M221 -> NB omron HMI comms

Congratulations on finding one of the many canonical ways to implement a flip flop!





That is almost certainly a misunderstanding of how the scan cycle works in digital PLCs. The canonical PLC paradigm of the power/current flowing from the high voltage on the left rail to the ground on the right rail can be useful, but it can also be misleading; specifically, left-to-right and then top-to-bottom represent time*, not voltage or current or power.


* or sequence, if you prefer.


Watch the first two or three videos in this playlist, which explain how a PLC scan cycle works; watch them repeatedly until you understand everything @Ron Beaufort says before he says it. Then come back and play your code in your head. Then play the code below in your head (it's much simpler).

Summary: only two of the rungs and two-thirds of the instructions are required; the timer is not required; see below (N.B. the Set and Reset instructions have been switched!). If this does not work, and give minimal delay, I'll shut up; the only thing that would cause this to fail is if the operator holds button for less than 100ms.

View attachment 61139








This should also work. Four different bits alternated on one network. (As coil is only writed once with word addressing it works, but Set / Reset more preferrable for bits.)


All other 10 different alternator can be finded from downloads section, Allen bradley and Lancie's example of alternators.


www.plcs.net/downloads/index.php?action=downloadfile&filename=ALTERNATOR%20METHODS.pdf&directory=Allen_Bradley&

alternator.jpg
 
Last edited:
Wow @Lare thats one effective and clean solution. Thank you sir I'm using it now and its working great.

Thank you everyone for teaching me some basics. I think this thread is now solved.
 
Wow @Lare thats one effective and clean solution. Thank you sir I'm using it now and its working great.

Thank you everyone for teaching me some basics. I think this thread is now solved.



Usually I maybe would use one of these as they are more easy to undestand.


I think that XOR instruction was added some years ago to M221.

Also rising edge detection block have only been couple years on M221.
Before these you needed to use temp coil with rising edge detection or temp bit and code your own rising edge without any built in inscructions. Several ways to do and shortest coding don't mean that is is easiest or best.
Several ways as allways on PLC coding and all have afterall same result.

alternator2.jpg
 
Last edited:
Nah, your (Lare's) one-shot feeding the XOR is the best: clean and easiest to understand; it functionally identical to my first post on this thread but with half the number of instructions and only one rung.

That XOR is sweet; it also makes the point that a [Normally Open] instruction (XIC in Allen-Bradley) is not a unary operator, but a binary operator i.e. a boolean AND.
 
That XOR is sweet; it also makes the point that a [Normally Open] instruction (XIC in Allen-Bradley) is not a unary operator, but a binary operator i.e. a boolean AND.


Yeah. Most of not thinking that when coding with ladder. I hate coding with STL as you need to think last binary result of earlier lines. Ladder and FBD are easier. (y)
 

Similar Topics

Hello All, I am stumped on how to convert a %MW to a %MF using Machine Expert Basic and a Modicon M221. The help files show a word to a double...
Replies
0
Views
31
Hello, I need to access the bits from the fire system control panel through RS-485. So, I used Read Var block to read from the panel...
Replies
0
Views
212
Hi, I am using M221 reading from 3 different sensors (modbus rs485) sharing same bus (daisy chain). I am currently using READ_VAR (in total...
Replies
0
Views
101
Hi, I am stuck with these SE cartridges, I am trying to add a second serial port rs485 to a M221 PLC. What is the difference between TMC2CONV01...
Replies
1
Views
124
I am having trouble running the application throught my PLC, tm221me32tk with magelis HMIGTO6310 I have prepared the plc programme, also created...
Replies
0
Views
125
Back
Top Bottom