public class SoTimeCounter extends SoEngine
The difference between this engine and the SoCounter
engine, is that this engine also has a timeIn
input, which allows the counting cycles to be timed. This engine counts automatically over time; it does not need to be triggered to go to the next step. By default, the timeIn
input is connected to the realTime global field. It can, however, be connected to any time source.
The frequency
input field controls how many min-to-max cycles are performed per second. For example, a frequency
value of 0.5 means that it will take 2 seconds to complete a single min-to-max cycle.
The steps in the count cycle do not necessarily all have the same duration. Using the duty
input field, you can arbitrarily split the time period of the count cycle between the steps. For example, if there are 5 steps in the cycle, a duty input of (1., 2., 2., 2., 1.) will make the second, third, and fourth steps take twice as long as the first and last steps.
At any time the counter can be reset to a specific value. If you set the reset
input field to a value, the engine will continue counting from there. Note that the counter will always output numbers based on the min
, max
and step
values, and setting the reset
value does not affect the those input fields. If the reset value is not a legal counter value, the counter will still behave as though it is:
reset
is greater than max
, the counter is set to max
.
reset
is less than min
, the counter is set to min
.
reset
is between step values, the counter is set to the lower step.
Each time a counting cycle is started, the syncOut
output is triggered. This output can be used to synchronize some other event with the counting cycle. Other events can also synchronize the counter by triggering the syncIn
input.
You can pause the engine, by setting the on
input to false, and it will stop updating the output field. When you turn off the pause, by setting on
to true, it will start counting again from where it left off.
File format/default:
TimeCounter {
min | 0 |
max | 1 |
step | 1 |
on | true |
frequency | 1 |
duty | 1 |
timeIn | <current time> |
syncIn | |
reset | 0 |
See also:
Inventor.ConstructorCommand
Modifier and Type | Field and Description |
---|---|
SoMFFloat |
duty
Duty cycle values.
|
SoSFFloat |
frequency
Number of min-to-max cycles per second.
|
SoSFShort |
max
Maximum value for the counter.
|
SoSFShort |
min
Minimum value for the counter.
|
SoSFBool |
on
Counter pauses if this is set to false.
|
SoEngineOutput |
output
(
SoSFShort ) Counts min-to-max, in step increments. |
SoSFShort |
reset
Reset the counter to the specified value.
|
SoSFShort |
step
Counter step value.
|
SoSFTrigger |
syncIn
Restart at the beginning of the cycle.
|
SoEngineOutput |
syncOut
(
SoSFTrigger ) Triggers at cycle start. |
SoSFTime |
timeIn
Running time.
|
VERBOSE_LEVEL, ZeroHandle
Constructor and Description |
---|
SoTimeCounter()
Constructor.
|
copy, getByName, getOutput, getOutputName
copyFieldValues, copyFieldValues, enableNotify, fieldsAreEqual, get, getAllFields, getEventIn, getEventOut, getField, getFieldName, hasDefaultValues, isNotifyEnabled, set, setToDefaults
dispose, getEXTERNPROTO, getName, getPROTO, isDisposable, isSynchronizable, setName, setSynchronizable, touch
getAddress, getNativeResourceHandle, startInternalThreads, stopInternalThreads
public final SoSFShort min
public final SoSFShort max
public final SoSFShort step
public final SoSFBool on
public final SoSFFloat frequency
public final SoMFFloat duty
public final SoSFTime timeIn
public final SoSFTrigger syncIn
public final SoSFShort reset
public final SoEngineOutput output
SoSFShort
) Counts min-to-max, in step increments.public final SoEngineOutput syncOut
SoSFTrigger
) Triggers at cycle start.Generated on January 23, 2025, Copyright © Thermo Fisher Scientific. All rights reserved. http://www.openinventor.com