SoTimeCounter

InventorModule
genre InventorEngines
author Silicon Graphics Inc
package MeVisLab/Standard
definition inventor.def

Purpose

The engine SoTimeCounter is a counter that outputs numbers, starting at a minimum value, increasing by a step value, and ending with a number that does not exceed the maximum value. When the maximum number is reached, it starts counting from the beginning again.

The difference between this engine and the SoCounter engine is that this engine also has a Time In input, which allows the counting cycles to be timed. This engine counts automatically over time; it does not need to be triggered to advance to the next step. By default, the Time In input is connected to the realTime global field. However, it can 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 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 those input fields. If the reset value is not a legal counter value, the counter will still behave as follows:

  • If Reset is greater than Max, the counter is set to max.
  • If reset is less than Min, the counter is set to min.
  • If reset is between Step values, the counter is set to the lower step.

Each time a counting cycle is started, the Sync Out output is triggered. This output can be used to synchronize other events with the counting cycle. Other events can also synchronize the counter by triggering the Sync In input.

You can pause the engine by setting the On input to FALSE, which 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.

Windows

Default Panel

../../../Modules/Inventor/InventorBase/mhelp/Images/Screenshots/SoTimeCounter._default.png

Parameter Fields

Field Index

Duty: DoubleList Sync In: Trigger
Frequency: Float Sync Out: EngineOutput
Max: Integer Time In: String
Min: Integer  
On: Bool  
Output: EngineOutput  
Reset: Integer  
Step: Integer  

Visible Fields

Min

name: min, type: Integer, default: 0

Sets the minimum value for the counter.

Max

name: max, type: Integer, default: 1

Sets the maximum value for the counter.

Step

name: step, type: Integer, default: 1

Sets the step value of the counter.

On

name: on, type: Bool, default: TRUE

If checked, the counter counts. Otherwise, the counter pauses.

Frequency

name: frequency, type: Float, default: 1

Sets the number of min-to-max cycles per second.

Duty

name: duty, type: DoubleList, default: 1

Sets the duty cycle values.

Time In

name: timeIn, type: String, persistent: no

Shows the running time.

Sync In

name: syncIn, type: Trigger

When pressed, the counter restarts at the beginning of the cycle.

Reset

name: reset, type: Integer, default: 0

(Re)Sets the counter to the specified value.

Output

name: output, type: EngineOutput, persistent: no

Outputs the counter min-to-max in Step increments.

This field must be connected to an appropriate Open Inventor field to access or view its value.

Sync Out

name: syncOut, type: EngineOutput, persistent: no

Outputs a trigger signal at the beginning of a cycle.

This field must be connected to an appropriate Open Inventor field to access or view its value.