I’m having problems with the Modbus write single register command when it goes through a Digi One IAP. Write multiple works, but every time I attempt a write single command the Digi replies with an exception 11.
Setup is a win2k PC running a Modbus master utility (the one at http://members.tripod.com/~mbserver/), talking Modbus/TCP to a Digi One IAP over Ethernet. The serial port of the Digi is configured as RS-232 running Modbus/RTU (9600-8E1) to a piece of embedded hardware acting as a Modbus slave. I’ve written the Modbus slave code on the embedded side.
If I take the Digi out of the loop and go Modbus/RTU over '232 to the embedded device, everything is fine. From the embedded side, I can’t see any difference in the Modbus/RTU datastream. For the write single 0=0 command, the embedded side receives 8 bytes:
01 06 00 00 00 00 89 CA
and replies with 8 bytes:
01 06 00 00 00 00 89 CA
I’ve turned on the trace (set trace state=on mask=ia:+info+debug), but it’s a little hard for me to read. (Is this stuff documented anywhere?) In particular, I’m not sure which lines show data on the TCP side and which show the serial side. Oh, the “CH01 seeing ECHO - check wiring” message seems important, too.
Any thoughts?
Here’s a trace with a write multiple command (0=0):
00:02:45 IA INFO: mbtcp:m02 Client Connecting!
00:02:45 IA INFO: mbtcp:m02 Rcv Req(5) Seq:0x0000 Len:11
00:02:45 IA INFO: mbtcp:m02 Slv:1 WrNReg:4x00001 Cnt=2
00:02:45 IA DEBG: 1 10 0 0 0 2 4 0 0 0 0
00:02:45 IA INFO: mbrtu:CH01 Snd Req:5
00:02:45 IA INFO: mbrtu:CH01 Slv:1 WrNReg:4x00001 Cnt=2
00:02:45 IA DEBG: 1 10 0 0 0 2 4 0 0 0 0
00:02:45 IA DEBG: f3 af
00:02:45 IA DEBG: MBRTU: Estimated Rsp length is 8
00:02:45 IA DEBG: mbrtu:CH01 wait more data
00:02:45 IA DEBG: mbrtu:CH01 wait more data
00:02:45 IA INFO: mbrtu:CH01 recv resp:5; completed in 80 msec
00:02:45 IA INFO: mbrtu:CH01 start of rsp min:48 avg:53 max:58 msec
00:02:45 IA INFO: mbrtu:CH01 complete rsp min:70 avg:81 max:91 msec
00:02:45 IA INFO: mbrtu:CH01 Slv:1 Write Complete
00:02:45 IA DEBG: 1 10 0 0 0 2
00:02:45 IA INFO: mbtcp:m02 Snd Rsp(5) Seq:0x0000 Len:6
00:02:45 IA INFO: mbtcp:m02 Slv:1 Write Complete
00:02:45 IA DEBG: 1 10 0 0 0 2
00:02:47 IA INFO: mbtcp:m02 idle timeout, closing connection
And a trace of a write single command that returns an exception 11 (0=0):
00:02:54 IA INFO: mbtcp:m02 Client Connecting!
00:02:54 IA INFO: mbtcp:m02 Rcv Req(6) Seq:0x0000 Len:6
00:02:54 IA INFO: mbtcp:m02 Slv:1 Wr1Reg:4x00001 = 0
00:02:54 IA DEBG: 1 6 0 0 0 0
00:02:54 IA INFO: mbrtu:CH01 Snd Req:6
00:02:54 IA INFO: mbrtu:CH01 Slv:1 Wr1Reg:4x00001 = 0
00:02:54 IA DEBG: 1 6 0 0 0 0
00:02:54 IA DEBG: 89 ca
00:02:54 IA DEBG: mbrtu:CH01 wait more data
00:02:54 IA DEBG: MBRTU: Estimated Rsp length is 8
00:02:54 IA DEBG: mbrtu:CH01 wait more data
00:02:54 IA INFO: mbrtu:CH01 seeing ECHO - check wiring
00:02:54 IA INFO: mbtcp:m02 Snd (6) is Exception Seq:0x0000 Len:6
00:02:54 IA INFO: mbtcp:m02 Slv:1 Err/Exception = No Response or Timeout
00:02:56 IA INFO: mbtcp:m02 idle timeout, closing connection
The firmware version is: Version 82000770_F 12/06/2005
Here’s the Digi One IAP config file:
[i]
Digi One IAP Version 82000770_F 12/06/2005
set config dhcp=off
set config myname=“” domain=“”
set config ip=192.168.0.68 submask=255.255.255.0
set config realport=771 securerealport=1027 sockets=2000 redirect=ignore tbreak=std
set config optimize=latency
set keys prevcmd=^P nextcmd=^N forwchar=^F backchar=^B
set config boothost=0.0.0.0 bootfile=“” tftpboot=no
set ethernet speed=auto duplex=half
set config rarp=on
set config ping-arp=on
set web timeout=300
set profile range=1 profile=ia
set profile range=2 profile=realport
set line range=1 parity=E csize=8 error=ignore
set line range=1 baud=9600 stopb=1 break=ignore inpck=off istrip=off onlcr=off otab=off
set flow range=1 ixon=off aixon=off ixoff=off ixany=off itoss=off altpin=off forcedcd=off
set flow range=1 dtr=off cts=off dcd=off dsr=off ri=off
set flow range=1 rts=off pre-delay=0 post-delay=0
set keys range=1 xon=^Q xoff=^S xona=^Q xoffa=^S lnext=^V
set line range=2 parity=N csize=8 error=ignore
set line range=2 baud=9600 stopb=1 break=ignore inpck=off istrip=off onlcr=off otab=off
set flow range=2 ixon=off aixon=off ixoff=off ixany=off itoss=off altpin=off forcedcd=off
set flow range=2 dtr=off cts=off dcd=off dsr=off ri=off
set flow range=2 rts=off pre-delay=0 post-delay=0
set keys range=2 xon=^Q xoff=^S xona=^Q xoffa=^S lnext=^V
set keys range=1 eof=^D erase=^H intr=^C kill=^U
set keys range=2 eof=^D erase=^H intr=^C kill=^U
set snmp run=on auth_trap=off login_trap=off
set snmp cold_start_trap=off link_up_trap=off
set snmp location=“” name=“” contact=“”
set device name=“gendialer” baud=no dialer=genmdm chat=no
set buffers range=1 size=32 state=off
set buffers range=2 size=32 state=off
set port range=1 dev=ia sess=4 termtype=“vt100” edelay=1 auto=off bin=off
set port range=1 uid=none group=none dport=none
set port range=1 dest=none
set port range=1 scriptname=none
set port range=1 keepalive=off flushstchar=default autoservice=default
set port range=1 idletime=0
set port range=2 dev=rp sess=4 termtype=“vt100” edelay=1 auto=off bin=off
set port range=2 uid=none group=none dport=none
set port range=2 dest=none
set port range=2 scriptname=none
set port range=2 keepalive=off flushstchar=default autoservice=default
set port range=2 idletime=0
set socketid range=1 state=off string=“SOCKETID”
set socketid range=2 state=off string=“SOCKETID”
set ia table=1 name=table1
set ia table=1 addroute=1 active=on protocol=modbusrtu
set ia table=1 route=1 protaddr=0-255 type=serial port=1
set ia master=1 active=on protocol=modbustcp transport=tcp ipport=502 table=1
set ia master=1 chartimeout=50ms messagetimeout=2500ms idletimeout=2sec
set ia master=1 permit=all priority=medium
set ia master=1 errorresponse=on broadcast=on fixedaddress=auto
set ia master=1 exttimeout=disabled
set ia serial=1 protocol=modbusrtu type=slave table=1
set ia serial=1 messagetimeout=2500ms slavetimeout=200ms chartimeout=20ms
set ia serial=1 lineturndelay=0ms
set ia serial=1 errorresponse=off broadcast=on fixedaddress=auto
set ia serial=1 rbx=off
set ia serial=1 exttimeout=disabled
set udpserial range=1 rmax=1024 rtime=100 closetime=0 overflow=forward strip=off
set udpserial range=1 delimiters=“”
set udpserial range=2 rmax=1024 rtime=100 closetime=0 overflow=forward strip=off
set udpserial range=2 delimiters=“”
set secureaccess ssh=on
set secureaccess ssh-keyauth=on
set secureaccess ssh-pwdauth=on
set secureaccess telnet=on
set secureaccess http=on
set secureaccess rlogin=on
set secureaccess rsh=on
set secureaccess realport=on
set secureaccess reversetcp=on
set secureaccess reversetelnet=on
set secureaccess snmp=on
set secureaccess securerealport=on
set secureaccess securesockets=on
set secureaccess https=on
set secureaccess lpd=on
set logport ra=1 state=off
set logport ra=1 mode=syslog
set logport ra=1 udpport=514
set logport ra=1 rmax=1024
set logport ra=1 rtime=100
set logport ra=1 pri=134
set logport ra=1 strip=off
set logport ra=1 delim=“”
set logport ra=2 state=off
set logport ra=2 mode=syslog
set logport ra=2 udpport=514
set logport ra=2 rmax=1024
set logport ra=2 rtime=100
set logport ra=2 pri=134
set logport ra=2 strip=off
set logport ra=2 delim=“”
[/i]