LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

show incoming data in list/table

data is coming in via a CAN-Bus at non-defined timing. I can extract the data (6 different values) and want to display it in a list/table which shows the latest reading as first line and shoves the previous readings one line down. somebody any idea?
0 Kudos
Message 1 of 10
(3,453 Views)
Hi

How about a continously updating loop with a 2D array feeding ur listbox.
wire a shift register to pass the data so it get updated.

Goy
0 Kudos
Message 2 of 10
(3,438 Views)
Easiest would be to simply built the array by adding the new row on top. See attached example (LabVIEW 7.0).
 
(If this program runs for extended periods of time, you need to make sure that the array does not grow without bounds or you'll run into memory issues after a while. You might want to e.g. keep and display only the last 20 entries, while appending them also to a log file for record keeping. You can then always retrieve older entries from the log file if needed).
Message 3 of 10
(3,430 Views)
Hi altenbach,

thanks for your VI! I modified it for my purpose and it worked.

0 Kudos
Message 4 of 10
(3,411 Views)
Hi Altenbach,

you proposed to limit the entry to the list to a certain amount to prevent it togrow too long. How would you do that in the VI you sent?

0 Kudos
Message 5 of 10
(3,393 Views)
Well, there are many possibilities.
 
The attached example (LabVIEW 7.0) shows one possibility. It keeps the array at a fixed lenght of 10 rows. Modify as needed. 🙂
0 Kudos
Message 6 of 10
(3,385 Views)
Hi Christian,

thanks for the VI! I modified it to my purpose in trillion different ways, however I have a fundamental problem (being a novice in LabView!): the in coming data is generated outside the while loop, so every time new data is coming in, the loop is started again, creating a new array. What happens is that the one line read is repeated continously till I press the stop button. Then I see a new line which is repeated so many times.  I have inlcuded my VI where ArrayIn is a 1-D string Array of fixed length 6 representing the data which comes in in bursts of 10 or 20, about every second.

One other question concerning arrays: Why are some 1-D arrays displayed in vertical order (as your array created by the for-loop), others in horizontal order (as in the array exercise from LabVEIW)? It took me a while to understand why you rotated the rows; a assumed the lines had to be rotated.
0 Kudos
Message 7 of 10
(3,373 Views)
Hi Altenbach,

I am not shure if you got noticed with my last message, since I used your first name, or if my question is too trivial and no challenge for you. Anyway I try it again:

thanks for the VI! I modified it to my purpose in trillion different ways, however I have a fundamental problem (being a novice in LabView!): the in coming data of my system is generated outside the while loop, so every time new data is coming in, the loop is started again, initializing a new array. What happens is that the one line read is repeated continously till I press the stop button. Then I see a new line which is repeated so many times.  I have inlcuded my VI where ArrayIn is a 1-D string Array of fixed length 6 representing the data which comes in in bursts of 10 or 20, about every second.
In your example you had the generation of the string array coupled to i, which means that data and loop are synchronized. This is not the case in my setup.

One other question concerning arrays: Why are some 1-D arrays displayed in vertical order (as your array created by the for-loop), others in horizontal order (as in the array exercise from LabVIEW)? It took me a while to understand why you rotated the rows; a assumed the lines had to be rotated.


0 Kudos
Message 8 of 10
(3,359 Views)


@RichL wrote:
I am not shure if you got noticed with my last message, since I used your first name, or if my question is too trivial and no challenge for you. Anyway I try it again:

No, I actually saw it and made an example, but then got sidetracked with other things and forgot about it. Sorry about that.


@RichL wrote:
thanks for the VI! I modified it to my purpose in trillion different ways, however I have a fundamental problem (being a novice in LabView!): the in coming data of my system is generated outside the while loop, so every time new data is coming in, the loop is started again, initializing a new array. What happens is that the one line read is repeated continously till I press the stop button. Then I see a new line which is repeated so many times.  I have inlcuded my VI where ArrayIn is a 1-D string Array of fixed length 6 representing the data which comes in in bursts of 10 or 20, about every second.

Your VI (Tablestop.vi) will not work because "Array In" is outside the loop and only get read once per VI run. All iterations of the FOR loop will get the same data from the tunnel.

 

If the data is generated elsehwere, you could use a LV2 style global to transfer the data. In the attached simple example, we have two loops. The upper loop generates new data at random intervals and writes it to the data exchange VI.
The VI for the data exchange acts as a buffer with a fixed number of entries that are kept in uninitialized shift registers. It opertates in one of three modes.

  1. Init just initializes the shift register to a fixed size
  2. Write appends the incoming data to the buffer.
  3. Read gets the currently stored data.

The lower loop calls the VI at regular intervals and if new data is available, updates the indicator.

This works equally well if the writer and reader loop are in different VIs.

There are many other ways to do this, of course.


@RichL wrote:
One other question concerning arrays: Why are some 1-D arrays displayed in vertical order (as your array created by the for-loop), others in horizontal order (as in the array exercise from LabVIEW)? It took me a while to understand why you rotated the rows; a assumed the lines had to be rotated.

1D arrays only have one dimension, there is no difference between vertical and horizontal. 1D array indicators can be shown horizontally or vertically, same difference. 🙂 This is purely cosmetic.

If we rotate the rows (=colums of the transposed indicator), it simplifies the code, because autoindexing works that way. If you want to rotate the columns you would need to explicitely index the columns at each iteration in the small FOR loop. You can do it either way. rotating the columns would save the transpose iteration.

Message 9 of 10
(3,342 Views)
Hi Altenbach,

thank you for your patience;  I got the tabel done with a mixture of your proposals and own ideas.

Regards
Richard

0 Kudos
Message 10 of 10
(3,313 Views)