Micrologix 1400 scan Array for logic HIGH

Hello everyone,
I have a Micrologix 1400 controller that connects to panelview 7 HMI.
There is a boolean bit array where various HMI alarm status has stored based on logic. What I want to do is that turn a output on when any variable become true in the array.
I cant use FSC instruction since its logix 500.
please note that there are multiple arrays with lots of variables. So I cant manually address them individually.
tag.png

array.png

Thank you.
 
How about b10:0 > 0 then if any bit is set to 1 you will know. You could cycle thru the B10 words to do all that are used.
Can you please elaborate. I'm looking for a way to cycle through them. I tried to use pulse generator and a counter for that but its not usable.
ladder.png
 
In rung 0002, change the EQU to GRT. Source A would be B10:[C5:1.ACC], Source B would be zero.

You may want to latch the alarm, since it will only be true until the counter cycles.
 
I don't have RSL500 & many years since I used it so this is how I would do it but you need to use the instructions you have in the ML1400
I will try to remember them.

One continuous loop per scan
MOV 0 Pointer // set the indirect pointer to 0 i.e. point to the first address in the array
RST Alarm_bit // reset the common alarm bit to 0 before checking
Loop: CMP Array[Pointer] > 0 Set Alarm_Bit JMP END // if the bit/word is true or > 0 then set the common alarm bit & jump to end as we have found one
InC Pointer //increment the pointer to the next array location
CMP Pointer > 1000 JMP END: // if end of array then jump out of loop
JMP Loop // if not jump back to check next
END: //this is where it jumps out if complete


Or you could just do it one part of the array per scan but an array of 1000 could require 1000 x scan time to complete and if only the last one was true it would take a couple of seconds before the Common alarm bit if this was just to display there is an alarm on HMI not really a problem.
Also a 1000 loop within one scan might timeout on the watchdog.
You could scan them say in blocks i.e. split the array into segments.
 
I don't have RSL500 & many years since I used it so this is how I would do it but you need to use the instructions you have in the ML1400
I will try to remember them.

One continuous loop per scan
MOV 0 Pointer // set the indirect pointer to 0 i.e. point to the first address in the array
RST Alarm_bit // reset the common alarm bit to 0 before checking
Loop: CMP Array[Pointer] > 0 Set Alarm_Bit JMP END // if the bit/word is true or > 0 then set the common alarm bit & jump to end as we have found one
InC Pointer //increment the pointer to the next array location
CMP Pointer > 1000 JMP END: // if end of array then jump out of loop
JMP Loop // if not jump back to check next
END: //this is where it jumps out if complete


Or you could just do it one part of the array per scan but an array of 1000 could require 1000 x scan time to complete and if only the last one was true it would take a couple of seconds before the Common alarm bit if this was just to display there is an alarm on HMI not really a problem.
Also a 1000 loop within one scan might timeout on the watchdog.
You could scan them say in blocks i.e. split the array into segments.
Thank you sir I will look into it.
 
You need to reset the bit at some point or once it is true it will stay true even if there are no alarms.
Also it looks like you would overrun the end of the array you have no check for the pointer.
here is a simple way but not in RSL
You could also skip out of the loop when the first instance of an alarm is found by jump to another label after the logic.

loop.png
 
You need to reset the bit at some point or once it is true it will stay true even if there are no alarms.
Also it looks like you would overrun the end of the array you have no check for the pointer.
here is a simple way but not in RSL
You could also skip out of the loop when the first instance of an alarm is found by jump to another label after the logic.
Thank you Sir.
 
Bits compose integers; the elements in a Binary Data File in RSLogix 500 can be treated like integers.

Each rung in the image below is a self-contained approach to this problem. The first three take advantage of the statement above and tests the bits with one or two Integer, or one Long, compares. The last checks the bits individually in a loop. The only issue with the first three approaches would be if the last six bits of B10:1 were being used for something other than these alarms; in that case you would need to mask them out, but it would still be simpler than the loop approach.

Untitled.png
​
 
Brian has nailed it (I Think only had a quick look at his logic, only comment is you could jump out of the loop on the first instance of a true bit, no need to carry on, this could be important if a large array.
 
I think @parky was right the first time. By trying to put it all on one rung, though correct, I made it more complicated than it needed to be. This is a little cleaner, and perhaps easier to grok.


There might be an even cleaner way, but there is always more than one way to skin a cat, and anyway the Integer/Long-based methods are better.

Untitled.png​
 

Similar Topics

I am trying to execute a logic on every first scan in MicroLogix 1400. I tried to use S:1/15 which is the default first scan bit in rslogix500...
6
Replies
6,202
Views
I have used the same set up a half dozen times, but I am missing something. Any help/ideas would be appreciated. Setup: I created both programs...
5
Replies
306
Views
I've reached out to a dozen different surplus companies in Canada and none of them would pay $250 for a used Micrologix 1400 1766-L32-BWA. I think...
2
Replies
414
Views
Hello, I am not able to get on-line with this MicroLogix PLC. I have in the past, with same ole XP Laptop with Physical Com Port. It has been...
8
Replies
431
Views
Hello! I have a project that requires my MicroLogix 1400 (RTU Slave) be able to place data, in an Integer File, for Modbus Register 47019. This...
4
Replies
470
Views
Top