Jump to content

Recommended Posts

Posted (edited)

So again I'm missing something really basic:

When I drag a TON timer function from the toolbox into a structured text window, I then fill in the variables within the parentheses.

Haven't figured out what I do with the TON at the beginning -- if I leave it as is or rename it, I get the error shown - undefined identifier.

The training manual I have says that an instance name must be defined, but what does that mean?

I've been able to use this in a ladder program, but can't figure out the ST syntax.

ST-TON.png

Edited by DonNH

Posted

Timers are function blocks which means they need dedicated memory to run and retain values for the next scan. You need to create an instance for said memory so it can be allocated.

In the variables at the top of your program make a variable for the timer of datatype TON:

 

Capture.PNG

Posted

Thanks.

I thought I had tried something like that, but apparently I missed part of it.

Always get caught up in the syntax details.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...