LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to remove the last line input into a string indicator??

I am currently working on a program where the user has the ability to create a profile for one of our lab machines to run.  When the user selects what parameters they would like, a string indicator shows the user the last input they set followed by a comma.  For example, if the user selects which profile they want, and the times they would like to set, the following string would be displayed:

 

untitled.JPG

As you can see in the picture above, the profile is updated in the string indicator after every set button is hit.  In the event the user makes a mistake, I want them to have the ability to delete the last line that was added.

 

2.JPG

This is the code I developed so far.  The string coming in and leaving is attached to a shift register so it continues to append to the indicator.  I tried in this case to count how many lines have been written in the string so far, and I built an array with the current string.  Using the delete from array.VI I indexed it to the number of lines that was created so that the last line is deleted.  I unfortunately had no luck.  Any suggestions?

 

 

 

 

0 Kudos
Message 1 of 12
(6,051 Views)

How about assigning each parameter an element in an array?  You could convert the array to a string for display, etc.  and you could easily replace a parameter if the user makes a mistake by replacing one array element.

 

 

>

"There is a God shaped vacuum in the heart of every man which cannot be filled by any created thing, but only by God, the Creator, made known through Jesus." - Blaise Pascal
Message 2 of 12
(6,040 Views)

That's a cheap solution i used for something like that 3-4 years ago.

I used 2- string indicators and used the visible property node to flick between them 2.

Used coordinates to find what text i have highlighted with the mouse to delete it.

You can delet any line of the indicator in that way. I have modified it so you can run it.

Copy the path of 1.txt to load the text file on the file path control

Let me know if that can work in your case

Regards

Download All
0 Kudos
Message 3 of 12
(6,024 Views)

I'm sure this is more complex than need be. There is probably a simpler way, but does it work. Yes.

 

 

Message Edited by for(imstuck) on 06-08-2010 09:13 AM
Message 4 of 12
(6,012 Views)

How About....

 

Message Edited by Broken Arrow on 06-08-2010 09:16 AM
Richard






Message 5 of 12
(6,006 Views)
How about it. 😉
0 Kudos
Message 6 of 12
(5,991 Views)

Broken Arrow.  I tried your code and it did not work.  You need to add another reverse string as shown below:

 

DeleteLastLine.png

 

- tbob

Inventor of the WORM Global
0 Kudos
Message 7 of 12
(5,963 Views)

Hey Tbob,

 

That almost worked.  The only issue though is it leaves a null string in its place without moving everything after up one line.  Also, if i have a parameter repeating multiple times, it doenst seem to work.

0 Kudos
Message 8 of 12
(5,950 Views)

Fonzie1104 wrote:

Hey Tbob,

 

That almost worked.  The only issue though is it leaves a null string in its place without moving everything after up one line.  Also, if i have a parameter repeating multiple times, it doenst seem to work.


 

I'm confused.  If you are deleting the last line, how can there be anything after?  What do you mean by a parameter repeating multiple times?

If you look at my example front panel, you will see that the last line is deleted.  Isn't this what you asked for?

 

- tbob

Inventor of the WORM Global
0 Kudos
Message 9 of 12
(5,943 Views)

tbob wrote:

Fonzie1104 wrote:

Hey Tbob,

 

That almost worked.  The only issue though is it leaves a null string in its place without moving everything after up one line.  Also, if i have a parameter repeating multiple times, it doenst seem to work.


 

I'm confused.  If you are deleting the last line, how can there be anything after?  What do you mean by a parameter repeating multiple times?

If you look at my example front panel, you will see that the last line is deleted.  Isn't this what you asked for?

 


 

It's due to the fact that your constant doesn't have a comma in the last line. If you add that in, you should be able to reproduce his problem. This is just a guess though, I didn't actually test it to see.

Message Edited by for(imstuck) on 06-08-2010 01:24 PM
0 Kudos
Message 10 of 12
(5,938 Views)