User signals

User signals

Auxiliary signals can also be used to transmit or receive application-specific user output and/or input.
If you want to start or stop an external event based on some calculation or analysis, you can manually set the state of any auxiliary output signal (or I/O signal set to output) to high or low. To do so, you set the state (on/off) of a bit in a user settable register (static-user-output register). When the bit is on, its associated auxiliary output signal will be high; when it is off, the auxiliary output signal will be low. This bit is referred to as a user-bit. To route the state of a user-bit to an auxiliary output signal, use MdigControl() with M_IO_SOURCE and M_USER_BITn; to set the state of a user-bit, use MdigControl() with M_USER_BIT_STATE.
Your application can also act upon and interpret the state of an auxiliary input signal (or I/O signal set to input). The state of an auxiliary input signal is not associated with a user-bit; you poll the state of the signal directly. To poll the state of an auxiliary input signal, use MdigInquire() with M_IO_STATUS. The state of an auxiliary input signal can also generate an interrupt; to do so, use MdigControl() with M_IO_INTERRUPT_STATE and then use MdigHookFunction() with M_IO_CHANGE to hook a function to this event (that is, to set up an event handler).