IAI SEL Software: How can I turn on a bit based on the value of a variable?

gbradley

Lifetime Supporting Member
Join Date
Apr 2002
Location
Corona, Ca.
Posts
1,637
I would like to turn on a bit with IAI software based on the value of a variable.
I can do it with one CPEQ statement. It works great.
I just need to be able to add some kind of or, or branch in order to be able to also turn off the bit if the variable is another value or two.

It's a simple little program that moves to a position,flashes a light, then moves to the next position, flashes a light etc…

I don't want the light to flash at position 4, so I put a CPEQ 10,4,901, and then on the bton for the light, I put a N901 condition.

I would also like the light to not turn on if the variable is 2, or if the variable is 3, or if the variable is 7.

I just don't know how to branch it so that I can also turn on bit 901 if the value of the variable is 2, or 4, or 3, or 7.

I tried putting the same line of code with an O, but the process halted and I got an error.




,,,LET,10,1,,

,,,WTON,7,,,

,,,TAG,2,,,

,,,CPEQ,10,4,901,

,,,MOVL,*10,,,

,,,CPEQ,10,248,900,

,,,ADD,10,1,,

,N,901,BTON,305,,,

,,,TIMW,0.5,,,

,,,BTOF,305,,,

,N,900,GOTO,2,,,

CPEQ.jpg
 
I figured it out.
I put a N, 901 before testing the other values, that way it would ignore if the bit had already been turned on.
,,,CPEQ,10,2,901,
,N,901,CPEQ,10,3,901,
,N,901,CPEQ,10,4,901,
,N,901,CPEQ,10,7,901,
 

Similar Topics

Hello, I'm Ryan, I'm new to this site and thought I would try It out so here's my question. Can the IAI MSEL controller understand a Allen...
Replies
5
Views
3,433
I'm adding an IAI Gateway with 2 axes connected to it. To an ethernet network on my PLC. So, I think the math is correct on the Input and Output...
Replies
0
Views
148
Hi All, Can I get help with the following Invalid Input Size Fault displayed in Studio 5000. Allen Bradley: Studio 5000 V33 CompactLogix...
Replies
1
Views
1,427
I have a IAI robo cylinder controller MSEP module that I need to change the IP address in. I have the parameter software from IAI, and i am able...
Replies
0
Views
1,088
Hello, 1. How do I setup IAI MCON IP address for Profinet connection to Siemens S7 CPU1511? 2. I had setup name and IP address for the MCON...
Replies
2
Views
3,515
Back
Top Bottom