DonNH Posted June 21, 2023 Report Posted June 21, 2023 (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. Edited June 21, 2023 by DonNH
photovoltaic Posted June 21, 2023 Report Posted June 21, 2023 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:
DonNH Posted June 21, 2023 Author Report Posted June 21, 2023 Thanks. I thought I had tried something like that, but apparently I missed part of it. Always get caught up in the syntax details.
photovoltaic Posted June 21, 2023 Report Posted June 21, 2023 You can also right-click on the name of the timer and register a new variable that way
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now