Toggle 2 bits with one tag or in Wonderware

No other way than scripting it..
Assume your using SP (based on previous posts..)

Perhaps cleanest way is to have a data change script, then to the toggle in the script, with last line making the second tag = the first.

But, as we seem to miss often, why the need to toggle 2x tags. ??
 
Action script on button up..
Bit 1 = 1
Bit 2 = 2

Was I nuts on this...."Bit2 = 2"????

This is better route:
**********
If Bit 1 =1 THEN
Bit 1 = 0
Bit 2 = 1;

ELSE
IF Bit 1 = 0 THEN
Bit 1 = 1
Bit 2 = 0;
ENDIF;
ENDIF;
**********

This is a simple button script...
Is there a reason not use a script?
 
What do you do if both bits in plc = 0 or 1?
Both will just be inverted.

Maybe code should be:

IF <button> THEN

BIT1:= 1;
BIT2:= 0;

ELSE

BIT1:= 0;
BIT2:= 1;

END_IF
Now you are just setting bit 1 high as long as you keep the button pressed, and bit 2 high when you release it, what's the point of that?

Am I missing something or isn't it just a question of toggling two bits from one command?
 
What do you do if both bits in plc = 0 or 1?

That script would invert the two bits regardless of their original state. I understood the OP to be asking how to toggle two bits at once. I never got the impression that the OP wanted the two bits in question to always maintain opposite states.
 
Now you are just setting bit 1 high as long as you keep the button pressed, and bit 2 high when you release it, what's the point of that?

Am I missing something or isn't it just a question of toggling two bits from one command?

Yeah, you are right with this. Sorry
 

Similar Topics

logix designer 5000 v21 to 32 trying to toggle input on bit will not turn on and the date table will not receive a 1. This CLX PLCv21 is in rack...
Replies
6
Views
2,433
I have a graphic that has 2 buttons for Automatic and Manual, each with pushbutton animations associated with them to toggle a bit in the PLC, one...
Replies
8
Views
2,502
I wrote a program for our Weintek HMI to connect to our Mitsubishi PLC I used two toggle switches for the start buttons but couldn't get the HMI...
Replies
19
Views
4,869
I used to be able to do this. We have a filling machine with an SLC 5/04 in it connected to a PV1000. I have connected to it recently to do some...
Replies
11
Views
6,136
Im using InTouch 10.1.3 with UnityPro XL V6.0. Can I have an example how this is achieved? this is what i've tried to do in quickscript and...
Replies
3
Views
3,971
Back
Top Bottom