K
Jiri,
This is from the VLC help file:
*******************************
In the VLC Control Designer, you use timers by creating a timer tag. You then use the timer tag name in combination with other special variable names to access timer functions. The VLC Control Designer automatically creates these special variables. You can*t add, delete, or modify these special timer variables (other than by adding,
deleting, or modifying the timer tag).
The VLC Control Designer creates the variables shown in the table below for every timer tag you create. For example, if you create a timer tag called sim_timer, you preset it by assigning a value to sim_timer.preset.
Timer Variable Type Function
Timer_Tag_name.accum Integer Accumulated time since enabled (read
only).
Timer_Tag_name.clear Boolean Write to clear the accumulator.
Timer_Tag_name.done Boolean ON when accumulator reaches the preset
value (read only).
Timer_Tag_name.enable Boolean Set to ON to start. Set to OFF to
stop. While ON, .accum increments until it reaches .preset.
Timer_Tag_name.preset Integer Sets the time-out value.
Timer_Tag_name.rllaccum Integer For RLL programs, the
accumulated time since enabled (read only).
Timer_Tag_name.rllclear Integer For RLL programs, write to clear the accumulator for an RLL timer.
Timer_Tag_name.rlldone Boolean For RLL programs, ON when accumulator reaches the preset value (read only).
Timer_Tag_name.prescale Integer The number of milliseconds between each increment of the accumulator.
Timer_Tag_name.scaleaccum Integer The accumulated time within each increment of the accumulator (increments up to prescale, and then
rolls over to zero).
There are several important characteristics of timers that are a function of the way the VLC RunTime updates variables (including timers) during each scan cycle. These characteristics are:
* A timer that you clear or start in a scan cycle remains zero during that cycle.
WARNING!
Assigning any value to a Timer_Tag_name.clear variable clears the accumulator in a flow chart program
The Visual Logic Controller, the VLC Control Designer, the VLC RunTime, the VLC MMI, and the VLC Control Maintainer are trademarks or
registered trademarks of Steeplechase Software, Inc. Commercial names of products from other manufacturers or developers that appear in this
documentation are registered or unregistered trademarks of those respective manufacturers or developers, which have expressed neither
approval nor disapproval of Steeplechase products.
*******************
~Ken
>>> Jiri Baum <[email protected]> 11/02 7:04 PM >>>
Ken Emmons, Jr.:
> Timers should have the resolution of milliseconds. Even if the
default
> prescalar multiplies the value by 1000 (to get seconds), the core
> structure should be based on a millisecond tick.
I said real-valued, and intend to keep the time as Linux gives it to
me
(which turns out to be microseconds).
We are not limited to integer constants here.
(Yes, I know floats have resolution problems; I'll be careful. Just
never
add or subtract two reals unless you know what you are doing.)
> Suggestion: Steeplechase assigns timers to their IO table
Yes, they should be in the IO table. But that will take some
designing, and
that demo has been bothering me ever since I wrote it. These will
probably
come in handy anyway.
> To interface to the Timer they define a structure like so:
> TimerName.Done
> TimerName.Enable
> TimerName.Preset
> TimerName.Clear
> TimerName.Accum
> Timer.Prescale
> (These might not be exact, but you get the idea ...)
> In the end I think this would make a nice way to interface to
them.
Do you have a description of the above functions? I can guess some of
them,
but not all, and not the details...
> Are these functions you mention just primitives for higher level
code to
> use???
That's probably how they will wind up, mostly. But they are intended
to be
sensible enough to be directly used by C code.
Jiri
--
Jiri Baum <[email protected]>
What we do Every Night! Take Over the World!
_______________________________________________
LinuxPLC mailing list
[email protected]
http://linuxplc.org/mailman/listinfo/linuxplc
This is from the VLC help file:
*******************************
In the VLC Control Designer, you use timers by creating a timer tag. You then use the timer tag name in combination with other special variable names to access timer functions. The VLC Control Designer automatically creates these special variables. You can*t add, delete, or modify these special timer variables (other than by adding,
deleting, or modifying the timer tag).
The VLC Control Designer creates the variables shown in the table below for every timer tag you create. For example, if you create a timer tag called sim_timer, you preset it by assigning a value to sim_timer.preset.
Timer Variable Type Function
Timer_Tag_name.accum Integer Accumulated time since enabled (read
only).
Timer_Tag_name.clear Boolean Write to clear the accumulator.
Timer_Tag_name.done Boolean ON when accumulator reaches the preset
value (read only).
Timer_Tag_name.enable Boolean Set to ON to start. Set to OFF to
stop. While ON, .accum increments until it reaches .preset.
Timer_Tag_name.preset Integer Sets the time-out value.
Timer_Tag_name.rllaccum Integer For RLL programs, the
accumulated time since enabled (read only).
Timer_Tag_name.rllclear Integer For RLL programs, write to clear the accumulator for an RLL timer.
Timer_Tag_name.rlldone Boolean For RLL programs, ON when accumulator reaches the preset value (read only).
Timer_Tag_name.prescale Integer The number of milliseconds between each increment of the accumulator.
Timer_Tag_name.scaleaccum Integer The accumulated time within each increment of the accumulator (increments up to prescale, and then
rolls over to zero).
There are several important characteristics of timers that are a function of the way the VLC RunTime updates variables (including timers) during each scan cycle. These characteristics are:
* A timer that you clear or start in a scan cycle remains zero during that cycle.
WARNING!
Assigning any value to a Timer_Tag_name.clear variable clears the accumulator in a flow chart program
The Visual Logic Controller, the VLC Control Designer, the VLC RunTime, the VLC MMI, and the VLC Control Maintainer are trademarks or
registered trademarks of Steeplechase Software, Inc. Commercial names of products from other manufacturers or developers that appear in this
documentation are registered or unregistered trademarks of those respective manufacturers or developers, which have expressed neither
approval nor disapproval of Steeplechase products.
*******************
~Ken
>>> Jiri Baum <[email protected]> 11/02 7:04 PM >>>
Ken Emmons, Jr.:
> Timers should have the resolution of milliseconds. Even if the
default
> prescalar multiplies the value by 1000 (to get seconds), the core
> structure should be based on a millisecond tick.
I said real-valued, and intend to keep the time as Linux gives it to
me
(which turns out to be microseconds).
We are not limited to integer constants here.
(Yes, I know floats have resolution problems; I'll be careful. Just
never
add or subtract two reals unless you know what you are doing.)
> Suggestion: Steeplechase assigns timers to their IO table
Yes, they should be in the IO table. But that will take some
designing, and
that demo has been bothering me ever since I wrote it. These will
probably
come in handy anyway.
> To interface to the Timer they define a structure like so:
> TimerName.Done
> TimerName.Enable
> TimerName.Preset
> TimerName.Clear
> TimerName.Accum
> Timer.Prescale
> (These might not be exact, but you get the idea ...)
> In the end I think this would make a nice way to interface to
them.
Do you have a description of the above functions? I can guess some of
them,
but not all, and not the details...
> Are these functions you mention just primitives for higher level
code to
> use???
That's probably how they will wind up, mostly. But they are intended
to be
sensible enough to be directly used by C code.
Jiri
--
Jiri Baum <[email protected]>
What we do Every Night! Take Over the World!
_______________________________________________
LinuxPLC mailing list
[email protected]
http://linuxplc.org/mailman/listinfo/linuxplc