This class controls the I/O Scheduler which allows to store and emit output signals in hard real-time.
See class VIB::IOScheduler in the VisionBox Interface Library for a detailed description.
Public Types | |
enum | eIO_SCHEDULER_CMP_SRC |
Operation mode type definition More... | |
enum | eIO_SCHEDULER_COUNTER |
Available counters, used by GetCounter() More... | |
enum | eIO_SCHEDULER_ENC_EDGE_MODE |
Encoder edge detection mode, used by SetEncoderSource() More... | |
enum | eIO_SCHEDULER_ENC_SRC |
The trigger source type definition for the Encoder counter, used by SetEncoderSource() More... | |
enum | eIO_SCHEDULER_ENCODER_DIR |
Encoder direction type definition, used by EncoderDirection. More... | |
enum | eIO_SCHEDULER_RST_SRC |
The sources which reset the counter, used by SetCounterResetSource() More... | |
Public Member Functions | |
UInt32 | GetCounter (const IOScheduler::eIO_SCHEDULER_COUNTER CounterType) |
Reads a counter value from the FPGA More... | |
IOScheduler () | |
Default constructor for the device object More... | |
void | PushValue (const UInt32 CompareValue, const UInt32 OutputValue) |
Pushes a new entry into the circular buffer within the FPGA More... | |
void | Reset () |
Resets the I/O Scheduler logic. More... | |
void | SetCounterResetSource (const eIO_SCHEDULER_RST_SRC rstSrc, const Boolean InvertInput, const Boolean EdgeSensitive) |
Selects and configures the signal to reset the counters More... | |
void | SetEncoderSource (const eIO_SCHEDULER_ENC_SRC encSrc, const eIO_SCHEDULER_ENC_EDGE_MODE encMode) |
Selects the source signal(s) for encoder mode. More... | |
void | SetOutputPulsTiming (UInt32 Delay_us, UInt32 OnTime_us) |
Configures the output delay and hold time More... | |
void | SetTriggerSource (UInt32 InputIndex, bool InvertInput) |
Selects the Multiplexer output signal to be used as trigger event More... | |
void | Start () |
Starts the I/O Scheduler logic within the FPGA More... | |
Public Member Functions inherited from VIB_NET::iDevice | |
void | Close () |
Closes a device More... | |
bool | isOpen () |
Returns the open state of a device object More... | |
void | Open () |
Opens a device More... | |
void | Open (unsigned int Index) |
Opens a device More... | |
Properties | |
Boolean | AutomaticRequeueMode [set] |
If enabled, a currently compared item will be added again More... | |
UInt32 | BufferFillLevel [get] |
Reads the number of valid entries in the circular buffer More... | |
UInt32 | BufferMaxElementCount [get] |
Reads the maximum space for elements inside the circular buffer More... | |
eIO_SCHEDULER_CMP_SRC | CompareSource [set] |
Select the source that is compared with the pushed value, see eIO_SCHEDULER_CMP_SRC More... | |
Boolean | CounterFreeze [set] |
Freezes the counters and counter copy registers More... | |
eIO_SCHEDULER_ENCODER_DIR | EncoderDirection [set] |
Sets the direction of the encoder signal in encoder mode, see eIO_SCHEDULER_ENCODER_DIR More... | |
UInt32 | NumberOfOutputs [get] |
Holds the number output lines of the unit More... | |
virtual VIB_NET::eDEVICE_TYPE | Type [get] |
Returns the device type for the current instance, see eDEVICE_TYPE More... | |
Properties inherited from VIB_NET::iDevice | |
virtual VIB_NET::eDEVICE_TYPE | Type [get] |
Returns the device type for the current instance, see eDEVICE_TYPE More... | |
|
strong |
Operation mode type definition
Selects which counter is compared against the trigger activation value of the current buffer entry, see CompareSource.
Enumerator | |
---|---|
TRIGGER | Trigger mode, signal can selected via SetTriggerSource() |
ENCODER | Encoder mode, can be configured with SetEncoderSource() and EncoderDirection() |
TIMER | Timer mode. |
|
strong |
Available counters, used by GetCounter()
Enumerator | |
---|---|
TRIGGER | Trigger counter. |
ENCODER | Encoder counter. |
TIMER | Timer counter. |
ENCODER_COPY | Encoder counter copy. |
TIMER_COPY | Trigger counter copy. |
Encoder edge detection mode, used by SetEncoderSource()
Enumerator | |
---|---|
A_RISING | Counter increments on the rising edge of the first signal. |
A_FALLING | Counter increments on the falling edge of the first signal. |
A_BOTH | Counter increments on rising and falling edge of the first signal. |
AB_BOTH | Counter increments on both edges for both encoder signals. |
AB_ENCODER | Counter increments or decrements depending on the encoder direction and the configured direction, see EncoderDirection. |
|
strong |
The trigger source type definition for the Encoder counter, used by SetEncoderSource()
|
strong |
Encoder direction type definition, used by EncoderDirection.
Enumerator | |
---|---|
NORMAL | Normal encoder direction. |
REVERSE | Reversed encoder direction. |
|
strong |
The sources which reset the counter, used by SetCounterResetSource()
VIB_NET::IOScheduler::IOScheduler | ( | ) |
Default constructor for the device object
The device must be opened with Open() before it can be used.
UInt32 VIB_NET::IOScheduler::GetCounter | ( | const IOScheduler::eIO_SCHEDULER_COUNTER | CounterType | ) |
Reads a counter value from the FPGA
CounterType | Counter type to read |
void VIB_NET::IOScheduler::PushValue | ( | const UInt32 | CompareValue, |
const UInt32 | OutputValue | ||
) |
Pushes a new entry into the circular buffer within the FPGA
CompareValue | 24 bit activation value which is compared against the selected counter, the upper 8 bits are ignored |
OutputValue | Binary representation of the output signal, two LSBs are currently used |
void VIB_NET::IOScheduler::Reset | ( | ) |
Resets the I/O Scheduler logic.
The unit will be stopped if it was running before.
The function sets the following default values:
void VIB_NET::IOScheduler::SetCounterResetSource | ( | const eIO_SCHEDULER_RST_SRC | rstSrc, |
const Boolean | InvertInput, | ||
const Boolean | EdgeSensitive | ||
) |
Selects and configures the signal to reset the counters
The reset signal sets the counters back to zero, but not the copy registers. The reset will be done regardless of the freeze state.
rstSrc | Signal or constant value which will be used |
InvertInput | Polarity of the reset signal |
EdgeSensitive | false: signal level triggeres reset true: signal edge triggers reset |
void VIB_NET::IOScheduler::SetEncoderSource | ( | const eIO_SCHEDULER_ENC_SRC | encSrc, |
const eIO_SCHEDULER_ENC_EDGE_MODE | encMode | ||
) |
Selects the source signal(s) for encoder mode.
Depending on the edge mode, one signal (A) or two phase signals (A, B) of a rotary encoder are used to update the encoder counter.
encSrc | Select the source for signal A and B=A+1 (if used) |
encMode | Specifies the edge mode, when and how to update the counter |
void VIB_NET::IOScheduler::SetOutputPulsTiming | ( | UInt32 | Delay_us, |
UInt32 | OnTime_us | ||
) |
Configures the output delay and hold time
A delay can be specified after which the output value of the buffer entry gets transfered to the output of the I/O Scheduler.
A non-zero hold time will automatically set the ouput to low after the specified time. If the hold time is zero (default), the outputs have to be set explicitly to low by pushing a 0-bit with the desired location into the buffer.
Delay_us | Delay for activating the outputs in microseconds (0...1 s), default: 0 |
OnTime_us | Hold time for the output signal in microseconds (0...1 s), 0 for infinite default: 0 |
void VIB_NET::IOScheduler::SetTriggerSource | ( | UInt32 | InputIndex, |
bool | InvertInput | ||
) |
Selects the Multiplexer output signal to be used as trigger event
The signal is used for the trigger counter in triggered mode, but it can also be used in encoder and timer mode in order trigger a copy of the counter values.
InputIndex | Index of the Multiplexer output |
InvertInput | Signal polarity |
void VIB_NET::IOScheduler::Start | ( | ) |
Starts the I/O Scheduler logic within the FPGA
|
set |
If enabled, a currently compared item will be added again
After the comparison of the current trigger activation value was true, the entry will be added to the circular buffer again. This allows to generate fixed signal sequences without CPU interaction.
In order to reset the sequence, the reset source (SetCounterResetSource()) can be used. At reset, the compare counter values are set to zero and the buffer moves back to the first entry with the lowest trigger value.
To prevent a race condition, it is only allowed to add an entries with PushValue() while the counters are freezed.
|
get |
Reads the number of valid entries in the circular buffer
|
get |
Reads the maximum space for elements inside the circular buffer
If BufferFillLevel is equal to BufferMaxElementCount, no element can be added / pushed
|
set |
Select the source that is compared with the pushed value, see eIO_SCHEDULER_CMP_SRC
|
set |
Freezes the counters and counter copy registers
If the freeze is activated, the counters are stopped from counting. Any trigger or encoder event is ignored and the timer is stopped. No update of the counter copy registers will be done while the counters are freezed.
A reset event resets the counters regardless of the freeze state.
|
set |
Sets the direction of the encoder signal in encoder mode, see eIO_SCHEDULER_ENCODER_DIR
The value can only be set after configuring the encoder source with SetEncoderSource(..., eIO_SCHEDULER_ENC_EDGE_MODE::AB_ENCODER).
|
get |
Holds the number output lines of the unit
|
get |
Returns the device type for the current instance, see eDEVICE_TYPE