Author Topic: ModbusRTU & Unitronics help needed  (Read 2023 times)

Chad2017

  • Newbie
  • *
  • Posts: 8
    • View Profile
ModbusRTU & Unitronics help needed
« on: September 26, 2017, 09:00:54 AM »
Hi All, I'm a newbie.  I'm just trying to display a readout from Unitronics Jazz. I've set it up very simple and followed the ADVHmi quickstart but get nothing.
I have tested PLC to pc connection using CAS Modbus Scanner and as you can see by the screenshots the values are there- the one i want to display is Reg Address 40003.
Hoping someone can offer some help.
Cheers

Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5262
    • View Profile
    • AdvancedHMI
Re: ModbusRTU & Unitronics help needed
« Reply #1 on: September 26, 2017, 02:09:49 PM »
Do you have any other software online while trying to run AdvancedHMI? When using the serial port, AdvancedHMI needs exclusive access to the port, therefore no other software can be accessing the PLC.

Chad2017

  • Newbie
  • *
  • Posts: 8
    • View Profile
Re: ModbusRTU & Unitronics help needed
« Reply #2 on: September 26, 2017, 05:54:58 PM »
No I have nothing else using the port at the same time, and I make sure I always shut down CasModbus Scanner software.  I have also tried on another pc a brand new laptop which only has Advancedhmi and visualcommunity on it and still no success.

Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5262
    • View Profile
    • AdvancedHMI
Re: ModbusRTU & Unitronics help needed
« Reply #3 on: September 26, 2017, 06:30:02 PM »
Use a BasicLabel instead of the DigitalPanelMeter. It will give more feedback of problems.

Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5262
    • View Profile
    • AdvancedHMI
Re: ModbusRTU & Unitronics help needed
« Reply #4 on: September 26, 2017, 06:38:03 PM »
Also you can set the EnableLogging property to true. This will create a log file in the bin\Debug directory that will give some feedback on what is happening.

Chad2017

  • Newbie
  • *
  • Posts: 8
    • View Profile
Re: ModbusRTU & Unitronics help needed
« Reply #5 on: September 26, 2017, 07:16:09 PM »
Thanks I'll give those things a try.

Chad2017

  • Newbie
  • *
  • Posts: 8
    • View Profile
Re: ModbusRTU & Unitronics help needed
« Reply #6 on: September 27, 2017, 04:09:59 AM »
Ok i've now tried using a "basic label" instead and still no readout.. 
Have set EnableLogging to True and the following is the Log from the bin\debug directory after a couple of tests. I'm not sure myself what to make of it?
27/09/2017 4:01:47 PM Send 1,3,0,2,0,1,37,202,
27/09/2017 4:01:50 PM Send 1,3,0,2,0,1,37,202,
27/09/2017 4:02:10 PM Send 1,3,0,2,0,1,37,202,
27/09/2017 4:02:21 PM Send 1,3,0,2,0,1,37,202,
27/09/2017 4:02:50 PM Send 1,3,0,2,0,1,37,202,

UPDATE........... I just found this driver error log below,  i guess this is related to it not working but where do i start?

SendQueProcessor-Cannot access a disposed object.
Object name: 'ModbusRTU DLL is disposed'.
SendQueProcessor-Cannot access a disposed object.
Object name: 'ModbusRTU DLL is disposed'.

« Last Edit: September 27, 2017, 09:16:10 AM by Chad2017 »

Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5262
    • View Profile
    • AdvancedHMI
Re: ModbusRTU & Unitronics help needed
« Reply #7 on: September 27, 2017, 12:24:36 PM »
It seems that a response from your device is not being received. You may need to check the node address, baud rate, etc.

This is a breakdown of the packet being sent:

01 - Slave ID (Node address)
03 - Function code 3 (read holding register)
0002 - Register 2
0001 - Read 1 register

last 2 bytes are checksum

Chad2017

  • Newbie
  • *
  • Posts: 8
    • View Profile
Re: ModbusRTU & Unitronics help needed
« Reply #8 on: September 28, 2017, 07:29:48 AM »
Ok , so i've spent hours last night and today trying every combination of coms settings in the plc and pc and still with no luck.
I have also tried another identical model plc unit and still no luck.  CAS Modbus Scanner on the PC reads the values fine so wouldnt that mean my connection and plc coms settings are ok?



Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5262
    • View Profile
    • AdvancedHMI
Re: ModbusRTU & Unitronics help needed
« Reply #9 on: September 28, 2017, 03:12:26 PM »
Since you are not seeing any error on the BasicLabel, the only thing confirmed so far is that your serial port exists and opens without errors. It's showing behavior of not having a com setting correct, such as baud rate, data bits, stop bits, etc.

Use the patched version 3.99x and try to run your test again. This version will give more details in the log file.

https://sourceforge.net/projects/advancedhmi/files/advancedhmi/3.5



Chad2017

  • Newbie
  • *
  • Posts: 8
    • View Profile
Re: ModbusRTU & Unitronics help needed
« Reply #10 on: September 29, 2017, 10:43:11 PM »
Ok so still no luck after trying the patched version and various com settings as you can see below and no info showing up in the Basic Label.
09:57:51.354 Opening Port COM3 with 9600,8,0
09:57:51.415 Send 2,3,0,2,0,1,37,249,
10:01:35.078 Opening Port COM3 with 9600,7,2
10:01:35.138 Send 2,3,0,2,0,1,37,249,
10:01:47.037 Opening Port COM3 with 9600,7,2
10:01:47.094 Send 2,3,0,2,0,1,37,249,
10:02:23.672 Opening Port COM3 with 9600,7,1
10:02:23.728 Send 2,3,0,2,0,1,37,249,
10:02:34.778 Opening Port COM3 with 9600,8,1
10:02:34.846 Send 2,3,0,2,0,1,37,249,
10:02:53.445 Opening Port COM3 with 9600,8,0
10:02:53.503 Send 2,3,0,2,0,1,37,249,
10:06:11.811 Opening Port COM3 with 9600,8,2
10:06:11.868 Send 2,3,0,2,0,1,37,249,
10:07:18.643 Opening Port COM3 with 300,8,0
10:07:18.702 Send 2,3,0,2,0,1,37,249,
10:07:29.131 Opening Port COM3 with 600,8,0
10:07:29.188 Send 2,3,0,2,0,1,37,249,
10:07:40.215 Opening Port COM3 with 1200,8,0
10:07:40.271 Send 2,3,0,2,0,1,37,249,
10:07:51.570 Opening Port COM3 with 2400,8,0
10:07:51.630 Send 2,3,0,2,0,1,37,249,
10:08:04.251 Opening Port COM3 with 4800,8,0
10:08:04.307 Send 2,3,0,2,0,1,37,249,
10:08:54.652 Opening Port COM3 with 4800,8,2
10:08:54.709 Send 2,3,0,2,0,1,37,249,
10:09:32.505 Opening Port COM3 with 4800,8,1
10:09:32.560 Send 2,3,0,2,0,1,37,249,
10:12:07.392 Opening Port COM3 with 4800,8,1
10:12:07.447 Send 2,3,0,2,0,2,101,248,
10:13:17.416 Opening Port COM3 with 4800,8,1
10:13:17.472 Send 2,3,0,2,0,2,101,248,
10:14:36.123 Opening Port COM3 with 9600,8,0
10:14:36.179 Send 2,3,0,2,0,2,101,248,
10:14:55.415 Opening Port COM3 with 9600,8,0
10:14:55.478 Send 2,3,0,2,0,2,101,248,
10:15:07.408 Opening Port COM3 with 1200,8,0
10:15:07.466 Send 2,3,0,2,0,2,101,248,
10:15:17.847 Opening Port COM3 with 4800,8,0
10:15:17.903 Send 2,3,0,2,0,2,101,248,
10:15:33.891 Opening Port COM3 with 9600,7,2
10:15:33.949 Send 2,3,0,2,0,2,101,248,
10:15:43.840 Opening Port COM3 with 300,7,2
10:15:43.898 Send 2,3,0,2,0,2,101,248,
10:15:53.191 Opening Port COM3 with 600,7,2
10:15:53.248 Send 2,3,0,2,0,2,101,248,
10:16:01.466 Opening Port COM3 with 1200,7,2
10:16:01.525 Send 2,3,0,2,0,2,101,248,
10:16:10.454 Opening Port COM3 with 2400,7,2
10:16:10.513 Send 2,3,0,2,0,2,101,248,
10:16:19.701 Opening Port COM3 with 4800,7,2
10:16:19.758 Send 2,3,0,2,0,2,101,248,
10:16:28.861 Opening Port COM3 with 9600,7,2
10:16:28.923 Send 2,3,0,2,0,2,101,248,
10:17:20.219 Opening Port COM3 with 300,7,2
10:17:20.276 Send 0,3,0,2,0,2,100,26,
10:17:30.466 Opening Port COM3 with 300,7,2
10:17:30.522 Send 2,3,0,2,0,2,101,248,
10:17:41.201 Opening Port COM3 with 9600,7,2
10:17:41.260 Send 2,3,0,2,0,2,101,248,
What gets me is that I had this running fine after a few minutes setup on a windows 7 PC about 18months ago it was with an older version of Visual studio and obviously back then an older version of ADVHMI . I cant remember the versions though and no longer have that PC. I now only have windows 10 PC's.
Am still using the same PLC with the same rs232 to usb adapter.
Also want to thank you Archie for you help so far and quick responses.

Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5262
    • View Profile
    • AdvancedHMI
Re: ModbusRTU & Unitronics help needed
« Reply #11 on: September 29, 2017, 11:20:30 PM »
What about the slave ID? Are you sure it's 2?

Chad2017

  • Newbie
  • *
  • Posts: 8
    • View Profile
Re: ModbusRTU & Unitronics help needed
« Reply #12 on: September 30, 2017, 01:41:42 AM »
Yes, definitely 2 for slave id, and this is confirmed as set in the PLC and also works for CASmodbus scanner software.

Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5262
    • View Profile
    • AdvancedHMI
Re: ModbusRTU & Unitronics help needed
« Reply #13 on: September 30, 2017, 04:46:32 AM »
So let's get it to mimic exactly what your Mobus scanner is sending:

- Add a BasicLabel and set PLCAddressValue tp 40001
- Add a 2nd BasicLabel and set PLCAddressValue to 40010
- On MosBusRTU1, use these settings :
PortName : COM3
BaudRate : 9600
DataBits : 8
Parity : None
StopBits  :One
StationAddress : 2
EnableLogging : True

Delete the existing driver log file, the run that and post what you get in the new driver log file

Chad2017

  • Newbie
  • *
  • Posts: 8
    • View Profile
Re: ModbusRTU & Unitronics help needed
« Reply #14 on: September 30, 2017, 09:42:42 AM »
So let's get it to mimic exactly what your Mobus scanner is sending:

- Add a BasicLabel and set PLCAddressValue tp 40001
- Add a 2nd BasicLabel and set PLCAddressValue to 40010
- On MosBusRTU1, use these settings :
PortName : COM3
BaudRate : 9600
DataBits : 8
Parity : None
StopBits  :One
StationAddress : 2
EnableLogging : True

Delete the existing driver log file, the run that and post what you get in the new driver log file

OK done that and here is the new Log file for it-

09:38:39.817 Opening Port COM3 with 9600,8,0
09:38:39.874 Send 2,3,0,0,0,10,197,254,
09:38:42.816 Send 2,3,0,0,0,10,197,254,
09:38:45.815 Send 2,3,0,0,0,10,197,254,
09:38:48.816 Send 2,3,0,0,0,10,197,254,
09:38:51.817 Send 2,3,0,0,0,10,197,254,