LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Best way to troubleshoot slow VI.

Solved!
Go to solution
I have a VI that is displaying data from a PLC.  I am using an OPC server, set to update every 50ms.  My VI updates the indicators on the screen every 11-15 seconds.  I have event structures, but they are all timing out at 50ms, and there are no wait functions in my loop (I had decided to let the timouts of the event structures be my minimum).  I was wondering what the best way to see where my bottleneck in the VI is.
0 Kudos
Message 1 of 27
(5,246 Views)
Any chance you could post your code?  How many event structures do you have? (That could be the problem)  You probably only need one.
-Matt Bradley

************ kudos always appreciated, but only when deserved **************************




0 Kudos
Message 2 of 27
(5,240 Views)
I have around twenty.  What is the best way to post code?  It's quite large and pretty messy, I doubt you want to see it.
0 Kudos
Message 3 of 27
(5,237 Views)
Ok, it appears to be my opc server that is actually refreshing that slow.  I guess I need to post this in the dsc area.
0 Kudos
Message 4 of 27
(5,230 Views)
I guess there isn't a specific DSC area, and when I search for slow OPC server, my thread is top post.  Uh oh.
0 Kudos
Message 5 of 27
(5,227 Views)
Even if you have a slow OPC server, I don't see why you would need 20 Event structures.  An Event structure can handle more than one event.  As for posting your code, there is an "Add Attachments" link when you post a message (near the bottom, under the Tags box).
-Matt Bradley

************ kudos always appreciated, but only when deserved **************************




0 Kudos
Message 6 of 27
(5,216 Views)

I dont think there will every be a point in time when you will need 20 event structures!

You can just right click on one, and keep adding events, so you arent using up all the computers resources polling for events.

Cory K
0 Kudos
Message 7 of 27
(5,201 Views)
Here is my multi event VI, if the upload works.  I have created an HMI that needs to read and write from a PLC so as not to interfere with the existing HMI.  The event structures first read the data in the PLC and write a new value only when it has been changed by a control object in LabVIEW.  I could have twenty events within a structure, but it would have so many wires coming out of it (the addresses to my shared variables) it would be just as ugly.
0 Kudos
Message 8 of 27
(5,198 Views)

Oh no!! all of my computer's resources are used up polling for events!!!

 

 

Capture.JPG

0 Kudos
Message 9 of 27
(5,194 Views)

Thanks for the sarcasm, but before you make comments, try running the code with only 1 event structure.

Some programmers try to make code efficient as well as functional

Message Edited by Cory K on 08-11-2009 05:54 PM
Cory K
0 Kudos
Message 10 of 27
(5,192 Views)