MX Foundation 4
MXF_FLEXDIO_DATAREC Struct Reference

Discrete Transmit / Receive (Acquisition) Record. More...

#include <mxf_class_flexdio.h>

Data Fields

uint64 timeTag
 
uint32 control
 
uint32 repeatCount
 
uint32 highDuration
 
uint32 lowDuration
 
uint64 data
 
uint64 edge
 

Detailed Description

This record structure is used to send (transmission) and receive (acquisition) discrete data.

Examples:
flexdio_event_handler.c, flexdio_fifo.c, flexdio_sampling_acq.c, and flexdio_sync.c.

Field Documentation

MXF_FLEXDIO_DATAREC::timeTag

Acquisition mode: Specifies the time when the data record has been received by the device. It is an absolute time expressed on the timebase set for the device. The time tag may also be disabled with the KMXF_FLEXDIO_MODULE_RX_TIMETAG_ENABLE attribute.

Transmission Mode: For transmit operation, the time tag allows the application to specify the time when the state is to be set. Depending on the usage the time tag can be optional.

Examples:
flexdio_event_handler.c, flexdio_sampling_acq.c, and flexdio_sync.c.
MXF_FLEXDIO_DATAREC::control

Not used in reception.

Used in transmission to control start and stop of pulse schedule.

Bit Constant Meaning
MXF_FLEXDIO_TX_REC_CTRL_WAIT_EOP Waits next end of pulse before applying new value.
MXF_FLEXDIO_TX_REC_CTRL_WAIT_EOR Waits next end of repeat count before applying new value.
MXF_FLEXDIO_TX_REC_CTRL_PULSE_START Starts a pulse schedule. Uses highDuration and lowDuration fields. The data field can be used to specify the initial value of the pulse.
Examples:
flexdio_event_handler.c.
MXF_FLEXDIO_DATAREC::repeatCount

Future use in transmission. Must be set to 1.

Not used in reception.

Examples:
flexdio_event_handler.c, and flexdio_fifo.c.
MXF_FLEXDIO_DATAREC::highDuration

High Duration of the pulse (Ticks count of 10 nsec, range: 5 - 2^32 [50 nsec to 42,94967296 sec]). Minimum combined duration of low and high duration is 100 nsec. Used only with pulse schedule mode, must be set to 0 when pulse schedule mode is not used.

Not used in reception.

MXF_FLEXDIO_DATAREC::lowDuration

Low Duration of the pulse (Ticks count of 10 nsec, range: 5 - 2^32 [50 nsec to 42,94967296 sec]). Minimum combined duration of low and high duration is 100 nsec. Used only with pulse schedule mode, must be set to 0 when pulse schedule mode is not used.

Not used in reception.

MXF_FLEXDIO_DATAREC::data

Discrete data.

Acquisition mode: Bit set to one in this field means that the corresponding discrete line is ON (over the Rx threshold), otherwise the corresponding discrete line is OFF (under the Rx thresold).



Transmission Mode: This table explains the discrete pin output value for each output mode.

Mode Discrete Value State Description
MXF_FLEXDIO_MODE_OUT_HS 0 Open Output pin = floating
The load should pull down the value close to 0 V
1 DC In Output pin = DC In
MXF_FLEXDIO_MODE_OUT_LS 0 Ground Output pin = Ground
1 Open Output pin = floating
External pull-up should get the value close to DC In
MXF_FLEXDIO_MODE_OUT_LS_PULLUP 0 Ground Output pin = Ground
1 Open Output pin = DC In
Internal pull-up should get the value close to DC In
MXF_FLEXDIO_MODE_OUT_PP 0 Ground Output pin = Ground
1 DC In Output pin = DC In
Examples:
flexdio_event_handler.c, flexdio_fifo.c, flexdio_sampling_acq.c, and flexdio_sync.c.
MXF_FLEXDIO_DATAREC::edge

Acquisition mode: Discrete edge capture word. Bit set to one in this field means that the corresponding discrete line changed state. The first record after the activation of the receive operation will have this field set to 0 to give the initial state of the discrete lines.



Transmission Mode: Mask to specify which bit to apply the data field. Bit set to one in this field will have its value set to the corresponding bit in data. Bit set to zero will keep its current value. Therefore, if you want set the state of the port #0 and #1, the mask must be set to 0x000000003.

Examples:
flexdio_event_handler.c, and flexdio_fifo.c.
Updated 10/23/2023