LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Continuously update table

Solved!
Go to solution

Hello,

 

Is there a way that you can continuously update a table or graph in labview without having the instrument inside the data processing loop itself? I basically want to take 10 voltage readings and have the graph update after each iteration of the loop. The problem I'm having is that I need the table outside the loop because it is connected to other data as well.

 

Thanks,

 

Konrad

0 Kudos
Message 1 of 18
(3,687 Views)

Local variables spring to mind.

 

Have a quick read here.

 

Edit - forgot local variables and VI snippets don't mix. Have a look at the VIs attached to that example for a better idea.

---
CLA
Message 2 of 18
(3,682 Views)

Ok, That seems to work, I'm running into another problem I can't seem to figure out though. When I run the data into a simple numeric indicator it updates after each loop iteration, which is what I want! But when I try and plug the data into a table, it defaults to a 2D array and wont let me wire the data to a local variable. I've attached some sample test code I've been using to test with.

 

Thanks,

 

Konrad

0 Kudos
Message 3 of 18
(3,670 Views)

With Context Help on (CTRL-H), hover over broken wires and you'll get an explanation for why you've got an error. In this case, it's because a table indicator accepts an array of strings, whereas the random number generator generates a double numeric. You need to convert your array of doubles to strings to pass it to a table, which is what the Express VI is trying to do. But bear in mind you're trying to wire the Table indicator with its own local variable, which is bizarre.

---
CLA
0 Kudos
Message 4 of 18
(3,663 Views)

I tried the string conversion already, the problem is that it's demanding that the data be in a 2D array format to be processed into the local variable for the table. Since I'm trying to process a single data point at a time, obviously the data is not in an array format. When I try to convert a decimal to a string then feed that into an array, it says the dimension is 1 and needs to be 2. Don't you need to feed the variable into the indicator for this method to work? I thought the whole point was to pass the data thru a local variable to the indicator in real time?

 

Konrad

0 Kudos
Message 5 of 18
(3,660 Views)

But you're trying to take a single data point, the random number during each iteration, and dump it into a table, which requires an array of data (in strong format).

 

If you used a shift register, and built up an array of random numbers like below, you could pass the array to a local variable at the end of each iteration. You can then, elsewhere, convert the array of doubles into an array of strings and feed into the table.

 

localexample.png

 

Edit - conversion in the other loop as follows:

 

waveformtotable.png

---
CLA
Message 6 of 18
(3,655 Views)

Would that update the table after each loop iteration though? It seems like it would only update after everything had run thru.

 

Konrad

0 Kudos
Message 7 of 18
(3,652 Views)

The local variable is inside the loop, so it will read the contents of the array once every iteration. An empty array is initialised before the for loop, and then for each iteration a new element is appended, consisting of a random number. The new array is then passed to the Waveform Graph local variable and a shift register, which sends the array to the next iteration to have the next element appended.

---
CLA
Message 8 of 18
(3,649 Views)

Ah Ok, I see what you mean now. This helps me alot! I havent worked with shift registers or clusters very much, what is the WFGraph(strict) and value cluster for? What is the value you are pushing into the shift register on the left side of the loop? I'm trying to recreate the code from your picture but am having a little bit of difficulty.

 

Thanks,

 

Konrad

0 Kudos
Message 9 of 18
(3,642 Views)

Please stop the insanity of the above discussion. It leads nowhere and makes no sense!


niedk wrote:

Is there a way that you can continuously update a table or graph in labview without having the instrument inside the data processing loop itself? I basically want to take 10 voltage readings and have the graph update after each iteration of the loop. The problem I'm having is that I need the table outside the loop because it is connected to other data as well.


 

 How is it "connected" to other data? What is "data"? Are you trying to write to the same table/graph from multiple places or do you have a single writer?

 

Looking at your attached code above, shows that you have very little experience with LabVIEW, so first we need to sort out some basics. A scalar DBL cannot be connected to a table, which is a 2D array of strings. Can you instead show us the code for the original problem?

0 Kudos
Message 10 of 18
(3,640 Views)