LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Labview graph data delayed

Solved!
Go to solution

Hello all,

 

I'm currently working on a Lab view interface for a Rocket thrust measurement Test stand. We're using an arduino and XBee connection, although for our current tests we've been using a hardwired connection. The problem is, the serial data input from our test weights is currently being written to graphs at an incredibly delayed rate. As in, I'll take the weight off the sensor and the graph/response will show that fact dozens of seconds later.

We're using VISA in this to receive serial data (the arduino is coded and calibrated to give accurate weight) in the form of pounds vs seconds

 

How should I counter this? I tried increasing my loop delay, but that didn't seem to be having an effect. Ideally, we want the graph updated in real time.

 

I attached the file, although it's currently unfinished (formatting in particular, and it also has three version of the graph I'm using). I don't (currently) need help with anything but the graph-writing delay however.

 

Thank you for your help.

0 Kudos
Message 1 of 4
(2,070 Views)
0 Kudos
Message 2 of 4
(2,069 Views)
Solution
Accepted by topic author fireball900

First.  Clean up your block diagram.  It is difficult to read with icons cluttered together and wires running backwards.

 

Second.  DON'T USE BYTES AT PORT!  Since you have the termination character enabled, I assume your Arduino is sending the data in some reasonable protocol where the values are separated by commas and the entire data set is terminated with a line feed character.  It certainly should be because that is how you are converting your string data to numbers.  The problem with bytes at port is you are only grabbing whatever bytes are at the port at that instant no matter whether a complete message has arrived or not.  Just wire up a number to the VISA Read that is larger than than the longest message you ever expect to get.

 

Third, you seem to be doing a couple things with your incoming data.  In one spot you are using spreadsheet string to array.  Seems reasonable.  In another, you are continually concatenating the new strings to a feedback node, then using Fractional String to Number to add it to the first array.  Why?  Then you proceed to send that to the Build XY graph, but then you don't actually have a graph.  Both Build XY graph and the feedback node are growing ever longer datasets with a history of old data.

 

My guess is that these ever growing strings and datasets are slowing your VI down and taking longer and longer to process.

 

Delete your whole VI and start over.  Do one simple thing like reading the VISA port and make sure you have that right.  Then build on that to convert it to numerics.  Build gradually.  Right now it seems like you are trying to do everything at once in whatever manner crosses your mind at the moment with no real clarity in what you are really trying to accomplish.

Message 3 of 4
(2,044 Views)

Cleaning it up worked well, so thank you. Ended up just altering my original, since the clutter was my failed efforts with the graph (was receiving null values that were screwing up the readings).

0 Kudos
Message 4 of 4
(1,985 Views)