Author Topic: Nano-10 +r74 ModbusRTU  (Read 4887 times)

gnewcomer

  • Newbie
  • *
  • Posts: 2
  • I'm a llama!
    • View Profile
Nano-10 +r74 ModbusRTU
« on: October 21, 2011, 05:56:40 PM »
One night, READMODBUS works great, but lots of unrelated ethernet communication faults from laptop to Nano. Next morning upgraded JRE and i-TRiLOGI to V6.43 as recommended to work around some Java issues. Laptop to Nano via ethernet works great! Thanks!
Next download, not one sucessful READMODBUS since. Only one other node on RS-485 network, node 2 temp/humidity sensor, still works correctly as tested using Modbus Poll software. Tried replacing Nano RS-485 transciever chip (TI75HVD3082 from Digikey), no joy. Have 1 x 83ohm terminator; no biasing resistors. Entire network is ~ 3' long on my desk. Maybe I overloaded the transciever chip terminating with 83ohm instead of 120ohm. Extremely suspicious that modbus failure was concurrent with upgrade to v6.43.

I always get a fault from the WRITEMODBUS code shown below:

CusFn 1 "Initialize":


SETLCD 0,1, CHR$(1)

SETLCD 1,1, "PLC Restarted"

'Sets baud for channel 1, 19.2k, 8 data bits, 1 stop bit, even parity
SETBAUD 1, &H44

'SETSYSTEM 6, 3 'ModbusRTU

'Sets the protocol for channel 1, Modbus RTU = 1 (or 0 - Auto sensing)
SETPROTOCOL 1, 1

' Set HUM2 to display Degrees F
' ModbusRTU, Node 2, Register 121, Value = 1
WRITEMODBUS 11, 2, 121, 1
IF status(2) THEN
   SETLCD 2,1,"Node 2 Set to "+CHR$(223)+"F"
ELSE
   SETLCD 2,1,"NODE 2 Write Failed"
ENDIF


Thanks for any help.
GN

support

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3171
    • View Profile
    • Internet Programmable PLCs
Re:Nano-10 +r74 ModbusRTU
« Reply #1 on: October 22, 2011, 09:05:30 AM »
First of all to verify that your PLC's RS485 driver is working properly, try using the TLServer through U-485 adapter and test the communication with the PLC via TLServer using the "IR*" command. If it works, then use iTRiLOGI to connect to TLServer and perform online monitoring with the PLC. If you are able to do this then the RS485 transceiver is working properly and the issue is something else.

Note: Your program changes the comm port settings. In order not to have to change your program, you can start up the Nano-10 with Jumper J4 capped which force the PLC into a PAUSE mode and so none of the serial port command would take effect. You then can use the default baud rate (38400, 8, n, 1) between the TLServer and the Nano-10 to test the RS485 driver.

If the driver work then the next thing is to  troubleshoot the communications between the PLC and your Modbus RTU device. The easiest way is to download a serial monitoring software (there are a number of them on the web and some with free 30 days trial) and run on your PC, use your U-485 adapter to connect to the RS485 port. Now you are able to monitor the communication between the PLC and the serial device. You first need to see if the PLC is able to send out the MODBUS command as per your expectation using the expected baud rate.

Note: SETPROTOCOL only affects its SLAVE protocol behavior but not as a master. In fact if the RS485 port is dedicated to be a Modbus master then you may want to run the SETPROCOL 1,10 (no protocol) which ensure that the PLC does not treat any return data as potential incoming protocol. However, not using SETPROTOCOL 1, 10 should not affect its ability to run the READMODBUS or WRITEMODBUS command.
Email: support@triplc.com
Tel: 1-877-TRI-PLCS