Moxa M-1601 Manual de Usario

Lee a continuación 📖 el manual en español para Moxa M-1601 (129 páginas) en la categoría No categorizado. Esta guía fue útil para 7 personas y fue valorada con 4.5 estrellas en promedio por 2 usuarios

Página 1/129
ioLogik MXIO DLL API Reference
Second Edition, June 2008
www.moxa.com/product
© 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 changes are incorporated into new editions of the manual.
Technical Support Contact Information
www.moxa.com/support
Moxa Americas:
Toll-free: 1-888-669-2872
Tel: +1-714-528-6777
Fax: +1-714-528-6778
Moxa China (Shanghai office):
Toll-free: 800-820-5036
Tel: +86-21-5258-9955
Fax: +86-10-6872-3958
Moxa Europe:
Tel: +49-89-3 70 03 99-0
Fax: +49-89-3 70 03 99-99
Moxa Asia-Pacific:
Tel: +886-2-8919-1230
Fax: +886-2-8919-1231
Table of Contents
Chapter 1. Overview ....................................................................................................1-1
What is the MXIO Linux Library? ....................................................................................... 1-2
Supported Platforms ............................................................................................................. 1-2
Supported I/O Modules ........................................................................................................ 1-2
Moxa Library Comparison ................................................................................................... 1-2
Chapter 2. Programming Flow....................................................................................2-1
Connecting to a Single Ethernet I/O..................................................................................... 2-2
Connecting to Multiple Ethernet I/O .................................................................................... 2-3
Connecting to a Single Serial I/O......................................................................................... 2-4
Connecting to Multiple RS-485 I/O ..................................................................................... 2-5
Connecting to the ioLogik E2000 and Attached RS-485 I/O................................................ 2-6
Modbus Command Sets vs. Direct I/O Command Sets........................................................ 2-7
Modbus Command Sets................................................................................................ 2-7
Direct I/O Command Sets............................................................................................. 2-7
Chapter 3. MXIO API Overview ...................................................................................3-1
System Command Sets......................................................................................................... 3-2
RS-485/RS-232 I/O Connect Commands ..................................................................... 3-2
Ethernet I/O Connect Commands................................................................................. 3-2
General Commands ...................................................................................................... 3-2
Special Commands for ioLogik E2000, R2000 ............................................................ 3-2
Special Commands for ioLogik 4000 ........................................................................... 3-2
Modbus Command Sets........................................................................................................ 3-3
Direct I/O Command Sets..................................................................................................... 3-3
Digital Input Commands............................................................................................... 3-3
Digital Input Commands for ioLogik E2000, R2000 ................................................... 3-3
Digital Input / Output Mode Commands for ioLogik E2000........................................ 3-3
Counter Commands for ioLogik E2000, R2000 ........................................................... 3-4
Digital Output Commands............................................................................................ 3-4
Digital Output Commands for ioLogik E2000, R2000................................................. 3-5
Digital Output Commands for ioLogik 4000................................................................ 3-5
Pulse Output Commands for ioLogik E2000, R2000 ................................................... 3-5
Analog Input Commands.............................................................................................. 3-6
Analog Input Commands for ioLogik E2000, R2000................................................... 3-6
Analog Output Commands ........................................................................................... 3-6
Analog Output Commands for ioLogik E2000, R2000 ................................................ 3-7
Analog Output Commands for ioLogik 4000 ............................................................... 3-7
RTD Commands ........................................................................................................... 3-7
Thermocouple Commands............................................................................................ 3-8
Click&Go Logic Commands................................................................................................ 3-8
Active I/O Message Commands ........................................................................................... 3-8
Chapter 4. System Command Sets ............................................................................4-1
RS-232/RS-485 I/O Connect Commands ............................................................................. 4-2
Ethernet I/O Connect Commands......................................................................................... 4-4
General Commands .............................................................................................................. 4-5
Special Commands for ioLogik E2000, R2000 .................................................................... 4-7
Special Commands for ioLogik 4000 ................................................................................... 4-7
Chapter 5. Modbus Command Sets ...........................................................................5-1
Chapter 6. Direct I/O Command Sets .........................................................................6-1
Digital Input Commands ...................................................................................................... 6-2
Digital Input Commands for ioLogik E2000, R2000 ........................................................... 6-3
Counter Commands for ioLogik E2000, R2000................................................................... 6-6
Digital Output Commands.................................................................................................. 6-18
Digital Output Commands for ioLogik E2000, R2000....................................................... 6-22
Digital Input/Output Commands for ioLogik E2000.......................................................... 6-25
Digital Output Commands for ioLogik 4000...................................................................... 6-27
Pulse Output Commands for ioLogik E2000, R2000 ......................................................... 6-29
Analog Input Commands.................................................................................................... 6-42
Analog Input Commands for ioLogik E2000, R2000......................................................... 6-44
Analog Output Commands ................................................................................................. 6-50
Analog Output Commands for ioLogik E2000, R2000 ...................................................... 6-58
Analog Output Commands for ioLogik 4000 ..................................................................... 6-63
RTD Commands ................................................................................................................. 6-65
Thermocouple Commands.................................................................................................. 6-84
Chapter 7. Click&Go Logic Commands .....................................................................7-1
Chapter 8. Active I/O Message Commands ...............................................................8-1
Chapter 9. Return Codes.............................................................................................9-1
Chapter 10. Product Model and ID Reference Table.................................................10-1
ioLogik 4000 ...................................................................................................................... 10-1
ioLogik E2000 and R2000.................................................................................................. 10-2
1
1
1
11
1
1
1
11
Chapter 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
1-2
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
I/O 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
z arm-elf-mxio-library-x.x.x.x.sh – for UC-7100-LX line
z mxsacleb-mxio-library-x.x.x.x.sh – for UC-7400-LX line
z mxio-library-x.x.x.x.sh – for x86
z arm-linux-mxio-library-x.x.x.x.sh - for IA-240-LX line
Supported I/O Modules
For a list of I/O modules that are supported by this library, please refer to Chapter 10, Product
Model and ID Reference Table.
ATTENTION
Click&Go logic and active I/O messaging are supported by the ioLogik E2000 line only.
Moxa Library Comparison
Function Windows PC-Linux 2.4
PC-Linux 2.6
UC-7110-LX
UC-7112-LX
UC-7408-LX
UC-7420-LX IA-240-LX
MXSIO_OpenCommport 3 3 3 3 3(COM) (ttyS0…) (ttyM0…) (ttyM0…) (ttyM0…)
MXSIO_CloseCommport 3 3 3 3 3
MXSIO_Connect 3 3 3 3 3
MXSIO_Disconnect 3 3 3 3 3
MXEIO_Init 3 - - - -
MXEIO_Exit 3 - - - -
MXEIO_Connect 3 3 3 3 3
MXEIO_Disconnect 3 3 3 3 3
MXEIO_CheckConnection 3 3 3 3 3
MXIO_GetDllVersion 3 3 3 3 3
MXIO_GetDllBuildDate 3 3 3 3 3
MXIO_GetModuleType 3 3 3 3 3
MXIO_ReadFirmwareRevi
sion
3 3 3 3 3
MXIO_ReadFirmwareDate 3 3 3 3 3
MXIO_Restart 3 3 3 3 3
MXIO_Reset 3 3 3 3 3
MXIO_ReadCoils 3 3 3 3 3
MXIO_WriteCoils 3 3 3 3 3
MXIO_ReadRegs 3 3 3 3 3
MXIO_WriteRegs 3 3 3 3 3
ioLogik MXIO DLL API Reference Overview
1-3
Function Windows PC-Linux 2.4
PC-Linux 2.6
UC-7110-LX
UC-7112-LX
UC-7408-LX
UC-7420-LX IA-240-LX
DI_Reads 3 3 3 3 3
DI_Read 3 3 3 3 3
DO_Reads 3 3 3 3 3
DO_Writes 3 3 3 3 3
DO_Read 3 3 3 3 3
DO_Write 3 3 3 3 3
DO_GetSafeValues 3 3 3 3 3
DO_SetSafeValues 3 3 3 3 3
DO_GetSafeValue 3 3 3 3 3
DO_SetSafeValue 3 3 3 3 3
AI_Reads 3 3 3 3 3
AI_Read 3 3 3 3 3
AI_ReadRaws 3 3 3 3 3
AI_ReadRaw 3 3 3 3 3
AO_Reads 3 3 3 3 3
AO_Writes 3 3 3 3 3
AO_Read 3 3 3 3 3
AO_Write 3 3 3 3 3
AO_ReadRaws 3 3 3 3 3
AO_WriteRaws 3 3 3 3 3
AO_ReadRaw 3 3 3 3 3
AO_WriteRaw 3 3 3 3 3
AO_GetSafeValues 3 3 3 3 3
AO_SetSafeValues 3 3 3 3 3
AO_GetSafeValue 3 3 3 3 3
AO_SetSafeValue 3 3 3 3 3
AO_GetSafeRaws 3 3 3 3 3
AO_SetSafeRaws 3 3 3 3 3
AO_GetSafeRaw 3 3 3 3 3
AO_SetSafeRaw 3 3 3 3 3
RTD_Reads 3 3 3 3 3
RTD_Read 3 3 3 3 3
RTD_ReadRaws 3 3 3 3 3
RTD_ReadRaw 3 3 3 3 3
RTD2K_ResetMin 3 3 3 3 3
RTD2K_ResetMins 3 3 3 3 3
RTD2K_ResetMax 3 3 3 3 3
RTD2K_ResetMaxs 3 3 3 3 3
RTD2K_ReadMinRaw 3 3 3 3 3
RTD2K_ReadMinRaws 3 3 3 3 3
RTD2K_ReadMaxRaw 3 3 3 3 3
RTD2K_ReadMaxRaws 3 3 3 3 3
RTD2K_ReadMin 3 3 3 3 3
RTD2K_ReadMins 3 3 3 3 3
RTD2K_ReadMax 3 3 3 3 3
ioLogik MXIO DLL API Reference Overview
1-4
Function Windows PC-Linux 2.4
PC-Linux 2.6
UC-7110-LX
UC-7112-LX
UC-7408-LX
UC-7420-LX IA-240-LX
RTD2K_ReadMaxs 3 3 3 3 3
RTD2K_GetStartStatus 3 3 3 3 3
RTD2K_SetStartStatus 3 3 3 3 3
RTD2K_GetStartStatuses 3 3 3 3 3
RTD2K_SetStartStatuses 3 3 3 3 3
RTD2K_GetSensorType 3 3 3 3 3
RTD2K_SetSensorType 3 3 3 3 3
RTD2K_GetSensorTypes 3 3 3 3 3
RTD2K_SetSensorTypes 3 3 3 3 3
RTD2K_GetEngUnit 3 3 3 3 3
RTD2K_SetEngUnit 3 3 3 3 3
RTD2K_GetEngUnits 3 3 3 3 3
RTD2K_SetEngUnits 3 3 3 3 3
RTD2K_GetMathPar 3 3 3 3 3
RTD2K_SetMathPar 3 3 3 3 3
RTD2K_GetMathPars 3 3 3 3 3
RTD2K_SetMathPars 3 3 3 3 3
TC_Reads 3 3 3 3 3
TC_Read 3 3 3 3 3
TC_ReadRaws 3 3 3 3 3
TC_ReadRaw 3 3 3 3 3
Module2K_GetSafeStatus 3 3 3 3 3
Module2K_ClearSafeStatus 3 3 3 3 3
Adp4K_ReadStatus 3 3 3 3 3
Adp4K_ClearStatus 3 3 3 3 3
Adp4K_ReadFirmwareRevi
sion
3 3 3 3 3
Adp4K_ReadFirmwareDate 3 3 3 3 3
DI2K_GetModes 3 3 3 3 3
DI2K_SetModes 3 3 3 3 3
DI2K_GetMode 3 3 3 3 3
DI2K_SetMode 3 3 3 3 3
DI2K_GetFilters 3 3 3 3 3
DI2K_SetFilters 3 3 3 3 3
DI2K_GetFilter 3 3 3 3 3
DI2K_SetFilter 3 3 3 3 3
DO2K_GetModes 3 3 3 3 3
DO2K_SetModes 3 3 3 3 3
DO2K_GetMode 3 3 3 3 3
DO2K_SetMode 3 3 3 3 3
DO2K_GetPowerOnValues 3 3 3 3 3
DO2K_SetPowerOnValues 3 3 3 3 3
DO2K_GetPowerOnValue 3 3 3 3 3
DO2K_SetPowerOnValue 3 3 3 3 3
Cnt2K_Reads 3 3 3 3 3
ioLogik MXIO DLL API Reference Overview
1-6
Function Windows PC-Linux 2.4
PC-Linux 2.6
UC-7110-LX
UC-7112-LX
UC-7408-LX
UC-7420-LX IA-240-LX
Pulse2K_SetPowerOnValue 3 3 3 3 3
Pulse2K_GetSafeValues 3 3 3 3 3
Pulse2K_SetSafeValues 3 3 3 3 3
Pulse2K_GetSafeValue 3 3 3 3 3
Pulse2K_SetSafeValue 3 3 3 3 3
AI2K_ReadMins 3 3 3 3 3
AI2K_ReadMinRaws 3 3 3 3 3
AI2K_ResetMins 3 3 3 3 3
AI2K_ReadMin 3 3 3 3 3
AI2K_ReadMinRaw 3 3 3 3 3
AI2K_ResetMin 3 3 3 3 3
AI2K_ReadMaxs 3 3 3 3 3
AI2K_ReadMaxRaws 3 3 3 3 3
AI2K_ResetMaxs 3 3 3 3 3
AI2K_ReadMax 3 3 3 3 3
AI2K_ReadMaxRaw 3 3 3 3 3
AI2K_ResetMax 3 3 3 3 3
AI2K_GetRanges 3 3 3 3 3
AI2K_SetRanges 3 3 3 3 3
AI2K_GetRange 3 3 3 3 3
AI2K_SetRange 3 3 3 3 3
AO2K_GetRanges 3 3 3 3 3
AO2K_SetRanges 3 3 3 3 3
AO2K_GetRange 3 3 3 3 3
AO2K_SetRange 3 3 3 3 3
AO2K_GetPowerOnValues 3 3 3 3 3
AO2K_SetPowerOnValues 3 3 3 3 3
AO2K_GetPowerOnValue 3 3 3 3 3
AO2K_SetPowerOnValue 3 3 3 3 3
AO2K_GetPowerOnRaws 3 3 3 3 3
AO2K_SetPowerOnRaws 3 3 3 3 3
AO2K_GetPowerOnRaw 3 3 3 3 3
AO2K_SetPowerOnRaw 3 3 3 3 3
DIO2K_GetIOMode 3 3 3 3 3
DIO2K_SetIOMode 3 3 3 3 3
DIO2K_GetIOModes 3 3 3 3 3
DIO2K_SetIOModes 3 3 3 3 3
Logic2K_GetStartStatus 3 3 3 3 3
Logic2K_SetStartStatus 3 3 3 3 3
Message2K_Start 3 3 3 3 3
Message2K_Stop 3 3 3 3 3
2
2
2
22
2
2
2
22
Chapter 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
¾ Modbus Command Sets
¾ Direct I/O Command Sets
ioLogik MXIO DLL API Reference Programming Flow
2-2
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.
ioLogik 4000 remote I/O
IP: 192.168.8.1
Port: 502
ioLogik E2000 Ethernet I/O
IP: 192.168.8.1
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 to release Windows system resources.
Program Flow I.
Connecting to a Single Ethernet I/O
MXEIO Connect
Direct I/O
Command Sets Modbus Command Sets
MXEIO Disconnect
ioLogik MXIO DLL API Reference Programming Flow
2-3
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.
ioLogik 4000 remote I/O
IP: 192.168.8.1
Port: 502
ioLogik E2000 Ethernet I/O
IP: 192.168.8.2
Port: 502
Each Ethernet I/O needs a unique handle in order to be accessed. Use MXEIO_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 I/O
Command Sets Modbus Command Sets
MXEIO Disconnect # 1
MXEIO Disconnect # 2
ioLogik MXIO DLL API Reference Programming Flow
2-4
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:
z Your computer must be equipped with an RS-232 or RS-485 communication port.
z Make sure that the baudrate and communication parameters for the computer and the I/O are
identical.
z Make sure that the I/O is running under Modbus/RTU
ioLogik 4000 remote I/O
ID: 10
ioLogik E2000 Ethernet I/O
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 I/O.
MXSIO_OpenCommport
MXSIO_Connect
Direct I/O
Command Sets Modbus Command Sets
MXSIO_ Disconnect
MXSIO_Closecommport
ioLogik MXIO DLL API Reference Programming Flow
2-5
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.
ioLogik 4000 remote I/O
ID: 01
ioLogik E2000 Ethernet I/O
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.
MXSIO_OpenCommport
MXSIO_Connect#1 MXSIO_Connect#2
Direct I/O
Command Sets Modbus Command Sets
MXSIO_ Disconnect #2
MXSIO_ Disconnect #1
MXSIO_Closecommport
ioLogik MXIO DLL API Reference Programming Flow
2-6
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.
Program Flow V.
Connecting to the ioLogik E2000 Ethernet I/O and Attached RS-485 I/O.
MXEIO Connect # 1
MXEIO Connect # 2 MXEIO Connect # 3
Modbus Command
Sets
Direct I/O
Command Sets
MXEIO Disconnect # 3MXEIO Disconnect # 2
MXEIO Disconnect # 1
ioLogik MXIO DLL API Reference MXIO API Overview
3-2
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 Commands
Function Name
MXEIO_Init
MXEIO_Exit
MXEIO_Connect
MXEIO_Disconnect
MXEIO_CheckConnection
General Commands
Function Name
MXIO_GetDllVersion
MXIO_GetDllBuildDate
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_ReadSlotAmount
Adp4K_ReadAlarmedSlot
Adp4K_ReadAlarmedSlot
ioLogik MXIO DLL API Reference MXIO API Overview
3-3
Modbus Command Sets
Function Name
MXIO_ReadCoils
MXIO_WriteCoils
MXIO_ReadRegs
MXIO_WriteRegs
Direct I/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_GetIOMode
DIO2K_SetIOMode
DIO2K_GetIOModes
DIO2K_SetIOModes
ioLogik MXIO DLL API Reference MXIO API Overview
3-4
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_GetPowerOnValues
Cnt2K_SetPowerOnValues
Cnt2K_GetPowerOnValue
Cnt2K_SetPowerOnValue
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
3-5
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
Pulse2K_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
3-6
Analog Input Commands
Function Name
AI_Reads
AI_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
AO_SetSafeValue
AO_GetSafeRaws
AO_SetSafeRaws
AO_GetSafeRaw
AO_SetSafeRaw
ioLogik MXIO DLL API Reference MXIO API Overview
3-7
Analog Output Commands for ioLogik E2000, R2000
Function Name
AO2K_GetRanges
AO2K_SetRanges
AO2K_GetRange
AO2K_SetRange
AO2K_GetPowerOnValues
AO2K_SetPowerOnValues
AO2K_GetPowerOnValue
AO2K_SetPowerOnValue
AO2K_GetPowerOnRaws
AO2K_SetPowerOnRaws
AO2K_GetPowerOnRaw
AO2K_SetPowerOnRaw
Analog Output Commands for ioLogik 4000
Function Name
AO4K_GetSafeActions
AO4K_SetSafeActions
AO4K_GetSafeAction
AO4K_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 MXIO DLL API Reference System Commands Sets
4-2
RS-232/RS-485 I/O Connect Commands
MXSIO_OpenCommport This function opens the local COM port of the host computer with
communication parameters.
C/C++
Arguments
Return Value
int MXSIO_OpenCommport ( char *szCommport,
DWORD dwBaudrate,
BYTE bytDataFormat,
DWORD dwTimeout,
int * hCommport);
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
0,
1)
= 0x00
=
bit_5
0x01
=
bit_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.
Succeed MXIO_OK.
Fail Refer to Return Codes.
MXSIO_CloseCommport This closes the COM port; the COM port handle will be invalid.
C/C++
Arguments
Return Value
int MXSIO_CloseCommport ( int hCommport);
hCommport: Handle of the opened COM port.
Succeed MXIO_OK.
Fail Refer to Return Codes.
ioLogik MXIO DLL API Reference System Commands Sets
4-3
MXSIO_Connect
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 I/O or up to 32 RS-485 I/O.
C/C++
Arguments
Return Value
int MXSIO_Connect ( int hCommport,
BYTE bytUnitID,
BYTE bytTransmissionMode,
int *hConnection);
hCommport: I/O 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
supports RTU.
hConnection: Handle of the I/O device connection.
Succeed MXIO_OK.
Fail Refer to Return Codes.
MXSIO_Disconnect This will disconnect the RS-485/232 I/O. The I/O handle will be
invalid.
C/C++
Arguments
Return Value
int MXSIO_Disconnect ( int hConnection);
hConnection: Handle of the I/O device connection.
Succeed MXIO_OK.
Fail Refer to Return Codes.
ioLogik MXIO DLL API Reference System Commands Sets
4-5
MXEIO_Disconnect This will close the connection with the Ethernet I/O; the handle
will be invalid.
C/C++
Arguments
Return Value
int MXEIO_Disconnect (int hConnection);
hConnection: Handle of the connection.
Succeed MXIO_OK.
Fail Refer to Return Codes.
MXEIO_CheckConnection
This establishes a connection to the port of the Ethernet I/O. Once
the connection is established, a handle will be returned for
additional functions.
C/C++
Arguments
Return Value
int MXEIO_CheckConnection( inth Connection,
DWORD dwTimeOut,
BYTE *bytStatus);
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.
Succeed MXIO_OK.
Fail Refer
t
o Re
t
u
r
n Codes.
General Commands
MXIO_GetDllVersion This will get the DLL version.
C/C++
Arguments
Return Value
int MXIO_GetDllVersion ();
None
Succeed The DLL version. Version 2.0.0.0 is
expressed as value 0x2000.
MXIO_GetDllBuildDate This will get the DLL release date.
C/C++
Arguments
Return Value
int MXIO_GetDllBuildDate();
None
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
4-6
MXIO_GetModuleType This function reports the model name of the network adapter and
I/O modules.
C/C++
Arguments
Return Value
int MXIO_GetModuleType ( int hConnection,
BYTE bytSlot,
WORD * wType);
hConnection: I/O handle for a connection.
bytSlot: Slot number of the I/O to be checked,
from 0 to 32. The ioLogik 4000
network adapters slot number is always 0.
This parameter is inactive for ioLogik
E2000 and R2000 I/O.
wType: 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.
Succeed MXIO_OK.
Fail Refer
t
o Re
t
u
r
n Codes.
MXIO_ReadFirmwareRev
ision
This function reports the firmware revision for the ioLogik 4000
(network adapter), E2000, or R2000.
C/C++
Arguments
Return Value
int MXIO_ReadFirmwareRevision ( int hConnection,
BYTE bytRevision[ ] );
hConnection: I/O handle for a connection.
bytRevision: Stores the firmware revision
bytRevision[0] = major (A)
bytRevision[1] = minor (B)
bytRevision[2] = release (C)
bytRevision[3] = build (D)
format is A.B.C.D
Succeed MXIO_OK.
Fail R
e
f
e
r
t
R
et
ur
n
C
ode
s
MXIO_ReadFirmwareDate This function reports the firmware release date for the ioLogik
4000 (network adapter), E2000, or R2000.
C/C++
Arguments
Return Value
int MXIO_ReadFirmwareDate ( int hConnection,
WORD wDate[ ] );
hConnection: I/O handle for a connection.
wDate: Firmware release date. For a firmware
release date of July 5, 2005, Word 0 =
0x0705 and Word 1 = 0x2005.
Succeed MXIO_OK.
Fail Refer to Return Codes.
ioLogik MXIO DLL API Reference Modbus Command Sets
5-3
MXIO_WriteRegs This function code is used to write the contents of a contiguous
block of the I/O holding registers.
C/C++
Arguments
Return Value
int MXIO_WriteRegs ( int hConnection,
WORD wStartRegister,
WORD wCount,
WORD wRegister[ ]);
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.
Succeed MXIO_OK.
Fail Refer to Return Codes.
ioLogik MXIO DLL API Reference Direct I/O Command Sets
6-2
Digital Input Commands
DI_Reads This function code is used to read the status of a group of
contiguous D/I channels.
C/C++
Arguments
Return Value
int DI_Reads ( int hConnection,
BYTE bytSlot,
BYTE bytStartChannel,
BYTE bytCount,
DWORD * dwValue);
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 D/I 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.
Succeed MXIO_OK.
Fail Refer
t
o Re
t
u
r
n Codes.
DI_Read This function code is used to read the status of a specific D/I
channel.
C/C++
Arguments
Return Value
int DI_Read ( int hConnection,
BYTE bytSlot,
BYTE bytChannel,
BYTE *bytValue);
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: A pointer to a specific D/I channel’s status.
Succeed MXIO_OK.
Fail Refer
t
o Re
t
u
r
n Codes.
ioLogik MXIO DLL API Reference Direct I/O Command Sets
6-9
Cnt2K_SetFilters This function code is used to set the filter values of contiguous D/I
channels in Counter mode.
C/C++
Arguments
Return Value
int Cnt2K_SetFilters ( int hConnection,
BYTE bytStartChannel,
BYTE bytCount,
WORD wFilter[ ]);
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 for the
contiguous D/I channels.
Succeed MXIO_OK.
Fail Refer
t
o Re
t
u
r
n Codes.
Cnt2K_GetFilter This function code is used to get the filter value of a specific D/I
channel in Counter mode.
C/C++
Arguments
Return Value
int Cnt2K_GetFilter ( int hConnection,
BYTE bytChannel,
WORD * wFilter);
hConnection: The handle for an I/O connection.
bytChannel: The desired channel.
wFilter: A pointer to the filter value.
Succeed MXIO_OK.
Fail Refer
t
o Re
t
u
r
n Codes.
Cnt2K_SetFilter This function code is used to set the filter value of a specific D/I
channel in Counter mode.
C/C++
Arguments
Return Value
int Cnt2K_SetFilter ( int hConnection,
BYTE bytChannel,
WORD wFilter);
hConnection: The handle for an I/O connection.
bytChannel: The desired channel.
wFilter: Stores the filter value.
Succeed MXIO_OK.
Fail Refer
t
o Re
t
u
r
n Codes.
ioLogik MXIO DLL API Reference Direct I/O Command Sets
6-11
Cnt2K_GetStartStatus This function code is used to get the start status of a specific D/I
channel in Counter mode.
C/C++
Arguments
Return Value
int Cnt2K_GetStartStatus ( int hConnection,
BYTE bytChannel,
BYTE * bytStatus);
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
Succeed MXIO_OK.
Fail Refer
t
o Re
t
u
r
n Codes.
Cnt2K_SetStartStatus This function code is used to set the start status of a specific D/I
channel in Counter mode.
C/C++
Arguments
Return Value
int Cnt2K_SetStartStatus ( int hConnection,
BYTE bytChannel,
BYTE bytStatus);
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
Succeed MXIO_OK.
Fail Refer
t
o Re
t
u
r
n Codes.

Especificaciones del producto

Marca: Moxa
Categoría: No categorizado
Modelo: M-1601

¿Necesitas ayuda?

Si necesitas ayuda con Moxa M-1601 haz una pregunta a continuación y otros usuarios te responderán




No categorizado Moxa Manuales

No categorizado Manuales

Últimos No categorizado Manuales