Scan time.
Hi,
I'm trying to figure out what's the scan time for one of my programs in my project. Is there any tool to see that or any idea about the best way to calculate it? In AB you have a built-in tool to see that. I triggered a TON at the beginning of my program and then assign a time variable with the elapsed time of the TON but was not able to see this value in ms or ns, the value shown is 0s.
Thanks,
I'm trying to figure out what's the scan time for one of my programs in my project. Is there any tool to see that or any idea about the best way to calculate it? In AB you have a built-in tool to see that. I triggered a TON at the beginning of my program and then assign a time variable with the elapsed time of the TON but was not able to see this value in ms or ns, the value shown is 0s.
Thanks,
Comments
Your program instance will be running in a task. If that task is a cyclic task, then the scan time is the task interval that you set in PLCnext Engineer. If it is the idle task, then the task runs whenever it can, at a lower priority than all the other tasks.
The actual execution time of a task - ie the total time to execute all the program instances in that task - can be seen in a global variable (I'm on my phone so don't have the variable name to hand). This global variable shows the maximum, minimum and most recent execution times for each task on each ESM (core).
For the TON question - I assume you are triggering this by setting the input to TRUE? What is the value of the preset time that you are passing to this timer? The value of the elapsed time should increase every time the TON block is executed, so long as the input is TRUE and the elapsed time is less than the preset time.
1) How can I see that real value?
2) if you have three code worksheets in a program, which one get executed first?
3) Could you provide me the name of the global variable you talked before? .
Thanks,
1) Unfortunately I can't see that picture. Here is an example of a TON timer, showing the Elapsed Time while the timer is running. This variable has the data type TIME, which is a 32 bit signed integer representing a whole number of milliseconds. I am not sure how you want to use this value.
2) Code sheets are executed in the order they appear in PLCnext Engineer. You can change the order of the sheets by dragging a code sheet left or right.
3) Here is a screen shot showing the global variable in the Watch window, expanded to show the live data from Task 1 on ESM 1. The duration values are in microseconds. In this case the task interval is 100ms and the execution durations - the time taken to execute all the program instances in that task - is between 41 and 94 µs.