LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Multiple inputs

Solved!
Go to solution

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 / ...

 

 

0 Kudos
Message 1 of 20
(3,530 Views)
Solution
Accepted by topic author iviewlab

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.

Message 2 of 20
(3,523 Views)

... 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

Message 3 of 20
(3,513 Views)

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."

0 Kudos
Message 4 of 20
(3,489 Views)
0 Kudos
Message 5 of 20
(3,480 Views)

Try a different browser.

 

Try to zip it before uplaoding.

0 Kudos
Message 6 of 20
(3,479 Views)

What is the purpose of Laser Position 2?  Whatever shows up in it is defined before your VI ever starts.

0 Kudos
Message 7 of 20
(3,475 Views)

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"

0 Kudos
Message 8 of 20
(3,466 Views)

What exactly do you mean by "Merge"?  You said you want to replace the data in the string with whatever comes later.

0 Kudos
Message 9 of 20
(3,461 Views)

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.

0 Kudos
Message 10 of 20
(3,458 Views)