MX Foundation 4
|
Functions | |
uint32 | mxfDiscreteChannelRead (HMXF_CHANNEL channel, uint64 mask, uint64 *data) |
uint32 | mxfDiscreteChannelWrite (HMXF_CHANNEL channel, uint64 mask, uint64 data) |
uint32 | mxfDiscreteTxAperiodicWrite (HMXF_BUFFER buffer, uint64 options, uint64 startTime, uint64 count, MXF_DISCRETE_DATAREC *rec) |
uint32 | mxfDiscreteRxAcqRead (HMXF_BUFFER buffer, uint64 maxMsgCount, uint64 maxBytesCount, uint64 *status, uint64 *msgCount, uint64 *byteCount, MXF_DISCRETE_DATAREC *rec) |
uint32 | mxfDiscreteRxSamplingRead (HMXF_BUFFER buffer, uint64 flags, uint64 maxMsgCount, uint64 maxBytesCount, uint64 *msgCount, uint64 *byteCount, MXF_DISCRETE_SAMPREC *rec) |
uint32 | mxfDiscreteNextDataRecordPtrGet (MXF_DISCRETE_DATAREC *currentRec, MXF_DISCRETE_DATAREC **nextRec) |
uint32 | mxfDiscreteEmbeddedNVStorageFileMsgRead (HMXF_NVSTORAGE nvStorage, uint64 fileIndex, uint64 maxMsgCount, uint64 maxBytesCount, uint64 *msgCount, uint64 *byteCount, MXF_DISCRETE_DATAREC *msg) |
uint32 | mxfDiscreteEmbeddedNVStorageFileMsgWrite (HMXF_NVSTORAGE nvStorage, uint64 fileIndex, uint64 maxMsgCount, MXF_DISCRETE_DATAREC *msg, uint64 *count) |
uint32 mxfDiscreteChannelRead | ( | HMXF_CHANNEL | channel, |
uint64 | mask, | ||
uint64 * | data | ||
) |
Reads the current discrete input lines state on a discrete channel.
[in] | channel | channel handle. |
[in] | mask | port mask. |
[out] | data | data returned. |
Port Mask Example
The mask bit 0 selects the channel first port, bit 1 the second port, etc.
Therefore, to get the state of the port #1, set the mask to 0x00000002.
uint32 mxfDiscreteChannelWrite | ( | HMXF_CHANNEL | channel, |
uint64 | mask, | ||
uint64 | data | ||
) |
Sets the discrete output lines state on a discrete channel.
[in] | channel | channel handle. |
[in] | mask | port mask. |
[in] | data | data to set. |
Port Mask Example
The mask bit 0 selects the channel first port, bit 1 the second port, etc.
Therefore, to set the state of the port #1, set the mask to 0x00000002.
uint32 mxfDiscreteTxAperiodicWrite | ( | HMXF_BUFFER | buffer, |
uint64 | options, | ||
uint64 | startTime, | ||
uint64 | count, | ||
MXF_DISCRETE_DATAREC * | rec | ||
) |
Sends aperiodic data records for transmission. The data items to be transmitted are specified within the records, along with an optional time tag. The first data item is transmitted at the specified starting time.
The records to transmit on time tag must be placed in chronological order in the array. The same time tag must not appear more than once in the array. When the start time is specified the time tag of the first record or the start time should be at least 50 msec in advance to be relatively precise otherwise it will be sent as soon as possible. Also, the cumulative time of all record’s time tag and the start time must be smaller than 30 seconds.
[in] | buffer | buffer handle. |
[in] | options | options for controlling the transmitter before sending the data records. The details of the options are explained below.
|
[in] | startTime | start time based on the timebase. This is the time at which the data held in the first record is transmitted by the device. The time is either expressed accordingly to the process time base or relative to the current real-time clock value (i.e. offset in the future). If the bit MXF_TXAPERIODIC_FLAG_ABSOLUTE_START_TIME of the transmit flag is set, then the start time is specified in absolute time (rather than relative). MXF_TXAPERIODIC_FLAG_USE_RECORD_ABSOLUTE_TIME or MXF_TXAPERIODIC_FLAG_USE_RECORD_RELATIVE_TIME options cannot be used with a start time. |
[in] | count | number of records to write. |
[in] | rec | pointer to MXF_DISCRETE_DATAREC records to write. The records in the buffer need to be indexed using the mxfDiscreteNextDataRecordPtrGet() function. |
The options modifies the transmission scheme as described below;
This flag can’t be used with MXF_TXAPERIODIC_FLAG_USE_RECORD_ABSOLUTE_TIME, MXF_TXAPERIODIC_FLAG_ABSOLUTE_START_TIME or a start time.Time rec1 = Transmission offset (min 50 msec)
Time rec2 = Time rec1 + (rec2 time tag – rec1 time tag )
Time rec3 = Time rec2 + (rec3 time tag – rec2 time tag )
…
Time recN = Time recN-1 + (recN time tag - recN-1 time tag )
uint32 mxfDiscreteRxAcqRead | ( | HMXF_BUFFER | buffer, |
uint64 | maxMsgCount, | ||
uint64 | maxBytesCount, | ||
uint64 * | status, | ||
uint64 * | msgCount, | ||
uint64 * | byteCount, | ||
MXF_DISCRETE_DATAREC * | rec | ||
) |
Transfers the records from the channel acquisition buffer to the calling application.
[in] | buffer | buffer handle. |
[in] | maxMsgCount | maximum messages to read (0 means all messages). |
[in] | maxBytesCount | maximum number of bytes to be read. |
[out] | status | last status set. |
[out] | msgCount | number of records returned. |
[out] | byteCount | number of bytes returned. |
[out] | rec | address of data records. The records in the buffer need to be indexed using mxfDiscreteNextDataRecordPtrGet() function. |
uint32 mxfDiscreteRxSamplingRead | ( | HMXF_BUFFER | buffer, |
uint64 | flags, | ||
uint64 | maxMsgCount, | ||
uint64 | maxBytesCount, | ||
uint64 * | msgCount, | ||
uint64 * | byteCount, | ||
MXF_DISCRETE_SAMPREC * | rec | ||
) |
Reads the sampling record from the sampling buffer to the application buffer.
The sampling process keeps the last record received. A record is considered received if it were received within the kill-time period. A record refresh from the receive port resets the kill-time timer and an updated copy is made available to the application.
The sampling record contains information on the arrival rate as well as the latest discrete input lines state.
[in] | buffer | buffer handle. | ||||||
[in] | flags | option flag.
| ||||||
[in] | maxMsgCount | maximum number of messages to read. Normally one, maximum of one sampling record available. | ||||||
[in] | maxBytesCount | maximum number of bytes to read. Normally sizeof MXF_DISCRETE_SAMPREC structure. | ||||||
[out] | msgCount | number of messages returned. | ||||||
[out] | byteCount | number of bytes returned. | ||||||
[out] | rec | pointer to MXF_DISCRETE_SAMPREC record structure. |
uint32 mxfDiscreteNextDataRecordPtrGet | ( | MXF_DISCRETE_DATAREC * | currentRec, |
MXF_DISCRETE_DATAREC ** | nextRec | ||
) |
Returns the next buffer address in a MXF_DISCRETE_DATAREC buffer array.
[in] | currentRec | pointer to the beginning or the current record in the buffer. |
[out] | nextRec | pointer to next record in the buffer. |
uint32 mxfDiscreteEmbeddedNVStorageFileMsgRead | ( | HMXF_NVSTORAGE | nvStorage, |
uint64 | fileIndex, | ||
uint64 | maxMsgCount, | ||
uint64 | maxBytesCount, | ||
uint64 * | msgCount, | ||
uint64 * | byteCount, | ||
MXF_DISCRETE_DATAREC * | msg | ||
) |
Reads the records from a specific file. The messages format must be of type MXF_EMBEDDED_NVSTORAGE_MSGTYPE_DISCRETE.
[in] | nvStorage | non-volatile storage handle |
[in] | fileIndex | file index |
[in] | maxMsgCount | maximum number of messages that can be returned |
[in] | maxBytesCount | maximum byte count that can be returned |
[out] | msgCount | count of messages returned |
[out] | byteCount | number of bytes returned in the msg buffer |
[out] | msg | pointer to read buffer containing messages. The records in the buffer need to be indexed using the mxfDiscreteNextDataRecordPtrGet() function. |
uint32 mxfDiscreteEmbeddedNVStorageFileMsgWrite | ( | HMXF_NVSTORAGE | nvStorage, |
uint64 | fileIndex, | ||
uint64 | maxMsgCount, | ||
MXF_DISCRETE_DATAREC * | msg, | ||
uint64 * | count | ||
) |
Writes messages to the specified file. The messages format must be of type MXF_EMBEDDED_NVSTORAGE_MSGTYPE_DISCRETE.
[in] | nvStorage | non-volatile storage handle |
[in] | fileIndex | file index |
[in] | maxMsgCount | maximum number of messages to write |
[in] | msg | pointer to messages to write. The records in the buffer need to be indexed using mxfDiscreteNextDataRecordPtrGet() function. |
[out] | count | number of messages actually written |