MX Foundation 4

Functions

uint32 mxfRxSamplingBufferAlloc (HMXF_HANDLE handle, uint64 size, HMXF_BUFFER *buffer, uint64 *allocated)
 
uint32 mxfRxSamplingBufferGet (HMXF_HANDLE handle, HMXF_BUFFER *buffer)
 
uint32 mxfRxSamplingBufferFree (HMXF_BUFFER buffer)
 
uint32 mxfRxSamplingBufferStatusGet (HMXF_BUFFER buffer, uint64 *status, uint64 *msgCount, uint64 *pendingBytes, uint64 *freeBytes)
 
uint32 mxfRxSamplingBufferInfoGet (HMXF_BUFFER buffer, HMXF_HANDLE *handle)
 
uint32 mxfRxSamplingExtEnableSet (HMXF_BUFFER buffer, uint64 state, uint64 count, void *msg)
 
uint32 mxfRxSamplingExtEnableAllGet (HMXF_BUFFER buffer, uint64 maxCount, uint64 *count, void *msg)
 
uint32 mxfRxSamplingKilltimeGet (HMXF_BUFFER buffer, uint64 *time)
 
uint32 mxfRxSamplingKilltimeSet (HMXF_BUFFER buffer, uint64 time)
 
uint32 mxfRxSamplingMaxRecordsGet (HMXF_BUFFER buffer, uint64 *address, uint64 *ext)
 
uint32 mxfRxSamplingMsgSelectSet (HMXF_BUFFER buffer, uint64 options, uint64 select, uint64 count, void *msg)
 
uint32 mxfRxSamplingMsgSelectGet (HMXF_BUFFER buffer, uint64 options, uint64 maxCount, uint64 *count, void *msg)
 
uint32 mxfRxSamplingRead (HMXF_BUFFER buffer, uint64 flags, uint64 maxMsgCount, uint64 maxBytesCount, uint64 *msgCount, uint64 *byteCount, void *rec)
 
uint32 mxfRxSamplingReadAsync (HMXF_BUFFER buffer, uint64 flags, uint64 maxMsgCount, uint64 maxBytesCount, void *hostBuffer, MXF_ASYNCHRONOUS_CALLBACK readCompletion, void *context)
 
uint32 mxfRxSamplingSingleRead (HMXF_BUFFER buffer, uint64 flags, void *msg, void *rec)
 
uint32 mxfRxSamplingSingleReadAsync (HMXF_BUFFER buffer, uint64 flags, void *msg, void *hostBuffer, MXF_ASYNCHRONOUS_CALLBACK readCompletion, void *context)
 
uint32 mxfRxSamplingRecordSizeGet (HMXF_BUFFER buffer, uint64 *size)
 
uint32 mxfRxSamplingStart (HMXF_BUFFER buffer)
 
uint32 mxfRxSamplingStop (HMXF_BUFFER buffer)
 

Detailed Description

Function Documentation

uint32 mxfRxSamplingBufferAlloc ( HMXF_HANDLE  handle,
uint64  size,
HMXF_BUFFER *  buffer,
uint64 *  allocated 
)
C#
public static extern UInt32 mxfRxSamplingBufferAlloc(UInt64 handle, UInt64 size, out UInt64 buffer, out UInt64 allocated);

public static extern UInt32 mxfRxSamplingBufferAlloc(UInt64 handle, UInt64 size, out UInt64 buffer, IntPtr allocated);

Allocates a sampling buffer area for reception. The allocated size can be greater than the asked size (rounding is done for internal buffer alignment). allocated parameter can return the actual allocated size.

Parameters
[in]handlechannel handle (module handle for FlexADC).
[in]sizebuffer size in bytes.
[out]bufferreturned buffer handle.
[out]allocatedreturned allocated size. Optional, pass NULL to if not needed.
Returns
MAXT_SUCCESS is returned when the function has succeeded.
Refer to mxf_error.h for a list of defined errors.
Call mxfSystemErrorStringGet() to transform the return code into a text string.
Availability:
Available in MX Foundation 4.0 and later.
See also
mxfRxSamplingBufferFree()
mxfRxSamplingBufferGet()
mxfRxSamplingBufferStatusGet()
Examples:
adc_sampling.c, ar429_rx_event_handler.c, ar429_rx_event_handler.cs, ar429_rx_sampling.c, ar429_rx_sampling.cs, ar629_error_injection_detection.c, ar629_error_injection_detection.cs, ar629_updating_data_sampling.c, ar629_updating_data_sampling.cs, ar708_sampling.c, ar708_sampling.cs, ar708_tx_error_injection.c, ar708_tx_error_injection.cs, canbus_sampling.c, csdb_rx_event_handler.c, csdb_rx_event_handler.cs, csdb_rx_sampling.c, csdb_rx_sampling.cs, flexadc_sampling.c, flexdio_fifo_sampling.c, mil1553_bc_buserror_trigger.c, and mil1553_bc_buserror_trigger.cs.
uint32 mxfRxSamplingBufferGet ( HMXF_HANDLE  handle,
HMXF_BUFFER *  buffer 
)
C#
public static extern UInt32 mxfRxSamplingBufferGet(UInt64 handle, out UInt64 buffer);

Returns the buffer handle allocated to a sampling channel or moduile.

Parameters
[in]handlechannel handle (module handle for FlexADC).
[out]bufferreturned buffer handle.
Returns
MAXT_SUCCESS is returned when the function has succeeded.
Refer to mxf_error.h for a list of defined errors.
Call mxfSystemErrorStringGet() to transform the return code into a text string.
Availability:
Available in MX Foundation 4.0 and later.
See also
mxfRxSamplingBufferAlloc
Examples:
ar429_rx_event_handler.c, ar429_rx_event_handler.cs, ar664_sampling.c, ar664_sampling.cs, csdb_rx_event_handler.c, and csdb_rx_event_handler.cs.
uint32 mxfRxSamplingBufferFree ( HMXF_BUFFER  buffer)
C#
public static extern UInt32 mxfRxSamplingBufferFree(UInt64 buffer);

Deallocates the memory previously allocated by mxfRxSamplingBufferAlloc().

Parameters
[in]bufferbuffer handle.
Returns
MAXT_SUCCESS is returned when the function has succeeded.
Refer to mxf_error.h for a list of defined errors.
Call mxfSystemErrorStringGet() to transform the return code into a text string.
Availability:
Available in MX Foundation 4.0 and later.
See also
mxfRxSamplingBufferGet()
Examples:
adc_sampling.c, ar429_rx_event_handler.c, ar429_rx_event_handler.cs, ar429_rx_sampling.c, ar429_rx_sampling.cs, ar629_error_injection_detection.c, ar629_error_injection_detection.cs, ar629_updating_data_sampling.c, ar629_updating_data_sampling.cs, ar664_sampling.c, ar664_sampling.cs, ar708_sampling.c, ar708_tx_error_injection.c, canbus_sampling.c, flexadc_sampling.c, flexdio_fifo_sampling.c, mil1553_bc_buserror_trigger.c, and mil1553_bc_buserror_trigger.cs.
uint32 mxfRxSamplingBufferStatusGet ( HMXF_BUFFER  buffer,
uint64 *  status,
uint64 *  msgCount,
uint64 *  pendingBytes,
uint64 *  freeBytes 
)
C#
public static extern UInt32 mxfRxSamplingBufferStatusGet(UInt64 buffer, out UInt64 status, out UInt64 msgCount, out UInt64 pendingBytes, out UInt64 freeBytes);

Returns the status and the buffers usage statistics (pending data to be read and free bytes) for a sampling buffer.

Parameters
[in]bufferbuffer handle.
[out]statussampling buffer status
Sampling Status Description
MXF_RXSAMPLING_STATUS_RUNNING sampling running.
MXF_RXSAMPLING_STATUS_STOPPED sampling stopped.
MXF_RXSAMPLING_STATUS_OVERFLOW sampling buffer has been overflowed.
MXF_RXSAMPLING_STATUS_OUT_OF_RESOURCES sampling stopped due to full internal buffer.
MXF_RXSAMPLING_STATUS_MODULE_OVERFLOW module FIFO overflow.
[out]msgCountnumber of unread messages.
[out]pendingBytesnumber of unread bytes.
[out]freeBytesnumber of free bytes.
Note
No value is returned if NULL is specified for the parameters status, mxgCount, pendingBytes, freeBytes.
Returns
MAXT_SUCCESS is returned when the function has succeeded.
Refer to mxf_error.h for a list of defined errors.
Call mxfSystemErrorStringGet() to transform the return code into a text string.
Availability:
Available in MX Foundation 4.0 and later.
See also
mxfRxSamplingBufferAlloc()
mxfRxSamplingRead()
mxfRxSamplingSingleRead()
Examples:
ar664_sampling.c, and ar664_sampling.cs.
uint32 mxfRxSamplingBufferInfoGet ( HMXF_BUFFER  buffer,
HMXF_HANDLE *  handle 
)
C#
public static extern UInt32 mxfRxSamplingBufferInfoGet(UInt64 buffer, out UInt64 handle);

Returns the channel handle related to a sampling buffer.

Parameters
[in]bufferbuffer handle.
[out]handlechannel or modulue handle.
Returns
MAXT_SUCCESS is returned when the function has succeeded.
Refer to mxf_error.h for a list of defined errors.
Call mxfSystemErrorStringGet() to transform the return code into a text string.
Availability:
Available in MX Foundation 4.0 and later.
See also
mxfRxSamplingBufferAlloc()
mxfRxSamplingBufferGet()
uint32 mxfRxSamplingExtEnableSet ( HMXF_BUFFER  buffer,
uint64  state,
uint64  count,
void *  msg 
)

Enables or disables message discrimination using the message extended address field. The message look-up table will have an entry for each message Address:ExtAddress pair

By default, after a device reset, message discrimination using the message extended address field is disabled.

Note
When the count is set to 0 and msg is set to NULL this means all possible message addresses for the protocol.
Parameters
[in]bufferbuffer handle.
[in]statemessage address extension discrimination state
  • VMXF_ENABLE: Enables message address extension discrimination
  • VMXF_DISABLE: Disables message address extension discrimination
[in]countnumber of entries in msg.
[in]msgarray of message(s) id structure. Only the address part is used, other fields must be set to 0.
Channel class Message identifier structure
ARINC 429 MXF_MSGID_A429
MIL-STD-1553 MXF_MSGID_MIL1553
CSDB MXF_MSGID_CSDB
ARINC 629 MXF_MSGID_A629
Returns
MAXT_SUCCESS is returned when the function has succeeded.
Refer to mxf_error.h for a list of defined errors.
Call mxfSystemErrorStringGet() to transform the return code into a text string.
Availability:
Available in MX Foundation 4.0 and later.
See also
mxfRxSamplingExtEnableAllGet()
uint32 mxfRxSamplingExtEnableAllGet ( HMXF_BUFFER  buffer,
uint64  maxCount,
uint64 *  count,
void *  msg 
)

Gets the list of messages that has discrimination using the message extended address field enabled.

Parameters
[in]bufferbuffer handle.
[in]maxCountmaximum number of entries in msg.
[out]countnumber of entries in msg.
[out]msgaddress array of message id structure.
Channel class Message identifier structure
ARINC 429 MXF_MSGID_A429
MIL-STD-1553 MXF_MSGID_MIL1553
CSDB MXF_MSGID_CSDB
ARINC 629 MXF_MSGID_A629
Returns
MAXT_SUCCESS is returned when the function has succeeded.
Refer to mxf_error.h for a list of defined errors.
Call mxfSystemErrorStringGet() to transform the return code into a text string.
Availability:
Available in MX Foundation 4.0 and later.
See also
mxfRxSamplingExtEnableSet()
uint32 mxfRxSamplingKilltimeGet ( HMXF_BUFFER  buffer,
uint64 *  time 
)
C#
public static extern UInt32 mxfRxSamplingKilltimeGet(UInt64 buffer, out UInt64 time);

Returns the kill-time defined for the specified sampling buffer.

The kill-time is defined as the time after which a message address (or label) is declared not-received.

If an address present in the sampling table is not received for more than the kill-time period, then its record entry is removed from the sampling table and thus will not be returned by the mxfRxSamplingRead() or mxfRxSamplingSingleRead() functions.

Parameters
[in]bufferbuffer handle.
[out]timekill-time currently set in timebase resolution.
Returns
MAXT_SUCCESS is returned when the function has succeeded.
Refer to mxf_error.h for a list of defined errors.
Call mxfSystemErrorStringGet() to transform the return code into a text string.
Availability:
Available in MX Foundation 4.0 and later.
See also
mxfRxSamplingKilltimeSet()
mxfSystemTimeBaseSet()
uint32 mxfRxSamplingKilltimeSet ( HMXF_BUFFER  buffer,
uint64  time 
)
C#
public static extern UInt32 mxfRxSamplingKilltimeSet(UInt64 buffer, UInt64 time);

Sets the kill-time for the specified sampling buffer.

The kill-time is defined as the maximum time after which a message address (or label) is declared not-received.

If an address present in the sampling table is not received for more than the kill-time period, then its record entry is removed from the sampling table and thus will not be returned by the mxfRxSamplingRead() or mxfRxSamplingSingleRead().

Note
The kill-time check process is a low priority task which result that if a message is declared not-received, it has not been received for at least the kill-time value.
Parameters
[in]bufferbuffer handle.
[in]timekill-time in timebase resolution. A value of zero disables the kill-time and received messages are never invalidated. Maximum is 24 hours.
Returns
MAXT_SUCCESS is returned when the function has succeeded.
Refer to mxf_error.h for a list of defined errors.
Call mxfSystemErrorStringGet() to transform the return code into a text string.
Availability:
Available in MX Foundation 4.0 and later.
See also
mxfRxSamplingKilltimeGet()
mxfSystemTimeBaseSet()
Examples:
ar629_error_injection_detection.c, ar629_error_injection_detection.cs, ar629_updating_data_sampling.c, ar629_updating_data_sampling.cs, ar664_sampling.c, ar664_sampling.cs, ar708_sampling.c, ar708_sampling.cs, mil1553_bc_buserror_trigger.c, and mil1553_bc_buserror_trigger.cs.
uint32 mxfRxSamplingMaxRecordsGet ( HMXF_BUFFER  buffer,
uint64 *  address,
uint64 *  ext 
)
C#
public static extern UInt32 mxfRxSamplingMaxRecordsGet(UInt64 buffer, out UInt64 address, out UInt64 ext);

Returns the maximum number of addresses and extensions of the specified buffer.

Parameters
[in]bufferbuffer handle.
[out]addressmaximum number of addresses.
[out]extmaximum number of extensions.
Returns
MAXT_SUCCESS is returned when the function has succeeded.
Refer to mxf_error.h for a list of defined errors.
Call mxfSystemErrorStringGet() to transform the return code into a text string.
Availability:
Available in MX Foundation 4.0 and later.
See also
mxfRxSamplingMsgSelectSet()
mxfRxSamplingMsgSelectGet()
mxfRxSamplingRead()
mxfRxSamplingSingleRead()
uint32 mxfRxSamplingMsgSelectSet ( HMXF_BUFFER  buffer,
uint64  options,
uint64  select,
uint64  count,
void *  msg 
)

Selects or deselects the message(s) to be received on the specified sampling buffer.

Upon data arrival, the embedded process checks if the received message is found in the current selection list. The receive data record will be added to the sampling 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.

Parameters
[in]bufferbuffer handle.
[in]optionsfiltering option
Option Description
MXF_MSG_SELECT_OPTION_DEFAULT filter based on the address of the message.
MXF_MSG_SELECT_OPTION_EXTENDED filter based on the address/extension of the message (MIL1553 only).
[in]selectaction to perform with the message ID array.
Option Description
MXF_MSG_DESELECT Deselects the message ID.
MXF_MSG_SELECT_ADD Adds the specified message ID.
MXF_MSG_SELECT_ONLY Replaces the current selection with the provided list .
[in]countcount of msg in the array.
[in]msgarray of message(s) id structure.
Channel class Message identifier structure
ARINC 429 MXF_MSGID_A429
MIL-STD-1553 MXF_MSGID_MIL1553
CSDB MXF_MSGID_CSDB
ARINC 629 MXF_MSGID_A629
ARINC 708 MXF_MSGID_A708
CAN MXF_MSGID_CANBUS
Note
When the count is set to 0 and msg is set to NULL this means all possible message addresses for the protocol. In ARINC 429 and CSDB, the 256 labels are selected implicitly. In MIL1553, all possible RT addresses or RT addresses/subaddresses are selected depending on the MXF_MSG_SELECT_OPTION_EXTENDED option.
Returns
MAXT_SUCCESS is returned when the function has succeeded.
Refer to mxf_error.h for a list of defined errors.
Call mxfSystemErrorStringGet() to transform the return code into a text string.
Availability:
Available in MX Foundation 4.0 and later.
See also
mxfRxSamplingMsgSelectGet()
uint32 mxfRxSamplingMsgSelectGet ( HMXF_BUFFER  buffer,
uint64  options,
uint64  maxCount,
uint64 *  count,
void *  msg 
)

Returns the list of message identifiers defined for the specified sampling buffer.

Parameters
[in]bufferbuffer handle.
[in]optionsfiltering option
Options Description
MXF_MSG_SELECT_OPTION_DEFAULT filter based on the address of the message.
MXF_MSG_SELECT_OPTION_EXTENDED filter based on the address/extension of the message (MIL1553 only).
[in]maxCountmaximum number of messages in the array msg.
[out]countreturned number msg in the msg array.
[out]msgaddress of the returned message array.
Channel class Message identifier structure
ARINC 429 MXF_MSGID_A429
MIL-STD-1553 MXF_MSGID_MIL1553
CSDB MXF_MSGID_CSDB
ARINC 629 MXF_MSGID_A629
ARINC 708 MXF_MSGID_A708
CAN MXF_MSGID_CANBUS
Returns
MAXT_SUCCESS is returned when the function has succeeded.
Refer to mxf_error.h for a list of defined errors.
Call mxfSystemErrorStringGet() to transform the return code into a text string.
Availability:
Available in MX Foundation 4.0 and later.
See also
mxfRxSamplingMsgSelectSet()
uint32 mxfRxSamplingRead ( HMXF_BUFFER  buffer,
uint64  flags,
uint64  maxMsgCount,
uint64  maxBytesCount,
uint64 *  msgCount,
uint64 *  byteCount,
void *  rec 
)

Generic function to read all sampling records from the sampling buffer to the application buffer.

Each channel class has its specific function (example: mxfMIL1553RxSamplingRead). For C#, only the specific functions are available.

The sampling process maintains records for all of the received addresses (i.e. label). An address is considered received if corresponding data words 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 and the number of errors, as well as the latest data received for that address.

Parameters
[in]bufferbuffer handle.
[in]flagsoption flag.
Flags Description
MXF_RXSAMPLING_FLAG_DEFAULT The record is kept in the buffer and the same record can be read again by the current or another application.
MXF_RXSAMPLING_FLAG_ERASE_WHEN_READ After the sampling record is returned, it is removed from the buffer.
[in]maxMsgCountmaximum number of messages to read (0 means all messages).
[in]maxBytesCountmaximum number of bytes to read.
[out]msgCountnumber of messages returned.
[out]byteCountnumber of bytes returned.
[out]recarray of message record structure. The record format depends on the channel class. The records in the buffer need to be indexed using mxfNextRecordPtrGet() function.
Channel class Sampling record structure
ARINC 429 MXF_A429_SAMPREC
MIL-STD-1553 MXF_MIL1553_SAMPREC
CSDB MXF_CSDB_SAMPREC
ARINC 629 MXF_A629_SAMPREC
ARINC 708 MXF_A708_SAMPREC
DISCRETE MXF_DISCRETE_SAMPREC
ARINC 664 MXF_A664_SAMPREC
Analog MXF_ANALOG_SAMPREC
CAN MXF_CANBUS_SAMPREC
Flex Analog MXF_FLEXANALOG_SAMPREC
Flex DIO MXF_FLEXDIO_SAMPREC
Returns
MAXT_SUCCESS is returned when the function has succeeded.
Refer to mxf_error.h for a list of defined errors.
Call mxfSystemErrorStringGet() to transform the return code into a text string.
Availability:
Available in MX Foundation 4.0 and later.
See also
mxfRxSamplingBufferAlloc()
mxfRxSamplingMsgSelectSet()
mxfRxSamplingStart()
mxfRxSamplingSingleRead()
mxfNextRecordPtrGet()
mxfRxSamplingReadAsync()
uint32 mxfRxSamplingReadAsync ( HMXF_BUFFER  buffer,
uint64  flags,
uint64  maxMsgCount,
uint64  maxBytesCount,
void *  hostBuffer,
MXF_ASYNCHRONOUS_CALLBACK  readCompletion,
void *  context 
)
C#
public static extern UInt32 mxfRxSamplingReadAsync(UInt64 buffer, UInt64 flags, UInt64 maxMsgCount, UInt64 maxBytesCount, IntPtr hostBuffer, MXF_ASYNCHRONOUS_CALLBACK readCompletion, IntPtr context);

Reads asynchronously all sampling records from the sampling buffer to the application buffer. 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 sampling process maintains records for all of the received addresses (i.e. label). An address is considered received if corresponding data words 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 and the number of errors, as well as the latest data received for that address.

Parameters
[in]bufferbuffer handle.
[in]flagsoption flag.
Flags Description
MXF_RXSAMPLING_FLAG_DEFAULT The record is kept in the buffer and the same record can be read again by the current or another application.
MXF_RXSAMPLING_FLAG_ERASE_WHEN_READ After the sampling record is returned, it is removed from the buffer.
[in]maxMsgCountmaximum number of messages to read (0 means all messages).
[in]maxBytesCountmaximum number of bytes to read.
[out]hostBufferarray of message record structure. The record format depends on the channel class. The records in the buffer need to be indexed using mxfNextRecordPtrGet() function.
Channel class Sampling record structure
ARINC 429 MXF_A429_SAMPREC
MIL-STD-1553 MXF_MIL1553_SAMPREC
CSDB MXF_CSDB_SAMPREC
ARINC 629 MXF_A629_SAMPREC
ARINC 708 MXF_A708_SAMPREC
DISCRETE MXF_DISCRETE_SAMPREC
ARINC 664 MXF_A664_SAMPREC
Analog MXF_ANALOG_SAMPREC
CAN MXF_CANBUS_SAMPREC
Flex Analog MXF_FLEXANALOG_SAMPREC
Flex DIO MXF_FLEXDIO_SAMPREC
[in]readCompletioncallback function to be called when read process has been completed. Callback function is defined as follow:
1 typedef void (*MXF_ASYNCHRONOUS_CALLBACK)(HMXF_BUFFER bufferHandle, uint32 result, void* context, uint64* output);
[in] bufferHandle: buffer handle.
[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 number of messages returned in hostBuffer. output[1] contains the number of bytes returned in hostBuffer.
[in]contextpointer to a value that will be passed to the callback handler (optional).
Returns
MAXT_SUCCESS is returned when the function has succeeded.
Refer to mxf_error.h for a list of defined errors.
Call mxfSystemErrorStringGet() to transform the return code into a text string.
Availability:
Available in MX Foundation 4.0 and later.
See also
mxfRxSamplingRead()
uint32 mxfRxSamplingSingleRead ( HMXF_BUFFER  buffer,
uint64  flags,
void *  msg,
void *  rec 
)

Reads a specific sampling record from the sampling buffer.

Parameters
[in]bufferbuffer handle.
[in]flagsoption flag.
Flags Description
MXF_RXSAMPLING_FLAG_DEFAULT The record is kept in the buffer and the same record can be read again by the current or another application.
MXF_RXSAMPLING_FLAG_ERASE_WHEN_READ After the sampling record is returned, it is removed from the buffer.
[in]msgmessage identifier address.
Channel class Message identifier structure
ARINC 429 MXF_MSGID_A429
MIL-STD-1553 MXF_MSGID_MIL1553
CSDB MXF_MSGID_CSDB
ARINC 629 MXF_MSGID_A629
ARINC 708 MXF_MSGID_A708
CAN MXF_MSGID_CANBUS
[out]recaddress of sampling record. The record format depends on the channel class.
Channel class Sampling record structure
ARINC 429 MXF_A429_SAMPREC
MIL-STD-1553 MXF_MIL1553_SAMPREC
CSDB MXF_CSDB_SAMPREC
ARINC 629 MXF_A629_SAMPREC
ARINC 708 MXF_A708_SAMPREC
CAN MXF_CANBUS_SAMPREC
Returns
MAXT_SUCCESS is returned when the function has succeeded.
Refer to mxf_error.h for a list of defined errors.
Call mxfSystemErrorStringGet() to transform the return code into a text string.
Availability:
Available in MX Foundation 4.0 and later.
See also
mxfRxSamplingBufferAlloc()
mxfRxSamplingMsgSelectSet()
mxfRxSamplingStart()
mxfRxSamplingStop()
mxfRxSamplingRead()
mxfRxSamplingSingleReadAsync()
uint32 mxfRxSamplingSingleReadAsync ( HMXF_BUFFER  buffer,
uint64  flags,
void *  msg,
void *  hostBuffer,
MXF_ASYNCHRONOUS_CALLBACK  readCompletion,
void *  context 
)
C#
public static extern UInt32 mxfRxSamplingSingleReadAsync(UInt64 buffer, UInt64 flags, IntPtr msg, IntPtr hostBuffer, MXF_ASYNCHRONOUS_CALLBACK readCompletion, IntPtr context);

Reads asynchronously a specific sampling record from the sampling buffer. 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.

Parameters
[in]bufferbuffer handle.
[in]flagsoption flag.
Flags Description
MXF_RXSAMPLING_FLAG_DEFAULT The record is kept in the buffer and the same record can be read again by the current or another application.
MXF_RXSAMPLING_FLAG_ERASE_WHEN_READ After the sampling record is returned, it is removed from the buffer.
[in]msgmessage identifier address.
Channel class Message identifier structure
ARINC 429 MXF_MSGID_A429
MIL-STD-1553 MXF_MSGID_MIL1553
CSDB MXF_MSGID_CSDB
ARINC 629 MXF_MSGID_A629
ARINC 708 MXF_MSGID_A708
CAN MXF_MSGID_CANBUS
[out]hostBufferaddress of sampling record. The record format depends on the channel class.
Channel class Sampling record structure
ARINC 429 MXF_A429_SAMPREC
MIL-STD-1553 MXF_MIL1553_SAMPREC
CSDB MXF_CSDB_SAMPREC
ARINC 629 MXF_A629_SAMPREC
ARINC 708 MXF_A708_SAMPREC
CAN MXF_CANBUS_SAMPREC
[in]readCompletioncallback function to be called when read process has been completed. Callback function is defined as follow:
1 typedef void (*MXF_ASYNCHRONOUS_CALLBACK)(HMXF_BUFFER bufferHandle, uint32 result, void* context, uint64* output);
[in] bufferHandle: buffer handle.
[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 number of messages returned in hostBuffer.
[in]contextpointer to a value that will be passed to the callback handler (optional).
Returns
MAXT_SUCCESS is returned when the function has succeeded.
Refer to mxf_error.h for a list of defined errors.
Call mxfSystemErrorStringGet() to transform the return code into a text string.
Availability:
Available in MX Foundation 4.0 and later.
See also
mxfRxSamplingSingleRead()
uint32 mxfRxSamplingRecordSizeGet ( HMXF_BUFFER  buffer,
uint64 *  size 
)
C#
public static extern UInt32 mxfRxSamplingRecordSizeGet(UInt64 buffer, out UInt64 size);

Returns the size of a the structure sampling record.

Parameters
[in]bufferbuffer handle.
[out]sizereturned record size, in bytes.
Returns
MAXT_SUCCESS is returned when the function has succeeded.
Refer to mxf_error.h for a list of defined errors.
Call mxfSystemErrorStringGet() to transform the return code into a text string.
Availability:
Available in MX Foundation 4.0 and later.
See also
mxfChannelRecordSizeGet()
uint32 mxfRxSamplingStart ( HMXF_BUFFER  buffer)
C#
public static extern UInt32 mxfRxSamplingStart(UInt64 buffer);

Starts the sampling process for the specified sampling buffer.

The sampling process maintains sampling records for all of the received addresses (i.e. label) defined previously with mxfRxSamplingMsgSelectSet().

A message (for a registered address) is considered received if corresponding data words were received within the kill-time period.

The sampling record contains information on the arrival rate and the number of errors, as well as the latest data received for that point.

Parameters
[in]bufferbuffer handle.
Returns
MAXT_SUCCESS is returned when the function has succeeded.
Refer to mxf_error.h for a list of defined errors.
Call mxfSystemErrorStringGet() to transform the return code into a text string.
Availability:
Available in MX Foundation 4.0 and later.
See also
mxfRxSamplingBufferAlloc()
mxfRxSamplingRead()
mxfRxSamplingSingleRead()
mxfRxSamplingStop()
Examples:
adc_sampling.c, ar429_rx_event_handler.c, ar429_rx_event_handler.cs, ar429_rx_sampling.c, ar429_rx_sampling.cs, ar629_error_injection_detection.c, ar629_error_injection_detection.cs, ar629_updating_data_sampling.c, ar629_updating_data_sampling.cs, ar664_sampling.c, ar664_sampling.cs, ar708_sampling.c, ar708_sampling.cs, ar708_tx_error_injection.c, ar708_tx_error_injection.cs, canbus_sampling.c, csdb_rx_event_handler.c, csdb_rx_event_handler.cs, csdb_rx_sampling.c, csdb_rx_sampling.cs, flexadc_sampling.c, flexdio_fifo_sampling.c, mil1553_bc_buserror_trigger.c, and mil1553_bc_buserror_trigger.cs.
uint32 mxfRxSamplingStop ( HMXF_BUFFER  buffer)
C#
public static extern UInt32 mxfRxSamplingStop(UInt64 buffer);

Stops the sampling process for the specified sampling buffer. All samples received are freed and not available to be read.

Parameters
[in]bufferbuffer handle.
Returns
MAXT_SUCCESS is returned when the function has succeeded.
Refer to mxf_error.h for a list of defined errors.
Call mxfSystemErrorStringGet() to transform the return code into a text string.
Availability:
Available in MX Foundation 4.0 and later.
See also
mxfRxSamplingStart()
Examples:
adc_sampling.c, ar429_rx_event_handler.c, ar429_rx_event_handler.cs, ar429_rx_sampling.c, ar429_rx_sampling.cs, ar629_error_injection_detection.c, ar629_error_injection_detection.cs, ar629_updating_data_sampling.c, ar629_updating_data_sampling.cs, ar664_sampling.c, ar664_sampling.cs, ar708_sampling.c, ar708_sampling.cs, ar708_tx_error_injection.c, ar708_tx_error_injection.cs, canbus_sampling.c, csdb_rx_event_handler.c, csdb_rx_event_handler.cs, csdb_rx_sampling.c, csdb_rx_sampling.cs, flexadc_sampling.c, flexdio_fifo_sampling.c, mil1553_bc_buserror_trigger.c, and mil1553_bc_buserror_trigger.cs.
Updated 03/30/2022