LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Table control

Attached is an image of my block diagram and my front panel for a pretty simple program I am writing.  It constantly reads data from a DVM and puts the data into 3 columns, 1 has all the data, 1 has all the data above a certain threshold, and 1 has all the data below a certain threshold.  I am trying to get it to display the data it has collected on the front panel and am running into a problem. 

 

In my attached image I have tried to use array indicators and a table control to do this (I was missing a "transpose array" for the table control when I took the screen shot, so those numbers have been moved to across the top row instead of down the first column) but they never show more than 1 line of data at a time.  If I take the table control and put it outside the while loop, I am pretty sure it will have all the data but it won't update in real-time.  I would like it to show all lines of data in real time, instead of just 1 line of data in real time or all lines of data once the program is over.

0 Kudos
Message 1 of 10
(5,646 Views)

One thing you are missing here is your shift register and when you are building the array insert the element at the top. But make sure that how long you will be building the array. If it is for short duration there is no problem but if you are running for a long time you will run out of memory. Just check the attached snippet for your reference.

 

Array.png

 

Array FP.PNG

 

Good luck

 

-----

The best solution is the one you find it by yourself
Message 2 of 10
(5,637 Views)

Thanks for the tip, I'm not exactly sure of the running time yet but there is a good chance it could go on for up to a few hours, in which case memory may start to become an issue.  Is there another way around that?

0 Kudos
Message 3 of 10
(5,628 Views)

Few hours means your application would crash because of memory leak. Try this

 

Open a file reference for .bin file before starting the loop and write the data at regular intervals

 

Building Array 1.png

 

 

Building Array 2.png

 

Good luck

 

 

 

 

 

 

-----

The best solution is the one you find it by yourself
Message 4 of 10
(5,621 Views)

Another problem you'll run into running the code for hours is that the loop time will gradually get longer and longer as LV has to allocate more and more memory. The other solutions are the way to go, just remember that you have a trade-off between execution time and exposure to loss of data.

 

Mike...


Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

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

For help with grief and grieving.
Message 5 of 10
(5,601 Views)

Just to make sure I've got this straight, I run the risk of running out of memory if it runs for a number of hours because of my use of arrays, and if it runs for so long the arrays will get huge, causing them to eat up more memory, causing the loop time to get longer? 

So in theory as long as I don't use arrays+shift registers then I should not have a memory problem.

0 Kudos
Message 6 of 10
(5,579 Views)

As long as you want to use a table control, you will be using an array so your comment makes no sense to me.

0 Kudos
Message 7 of 10
(5,567 Views)

That was more of a general programing / knowledge for the future type-question and not so much a specific to this instance type-question

0 Kudos
Message 8 of 10
(5,560 Views)

@LarsUlrich wrote:

 

So in theory as long as I don't use arrays+shift registers then I should not have a memory problem.


No as long as you properly handling them they will not create memory issue.

-----

The best solution is the one you find it by yourself
0 Kudos
Message 9 of 10
(5,552 Views)
The trade off I mentioned was this: The fastest solution is to keep all the data in memory and write it to disk at the end. However this is also the most memory intensive and is the PC should crash or somebody trips over a power cord - you could lose a lot of data.
Conversely, writing data after acquisition will use the least memory and is the safest but is also the slowest due to all the file IO. Hence the trade-off.

Mike...

Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

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

For help with grief and grieving.
Message 10 of 10
(5,546 Views)