MX Foundation 4
|
Functions | |
uint32 | mxfRxAcqBufferAlloc (HMXF_HANDLE handle, uint64 size, HMXF_BUFFER *buffer, uint64 *allocated) |
uint32 | mxfRxAcqBufferGet (HMXF_HANDLE handle, HMXF_BUFFER *buffer) |
uint32 | mxfRxAcqBufferFree (HMXF_BUFFER buffer) |
uint32 | mxfRxAcqBufferStatusGet (HMXF_BUFFER buffer, uint64 *status, uint64 *msgCount, uint64 *pendingBytes, uint64 *freeBytes) |
uint32 | mxfRxAcqBufferInfoGet (HMXF_BUFFER buffer, HMXF_HANDLE *handle) |
uint32 | mxfRxAcqModeGet (HMXF_BUFFER buffer, uint64 *mode) |
uint32 | mxfRxAcqModeSet (HMXF_BUFFER buffer, uint64 mode) |
uint32 | mxfRxAcqMsgSelectGet (HMXF_BUFFER buffer, uint64 options, uint64 maxCount, uint64 *count, void *msg) |
uint32 | mxfRxAcqMsgSelectSet (HMXF_BUFFER buffer, uint64 options, uint64 select, uint64 count, void *msg) |
uint32 | mxfRxAcqStart (HMXF_BUFFER buffer, uint64 flags, uint64 startTime, uint64 duration) |
uint32 | mxfRxAcqStop (HMXF_BUFFER buffer) |
uint32 | mxfRxAcqClose (HMXF_BUFFER buffer) |
uint32 | mxfRxAcqStopTimeGet (HMXF_BUFFER buffer, uint64 *stopTime) |
uint32 | mxfRxAcqClear (HMXF_BUFFER buffer) |
uint32 | mxfRxAcqRead (HMXF_BUFFER buffer, uint64 maxMsgCount, uint64 maxBytesCount, uint64 *status, uint64 *msgCount, uint64 *byteCount, void *rec) |
uint32 | mxfRxAcqReadAsync (HMXF_BUFFER buffer, uint64 maxMsgCount, uint64 maxBytesCount, void *hostBuffer, MXF_ASYNCHRONOUS_CALLBACK readCompletion, void *context) |
uint32 | mxfRxAcqTrigEnableGet (HMXF_BUFFER buffer, uint64 *state) |
uint32 | mxfRxAcqTrigEnableSet (HMXF_BUFFER buffer, uint64 state) |
uint32 | mxfRxAcqTrigSet (HMXF_BUFFER buffer, HMXF_COND_LIST condList, uint64 pretrigCount) |
uint32 | mxfRxAcqTrigTimeGet (HMXF_BUFFER buffer, uint64 *time) |
uint32 | mxfRxAcqTrigConditionListAlloc (HMXF_SERVER server, HMXF_COND_LIST *condList) |
uint32 | mxfRxAcqTrigConditionListFree (HMXF_COND_LIST condList) |
uint32 | mxfRxAcqTrigConditionListExprSet (HMXF_COND_LIST condList, uint64 expression) |
uint32 | mxfRxAcqTrigConditionAdd (HMXF_COND_LIST condList, uint64 id, void *param) |
uint32 | mxfRxAcqBufferAsyncEventInit (HMXF_BUFFER buffer, uint64 almostFull, void *context, MXF_ASYNCEVENT_BUFFER_HANDLER callback) |
uint32 | mxfRxAcqBufferAsyncEventTerminate (HMXF_BUFFER buffer) |
uint32 | mxfRxMsgChannelAsyncEventInit (HMXF_CHANNEL channel, void *context, MXF_ASYNCEVENT_RXMSG_HANDLER callback) |
uint32 | mxfRxMsgChannelAsyncEventTerminate (HMXF_CHANNEL channel) |
uint32 | mxfRxMsgAsyncEventMsgSelectSet (HMXF_CHANNEL channel, uint64 select, uint64 count, void *msg) |
uint32 | mxfRxMsgAsyncEventMsgSelectGet (HMXF_CHANNEL channel, uint64 maxCount, uint64 *count, void *msg) |
uint32 | mxfRxErrChannelAsyncEventInit (HMXF_CHANNEL channel, void *context, MXF_ASYNCEVENT_RXERR_HANDLER callback) |
uint32 | mxfRxErrChannelAsyncEventTerminate (HMXF_CHANNEL channel) |
uint32 mxfRxAcqBufferAlloc | ( | HMXF_HANDLE | handle, |
uint64 | size, | ||
HMXF_BUFFER * | buffer, | ||
uint64 * | allocated | ||
) |
Allocates an acquisition buffer area for reception.
[in] | handle | channel handle (module handle for FlexADC). |
[in] | size | buffer size in bytes. |
[out] | buffer | returned buffer handle. |
[out] | allocated | returned allocated size. The allocated buffer size returned can be greater than the asked size (rounding is done for internal buffer alignment). If NULL is specified for this parameter no value is returned. |
uint32 mxfRxAcqBufferGet | ( | HMXF_HANDLE | handle, |
HMXF_BUFFER * | buffer | ||
) |
Returns the buffer handle allocated to an acquisition channel or module.
[in] | handle | channel handle (module handle for FlexADC). |
[out] | buffer | returned buffer handle. |
uint32 mxfRxAcqBufferFree | ( | HMXF_BUFFER | buffer | ) |
Deallocates the memory previously allocated by mxfRxAcqBufferAlloc().
[in] | buffer | buffer handle. |
uint32 mxfRxAcqBufferStatusGet | ( | HMXF_BUFFER | buffer, |
uint64 * | status, | ||
uint64 * | msgCount, | ||
uint64 * | pendingBytes, | ||
uint64 * | freeBytes | ||
) |
Returns the status and the buffer usage statistics (pending data to be read and free bytes) for an acquisition channel.
[in] | buffer | buffer handle | ||||||||||||||||||||||||
[out] | status | acquisition buffer status
| ||||||||||||||||||||||||
[out] | msgCount | number of unread messages. | ||||||||||||||||||||||||
[out] | pendingBytes | number of unread bytes. | ||||||||||||||||||||||||
[out] | freeBytes | number of free bytes. |
uint32 mxfRxAcqBufferInfoGet | ( | HMXF_BUFFER | buffer, |
HMXF_HANDLE * | handle | ||
) |
Returns the channel handle related to an acquisition buffer.
[in] | buffer | buffer handle. |
[out] | handle | channel or module handle. |
uint32 mxfRxAcqModeGet | ( | HMXF_BUFFER | buffer, |
uint64 * | mode | ||
) |
Returns the acquisition mode of the acquisition buffer.
[in] | buffer | buffer handle. | ||||||
[out] | mode |
|
uint32 mxfRxAcqModeSet | ( | HMXF_BUFFER | buffer, |
uint64 | mode | ||
) |
Sets the acquisition mode for the acquisition buffer.
[in] | buffer | buffer handle. | ||||||
[in] | mode |
|
uint32 mxfRxAcqMsgSelectGet | ( | HMXF_BUFFER | buffer, |
uint64 | options, | ||
uint64 | maxCount, | ||
uint64 * | count, | ||
void * | msg | ||
) |
Reads the message ID filter for the acquisition buffer.
[in] | buffer | buffer handle | ||||||||||||||
[in] | options | filtering option
| ||||||||||||||
[in] | maxCount | maximum number of messages in the array msg. | ||||||||||||||
[out] | count | returned number msg in the msg array. | ||||||||||||||
[out] | msg | address of the returned message array.
|
uint32 mxfRxAcqMsgSelectSet | ( | HMXF_BUFFER | buffer, |
uint64 | options, | ||
uint64 | select, | ||
uint64 | count, | ||
void * | msg | ||
) |
Selects or deselects the message(s) to be acquired on the specified acquisition buffer.
Upon data arrival, the embedded process will check if the received message is found in the current selection list. The receive data record will be added to the acquisition buffer only if the message is found in the selection list, otherwise it is discarded.
By default, after a device reset, no filtering is performed and all messages are received.
[in] | buffer | buffer handle. | ||||||||||||||
[in] | options | filtering option
| ||||||||||||||
[in] | select | action to perform with the message ID array.
| ||||||||||||||
[in] | count | count of msg id in the array. | ||||||||||||||
[in] | msg | address array of message id structure.
|
uint32 mxfRxAcqStart | ( | HMXF_BUFFER | buffer, |
uint64 | flags, | ||
uint64 | startTime, | ||
uint64 | duration | ||
) |
Starts the data acquisition process for the specified acquisition buffer. The acquisition starts at the specified starting time and ends after the duration. If mxfRxAcqStart() is called while the acquisition is already running, the contents of the acquisition buffer will be cleared. The acquisition runs until mxfRxAcqStop() is called, a timeout occurs (duration finished) or the acquisition queue becomes full.
[in] | buffer | buffer handle. | ||||||
[in] | flags | acquisition mode.
| ||||||
[in] | startTime | start time: the time can either represent a relative time (offset in the future) or an absolute time based on the timebase format (absolute time is used when MXF_RXACQ_FLAG_ABSOLUTE_START_TIME is set in the acquisition flag). Relative time are not based on the timebase format but uses the process timebase resolution (microseconds or nanoseconds). A relative time of 0 instructs the acquisition process to start now. | ||||||
[in] | duration | duration: the acquisition stops (timeout) after the specified duration. The duration has the same resolution as the timebase format used (microseconds or nanoseconds). Set the duration to zero if you do not want the acquisition process to timeout. The duration is not precise (last at least duration, but can last up to 500 msec more). |
uint32 mxfRxAcqStop | ( | HMXF_BUFFER | buffer | ) |
Stops the acquisition process. After the acquisition is stopped, the data present in the acquisition queue can still be read using mxfRxAcqRead().
[in] | buffer | buffer handle. |
uint32 mxfRxAcqClose | ( | HMXF_BUFFER | buffer | ) |
Closes the acquisition process. Stops the acquisition, clear and free the acquisition buffer.
[in] | buffer | buffer handle. |
uint32 mxfRxAcqStopTimeGet | ( | HMXF_BUFFER | buffer, |
uint64 * | stopTime | ||
) |
Returns the time (based on the timebase) at which the acquisition has stopped.
[in] | buffer | buffer handle. |
[out] | stopTime | stop time. |
uint32 mxfRxAcqClear | ( | HMXF_BUFFER | buffer | ) |
Clears the acquisition buffer.
[in] | buffer | buffer handle. |
uint32 mxfRxAcqRead | ( | HMXF_BUFFER | buffer, |
uint64 | maxMsgCount, | ||
uint64 | maxBytesCount, | ||
uint64 * | status, | ||
uint64 * | msgCount, | ||
uint64 * | byteCount, | ||
void * | rec | ||
) |
Generic function to transfer the records from the acquisition buffer to the calling application.
Each channel class has its specific function (example: mxfA629RxAcqRead). For C#, only the specific functions are available.
The time tag in the records is expressed according to the timebase format.
The function reads messages up to maxMsgCount
or maxBytesCount
, the first one that is reached.
[in] | buffer | buffer handle. | ||||||||||||||||||||||||||||||||
[in] | maxMsgCount | maximum number of messages to read. Passing 0 to this parameter will make the function ignore it and be only limited by maxBytesCount . | ||||||||||||||||||||||||||||||||
[in] | maxBytesCount | maximum number of bytes to be read (1 to 100MB). | ||||||||||||||||||||||||||||||||
[out] | status | last read status: see mxfRxAcqBufferStatusGet() for more details. | ||||||||||||||||||||||||||||||||
[out] | msgCount | number of records returned. | ||||||||||||||||||||||||||||||||
[out] | byteCount | number of bytes returned. | ||||||||||||||||||||||||||||||||
[out] | rec | address of data records. The record format depends on the channel class. The records in the buffer need to be indexed using the mxfNextRecordPtrGet() function.
|
uint32 mxfRxAcqReadAsync | ( | HMXF_BUFFER | buffer, |
uint64 | maxMsgCount, | ||
uint64 | maxBytesCount, | ||
void * | hostBuffer, | ||
MXF_ASYNCHRONOUS_CALLBACK | readCompletion, | ||
void * | context | ||
) |
Transfers asynchronously the records from the channel acquisition buffer to the calling application. The function will return immediately after it has been registered to be executed by another thread. A callback function will be called when the asynchronous function has finished.
A maximum of 1000 asynchronous function calls can be queued.
The time tag in the records is expressed according to the timebase format.
The function reads messages up to maxMsgCount
or maxBytesCount
, the first one that is reached.
[in] | buffer | buffer handle. | ||||||||||||||||||||||||||||||||
[in] | maxMsgCount | maximum number of messages to read. Passing 0 to this parameter will make the function ignore it and be only limited by maxBytesCount . | ||||||||||||||||||||||||||||||||
[in] | maxBytesCount | maximum number of bytes to be read (1 to 100MB). | ||||||||||||||||||||||||||||||||
[out] | hostBuffer | address of data records. The record format depends on the channel class. The records in the buffer need to be indexed using the mxfNextRecordPtrGet() function.
|
[in] | readCompletion | callback function to be called when read process has been completed. Callback function is defined as follow: [in] result: return code of the function. [in] context: pointer to a value that has been passed for the callback. [in] output: array of additional information. output[0] contains the acquisition status. output[1] contains the number of messages returned in hostBuffer. output[2] contains the number of bytes returned in hostBuffer. |
[in] | context | pointer to a value that will be passed to the callback handler (optional). |
uint32 mxfRxAcqTrigEnableGet | ( | HMXF_BUFFER | buffer, |
uint64 * | state | ||
) |
Returns the state of the trigger.
[in] | buffer | buffer handle. | ||||||
[out] | state | trigger state
|
uint32 mxfRxAcqTrigEnableSet | ( | HMXF_BUFFER | buffer, |
uint64 | state | ||
) |
Sets the state of the trigger. By default, when a trigger is set with mxfRxAcqTrigSet(), the trigger is enabled. The trigger can be disabled or re-enabled with this function. Disabling a trigger before starting the acquisition will force the acquisition process to ignore the trigger. Disabling a trigger when the acquisition is started and is in wait-trig state will force the acquisition process to switch to running mode (as if the trigger occurred).
[in] | buffer | buffer handle. | ||||||
[in] | state | trigger state
|
uint32 mxfRxAcqTrigSet | ( | HMXF_BUFFER | buffer, |
HMXF_COND_LIST | condList, | ||
uint64 | pretrigCount | ||
) |
Assigns an acquisition trigger to a buffer. This trigger will take effect after the user has started the acquisition. If a trigger is set, the acquisition will start in the wait-trig state. In this state, the data received is kept in a circular buffer. These data are not available to the application up until the trigger conditions (condList) are evaluated positively or the acquisition is stopped with mxfRxAcqStop(). In this wait-trig state, pretrigCount of data record is kept in the buffer. If the buffer is full, the older data are discarded to make place for newly incoming data. The acquisition buffer size must be of at least two memory segment size (8KB) for the pretrigCount mechanism to work. When the trigger conditions are realized, the acquisition goes into running state. In this state the pre-trig data and all newly incoming data are buffered until the application reads them (through the mxfRxAcqRead() function). In the running state, the application should periodically read the buffered data (mxfRxAcqRead()). If it does not, the buffer may become full, forcing the acquisition process to stop itself.
The acquisition status will be set according to the running or wait-trig state. Please refer to mxfRxAcqBufferStatusGet().
[in] | buffer | buffer handle. |
[in] | condList | condition list handle. |
[in] | pretrigCount | pre-trigger count. Number of records received before the trigger to be kept in the acquisition buffer. This count is not precise, as it can be internally rounded up for performance optimization. |
uint32 mxfRxAcqTrigTimeGet | ( | HMXF_BUFFER | buffer, |
uint64 * | time | ||
) |
Returns the acquisition trigger time of the specified acquisition buffer.
[in] | buffer | buffer handle. |
[out] | time | time of the event triggered based on the timebase. |
uint32 mxfRxAcqTrigConditionListAlloc | ( | HMXF_SERVER | server, |
HMXF_COND_LIST * | condList | ||
) |
Allocates a condition list for triggering the acquisition on a receive channel.
A condition list is a memory resource that is used to hold one or more conditions defined with mxfRxAcqTrigConditionAdd().
Condition lists are used to define an event that MX Foundation's firmware has to monitor.
The various trigger-related functions take in argument a condition list to specify the trig condition(s).
[in] | server | server handle. |
[out] | condList | address of condition list HMXF_COND_LIST structure. |
uint32 mxfRxAcqTrigConditionListFree | ( | HMXF_COND_LIST | condList | ) |
Frees a condition list defined for triggering acquisition.
[in] | condList | condition list handle. |
uint32 mxfRxAcqTrigConditionListExprSet | ( | HMXF_COND_LIST | condList, |
uint64 | expression | ||
) |
Assigns an expression to the specified condition list when more than one condition is defined.
The expression represents the link between conditions. Two expressions are defined: “AND” and “OR”.
[in] | condList | condition list handle. | ||||||
[in] | expression | expression.
|
uint32 mxfRxAcqTrigConditionAdd | ( | HMXF_COND_LIST | condList, |
uint64 | id, | ||
void * | param | ||
) |
Adds a condition to the condition list for triggering acquisition.
A condition specifies the event to be monitored for a trigger action.
When a list holds multiple conditions, they are either ORed or ANDed in the evaluation of the condition list (see mxfRxAcqTrigConditionListExprSet()).
[in] | condList | condition list. | ||||||
[in] | id | condition identifier.
| ||||||
[in] | param | condition definition (structure) based on the id parameter. |
uint32 mxfRxAcqBufferAsyncEventInit | ( | HMXF_BUFFER | buffer, |
uint64 | almostFull, | ||
void * | context, | ||
MXF_ASYNCEVENT_BUFFER_HANDLER | callback | ||
) |
Sets an async event handler for a Rx acquisition buffer. When the almost full threshold will be reached, the callback will be called once and will be called again only when the almost full threshold will be reached again.
[in] | buffer | Rx acquisition buffer handle |
[in] | almostFull | almost full threshold value |
[in] | context | handler callback context |
[in] | callback | Rx acquisition buffer callback handler |
The callback handler function is defined as follow:
[in] buffer: buffer handle [in] context: context pointer
uint32 mxfRxAcqBufferAsyncEventTerminate | ( | HMXF_BUFFER | buffer | ) |
Clears the async event handler for a Rx acquisition buffer.
[in] | buffer | Rx acquisition buffer handle |
uint32 mxfRxMsgChannelAsyncEventInit | ( | HMXF_CHANNEL | channel, |
void * | context, | ||
MXF_ASYNCEVENT_RXMSG_HANDLER | callback | ||
) |
Sets an async event handler for a Rx Msg. When the message will be received, the callback will be called once and will be called again only when the message will be received again. The messages are selected with mxfRxMsgAsyncEventMsgSelectSet().
[in] | channel | Rx channel handle |
[in] | context | handler callback context |
[in] | callback | Rx Msg callback handler |
The callback handler function is defined as follow:
[in] buffer: buffer handle [in] msg: pointer to message (MXF_MSGID structure depending on the channel class) [in] context: context pointer
uint32 mxfRxMsgChannelAsyncEventTerminate | ( | HMXF_CHANNEL | channel | ) |
Clears the async event handler for a Rx Msg.
[in] | channel | Rx channel handle |
uint32 mxfRxMsgAsyncEventMsgSelectSet | ( | HMXF_CHANNEL | channel, |
uint64 | select, | ||
uint64 | count, | ||
void * | msg | ||
) |
Selects or deselects the message IDs for Rx Msg condition on a specified RX channel.
This function must be called in addition to mxfRxMsgChannelAsyncEventInit() to cause an asynchronous event to occur when a specific message ID is received.
[in] | channel | channel handle | ||||||||||||||
[in] | select | action to perform for the message IDs
| ||||||||||||||
[in] | count | count of messages IDs | ||||||||||||||
[in] | msg | array of message IDs.
|
uint32 mxfRxMsgAsyncEventMsgSelectGet | ( | HMXF_CHANNEL | channel, |
uint64 | maxCount, | ||
uint64 * | count, | ||
void * | msg | ||
) |
Returns the list of message IDs registered for a specified RX channel for Rx Msg asynchronous event condition ID.
[in] | channel | channel handle |
[in] | maxCount | maximum message IDs expected |
[out] | count | number of message IDs returned |
[out] | msg | returned message IDs array |
uint32 mxfRxErrChannelAsyncEventInit | ( | HMXF_CHANNEL | channel, |
void * | context, | ||
MXF_ASYNCEVENT_RXERR_HANDLER | callback | ||
) |
Sets an async event handler for a Rx Error. When an received error will be detected, the callback will be called once and will be called again only when another received error will be detected.
[in] | channel | Rx channel handle |
[in] | context | handler callback context |
[in] | callback | Rx Err buffer callback handler |
The callback handler function is defined as follow:
[in] channel: channel handle [in] status: detected error [in] msg: pointer to message (MXF_MSGID structure depending on the channel class) [in] context: context pointer
uint32 mxfRxErrChannelAsyncEventTerminate | ( | HMXF_CHANNEL | channel | ) |
Clears the async event handler for a Rx Error.
[in] | channel | Rx channel handle |