------------------------------------------------------------------------------- Matrox Imaging Library (MIL) 10.0 MIL 9 to MIL 10 IO conversion table for the Matrox Morphis December, 2013 (c) Copyright Matrox Electronic Systems Ltd., 1992-2013. ------------------------------------------------------------------------------- MIL 10 has a new mechanism to control and inquire IO signals. It has unified some concepts under the M_IO_... constants of MsysControl/MsysInquire. Although the old mechanism still works, the old mechanism is deprecated. To port your code to the new mechanism, use the equivalence tables below. Note that the concept of user-defined signals is now treated differently. To output a user-defined signal, you set a bit in a static user output register (M_USER_BIT_STATE). To inquire the state of an auxiliary input signal so that you can act upon it (user input), you inquire the status of the auxiliary signal directly (M_IO_STATUS); you don’t inquire a bit. The following conversion table applies to the Matrox Morphis. Contents 1. MIL 9 to MIL 10 conversion table. 2. MIL 9 to MIL 10 conversion examples. 2.1 Setting a user-bit. 2.2 Inquiring a user-bit. 2.3 Hooking a callback function on a user-bit. 2.4 Setting a grab trigger source. =============================================================================== 1. MIL 9 to MIL 10 conversion table. For M_GRAB_TRIGGER_SOURCE: M_HARDWARE_PORT0 now becomes M_AUX_IO16 Note that the following table includes only equivalences for inquiring whether a signal is an input or an output. MsysInquire M_USER_BIT_MODE + n becomes M_IO_MODE + M_AUX_IOn where n is from 0 to 16 Note that the following table includes only equivalences for setting up output user-defined signals; see the subsequent table for inquiring user input signals (no corresponding register bit). MsysControl M_USER_BIT_VALUE_OUT + n becomes M_USER_BIT_STATE + M_USER_BITn where n is from 0 to 15 Note that the following table includes only equivalences for reading the status of a user input signal. MsysInquire M_USER_BIT_VALUE_IN + n becomes M_IO_STATUS + M_AUX_IOn where n is from 0 to 16 MsysHookFunction M_USER_BIT_CHANGE becomes M_IO_CHANGE Note that the following table includes only equivalences for inquiring which input signal caused the interrupt event. MsysGetHookInfo M_USER_BIT returns n becomes M_IO_INTERRUPT_SOURCE returns M_AUX_IOn where n is from 0 to 15 Note that the following table includes only equivalences for controlling/inquiring whether an input signal should cause an interrupt. MsysControl/Inquire M_USER_BIT_INTERRUPT_STATE + n becomes M_IO_INTERRUPT_STATE + M_AUX_IOn where n is from 0 to 15 Note that the following table includes only equivalences for controlling/inquiring input signals that cause an interrupt. MsysControl/Inquire M_USER_BIT_INTERRUPT_MODE + n becomes M_IO_INTERRUPT_ACTIVATION + M_AUX_IOn where n is from 0 to 15 2. MIL 9 to MIL 10 conversion examples. 2.1 Setting a user-bit. Using Mil 9 IO API: MsysControl(MilSystem, M_USER_BIT_VALUE_OUT + 1, M_ON); MsysControl(MilSystem, M_USER_BIT_MODE + 1, M_OUTPUT); Using Mil 10 IO API: MsysControl(MilSystem, M_USER_BIT_STATE + M_USER_BIT1, M_ON); MsysControl(MilSystem, M_IO_MODE + M_AUX_IO1, M_OUTPUT); 2.2 Inquiring a user-bit. Using Mil 9 IO API: MsysControl(MilSystem, M_USER_BIT_MODE + 1, M_INPUT); MsysInquire(MilSystem, M_USER_BIT_VALUE_IN + 1, &Value); Using Mil 10 IO API: MsysControl(MilSystem, M_IO_MODE + M_AUX_IO1, M_INPUT); MsysInquire(MilSystem, M_IO_STATUS + M_AUX_IO1, &Value); 2.3 Hooking a callback function on a user-bit. Using Mil 9 IO API: MsysControl(MilSystem, M_USER_BIT_MODE + 1, M_INPUT); MsysControl(MilSystem, M_USER_BIT_INTERRUPT_MODE + 1, M_EDGE_RISING); MsysHookFunction(MilSystem, M_USER_BIT_CHANGE, HookHandlerFnc, &HookData); MsysControl(MilSystem, M_USER_BIT_INTERRUPT_STATE + 1, M_ENABLE); MIL_INT HookHandlerFnc(MIL_INT HookType, MIL_ID EventId, void *UserDataPtr) { MIL_INT UserBit = 0; MsysGetHookInfo(EventId, M_USER_BIT, &UserBit); // UserBit will be 1 when interrupt is fired. } Using Mil 10 IO API: MsysControl(MilSystem, M_IO_MODE + M_AUX_IO1, M_INPUT); MsysControl(MilSystem, M_IO_INTERRUPT_ACTIVATION + M_AUX_IO1, M_EDGE_RISING); MsysHookFunction(MilSystem, M_IO_CHANGE, HookHandlerFnc, &HookData); MsysControl(MilSystem, M_IO_INTERRUPT_STATE + M_AUX_IO1, M_ENABLE); MIL_INT HookHandlerFnc(MIL_INT HookType, MIL_ID EventId, void *UserDataPtr) { MIL_INT IOSource = 0; MsysGetHookInfo(EventId, M_IO_INTERRUPT_SOURCE, &IOSource); // IOSource will be M_AUX_IO1 when interrupt is fired. } 2.4 Setting a grab trigger source. Using Mil 9 IO API: MdigControl(MilDigitizer, M_GRAB_TRIGGER_SOURCE, M_HARDWARE_PORT0); Using Mil 10 IO API: MdigControl(MilDigitizer, M_GRAB_TRIGGER_SOURCE, M_AUX_IO16);