MX Foundation 4
RelayBox Functions Reference

Functions

uint32 mxfRelayBoxConfigSet (HMXF_DEVICE handle, uint64 options, uint64 val)
 
uint32 mxfRelayBoxStatusGet (HMXF_DEVICE handle, uint64 *rotarySw, uint64 *db9, uint64 *softMask, uint64 *relayMask)
 
uint32 mxfRelayBoxReset (HMXF_DEVICE handle)
 
uint32 mxfRelayBoxTemperatureSensorRead (HMXF_DEVICE handle, double *temperature)
 

Detailed Description

Function Documentation

uint32 mxfRelayBoxConfigSet ( HMXF_DEVICE  handle,
uint64  options,
uint64  val 
)
C#
public static extern UInt32 mxfRelayBoxConfigSet(UInt64 handle, UInt64 options, UInt64 val);

Configures the RelayBox. The configuration can be made by position or by mask.
By position, the configuration possibilities are equivalent to the rotary switch. With this option, only one pair of groups can be commutated at a given time and includes all 16 relays of each group. The position is internally converted to a mask that can be returned by mxfRelayBoxStatusGet().
By mask, the 64-bit value is divided in 4 16-bit, one 16-bit for each group (A, B, C and D) and one bit for each relay in that group. The 16-bit LSB is group A and MSB is group D. In each group, the LSB is relay 0 and MSB relay 15.

Note
For this function to work, the rotary switch and TTL control of the RelayBox must be set to Off.
Parameters
[in]handledevice handle
[in]optionsconfiguration options
Options Description
MXF_RELAYBOX_CONFIG_OPT_POS Configure using a position
MXF_RELAYBOX_CONFIG_OPT_MASK Configure using a mask
[in]valconfiguration value
For position option, the value is one of 7 positions corresponding to the rotary switch.
Position option Description
MXF_RELAYBOX_CONFIG_POS_OFF The relays are set to Off
MXF_RELAYBOX_CONFIG_POS_AB The relays from A and B are commutated
MXF_RELAYBOX_CONFIG_POS_AC The relays from A and C are commutated
MXF_RELAYBOX_CONFIG_POS_AD The relays from A and D are commutated
MXF_RELAYBOX_CONFIG_POS_BC The relays from B and C are commutated
MXF_RELAYBOX_CONFIG_POS_BD The relays from B and D are commutated
MXF_RELAYBOX_CONFIG_POS_CD The relays from C and D are commutated

For mask option, the 64-bit value is divided in 4 16-bit, one 16-bit for each group (A, B, C and D) and one bit for each relay in that group. The 16-bit LSB is group A and MSB is group D. In each group, the LSB is relay 0 and MSB relay 15.
For example, to link relay 0 of all 4 groups together, the mask to use will be 0x0001000100010001.
To link A2 to B2 and C2, the mask to use is 0x0000000400040004.
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.6.1 and later.
See also
mxfRelayBoxStatusGet()
Examples:
relaybox.c, relaybox.cs, relaybox_demo.c, and relaybox_demo.cs.
uint32 mxfRelayBoxStatusGet ( HMXF_DEVICE  handle,
uint64 *  rotarySw,
uint64 *  db9,
uint64 *  softMask,
uint64 *  relayMask 
)
C#
public static extern UInt32 mxfRelayBoxStatusGet(UInt64 handle, out UInt64 rotarySw, out UInt64 db9, out UInt64 softMask, out UInt64 relayMask);
public static extern UInt32 mxfRelayBoxStatusGet(UInt64 handle, out UInt64 rotarySw, out UInt64 db9, out UInt64 softMask, IntPtr relayMask);
public static extern UInt32 mxfRelayBoxStatusGet(UInt64 handle, out UInt64 rotarySw, out UInt64 db9, IntPtr softMask, out UInt64 relayMask);
public static extern UInt32 mxfRelayBoxStatusGet(UInt64 handle, out UInt64 rotarySw, out UInt64 db9, IntPtr softMask, IntPtr relayMask);
public static extern UInt32 mxfRelayBoxStatusGet(UInt64 handle, out UInt64 rotarySw, IntPtr db9, out UInt64 softMask, out UInt64 relayMask);
public static extern UInt32 mxfRelayBoxStatusGet(UInt64 handle, out UInt64 rotarySw, IntPtr db9, out UInt64 softMask, IntPtr relayMask);
public static extern UInt32 mxfRelayBoxStatusGet(UInt64 handle, out UInt64 rotarySw, IntPtr db9, IntPtr softMask, out UInt64 relayMask);
public static extern UInt32 mxfRelayBoxStatusGet(UInt64 handle, out UInt64 rotarySw, IntPtr db9, IntPtr softMask, IntPtr relayMask);
public static extern UInt32 mxfRelayBoxStatusGet(UInt64 handle, IntPtr rotarySw, out UInt64 db9, out UInt64 softMask, out UInt64 relayMask);
public static extern UInt32 mxfRelayBoxStatusGet(UInt64 handle, IntPtr rotarySw, out UInt64 db9, out UInt64 softMask, IntPtr relayMask);
public static extern UInt32 mxfRelayBoxStatusGet(UInt64 handle, IntPtr rotarySw, out UInt64 db9, IntPtr softMask, out UInt64 relayMask);
public static extern UInt32 mxfRelayBoxStatusGet(UInt64 handle, IntPtr rotarySw, out UInt64 db9, IntPtr softMask, IntPtr relayMask);
public static extern UInt32 mxfRelayBoxStatusGet(UInt64 handle, IntPtr rotarySw, IntPtr db9, out UInt64 softMask, out UInt64 relayMask);
public static extern UInt32 mxfRelayBoxStatusGet(UInt64 handle, IntPtr rotarySw, IntPtr db9, out UInt64 softMask, IntPtr relayMask);
public static extern UInt32 mxfRelayBoxStatusGet(UInt64 handle, IntPtr rotarySw, IntPtr db9, IntPtr softMask, out UInt64 relayMask);
public static extern UInt32 mxfRelayBoxStatusGet(UInt64 handle, IntPtr rotarySw, IntPtr db9, IntPtr softMask, IntPtr relayMask);

Returns the status of the RelayBox. The position of the rotary switch, the TTL control value, the software mask value and the current relay mask value are returned.
The relayMask returns the current mask value configuration applied to the RelayBox relays. The priority, from the highest to lowest is: Rotary Switch — TTL control port — Software.

Parameters
[in]handledevice handle
[out]rotarySwrotary switch position. Optional, pass NULL if not needed. The value is one of 7 positions corresponding to the rotary switch.
Position Description
MXF_RELAYBOX_CONFIG_POS_OFF The relays are set to Off
MXF_RELAYBOX_CONFIG_POS_AB The relays from A and B are commutated
MXF_RELAYBOX_CONFIG_POS_AC The relays from A and C are commutated
MXF_RELAYBOX_CONFIG_POS_AD The relays from A and D are commutated
MXF_RELAYBOX_CONFIG_POS_BC The relays from B and C are commutated
MXF_RELAYBOX_CONFIG_POS_BD The relays from B and D are commutated
MXF_RELAYBOX_CONFIG_POS_CD The relays from C and D are commutated
[out]db9TTL control value. 8-bit bitmask, one bit for each pin. Pin #1 is LSB, pin #8 is MSB. Only bit 0-2 are currently used. Optional, pass NULL if not needed.
3-bit bitmask value (Bit 0-2) Description
0-0-0 The relays are set to Off
0-0-1 The relays from A and B are commutated
0-1-0 The relays from A and C are commutated
0-1-1 The relays from A and D are commutated
1-0-0 The relays from B and C are commutated
1-0-1 The relays from B and D are commutated
1-1-0 The relays from C and D are commutated
[out]softMasksoftware configuration mask value. The 64-bit value is divided in 4 16-bit, one 16-bit for each group (A, B, C and D) and one bit for each relay in that group. The 16-bit LSB is group A and MSB is group D. In each group, the LSB is relay 0 and MSB relay 15. Optional, pass NULL if not needed.
[out]relayMaskcurrent relay mask value. The 64-bit value is divided in 4 16-bit, one 16-bit for each group (A, B, C and D) and one bit for each relay in that group. The 16-bit LSB is group A and MSB is group D. In each group, the LSB is relay 0 and MSB relay 15. Optional, pass NULL 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.6.1 and later.
See also
mxfRelayBoxConfigSet()
Examples:
relaybox.c, relaybox.cs, relaybox_demo.c, and relaybox_demo.cs.
uint32 mxfRelayBoxReset ( HMXF_DEVICE  handle)
C#
public static extern UInt32 mxfRelayBoxReset(UInt64 handle);

Resets the RelayBox. The software mask will be set to 0 by this function.

Parameters
[in]handledevice 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.6.1 and later.
See also
mxfRelayBoxConfigSet()
Examples:
relaybox_demo.c, and relaybox_demo.cs.
uint32 mxfRelayBoxTemperatureSensorRead ( HMXF_DEVICE  handle,
double *  temperature 
)
C#
public static extern UInt32 mxfRelayBoxTemperatureSensorRead(UInt64 handle, out Double temperature);

Gets the temperature of the RelayBox.

Parameters
[in]handledevice handle
[out]temperaturecurrent device temperature in DegC.
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.6.1 and later.
See also
mxfRelayBoxStatusGet()
Examples:
relaybox_demo.c, and relaybox_demo.cs.
Updated 10/23/2023