MX Foundation 4
Attributes

Discrete parameter attributes such as edge detection, internal loopback and others can be read or modified using the mxfAttributeUint64Get() and the mxfAttributeUint64Set() 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 to get information about attributes:

The following code shows how to set attributes for a discrete input channel.

HMXF_SERVER server;
HMXF_CHANNEL channel;
HMXF_DEVICE device;
HMXF_MODULE module;
uint64 count, ports;
uint32 rc;
// Connects to local server
rc = mxfServerConnect("0.0.0.0", "", "", FALSE, &server);
if (rc)
return;
// Inits and server config
rc = mxfSystemInit(server);
if (!rc)
{
// Gets the device handle
rc = mxfSystemDeviceAllGet(server, MXF_DEVICE_ALL, 1, &count, &device);
if (!rc)
{
// Gets the module handle
rc = mxfDeviceModuleAllGet(device, MXF_MODULE_DIOFIFO_EH, 1, &count, &module);
if (rc)
// Gets the channel handle
rc = mxfModuleChannelAllGet(module, MXF_CLASS_DISCRETE, MXF_SCLASS_RX_CHANNEL, 1, &count, &channel);
}
}
if (!rc)
{
// Gets the number of input pins
rc = mxfAttributeUint64Get(channel, KMXF_DISCRETE_NUMPORT, &ports);
if (!rc)
printf("Number of ports = %llu\n", ports);
else
printf("Error code=0x%lX\n", rc);
}
if (!rc)
{
// Sets Edge capture to first pin to rising edge
rc = mxfAttributeUint64Set(channel, KMXF_DISCRETE_RX_EDGE_RISING, 0x0001);
}
if (rc)
printf("Error code=0x%lX\n", rc);
Updated 10/23/2023