Comunicating with Unitronics Jazz using Serial RTU

277 views
Skip to first unread message

rallets

unread,
May 11, 2009, 6:16:15 PM5/11/09
to NModbus
Hi all!
I've a Unitronics Jazz Plc, that support modbus :) Using site examples
I'm get everytime "Time out" exception in

IModbusSerialMaster master = ModbusSerialMaster.CreateRtu(port);
master.ReadHoldingRegisters(slaveID, startAddress, numRegisters);

Serial port is successfull connected.

Is anyone successfull experience with this PLC?
In the (small) documentation it say that read coils is code 601 and
read registers is code 604 (I think it's internal modbus PDU request).
Is this standard or I must write a custom message?

Thank you,
Rallets

Scott Alexander

unread,
May 11, 2009, 6:29:35 PM5/11/09
to NModbus...@googlegroups.com
I'm not sure what your documentation says but the Function Code value
has to be a byte which has a max value of 255.

My guess is you probably have a setting on the comm port set
incorrectly - parity, baud rate, etc. Try enabling logging and see
where it's hanging up - http://www.nmodbus.com/Samples.aspx#Sample15

or you could try using the blueSCADA GUI to easily configure the
serial port parameters and see if you can read values -
http://www.bluescada.com/

Scott

rallets

unread,
May 12, 2009, 2:31:20 PM5/12/09
to NModbus
Hi, I've tried with blueScada but don't autodetect serial port params.
I've contacted vendor to support me.
When done I will post correct configuration so others users can take
Unitronics Jazz work fine.
Rallets

rallets

unread,
May 14, 2009, 10:30:17 AM5/14/09
to NModbus
Hi, another point.
From Modbus specifications
http://www.modbus.org/docs/Modbus_over_serial_line_V1_02.pdf
when parity = None, stop bits must be 2. In this site samples Serial
RTU parity = None, and stop bits = 1. Is this correct?
Best regards,
Rallets

rallets

unread,
May 14, 2009, 6:39:20 AM5/14/09
to NModbus
This is the error stack trace:

INFO Modbus.IO.ModbusSerialTransport Write - TX: 2, 3, 0, 0, 0, 10,
197, 254
WARN Modbus.IO.ModbusTransport UnicastMessage - TimeoutException, 0
retries remaining - System.TimeoutException: The operation has timed
out.
at System.IO.Ports.SerialStream.Read(Byte[] array, Int32 offset,
Int32 count, Int32 timeout)
at System.IO.Ports.SerialStream.Read(Byte[] array, Int32 offset,
Int32 count)
at System.IO.Ports.SerialPort.Read(Byte[] buffer, Int32 offset,
Int32 count)
at Modbus.IO.SerialPortAdapter.Read(Byte[] buffer, Int32 offset,
Int32 count)
at Modbus.IO.ModbusRtuTransport.Read(Int32 count)
at Modbus.IO.ModbusRtuTransport.ReadResponse[T]()
at Modbus.IO.ModbusTransport.UnicastMessage[T](IModbusMessage
message)

Rallets

rallets

unread,
May 14, 2009, 6:33:10 AM5/14/09
to NModbus
Hi, Unitronics support use this emulator: ModbusMAT
http://www.ataytugal.com/ModbusMAT.htm
that work fine.

It send this frame (slave 2, registers offset 1 (1 based), num
registers 10):
[02][03][00][00][00][0A][C5][FE]
2,3,0,0,0,10,197,254
using Serial Port COM1, 19200, 8, None, 1 timeout 1000

Using the same configuration (excluded timeout because of in Nmodbus
samples there's non reference to it) the send frame is the same but it
raise an "Time out error".

Can anyone help me?
Thank you,
Rallets

rallets

unread,
May 15, 2009, 9:44:39 PM5/15/09
to NModbus
Hi, I've understand where problem is (nearly). I think that frame was
sended to the plc and then I cannot read from it. This is wrong.
When transport write a frame it's not sure that plc received it!!! if
I unplug serial cable, error is the same: write ok (???), timeout on
read!
Is There a properties to set that able me to be safe that frame is
received from plc (or communication is possible)?
Thank you

Scott Alexander

unread,
May 18, 2009, 11:35:49 AM5/18/09
to NModbus...@googlegroups.com
Did you ever get this to work? One thing you might try is to increase
the ReadTimeout on the SerialPort instance. Does your device support
Serial ASCII? that would be wort a try to determine if it is an RTU
specific issue.

Aside from that I can test the ModbusMAT program against NModbus to
see what it is doing differently.

Thanks
Scott

rallets

unread,
May 18, 2009, 3:19:14 PM5/18/09
to NModbus
Hi, exactly now I've resolved!
With PLC module MJ20-RS4 run fine with defaults settings. With module
MJ20-PRG I must enable RTS or DTS and all running fine:
port.DtrEnable = true;
OR
port.RtsEnable = true;

I will contact blueScada and require the ability to configure this
params (maybe can help other people)

Thank you!
Rallets
Reply all
Reply to author
Forward
0 new messages