VisionBox .NET Library  1.7.10.0 (2024-04-16)
VIB_NET::IOScheduler Class Reference
+ Inheritance diagram for VIB_NET::IOScheduler:

Detailed Description

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.

+ C# example using a trigger signal
+ C# example using an Encoder

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...
 

Member Enumeration Documentation

◆ eIO_SCHEDULER_CMP_SRC

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.

◆ eIO_SCHEDULER_COUNTER

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.

◆ eIO_SCHEDULER_ENC_EDGE_MODE

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.

◆ eIO_SCHEDULER_ENC_SRC

The trigger source type definition for the Encoder counter, used by SetEncoderSource()

Enumerator
SYNC_0_0 

SYNC Unit 0 Input 0.

SYNC_0_1 

SYNC Unit 0 Input 1.

MUX_OUT0 

Multiplexer Output 0.

MUX_OUT1 

Multiplexer Output 1.

MUX_OUT2 

Multiplexer Output 2.

MUX_OUT3 

Multiplexer Output 3.

MUX_OUT4 

Multiplexer Output 4.

MUX_OUT5 

Multiplexer Output 5.

MUX_OUT6 

Multiplexer Output 6.

MUX_OUT7 

Multiplexer Output 7.

MUX_OUT8 

Multiplexer Output 8.

MUX_OUT9 

Multiplexer Output 9.

MUX_OUT10 

Multiplexer Output 10.

MUX_OUT11 

Multiplexer Output 11.

MUX_OUT12 

Multiplexer Output 12.

MUX_OUT13 

Multiplexer Output 13.

MUX_OUT14 

Multiplexer Output 14.

MUX_OUT15 

Multiplexer Output 15.

MUX_OUT16 

Multiplexer Output 16.

MUX_OUT17 

Multiplexer Output 17.

MUX_OUT18 

Multiplexer Output 18.

MUX_OUT19 

Multiplexer Output 19.

MUX_OUT20 

Multiplexer Output 20.

MUX_OUT21 

Multiplexer Output 21.

MUX_OUT22 

Multiplexer Output 22.

MUX_OUT23 

Multiplexer Output 23.

◆ eIO_SCHEDULER_ENCODER_DIR

Encoder direction type definition, used by EncoderDirection.

Enumerator
NORMAL 

Normal encoder direction.

REVERSE 

Reversed encoder direction.

◆ eIO_SCHEDULER_RST_SRC

The sources which reset the counter, used by SetCounterResetSource()

Enumerator
OFF 

static off

ON 

static on

MUX_OUT0 

Multiplexer Output 0.

MUX_OUT1 

Multiplexer Output 1.

MUX_OUT2 

Multiplexer Output 2.

MUX_OUT3 

Multiplexer Output 3.

MUX_OUT4 

Multiplexer Output 4.

MUX_OUT5 

Multiplexer Output 5.

MUX_OUT6 

Multiplexer Output 6.

MUX_OUT7 

Multiplexer Output 7.

MUX_OUT8 

Multiplexer Output 8.

MUX_OUT9 

Multiplexer Output 9.

MUX_OUT10 

Multiplexer Output 10.

MUX_OUT11 

Multiplexer Output 11.

MUX_OUT12 

Multiplexer Output 12.

MUX_OUT13 

Multiplexer Output 13.

MUX_OUT14 

Multiplexer Output 14.

MUX_OUT15 

Multiplexer Output 15.

MUX_OUT16 

Multiplexer Output 16.

MUX_OUT17 

Multiplexer Output 17.

MUX_OUT18 

Multiplexer Output 18.

MUX_OUT19 

Multiplexer Output 19.

MUX_OUT20 

Multiplexer Output 20.

MUX_OUT21 

Multiplexer Output 21.

MUX_OUT22 

Multiplexer Output 22.

MUX_OUT23 

Multiplexer Output 23.

Constructor & Destructor Documentation

◆ IOScheduler()

VIB_NET::IOScheduler::IOScheduler ( )

Default constructor for the device object

The device must be opened with Open() before it can be used.

Member Function Documentation

◆ GetCounter()

UInt32 VIB_NET::IOScheduler::GetCounter ( const IOScheduler::eIO_SCHEDULER_COUNTER  CounterType)

Reads a counter value from the FPGA

Parameters
CounterTypeCounter type to read
Returns
Counter value of the given type

◆ PushValue()

void VIB_NET::IOScheduler::PushValue ( const UInt32  CompareValue,
const UInt32  OutputValue 
)

Pushes a new entry into the circular buffer within the FPGA

Note
If the I/O Scheuler is in automatic requeue mode, the counters must be freezed (CounterFreeze) before calling this function.
Parameters
CompareValue24 bit activation value which is compared against the selected counter, the upper 8 bits are ignored
OutputValueBinary representation of the output signal, two LSBs are currently used

◆ Reset()

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:

pIOScheduler.CounterFreeze = false;
pIOScheduler.AutomaticRequeueMode = false;
pIOScheduler.CompareSource = VIB_NET.IOScheduler.eIO_SCHEDULER_CMP_SRC.TRIGGER;
pIOScheduler.SetTriggerSource(0, false);
pIOScheduler.SetEncoderSource(VIB_NET.IOScheduler.eIO_SCHEDULER_ENC_SRC.SYNC_0_0, VIB_NET.IOScheduler.eIO_SCHEDULER_ENC_EDGE_MODE.AB_ENCODER);
pIOScheduler.EncoderDirection = VIB_NET.IOScheduler.eIO_SCHEDULER_ENCODER_DIR.NORMAL; //The user can't call this without setting eIO_SCHEDULER_CMP_SRC.ENCODER
pIOScheduler.CounterResetSource(VIB_NET.IOScheduler.eIO_SCHEDULER_RST_SRC.OFF, false, false);
pIOScheduler.SetOutputPulsTiming(0, 0);

◆ SetCounterResetSource()

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.

Parameters
rstSrcSignal or constant value which will be used
InvertInputPolarity of the reset signal
EdgeSensitivefalse: signal level triggeres reset
true: signal edge triggers reset

◆ SetEncoderSource()

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.

Parameters
encSrcSelect the source for signal A and B=A+1 (if used)
encModeSpecifies the edge mode, when and how to update the counter

◆ SetOutputPulsTiming()

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.

Parameters
Delay_usDelay for activating the outputs in microseconds (0...1 s), default: 0
OnTime_usHold time for the output signal in microseconds (0...1 s), 0 for infinite default: 0

◆ SetTriggerSource()

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.

Parameters
InputIndexIndex of the Multiplexer output
InvertInputSignal polarity

◆ Start()

void VIB_NET::IOScheduler::Start ( )

Starts the I/O Scheduler logic within the FPGA

Property Documentation

◆ AutomaticRequeueMode

VIB_NET::IOScheduler::AutomaticRequeueMode
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.

◆ BufferFillLevel

VIB_NET::IOScheduler::BufferFillLevel
get

Reads the number of valid entries in the circular buffer

◆ BufferMaxElementCount

VIB_NET::IOScheduler::BufferMaxElementCount
get

Reads the maximum space for elements inside the circular buffer

If BufferFillLevel is equal to BufferMaxElementCount, no element can be added / pushed

◆ CompareSource

VIB_NET::IOScheduler::CompareSource
set

Select the source that is compared with the pushed value, see eIO_SCHEDULER_CMP_SRC

◆ CounterFreeze

VIB_NET::IOScheduler::CounterFreeze
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.

◆ EncoderDirection

VIB_NET::IOScheduler::EncoderDirection
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).

◆ NumberOfOutputs

VIB_NET::IOScheduler::NumberOfOutputs
get

Holds the number output lines of the unit

◆ Type

VIB_NET::IOScheduler::Type
get

Returns the device type for the current instance, see eDEVICE_TYPE

VIB_NET
All relevant classes and functions are residing in this namespace.
Definition: CameraLinkIn.cpp:6
VIB_NET::IOScheduler::eIO_SCHEDULER_CMP_SRC
eIO_SCHEDULER_CMP_SRC
Operation mode type definition
Definition: VIB_NET.h:1299
VIB_NET::Multiplexer
This class controls the Multiplexer unit which connects signal sources and sinks with each other.
Definition: VIB_NET.h:1003
VIB_NET::TriggerGenerator
This module controls the FPGA Trigger Unit.
Definition: VIB_NET.h:658
VIB_NET::IOScheduler::eIO_SCHEDULER_ENC_EDGE_MODE
eIO_SCHEDULER_ENC_EDGE_MODE
Encoder edge detection mode, used by SetEncoderSource()
Definition: VIB_NET.h:1343
VIB_NET::DigitalOutput
This class controls the optically isolated output signals.
Definition: VIB_NET.h:1099
VIB_NET::DigitalOutput::eOUT_SOURCE
eOUT_SOURCE
Sources for the Outputs used with SetSource()
Definition: VIB_NET.h:1112
VIB_NET::Multiplexer::eMUX_SOURCE
eMUX_SOURCE
Source signal definitions for the Multiplexer
Definition: VIB_NET.h:1008
VIB_NET::IOScheduler
This class controls the I/O Scheduler which allows to store and emit output signals in hard real-time...
Definition: VIB_NET.h:1291
VIB_NET::IOScheduler::eIO_SCHEDULER_RST_SRC
eIO_SCHEDULER_RST_SRC
The sources which reset the counter, used by SetCounterResetSource()
Definition: VIB_NET.h:1363
VIB_NET::IOScheduler::eIO_SCHEDULER_ENC_SRC
eIO_SCHEDULER_ENC_SRC
The trigger source type definition for the Encoder counter, used by SetEncoderSource()
Definition: VIB_NET.h:1310
VIB_NET::IOScheduler::eIO_SCHEDULER_ENCODER_DIR
eIO_SCHEDULER_ENCODER_DIR
Encoder direction type definition, used by EncoderDirection.
Definition: VIB_NET.h:1354