What does this mean?

Frelecing

Member
Join Date
Oct 2010
Location
Uruguay
Posts
73
I'm looking at a ladder code from a PLC5/20 and there is an instruction I don't understand:

It's a FAL block that goes like this:

Control-------R6:0
Lenght--------20
Position------0
Mode----------ALL
Dest----------#N22:80
Expression----(- 1) OR #N22:80

What does it mean to make an OR instruction with -1???

Thanks.
 
regarding your specific question:

What does it mean to make an OR instruction with -1???

in simplest terms, the FAL instruction that you've described is just writing the value/status of ONE to all of the bits in the words N22:80 to N22:99 ...

note that the value -1 (in decimal) translates to "all bits turned ON" (in binary) ...

now WHY the programmer did it this way is open for conjecture - but since "any ONE gives a ONE" in an OR statement, then the use of #N22:80 in the expression is superfluous ... specifically, the -1 operator is going to overwrite anything in words N22:80 through N22:99 anyway ...

just a guess: maybe he wanted this FAL to have a consistent appearance/construction to other FALs in the program ...

do you need more help than that? ... if so, tell us where it hurts ...

tip: instructions like this are typically used in setting up "alarm functions" ... specifically, OR, AND, and XOR operations are commonly used to track ideas such as "existing alarms" and "new alarms" and "acknowledged alarms" ...

.

forno_or.PNG
 
Last edited:
Thanks Ron! Second lifejacket you throw me this week! You're my personal hero ;-)

I couldn't understand what making for example an OR between 1 OR -1, or 0 OR -1, would result in. But it's precisely what you said in the tip, this arrays are used for acknowledge/reset alarm states.

Thanks again!
 
Ron Beaufort said:
just a guess: maybe he wanted this FAL to have a consistent appearance/construction to other FALs in the program ...

I bet you're right. That kind of programming always aggravates me, putting form over function. How much simpler would it have been to just FLL -1 #N22:80 20?

K.I.S.S.

I'm guessing that this FAL was the "acknowledge all" instruction, i.e. a "0=Alarm" setup?
 
Last edited:

Similar Topics

The picture attached relates to the properties for the F9 key. Does anyone know what 'object number' refers to? What does 'object number' mean...
Replies
4
Views
708
I have used plenty of Fx 3U's but this is the first I have ever seen the ES-A. I can't find any refrence to it in any Mitsubishi literature. Looks...
Replies
6
Views
2,292
When I do a search of used devices (typically, to find a spare one I can use), this table appears, but I don't understand what "unpaired" means or...
Replies
7
Views
1,374
When I press F4 to convert the code, I get this message. What does it mean? Thanks
Replies
11
Views
2,540
Back
Top Bottom