Author Topic: 3.89&3.90 Modbus TCP comm error-999  (Read 4349 times)

MrPike

  • Sr. Member
  • ****
  • Posts: 297
    • View Profile
3.89&3.90 Modbus TCP comm error-999
« on: December 09, 2014, 10:59:38 PM »
Hi Archie, I updated my working 3.87 project to 3.89 and then 3.90 but I cannot get any values over Modbus TCP with either.  I am using modscan and modsim to verify register data.  I attached a screen shot of the error code that flashes in and out rapidly.  I need to upgrade from 3.87 due to my previous post"Modbus TCP".  thank you.

Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5269
    • View Profile
    • AdvancedHMI
Re: 3.89&3.90 Modbus TCP comm error-999
« Reply #1 on: December 10, 2014, 02:33:34 AM »
In ModbusBase.vb, go to line 538 and change the code to this:

If Responses(TNSByte).Values.Count > ValueIndex Then
    If SubscriptionList(i).Address.BitNumber < 0 And Requests(TNSByte).BitNumber = SubscriptionList(i).Address.BitNumber Then
        f.Values.Add(Responses(TNSByte).Values(ValueIndex))
    ElseIf SubscriptionList(i).Address.BitNumber >= 0 AndAlso Requests(TNSByte).BitNumber < 0 Then
        '* Bit designated in address
        f.Values.Add(CStr(CBool((CInt(2 ^ SubscriptionList(i).Address.BitNumber) And CInt(Responses(TNSByte).Values(ValueIndex))) > 0)))
    ElseIf SubscriptionList(i).Address.Address = Requests(TNSByte).Address Then
        f.Values.Add(Responses(TNSByte).Values(ValueIndex))
    End If
End If
« Last Edit: December 10, 2014, 02:37:20 AM by Archie »

MrPike

  • Sr. Member
  • ****
  • Posts: 297
    • View Profile
Re: 3.89&3.90 Modbus TCP comm error-999
« Reply #2 on: December 10, 2014, 06:48:38 PM »
Hi Archie, I replaced the old code in V3.90 with this one and only a small change happened.  Still get the comm error-999 message but now it flashes between the actual value(set with modscan) and the commerror-999 message. Only difference was the comm error message was steady on before.  Thanks

Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5269
    • View Profile
    • AdvancedHMI
Re: 3.89&3.90 Modbus TCP comm error-999
« Reply #3 on: December 10, 2014, 07:04:59 PM »
I  made a few other changes and will get a new version posted by morning that should resolve this.

Try this to see if it is the problem I am thinking it is. Add a BasicLabel and set the PLCAddressValue to the integer of the bits you are using. For example, if you BasicIndicators are using 40001.0 and 40001.1, then put 40001 in your BasicLabel. If you are using multiple words for your bits, then just use the lowest address in the BasicLabel.

MrPike

  • Sr. Member
  • ****
  • Posts: 297
    • View Profile
Re: 3.89&3.90 Modbus TCP comm error-999
« Reply #4 on: December 10, 2014, 08:29:56 PM »
I added a basic label for INT 40504 and have a basiclabel 40504.5 set to PLCAddr visible.  What I find is the comm error occurs first for about 4-5 seconds in both labels then the value updates and begins to work as it should. 

Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5269
    • View Profile
    • AdvancedHMI
Re: 3.89&3.90 Modbus TCP comm error-999
« Reply #5 on: December 10, 2014, 08:45:08 PM »
I'll have a new version posted in a few hours that will fix this

Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5269
    • View Profile
    • AdvancedHMI
Re: 3.89&3.90 Modbus TCP comm error-999
« Reply #6 on: December 10, 2014, 11:32:05 PM »
Version 3.91 is now available. Try that one to see if it resolves the issues.

MrPike

  • Sr. Member
  • ****
  • Posts: 297
    • View Profile
Re: 3.89&3.90 Modbus TCP comm error-999
« Reply #7 on: December 11, 2014, 09:10:29 PM »
Hi Archie.  I ran v3.91 and the value reads seem to work fine but the write feature does not work.  I have two buttons that write to registers and they do nothing when pressed.

Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5269
    • View Profile
    • AdvancedHMI
Re: 3.89&3.90 Modbus TCP comm error-999
« Reply #8 on: December 11, 2014, 09:40:37 PM »
I posted version 3.92 that addresses a couple more issues.

MrPike

  • Sr. Member
  • ****
  • Posts: 297
    • View Profile
Re: 3.89&3.90 Modbus TCP comm error-999
« Reply #9 on: December 12, 2014, 12:37:39 AM »
Hi Archie, I loaded v3.92 and ran my project.  The comm error-999 occurs just initially then seems to not return.  I found that the read and writes work now, however I am having two issues.  I will do my best to describe below.

1)  The project runs for about 2 minutes and then I get an exception message that I attached.  The image "exception before ok" screenshot is prior to pressing "ok" button.  I reverted back to 3.87 and this version seems to be stable in this aspect and I do not see any exceptions.

2)  I am still having the issues that I posted in "Modbus TCP".  This is where I have two different controllers connected in different configurations.  Here is a paste of that post to describe my configuration.  I get a comm error-21(no response from PLC 21). To add to the info below. The controller that works is IP 172.16.0.3 Id1 and the ones that dont work are both IP 172.16.0.2 Id1 and Id2.

"I am using AHMI3.87 to communicate to two seperate controllers via modbus TCP. One controller I am communicating just fine, it is connected via 2wire serial to a serial-ethernet(multinet FE) converter at 9600bps. The other is connected via 4 wire serial-ethernet(lantronics) converter at 19.2kbps.  The later one will not communicate with AHMI and gives me a msg box that reads "No response from PLC(21)" and the basic label values display "CommFail--20".  I am able to use Modscan32 without any issues and can read data just fine.  I went ahead and used modsim and AHMI communicates just fine with it. I did previously communicate to the later when I was connected via 2 wire but had too many comm fail messages that I converted back thinking the lantronics converter preferred a 4 wire config.  Is the serial configuration an issue, does AHMI care? Thanks"   

Sorry for the poor images, its hard to post quality pics with a 192k limit attachment of the forum.  Thanks for the help.

Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5269
    • View Profile
    • AdvancedHMI
Re: 3.89&3.90 Modbus TCP comm error-999
« Reply #10 on: December 12, 2014, 09:09:08 AM »
Version 3.93 now available.

I have not been able to replicate the second problem, but I do not have the same setup. The closest I can do is to run to simulators and out them on different ports. That setup works fine with version 3.93

MrPike

  • Sr. Member
  • ****
  • Posts: 297
    • View Profile
Re: 3.89&3.90 Modbus TCP comm error-999
« Reply #11 on: December 13, 2014, 02:47:50 PM »
Hey Archie, I did some testing today with 3.93.  The 999 error seems to be gone. Thanks

On to the second issue.  Let me try to give you the setup:

PAGE 1 has device 1=modbusTCP1, 172.16.0.3, port 502, id1--works fine everytime

PAGE 2 has device2=modbusTCP1,172.16.0.2,port 502, id1--comm error 21 no data from plc(21)

PAGE 2 has device3=modbusTCP2,172.16.0.2,port 502 id2--comm error 21 no data from plc(21)


I tried a bunch of different configurations for device 2 and 3 that doesnt work.  I tried a 2 and 4 wire config with both 9600 and 19.2k baud and neither one worked.  I verified comms was good with each config using modscan32.  i reverted back to my original project built with 3.70 and found that it works fine with all devices.  i did verifiy what you tested using different ports using modsim but i have not been able to do this with real contollers. Is there a chance that using the same port(502) for all devices is causing the second device to not establish comms?  To add a bit more complexity i added device 2 and 3 to 172.16.0.3 along with device 1 but the values returned are all wrong for devices 2 and 3 while device 1 was fine.  Im stalled here and I dont know how to move forward to get comms from my devices.  Thanks for the help.   

 

Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5269
    • View Profile
    • AdvancedHMI
Re: 3.89&3.90 Modbus TCP comm error-999
« Reply #12 on: December 13, 2014, 09:52:30 PM »
When I get back to my office on Tuesday, I can partially test this. I have a PLC that supports ModbusTCP and I can also run another computer with a Modbus simulator.

MrPike

  • Sr. Member
  • ****
  • Posts: 297
    • View Profile
Re: 3.89&3.90 Modbus TCP comm error-999
« Reply #13 on: December 13, 2014, 11:57:53 PM »
OK great.  I did some more testing and found a reason for the second item that displays incorrect data when I connect all devices to the 172.16.0.3 Ip address.  If you look at the screenshot "ID error" you will see the driver settings in the upper right corner set to ID 245.  There is in fact only one device that is ID 1.  You can see modscan reading data in the bottom right which is set to ID 1.  Modscan data matches the data seen by the BasicLabels on the left.  I does not matter what ID I use, i get the same data returned.  So it looks like the AdvHMI modbus driver is not using the device ID to distinguish devices. 

The next screenshot "comm error" is IP address set to 172.16.0.2 ID 1.  This is the device that will not communicate with AdvHMI.  Looking in the bottom right corner you will see modscan32 that is polling data just fine from this device.

I am willing to send you any documentation that I have if its needed, just let me know.  Thank you again!   

MrPike

  • Sr. Member
  • ****
  • Posts: 297
    • View Profile
Re: 3.89&3.90 Modbus TCP comm error-999
« Reply #14 on: December 14, 2014, 12:00:07 AM »
Sorry had to post the screenshots seperate because the forum limits their size.