Alternative PLC Logic

I would agree that the manually created sum function sounds like the best fit. The logic is short and clean, easy to understand.
I also agree with losing the tof instruction in favor of a sum.

It is not about experienced programmers or not. That instruction is one reason people get called into to work at 2 am, if your maintanance people don't understand it it will be the reason the machine don't work. Whether its the actual problem or not.


Drewcrew6
 
You may as well bite the bullet and do it the long way--because to start any other machine, you need to know specifically which one is running already. You're really gonna open a can of worms, here, because when they find out you can automatically start another machine, they're gonna want you to selectively start them based on "who knows how many wild and crazy conditions only management could think of". Wait till you gotta keep up with how many hours each machine has run on any day beginning with "T" or ending in "Y"--not in a leap year. But then you cross the international date line....
 
The 'tidbit' scenario

I'm unable to post an image of the ladder I worked up but, here's the mnemonic version for an A-B PLC-5/40. Mine is all one rung but I separated it here for readability.

MOV B3:0 TO N7:0 * Bits are copied to a work word
SUB 0 N7:0 N7:1
AND N7:0 N7:1 N7:1
XOR N7:0 N7:1 N7:0 * Least significant ON bit is reset

* Next rung or branch *

NEQ N7:0 0 OTE B3:1/0
 
Re: Excellent

Peter Nachtwey said:
Doug_P has the answer I was looking for.

Only because Doug_P, not trusting his three (or is it four?) organic memory cells to retain this from the original thread, copied it into his offline storage, AKA "little book o' knowledge". ;^)
 
Sorry Peter,


Didn't mean to disapoint you. :rolleyes: As I was reading it this morning I knew exactly what are you after. I just wasn't following the tread at the time. It looks like some of you guys don't get any sleep (posts timestamped 1AM, 5AM...). zzzzz
 
The only goal was to share some 'Alternative Logix'

This Tidbit was appropriate for this thread. It definately requires programming 'outside the box'.

Doug_P's solution still required modifying a known trick. Actually the trick is very old and it can be found by searching the internet. This 'Tidbit' is just new here. Panic Mode, I am not a professor or Yoda giving grades. :)

BTW, I am using Tidbit as a key word so that one can easily find these related posts later.
 
Post # 19 followup

It occurred to me that the logic shown in the post mentioned could be marginally speeded up. Replace the last branch/rung combination

NEQ N7:0 0 OTE B3:1/0

with this one:

XIO S:0/2 OTE B3:1/0 * State of processor arithmetic zero flag controls output

Although simpler logic wise, this approach is a bit more cryptic understanding wise. What happens is that the XOR conditions the arithmetic flags, which can then be used for comparison tests. The flag of interest here is the 'Z' flag - which will be set if the result of the XOR into N7:0 is zero. If this is used, be sure that no other instructions which condition the processor arithmetic flags exist between the final XOR and the zero flag test.
 

Similar Topics

Greetings All, I recently decided to start freelancing in Controls and Automation part time, most of my experience has been with Rockwell...
Replies
2
Views
162
Hi everyone, I'm pretty new to PLC's in general, and working on a project where I have to get familiar with the PLC compilation process...
Replies
5
Views
4,566
Hi Guys, Does anyone know of an virtual PLC similar to RS Emulate. I need one for testing programs created for AB and general training. The RS...
Replies
5
Views
2,601
Hello all, Has anyone tried a more economical alternative to the 9300 RADES (Allen Bradley PLC modem)? Thank you!
Replies
4
Views
2,749
Hello to all, I'm just starting with using CodeSys. Immediately, I have noticed that Codesys doesn't use data blocks like for example S7 does...
Replies
11
Views
146
Back
Top Bottom