Anyone who knows Codesys?

kassi

Member
Join Date
Oct 2016
Location
austria
Posts
6
Hello everyone i m using codesys with wago modules,i have 1 output module and i give power with cables to input(8 output,8 input)i try to make a app to read which output going to which input for example output1->input4,output2->input3 but when i put 3rd output then confuse inputs and i can get right result
 
if output1=input1 then
Output1conn :=1;
elsif
output1=input2 THEN
Output1conn:= 2;
elsif
output1=Input3 THEN ;
Output1conn:= 3;
....
IF output2 = input1 THEN
Output2conn :=1;
ELSIF output2 = input2 THEN ;
Output2conn:= 2;
ELSIF output2=input3 THEN ;
Output2conn:=3;
....
this is an example of my code,i use var outputconn and i put numbers so if is true then outputconn shows me the number of input (for example output1=input3 then output1conn =3),this works fine only with 2 outputs when i open 3rd output in my programm then it takes the value of my first output...(i hope understand what im trying to do)
 
You could copy the inputs to the bits in a byte and then monitoring its value to establish which Inputs are on.

Input1 := TestByte.1;
Input2 := TestByte.2:
Input3 := TestByte.3;

You then know if TestByte is 1 then input 1 is on only.

etc etc

Is this what your trying to achieve.
 
thank you very much for your time and your answer...i found the solution yesterday,i insert a time delay and everything works fine...it was running so fast on module and codesys couldnt write the values...anyway thank you for your time to my problem
 
the program is fast enough, but the inputs have a time delay in them.
see the manual of the module.
when you use diodes in the lines you can use a matrix so you can scan more possibilities.
 
thank you again for your time its my first time on codesys so i listen everyone who advises me,if you can be more specificate i will be glad
 
well the program does exactly what you write, however the modules have a time delay, see on the side of them there is a ms time on them., like an AC input needs 10 ms to get on, as it needs a filter for the waveform.
same for outputs.
A PLC program first scans all inputs and put these in registers, then the PLC_PRG starts and all progs are run.
at the end all outputs are set according to the last setting they got.
when you output to the same variable twice, be aware of not certain settings.
 
If you have time i will be glad to sent you my code and tell me your opinion as i said its my first time with codesys
 

Similar Topics

Hi. Do anyone know if there are exist any supplier of ready-to-use load-cell and display units, calibrated with certificate and all ? I have...
Replies
11
Views
3,321
Does anyone knows how to upload code from a G&L Electronic, PiC0 controller? It has an ethernet port for comm. What kind of software would I...
Replies
2
Views
1,381
Hi all - I have a project where I will replace a GE Fanuc PLC, with Allen Bradley hardware. This PLC looks very old and I do not know much about...
Replies
8
Views
4,009
Apologies for abusing this forum for this, but I am running out of options. Has anyone contacted Comptrol Technologies Inc (Burlington, Ontario)...
Replies
5
Views
3,578
Replies
8
Views
2,238
Back
Top Bottom