SIEMENS PLC S7 1200 TOF issue

1.5k views Asked by At

Let's say I have a Boolean input which can switch its state automatically. Swichting from 0 to 1 and from 1 to 0 sets a cycle. To determine if that cycle is valid, the cycle time must be at least 10 seconds.

I can determine if one semicicle is invalid, but I can't figure out how could to be able to determine at the end of the cycle if it has been invalid.

This is what I have:

enter image description here

1

There are 1 answers

0
Ira Baxter On

You seem to be saying if the status of the input signal is not stable for 10 seconds, you have an invalid cycle and you want to check for that.

To do that, you obviously need a timer triggered by each transition. (I'm not specifically familiar with your PLC but they're all pretty similar so I'll assume that's what you have, and you appropriately have two, triggered on different transitions.

The invalid transition condition for positive-transition is:

        positive_input_transition_timer_q and  not  input

That is, the timer must be running and the input must go to the wrong state.

Now, the input might spike low then go high again immediately; you probably don't want lose the fact that you had an invalid transition. So what you really want to do is latch the detection of invalid transition.

I'm not good at pretty ladder logic graphics so I'll write in old style:

   --+----[ ]----[TON]----+------[/]-----[/]------( )------
     |   Input  Positive  |     Unlatch  Input  Invalid
     |         Transition |     Invalid         Positive
     |                    |     Positive        Cycle
     +--------[]----------+     Cycle
            Invalid
            Positive
            Cycle

A corresponding ladder rung is needed for negative transition.

Presumably, some other bit of code will notice the InvalidPositive, respond appropriately, and then unlatch the condition.