Moxa IA3341-LX [68/72] Modbus

Moxa IA3341-LX [68/72] Modbus
IA3341 Linux User’s Manual Programmer’s Guide
6-13
break;
case DIO_ERROR_CONTROL:
printf(“DIO error control\n”);
break;
case DIO_ERROR_DURATION:
printf(“DIO error duratoin\n”);
case DIO_ERROR_DURATION_20MS:
printf(“DIO error! The duratoin is not a multiple of 20 ms\n”);
break;
}
}
return 0;
}
DIO Program Make File Example
FNAME=tdio
CC=arm-linux-gcc
STRIP=arm-linux-strip
release:
$(CC) -o $(FNAME) $(FNAME).c -lmoxalib -lpthread
$(STRIP) -s $(FNAME)
debug:
$(CC) -DDEBUG -o $(FNAME)-dbg $(FNAME).cxx -lmoxalib -lpthread
clean:
/bin/rm -f $(FNAME) $(FNAME)-dbg *.o
Modbus
The IA3341-LX provides two AI (Analog Input) channels and two TC (Thermocouple Input)
channels. The AI channels support voltage and current modes. The TC channels support J, K, T, E,
R, S, B and N sensor types. The AI and TC channels are accessible through MODBUS TCP
protocol or supported MODBUS TCP client API functions. A built-in MODBUS TCP gateway
server in the IA3341-LX provides MODBUS TCP protocol service for AI/TC channels.
Getting Started
The MODBUS TCP gateway server is started when the IA3341-LX boots up. Once the server is
ready, MODBUS TCP clients can communicate with it to access AI/TC channels using supported
MODBUS TCP address mappings listed in the following section. The gateway server listens on
TCP port 502.
MODBUS TCP Address Mapping
The following addresses of Input Registers and Holding Registers for MODBUS TCP are defined
for AI/TC channels. AI/TC channel parameters are defined in Holding Registers and can be read
and written. AI/TC channel data are defined in Input Registers and are read only. Each channel can
be set to on or off and the former is the default value. The default value is the value used each time
the IA3341-LX is cold booted. An AI value in C/C++ float data type is defined at two continuous
MODBUS TCP addresses. The first address defines the high word of the AI value and the second
defines the low word of the AI value. The data unit of an AI value depends on its corresponding

Содержание

Похожие устройства

Скачать