LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to create a string indicator with a history?

I'm interested in creating a string indicator that has a history to it, possibly with time stamps attached to it.

 

For those who have used AutoCAD it would be exactly like the command bar. A plus would be if I could only

save the last 100 entries to keep the size memory usage down.

Any thoughts? Does anyone have a code segment of this? 

 

0 Kudos
Message 1 of 10
(6,275 Views)

You store the data that goes into the string in a shift register.  When you add more, you concatenate it to the end, send it to the string terminal and also to the shift register.

 

For keeping it from growing too long, you will need to keep track of its length and remove data from the front end.

 

One way to do this is if this is based on lines, use a 1-D array of strings as your shift register.  Use concatenates strings on the array (or possibly array to spreadsheet string) to convert the array of strings into a single string to display.  That way to remove data from the beginning, all you'd have to do is use array subset or Delete from array to remove entire lines at once.

0 Kudos
Message 2 of 10
(6,270 Views)

You could also use a feedback node. You can modify the example to include timestamps, add linefeeds after each entry, and keep a number of lines rather than number of characters.

 

Example_VI_BD.png

=====================
LabVIEW 2012


0 Kudos
Message 3 of 10
(6,257 Views)

Thank you both for your suggestions. I have used parts of both.

 

Steve - How would you modify that to have a maxiumum number of lines? Especially because

my applications has lines of different character lengths.

0 Kudos
Message 4 of 10
(6,248 Views)

Keep a line count and once you go over your limit search the string for the first new line and split it at that point.



Mark Yedinak
Certified LabVIEW Architect
LabVIEW Champion

"Does anyone know where the love of God goes when the waves turn the minutes to hours?"
Wreck of the Edmund Fitzgerald - Gordon Lightfoot
0 Kudos
Message 5 of 10
(6,240 Views)

Ravens fan already told you. But I know how hard it can be when you are new. This is what it looks like. And if I find out this is homework I'm telling your teacher on you Smiley Happy

 

 

Example_VI_BD.png

=====================
LabVIEW 2012


0 Kudos
Message 6 of 10
(6,233 Views)

@Mark Yedinak wrote:

Keep a line count and once you go over your limit search the string for the first new line and split it at that point.



That is probably better Smiley Happy

=====================
LabVIEW 2012


0 Kudos
Message 7 of 10
(6,231 Views)

Don't sleep on the Queue to hold the strings, and a Listbox to display them:

 

StringQueueExample.png

 

Super crude autoscrolling added at last second.

Message 8 of 10
(6,224 Views)

Thank you all for your help. Once I became familier with the array functions I made a program that does exactly what I need.

0 Kudos
Message 9 of 10
(6,211 Views)
You are right about not needing the shift register on the queue reference. But you always should use one on the error wire of all loops. I know you knew that but I am throwing it out for others who are new.
=====================
LabVIEW 2012


0 Kudos
Message 10 of 10
(6,202 Views)