MX Foundation 4
Attributes

Analog parameters, like conversion period and input range can be read or modified using the mxfAttributeUint64Get(), mxfAttributeDoubleGet(), mxfAttributeUint64Set() and mxfAttributeDoubleSet() functions, passing the handle (device, module or channel) and attribute key-value pair.

See the section Attributes Reference for a description of all supported attributes.

Some other utility functions are used for getting more information about attributes;

The following code shows how to configure an ADC module conversion period to 100msec and input range to +/-5V SE.

{
HMXF_SERVER server; // Server handle
HMXF_DEVICE device; // Device handle
HMXF_MODULE module; // Module handle
HMXF_CHANNEL channel; // Channel handle
uint64 deviceIdx = 0; // Device index #0
uint64 moduleType = MXF_MODULE_FLEXADC; // FLEXADC module
uint64 moduleCount;
uint32 rc;
//Connects to the server
rc=mxfServerConnect("0.0.0.0", "", "", 0, &server);
//MXF initialization
if (!rc)
rc = mxfSystemInit(server);
//Obtains the first device handle
if(!rc)
rc = mxfSystemDeviceGet(server, deviceIdx, &device);
//Obtains the first module handle
if(!rc)
rc = mxfDeviceModuleAllGet(device, moduleType, 1, &moduleCount, &module);
// Sets the module conversion period to 100msec (10Hz) and input range to +/-5V SE
if(!rc && moduleCount)
{
// Get a handle to first Analog FlexADC channel
rc = mxfModuleChannelGet(module, 0, &channel);
if(!rc)
rc = mxfAttributeUint64Set(module, KMXF_FLEXADC_MODULE_CONVERSION_PERIOD, 100*1000*1000);
if(!rc)
rc = mxfAttributeUint64Set(channel, KMXF_FLEXADC_CHN_INPUT_RANGE, VMXF_FLEXADC_CHN_INPUT_RANGE_SE_BIPOLAR_5V);
}
}
Updated 10/23/2023