Author Topic: v3.97d EthernetIPforCLXCom_MainForm.Read performance  (Read 1988 times)

scott.clark

  • Jr. Member
  • **
  • Posts: 96
    • View Profile
v3.97d EthernetIPforCLXCom_MainForm.Read performance
« on: January 23, 2015, 05:21:59 PM »
I just updated an application from v3.97 to v3.97d

I was very pleased to see on my delvelopement computer that the read time for 35 tags went from 750ms down to 250ms using 35 consecutive EthernetIPforCLXCom_MainForm.Read("TAGName") statements.

I am wondering the source of the performance improvement?

However, when running the same on the target machine control PC, the read performance went from 1100ms to 900ms.  First of all the target machine is slower to begin with but also the performance gain was not as much.

Any suggestions on improving the performance on the target machine?

Development machine:  i7-2760 CPU  2.4GHZ, 8GB Ram, 64Bit, Windows7 PRO
Target Machine:  i7-3517UE CPU  1.7GHZ, 4GB Ram, 64Bit, Windows7 PRO




 

Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5322
    • View Profile
    • AdvancedHMI
Re: v3.97d EthernetIPforCLXCom_MainForm.Read performance
« Reply #1 on: January 23, 2015, 06:03:54 PM »
When looking at communication response time, you have to consider 2 distinct event:

- How fast the software prepares, sends requests, and processes responses
- How fast the PLC and network can turn around a request for a response

A very easy way to see how much time each event takes is to start WireShark, then run this very simple program in the form load event:

EthernetIPforCLXCom1.BeginRead("MyTag1")
EthernetIPforCLXCom1.BeginRead("MyTag2")
EthernetIPforCLXCom1.BeginRead("MyTag3")
.
.
.
EthernetIPforCLXCom1.BeginRead("MyTag10")


The BeginRead does not wait for a response, It will queue up all 10 requests and send them as fast as the PLC responds.

If you examine the Wireshark capture after running that test program, you can see the Network/PLC time by looking at the time stamp between a request and response. Then the time difference between a response and the next request is how fast AdvancedHMI sent the next request.

If you are reading a lot of data in code, it is better to use BeginRead and then process the response in a DataReceived event handler.

astroman

  • Newbie
  • *
  • Posts: 21
    • View Profile
Re: v3.97d EthernetIPforCLXCom_MainForm.Read performance
« Reply #2 on: January 26, 2015, 09:30:05 AM »
Hi Archie. Would you mind showing an example of how to use BeginRead with multiple components in conjunction with DataReceived? I understand that Read may be replaced with BeginRead (e.g. EthernetIPforPLCSLCMicroCom1.Read vs. EthernetIPforPLCSLCMicroCom1.BeginRead), but how would I process the data in a DataReceived event? Thank you very much for any clarification.

EDIT: Sorry Archie, I've found your example in this thread - http://advancedhmi.com/forum/index.php?topic=581.msg2598#msg2598

Thank you again.
« Last Edit: January 26, 2015, 09:45:32 AM by astroman »

Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5322
    • View Profile
    • AdvancedHMI
Re: v3.97d EthernetIPforCLXCom_MainForm.Read performance
« Reply #3 on: January 26, 2015, 01:20:51 PM »
I am modifying the ControlLogix driver for the next release that will allow you to double click the driver on the form and it will create the DataReceived event handler for you.