Home

Moxa M-1400

image

Contents

1. AO SetSafeValue AO GetSafeRaws AO SetSafeRaws AO GetSafeRaw AO SetSafeRaw ioLogik MXIO DLL API Reference MXIO API Overview Analog Output Commands for ioLogik E2000 R2000 Function Name 2 GetRanges 2 SetRanges 2 GetRange 2 SetRange 2 GetPovverOnValues 2 SetPovverOnValues 2 GetPowerOnValue 2 SetPovverOnValue 2 GetPowerOnRaws 2 SetPovverOnRavvs 2 GetPovverOnRavv 2 SetPovverOnRavv Analog Output Commands for ioLogik 4000 Function Name AO4K GetSafeActions 4 SetSafeActions 4 GetSafeAction 4 SetSafeAction RTD Commands Function Name RTD Reads RTD Read RTD ReadRaws RTD ReadRaw RTD2K ResetMin RTD2K ResetMins RTD2K ResetMax RTD2K ResetMaxs RTD2K ReadMinRaw RTD2K ReadMinRaws RTD2K ReadMaxRaw RTD2K ReadMaxRaws RTD2K ReadMin RTD2K ReadMins RTD2K ReadMax RTD2K ReadMaxs RTD2K GetStartStatus RTD2K SetStartStatus RTD2K GetStartStatuses RTD2K SetStartStatuses ioLogik MX IO DLL API Reference MXIO API Overview Function Name RTD2K_GetSensorType RTD2K SetSensorType RTD2K GetSensorTypes RTD2K SetSensorTypes RTD2K GetEngUnit RTD2K SetEngUnit RTD2
2. 2 7 Direct VO Comimatid Setske ra 2 7 APEOVETVIEW a ee eee 3 1 System Command 8 5 3 2 RS 485 RS 232 I O Connect 5 2 nn nn 3 2 Ethernet I O Connect 5 3 2 General Commands ih AI AA Aen a 3 2 Special Commands for ioLogik E2000 2000 222 3 2 Special Commands for i0 Logik 4000 00 ee eeceecceseceseceseeeeceseceseceeeceecaeeeaeeeneeeeeeereees 3 2 Modbus Command 5 5 3 3 Direct VO Command Sets s c ssh A de ae ben dotted viele Gat 3 3 Digital Input 5 3 3 Digital Input Commands for ioLogik E2000 R2000 2222 3 3 Digital Input Output Mode Commands for ioLogik 2000 222 2 2222 3 3 Counter Commands for ioLogik E2000 2000 2222 3 4 Digital Output 45 3 4 Digital Output Commands for ioLogik 2000 2000 2 3 5 Digital Output Commands for ioLogik 40
3. ioLogik MXIO DLL API Reference Overview i PC Linux 2 4 UC 7110 LX UC 7408 LX Hun Windows 5 1 inux 2 6 UC 7112 LX UC 7420 LX A 240 LX v v v K Pulse2K SetPowerOnValue Pulse2K GetSafeValues Pulse2K SetSafeValues Pulse2K GetSafeValue Pulse2K SetSafeValue AI2K ReadMins AI2K ReadMinRaws AI2K ResetMins AI2K ReadMin AI2K ReadMinRaw AI2K ResetMin AI2K ReadMaxs AI2K ReadMaxRaws AI2K ResetMaxs AI2K ReadMax AI2K ReadMaxRaw AI2K ResetMax AT2K GetRanges AI2K SetRanges AI2K GetRange AI2K SetRange 2 GetRanges 2 SetRanges 2 GetRange 2 SetRange 2 GetPowerOnValues 2 SetPowerOnValues 2 GetPowerOnValue 2 SetPowerOnValue 2 GetPowerOnRaws 2 SetPowerOnRaws 2 GetPowerOnRaw 2 SetPovverOnRavv DIO2K GetlOMode DIO2K SetlOMode DIO2K GetlOModes DIO2K SetlOModes Logic2K GetStartStatus Logic2K SetStartStatus Message2K Start Message2K Stop AL sla sl ala al sl sla l kala a S Aa aaa saa a s SA AAS lt lt lt lt lt lt lt lt lt lt lt lt lt SES SI SPST STATS AEST AEST S S S S S S SESE lt lt lt APPA S M S R APSE S S SESE SPE SPESES SA SE SA SS SA SA SA SA SA SA SA SA SA SA SAS S S SESE SESE SY AP SPATS A AY ALATEST S S ss s SES SI Isla A A S S S
4. gu ri Windows pc Linux 2 6 UC 7112 LX UC 7420 LX 240 DI Reads v A vi vi DI Read v v vi vi DO Reads v vi vi vi DO Writes v v v v v DO Read v v v v DO Write v v vi vi vi DO GetSafeValues v v vi vi vi DO SetSafeValues v v vi vi vi DO GetSafeValue v v v v DO SetSafeValue v A vi vi vi AT Reads v v vi vi AT Read v vi vi AT ReadRavvs v v A vi AT ReadRavv v vi vi AO Reads V v v v AO Writes v A vi vi vi AO Read v vi vi vi AO Write v V vi vi AO ReadRavvs A v vi vi vi AO_WriteRaws v v vi vi AO ReadRavv v v vi vi vi AO_WriteRaw v v vi vi AO GetSafeValues v v vi vi vi AO SetSafeValues v v vi vi v AO GetSafeValue v v v v AO SetSafeValue v v vi vi v AO_GetSafeRaws v vi vi vi AO SetSafeRavvs v v vi vi vi AO_GetSafeRaw v vi vi AO SetSafeRavv v v vi vi RTD Reads v vi vi RTD Read v A vi vi vi V v vi V V v v V v V V V V v V v vi V v v V v vV v V v vi vi V vV v vi V v V v vi V v V v vi V v V vV v V v V v v V v V v vi V V V v ioLogik MXIO DLL API Reference Overview PC Linux 2 4 UC 7110 LX UC 7408 LX puncte Windows pc Linux 2 6 UC 7112 LX UC 7420 Lx A 240 LX RTD2K ReadMaxs v v vi v RTD2K GetStartStatus v v vi vi 2 SetStartStatus v v vi vi
5. Return Value hConnection BYTE bytChannel BYTE wMode The handle for an I O connection The desired channel A pointer to the mode of tthe desired D O channel The values are 0 D O mode 1 Pulse mode DO2K_SetMode This function code is used to set the mode for a specific D O channel int DO2K_SetMode int Arguments hConnection bytChannel wMode Return Value 6 23 hConnection BYTE bytChannel WORD wMode The handle for an I O connection The desired channel A pointer to the mode of the desired D O channel The values are 0 D O mode 1 Pulse mode MXIO_OK Refer to Return Codes ioLogik MXIO DLL API Reference Direct I O Command Sets DO2K GetPovverOnValues This function code is used to get the power on values of contiguous D O channels int DO2K_GetPowerOnValues int Arguments hConnection bytStartChannel bytCount dwValue Return Value hConnection bytStartChannel BYTE bytCount DWORD dwValue The handle for an I O connection BYTE Specifies the starting channel The number of channels to read A pointer to the power on values of the contiguous D O channels each bit holds the value of one channel A bit value of 0 represents the power on status of the start channel A bit value of 1 represents the status of the second digital output channel The values of the unused bits are random MXIO_OK Refer to Return Codes DO2K_SetPowerOnValues
6. 5 of MXIO DLL 4002 _ Handle error 4005 FUNCTION NOT SUPPORT 4007 Function is not supported for designated I O module OUTPUT VALUE OUT OF RANGE 4008 The output value is out of the output range INPUT VALUE OUT OF RANGE 4009 The input value is out of the input range 10 Product Model and ID Reference Table The MXIO DLL library is designed for use by the ioLogik line of remote I O including the ioLogik 4000 E2000 and R2000 A list of supported products is provided below To support new I O modules you must upgrade to this version of the MXIO library ioLogik 4000 Ethernet network adapter Modbus TCP RS 485 network adapter Modbus RTU RS 232 network adapter Modbus RTU Digitallp 0060606067 4 DI sink 24 VDC RTB 4 DI source 24 VDC RTB 4 DI sink 48 VDC RTB 4 DI source 48 VDC RTB 8 DI sink 24 VDC RTB 8 DI source 24 VDC RTB 16 DI sink 24 VDC RTB 16 DI source 24 VDC 20 pin 4 DI 110 VAC RTB 4 DI 220 VAC RTB Digital Output 4 DO sink MOSFET 24 VDC 0 5A RTB 4 DO source MOSFET 24 VDC 0 5A RTB 8 DO sink MOSFET 24 VDC 0 5A RTB 8 DO source MOSFET 24 VDC 0 5A RTB 16 DO sink MOSFET 24 VDC 0 3A 20 pin 16 DO source MOSFET 24 VDC 0 3A 20 pin 4 DO sink MOSFET diag 24 VDC 0 5A RTB 4 DO source MOSFET diag 24 VDC 0 5A RTB 4 DO sink MOSFET diag 24 VDC 2 0A RTB 4 DO source MOSFET diag 24 VDC
7. bytChannel wRange Return Value 6 59 hConnection bytChannel wRange BYTE WORD The handle for an I O connection The desired channel A pointer to the range of the desired A O channel The values are 0 0 10 VDC 1 4 20 mA Oxff disable Others return Illegal Data Value MXIO_OK Refer to Return Codes ioLogik MXIO DLL API Reference Direct I O Command Sets AO2K_SetRange This function code is used to set the range for a specific A O channel int AO2K_SetRange int hConnection bytChannel wRange Arguments Return Value hConnection BYTE _ bytChannel WORD wRange The handle for an I O connection The desired channel Stores the specific A O channel s range The values are 0 0 10 VDC 1 4 20 mA Others return Illegal Data Value MXIO OK Refer to Return Codes AO2K_GetPowerOnValues This function code is used to get the power on values of contiguous A O channels int AO2K_GetPowerOn Values int hConnection bytStartChannel bytCount dValue Arguments Return Value 6 60 hConnection bytStartChannel BYTE bytCount double dValuel 1 The handle for an I O connection BYTE Specifies the starting channel The number of channels to read An array that stores the power on values for the contiguous A O channels dValue 0 represents the value of the starting channel The unit is Vdc for the voltage channel and mA for the current chan
8. bytStartChannel Specifies the starting channel bytCount The number of channels to be set wEngUnit An array that stores the contiguous RTD channel s engineering unit wEngUnit 0 represents the value of the starting channel The values for normal channel are 0 Celsius 1 Fahrenheit 2 Ohm Others_ return Illegal Data Value The values for virtual channels are 0 Celsius 1 Fahrenheit Others_ return Illegal Data Value Return Value MXIO OK Refer to Return Codes RTD2K_GetMathPar This function code is used to get the math parameter for a specific RTD channel int RTD2K_GetMathPar int hConnection BYTE bytChannel WORD wMathPar Arguments hConnection The handle for an I O device connection bytChannel The specific channel to be get wMathPar A pointer that stores the specific RTD channel s math parameter For AVG Bit 0 of high byte represents the first channel and Bit 1 of high byte represents the second channel For DEV the High Byte as subtrahend and Low Byte as minuend Exp AVG b 0000 0000 b 0010 0011 ch5 ch1 ch0 Exp DEV b 0000 0100 b 0010 0000 ch2 ch6 Return Value 6 82 ioLogik MXIO DLL API Reference Direct I O Command Sets RTD2K SetMathPar This function code is used to set the math parameter for a specific RTD channel int RTD2K_SetMathPar int hConnection BYTE bytChannel WORD wMathPar Arguments hConnection The handle for an I O device connection bytChannel The specif
9. int Message2K_Start int iProtocol WORD wPort pfnCALLBACK iProcAddress Callback Function Void FunctionName BYTE bytDatafl WORD v sSize Arguments iProtocol Transmission protocol 1 TCP 2 UDP wPort TCP or UDP port number iProcAddress Callback function which is called after receiving an active I O message from an ioLogik E2000 Ethernet I O bytData An array that stores the message yvSize Array size Return Value Succeed MXIO OK Fail Refer to Retum Codes Message2K Stop This function code is used to stop receiving active 1 O messages from an ioLogik E2000 Ethernet I O C C int Message2K Stop int iProtocol Arguments iProtocol Transmission protocol 1 TCP 2 UDP Return Value MXIO OK Refer to Return Codes 9 Return Codes Return Value Value Description 1 OK Function call was successful ILLEGAL FUNCTION ILLEGAL DATA ADDRESS ILLEGAL DATA VALUE SLAVE DEVICE FAILURE SLAVE DEVICE BUSY EIO TIME OUT EIO INIT SOCKETS FAIL EIO CREATING SOCKET ERROR EIO RESPONSE BAD EIO SOCKET DISCONNECT PROTOCOL TYPE ERROR SIO OPEN FAIL SIO TIME OUT 1002 1003 1004 1006 2001 The function code received in the query is not an allowable action for the server or slave The data address received in the query is not an allowable address for the server or slave A value contained in the query data field is not an allowable value for the serve
10. 4 SetSafeAction This function code 1s used to set the safe action for a specific channel int AO4K GetSafeAction int hConnection BYTE bytSlot BYTE bytChannel WORD wAction Arguments hConnection The handle for an I O connection bytSlot Slot number of the I O module from 1 to 32 bytChannel The desired channel wAction Stores the safe action of the desired A O channel The values are 0 Safe value 1 Hold last state 2 Low Limit 3 High Limit Return Value MXIO OK Refer to Return Codes RTD Commands RTD_Reads This function code is used to read the temperature values for contiguous channels int RTD_Reads int hConnection BYTE bytSlot BYTE _ bytStartChannel BYTE bytCount double dValuel Arguments hConnection The handle for an I O connection bytSlot Slot number of the I O module from 1 to 32 This parameter is inactive for the ioLogik E2000 and R2000 bytStartChannel Specifies the starting channel bytCount The number of channels to read dValue An array that stores the temperature values of the contiguous channels dValue 0 represents the start channel When dValue is 0x8000 it means the sensor is not wired correctly or the measured value is out of range When using the RTD module for Resistance Input the unit is Ohm When the operating mode is temperature sensor the unit is C or F depending on the setting Use the ioAdmin utility to check the current settings fo the desired
11. 6 86 7 Click amp Go Logic Commands Click amp Go logic commands are for ioLogik E2000 Ethernet I O only These commands involve the activation of Click amp Go logic on an ioLogik E2000 I O Logic2K_GetStartStatus 1 This function code is used to verify activation of Click amp Go logic on an ioLogik E2000 Ethernet I O C C int Logic2K_GetStartStatus int hConnection WORD wStatus Arguments hConnection The handle for an I O connection wStatus A pointer to the I O Click amp Go Logic activation status The values are 0 Click amp Go logic is not activated 1 Click amp Go logic is activated Return Value MXIO_OK Refer to Return Codes Logic2K_SetStartStatus This function code is used to activate or deactivate Click amp Go logic on an ioLogik E2000 Ethernet I O C C int Logic2K_SetStartStatus int hConnection WORD wStatus Arguments hConnection The handle for an I O connection bytChannel The desired channel wStatus Stores the I O Click amp Go logic activation status The values are 0 Click amp Go logic is not activated 1 Click amp Go logic is activated Return Value MXIO OK Refer to Return Codes 8 Active I O Message Commands Active I O message commands are for ioLogik E2000 Ethernet I O only These commands manage active I O messages that are received from an ioLogik E2000 Message2K_Start This function code is used to start receiving active I O messages from an ioLogik E2000 Ethernet I O
12. BYTE bytCount DWORD dwValue Arguments hConnection The handle for an I O connection bytStartChannel Specifies the starting channel bytCount The number of channels to read dwValue A pointer to the power on values of the contiguous pulse channels each bit holds the value of one channel A bit value of 0 represents the power on value of the start channel A bit value of 1 represents the value of the second pulse channel The values are 0 stop 1 start Succeed MXIO OK Fail Refer to Return Codes Return Value 6 38 ioLogik MXIO DLL API Reference Direct O Command Sets Pulse2K SetPowerOnValues This function code is used to set the power on values of contiguous pulse channels int Pulse2K_SetPowerOnValues int Arguments hConnection bytStartChannel bytCount dwValue Return Value hConnection BYTE bytStartChannel BYTE bytCount DWORD dwvValue The handle for an I O connection Specifies the starting channel The number of channels to set Stores the power on values for the contiguous channels each bit holds the value of one channel A bit value of 0 represents the power on value of the start channel A bit value of 1 represents the value of the second pulse channel The values are 0 stop 1 start MXIO OK Refer to Return Codes Pulse2K GetPowerOnValue This function code is used to get the power on value for a specific pulse channel int Pulse2K_GetPowerOnValue
13. ReadMaxs int hConnection BYTE biytStartChannel BYTE bytCount double dValuel Arguments hConnection The handle for an I O connection bytStartChannel Specifies the starting channel bytCount The number of channels to read dValue An array that stores the maximize values for contiguous A I channels dValue 0 represents the value of the starting channel The unit is VDC for the voltage module and mA for the current module Return Value MXIO OK Refer to Return Codes 6 46 ioLogik MXIO DLL API Reference Direct I O Command Sets AI2K_ReadMaxRaws This function code is used to read the maximize raw data values for contiguous A I channels int 2 4 int hConnection BYTE bytStartChannel BYTE bytCount WORD wValue Arguments hConnection The handle for an I O connection bytStartChannel Specifies the starting channel bytCount The number of channels to read wValue An array that stores the maximize raw data values for the contiguous A I channels wValue 0 represents the value of the starting channel Return Value MXIO_OK Refer to Return Codes AI2K_ResetMaxs This function code is used to reset the maximize values of contiguous A I channels int AT2K ResetMaxs int hConnection BYTE bytStartChannel BYTE bytCount Arguments hConnection The handle for an I O connection bytStartChannel Specifies the starting channel bytCount The number of channels to be r
14. Specifies the starting channel bytCount The number of channels to read wValue An array that stores the temperature values of the contiguous channels in raw data format vvValue 0 represents the start channel When wValue is 0x8000 it means the sensor is not wired correctly or the measured value is out of range When using the RTD module for Resistance Input 1 2000Q 100 m 1count When using the RTD module for Resistance Input 1 327Q 10 mQ 1 count When using the RTD module for Resistance Input 1 620Q 20 mQ 1 count When the operating mode is temperature sensor 0 1 C F 1count depending on the setting Use the ioAdmin utility to check the current settings for the desired channels Return Value MXIO_OK Refer to Return Codes 6 67 ioLogik MXIO DLL API Reference Direct I O Command Sets RTD_ReadRaw This function code is used to read the temperature value of a specific channel in raw data format int RTD ReadRav int hConnection BYTE bytSlot BYTE bytChannel WORD wValue Arguments hConnection The handle for an I O connection bytSlot Slot number of the I O module from 1 to 32 This parameter is inactive for the ioLogik E2000 and R2000 bytChannel The desired channel wValue A pointer to the temperature value of the desired channel When wValue is 0x8000 it means the sensor is not wired correctly or the measured value is out of range When using the RTD module for Resistance Input 1 200
15. The handle for a connection wDate An array that stores the firmware release date For a firmware release date of July 5 2005 wDate 0 will be 0X0705 and wDate 1 will be 0X2005 Return Value MXIO OK Refer to Return Codes Adp4K_ReadSlotAmount This function code is used to read the number of expansion slots C C int Adp4K_ReadSlotAmount int hConnection WORD wA mount Arguments hConnection The handle for a connection wAmount A pointer to the number of expansion slots Return Value Succeed MXIO_OK Fail Refer to Return Codes Adp4K_ReadAlarmedSlot This function code is used to read the number of expansion slots C C int Adp4K_ReadAlarmedSlot int hConnection DWORD dwAlarm Arguments hConnection The handle for a connection dwAlarm A pointer to the Alarm slot list The corresponding bit represents slot position The wAlarm bit 0 is represented by the first slot and bit 31 is represented by the last slot The values are 0 Normal slot 1 Alarm slot Return Value MXIO OK 9 Modbus Command Sets Four basic Modbus commands are provided in the Modbus command set However you must refer to the Modbus reference table in 10 Admin to extract data from the Modbus packet R This function reads the on off status for a contiguous group of 5 5 coils on the same I O int MXIO_ReadCoils int hConnection BYTE _ bytCoilType WORD wStartCoil WORD wCount BYTE bytCoils Arguments hCo
16. int hConnection bytChannel bytValue Arguments Return Value Succeed Fail 6 39 hConnection BYTE bytChannel BYTE bytValue The handle for an I O connection The desired channel A pointer to the power on value of the desired channel The values are 0 stop 1 start MXIO OK Refer to Return Codes ioLogik MXIO DLL API Reference Direct I O Command Sets Pulse2K_SetPowerOnValue This function code is used to set the power on value for a specific pulse channel int Pulse2K_SetPowerOnValue int hConnection BYTE bytChannel BYTE bytValue Arguments hConnection The handle for an I O connection bytChannel The desired channel bytValue Stores the power on value for the desired channel The values are 0 stop 1 start Return Value Succeed MXIO OK Fail Refer to Return Codes Pulse2K_GetSafeValues This function code is used to get the safe values of contiguous pulse channels int Pulse2K_GetSafeValues int hConnection BYTE bytStartChannel BYTE bytCount DWORD dwValue Arguments hConnection The handle for an I O connection bytStartChannel Specifies the starting channel bytCount The number of channels to read dwValue A pointer to the safe values for the contiguous channels each bit holds the value of one channel A bit value of 0 represents the safe value of the start channel A bit value of 1 represents the value of the second pulse channel The values are 0 st
17. 2 0A RTB 2 DO relay 230 VAC 24 VDC 2 0A RTB 2 DO Triac 12 to 125 AC 0 5A RTB ioLogik MXIO DLL API Reference Product Model and ID Reference Table Analog Input 0x3400 M 3400 4 AI current 0 to 20 mA 12 bit RTB 0x3401 M 3401 4 AI current 0 to 20 mA 14 bit RTB 0x3402 M 3402 4 AI current 4 to 20 mA 12 bit RTB 0x3403 M 3403 4 AI current 4 to 20 mA 14 bit RTB 0x3410 M 3410 4 AI voltage 0 to 10V 12 bit RTB 0x3411 M 3411 4 AI voltage 0 to 10V 14 bit RTB 0x3412 M 3412 4 AI voltage 10 to 10V 12 bit RTB 0x3413 M 3413 4 AI voltage 10 to 10V 14 bit RTB 0x3414 M 3414 4 AL voltage 0 to 5V single ended 12 bit RTB 0x3415 M 3415 4 AL voltage 0 to 5V single ended 14 bit RTB 0x6200 M 6200 2 AI RTD PT100 JPT100 300 Ohm RTB 0x6201 M 6201 2 AI thermocouple 30 mV 1 uV bit RTB Analog Output 0x4201 M 4201 2 AO 0 to 20 mA 12 bit RTB 0x4202 M 4202 2 AO 4 to 20 mA 12 bit RTB 0x4210 M 4210 2 AO voltage 0 to 10V 12 bit RTB 0x4211 M 4211 2 AO voltage 10 to 10V 12 bit RTB 0x4212 M 4212 2 AO voltage 0 to 5V 12 bit RTB ioLogik E2000 and R2000 0x2210 E2210 Active Ethernet I O with 12DI 8DO 0x2240 E2240 Active Ethernet I O with 8AI 2AO 0x2110 R2110 Remote I O with 1201 8 0x2140 R2140 Remote I O with 8AI 2AO 0x2212 E2212 Active Ethernet I O with 8DI 8DO 4DIO 0x2260 E2260 Active Ethernet I O with 6RTD 4DO 10 2
18. 6 0x02 bit 7 0x03 bit 8 stop cnt bit 2 0x00 stop 1 0x04 stop 2 parity bit 3 4 5 0x00 none 0x08 odd 0x18 even 0x28 mark 0x38 space dwTimeout Timeout in milliseconds for serial adapter communication hCommport Handle of the opened COM port Return Value Succeed MXIO OK Fail Refer to Return Codes MXSIO CloseCommport This closes the COM port the COM port handle will be invalid C C int MXSIO CloseCommport int hCommport Arguments hCommport Handle of the opened COM port Return Value Succeed MXIO OK Fail Refer to Return Codes 4 2 ioLogik MXIO DLL API Reference System Commands Sets Based on the COM port handle or ioLogik E2000 handle users must use this function to establish an I O device handle for each RS 485 or RS 232 I O A COM port handle can connect one RS 232 VO or up to 32 RS 485 VO int MXSIO_Connect int hCommport BYTE _ bytUnitID BYTE bytTransmissionMode int hConnection MXSIO Connect Arguments hCommport VO over serial interface will get a serial handle I O server over Ethernet interface will get an Ethernet handle For more details please see the Program Flow IV and Program Flow V in Chapter 2 bytUnitID Modbus unit ID of the I O from 01 to 99 bytTransmissionMod Modbus transmission format ex 0 RTU mode 1 ASCII mode Note that the protocol settings must agree with the hardware settings on the ioLogik 4000 I O and the ioLogik R2000 only sup
19. A pointer to a specific D I channel s status Return Value Succeed MXIO OK Fail Refer to Return Codes ioLogik MXIO DLL API Reference Direct I O Command Sets Digital Input Commands for ioLogik E2000 R2000 DI2K_GetModes This function code is used to get the mode of contiguous D I channels int DIZK_GetModes int hConnection BYTE bytStartChannel BYTE bytCount WORD wMode 1 Arguments hConnection The handle for an I O connection bytStartChannel Specifies the starting channel bytCount The number of channels to read wMode An array that stores the modes of the contiguous D I channels wMode 0 represents the value of the starting channel The values are 0 Mode 1 Counter Mode Return Value MXIO OK Refer to Retum Codes DI2K SetModes This function code is used to set the mode of contiguous D I channels int DI2K SetModes int hConnection BYTE bytStartChannel BYTE bytCount WORD wMode 1 Arguments hConnection The handle for an I O connection bytStartChannel Specifies the starting channel bytCount The number of channels to set wMode An array that stores the modes of the contiguous D I channels wMode 0 represents the value of the starting channel The values are 0 Mode 1 Counter Mode Return Value MXIO OK Refer to Return Codes ioLogik MXIO DLL API Reference Direct I O Command Sets DI2K_GetMode This function code is used to get the mode of a specific
20. API Reference MXIO API Overview Counter Commands for ioLogik E2000 R2000 Function Name Cnt2K_Reads Cnt2K Clears Cnt2K Read Cnt2K Clear Cnt2K GetOverflows Cnt2K ClearOverflows Cnt2K GetOverflow Cnt2K ClearOverflow Cnt2K GetFilters Cnt2K SetFilters Cnt2K GetFilter Cnt2K SetFilter Cnt2K GetStartStatuses Cnt2K SetStartStatuses Cnt2K GetStartStatus Cnt2K SetStartStatus Cnt2K GetTriggerTypes Cnt2K SetTriggerTypes Cnt2K GetTriggerType Cnt2K SetTriggerType Cnt2K GetPovverOnValues Cnt2K SetPovverOnValues Cnt2K GetPovverOnValue Cnt2K SetPovverOnValue Cnt2K GetSafeValues Cnt2K SetSafeValues Cnt2K GetSafeValue Cnt2K SetSafeValue Digital Output Commands Function Name DO Reads DO Read DO Writes DO Write DO GetSafeValues DO SetSafeValues DO GetSafeValue DO SetSafeValue ioLogik MXIO DLL API Reference MXIO API Overview Digital Output Commands for ioLogik E2000 R2000 Function Name DO2K_GetModes DO2K SetModes DO2K GetMode DO2K SetMode DO2K GetPowerOnValues DO2K SetPowerOnValues DO2K GetPowerOnValue DO2K SetPowerOnValue Digital Output Commands for ioLogik 4000 Function Name DO4K GetSafeActions DO4K SetSafeActions DO4K GetSafeAction DO4K SetSafeAction Pulse Output Commands for ioLogik E2000 R2000 Function Name Pulse2K GetSignalWidths Pulse2K SetSignalWidths Pulse
21. Byte HiWidth As Long iLoWidth As Long As Long Arguments hConnection The handle for an I O connection bytChannel The specific channel to get dwHiWidth A pointer that stores the specific pulse channel s Hi signal width dwLoWidth A pointer that stores the specific pulse channel s Lo signal width MXIO_OK Refer to Return Codes 6 33 ioLogik MXIO DLL API Reference Direct I O Command Sets Pulse2K_GetSignalWidth32 This function code is used to set the Hi Lo signal width 32 bits for a specific pulse channel The function code is designed for the ioLogik E2260 only int Pulse2K SetSignalVVidth32 int hConnection BYTE bytChannel DWORD dwHiWidth DWORD dwLoWidth Declare Function Pulse2K SetSignalWidth32 Lib MXTO diT ByVal hConnection As Long ByVal bytChannel As Byte iHiWidth As Long iLoWidth As Long As Long Arguments hConnection The handle for an I O connection bytChannel The specific channel to get dwHiWidth Store the specific pulse channel s Hi signal width dwLoWidth Store the specific pulse channel s Lo signal width MXIO_OK Refer to Return Codes Pulse2K GetOutputCounts This function code is used to get the output count int Pulse2K_GetOutputCounts int hConnection BYTE bytStartChannel BYTE bytCount DWORD dwOutputCounts 1 Arguments hConnection The handle for an I O connection bytStartChannel Specifies the starting channel bytCount The number of
22. D I channel int DIZK_GetMode int hConnection BYTE bytChannel WORD wMode Arguments hConnection The handle for an I O connection bytChannel The desired channel wMode A pointer to the mode of the desired D I channel The values are 0 D I Mode 1 Counter Mode Return Value MXIO OK Refer to Return Codes DI2K_SetMode This function code is used to set the mode of a specific D I channel int DI2K SetMode int hConnection BYTE bytChannel WORD wMode Arguments hConnection The handle for an I O connection bytChannel The desired channel wMode A pointer to the mode of the desired channel The values are 0 Mode 1 Counter Mode Return Value MXIO OK DI2K_GetFilters This function code is used to get the filter of contiguous D I channels int DI2K GetFilters int hConnection BYTE bytStartChannel BYTE bytCount WORD vrFilterl D Arguments hConnection The handle for an I O connection bytStartChannel Specifies the starting channel bytCount The number of channels to read wFilter An array that stores the filter values of the contiguous D I channels wFilter 0 represents the value of the starting channel Return Value MXIO OK Refer to Return Codes ioLogik MXIO DLL API Reference Direct I O Command Sets DI2K_SetFilters This function code is used to set the filter of contiguous D I channels int DI2K SetFilters int hConnection BYTE bytStartChannel BYTE bytCount
23. Ethernet I O the handle MXEIO_ Disconnect will be invalid C C int MXEIO_Disconnect int hConnection Arguments hConnection Handle of the connection Return Value Succeed MXIO_OK Fail Refer to Return Codes This establishes a connection to the port of the Ethernet I O Once MXEIO the connection is established a handle will be returned for additional functions int MXEIO CheckConnection inth Connection DWORD dvyTimeOut BYTE bytStatus Arguments hConnection Handle of the I O connection dwTimeOut Timeout value in milliseconds for network connection bytStatus Connection status 0 Check connection ok 1 Check connection fail 2 Check connection timeout Return Value MXIO OK Refer to Return Codes General Commands C C int MXIO GetDllVersion Arguments None Return Value Succeed The DLL version Version 2 0 0 0 is expressed as value 0x2000 MXIO GetDilBuildDate This will get the DLL release date C C int MXIO GetDIIBuildDate Arguments None Return Value Succeed Return the DLL release date If the value is 0x20071001 then the date is 2007 10 01 ioLogik MXIO DLL API Reference System Commands Sets This function reports the model name of the network adapter and MXIO_GetModuleType KO moies int MXIO_GetModuleType int hConnection BYTE bytSlot WORD wType Arguments hConnection VO handle for a connection bytSlot Slot number of the I O
24. Fail Refer to Return Codes Cnt2K GetOverflows This function code is used to get the overflow statuses of contiguous D I channels in Counter mode int Cnt2K_GetOverflows int hConnection BYTE bytStartChannel BYTE bytCount DWORD dwStatus Arguments hConnection The handle for an I O connection bytStartChannel Specifies the starting channel bytCount The number of channels to read dwStatus A pointer to the overflow status of the contiguous channels each bit holds the status A bit value of 0 represents the status of the start channel A bit value of 1 represents the second channel s status The values are 0 Normal 1 Overflow Return Value MXIO OK Refer to Return Codes Cnt2K_ClearOverflows This function code is used to clear the overflow statuses of contiguous D I channels in Counter mode int Cnt2K ClearOverflovvs int hConnection BYTE _ bytStartChannel BYTE bytCount Arguments hConnection The handle for an I O connection bytStartChannel Specifies the starting channel bytCount The number of channels to clear Return Value Succeed MXIO OK Fail Refer to Return Codes 6 7 ioLogik MXIO DLL API Reference Direct I O Command Sets Cnt2K_GetOverflow This function code is used to get the overflow status of a specific D I channel in Counter mode int Cnt2K_GetOverflow int hConnection BYTE bytChannel BYTE bytStatus Arguments hConnection The handle for an I O connection bytChanne
25. Slot number of the I O module from 1 to 32 This parameter is inactive for the ioLogik E2000 and R2000 Specifies the starting channel The number of channels to set An array that stores the safe values for the contiguous A O channels dValue 0 represents the value of the starting analog output channel The unit is VDC for the voltage channel and mA for the current channel MXIO OK Refer to Return Codes AO GetSafeValue This function code is used to get the safe value for a specific A O channel int AO GetSafeValue int hConnection bytSlot Arguments bytChannel dValue Return Value 6 55 hConnection BYTE bytSlot BYTE bytChannel double dValue The handle for an I O connection Slot number of the I O module from 1 to 32 This parameter is inactive for the ioLogik E2000 and R2000 The desired channel A pointer to the safe value of the desired A O channel The unit is VDC for the voltage channel and mA for the current channel MXIO OK Refer to Return Codes ioLogik MXIO DLL API Reference Direct O Command Sets AO_SetSafeValue This function code is used to set the safe value for a specific A O channel int AO_SetSafeValue int hConnection bytSlot Arguments bytChannel dValue Return Value hConnection bytSlot BYTE bytChannel double dValue The handle for an I O connection Slot number of the I O module from 1 to 32 This parameter is inactive f
26. bytStartChannel Specifies the starting channel bytCount The number of channels to be reset Return Value Succeed MXIO OK Fail Refer to Return Codes ARK ReadMin This function code is used to read the minimize value for a specific A I channel int AT2K ReadMin int hConnection BYTE bytChannel double dValue Arguments hConnection The handle for an I O connection bytChannel The desired channel dValue A pointer to the minimize value of the desired A I channel The unit is VDC for the voltage module and mA for the current module Return Value MXIO_OK Refer to Return Codes 6 45 ioLogik MXIO DLL API Reference Direct I O Command Sets AI2K_ReadMinRaw This function code is used to read the minimize raw data value for a specific A I channel int AT2K ReadMinRavv int hConnection BYTE bytChannel int iValue Arguments hConnection The handle for an I O connection bytChannel The desired channel iValue A pointer to the minimize raw data value for the desired channel Return Value AI2K ResetMin This function code is used to reset the minimize value for a specific A I channel C C int AT2K ResetMin int hConnection BYTE bytChannel Arguments hConnection The handle for an VO server connection bytChannel The desired channel Return Value Succeed MXIO OK Fail Refer to Return Codes AT2K ReadMaxs This function code is used to read the maximize values for contiguous A I channels int 2
27. channel int RTD2K_ReadMaxRaw int hConnection bytChannel wValue Arguments Return Value 6 70 hConnection BYTE bytChannel WORD wValue The handle for an I O device connection The specific channel to be read An point that stores the specific RTD channel s maximize raw data MXIO OK ioLogik MXIO DLL API Reference Direct I O Command Sets RTD2K ReadMaxRaws This function code is used to read contiguous RTD channel s maximize raw data int RTD2K ReadMaxhRavs int hConnection BYTE bytStartChannel BYTE bytCount WORD wValue Arguments hConnection The handle for an I O device connection bytStartChannel Specifies the starting channel bytCount The number of channels to be read wValue An array that stores the contiguous RTD channel s maximize raw data wValue 0 represents the value of the starting channel Return Value MXIO_OK RTD2K ReadMin This function code is used to read the RTD input minimize valug for a specific channel int RTD2K_ReadMin int hConnection BYTE bytChannel double dValue Arguments hConnection The handle for an I O device connection bytChannel The specific channel to be read dValue A pointer that stores the specific channel RTD input minimize value to be read The unit is for the Ohm C for Celsius and F for Fahrenheit Return Value MXIO OK Refer to Return Codes 6 71 ioLogik MXIO DLL API Reference Direct I O Command Sets RTD
28. connection Return Value Succeed MXIO OK Fail Refer to Return Codes Special Commands for ioLogik E2000 R2000 This function code is used to get the safe status of an ioLogik Module2K GetSafeStatus E2000 or R2000 I O C C int Module2K_GetSafeStatus int hConnection WORD wStatus Arguments hConnection The handle for a connection wStatus A pointer to the specific module s safe status The values are 0 Normal 1 Safe mode Return Value Succeed MXIO_OK Fail Refer to Return Codes This function code is used to get the safe status of an ioLogik Module2K_ClearSafeStatus E2000 or R2000 I O C C int Module2K_ClearSafeStatus int hConnection Arguments hConnection The handle for a connection Return Value Succeed MXIO OK Fail Refer to Return Codes Special Commands for ioLogik 4000 Adp4K ReadFirmwareRevi This function code is used to read the firmware revision sion C C int Adp4K_ReadFirmwareRevision int hConnection WORD wRevision Arguments hConnection The handle for an I O connection wRevision Stores the firmware revision For revision 1 01 the value will be 0X0101 Return Value Succeed MXIO OK Fail Refer to Return Codes ioLogik MXIO DLL API Reference System Commands Sets This function code is used to read the status of the ioLogik 4000 Adp4K_ReadStatus adapter int Adp4K_ReadStatus int hConnection WORD wBusStatus WORD wFPStatus WORD wEWStatus WORD wES
29. output status of the desired channel 1 represents ON 0 represents OFF MXIO OK Refer to Return Codes Return Value 6 19 ioLogik MXIO DLL API Reference Direct I O Command Sets DO_GetSafeValues This function code is used to get the output safe values of contiguous D O channels int DO_GetSafeValues int hConnection BYTE bytSlot BYTE bytStartChannel BYTE bytCount DWORD dwValue Arguments hConnection The handle for an I O connection bytSlot Slot number of the I O module from 1 to 32 This parameter is inactive for the ioLogik E2000 and R2000 bytStartChannel Specifies the starting channel bytCount The number of channels to read dwValue A pointer to the safe values of the contiguous D O channels each bit holds the value of one channel A bit value of 0 represents the digital output status of the start channel A bit value of 1 represents the status of the second digital output channel The values of the unused bits are random Return Value MXIO OK Refer to Return Codes DO SetSafeValues This function code is used to set the safe values of contiguous D O channels int DO SetSafeValues int hConnection BYTE bytSlot BYTE bytStartChannel BYTE bytCount DWORD dwValue Arguments hConnection The handle for an I O connection bytSlot Slot number of the I O module from 1 to 32 This parameter is inactive for the ioLogik E2000 and R2000 bytStartChannel Specifies the starting chan
30. to be checked from 0 to 32 The ioLogik 4000 network adapter s slot number is always 0 This parameter is inactive for ioLogik E2000 and R2000 I O A pointer to the model name For the model name NA 4010 the value would be 0x4010 Refer to the Product Model and ID Reference Table for more information Return Value MXIO OK Refer to Return Codes ision network adapter E2000 or R2000 C C int MXIO ReadFirmwareRevision int hConnection BYTE bytRevisionl Arguments hConnection VO handle for a connection bytRevision Stores the firmware revision bytRevision 0 major A bytRevision 1 minor B bytRevision 2 release C bytRevision 3 build format is A B C D Return Value MXIO OK Refer to Return Codes C C int MXIO ReadFirmwareDate int hConnection WORD vDate 1 Arguments hConnection VO handle for a connection wDate Firmware release date For a firmware release date of July 5 2005 Word 0 0x0705 and Word 1 0x2005 Return Value Succeed MXIO_OK Fail Refer to Return Codes ioLogik MXIO DLL API Reference System Commands Sets MXIO Restart This function is used to restart the I O C C int MXIO_Restart int hConnection Arguments hConnection VO handle for a connection Return Value Succeed MXIO OK Fail Refer to Return Codes MXIO Reset This function is used to reset the I O C C int MXIO Reset int hConnection Arguments hConnection VO handle for a
31. to set dwStatus Stores the start statuses of the contiguous pulse channels each bit holds the value of one channel A bit value of 0 represents the start status of the start channel A bit value of 1 represents the status of the second pulse channel The values are 0 stop 1 start MXIO OK Refer to Return Codes Pulse2K GetStartStatus This function code is used to get the start status for a specific pulse channel int Pulse2K_GetStartStatus int hConnection BYTE bytChannel BYTE bytStatus Return Value Arguments hConnection The handle for an I O connection bytChannel The desired channel bytStatus A pointer to the start status of the desired channel The values are 0 stop 1 start Return Value MXIO_OK Refer to Return Codes 6 37 ioLogik MXIO DLL API Reference Direct I O Command Sets Pulse2K_SetStartStatus This function code is used to set the start status for a specific pulse channel int Pulse2K_SetStartStatus int hConnection BYTE bytChannel BYTE byfStatus Arguments hConnection The handle for an I O connection bytChannel The desired channel bytStatus Stores the start status of the desired channel The values are 0 stop 1 start Return Value MXIO OK Refer to Return Codes Pulse2K_GetPowerOnValues This function code is used to get the power on values for contiguous pulse channels int Pulse2K_GetPowerOnValues int hConnection BYTE bytStartChannel
32. 00 3 5 Pulse Output Commands for ioLogik E2000 R2000 22 3 5 Analog Input 45 3 6 Analog Input Commands for ioLogik E2000 2000 3 6 Analog Output 45 3 6 Analog Output Commands for ioLogik E2000 2000 3 7 Analog Output Commands for ioLogik 4000 3 7 RTD C rmimanids A eae AR tas e S 3 7 Thermocouple Commands ccccescsseesseesceesceeeceeceseceaecaecsaecaeeeaeeeneeseeeeeeeeeeeeesereeerens 3 8 Click amp Go Logic Commands s 23 hath ti ie Rt ais SOA as 3 8 Active I O Message 5 3 8 System Command Set 4 1 RS 232 RS 485 VO Connect Commands cecccececsseessesseeesceeseeeceseeeaecaecseecaeeeseeeneeneeeneeens 4 2 Ethernet I O Connect 5 4 4 General C mmands d n Tumas 4 5 Special Commands for ioLogik E2000 2000 4 7 Special Commands for i0 Logik 4000 4 7 Chapter 5 Chapter 6 Chapter 7 Chapter 8 Chapter 9 Chapt
33. 0Q 100 mQ Icount When using the RTD module for Resistance Input 1 327Q 10 mQ 1 count When using the RTD module for Resistance Input 1 620Q 20 mQ 1 count When the operating mode is temperature sensor 0 1 C F 1count depending on the setting Use the ioAdmin utility to check the current settings for the desired channels MXIO OK Refer to Return Codes RTD2K ResetMin This function code 1s used to reset the RTD input minimize value for a specific channel C C int RTD2K_ResetMin int hConnection BYTE bytChannel hConnection The handle for an I O device connection bytChannel The specific channel to be reset Return Value Arguments Return Value Succeed MXIO OK Fail Refer to Return Codes 6 68 ioLogik MXIO DLL API Reference Direct I O Command Sets RTD2K ResetMins This function code is used to reset contiguous RTD channel s minimize value int RTD2K_ResetMins int hConnection BYTE bytStartChannel BYTE bytCount Arguments hConnection The handle for an I O device connection bytStartChannel Specifies the starting channel bytCount The number of channels to be reset Return Value Succeed MXIO OK C C int RTD2K_ResetMax int hConnection BYTE bytChannel Arguments hConnection The handle for an I O device connection bytChannel The specific channel to be reset Return Value Succeed MXIO OK RTD2K ResetMaxs This function code is used to reset contiguous RTD channe s maximize va
34. 2K GetSignalWidth Pulse2K SetSignalWidth Pulse2K GetSignalWidths32 Only for ioLogik E2260 Pulse2K_SetSignalWidths32 Only for ioLogik E2260 Pulse2K GetSignalWidth32 Only for ioLogik E2260 Pulse2K SetSignalWidth32 Only for ioLogik E2260 Pulse2K GetOutputCounts Pulse2K SetOutputCounts Pulse2K GetOutputCount Pulse2K SetOutputCount Pulse2K GetStartStatuses Pulse2K SetStartStatuses Pulse2K GetStartStatus Pulse2K SetStartStatus Pulse2K GetPowerOnValues Pulse2K SetPowerOnValues Pulse2K GetPowerOnValue Pulse2K SetPowerOnValue Pulse2K GetSafeValues Pulse2K SetSafeValues Pulse2K GetSafeValue Pulse2K SetSafeValue ioLogik MXIO DLL API Reference MXIO API Overview Analog Input Commands Function Name AT Reads AL Read AI ReadRaws AI ReadRaw Analog Input Commands for ioLogik E2000 R2000 Function Name AI2K ReadMins AI2K ReadMinRaws AI2K ResetMins AI2K ReadMin AI2K ReadMinRaw AI2K ResetMin AI2K ReadMaxs AI2K ReadMaxRaws AI2K ResetMaxs AI2K ReadMax AI2K ReadMaxRaw AI2K ResetMax AI2K GetRanges AI2K SetRanges AI2K GetRange AI2K SetRange Analog Output Commands Function Name AO Reads AO Writes AO Read AO Write AO ReadRaws AO WriteRaws AO ReadRaw AO WriteRaw AO GetSafeValues AO SetSafeValues AO GetSafeValue
35. 2K_ReadMins This function code is used to read contiguous RTD channel s minimize value int RTD2K ReadMins int hConnection BYTE bytStartChannel BYTE bytCount double dValue 1 Arguments hConnection The handle for an I O device connection bytStartChannel Specifies the starting channel bytCount The number of channels to be read dValue An array that stores the contiguous RTD channel s minimize value dValue 0 represents the value of the starting channel The unit isQ for the Ohm C for Celsius and Return Value F for Fahrenheit MXIO_OK Refer to Return Codes RTD2K_ReadMax This function code is used to read the RTD input maximize value for a specific channel int RTD2K_ReadMax int hConnection BYTE bytChannel double dValue Arguments hConnection The handle for an I O device connection bytChannel The specific channel to be read dValue A pointer that stores the specific channel RTD input maximize value to be read The unit is Q for the Ohm C for Celsius and F for Fahrenheit Return Value MXIO OK Refer to Return Codes 6 72 ioLogik MXIO DLL API Reference Direct I O Command Sets RTD2K_ReadMaxs This function code is used to read contiguous RTD channel s maximize value int RTD2K_ReadMaxs int hConnection BYTE bytStartChannel BYTE bytCount double dValuel 1 Arguments hConnection The handle for an I O device connection bytStartChannel Specifies the starting channel bytC
36. Connection bytChannel bytValue Arguments Return Value Succeed Fail hConnection BYTE bytChannel BYTE bytValue The handle for an I O connection The desired channel A pointer to the power on value for specific channel The values are 0 OFF 1 ON MXIO OK Cnt2K SetPowerOnValue This function code is used to set the power on value of a specific D I channel in Counter mode int Cnt2K_SetPowerOnValue int hConnection bytChannel bytValue Arguments Return Value Succeed Fail hConnection BYTE bytChannel BYTE bytValue The handle for an I O connection The desired channel Stores the power on value for the desired channel The values are 0 OFF 1 ON MXIO OK Refer to Return Codes ioLogik MXIO DLL API Reference Direct I O Command Sets Cnt2K_GetSafeValues This function code is used to get the safe values of contiguous D I channels in Counter mode int Cnt2K_GetSafeValues int hConnection BYTE bytStartChannel BYTE bytCount DWORD dwValue Arguments hConnection The handle for an I O connection bytStartChannel Specifies the starting channel bytCount The number of channels to read dwValue A pointer to the safe values each bit holds the safe value of one channel A bit value of 0 represents the safe value of the start channel A bit value of 1 represents the second channel s safe value The values are 0 OFF 1 ON Return Value MXIO OK Refer to Re
37. K GetEngUnits RTD2K GetMathPar RTD2K SetMathPar RTD2K GetMathPars RTD2K SetMathPars Thermocouple Commands Function Name TC Reads TC Read TC ReadRaws TC ReadRaw Click amp Go Logic Commands Active Function Name Logic2K GetStartStatus Logic2K SetStartStatus O Message Commands Function Name Message2K Start Message2K Stop 4 System Command Sets System commands include functions that initialize the connection between a host computer and the VO In addition system commands include functions for obtaining hardware and status information of the I O itself The following topics are covered RS 232 RS 485 I O Connect Commands Ethernet I O Connect Commands General Commands Special Commands for ioLogik E2000 R2000 Special Commands for ioLogik 4000 U O ioLogik MXIO DLL API Reference System Commands Sets RS 232 RS 485 VO Connect Commands MXSIO OpenCommport This function opens the local COM port of the host computer with communication parameters int MXSIO_OpenCommport char szCommport DWORD dwBaudrate BYTE bytDataFormat DWORD dwTimeout int hCommport Arguments szCommport Name of the common port e g ttyM0 dwBaudrate Baudrate from 4 800 to 115 200 bps Does not support 1200 or 2400 bps bytDataFormat Transmission data format bit_cnt bit 1 0x00 bit 5 0x01 bit
38. Logik MXIO DLL API Reference Direct I O Command Sets RTD2K GetSensorTypes This function code is used to get contiguous RTD channel s sensor type int RTD2K_GetSensorTypes int hConnection BYTE bytStartChannel BYTE bytCount WORD wSensorType Arguments hConnection The handle for an I O device connection bytStartChannel Specifies the starting channel bytCount The number of channels to be get wSensorType An array that stores the contiguous RTD channel s sensor type wSensorType 0 represents the value of the starting channel The values for normal channel are 0 50 1 100 2 200 3 500 4 1000 5 100 6 JPT200 7 500 8 1000 9 NI100 10 NI200 11 NI500 12 NI1000 13 NI120 14 310 Ohm 15 620 Ohm 16 1250 Ohm 17 2500 Ohm Others return Illegal Data Value The values for virtual channels are 20 AVG 21 DIV Others return Illegal Data Value MXIO OK Return Value Refer to Return Codes 6 78 ioLogik MXIO DLL API Reference Direct I O Command Sets RTD2K SetSensorTypes This function code is used to set contiguous RTD channel s sensor type int RTD2K_SetSensorTypes int hConnection BYTE bytStartChannel BYTE bytCount WORD wSensorType Arguments hConnection The handle for an I O device connection bytStartChannel Specifies the starting channel bytCount The number of channels to be set wSensorType An array that stores the contiguous RTD channel s sensor type wS
39. RTD2K GetStartStatuses v v RTD2K SetStartStatuses v A v RTD2K GetSensorType v vi vi RTD2K SetSensorType v v v v RTD2K GetSensorTypes v vi vi RTD2K SetSensorTypes a v v RTD2K GetEngUnit v vi vi RTD2K SetEngUnit v vi vi RTD2K GetEngUnits V v RTD2K SetEngUnits v v vi vi RTD2K GetMathPar v vi vi RTD2K SetMathPar v A vi vi RTD2K GetMathPars v v vi vi RTD2K SetMathPars v vi vi TC Reads V v v v TC Read v v v TC ReadRaws v v vi vi vi TC ReadRavv v v vi Module2K GetSafeStatus v A vi vi vi Module2K ClearSafeStatus v v Adp4K_ReadStatus v v vi vi Adp4K_ClearStatus v v vi vi Adp4K ReadFirmwareRevi v v v vi v sion Adp4K ReadFirmvvareDate v v vi v DI2K GetModes v vi vi v DI2K SetModes V v v DI2K_GetMode V v DI2K SetMode v v V v DI2K GetFilters V v v v DI2K SetFilters v v vi v DI2K GetFilter v v vi vi DI2K SetFilter v vi vi DO2K GetModes v vV vi vi vi DO2K SetModes v v v DO2K GetMode v v v DO2K SetMode v v v v DO2K GetPowerOnValues v v v v DO2K SetPowerOnValues v v A vi DO2K_GetPowerOnValue V v v DO2K SetPowerOnValue v v v A vi Cnt2K Reads v A vi vi vi k 1 b ioLogik MXIO DLL API Reference Overview i PC Linux 2 4 UC 7110 LX UC 7408 LX tme lo Windows 5 1 inux 2 6 UC 7112 LX UC 7420 LX A 240 LX v v v A Cnt2K Clea
40. S S S S S SESE SESS APP STS A AY AT APSE AT SE SESE STESPESES SES SI ATS AT STS SESE S S S S M sla AP AP ATS 1 6 2 Programming Flow The process used to obtain access to a remote I O device on an ioLogik is similar for both Ethernet and serial interfaces Five different scenarios are described below The following topics are covered Connecting to a Single Ethernet I O Connecting to Multiple Ethernet I O Connecting to a Single Serial I O Connecting to Multiple RS 485 I O Connecting to the ioLogik E2000 and Attached RS 485 I O Modbus Command Sets vs Direct I O Command Sets gt Modbus Command Sets gt Direct I O Command Sets JV V ioLogik MXIO DLL API Reference Programming Flow Connecting to a Single Ethernet I O The MXIO Linux Library establishes a data tunnel using Modbus commands to communicate with the Ethernet I O Access is usually established using TCP port number 502 Ethernet Ethernet ioLogik 4000 remote I O ioLogik E2000 Ethernet I O IP 192 168 8 1 IP 192 168 8 1 Port 502 Port 502 Three steps are required to access remote I O data using the MXIO Linux Library 1 Use MXEIO Connect to connect to the Ethernet I O using IP Port e g 192 168 8 1 502 MXEIO_ Connect should return a handle 2 Use the handle to access the desired I O point with Modbus commands or direct I O commands 3 To finish the operation use MXEIO Disconnect t
41. SetSafeAction This function code is used to set the safe action for a specific channel int DO4K GetSafeAction int hConnection BYTE bytSlot BYTE bytChannel WORD waAction Arguments hConnection The handle for an I O connection bytSlot Slot number of the I O module from 1 to 32 bytChannel The desired channel wAction Stores the safe action for the desired D O channel The values are 0 Safe Value 1 Hold last state Return Value MXIO OK Refer to Return Codes Pulse Output Commands for ioLogik E2000 R2000 Pulse2K_GetSignalWidths This function code is used to get the Hi Lo signal widths of contiguous pulse output channels int Pulse2K_GetSignal Widths int hConnection BYTE bytStartChannel BYTE bytCount WORD wHiWidthl 1 WORD wLoWidth Arguments hConnection The handle for an I O connection bytStartChannel Specifies the starting channel bytCount The number of channels to read wHiWidth An array that stores the Hi signal widths of the contiguous pulse output channels wHiWidth 0 represents the Hi signal width of the starting channel wLoWidth An array that stores the Lo signal widths of the contiguous pulse output channels wLoWidth 0 represents the Lo signal width of the starting channel MXIO OK Refer to Return Codes Return Value 6 29 ioLogik MXIO DLL API Reference Direct I O Command Sets Pulse2K_SetSignalWidths This function code is used to set the Hi Lo sign
42. Status WORD wECStatus hConnection The handle for an I O connection Arguments wBusStatus Stores the bus status in numerical format The values are 0 Normal Operation 1 Bus Standby 2 Bus Communication Fault 3 Slot Configuration Failed 4 No Expansion Slot wFPStatus Stores the field power status in numerical format The values are 0 24 VDC Field Power On 1 24 VDC Field Power Off wEWStatus Stores the Watchdog status in numerical format The values are 0 No Error 1 Watchdog activated wESStatus Stores the Modbus Setup Error status in numeric data format supported by NA 4020 amp NA 4021 only 0 No Error 1 Modbus Setup Error wECStatus Stores the Modbus Checksum Error status supported by NA 4020 amp NA 4021 only 0 No Error 1 Three continuous CRC LRC checksum errors have occurred since last restart last clear counters operation or last power up Return Value Succeed MXIO_OK 4 8 ioLogik MXIO DLL API Reference System Commands Sets This function code is used to clear the status of the ioLogik 4000 Adp4K_ClearStatus adapters C C int Adp4K_ClearStatus int hConnection Arguments hConnection The handle for an I O connection Return Value Succeed MXIO OK Fail Refer to Return Codes Adp4K_ReadFirmwareDate This function code is used to read the firmware release date C C int Adp4K ReadFirmwareDate int hConnection WORD wDate 1 Arguments hConnection
43. This function code is used to set the power on values of contiguous D O channels int DO2K_SetPowerOnValues int Arguments hConnection bytStartChannel bytCount dwValue Return Value 6 24 hConnection BYTE bytStartChannel BYTE bytCount DWORD dwvValue The handle for an I O connection Specifies the starting channel The number of channels to set Stores the power on values of contiguous D O channels each bit holds the value of one channel A bit value of 0 represents the power on status of the start channel A bit value of 1 represents the status of the second digital output channel The values of the unused bits are random MXIO OK Refer to Return Codes ioLogik MXIO DLL API Reference Direct I O Command Sets DO2K_GetPowerOnValue This function code is used to get the power on value for a specific D O channel int DO2K_GetPowerOnValue int Arguments hConnection bytChannel bytValue Return Value Succeed Fail hConnection BYTE bytChannel BYTE bytValue The handle for an I O connection The desired channel A pointer to the power on value of the desired D O channel MXIO_OK Refer to Return Codes 2 SetPowerOnValue This function code is used to set the power on value for a specific D O channel int DO2K SetPowerOnValue int Arguments hConnection bytChannel bytValue Return Value Succeed Fail hConnection BYTE bytChannel BYTE bytVa
44. WORD wkKilter Arguments hConnection The handle for an I O connection bytStartChannel Specifies the starting channel bytCount The number of channels to set wFilter An array that stores the filter values of the contiguous D I channels wFilter 0 represents the value of the starting channel Return Value MXIO OK Refer to Return Codes DI2K_GetFilter This function code is used to get the filter of a specific D I channel int DIZK_GetFilter int hConnection BYTE bytChannel WORD wFilter Arguments hConnection The handle for an I O connection bytChannel The desired channel wFilter A pointer to the filter value of the desired D I channel Return Value Succeed MXIO OK Fail Refer to Return Codes DIK SetFilter This function code is used to set the filter of a specific D I channel int DI2K GetFilter int hConnection BYTE bytChannel WORD wFilter Arguments hConnection The handle for an I O connection bytChannel The desired channel wFilter A pointer to the filter value of the desired D I channel Return Value MXIO OK Refer to Return Codes 6 5 ioLogik MXIO DLL API Reference Direct I O Command Sets Counter Commands for ioLogik E2000 R2000 Cnt2K_Reads This function code is used to read the counter values of contiguous channels in Counter mode int Cnt2K_Reads int hConnection BYTE bytStartChannel BYTE bytCount DWORD dwValue 1 Arguments hConnection The
45. al widths of contiguous pulse output channels int Pulse2K_SetSignal Widths int hConnection bytStartChannel bytCount wHiWidth Arguments wLoWidth Return Value hConnection BYTE bytStartChannel BYTE bytCount WORD wHiWidth 1 WORD wLoWidth 1 The handle for an I O connection Specifies the starting channel The number of channels to set An array that stores the Hi signal widths of the contiguous pulse output channels wHiWidth 0 represents the Hi signal width of the starting channel An array that stores the Lo signal widths of the contiguous pulse output channels wLoWidth 0 represents the Lo signal width of the starting channel MXIO OK Refer to Return Codes Pulse2K_GetSignalWidth This function code is used to get the Hi Lo signal width for a specific pulse channel int Pulse2K_GetSignal Width int Arguments hConnection bytChannel wHiwWidth wLoWidth Return Value Succeed Fail 6 30 hConnection BYTE bytChannel WORD wHiWidth WORD wLoWidth The handle for an I O connection The desired channel A pointer to the Hi signal width of the desired channel A pointer to the Lo signal width of the desired channel MXIO OK Refer to Return Codes ioLogik MXIO DLL API Reference Direct I O Command Sets Pulse2K_SetSignalWidth This function code is used to set the Hi Lo signal width for a specific pulse channel int Pulse2K_SetSignal Width int hConnec
46. alWidths32 This function code is used to set the contiguous pulse channel s Hi Lo signal width 32 bits The function code is designed for the ioLogik E2260 only int Pulse2K SetSignalVVidths32 int hConnection BYTE bytStartChannel BYTE bytCount DVVORD dwHiWidthl 1 DVVORD dwLoWidth 1 Declare Function Pulse2K SetSignalWidths32 Lib MXTO diT ByVal hConnection As Long ByVal bytStartChannel As Byte ByVal bytCount As Byte iHiVVidth As Long iLoWidth As Long As Long Arguments hConnection The handle for an I O connection bytStartChannel Specifies the starting channel bytCount The number of channels to get dwHiWidth An array that stores the contiguous pulse channel s Hi signal width dwHiWidth 0 represents the Hi signal width of the starting channel dwLo Width An array that stores the contiguous plulse channel s Lo signal width dwLoWidth 0 represents the Lo signal width of the starting channel Succeed MXIO OK Fail Refer to Return Codes 6 32 ioLogik MXIO DLL API Reference Direct I O Command Sets Pulse2K GetSignalWidth32 This function code is used to get the Hi Lo signal width 32 bits for a specific pulse channel The function code is designed for the ioLogik E2260 only int Pulse2K_GetSignal Width32 int hConnection BYTE bytChannel DWORD dwHiWidth DWORD dwLoWidth Declare Function Pulse2K_GetSignalWidth32 Lib MXIO dIl ByVal hConnection As Long ByVal bytChannel As
47. c channel to be set A pointer that stores the specific RTD channel s engineering unit The values for normal channels are 0 Celsius 1 Fahrenheit 2 Ohm Others_ return Illegal Data Value The values for virtual channels are 0 Celsius 1 Fahrenheit Others return Illegal Data Value MXIO OK Refer to Return Codes ioLogik MXIO DLL API Reference Direct I O Command Sets RTD2K_GetEngUnits This function code is used to get contiguous RTD channel s engineering unit int RTD2K_GetEngUnits int hConnection BYTE bytStartChannel BYTE bytCount WORD wEngUnit 1 Arguments hConnection The handle for an I O device connection bytStartChannel Specifies the starting channel bytCount The number of channels to be gets wEngUnit An array that stores the contiguous RTD channel s engineering unit wEngUnit 0 represents the value of the starting channel The values for normal channel are 0 Celsius 1 Fahrenheit 2 Ohm Others_ return Illegal Data Value The values for virtual channels are 0 Celsius 1 Fahrenheit Others_ return Illegal Data Value Return Value MXIO OK Refer to Return Codes 6 81 ioLogik MXIO DLL API Reference Direct I O Command Sets RTD2K_SetEngUnits This function code is used to get contiguous RTD channel s engineering unit int RTD2K_SetEngUnits int hConnection BYTE bytStartChannel BYTE bytCount WORD wEngUnit 1 Arguments hConnection The handle for an I O device connection
48. channels Return Value MXIO OK Refer to Return Codes 6 65 ioLogik MXIO DLL API Reference Direct I O Command Sets RTD_Read This function code is used to read the temperature value for a specific channel int RTD Read int hConnection BYTE bytSlot BYTE bytChannel double dValue Arguments hConnection The handle for an I O connection bytSlot Slot number of the I O module from 1 to 32 This parameter is inactive for the ioLogik E2000 and R2000 bytChannel The desired channel dValue A pointer to the temperature value of the desired channel When dValue is 0x8000 it means the sensor is not correctly wired or the measured value is out of range When using the RTD module for Resistance Input the unit is Ohm When the operating mode is temperature sensor the unit is C or F depending on the setting Use the ioAdmin utility to check the current settings for the desired channels Return Value MXIO OK Refer to Return Codes 6 66 ioLogik MXIO DLL API Reference Direct I O Command Sets RTD_ReadRaws This function code is used to read the temperatures for contiguous channels in raw data format int RTD_ReadRavws int hConnection BYTE bytSlot BYTE bytStartChannel BYTE bytCount WORD wValue Arguments hConnection The handle for an I O server connection bytSlot Slot number of the I O module from 1 to 32 This parameter is inactive for the ioLogik E2000 and R2000 bytStartChannel
49. channels to read dwOutputCounts An array that stores the output count dwOutputCounts 0 represents the pulse output count of the starting channel Return Value MXIO OK Refer to Return Codes 6 34 ioLogik MXIO DLL API Reference Direct I O Command Sets Pulse2K_SetOutputCounts This function code is used to set the output counts for contiguous pulse output channels int Pulse2K_SetOutputCounts int hConnection BYTE bytStartChannel BYTE bytCount DWORD dwOutputCounts Arguments hConnection The handle for an I O connection bytStartChannel Specifies the starting channel bytCount The number of channels to set dwOutputCounts An array that stores the output counts of the contiguous pulse output chanels dwOutputCounts 0 represents the pulse output count of the starting channel Return Value MXIO OK Refer to Return Codes Pulse2K_GetOutputCount This function code is used to get the output count for a specific pulse channel int Pulse2K_GetOutputCount int hConnection BYTE bytChannel DWORD dwOutputCount Arguments hConnection The handle for an I O connection bytChannel The desired channel dwOutputCount A pointer to the output count for the desired channel Return Value Succeed MXIO_OK Fail Refer to Return Codes Pulse2K_SetOutputCount This function code is used to set the output count for a specific pulse channel int Pulse2K_SetOutputCount int hConnection BYTE bytChan
50. e I O Message 05 R Y iii mni iii 8 1 a as 9 1 Product Model and ID Reference 7755255 10 1 TOLIOBIKAOOO sacs ceeds s 10 1 qoL gik E2000 and R2000 ni 10 2 1 Overview This reference introduces the MXIO Linux Library for Moxa s ioLogik 4000 E2000 and R2000 remote I O The following topics are covered in this chapter What is the MXIO Linux Library Supported Platforms Supported I O Modules Moxa Library Comparison ioLogik MXIO DLL API Reference Overview What is the MXIO Linux Library The MXIO Linux Library is a set of tools for programmers to use with Moxa s ioLogik 4000 E2000 and R2000 remote I O Programmers can use the library when developing applications to manage VO devices and obtain I O data remotely over an Ethernet or RS 485 network The MXIO Linux Library is designed for x86 platforms and Moxa s UC 7100 LX UC 7400 LX and IA 240 LX line of embedded computers Supported Platforms arm elf mxio library x x x x sh for UC 7100 LX line mxsacleb mxio library x x x x sh for UC 7400 LX line mxio library x x x x sh for x86 arm linux mxio library x x x x sh for IA 240 L X line Supported I O Modules For a list of I O modules that are supported by this library please refer to C
51. e handle for an I O connection Slot number of the I O module from 1 to 32 This parameter is inactive for the ioLogik E2000 and R2000 The specific channel to be written Stores the raw data value for the desired analog output channel MXIO OK Refer to Return Codes AO GetSafeValues This function code is used to get the safe values of contiguous analog output channels int AO_GetSafeValues int hConnection bytSlot Arguments bytStartChannel bytCount dValue Return Value 6 54 hConnection BYTE bytSlot BYTE bytStartChannel BYTE bytCount Double dValuel The handle for an I O connection Slot number of the I O module from 1 to 32 This parameter is inactive for the ioLogik E2000 and R2000 Specifies the starting channel The number of channels to read An array that stores the safe values for the contiguous A O channels dValue 0 represents the value of the starting channel The unit is Vdc for the voltage channel and mA for the current channel MXIO OK Refer to Return Codes ioLogik MXIO DLL API Reference Direct O Command Sets AO SetSafeValues This function code is used to set the safe values for contiguous A O channels int AO_SetSafeValues int hConnection bytSlot Arguments bytStartChannel bytCount dValue Return Value hConnection BYTE bytSlot BYTE bytStartChannel BYTE bytCount Double dValuel The handle for an I O connection
52. e ioAdmin to check the VO module settings Return Value MXIO OK Refer to Return Codes 6 84 ioLogik MXIO DLL API Reference Direct O Command Sets TC_Read This function code is used to read the temperature value of a specific channel int TC_Read int BYTE BYTE double hConnection bytSlot Arguments bytChannel dValue Return Value hConnection bytSlot bytChannel dValue The handle for an I O connection Slot number of the I O module from 1 to 32 This parameter is inactive for the ioLogik E2000 and R2000 The desired channel Stores the temperature value of the desired channel When dValue is 0x8000 it means the sensor is not wired correctly When the operating mode of the TC module is voltage input the unit is uv Use ioAdmin to check the VO module settings MXIO_OK Refer to Return Codes TC_ReadRaws This function code is used to read the temperature value of contiguous channels in raw data format int TC ReadRavs int hConnection bytSlot Arguments bytStartChannel bytCount wValue Return Value 6 85 hConnection bytSlot bytStartChannel BYTE bytCount WORD wValue The handle for an I O connection Slot number of the I O module from 1 to 32 This parameter is inactive for the ioLogik E2000 and R2000 Specifies the starting channel BYTE BYTE The number of channels to read An array that stores the temperature values of the cont
53. e safe value of the desired channel 1 represents ON 0 represents OFF MXIO OK Refer to Return Codes ioLogik MXIO DLL API Reference Direct I O Command Sets Digital Output Commands for ioLogik E2000 R2000 DO2K_GetModes This function code is used to get the mode of contiguous D O channels int DO2K_GetModes int hConnection bytStartChannel bytCount wMode Arguments Return Value hConnection BYTE _ bytStartChannel BYTE bytCount WORD wMode The handle for an I O connection Specifies the starting channel The number of channels to read An array that stores the modes of contiguous D O channels The values are 0 D O mode 1 Pulse mode MXIO OK Refer to Return Codes DO2K_SetModes This function code is used to set the modes of contiguous D O channels int DO2K_SetModes int Arguments hConnection bytStartChannel bytCount wMode Return Value 6 22 hConnection BYTE bytStartChannel BYTE bytCount WORD wMode The handle for an I O connection Specifies the starting channel The number of channels to set An array that stores the modes of contiguous D O channels The values are 0 D O mode 1 Pulse mode MXIO OK Refer to Return Codes ioLogik MXIO DLL API Reference Direct I O Command Sets DO2K_GetMode This function code is used to get the mode of a specific D O channel int DO2K_GetMode int Arguments hConnection bytChannel wMode
54. e set dwStatus A pointer that stores the contiguous channel s DI DO mode each bit holds one channel status A bit value of 0 represents the status of the start channel A bit value of 1 represents the second channel s status The values are 0 INPUT DI mode 1 OUTPUT DO mode MXIO OK Refer to Return Codes Return Value 6 26 ioLogik MXIO DLL API Reference Direct I O Command Sets This function will take effect after restart the device int DIO2K SetIOModes int hConnection BYTE bytStartChannel BYTE bytCount DWORD dwMode Arguments hConnection The handle for an I O device connection bytStartChannel Specifies the starting channel bytCount The number of channels to be set dwMode A pointer that stores the contiguous channel s DI DO mode each bit holds one channel status A bit value of 0 represents the status of the start channel A bit value of 1 represents the second channel s status The values are 0 INPUT DI mode 1 OUTPUT DO mode Succeed MXIO OK Fail Return Value Digital Output Commands for ioLogik 4000 DO4K GetSafeActions This function code is used to get the safe actions of contiguous D O channels int DO4K_GetSafeActions int hConnection BYTE bytSlot BYTE _ bytStartChannel BYTE bytCount WORD vvActionl Arguments hConnection The handle for an I O connection bytSlot Slot number of the I O module from 1 to 32 bytStartChannel Specifies the starting channel bytCo
55. e starting channel BYTE The number of channels to write An array that stores safe values in raw data format for the contiguous A O channels wValue 0 represents the value of the starting analog output channel MXIO OK Refer to Return Codes AO GetSafeRaw This function code is used to get the safe value for a specific A O channel in raw data format int AO GetSafeRav int hConnection bytSlot Arguments bytChannel wValue Succeed Fail Return Value 6 57 hConnection bytSlot bytChannel wValue BYTE BYTE WORD The handle for an I O connection Slot number of the I O module from 1 to 32 This parameter is inactive for the ioLogik E2000 and R2000 The desired channel A pointer to the safe value for the desired channel in raw data format MXIO OK Refer to Return Codes ioLogik MXIO DLL API Reference Direct I O Command Sets AO_SetSafeRaw This function code is used to set the safe value for a specific A O channel in raw data format int AO_SetSafeRaw int hConnection BYTE bytSlot BYTE bytChannel WORD _ wvValue Arguments hConnection The handle for an I O connection bytSlot Slot number of the I O module from 1 to 32 This parameter is inactive for the ioLogik E2000 and R2000 bytChannel The desired channel wValue Stores the safe value for the desired channel in raw data format Return Value Succeed MXIO_OK Fail Refer to Return Codes Analog O
56. el dValue Stores the power on value for the desired A O channel The unit is Vdc for the voltage channel and mA for the current channel Return Value 6 61 ioLogik MXIO DLL API Reference Direct I O Command Sets AO2K_GetPowerOnRaws This function code is used to get the power on values of contiguous A O channels in raw data format int AO2K GetPowerOnRavs int hConnection BYTE bytStartChannel BYTE bytCount WORD wValue Arguments hConnection The handle for an I O connection bytStartChannel Specifies the starting channel bytCount The number of channels to read wValue An array that stores the power on values of the contiguous A O channels in raw data format wValue 0 represents the value of the starting channel Return Value MXIO_OK Refer to Return Codes 2 SetPowerOnRaws This function code is used to set the power on values of contiguous A O channels in raw data format int AO2K SetPowerOnRavs int hConnection BYTE bytStartChannel BYTE bytCount WORD wValue Arguments hConnection The handle for an I O connection bytStartChannel Specifies the starting channel bytCount The number of channels to set wValue An array that stores the power on values of contiguous A O channels in raw data format vvValue 0 represents the value of the starting channel Return Value MXIO OK AO2K_GetPowerOnRaw This function code is used to get the power on value of a specific analog outp
57. ensorType 0 represents the value of the starting channel The values for normal channel are 0 50 1 100 2 200 3 500 4 1000 5 100 6 JPT200 7 500 8 1000 9 NI100 10 NI200 11 NI500 12 NI1000 13 NI120 14 310 Ohm 15 620 Ohm 16 1250 Ohm 17 2500 Ohm Others return Illegal Data Value The values for virtual channels are 20 AVG 21 DIV Others return Illegal Data Value Return Value MXIO_OK 6 79 ioLogik MXIO DLL API Reference Direct O Command Sets RTD2K_GetEngUnit This function code is used to get the engineering unit for a specific RTD channel int RTD2K_GetEngUnit int hConnection bytChannel wEngUnit Arguments Return Value hConnection BYTE bytChannel WORD wEngUnit The handle for an I O device connection The specific channel to be get A pointer that stores the specific RTD channel s engineering unit The values for normal channels are 0 Celsius 1 Fahrenheit 2 Ohm Others return Illegal Data Value The values for virtual channels are 0 Celsius 1 Fahrenheit Others return Illegal Data Value MXIO OK Refer to Return Codes RTD2K SetEngUnit This function code is used to set the engineering unit for a specific RTD channel int RTD2K_SetEngUnit int hConnection bytChannel wEngUnit Arguments Return Value 6 80 hConnection BYTE bytChannel WORD wEngUnit The handle for an I O device connection The specifi
58. er 10 Modbus Command Sets 5 1 Direct 1 0 Command Sets s s R r aa alay eln n 6 1 Digital Input Commands ienne ninani anni E a i n n 6 2 Digital Input Commands for ioLogik E2000 2000 6 3 Counter Commands for ioLogik E2000 2000 6 6 Digital Output C mimand Srei iinan a ee a E EE 6 18 Digital Output Commands for ioLogik E2000 2000 6 22 Digital Input Output Commands for ioLogik 2000 6 25 Digital Output Commands for ioLogik 4000 6 27 Pulse Output Commands for ioLogik E2000 2000 2222 6 29 Analog Input 5 6 42 Analog Input Commands for ioLogik E2000 2000 2222 6 44 Analog Output 45 6 50 Analog Output Commands for ioLogik E2000 R2000 2522 2222 6 58 Analog Output Commands for ioLogik 4000 2 6 63 RID Commands ka A a hea eae 6 65 Thermocouple Commands 22 cccccsccctveccavecsceieedeccecdh R A A Ass 6 84 Click8Go Logic 5 5 7 1 Activ
59. eset Return Value Succeed MXIO OK Fail Refer to Return Codes ALK ReadMax This function code is used to read the maximize value for a specific A I channel int AI2K ReadMax int hConnection BYTE bytChannel double dValue Arguments hConnection The handle for an I O connection bytChannel The specific channels to be read dValue A pointer to the maximize value of the desired A I channel The unit is VDC for the voltage module and mA for the current module Return Value MXIO_OK Refer to Return Codes 6 47 ioLogik MXIO DLL API Reference Direct I O Command Sets AI2K_ReadMaxRaw This function code is used to read the maximize raw data value for a specific A I channel int AIZK_ReadMaxRaw int hConnection BYTE bytChannel WORD wValue Arguments hConnection The handle for an I O connection bytChannel The desired channel wValue A pointer to the raw data value of the desired A I channel Return Value AI2K ResetMax This function code is used to reset the maximize value for a specific A I channel C C int AT2K ResetMin int hConnection BYTE bytChannel Arguments hConnection The handle for an I O connection bytChannel The desired channel Return Value Succeed MXIO_OK Fail Refer to Return Codes AI2K_GetRanges This function code is used to get the ranges of contiguous A I channels int AT2K GetRanges int hConnection BYTE bytStartChannel BYTE bytCount WORD wRange Argu
60. ges are incorporated into new editions of the manual Technical Support Contact Information www moxa com support Moxa Americas Moxa China Shanghai office Toll free 1 888 669 2872 Toll free 800 820 5036 Tel 1 714 528 6777 Tel 86 21 5258 9955 Fax 1 714 528 6778 Fax 86 10 6872 3958 Moxa Europe Moxa Asia Pacific Tel 49 89 3 70 03 99 0 Tel 886 2 8919 1230 Fax 49 89 3 70 03 99 99 Fax 886 2 8919 1231 Chapter 1 Chapter 2 Chapter 3 Chapter 4 Table of Contents OVE VIEWN 2 aa da DAR eect teed eva 1 1 What is the MXIO Linux 1 2 Supported Platforms 2c 2s scccc geiedeccee aya ERE TN al 1 2 Supported VO Modules os sr ni 1 2 Moxa Library Comparison ee Eerie isi isi iiaei 1 2 Pr gramming a 2 1 Connecting to a Single Ethernet 1 2 2 Connecting to Multiple Ethernet 1 2 3 Connecting to a Single Serial 1 2 4 Connecting to Multiple RS 485 VO 2 5 Connecting to the ioLogik E2000 and Attached RS 485 1 2 5222 2 6 Modbus Command Sets vs Direct I O Command 5615 2 7 Modbus Command 8 5
61. handle for an I O connection bytStartChannel Specifies the starting channel bytCount The number of channels to read dwValue An array that stores the counter values of the contiguous channels dwValue 0 represents the value of the starting channel Return Value MXIO OK Refer to Return Codes Cnt2K_Clears This function code is used to clear the counter values of contiguous D I channels in Counter mode int Cnt2K Clears int hConnection BYTE bytStartChannel BYTE bytCount Arguments hConnection The handle for an I O connection bytStartChannel Specifies the starting channel bytCount The number of channels to clear Return Value Succeed MXIO OK Fail Refer to Return Codes Cnt2K_Read This function code is used to read the counter value of a specific D I channel in Counter mode int Cnt2K_Read int hConnection BYTE bytChannel DWORD dwValue Arguments hConnection The handle for an I O connection bytChannel The desired channel dwValue A pointer to the counter value of the desired channel Return Value Succeed MXIO_OK Fail Refer to Return Codes ioLogik MXIO DLL API Reference Direct I O Command Sets Cnt2K_Clear This function code is used to clear the counter value of a specific D I channel in Counter mode C C int Cnt2K_Clear int hConnection BYTE bytChannel Arguments hConnection The handle for an I O connection bytChannel The desired channel Return Value Succeed MXIO OK
62. hapter 10 Product Model and ID Reference Table ATTENTION Click amp Go logic and active I O messaging are supported by the ioLogik E2000 line only Moxa Library Comparison PC Linux 2 41 UC 7110 LX UC 7408 LX suna Windows Po Linux 2 6 UC 7112 LX UC 7420 LX 2401 MXSIO OpenCommport vfttyS0 v ttyMO v tiyM0 MXSIO CloseCommport v v v MXSIO Connect v v vi MXSIO Disconnect v v v v MXEIO Init 7 MXEIO Exit Z MXEIO Connect v v v vV MXEIO Disconnect v v v MXEIO CheckConnection v v v v MXIO GetDllVersion v v MXIO GetD lBuildDate v v Vv v v MXIO GetModuleType g 7 Z v Z MXIO ReadFirmwareRevi v V v v v sion MXIO ReadFirmwareDate v v vi v MXIO Restart v v vi MXIO Reset a v MXIO_ReadCoils v v v v MXIO WriteCoils v 7 v v 7 MXIO ReadRegs v v v MXIO_WriteRegs v v vi vi ioLogik MXIO DLL API Reference Overview PC Linux 2 4 UC 7110 LX UC 7408 LX RTD_ReadRaws RTD_ReadRaw RTD2K ResetMin RTD2K ResetMins RTD2K ResetMax RTD2K ResetMaxs RTD2K ReadMinRaw RTD2K ReadMinRaws RTD2K ReadMaxRaw RTD2K ReadMaxRaws RTD2K ReadMin RTD2K ReadMins RTD2K ReadMax
63. he handle for an I O connection bytChannel The desired channel bytValue Stores the specific pulse channel s power on value The values are 0 stop 1 start Return Value MXIO_OK Refer to Return Codes Analog Input Commands AI Reads This function code is used to read the values of contiguous analog input channels int AJ Reads int hConnection BYTE bytSlot BYTE bytStartChannel BYTE bytCount double dValuel 1 Arguments hConnection The handle for an I O connection bytSlot Slot number of the I O module from 1 to 32 This parameter is inactive for the ioLogik E2000 and R2000 bytStartChannel Specifies the starting channel bytCount The number of channels to read dValue An array that stores the values of the contiguous A I channels dValue 0 represents the value of the starting channel The unit is Vdc for the voltage module and mA for the current module Return Value MXIO OK Refer to Return Codes 6 42 ioLogik MXIO DLL API Reference Direct O Command Sets AI_Read This function code is used to read the value of a specific analog input channel int AJ Read int hConnection BYTE bytSlot BYTE bytChannel double dValue hConnection bytSlot Arguments bytChannel dValue Return Value The handle for an I O connection Slot number of the I O module from 1 to 32 This parameter is inactive for the ioLogik E2000 and R2000 The desired channel A
64. he handle for an I O device connection bytStartChannel Specifies the starting channel bytCount The number of channels to be get dwStatus A pointer that stores the contiguous RTD channel s start status each bit holds one channel status A bit value of 0 represents the status of the start channel A bit value of 1 represents the second channel s status The values are 0 stop 1 start Return Value MXIO OK Refer to Return Codes 6 74 ioLogik MXIO DLL API Reference Direct I O Command Sets RTD2K SetStartStatuses This function code is used to set contiguous channel s start status int RTD2K_SetStartStatuses int hConnection BYTE bytStartChannel BYTE bytCount DWORD dwStatus Arguments hConnection The handle for an I O device connection bytStartChannel Specifies the starting channel bytCount The number of channels to be set dwStatus A pointer that stores the contiguous count channel s start status each bit holds one channel status A bit value of 0 represents the status of the start channel A bit value of 1 represents the second channel s status The values are 0 stop 1 start MXIO OK Refer to Return Codes Return Value 6 75 ioLogik MXIO DLL API Reference Direct I O Command Sets RTD2K_GetSensorType This function code is used to get the sensor type for a specific RTD channel int RTD2K_GetSensorType int hConnection BYTE bytChannel WORD wSensorType Arguments hConnect
65. hod of obtaining I O data With direct I O command sets each I O point or channel can be accessed using the physical slot number and channel number This allows users to obtain I O data quickly and easily 3 MXIO API Overview The MXIO API is organized into five types of commands 31 System Command Sets U v V V V Vv RS 485 RS 232 I O Connect Commands Ethernet I O Connect Commands General Commands Special Commands for ioLogik E2000 R2000 Special Commands for ioLogik 4000 Modbus Command Sets Direct I O Command Sets V VV V V VV V VV VV Vv v Digital Input Commands Digital Input Commands for ioLogik E2000 R2000 Digital Input Output Mode Commands for ioLogik E2000 Counter Commands for ioLogik E2000 R2000 Digital Output Commands Digital Output Commands for ioLogik E2000 R2000 Digital Output Commands for ioLogik 4000 Pulse Output Commands for ioLogik E2000 R2000 Analog Input Commands Analog Input Commands for ioLogik E2000 R2000 Analog Output Commands Analog Output Commands for ioLogik E2000 R2000 Analog Output Commands for ioLogik 4000 RTD Commands Thermocouple Commands U Click amp Go Logic Commands U Active I O Message Commands ioLogik MXIO DLL API Reference MXIO API Overview System Command Sets RS 485 RS 232 I O Connect Commands Function Name MXSIO OpenCommport MXSIO CloseCommport MXSIO Connect MXSIO Disconnect Ethernet I O Connect Co
66. ic channel to be set wMathPar A pointer that stores the specific RTD channel s math parameter For AVG Bit 0 of high byte represents the first channel and Bit 1 of high byte represents the second channel For DEV the High Byte as subtrahend and Low Byte as minuend Exp AVG b 0000 0000 b 0010 0011 ch5 ch1 ch0 Exp DEV b 0000 0100 b 0010 0000 ch2 ch6 Return Value Succeed MXIO_OK Fail Refer to Return Codes RTD2K_GetMathPars This function code is used to get contiguous RTD channel s math parameter int RTD2K GetMathPars int hConnection BYTE bytStartChannel BYTE bytCount VVORD wMathPar 1 Arguments hConnection The handle for an I O device connection bytStartChannel Specifies the starting channel bytCount The number of channels to be gets wMathPart An array that stores the contiguous RTD channel s math parameter wMathPar 0 represents the value of the starting channel The values are For AVG Bit 0 of high byte represents the first channel and Bit 1 of high byte represents the second channel For DEV High Byte as subtrahend and Low Byte as minuend Exp AVG b 0000 0000 b 0010 0011 ch5 ch1 ch0 Exp DEV b 0000 0100 b 0010 0000 ch2 ch6 Return Value MXIO OK i Refer to Return Codes 6 83 ioLogik MXIO DLL API Reference Direct I O Command Sets RTD2K_SetMathPars This function code is used to set contiguous RTD channel s math parameter int RTD2K_SetMathPars int hConnecti
67. iguous channels in raw data format wValue 0 represents start channel 0 When wValue is 0x8000 it means the sensor is not correctly wired When the operating mode is temperature sensor 0 1 C F When the operating mode of the TC module is 78 0 78 0 mV 10 uV count When the operating mode of the TC module is 32 7 32 7 mV luV count When the operating mode of the TC module is 65 5 65 5 mV 2uV count Use ioAdmin to check the I O module settings MXIO OK Refer to Return Codes ioLogik MXIO DLL API Reference Direct I O Command Sets TC_ReadRaw This function code is used to read the temperature value of a specific channel in raw data format int TC_ReadRaw int hConnection BYTE bytSlot BYTE bytChannel WORD wValue Arguments hConnection The handle for an I O connection bytSlot Slot number of the I O module from 1 to 32 This parameter is inactive for the ioLogik E2000 and R2000 bytChannel The desired channel wValue A pointer to the temperature value to read When wValue is 0x8000 it means the sensor is not correctly wired When the operating mode is temperature sensor 0 1 C F When the operating mode of the TC module is 78 0 78 0 mV 10uV count When the operating mode of the TC module is 32 7 32 7 mV TuV count When the operating mode of the TC module is 65 5 65 5 mV 2uV count Use ioAdmin to check the I O module settings Return Value MXIO OK Refer to Return Codes
68. ioLogik MXIO DLL API Reference Second Edition June 2008 www moxa com product MOXA 2008 Moxa Inc all rights reserved Reproduction without permission is prohibited ioLogik MXIO DLL API Reference The software described in this manual is furnished under a license agreement and may be used only in accordance with the terms of that agreement Copyright Notice Copyright 2008 Moxa Inc All rights reserved Reproduction without permission is prohibited Trademarks Moxa is a registered trademark of Moxa Inc All other trademarks or registered marks in this manual belong to their respective manufacturers Disclaimer Information in this document is subject to change without notice and does not represent a commitment on the part of Moxa Moxa provides this document as is without warranty of any kind either expressed or implied including but not limited to its particular purpose Moxa reserves the right to make improvements and or changes to this manual or to the products and or the programs described in this manual at any time Information provided in this manual is intended to be accurate and reliable However Moxa assumes no responsibility for its use or for any infringements on the rights of third parties that may result from its use This manual might include unintentional technical or typographical errors Changes are made periodically to the information herein to correct such errors and these chan
69. ion The handle for an I O device connection bytChannel The specific channel to be get wSensorType A pointer that stores the specific RTD channel s sensor type The values for normal channels are 0 PT50 1 PT100 2 PT200 3 PT500 4 PT1000 5 100 6 JPT200 7 500 8 1000 9 NI100 10 NI200 11 NI500 12 N11000 13 N1120 14 310 Ohm 15 620 Ohm 16 1250 Ohm 17 2500 Ohm Others return Illegal Data Value The values for virtual channels are 20 AVG 21 DIV Others return Illegal Data Value Return Value MXIO OK Refer to Return Codes 6 76 ioLogik MXIO DLL API Reference Direct I O Command Sets RTD2K_SetSensorType This function code is used to set the sensor type for a specific RTD channel int RTD2K SetSensorType int hConnection BYTE bytChannel WORD wSensorType Arguments hConnection The handle for an I O device connection bytChannel The specific channel to be set wSensorType A pointer that stores the specific RTD channel s sensor type The values for normal channels are 0 PT50 1 PT100 2 PT200 3 PT500 4 PT1000 5 100 6 JPT200 7 500 8 1000 9 N1100 10 NI200 11 NI500 12 N11000 13 N1120 14 310 Ohm 15 620 Ohm 16 1250 Ohm 17 2500 Ohm Others return Illegal Data Value The values for virtual channels are 20 AVG 21 DIV Others return Illegal Data Value Return Value MXIO OK Refer to Return Codes 6 77 io
70. l The values are 0 Safe value 1 Hold last state 2 Low Limit 3 High Limit Return Value 6 63 ioLogik MXIO DLL API Reference Direct I O Command Sets AO4K_SetSafeActions This function code is used to set the safe actions of contiguous A O channels int AO4K_SetSafeActions int hConnection BYTE bytSlot BYTE bytStartChannel BYTE bytCount WORD wAction Arguments hConnection The handle for an I O connection bytSlot Slot number of the I O module from 1 to 32 bytStartChannel Specifies the starting channel bytCount The number of channels to set wAction An array that stores thesafe actions for the contiguous A O channels wAction 0 represents the value of the starting channel The values are 0 Safe value 1 Hold last state 2 Low Limit 3 High Limit Return Value MXIO OK Refer to Return Codes AO4K_GetSafeAction This function code is used to get the safe action for a specific analog output channel int AO4K_GetSafeAction int hConnection BYTE bytSlot BYTE bytChannel WORD wAction Arguments hConnection The handle for an I O connection bytSlot Slot number of the I O module from 1 to 32 bytChannel The desired channel wAction A pointer to the safe action of the desired A O channel The values are 0 Safe value 1 Hold last state 2 Low Limit 3 High Limit Return Value MXIO OK Refer to Return Codes 6 64 ioLogik MXIO DLL API Reference Direct I O Command Sets
71. l The desired channel bytStatus A pointer to the overflow status of the desired channel The values are 0 Normal 1 Overflow Return Value Cnt2K_ClearOverflow This function code is used to clear the overflow status of a specific D I channel in Counter mode C C int Cnt2K_ClearOverflow int hConnection BYTE bytChannel Arguments hConnection The handle for an I O connection bytChannel The desired channel Return Value Succeed MXIO OK Fail Refer to Returm Codes Cnt2K GetFilters This function code is used to get the filter value of contiguous D I channels in Counter mode int Cnt2K GetFilters int hConnection BYTE bytStartChannel BYTE bytCount WORD wkKilter Arguments hConnection The handle for an I O connection bytStartChannel Specifies the starting channel bytCount The number of channels to read wFilter An array that stores the filter values for the contiguous channels Return Value MXIO OK Refer to Return Codes 6 8 ioLogik MXIO DLL API Reference Direct I O Command Sets Cnt2K_SetFilters This function code is used to set the filter values of contiguous D I channels in Counter mode int Cnt2K_SetFilters int hConnection BYTE _ bytStartChannel BYTE _ bytCount WORD vrFilterl 1 Arguments hConnection The handle for an I O connection bytStartChannel Specifies the starting channel bytCount The number of channels to set wFilter An array that stores
72. log Output Commands for ioLogik E2000 R2000 Analog Output Commands for ioLogik 4000 RTD Commands Thermocouple Commands Click amp Go Logic Commands Active I O Message Commands ioLogik MXIO DLL API Reference Direct I O Command Sets Digital Input Commands DI_Reads This function code is used to read the status of a group of contiguous D I channels int DI Reads int hConnection BYTE bytSlot BYTE bytStartChannel BYTE bytCount DWORD dwValue Arguments hConnection The handle for an I O connection bytSlot Slot number of the I O module from 1 to 32 This parameter is inactive for the ioLogik E2000 and R2000 bytStartChannel Specifies the starting channel bytCount The number of channels to read dwValue A pointer to the contiguous channel s values each bit holds the value of one channel A bit value of 0 represents the digital input status of the start channel A bit value of 1 represents the second digital input channel s status The values of the unused bits are random Return Value MXIO OK i Refer to Return Codes DI_Read This function code is used to read the status of a specific D I channel int DI_Read int hConnection BYTE bytSlot BYTE bytChannel BYTE bytValue Arguments hConnection The handle for an I O connection bytSlot Slot number of the I O module from 1 to 32 This parameter is inactive for the ioLogik E2000 and R2000 bytChannel The desired channel bytValue
73. lue The handle for an I O connection The desired channel Stores the power on value of a specific D O channel MXIO_OK Refer to Return Codes Digital Input Output Commands for ioLogik E2000 DIO2K GetlOMode This function code is used to get specific channel s DI DO mode int DIO2K GetlOMode int hConnection bytChannel bytMode Arguments Return Value Succeed Fail 6 25 hConnection BYTE bytChannel BYTE bytMode The handle for an I O connection The specific channel to be get A pointer that stores the specific channel s DI DO mode The values are 0 INPUT DI mode 1 OUTPUT DO mode MXIO OK Refer to Return Codes ioLogik MXIO DLL API Reference Direct I O Command Sets This function will take effect after restart the device int DIO2K SetlOMode int hConnection BYTE bytChannel BYTE bytMode hConnection The handle for an I O connection Arguments bytChannel The specific channel to be set bytMode A pointer that stores the specific channel s DI DO mode The values are 0 INPUT DI mode 1 OUTPUT DO mode MXIO OK Refer to Return Codes Return Value DIO2K GetlIOModes This function code is used to get contiguous channel s DI DO mode int DIO2K GetlOModes int hConnection BYTE bytStartChannel BYTE bytCount DVVORD dwMode Arguments hConnection The handle for an I O connection bytStartChannel Specifies the starting channel bytCount The number of channels to b
74. lue int RTD2K ResetMaxs int hConnection BYTE yYtStartChannel BYTE bytCount Arguments hConnection The handle for an I O device connection bytStartChannel Specifies the starting channel bytCount The number of channels to be reset Return Value Succeed MXIO OK Fail Refer to Return Codes 6 69 ioLogik MXIO DLL API Reference Direct O Command Sets RTD2K_ReadMinRaw This function code is used to read the RTD input minimize raw data for a specific channel int RTD2K_ReadMinRaw int hConnection bytChannel iValue Arguments Return Value hConnection BYTE bytChannel WORD iValue The handle for an I O device connection The specific channel to be read An point that stores the specific RTD channel s minimize raw data MXIO OK Refer to Return Codes RTD2K ReadMinRaws This function code is used to read contiguous RTD channe s minimize raw data int RTD2K_ReadMinRavws int hConnection Arguments hConnection bytStartChannel bytCount wValue Return Value BYTE bytStartChannel BYTE bytCount WORD wValue The handle for an I O device connection Specifies the starting channel The number of channels to be read An array that stores the contiguous RTD channel s minimize raw data wValue 0 represents the value of the starting channel MXIO_OK Refer to Return Codes RTD2K_ReadMaxRaw This function code is used to read the RTD input maximize raw data for a specific
75. lues are 00 150mV 01 500mV 02 5V 03 10V 04 0 20mA 05 4 20mA Others return Illegal Data Value MXIO OK Refer to Return Codes Return Value Return Value 6 49 ioLogik MXIO DLL API Reference Direct I O Command Sets AI2K_SetRange This function code is used to set the range for a specific A I channel int AT2K SetRange int hConnection BYTE bytChannel WORD wRange Arguments hConnection The handle for an I O connection bytChannel The desired channel wRange Stores the range of the desired A I channel The values are 00 150mV 01 500mV 02 5V 03 10V 04 0 20mA 05 4 20mA Others return Illegal Data Value Return Value MXIO OK Refer to Return Codes Analog Output Commands AO_Reads This function code is used to read the values of contiguous analog output channels int AO_Reads int hConnection BYTE bytSlot BYTE bytStartChannel BYTE bytCount double dValuel 1 Arguments hConnection The handle for an I O connection bytSlot Slot number of the I O module from 1 to 32 This parameter is inactive for the ioLogik E2000 and R2000 bytStartChannel Specifies the starting channel bytCount The number of channels to read dValue An array that stores the values of contiguous analog output channels dValue 0 represents the value of the starting channel The unit is Vdc for the voltage channel and mA for the current channel Return Value 6 50 i
76. ments hConnection The handle for an I O connection bytChannel The desired channel bytStatus A pointer to the start status of the desired channel The values are 0 stop 1 start Return Value 6 11 ioLogik MXIO DLL API Reference Direct I O Command Sets Cnt2K_GetTriggerTypes This function code is used to get the trigger types of contiguous D I channels in Counter mode int Cnt2K_GetTriggerTypes int hConnection BYTE bytStartChannel BYTE bytCount DWORD dwType Arguments hConnection The handle for an I O connection bytStartChannel Specifies the starting channel bytCount The number of channels to read dwType A pointer to the triggers types each bit holds the trigger type of one channel A bit value of 0 represents the trigger type of the start channel A bit value of 1 represents the second channel s trigger type The values are 0 LoToHi 1 HiToLo Return Value MXIO OK Refer to Return Codes Cnt2K_SetTriggerTypes This function code is used to set the trigger types of contiguous D I channels in Counter mode int Cnt2K SetTriggerTypes int hConnection BYTE bytStartChannel BYTE bytCount DWORD dwType Arguments hConnection The handle for an I O connection bytStartChannel Specifies the starting channel bytCount The number of channels to set dwType Stored the trigger types of the contiguous channels each bit holds the trigger type of one channel A bit value of 0 represe
77. ments hConnection The handle for an I O connection bytStartChannel Specifies the starting channel bytCount The number of channels to read wRange An array that stores the ranges of the contiguous A I channels wRange 0 represents the value of the starting channel The values are 00 150mV 01 500mV 02 5V 03 10V 04 0 20mA 05 4 20mA Others return Illegal Data Value MXIO OK Refer to Return Codes Return Value 6 48 ioLogik MXIO DLL API Reference Direct I O Command Sets AI2K_SetRanges This function code is used to set the ranges of contiguous A I channels int AT2K SetRanges int hConnection BYTE bytStartChannel BYTE bytCount WORD wRange 1 Arguments hConnection The handle for an I O connection bytStartChannel Specifies the starting channel bytCount The number of channels to set wRange An array that stores the ranges of the contiguous A I channels wRange 0 represents the value of the starting channel The values are 00 150mV 01 500mV 02 5V 03 10V 04 0 20mA 05 4 20mA Others return Illegal Data Value MXIO OK Refer to Return Codes AI2K_GetRange This function code is used to get the range for a specific A I channel int AT2K GetRange int hConnection BYTE bytChannel WORD wRange Arguments hConnection The handle for an I O connection bytChannel The desired channel wRange A pointer to the range of the desired A I channel The va
78. mmands Function Name MXEIO Init MXEIO Exit MXEIO Connect MXEIO_Disconnect MXEIO CheckConnection General Commands Function Name MXIO GetDllVersion MXIO GetDIIBuildDate MXIO GetModuleType MXIO ReadFirmwareRevision MXIO ReadFirmwareDate MXIO Restart MXIO Reset Special Commands for ioLogik E2000 R2000 Function Name Module2K GetSafeStatus Module2K ClearSafeStatus Special Commands for ioLogik 4000 Function Name Adp4K ReadFirmwareRevision Adp4K ReadStatus Adp4K ClearStatus Adp4K ReadFirmwareDate Adp4K ReadSlotA mount Adp4K ReadAlarmedSlot Adp4K ReadAlarmedSlot 3 2 ioLogik MXIO DLL API Reference MXIO API Overview Modbus Command Sets Function Name ReadCoils MXIO WriteCoils MXIO ReadRegs MXIO WriteRegs Direct O Command Sets Digital Input Commands Function Name DI Reads DI Read Digital Input Commands for ioLogik E2000 R2000 Function Name DI2K GetModes DI2K SetModes DI2K_GetMode DI2K_SetMode DI2K GetFilters DI2K SetFilters DI2K GetFilter DI2K SetFilter Digital Input Output Mode Commands for ioLogik E2000 Function Name DIO2K GetlOMode DIO2K SetlOMode DIO2K GetlOModes DIO2K SetlOModes ioLogik MXIO DLL
79. nce Direct O Command Sets Digital Output Commands DO_Reads This function code is used to read the output statuses of contiguous D O channels int DO_Reads int BYTE BYTE BYTE hConnection bytSlot bytStartChannel bytCount DWORD dwValue hConnection bytSlot Arguments bytStartChannel bytCount dwValue Return Value The handle for an I O connection Slot number of the I O module from 1 to 32 This parameter is inactive for the ioLogik E2000 and R2000 Specifies the starting channel The number of channels to read A pointer to the statuses of the contiguous D O channels each bit holds the value of one channel A bit value of 0 represents the digital output status of the start channel A bit value of 1 represents the status of the second digital output channel The values of the unused bits are random MXIO_OK Refer to Return Codes DO_Read This function code is used to read the output status of a specific D O channel int DO_Read int BYTE BYTE BYTE hConnection bytSlot Arguments bytChannel bytValue Succeed Fail Return Value hConnection bytSlot bytChannel bytValue The handle for an I O connection Slot number of the I O module from 1 to 32 This parameter is inactive for the ioLogik E2000 and R2000 The desired channel A pointer to the output value of the desired channel MXIO OK Refer to Return Codes ioLogik MXIO DLL API Refe
80. nel MXIO_OK Refer to Return Codes ioLogik MXIO DLL API Reference Direct I O Command Sets AO2K_SetPowerOnValues This function code is used to set the power on values of contiguous A O channels int AO2K_SetPowerOnValues int hConnection BYTE bytStartChannel BYTE bytCount double dValuel Arguments hConnection The handle for an I O connection bytStartChannel Specifies the starting channel bytCount The number of channels to set dValue An array that stores the power on valuse for the contiguous A O channels dValue 0 represents the value of the starting channel The unit is Vdc for the voltage channel and mA for the current channel Return Value MXIO_OK Refer to Return Codes AO2K_GetPowerOnValue This function code is used to get the power on value for a specific channel int AO2K_GetPowerOnValue int hConnection BYTE bytChannel double dValue Arguments hConnection The handle for an I O connection bytChannel The desired channel dValue A pointer to the power on value for the desired A O channel The unit is Vde for the voltage channel and mA for the current channel Return Value MXIO_OK Refer to Return Codes AO2K_SetPowerOnValue This function code is used to set the power on value for a specific channel int AO2K_SetPowerOnValue int hConnection BYTE bytChannel double dValue Arguments hConnection The handle for an I O server connection bytChannel The desired chann
81. nel bytCount The number of channels to set dwValue A pointer to the safe values of the contiguous D O channels each bit holds the value of one channel A bit value of 0 represents the digital output status of the start channel A bit value of 1 represents the status of the second digital output channel Return Value MXIO OK Refer to Return Codes 6 20 ioLogik MXIO DLL API Reference Direct I O Command Sets DO_GetSafeValue This function code is used to get the safe value for a specific D O channel int DO_GetSafeValue int hConnection bytSlot Arguments bytChannel bytValue Return Value hConnection BYTE bytSlot BYTE bytChannel BYTE bytValue The handle for an I O connection Slot number of the I O module from 1 to 32 This parameter is inactive for the ioLogik E2000 and R2000 The desired channel Stores the safe value of the desired D O channel 1 represents ON 0 represents OFF MXIO OK Refer to Return Codes DO SetSafeValue This function code is used to set the safe value for a specific D O channel int DO SetSafeValue int hConnection bytSlot Arguments bytChannel bytValue Return Value Succeed Fail 6 21 hConnection bytSlot BYTE bytChannel BYTE _ bytValue The handle for an I O connection Slot number of the I O module from 1 to 32 This parameter is inactive for the ioLogik E2000 and R2000 The desired channel BYTE Stores th
82. nel DWORD dwOutputCount Arguments hConnection The handle for an I O connection bytChannel The desired channel dwOutputCount A pointer to the output count for the desired channel Return Value Succeed MXIO OK Fail Refer to Return Codes 6 35 ioLogik MXIO DLL API Reference Direct I O Command Sets Pulse2K_GetStartStatuses This function code is used to get the start statuses of contiguous pulse channels int Pulse2K_GetStartStatuses int hConnection BYTE bytStartChannel BYTE bytCount DWORD dwStatus Arguments hConnection The handle for an I O connection bytStartChannel Specifies the starting channel bytCount The number of channels to read dwStatus An point that stores the start statuses for the contiguous pulse channels each bit holds the value of one channel A bit value of 0 represents the start status of the start channel A bit value of 1 represents the status of the second pulse channel The values are 0 stop 1 start Return Value MXIO OK Refer to Return Codes 6 36 ioLogik MXIO DLL API Reference Direct I O Command Sets Pulse2K_SetStartStatuses This function code is used to set the start statuses of contiguous pulse channels int Pulse2K_SetStartStatuses int hConnection BYTE bytStartChannel BYTE bytCount DWORD dwStatus Arguments hConnection The handle for an I O connection bytStartChannel Specifies the starting channel bytCount The number of channels
83. nnection Handle for the I O connection bytCoilType Coil type to be read 1 read coils output bit 2 read discrete input bit wStartCoil Specifies the starting coil address to be read The address is beginning at 0 wCount The number of coils to be read bytCoils An array that stores the status of coils each byte holds eight coil values Bit 0 of Ist byte represents 1st coil status Return Value MXIO OK Refer to Return Codes ioLogik MXIO DLL API Reference Modbus Command Sets MXIO WriteCoils function code is used to write the contiguous status of an I O int MXIO_WriteCoils int hConnection WORD vsStartCoil WORD vwCount BYTE bytCoils 1 Arguments hConnection Handle for the I O connection wStartCoil Specifies the starting coil to be written The address is beginning at 0 wCount The number of coils to be written bytCoils An array that stores the coil value each byte holds eight coil values Return Value MXIO OK Refer to Return Codes This function code is used to read the contents of a contiguous MXIO ReadRegs block of the I O holding registers int MXIO_ReadRegs int hConnection BYTE bytRegisterType WORD wStartRegister WORD vvCount WORD wRegister Arguments hConnection The handle for an I O connection bytRegisterType Coil type to be read The meaning for a value in an entity is as follows 3 read holding registers output word 4 read input register input wo
84. nnel bytCount wValue Return Value hConnection bytSlot bytStartChannel BYTE bytCount WORD wValue The handle for an I O connection Slot number of the I O module from 1 to 32 This parameter is inactive for the ioLogik E2000 and R2000 Specifies the starting channel BYTE BYTE The number of channels to write An array that stores raw data values for the contiguous analog output channels wValue 0 represents the value of the starting analog output channel MXIO OK Refer to Return Codes AO ReadRaw This function code is used to read the raw data value of a specific analog output channel int AO ReadRav int hConnection bytSlot Arguments bytChannel wValue Succeed Fail Return Value 6 53 hConnection bytSlot bytChannel wValue BYTE BYTE WORD The handle for an I O connection Slot number of the I O module from 1 to 32 This parameter is inactive for the ioLogik E2000 and R2000 The desired channel A pointer to the raw data value of the desired analog output channel MXIO OK Refer to Return Codes ioLogik MXIO DLL API Reference Direct I O Command Sets AO_WriteRaw This function code is used to write the raw data value of a specific analog output channel int AO_WriteRaw int hConnection bytSlot Arguments bytChannel wValue Return Value Succeed Fail hConnection bytSlot bytChannel wValue BYTE BYTE WORD Th
85. nt dwValue Return Value Succeed Fail hConnection bytStartChannel BYTE bytCount DWORD dwValue The handle for an I O connection BYTE Specifies the starting channel The number of channels to read A pointer to the power on values each bit holds the power on value of one channel A bit value of 0 represents the power on value of the start channel A bit value of 1 represents the second channel s power on value The values are 0 OFF 1 ON MXIO OK Refer to Return Codes Cnt2K SetPowerOnValues This function code is used to set the power on values of contiguous D I channels in Counter mode int Cnt2K_SetPowerOnValues int hConnection bytStartChannel bytCount dwValue Arguments Return Value 6 14 hConnection BYTE bytStartChannel BYTE bytCount DWORD dwValue The handle for an I O connection Specifies the starting channel The number of channels to set Stored the power on values for the contiguous channels each bit holds the power on value of one channel A bit value of 0 represents the power on value of the start channel A bit value of 1 represents the second channel s power on value The values are 0 OFF 1 ON MXIO OK Refer to Return Codes ioLogik MXIO DLL API Reference Direct O Command Sets Cnt2K_GetPowerOnValue This function code is used to get power on values when specific D I channel in Counter mode int Cnt2K_GetPowerOnValue int h
86. nts the status of the start channel A bit value of 1 represents the second channel s status The values are 0 stop 1 start MXIO OK Refer to Return Codes Return Value Cnt2K SetStartStatuses This function code is used to set the start statuses of contiguous D I channels in Counter mode int Cnt2K_SetStartStatuses int hConnection BYTE bytStartChannel BYTE bytCount DWORD dwStatus Arguments hConnection The handle for an I O connection bytStartChannel Specifies the starting channel bytCount The number of channels to set dwStatus A pointer to the start statuses of the contiguous channels each bit holds the start status of one channel A bit value of 0 represents the status of the start channel A bit value of 1 represents the second channel s status The values are 0 stop 1 start MXIO OK Refer to Return Codes Return Value 6 10 ioLogik MXIO DLL API Reference Direct I O Command Sets Cnt2K_GetStartStatus This function code is used to get the start status of a specific D I channel in Counter mode int Cnt2K_GetStartStatus int hConnection BYTE _ bytChannel BYTE bytStatus Arguments hConnection The handle for an I O connection bytChannel The desired channel bytStatus A pointer to the start status of the desired channel The values are 0 stop 1 start Return Value int Cnt2K_SetStartStatus int hConnection BYTE bytChannel BYTE bytStatus Argu
87. nts the trigger type of the start channel A bit value of 1 represents the second channel s trigger type The values are 0 LoToHi 1 HiToLo MXIO OK Refer to Return Codes Return Value 6 12 ioLogik MXIO DLL API Reference Direct O Command Sets Cnt2K GetTriggerType 1 This function code is used to get the trigger type of a specific channel in Counter mode int Cnt2K_GetTriggerType int Arguments hConnection bytChannel bytType Return Value hConnection BYTE bytChannel BYTE bytType The handle for an I O connection The desired channel A pointer to the trigger type for a specific channel The values are 0 LoToHi 1 HiToLo Cnt2K_SetTriggerType This function code is used to set the trigger type of a specific D I channel in Counter mode int Cnt2K_SetTriggerType int hConnection bytStartChannel bytCount Arguments bytType Return Value hConnection BYTE bytChannel BYTE bytType The handle for an I O connection Specifies the starting channel The desired channel Stores the trigger type for the desired channel The values are 0 LoToHi 1 HiToLo MXIO_OK Refer to Return Codes ioLogik MXIO DLL API Reference Direct O Command Sets Cnt2K_GetPowerOnValues This function code is used to get the power on values of contiguous D I channels in Counter mode int Cnt2K_GetPowerOnValues int Arguments hConnection bytStartChannel bytCou
88. o release Windows system resources Program Flow I Connecting to a Single Ethernet I O MXEIO Connect fl v Direct O Command Sets Modbus Command Sets MXEIO Disconnect ioLogik MXIO DLL API Reference Programming Flow Connecting to Multiple Ethernet I O Before multiple Ethernet I O can be accessed over the network make sure that each I O has a unique IP address Ethernet ioLogik 4000 remote I O ioLogik E2000 Ethernet I O IP 192 168 8 1 IP 192 168 8 2 Port 502 Port 502 Each Ethernet I O needs a unique handle in order to be accessed Use Connect to obtain the handle for each Ethernet I O Program Flow II Connecting to Multiple Ethernet I O MXEIO Connect 1 MXEIO Connect 2 Direct O Command Sets Modbus Command Sets MXEIO Disconnect 1 MXEIO Disconnect 2 ioLogik MXIO DLL API Reference Programming Flow Connecting to a Single Serial I O ioLogik 4000 and R2000 I O can be used in RS 485 RS 232 control networks For access to I O over RS 485 or RS 232 please pay attention to the following Your computer must be equipped with an RS 232 or RS 485 communication port Make sure that the baudrate and communication parameters for the computer and the I O are identical Make sure that the I O is running under Modbus RTU o i 2 r MORA 5 i Or Na a 7 1 m Ex COM1 e PRO Oy Ex COM1 9600 N 8 1 ioLogik 4000 ioLogik 2000 I O M
89. oLogik MXIO DLL API Reference Direct I O Command Sets AO Writes This function code is used to write the values of contiguous analog output channels int AO_Writes int hConnection BYTE bytSlot BYTE bytStartChannel BYTE bytCount double dValuel Arguments hConnection The handle for an I O connection bytSlot Slot number of the I O module from 1 to 32 This parameter is inactive for the ioLogik E2000 and R2000 bytStartChannel Specifies the starting channel bytCount The number of channels to write dValue An array that stores the values of contiguous channel outputs dValue 0 represents the value of the starting channel The unit is VDC for the voltage channel and mA for the current channel Return Value MXIO OK Refer to Return Codes AO_Read This function code is used to read the value for a specific analog output channel int AO_Read int hConnection BYTE bytSlot BYTE bytChannel double dValue Arguments hConnection The handle for an I O connection bytSlot Slot number of the I O module from 1 to 32 This parameter is inactive for the ioLogik E2000 and R2000 bytChannel The desired channel dValue A pointer to the value of the desired analog output channel The unit is VDC for the voltage channel and mA for the current channel Return Value 6 51 ioLogik MXIO DLL API Reference Direct I O Command Sets AO_Write This function code is used to write the status for a specific analog
90. odule ioLogik 4000 remote I O ioLogik E2000 Ethernet I O ID 10 ID 10 Four steps are required to access remote I O data using the MXIO Linux Library 1 Use MXSIO OpenCommport to open the COM port and connect to the serial I O 2 Use MXSIO Connect to connect to the serial I O using the Unit ID e g 10 MXSIO Connect should return a handle 3 Use the handle to access the desired I O point with Modbus command sets or direct I O command sets 4 To finish the operation use MXSIO_Disconnect and MXSIO_CloseCommport to release Windows system resources Program Flow III Connecting Single RS 485 VO MXSIO_OpenCommport MXSIO_Connect Direct O Command Sets Modbus Command Sets MXSIO_ Disconnect MXSIO_Closecommport 2 4 ioLogik MXIO DLL API Reference Programming Flow Connecting to Multiple RS 485 I O In most real world applications multiple RS 485 I O are often connected to the same network One RS 485 network can support up to 32 nodes Ex COM1 ioLogik 4000 int ogik 2000 I O Module Slice 1 0 Server 1 Ex ID 01 2 Ex ID 32 ioLogik 4000 remote I O ioLogik E2000 Ethernet I O ID 01 ID 32 Each serial I O requires a unique handle Make sure each serial I O server already has its own handle before accessing the I O points Program Flow IV Connecting Multiple Serial I O ps oyuna MXSIO_Connect 1 MXSIO_Connect 2 v HN Sets Modbus Command Sets MXSIO Disconnec
91. on BYTE bytStartChannel BYTE bytCount WORD wMathPar Arguments hConnection The handle for an I O device connection bytStartChannel Specifies the starting channel bytCount The number of channels to be sets wMathPart An array that stores the contiguous RTD channel s math parameter wMathPar 0 represents the value of the starting channel The values are For AVG Bit 0 of high byte represents the first channel and Bit 1 of high byte represents the second channel For DEV High Byte as subtrahend and Low Byte as minuend Exp AVG b 0000 0000 b 0010 0011 ch5 ch1 ch0 Exp DEV b 0000 0100 b 0010 0000 ch2 ch6 Return Value Succeed MXIO OK Fail Refer to Return Codes Thermocouple Commands TC_Reads This function code is used to read the temperature values for contiguous channels int TC_Reads int hConnection BYTE bytSlot BYTE bytStartChannel BYTE bytCount double dValuel Arguments hConnection The handle for an I O connection bytSlot Slot number of the I O module from 1 to 32 This parameter is inactive for the ioLogik E2000 and R2000 bytStartChannel Specifies the starting channel bytCount The number of channels to read dValue An array that stores the temperature values of the contiguous channels dValue 0 represents start channel 0 When dValue is 0x8000 it means the sensor is not correctly wired When the operating mode of the TC module is voltage input the unit is uv Us
92. op 1 start MXIO_OK Refer to Return Codes Return Value 6 40 ioLogik MXIO DLL API Reference Direct I O Command Sets Pulse2K_SetSafeValues This function code is used to set the safe value int Pulse2K_SetSafeValues int hConnection BYTE _ bytStartChannel BYTE bytCount DWORD dwValue Arguments hConnection The handle for an I O connection bytStartChannel Specifies the starting channel bytCount The number of channels to set dwValue Stores the safe value each bit holds the value of one channel A bit value of 0 represents the safe value of the start channel A bit value of 1 represents the value of the second pulse channel The values are 0 stop 1 start Return Value MXIO OK Refer to Return Codes Pulse2K GetSafeValue This function code is used to get the safe value for a specific pulse channel int Pulse2K_GetSafeValue int hConnection BYTE bytChannel BYTE by Value Arguments hConnection The handle for an I O server connection bytChannel The desired channel bytValue A pointer to the specific pulse channel s power on value The values are 0 stop 1 start Return Value MXIO_OK Refer to Return Codes 6 41 ioLogik MXIO DLL API Reference Direct I O Command Sets Pulse2K_SetSafeValue This function code is used to set the safe value for a specific pulse channel int Pulse2K_SetSafeValue int hConnection BYTE bytChannel BYTE bytValue Arguments hConnection T
93. or the ioLogik E2000 and R2000 The desired channel Stores the safe value of the desired A O channel The unit is Vdc for the voltage channel and mA for the current channel MXIO OK Refer to Return Codes BYTE AO GetSafeRaws This function code is used to get the raw safe values of contiguous analog output channels int AO GetSafeRavs int hConnection bytSlot Arguments bytStartChannel bytCount wValue Return Value 6 56 hConnection bytSlot BYTE bytStartChannel BYTE bytCount WORD vvaluel The handle for an I O connection Slot number of the I O module from 1 to 32 This parameter is inactive for the ioLogik E2000 and R2000 Specifies the starting channel BYTE The number of channels to read An array that stores the raw safe values of the contiguous A O channels wValue 0 represents the value of the starting channel MXIO OK Refer to Return Codes ioLogik MXIO DLL API Reference Direct O Command Sets AO_SetSafeRaws This function code is used to set safe values for contiguous A O channels in raw data format int AO_GetSafeRaws int hConnection bytSlot Arguments bytStartChannel bytCount wValue Return Value hConnection bytSlot BYTE bytStartChannel BYTE bytCount WORD vvaluel The handle for an I O connection Slot number of the I O module from 1 to 32 This parameter is inactive for the ioLogik E2000 and R2000 Specifies th
94. ount The number of channels to be read dValue An array that stores the contiguous RTD channel s maximize value dValue 0 represents the value of the starting channel The unit is Q for the Ohm C for Celsius and F for Fahrenheit Return Value MXIO OK Refer to Return Codes RTD2K GetStartStatus This function code is used to get specific channel s start status int RTD2K_GetStartStatus int hConnection BYTE bytChannel BYTE bytStatus Arguments hConnection The handle for an I O device connection bytChannel The specific channel to be get bytStatus A pointer that stores the specific RTD channel s start status The values are 0 stop 1 start Return Value MXIO OK Refer to Return Codes 6 73 ioLogik MXIO DLL API Reference Direct I O Command Sets RTD2K_SetStartStatus This function code is used to set specific channel s start status int RTD2K_SetStartStatus int hConnection BYTE bytChannel BYTE byfStatus Arguments hConnection The handle for an I O device connection bytChannel The specific channel to be set bytStatus A pointer that stores the specific RTD channel s start status The values are 0 stop 1 start Return Value MXIO OK Refer to Return Codes RTD2K GetStartStatuses This function code is used to get contiguous channel s start status int RTD2K_GetStartStatuses int hConnection BYTE bytStartChannel BYTE bytCount DWORD dwStatus Arguments hConnection T
95. output channel int AO_Write int BYTE BYTE double hConnection bytSlot Arguments bytChannel dValue Return Value hConnection bytSlot bytChannel dValue The handle for an I O connection Slot number of the I O module from 1 to 32 This parameter is inactive for the ioLogik E2000 and R2000 The desired channel Stores the value of the desired channel The unit is VDC for the voltage channel and mA for the current channel MXIO_OK Refer to Return Codes AO_ReadRaws This function code is used to read the raw data values of contiguous analog output channels int AO ReadRavs int hConnection bytSlot Arguments bytStartChannel bytCount wValue Return Value 6 52 hConnection bytSlot bytStartChannel BYTE bytCount WORD wValue The handle for an I O connection Slot number of the I O module from 1 to 32 This parameter is inactive for the ioLogik E2000 and R2000 Specifies the starting channel BYTE BYTE The number of channels to read An array that stores the raw data values for the contiguous analog output channels wValue 0 represents the value of the starting channel MXIO OK Refer to Return Codes ioLogik MXIO DLL API Reference Direct I O Command Sets AO_WriteRaws This function code is used to write the raw data values for contiguous analog output channels int AO_WriteRaws int hConnection bytSlot Arguments bytStartCha
96. pointer to the value of the desired analog input channel The unit is VDC for the voltage module and mA for the current module MXIO_OK Refer to Return Codes AI ReadRaws This function code is used to read the raw data values of contiguous analog input values int AT ReadRavs int hConnection bytSlot Arguments bytStartChannel bytCount wValue Return Value 6 43 hConnection bytSlot bytStartChannel BYTE bytCount WORD wValue The handle for an I O connection Slot number of the I O module from 1 to 32 This parameter is inactive for the ioLogik E2000 and R2000 Specifies the starting channel BYTE BYTE The number of channels to read An array that stores the raw data values of the contiguous A I channels wValue 0 represents the value of the starting channel MXIO OK ioLogik MXIO DLL API Reference Direct I O Command Sets AI ReadRaw This function code is used to read the raw data value of a specific analog input channel int AJ ReadRav int hConnection BYTE bytSlot BYTE bytChannel WORD wValue Arguments hConnection The handle for an I O connection bytSlot Slot number of the I O module from 1 to 32 This parameter is inactive for the ioLogik E2000 and R2000 bytChannel The desired channel wValue A pointer to raw data value of the desired analog input channel Return Value Succeed MXIO OK Fail Refer to Return Codes Analog Input Commands fo
97. ports RTU hConnection Handle of the I O device connection Return Value Succeed MXIO OK Fail Refer to Return Codes This will disconnect the RS 485 232 I O The I O handle will be MXSIO_Disconnect valid C C int MXSIO_Disconnect int hConnection Arguments hConnection Handle of the I O device connection Return Value Succeed MXIO OK Fail Refer to Return Codes ioLogik MXIO DLL API Reference System Commands Sets Ethernet I O Connect Commands MXEIO_Init Initiate the socket only for windows OS C C int MXEIO mit 0 Arguments Return Value MXIO OK Refer to Return Codes MXEIO_ Exit To terminates use of the socket only for windows OS C C int MXEIO Exit 0 Arguments None Return Value None This function establishes a connection to the port of the Ethernet MXEIO_Connect VO Once a connection is established a handle will be returned for additional functions int MXEIO_Connect char szIP WORD vwPort DWORD dwTimeOut int hConnection Arguments IP address of the Ethernet I O to be connected TCP port number of Ethernet I O Please use 502 for the ioLogik 4000 and E2000 dwTimeOut Timeout value in milliseconds for establishing a network connection with the ioLogik Ethernet adapter hConnection Handle of the I O device connection Return Value Succeed MXIO_OK Fail Refer to Return Codes ioLogik MXIO DLL API Reference System Commands Sets R This will close the connection with the
98. r or slave An unrecoverable error occurred while the server or slave was attempting to perform the requested action Specialized use in conjunction with programming commands The server or slave is engaged in processing a long duration program command The client or master should retransmit the message later when the server or slave is free The following situation may cause an EIO TIME OUT 1 Open socket timeout 2 Send command to the I O server timeout 3 I O response timeout 2002 An error occurred when the Windows system couldn t complete SOCKET INIT 2003 An error occurred when the Windows system couldn t initiate Socket 2004 The data received from Ethernet VO server is incorrect 2005 network connection from host computer is down 2006 Protocol type error 3001 Open COM port failure 3002 1 Unable to communicate to the COM port in the designated time ioLogik MXIO DLL API Reference Return Codes Setup COM port error SIO SET COMM TIME OUT FAIL 3009 Set COM port read timeout and write timeout fail SIO CLEAR COMM FAIL 3010 Clear COM port SIO RESPONSE BAD 3011 The data received from the serial I O servet is incorrect SIO TRANSMISSION MODE ERROR 3012 Modbus transmission parameter error whild m0 ee MXSIO Connect SIO BAUDRATE NOT SUPPORT 3013 Baudrate is not Baudrate is not supported PRODUCT NOT SUPPORT 4001 The O module is not supported by thi r
99. r ioLogik E2000 R2000 AI2K_ReadMins This function code is used to read the minimize values of contiguous A I channels int 2 ReadMins int hConnection BYTE bytStartChannel BYTE bytCount double dValuel 1 Arguments hConnection The handle for an VO connection bytStartChannel Specifies the starting channel bytCount The number of channels to read dValue An array that stores the minimize values of contiguous A I channels dValue 0 represents the value of the starting channel The unit is VDC for the voltage module and mA for the current module Return Value 6 44 ioLogik MXIO DLL API Reference Direct I O Command Sets AI2K_ReadMinRaws This function code is used to read the minimize raw data values of contiguous A I channels int AT2K ReadMinRavis int hConnection BYTE bytStartChannel BYTE bytCount WORD wValue Arguments hConnection The handle for an I O connection bytStartChannel Specifies the starting channel bytCount The number of channels to read wValue An array that stores the minimize raw data values of the contiguous A I channels wValue 0 represents the value of the starting channel MXIO OK Refer to Return Codes AI2K ResetMins This function code is used to reset the minimize values of contiguous A I channels int AT2K ResetMins int hConnection BYTE biytStartChannel BYTE bytCount Arguments hConnection The handle for an VO connection Return Value
100. rd wStartRegister Specifies the starting register address The address is beginning at 0 wCount The number of coils to be read wRegister An array that stores the register values Return Value Succeed MXIO OK Fail Refer to Return Codes 5 2 ioLogik MXIO DLL API Reference Modbus Command Sets This function code is used to write the contents of a contiguous 1 block of the I O holding registers int MXIO_WriteRegs int hConnection WORD wStartRegister WORD vvCount WORD wRegister Arguments hConnection The handle for an I O connection wStartRegister Specifies the starting register address The address begins at 0 wCount The number of coils to be written wRegister An array that stores the register values Return Value Succeed MXIO OK Fail Refer to Return Codes 5 3 6 Direct I O Command Sets Direct I O command sets provide an intuitive way to access the data for each channel The following topics are covered in this chapter JU JV V V O LL Digital Input Commands Digital Input Commands for ioLogik E2000 R2000 Digital Input Output Mode Commands for ioLogik E2000 Counter Commands for ioLogik E2000 R2000 Digital Output Commands Digital Output Commands for ioLogik E2000 R2000 Digital Output Commands for ioLogik 4000 Pulse Output Commands for ioLogik E2000 R2000 Analog Input Commands Analog Input Commands for ioLogik E2000 R2000 Analog Output Commands Ana
101. rence Direct I O Command Sets DO_Writes Arguments Return Value This function code is used to write the output statuses of contiguous D O channels There may not contiguous channels if you use ioLogik E2212 DIO channels Please make sure they are contiguous channels or ILLEGAL DATA VALUE will be return int DO_Writes int BYTE hConnection bytSlot BYTE bytStartChannel BYTE bytCount DWORD dwValue The handle for an I O connection Slot number of the I O module from 1 to 32 This parameter is inactive for the ioLogik E2000 and R2000 bytStartChannel Specifies the starting channel hConnection bytSlot bytCount The number of channels to be written dwValue Stores the channel statuses of the contiguous D O channels each bit holds the status of one channel A bit value of 0 represents the digital output status of the start channel A bit value of 1 represents the second digital output channel s status The values of the unused bits are random MXIO_OK Refer to Return Codes DO_Write This function code is used to write the output status for a specific D O channel int DO_Write int BYTE hConnection bytSlot BYTE bytChannel BYTE bytValue The handle for an I O connection Slot number of the I O module from 1 to 32 This parameter is inactive for the ioLogik E2000 and R2000 The desired channel hConnection bytSlot Arguments bytChannel bytValue Stores the
102. rs Cnt2K Read Cnt2K Clear Cnt2K GetOverflows Cnt2K ClearOverflows Cnt2K GetOverflow Cnt2K ClearOverflow Cnt2K GetFilters Cnt2K SetFilters Cnt2K GetFilter Cnt2K SetFilter Cnt2K GetStartStatuses Cnt2K SetStartStatuses Cnt2K GetStartStatus Cnt2K SetsStartStatus Cnt2K_GetTriggerTypes Cnt2K_SetTriggerTypes Cnt2K_GetTriggerType Cnt2K_SetTriggerType Cnt2K GetPowerOnValues Cnt2K SetPowerOnValues Cnt2K GetPowerOnValue Cnt2K SetPowerOnValue Cnt2K GetSafeValues Cnt2K SetSafeValues Cnt2K GetSafeValue Cnt2K SetSafeValue Pulse2K GetSignalWidths Pulse2K_SetSignalWidths Pulse2K GetSignalWidth Pulse2K_SetSignalWidth Pulse2K GetOutputCounts Pulse2K SetOutputCounts Pulse2K GetOutputCount Pulse2K SetOutputCount Pulse2K GetStartStatuses Pulse2K SetStartStatuses Pulse2K GetStartStatus Pulse2K SetStartStatus Pulse2K GetPowerOnValu Pulse2K SetPowerOnValue Pulse2K GetPowerOnValu ei G 5 aaa RRS lt s lt lt lt lt lt lt lt lt lt lt lt lt si sisal salsa saa VE VEER EEE CEE CECE GIGI sla s a s sla s sla ala js ay Sislalala sl 4l as a rs sla ss ala 5 S S SIS Al Al a 4 lt s lt lt lt lt lt lt lt lt lt lt lt lt lt lt lt lt ass sa aaa VEE VEE lt a sal lt lt GENEID S Rel as a ala ls S K Sa S A a aa aa RR A HR N K
103. t 1 MXSIO_ Disconnect 2 v MXSIO Closecommport ioLogik MXIO DLL API Reference Programming Flow Connecting to the ioLogik E2000 and Attached RS 485 I O It is possible to combine Ethernet and RS 485 connections as shown in the following figure Ethernet Server 2 ioLogik E2000 ioLogik 4000 IP 192 168 8 1 ID 2 Port 502 Server 1 Server 3 ioLogik R2000 ID 3 Program Flow V Connecting to the ioLogik E2000 Ethernet I O and Attached RS 485 I O MXEIO Connect 1 v MXEIO Connect 2 MXEIO Connect 3 Direct I O Modbus Command Command Sets Sets v MXEIO Disconnect 2 MXEIO Disconnect 3 MXEIO Disconnect 1 2 6 ioLogik MXIO DLL API Reference Programming Flow Modbus Command Sets vs Direct O Command Sets The MXIO Library offers two options for accessing I O data from ioLogik 4000 E2000 and R2000 VO Modbus Command Sets ioLogik 4000 E2000 and R2000 I O use Modbus TCP and Modbus RTU to communicate with host computers The MXIO Library includes Modbus command sets that use the Modbus protocol data format to access I O data This is a good choice if you are already familiar with the Modbus protocol and prefer using the Modbus data structure Direct O Command Sets As an alternative to the complex data structure of Modbus the MXIO library also provides direct VO command sets for a more intuitive met
104. the filter values for the contiguous channels Return Value Succeed MXIO OK Fail Refer to Return Codes Cnt2K_GetFilter This function code is used to get the filter value of a specific D I channel in Counter mode int Cnt2K_GetFilter int hConnection BYTE bytChannel WORD vFilter Arguments hConnection The handle for an I O connection bytChannel The desired channel wFilter A pointer to the filter value Return Value Succeed MXIO OK Fail Refer to Return Codes Cnt2K_SetFilter This function code is used to set the filter value of a specific D I channel in Counter mode int Cnt2K_SetFilter int hConnection BYTE bytChannel WORD vFilter Arguments hConnection The handle for an I O connection bytChannel The desired channel wFilter Stores the filter value Return Value Succeed MXIO OK Fail Refer to Return Codes 6 9 ioLogik MXIO DLL API Reference Direct I O Command Sets Cnt2K_GetStartStatuses This function code is used to get the start statuses of contiguous channels in Counter mode int Cnt2K_GetStartStatuses int hConnection BYTE bytStartChannel BYTE bytCount DWORD dwStatus Arguments hConnection The handle for an I O connection bytStartChannel Specifies the starting channel bytCount The number of channels to read dwStatus A pointer to the start statuses of the contiguous D I channels each bit holds the start status of one channel A bit value of 0 represe
105. tion BYTE bytChannel WORD wHiWidth WORD wLoWidth Arguments hConnection The handle for an I O connection bytChannel The desired channel wHiWidth A pointer to the Hi signal width of the desired channel wLoWidth A pointer to the Lo signal width of the desired channel Return Value Succeed MXIO OK Fail Refer to Return Codes Pulse2K_GetSignalWidths32 This function code is used to get the contiguous pulse channel s Hi Lo signal width 32 bits The function code is designed for the ioLogik E2260 only int Pulse2K GetSignalVVidths32 int hConnection BYTE bytStartChannel BYTE bytCount DVVORD dwHiWidthl 1 DVVORD dwLoWidth 1 Declare Function Pulse2K GetSignalWidths32 Lib 1 4 ByVal hConnection As Long ByVal bytStartChannel As Byte ByVal bytCount As Byte iHiVVidth As Long iLoWidth As Long As Long Arguments hConnection The handle for an I O connection bytStartChannel Specifies the starting channel bytCount The number of channels to get dwHiWidth An array that stores the contiguous pulse channel s Hi signal width dwHiWidth 0 represents the Hi signal width of the starting channel dwLo Width An array that stores the contiguous plulse channel s Lo signal width dwLoWidth 0 represents the Lo signal width of the starting channel Succeed MXIO OK Fail Refer to Return Codes Return Value 6 31 ioLogik MXIO DLL API Reference Direct I O Command Sets Pulse2K_SetSign
106. turn Codes Cnt2K_SetSafeValues This function code is used to set the safe values of contiguous D I channels in Counter mode int Cnt2K_SetSafeValues int hConnection BYTE bytStartChannel BYTE bytCount DWORD dwValue Arguments hConnection The handle for an I O connection bytStartChannel Specifies the starting channel bytCount The number of channels to set dwValue Stored the safe values of the contiguous channels each bit holds the safe value of one channel A bit value of 0 represents the safe value of the start channel A bit value of 1 represents the second channel s safe value The values are 0 OFF 1 ON MXIO_OK Refer to Return Codes Return Value ioLogik MXIO DLL API Reference Direct I O Command Sets Cnt2K_GetSafeValue This function code is used to get the safe value of a specific D I channel in Counter mode int Cnt2K_GetSafeValue int hConnection BYTE bytChannel BYTE byt Value Arguments hConnection The handle for an I O connection bytChannel The desired channel bytValue A pointer to the safe value of the desired channel The values are 0 OFF Return Value int Cnt2K_SetSafeValue int hConnection BYTE bytChannel BYTE bytValue Arguments hConnection The handle for an I O connection bytChannel The desired channel bytValue Stored the safe value for the desired channel The values are 0 OFF 1 ON Return Value MXIO OK 6 17 ioLogik MXIO DLL API Refere
107. unt The number of channels to read wAction An array that stores the safe actions of contiguous D O channels The values are 0 Safe Value 1 Hold last state Return Value MXIO OK Refer to Return Codes 6 27 ioLogik MXIO DLL API Reference Direct I O Command Sets DO4K_SetSafeActions This function code is used to set the safe actions of contiguous D O channels int DO4K_SetSafeActions int hConnection Arguments hConnection bytStartChannel bytCount wAction Return Value BYTE bytSlot BYTE bytStartChannel BYTE bytCount WORD vvActionl The handle for an I O connection bytSlot Slot number of the I O module from 1 to 32 Specifies the starting channel The number of channels to set An array that stores the safe actions of contiguous D O channels The values are 0 Safe Value 1 Hold last state MXIO_OK Refer to Return Codes DO4K_GetSafeAction This function code is used to get the safe action for a specific D O channel int DO4K_GetSafeAction int Arguments hConnection bytChannel wAction Return Value 6 28 hConnection bytSlot BYTE bytChannel WORD wAction The handle for an I O connection bytSlot Slot number of the I O module from 1 to 32 The desired channel A pointer to the safe action for the desired D O channel The values are 0 Safe Value 1 Hold last state BYTE ioLogik MXIO DLL API Reference Direct I O Command Sets DO4K
108. ut channel in raw data format int AO2K_GetPowerOnRaw int hConnection BYTE bytChannel WORD wValue Arguments hConnection The handle for an I O connection bytChannel The desired channel wValue A pointer to the power on value for the desired channel in raw data format Return Value Succeed MXIO_OK Fail Refer to Return Codes 6 62 ioLogik MXIO DLL API Reference Direct I O Command Sets AO2K_SetPowerOnRaw _ This function code is used to set the power on value of a specific analog output channel in raw data format int AO2K SetPowerOnRav int hConnection BYTE bytChannel WORD wValue Arguments hConnection The handle for an I O connection bytChannel The desired channel wValue Stores the power on value for the desired channel in raw data format Return Value Succeed MXIO_OK Fail Refer to Return Codes Analog Output Commands for ioLogik 4000 AO4K_GetSafeActions This function code is used to get the safe actions of contiguous A O channels int AO4K_GetSafeActions int hConnection BYTE bytSlot BYTE _ bytStartChannel BYTE bytCount WORD vvActionl Arguments hConnection The handle for an I O connection bytSlot Slot number of the I O module from 1 to 32 bytStartChannel Specifies the starting channel bytCount The number of channels to read wAction An array that stores the safe actions of the contiguous A O channels wAction 0 represents the value of the starting channe
109. utput Commands for ioLogik E2000 R2000 AO2K_GetRanges This function code is used to get the ranges of contiguous A O channels int AO2K_GetRanges int hConnection BYTE bytStartChannel BYTE bytCount WORD wRange Arguments hConnection The handle for an I O connection bytStartChannel Specifies the starting channel bytCount The number of channels to read wRange An array that stores theranges of the contiguous A O channels wRange 0 represents the value of the starting channel The values are 0 0 10 VDC 1 4 20 mA Oxff disable Others return Illegal Data Value Return Value MXIO OK Refer to Return Codes 6 58 ioLogik MXIO DLL API Reference Direct I O Command Sets AO2K_SetRanges This function code is used to set the ranges of contiguous A O channels int AO2K_SetRanges int Arguments hConnection bytStartChannel bytCount wRange Return Value hConnection BYTE bytStartChannel BYTE bytCount WORD wRange 1 The handle for an I O connection Specifies the starting channel The number of channels to set An array that stores the ranges of the contiguous A O channels wRange 0 represents the value of the starting channel The values are 0 0 10 VDC 1 4 20 mA Others return Illegal Data Value MXIO OK Refer to Return Codes AO2K_GetRange This function code is used to get the range of a specific A O channel int AO2K_GetRange int Arguments hConnection

Download Pdf Manuals

image

Related Search

Related Contents

    SR780 User`s Manual - Stanford Research Systems  Test d`Aptitude Naturelle Cursinu à la Polyvalence (TANCP) MODE  Axis P1355-E    A l`intérieur - Swank Films Distribution  

Copyright © All rights reserved.
Failed to retrieve file