MX Foundation 4
|
In aperiodic mode, the user application is in complete control of the transmission.
The mxfDiscreteTxAperiodicWrite() function is used to send a FIFO buffer containing one or many MXF_DISCRETE_DATAREC
records that define the transition to perform on the discrete output lines.
After the application is initialized and the channel is set, the application must allocate a buffer for MXF_DISCRETE_DATAREC
record objects. The state of the discrete output lines is stored using the data
field.
The transmit timing is controlled by the timeTag
record field in conjunctions with the startTime parameter of the mxfDiscreteTxAperiodicWrite() function.
The aperiodic modes of transmission can be defined as follows:
Default Transmission
In this mode, a relative start time can be specified to send the records. The records are then sent back-to-back. The record's time tag can't be used.
Transmission with Absolute Timing
In this mode, an absolute start time is specified to send the records. The records are then sent back-to-back. The record's time tag can't be used.
Transmission with Record Timing
In this mode, each record's time tag is set in the future (in sequence) for the transmission of the records. The start time can't be used with this option.
Transmission with Record Relative Timing
With this method, the records' time tag specify the relative time between each records for transmission. The start time can't be used with this option.
The transmission can changed the line state to high or low by setting the bit to 1 or 0 in the data field, but a pulse pattern can also be set by using the control, highDuration and lowDuration fields. The pulse schedule mode can, for example, be used to generate a clock by transmitting only one record by the application. The pulse will start by a high duration or a low duration based on the value set in data field. If the bit is set to 1, the pulse will start with the high duration. If the bit is set to 0, the pulse will start with the low duration. The Pulse Schedule Mode is only available on MXF_MODULE_DIOFIFO_EH .
The example below shows how to change the state of discrete output based on the state of discrete input.
discrete.c
The example below shows how to change the state of discrete output with record timing.
discrete_event_handler.c
The example below shows how to use pulse schedule mode to generate a clock.