LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Problems with graphing, as well as Circular Buffer

Solved!
Go to solution

Hi,

 

I am having several problems with my graph. Basically whenever I move the front panel around or shake it, the data does not seem to be logged and it screws up the graph.

 

Secondly, whenever my buffer fills up, 50% of the time, there is this line that appears from the end of the graph to the beginning for a split second. I dont understand why it would only happen sometimes though, because many times the buffer fills up but this does not happen.

 

 

If anyone had this problem before and knows a good way to fix it, it would be appreciated. I tried doing defer and undefer front panel updates but this did not help my graph. My CPU usage is pretty high as well. 

Message 1 of 12
(4,146 Views)

Okay so my application acquires data from a NI DAQ device as well as a Galil Motion Control card.

 

What I've noticed is that moving the front panel around does not affect data acquired from NI DAQ, but it does for the Galil. It might be because in the loop where I acquire data from the galil card, I am sending commands to get that data, and when im moving the front panel around, it is somehow interfering with sending commands to the galil card thus distorting my values. 

 

Don't really know how to fix this. It seems that the galil commands and the front panel are not exactly running in parallel...

0 Kudos
Message 2 of 12
(4,136 Views)
Solution
Accepted by topic author Bilal_J

I don't know the details of the Galil motion card but it sounds like you might be controlling it from the user interface thread. When you hold the  mouse down on a window border in Windows, the UI thread is unavailable for a period of time and the DLL call will just block. If you are controlling the Galil with a DLL, see if the DLL is set to run in the user interface thread (it will be orange.) This is the default; LabView assumes your DLL is not thread-safe unless you specifically identify that it is. If the DLL is thread-safe, you can just change the call setup to let it run in any thread. 

 

Message 3 of 12
(4,127 Views)

Thanks, that worked.

 

I still need to figure out why my graph randomly draws a line from the start point to the end point when my buffer starts over writing.

0 Kudos
Message 4 of 12
(4,104 Views)

Thanks for the great suggestion Rob.  Kudos to you!

 

I've worked with these Galil drivers before and will probably work with them again in the future.  This info will be very useful.  Thanks for posting.

---------------------
Patrick Allen: FunctionalityUnlimited.ca
0 Kudos
Message 5 of 12
(4,083 Views)

Bilal_J wrote:

Thanks, that worked.

 

I still need to figure out why my graph randomly draws a line from the start point to the end point when my buffer starts over writing.


 

The XY graph plots points in the order that they are in the array.  So if you are doing a circular buffer where you wrap around and start putting points in at the beginning of the array, then the later points plot first, and the older points near the end of the array plot last.  And you'll have a line jump somewhere in the middle of the array where your pointer is as it goes from the point you just added, to the oldest point still remaining in the array.  You could rotate your array as you add points to the end.  Or you could add another element in there that is set to NaN right after your newest point so that it breaks the line before it jumps back to your oldest point.
0 Kudos
Message 6 of 12
(4,070 Views)
If my buffer is wrapped, then I rotate the array by negative the pointer location everytime the data is retrieved.
0 Kudos
Message 7 of 12
(4,047 Views)

If you are talking about bogus lines from points that should be on the right showing half-dots on the left,that is a bug.

 

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 8 of 12
(4,044 Views)

Im not sure what you're talking about. I was able to take a picture right when it happened, it happens right when the end pointer goes to the very beginning.

 

0 Kudos
Message 9 of 12
(4,026 Views)
Please reread my reply #6 again.
0 Kudos
Message 10 of 12
(4,023 Views)