Author Topic: Errors in Advanced HMI  (Read 7317 times)

Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5323
    • View Profile
    • AdvancedHMI
Re: Errors in Advanced HMI
« Reply #15 on: May 17, 2018, 02:16:59 AM »
An unhandled exception of type 'System.ArgumentException' occurred in mscorlib.dll
Offset and length were out of bounds for the array or count is greater than the number of elements from index to the end of the source collection.

The program '[9504] AdvancedHMI.exe' has exited with code -1 (0xffffffff).


This was coming in my output window.
This sounds like the Modbus packet returned from the controller has too few bytes. The EnableLogging will give a clue to that.

Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5323
    • View Profile
    • AdvancedHMI
Re: Errors in Advanced HMI
« Reply #16 on: May 17, 2018, 02:30:35 AM »
In your application, set EnableLogging property of the Modbus driver to True.
Run the application until it stops again.
Post the DriverLog.txt file found in AdvancedHMI\bin\Debug

Manickam Sk

  • Newbie
  • *
  • Posts: 18
    • View Profile
Re: Errors in Advanced HMI
« Reply #17 on: May 17, 2018, 02:32:16 AM »
When I am running I had now noticed other error window now. I had attached the screen shot below.

The break window now is replaced by this window.

Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5323
    • View Profile
    • AdvancedHMI
Re: Errors in Advanced HMI
« Reply #18 on: May 17, 2018, 02:39:01 AM »
The DriverLog file may show me what the problem is.

Manickam Sk

  • Newbie
  • *
  • Posts: 18
    • View Profile
Re: Errors in Advanced HMI
« Reply #19 on: May 17, 2018, 02:41:29 AM »
Now I am getting the disassembly error.

source code missing what should I do to rectify this.

Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5323
    • View Profile
    • AdvancedHMI
Re: Errors in Advanced HMI
« Reply #20 on: May 17, 2018, 02:51:24 AM »
In your application, set EnableLogging property of the Modbus driver to True.
Run the application until it stops again.
Post the DriverLog.txt file found in AdvancedHMI\bin\Debug

Manickam Sk

  • Newbie
  • *
  • Posts: 18
    • View Profile
Re: Errors in Advanced HMI
« Reply #21 on: May 17, 2018, 02:55:08 AM »
FYI This is my driver log file.

Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5323
    • View Profile
    • AdvancedHMI
Re: Errors in Advanced HMI
« Reply #22 on: May 17, 2018, 03:04:24 AM »
Your PollRateOverride is over running the controller. Set PollRateOverride to 500 or higher.

Delete the DriverLog.txt, then run the application again and post the DriverLog

Manickam Sk

  • Newbie
  • *
  • Posts: 18
    • View Profile
Re: Errors in Advanced HMI
« Reply #23 on: May 17, 2018, 03:18:20 AM »
Yes , but whenever I changed my pollride more than 100 or to 500 My HMI is running but I cannot receive any data from my controller and I change that to 80 the response is immediate and it works properly.

FYI the driver log is attached below

Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5323
    • View Profile
    • AdvancedHMI
Re: Errors in Advanced HMI
« Reply #24 on: May 17, 2018, 03:24:11 AM »
It looks like you set the PollRateOverride to 3000.

There is something wrong with your device's Modbus response:

12:23:08.434 Send 17,3,0,0,0,21,134,149,
12:23:08.456 RCVD 17,6,0,0,0,0,33,0,1,0,32,0,32,0,33,0,32,0,36,0,0,1,215,0,125,0,125,0,125,0,120,0,30,0,2,0,0,0,0,0,1,0,10,0,7,0,22,

The received data byte 2 should be the function code of 3, not 6. The 3rd byte is the data size, but the response packet has a 0

See this for more information:

http://www.simplymodbus.ca/FC03.htm

Manickam Sk

  • Newbie
  • *
  • Posts: 18
    • View Profile
Re: Errors in Advanced HMI
« Reply #25 on: May 17, 2018, 03:36:57 AM »
Ok I will check with that, what should be the timeout value to maintain.

Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5323
    • View Profile
    • AdvancedHMI
Re: Errors in Advanced HMI
« Reply #26 on: May 17, 2018, 03:48:41 AM »
A typical PollrateOverride for RTU is at least 250. A Timeout of 3000 is normal.

Manickam Sk

  • Newbie
  • *
  • Posts: 18
    • View Profile
Re: Errors in Advanced HMI
« Reply #27 on: May 17, 2018, 05:18:40 AM »
Whenever I changed my pollrate value the data is not being displayed in my window but the driver log receives and sends the data.

And when I change my pollrate value the communication takes place but another error window appears as arithmetic operation stack overflow.

Please find me a solution to this problem.

I had attached my both driver log data and my error display.

Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5323
    • View Profile
    • AdvancedHMI
Re: Errors in Advanced HMI
« Reply #28 on: May 17, 2018, 08:26:26 AM »
The response packet is not correct:

02:42:20.282 Send 17,3,0,0,0,21,134,149,
02:42:20.304 RCVD 17,3,0,0,0,0,33,0,1,0,32,0,32,0,33,0,32,0,32,0,0,1,215,0,125,0,120,0,125,0,120,0,30,0,0,0,0,0,0,0,1,0,10,0,6,0,22,

The 3rd byte is supposed to tell the number of bytes in the packet. The driver uses that value to know when it receives the full packet. See the response description :

http://www.simplymodbus.ca/FC03.htm

DougLyons

  • Jr. Member
  • **
  • Posts: 68
    • View Profile
Errors in Advanced HMI
« Reply #29 on: May 17, 2018, 01:37:33 PM »
This is very probably a failure of the "USB to RS-232" converter. I recommend that you obtain a converter with the FTDI chip such as the CHIPI-X10 model and test this. These are readily available from www.newark.com for a reasonable price.