PLC5 Help...AFI..OTE keeps flashing

BeepBob

Member
Join Date
Jan 2023
Location
Oakland, CA
Posts
107
Hello all,

For the life of me I cant understand why this output (B3:1/11) keeps on flickering on and off.. I have an AFI in front of the rung too.


This is the only occurrence of this this bit in the code...

pic.jpg
 
Something is writing to it (most likely).

Check for usage at the word level.

Check for indirect addressing.

Check for the presence of a device on a communication channel.

There is also the very remote possibility that your PC is showing erratic info and the bit isn't really flickering. I've only seen that once or twice in nearly 30 years. You can rule that out by tying that bit to a counter.
 
I think I see the issue...


There is COP instruction that is writing to the WORD



Can someone show me a way to not energize that bit 3:1/11 without having to remove that COP instruction?

Screenshot 2023-04-01 184015.jpg
 
Last edited:
Something is writing to it (most likely).

Check for usage at the word level.

Check for indirect addressing.

Check for the presence of a device on a communication channel.

There is also the very remote possibility that your PC is showing erratic info and the bit isn't really flickering. I've only seen that once or twice in nearly 30 years. You can rule that out by tying that bit to a counter.


What he said.
Note that the PC will be showing the status of each bit as it knows it, which is their status at the end of the program scan. If you see flickering on the display, and it's not a weird random relic that I've never seen but OkiePC has, then add a rung right after this one that's just XIC B3:1/11 CTU Cx:y, where x and y address an unused counter. Then, I'd add a rung at the end of LAD 2 that's identical except it uses a different Cx:y address. For both counters, set the preset to some large-ish number.


edit: I see you found something and posted as I was posting...
 
Can you show a screenshot of the COP instructions?



You may know this already, but note that the AFI instruction doesn't disable the rung, it just makes the logic status of its branch is 0, which will write a 0 to the target of an OTE instruction downstream of it. AFI: Always False Instruction
 
Can you show a screenshot of the COP instructions?



You may know this already, but note that the AFI instruction doesn't disable the rung, it just makes the logic status of its branch is 0, which will write a 0 to the target of an OTE instruction downstream of it. AFI: Always False Instruction


This is the COP instruction

Screenshot 2023-04-01_2.jpg
 
Basically I just want bit B3:1/9 to not be energize...but the COP instruction writes to the B3:1 Word...I tried to delete the OTE of B3:1/12 , cross reference only shows the COP instruction and the rung in the attached picture...

Also, the COP instruction only specify a length of 7 , so I am assuming bit 0-6 of Word 1 ....but bit 12 is still being energized...I must have an incorrect asumption.

Screenshot 2023-04-01_3.jpg
 
Last edited:
Also, the COP instruction only specify a length of 7 , so I am assuming bit 0-6 of Word 1 ....but bit 12 is still being energized...I must have an incorrect asumption.
Indeed. The COP does not deal with individual bits, the 'length' operand is in whatever element the destination has.

B3:1 is a word, so the COP shown will copy 7 words starting with the addresses specified. Everything from B3:1/0 to B3:7/15 will be overwritten in this case whenever the COP instruction runs.
 
Indeed. The COP does not deal with individual bits, the 'length' operand is in whatever element the destination has.

B3:1 is a word, so the COP shown will copy 7 words starting with the addresses specified. Everything from B3:1/0 to B3:7/15 will be overwritten in this case whenever the COP instruction runs.


Oh man I missed by a mile....thank you!

Any idea on how to achieve Bit B3:1/9 to not be energized?
 
You can put an OTU B3:1/9 or 11 right after the COP instruction, on the very next rung or even a branch on the same rung. This will clear the bit for the entire rest of the scan. It is possible to still see flicker but just remember what you are seeing is the value of the bit when the PC requests an update of the bit. The bit should only be true after the COP and before your new OTU. This will be a very short period of time.
 
You can put an OTU B3:1/9 or 11 right after the COP instruction, on the very next rung or even a branch on the same rung. This will clear the bit for the entire rest of the scan. It is possible to still see flicker but just remember what you are seeing is the value of the bit when the PC requests an update of the bit. The bit should only be true after the COP and before your new OTU. This will be a very short period of time.


I'll give this a try, thank you!
 
What cross references to N11:8/9? The COP is sending that bit of an integer to B3:1/9. Or in your earlier post, N11:8/11 is written to B3:1/11.

If you have the XIC I:011/10 and other stuff to OTE B3:1/9 in post #7 active and also the COP in post #6 active, you have two pieces of code fighting each other. A search term to help understand that is "duplicate destructive bits".
 
Last edited:
I think I figured out why I mess up. There are two PLC5, Primary and Secondary. When a PLC is in Primary mode, it writes its data table using BTW to the Secondary, the Secondary PLC , in Secondary mode uses BTR to update its data table using the COP instruction. For some reason, most likely my fault, when I started work the PLC i was working with was in Primary mode, then when I started having issue, I failed to see that it jumped to Secondary mode and the other jump to Primary. So I was connected to a PLC that was by designed updating its data table from the Primary PLC

sigh i must have screwed up when there was a power cycle. Oh well at least now I know things are working as designed.
 

Similar Topics

Hi, can anyone help me get a pdf file for this RSP files. They are from a PLC5. Thanks
Replies
5
Views
526
I have a PLC5/80E that I want to poll a Modbus device into using a Digi1. I have setup the message as a multihop going to the IP adress of the...
Replies
2
Views
1,437
Years ago, we had a PLC-5 here running some "Supervisory" Utilities Logic. It had (still has) a Wonderware front-end. It was reading multiple...
Replies
12
Views
3,626
I have a PLC5/40E that I need to change the IP address of. I have changed it multiple times and it keeps returning to the original address. I...
Replies
7
Views
1,905
I am upgrading an existing PLC5 program to controllogix (L73 V23). For my question I will only use the logic for my CH1 on my 1771-IFE/C...
Replies
7
Views
2,805
Back
Top Bottom