TwinCat2 TON no way to override the elapsed time?

g.mccormick

Lifetime Supporting Member
Join Date
Jul 2012
Location
IN
Posts
961
I have some code that is going to trigger calculations to happen either when "A" happens, or every 1 second.

For the 1second trigger, I am using a TON.

When the "A" happens, I wanted to reset the 1second timer so that the calculations don't happen twice (ie. one scan due to A then next scan due to 1secondtimer.Q).


Is forcing the .ET not allowed?
 
Couldn't you just use the A condition in a NC contact instruction to enable the TON. TON will run if A is not on, A turning on turn the NC A instruction off and will disable and reset the TON instruction?

I know nothing about TwinCAT but seems like this would work on the platforms that I know.
 
I just added more logic into the enable

Tmr_TimeSinceCalc(IN:= ( NOT Trigger_Bool AND NOT Tmr_TimeSinceCalc.Q) , PT:=T#1s );

The Trigger_Bool is always set to FALSE at the start of the scan, then if "A" happens it is set to TRUE. This is all ahead of the timer in the code.

I was just surprised that I could not just simply set ET to 0 like I can/do in other PLCs.
 

Similar Topics

Hi All, I have to connect a slave (Digiforce 9311) to EtherNET/IP scanner (EL6652). The EDS file informations must be transfered into IO...
Replies
0
Views
357
I have 10 years expereience about programming TwinCAT2 PLC. However, there is still one thing that I can't find a best solution about updating the...
Replies
0
Views
798
Ok so probably a really dumb question. How do I do set a variable equal to a value in ladder? I can't seem to find a ':=' equivalent in ladder...
Replies
1
Views
1,319
I am needing to convert the low DWORD of a timestamp into a LREAL. The DWORD is a 32bit unsigned number. In TwinCat2, I keep getting a negative...
Replies
3
Views
1,684
I am trying to get a floating point value into a CX8090 via modbus. The value is being read, but I cannot seem to get it to convert correctly...
Replies
7
Views
2,607
Back
Top Bottom