Pulse relay function in Simatic Manager

O

Thread Starter

Ollie

I'm trying to find a "clean" way of making a single input pulse relay function that toggles the output on each positive flank input. I would like to use this function x amount of times in the program.
I've already tried a number of ways and have it working successfully, but not without using individual memory bits or DB bits for the positive edge RLO memory.
Since I would like to use this function an undefined number of times, it would be nice not to have to add memory bits manually in the source function.
Is there a smart way to do this?

Thanks.
 
The cleanest way I've seen still requires two rungs because you must generate a positive edge trigger that goes away after one scan. IE a D flip flop has a clock and in the Allen Bradley world it would be the One Shot feature that gives you this edge trigger. The AB solution requires the Input Bit, Output Bit, ONE Shot bit, and the output of the oneshot bit to implement. So you would have to add 2 Bits of user memory.
 
Scan for the positive edge just once in the beginning of your program cycle. Save the result and use it as many times as you wish later during that cycle.

It takes 2 memory bits...
 
A

Andrew Hawdon

Hi

The way I implement this requires 1 memory bit.
Write and FC with the following input/Output declared


In_Out toggle bool

Then in the FC code the following

AN #toggle
= #toggle

Save the block and then call where you want to use it in the PLC program. On the EN input to the FC you require a one shot. The In_Out parameter toggle is were you can assign the output you wish to switch.

Andrew
 
If you are interested I can show You a way to call a subroutine with a number for the 2 bits. For example if You wanted to use the 21st "Set of bits" which would use the 42 and 43 bits in a series of predfined bits from a predefined Datablock containing maybe 2000 bits. This would alleviate some of the headaches for you maybe.
any way let me know if You are interested.

Brian
 
Top