‎05-03-2016 08:14 PM
Hello
I have a string indicator that receives its value from a block. I have another string indicator that receives its value from another block. How can I merge this two strings? I.e. I always want to show the latest output that I received, overwriting the old one.
To give some more context, I have a motor that is moving around. There are two sources that can move around the motor, in the beginning it's done in an absolute step and then it moves around in a for loop in relative steps. I.e. I might be moving the motor in an absolute movement to position 1000, and then increment this number in the for loop by 50. What I need is a string that tells me:
1000 / 1050 / 1100 / 1150 / ..., always overwriting the last value. What I have is a string from the absolute movement, telling me it's 1000 and another string which constantly updates with 1050 / 1100 / ...
Solved! Go to Solution.
‎05-03-2016 08:45 PM
Without a VI or something to look at this is a little hard to figure out.
Are you only ever writing to the first string one time?
Are these strings ever read anywhere?
How does the second one keep updating?
For a start though I might suggest using a local variable to write the first time into the string indicator of the second. Just right click the string indicator, create local variable then wire the first string into that.
‎05-03-2016 09:10 PM
... and many LabVIEW practicioners would say "(Almost) never use a Local Variable. However, without seeing your VI (please attach the VI itself, don't post a picture, please. I suspect that what you want to do has a simple solution, but "a picture is worth a thousand words" (or, in LabVIEW, a Block Diagram is worth 1000 lines ot C code).
Bob Schor
‎05-03-2016 10:53 PM
Well, here's my VI. Basically I want to merge "Laser position" and "Laser position 2".
Edit: I can't upload my VI, the forum says "The attachment's laserLoop2.vi content type (application/x-labview-vi) does not match its file extension and has been removed."
‎05-03-2016 11:06 PM
I uploaded the vi here: http://www.megafileupload.com/nqUp/laserLoop2.vi
‎05-03-2016 11:06 PM
Try a different browser.
Try to zip it before uplaoding.
‎05-03-2016 11:15 PM
What is the purpose of Laser Position 2? Whatever shows up in it is defined before your VI ever starts.
‎05-03-2016 11:18 PM
Hmm, not sure if I understand. "Laser position 2" is defined by what I set in "Initial position x/y/z". This is the field that should be merged with "Laser position"
‎05-03-2016 11:21 PM
What exactly do you mean by "Merge"? You said you want to replace the data in the string with whatever comes later.
‎05-03-2016 11:23 PM
What I want to achieve in the end: I need to call the external command with the x/y/z positions. To simplify this problem, I first tried to write out the x/y/z positions in a string. I can then easily concatenate the positions with commands as needed.
I can write the initial x/y/z position in "Laser position 2". I can write the x/y/z position in the for loop in "Laser position". I need to have them in one field, though.