RSLogix500 firing input from a binary bit

bob12

Member
Join Date
May 2022
Location
Here
Posts
9
So here's my situation, I have been tasked with modifying the logic to mimic a button press in the PLC. I have two identical machines however one has a CLX PLC and one has a SLC, on the CLX side it's a no brainer because mapping was used, so my button press logic will just go in parallel with the physical input. On the SLC side that's not the case. The physical input is used in over 20+ places. Rather than have to branch around each physical input I believe I have found a workaround and wanted to get advise before putting this in production. I have tested this on a micrologix. The rung has I:0/0 as an XIC bit and an OTE coil, I then branch around the XIC with another XIC using my binary bit. In testing, pressing the button turns on the input and releasing the button turns it back off and turning on the binary bit also turns on that input, turning off the binary bit turns off the input. It seems to work just fine but is it legal? I have direct connect and plan to call Rockwell but I also value everyone's opinions as well. I can't be the only one who has had to do something like this. Is it common practice? Can I get myself into a situation where this will come back to bite me? I'm going to try to attach a picture of my logic.

logic.PNG
 
So I:0/0 is a memory location in the PLC connected to a physical input. That means that it's written to between every scan of the logic in the 500 world and at the module's RPI in the 5000 world. In the 5000 world, the IO update can happen between scans, mid-scan, multiple times during a scan, or after several scans, whenever the RPI says it should. While you can certainly write to the physical input's memory location, doing so is likely to cause confusion in the future when someone (you in a few years after you've forgotten it?) is troubleshooting and sees that the code is working as if I:0/0 is on while it's physical device is off.


If I were you, and I wanted B3:0/1 to work in parallel with the physical input, I would either replace I:0/0 in the code with another unused B3:x/y bit that would then be written to by either B3:0/1 OR I:0/0 like you're writing to I:0/0 in your screenshot or put B:0/1 in parallel with I:0/0 everywhere it's used.


Edit to add:
If you really want to write to I:0/0 that way, make sure that it happens first in the program scan so that I:0/0 is the same value throughout the scan.
 
Interesting. This is not something I have done, but I think it could work on a SLC or PLC5 since they have IO scan synchronized with the program scan. So the processor scans the IO, sets the input bit, and then scans the logic. So I think your B3:0/1 will just override that to turn on the input bit.

This would NOT work in a contrologix since it is non-synchronous.

So I think it should work. I'd be sure to document that well, because the next guy is gonna say "what the....."

EDIT: personally, I would add that to the 20+ places in the code.
 
So here's my situation, I have been tasked with modifying the logic to mimic a button press in the PLC.
You want an in-PLC emulator of some or all of the process. That is a great way to test things out. I, and I am sure many others, do this or something similar all the time.
I have two identical machines however one has a CLX PLC and one has a SLC, on the CLX side it's a no brainer because mapping was used, so my button press logic will just go in parallel with the physical input. On the SLC side that's not the case.
There is a reason the CLX program is like that: I/O is asynchronous, which means I:0.0/1 (or its equivalent in CLX, Local:I...) can change at any time, even during the program scan. I find it kind of funny that this asynchronous "feature" of CLX is most often the first thing overridden by an input map routine when writing a new program.

The physical input is used in over 20+ places. Rather than have to branch around each physical input I believe I have found a workaround and wanted to get advise before putting this in production. I have tested this on a micrologix. The rung has I:0/0 as an XIC bit and an OTE coil, I then branch around the XIC with another XIC using my binary bit. In testing, pressing the button turns on the input and releasing the button turns it back off and turning on the binary bit also turns on that input, turning off the binary bit turns off the input. It seems to work just fine but is it legal?
Define "legal." :ROFLMAO:

It takes advantage of how the PLC actually works, so it's definitely a hack, but I still say it is legal. @Ron Beaufort's bootcamp videos use that same technique to make the point that the user's PLC program does not read external physical inputs and write external physical outputs directly, rather the program directly reads and writes bits in PLC internal memory that the PLC operating system connect to the external physical IO.
Can I get myself into a situation where this will come back to bite me?
lol.gif
I assume that is a rhetorical question
wink.gif
.

The most important thing is to add a clear and concise comment to such a rung.

Another thing to consider is whether or not you should ensure the PLC outputs are in a safe state if the Emulate_Mode bit (see next section) is actively overriding the inputs. If you are only trying to override this one input in the actual process, then that is on you; but if this is part of a full blown process emulation (see next section), then it might be wise to ensure an accidental trip of this override bit never effects chaos on the actual process.

Is it common practice?
For me, and probably many others, yes. In fact, it is often the reason for having an otherwise unnecessary input mapping routine in synchronous PLCs like SLC, MicroLogix, etc., which routines are often required for operational reasons in asynchronous PLCs like CLX.

Also note that doing this is roughly equivalent to using a "Force."

Note that more generally you could do
XIC B3:99/15 MOV B3:0.0 I:0.0
to have that emulate mode bit (B3:99/15) trigger emulating a full word's worth of input memory locations from that B3:0.0 word via a single rung; I did something very similar recently, and also added code to emulate the process i.e. to have the bits of word B3:0.0, and thus I:0.0, driven by logic that simulated the process, so could I test my process-controlling logic without the physical process.

The code shown in Post #1 assumes the normal situation in mimic/emulator mode is that the input value is 0; that may not be the actual case. So I would add another global bit called EMULATE_MODE, which chooses which source to use to write the input value used downstream of this rung.
logic_drbitboy.png
 
This isn't going to work reliably.

Search and replace all the accesses of the input bit with a memory location (e.g.: B3:10.0) and then use your code but with the OTE replaced with B3:10.0
 
Find the 20 places in logic, and add in your new button press in parallel. It doesn't take that long with online edits.

Think about when anyone aside from you has to troubleshoot that. Why isn't this input turning on? The program is using an input on an output coil?!?! I could see a senior guy roasting ya with it if a line was down over that sensor.

IMHO your logic should be as clear to read as possible. I try to avoid finessed code.. but I've had 12 years worth on mid night calls and drives to the plant.

=-), Just remember, "I told ya so".
 

Similar Topics

Hello, I'm new to programming. I'm using RSLogix500 to modify an existing program for a SLC500. My plan was to use one of the existing inputs...
Replies
26
Views
1,986
So i have an allen bradley rack (2080-LC50-24QWB), i have it connected through ethernet. I dont have an offline program so im trying to upload...
Replies
6
Views
682
Hi Everyone, I am supporting a system which runs on a SLC 500 (1747-L532). A fault has developed whereby the output state of some digital outputs...
Replies
10
Views
1,000
Hello, I am currently taking a course on plc programming and in the course rslogix 500 is being used. I am however having a problem since it keeps...
Replies
4
Views
1,703
Hello experts, I am just starting with AB programing, I have a questions regarding a compare done in an old RSlogix500 and causing me issues when...
Replies
5
Views
1,941
Back
Top Bottom