MX Foundation 4
Sending IO signals

The state of the discrete output lines can be directly set by the mxfFlexDIOChannelWrite() function.

The example below shows how the mxfFlexDIOChannelWrite() function can be used to set the state of one discrete output line.

Example

flexdio.c

uint32 rc;
HMXF_CHANNEL io=0;
uint64 i;
uint64 state;
...
// Read value of input pin #1 and set it to output pin #2 for about 10 seconds
for(i=0; i < 10000 && !rc; i++)
{
rc = mxfFlexDIOChannelRead(io, 0x02, &state);
state<<=1; // to be aligned with mask 0x04
state = ~state;
if(!rc)
rc = mxfFlexDIOChannelWrite(io, 0x04, state);
}
...
Updated 10/23/2023