Writing address of variables

anoop6543

Member
Join Date
Jul 2015
Location
Rolla
Posts
7
Can we write Address of Outputs in PLC memory, I am using WAGO PLC 750-881 and Codesys V2.3 software to program the PLC.

Basically i need to change Hardware address of an Output based on a selection. I have nine outputs of which i select one output for one sequence and another output for another sequence.

In my program i need to use a single variable which can be assigned with address of either of 9 variables depending on My selection.

I saw reading an address , but couldn't find much info on writing address.
 
Is there any reason you can't just use an intermediate variable in the middle, and then choose what working variable you assign it to?

For example:

Code:
IF (sequence1) THEN
     output = alpha;
ELSIF (sequence2) THEN
     output = beta;
ELSE
     output = gamma;
END_IF

If I remember correctly, you may be able to directly assign outputs to variables with syntax something like %QX0.0. Intermediate variables seems much easier though.
 
So you have 9 signals, one of which is true, then you write to the according output?

Sounds like either an if-elsif-else function or case function?
D:=B*B;
IF D<0.0 THEN
C:=A;
ELSIF D=0.0 THEN
C:=B;
ELSE
C:=D;
END_IF;


CASE INT1 OF
1: BOOL1 := TRUE;
2: BOOL2 := TRUE;
ELSE
BOOL1 := FALSE;
BOOL2 := FALSE;
END_CASE;

Keep in mind that you have to write 0, or whatever to the outputs you are not writing to. Not an expert in CodeSYS, but I think if you not explicitly overwrite your output, it will retain it's last.
 
Last edited:
Output 1 address is %Qx0.0
Output 2 address is %Qx0.1
.
.
.
.
Output 9 address is %Qx0.8

I have a variable namely Sample_Output.

My sample_output should be assigned with the address of either of 9 Outputs i mentioned above depending on my selection initially. I have a button which is clicked to select which output should be assigned on every particular sequence. I need to do this since when i write my Sample_Output in program it should reflect in the selected output from the list, Output is a valve in Real Time.

Hope you got my point.
 

Similar Topics

Hi, I am designing an HMI with Workbench for a Micro1400 PLC. I have a PLC variable that manages the "states" depending on the integer value of...
Replies
1
Views
1,252
Hi, I’m having problems using an UDP connection, especially regarding how to put in registers Nx:4 and Nx:5 IP address to write my message...
Replies
7
Views
2,068
my serial connection isnt working so i want to use ethernet. However, i dont know the IP address so i cant configure the driver. help?
Replies
2
Views
1,913
Dear Expert Can we use this instruction successfully in Siemens s7-300 plc L db10.dbd0 //data from DB T PID 256 //to spare peripheral input...
Replies
4
Views
3,167
Hello All: I have a Windows 10 PC running a FTView ME Station 10.00. I have a .mer file version 6.00. It has been running well on it for a long...
Replies
1
Views
127
Back
Top Bottom