flashlights

it seems I can learn stuff even in the non posts.

Call a Function from OB32 set up for one second with the following code.

AN Q1.7
= Q1.7

Output 1.7 will be on for a second, off for a second and so on whilst the PLC runs.

I do exactly this to provide a watchdog output from the PLC. The output is either monitored by another PLC or by a low cost module usually used to detect stoppage or belt broken for a conveyor.

Seriously for a minute, Would the above code really be on for a full second or just one scan?

Then after a second OB32 comes on and does it again?

You could have 10 or 20 scans in a second or fewer depending on the code. But this OB32 runs once a second regardless, right?
 
What are we talking about, here?

Was the question really how to do an intermitence in Step7 and you want him to use cyclic OB, timers and things like that? Or I understand wrong?

If was it, cycle mark and it's done!
 
Seriously for a minute, Would the above code really be on for a full second or just one scan?

Then after a second OB32 comes on and does it again?

You could have 10 or 20 scans in a second or fewer depending on the code. But this OB32 runs once a second regardless, right?


OB32 is an interrupt OB. It runs once every few ms/secs, depending how you configure it. It only runs once in that time frame.

So if you don't have any other code that also writes to Q1.7, it'll flash at a 0.5Hz fequency. On for one sec, off for the next. This because the code making it change, only runs once every sec.

The answer to your question is: Yes.
 
Call a Function from OB32 set up for one second with the following code.

AN Q1.7
= Q1.7

Output 1.7 will be on for a second, off for a second and so on whilst the PLC runs.

I do exactly this to provide a watchdog output from the PLC. The output is either monitored by another PLC or by a low cost module usually used to detect stoppage or belt broken for a conveyor.

A shame wasting an interrupt OB for something like this.
The same can be achieved with the clock memory or even the OB1_time, the local variable in OB1.

Depending on whether you write directly to the PWQ in your OB32, there wouldn't be any differnce in the methods.
 
Back
Top Bottom