Author Topic: ModbusTCP - More than 9 DataSets?  (Read 2135 times)

TSLJon

  • Newbie
  • *
  • Posts: 24
    • View Profile
ModbusTCP - More than 9 DataSets?
« on: September 10, 2013, 05:44:52 AM »
Me again!

Been making great progress with this, really pleased. I got around the last error by using multiple DNS names and it works perfectly.

However when I try to add a tenth dataset for ModbusTCP I get the error below? I'm unsure how to allow the Index to build into double numbers (I.E. 10 and above). I assume it is around Line 249 but slightly unsure on this....

Any pointers appreciated.

Occasionally when I close the form in testing mode I get the error as attached below too. Is this part of the same thing?

Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5268
    • View Profile
    • AdvancedHMI
Re: ModbusTCP - More than 9 DataSets?
« Reply #1 on: September 10, 2013, 08:19:48 AM »
To get more than 10 connections, you will have to make 2 changes to ModbusTCPCom.vb

Near the top of the code, change the array size to a higher number than 10:

    '* Use a shared Data Link Layer so multiple instances will not create multiple connections
    Private Shared DLL(10) As MfgControl.AdvancedHMI.Drivers.ModbusTCP.ModbusTcpDataLinkLayer
    Private MyDLLInstance As Integer


In the CreateDLLInstance subroutine, change the i<11 to the value you used above +1

While DLL(i) IsNot Nothing AndAlso DLL(i).IPAddress <> m_IPAddress AndAlso DLL(i).TcpipPort <> m_TcpipPort AndAlso i < 11


TSLJon

  • Newbie
  • *
  • Posts: 24
    • View Profile
Re: ModbusTCP - More than 9 DataSets?
« Reply #2 on: September 10, 2013, 08:35:34 AM »
Archie - Excellent thank you. Done and working an absolute treat.

I've brought all your packs online, will happily buy more as you do them i'm very impressed with this and the excellent support. If I can contribute to the project further do let me know.

A question aside, when using the BarLevel I am reading Volts and receive it from the PLC in 273 for arguments sake. It needs to be 27.3. I've tried to adjust the ValueScaleFactor from 1 to 0.1 but it doesn't change it. This works fine in the Label module or have I interepted the BarLevel wrong?

Thank you.

Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5268
    • View Profile
    • AdvancedHMI
Re: ModbusTCP - More than 9 DataSets?
« Reply #3 on: September 10, 2013, 08:50:44 AM »
That one is definitely a problem in the underlying BarLevel control. Here is a patched file that should fix it:

http://www.advancedhmi.com/MfgControl.AdvancedHMI.ControlsPatch358.zip

Unzip this file and replace the one in the AdvancedHMI\support directory

TSLJon

  • Newbie
  • *
  • Posts: 24
    • View Profile
Re: ModbusTCP - More than 9 DataSets?
« Reply #4 on: September 10, 2013, 09:44:01 AM »
Perfect works fine thank you Archie.

Is there is time limit on the connections on ModbusTCP? If I leave it running I eventually get ComFail - 20 errors. I reload and it is fine? If it gets an error does it auto reset or not?

Sorry for all the questions...

Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5268
    • View Profile
    • AdvancedHMI
Re: ModbusTCP - More than 9 DataSets?
« Reply #5 on: September 10, 2013, 10:30:15 AM »
The -20 usually means a packet request did not get a response. There is no time limit on anything. I'll need to do some extensive testing on the driver, it definitely sounds like there are a few issues to iron out. I can do some limited testing tonight with a single connection, but won't be back to the office until Monday to do more extensive testing.

By the way, thank you for purchasing the components. Those purchases keep development on the project moving forward.

TSLJon

  • Newbie
  • *
  • Posts: 24
    • View Profile
Re: ModbusTCP - More than 9 DataSets?
« Reply #6 on: September 10, 2013, 11:55:09 AM »
I am polling ModbusTCP directly over the internet so it is likely of a poor connection then. I will put some QOS on the routers to prioritise the packets.

Very minor, it's pretty impressive so far Archie!

No problem, any more you produce I will be getting them for sure. Firm believer of supporting things, especially like this.