Triggering recurrent action in CCW

MikeBriggs

Member
Join Date
Sep 2022
Location
Dover, NH
Posts
33
In Connected Components Workbench, using ladder logic, is there a relatively simple way to trigger something to happen repeatedly at a regular interval? In my case, I want to send some Modbus messages (reads) every 2 seconds. The CCW timers I'm familiar with all revolve around delaying an action from happening after some event (something becoming true or false) for some amount of time - but not for having it happen repeatedly every X seconds. I might be able to figure out some roundabout way of doing it with a pulse timer....

Thanks!
 
Even with a standard Delay on timer just use the not output on the input of the timer this will give you a pulse for one scan at the time interval you choose or if you need it on for longer seal a contact in from the timer then clear it when you have finished what you want to do.

AND NOT T4:0/DN [T4:0 2S]
T4:0/DN
------| |--------------On for one scan every 2 seconds
 
I want to send some Modbus messages (reads) every 2 seconds.


Do Micro8xx PLCs have a Real-Time Clock (typically a data structure or array of integers year, month of year, day of month, hour of day, minute of hour, second of minute)? Or maybe a seconds since the Epoch system DINT?


Because the low bit of the seconds integer will have a rising edge every 2s, and could trigger a Modbus message FB, although they probably should not do so unless the previous message execution has completed (success or error).
 
System Variable __SYSVA_CYCLEDATE is a timestamp, data type TIME, that gets updated at the beginning of each scan cycle.

It appears (cf. here) to be a running UDINT count of ms, probably since the Micro8xx was powered on and rolling over every three and a half fortnights or so.

Assuming that is true, __SYSVA_CYCLEDATE's bit 10 (value 1024) has a rising edge every 2048ms, accurate to a few ms. Is that close enough?

There is also __SYSVA_CYCLECNT, which counts scan cycles, so if the 2s target period is a round number, then that cycle count could also be used once you calibrate the scan time of your program, e.g. if the mean scan time is around 4ms, then bit 8 would have a rising edge every 2s or so.

Untitled.png
 
Whoopsie! I just remembered:

If this is Modbus TCP, then the MODBUS2LOCPARA structure already has timed repeating capability built in; cf. parameter TriggerType here.

Of course, being CCW, whether it actually works is whole 'nuther kettle of fish.
 
Even with a standard Delay on timer just use the not output on the input of the timer this will give you a pulse for one scan at the time interval you choose or if you need it on for longer seal a contact in from the timer then clear it when you have finished what you want to do.

AND NOT T4:0/DN [T4:0 2S]
T4:0/DN
------| |--------------On for one scan every 2 seconds


This video starting here is an example of what @parky is suggesting, which is the canonical way to implement a repeating timer.

Contrary to what that video says, the TON_1.Q bit does become 1 for 1 scan, starting at the completion of the TON instruction.
 

Similar Topics

Hi all. I am looking at a valve position which has been scaled for an operator HMI. The valve position is in 0-100% shown to the operator for...
Replies
6
Views
1,113
I have established communication with a sensor via ASCII protocol using the Micro-850 PLC. I have a program which writes to the sensor using an...
Replies
2
Views
1,868
In my lab we are using Controllogix plcs and RS 5000 for programming the PLCS. We have one PLC on a skid, and one PLC at our workbench and we...
Replies
3
Views
1,722
I am measuring level on 36 tanks and wanted to change the color of the tank on the screen as it was being filled or emptied to make it easy to...
Replies
10
Views
2,438
I am trying to add some new transactions to an existing working FactoryTalk transaction manager service (V10.20). One is triggered by a bit (bool)...
Replies
0
Views
2,639
Back
Top Bottom