Apparently, you have two independed VIs, one with an infinite while loop that generates random data as fast as the processor can, and you have another VI that runs a limited FOR loop, also as fast a possible.
-- Do you want to run both concurrently and simply randomly grab the current value from "second" whenever the FOR loop iterates?
In this case, you should definitely put at least a 0ms wait in each loop to force a task switch. Else the FOR loop might run multiple times before the while loop executes again and you'll get the same value several times in a row (Just guessing, I have not tried this). Messaging the data between the two VIs can be done in a variety of ways (LV2 style functional global, Global variable, value properties, queues, datasocke
t, UDP, etc. etc.)
-- Do you need to add synchronization such that "second" executes exactly once per FOR loop iteration? Do you need to ensure that ALL data generated by "second.vi" arrives at "first.vi"?
-- Do you simply want to call "second" inside the FOR loop of "first" as a subVI call?
In this case, get rid of the while loop, add terminals, and just place the subVI inside the FOR loop.
Please tell us a bit more behind the reasoning for your design. What are typical input parameters? How are you planning to start second.vi, then stop it when it is no longer needed?