Micrologix 1400 scan Array for logic HIGH

psycho1o1

Member
Join Date
Nov 2021
Location
Kaduwela
Posts
49
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.
 
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.
 
lol!
Sounded like student and homework.
Since you are more familiar with 5000 and FSC. Show us how you do it with 5000.
 
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...
Replies
6
Views
4,870
Hey all, first time poster here. I am wondering if anyone has tried using a Keyence SR-X300 barcode scanner to a Micrologix 1400. Keyence sent...
Replies
0
Views
36
I'm using a SLC typed write from the ControlLogix5572 to the MicroLogix 1400, with path: 2, (MicroLogix IP). The ControlLogix equipment has a...
Replies
0
Views
99
Hi, I am working with a Micrologix 1400 model 1766-L32BXB. With no input wires connected to the “in12” thru “in19”, I am getting 24 volts while...
Replies
4
Views
224
Hi everyone, I hope I don't butcher this up, please feel free to critique me wherever if I do, I have an issue I would equate to "chasing...
Replies
4
Views
306
Back
Top Bottom