12-02-2011 11:15 AM - edited 12-02-2011 11:20 AM
In the attached sample VI, I am trying to output a text string to the string indicator-string3, The string2 is a constant text string "I am". i would like to have the string3 show "i am0" , "I am1", "I am2", "I am3", "I am4", one by one, but with the attached VI, i can only shown "I am4", anyone can tell me how to modify this VI? I don't want to put the string3 indicator inside the "for" loop for other application purpose.
Thanks.
John
12-02-2011 11:23 AM
John,
Not sure what you are trying to accomplish, but try this to see if it brings you closer to a solution.
Right click on the output of the for loop and select "Indexing" This will give you an array output of each string created in the loop. Then you can use the index array function in other parts of the code to select the correct string to display.
Dan
12-02-2011 11:31 AM
John,
See the following example.... LV 2011 - Let me know if you need it in a different version.
Dan
12-02-2011 11:33 AM
Dan,
I have tried your solution, but the problem is that i can only get the display on String3 after all five "for" loop are accomplished. Can i show the result from each "for" loop instantly?
John
12-02-2011 11:35 AM
Sorry, my labview version is 8.5.
12-02-2011 11:43 AM
Hello,
Attached is LV 8.5 VI.
Regards,
Bijay
12-02-2011 11:52 AM
Bijay,
with your solution, I still get the same problem as Dan's solution, i can only show the result after all five "for" loop are accomplished. The content in string3 is actually commands to be written to a linear XY stage. The stage controller can not accept commands in a array, it can only accept a command one by one, i also want to send the command to the stage controller every 2 minites, so i need to set the waiting time in each "for" loop. With your solution, i could not set up this waiting time.
John
12-02-2011 12:31 PM
John,
I've just downconverted Dan's VI. As you have mentioned in your first post,Dan's VI works good.
Regards,
Bijay
12-02-2011 12:47 PM
I could not open Dan's VI, can you send me the 8.5 version?
John
12-02-2011 12:58 PM
Try this. The Wait ms is there only to allow you to see the updates to the value of Command. Without it you would only see the last value even though each is written to the indicator. They are just written so quickly you don't see it.