LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Cut down execution time

So I need to take the execution time of the attached VI down Greatly.  it sits at about 10-15 seconds and i need it to be more like 500ms.  the issue seems to be with extracting the registers from the modbus return and then formatting them to look correct on the VI.  I Have some ideas on cutting this down but they have proved nominal at best.  I could really use some suggestions on this.  it me last major piece on this project.

 

thanks,

 

Mark R. 

0 Kudos
Message 1 of 9
(5,576 Views)

You haven't supplied all the SubVIs... But I have some suggestions:

  • I notice that the "MB Ethernet Master Query.vi" SubVI is re-used several times for each of your Drives.  If the VI isn't re-entrant then each call will block between drives.
  • It can take time to open a connection. It looks like this VI is part of a larger application - you are better off keeping the connection open up-front and only performing the reads when needed.
  • The register conversion logic won't be slowing you down; this will execute very quickly. It is more lilkely that the modbus reads are where time is being spent. But again, without the rest of the SubVIs it is hard to give any further guidance.
  • It is hard to tell without the SubVI but it looks like you are using a time-out of 10000 seconds for each modbus read. Are you sure one of your requests isn't timing out and adding 10s to your execution time?
0 Kudos
Message 2 of 9
(5,538 Views)
As far as the last bullet goes I am not getting any time outs, I was using the default 5000ms just wanted to add padding. Would rather use one Mb read command to start with but the registers are not sequential. You are probably right that the vi is not set to be re-entrant and is closing one instance before starting the next rather then running two parallel threads. I really think that I am missing the correct way to read the registrars that I need.
0 Kudos
Message 3 of 9
(5,511 Views)

Perhaps as an experiment try timing a single MB read from one of your register sets to get a feel for the time this is taking. If you break it apart you could also use the profiling tool to understand how long the SubVIs are taking to execute (although I think the profiling tools are only availale in Professional version of LabVIEW?)

0 Kudos
Message 4 of 9
(5,505 Views)

You really are reading very little data over ethernet modbus, I would expect it to be darned near instantaneous getting the data -- certainly within the 500ms. Where did you get the modbus drivers? They don't look familier. I would try the newest drivers from NI and see if there is any difference.

 

Mike...


Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
0 Kudos
Message 5 of 9
(5,489 Views)
They are the Ni modbus library. The problem with the DSC moduel is the my customer wont pay for 1000 dollar deployment fee. And all my other applications are reading similar data amount without the DSC and are instantaneous
0 Kudos
Message 6 of 9
(5,480 Views)

If you are referring to the older (non-OOP) NI Modbus library available online - I have used this previously and achieved the kind of performance that Mike is suggesting.

 

I suggest providing more of your source (eg. SubVIs) to let us give you better feedback.

0 Kudos
Message 7 of 9
(5,478 Views)
Yes I get really good results in my other applications just not this time I am starting to think its the drive is set to like a 10mbps network speed rather then 100mbps I was thinking along the line that my conversion logic needed to be stream lined
0 Kudos
Message 8 of 9
(5,453 Views)

Even 10Mbps is more than adequate for the performance you require. As an example - I have a system that polls a device on a 10Mbps network for almost two dozen registers 10 times a second, which includes all the conversion logic (the registers are converted to 32bit floats).

 

I suggest the issue likely lies in your SubVIs - if I was in your position that would be my next step.

0 Kudos
Message 9 of 9
(5,451 Views)