1

I was looking for a way to detect falling edges and I encounter two ways:

|--XIO---ONS------------OTE--|

and

|--XIC------------------OSF--|

|--OSF.OB---------------OTE--|

My colleagues told me that the 1st way is better, mainly cause you save one tag (being the storage bit). My question is why does the OSF need a storage bit and are those two methods equivalent ?

2 Answers2

1

This is for Rockwell/Allen-Bradley PLCs, which use all of those instructions.

For those who don't know:

  • XIC = Examine If Closed. This is a normally open contact. --| |--
  • XIO = Examine If Open. This is a normally-closed contact. --|/|--
  • ONS = One-shot contact. This instruction does require a storage BOOL.
  • OTE = Output Enable. This is a regular coil.
  • OSF = One-shot Falling Edge. This is an output instruction that is on for one scan on the falling edge of the input.

Both of your methods accomplish the same thing: When the input bit (either the XIC or XIO) goes from high to low, the output bit (the OTE) will be high for one scan.

Here is what they look like in Studio5000:

screenshot of OP's program

As you can see, Method B requires one more BOOL tag (oneshot_output_method_B) than Method A does.

You might also notice that in the Method B logic, "oneshot_output_method_B" is really equivalent to "output_method_B". One of these tags is unnecessary.

The performance difference between the two is most likely negligible. You should choose the method that is easiest to read and understand, both for you and for anyone that needs to see your program in the future.

0

I don't know what those OSF,XIO,...meana, through I do ladder PLC more than 20 years. So, falling edge:

Out = /IN & flag
flag = IN

   IN    flag    out
--|/|----| |----()

  IN            flag
--| |-----------()

No matter what system functions on falling edge is, it does the same calculation behind, so that's why you need store one aux variable - flag.

Marko Buršič
  • 23,562
  • 2
  • 20
  • 33