LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

continuous reading xy

hello. I have a program that has two while loops with one of them having a time delay. the problem is, i want the xy graph to give a continuous reading while the program is running. I cant seem to figure how to do that with two while loops. i can do it when there is only 1 while loop in the program (using xy chart)and both the x and y inputs are in the same loop but mine has 2 different loops (1 for x and 1 for y). how do i get around this?

thanks in advance
0 Kudos
Message 1 of 4
(2,356 Views)
The answer will depend on whether these loops are independent loops, or one within the other. Which way do you have it? Can you post your code or at the very least a screenshot?
0 Kudos
Message 2 of 4
(2,355 Views)
well, i kinda messed it up big time experimenting. but the overall idea is there. output of the top loop should be the x-axis and the bottom timed loop should be the y. i would really appreciate it if you can help me
0 Kudos
Message 3 of 4
(2,351 Views)
Yes, well, I'm afraid I don't have a 50" screen in order to actually figure out your VI. I couldn't make heads or tails out of it due to the gorge of local variables.

As far as I could tell, it seems that you're trying to access the "Current wavelength" that's being updated in another loop. The way you have it you're reading the value before you start the loop that's updating the graph. This means that even if this value is changed, the loop only ever sees the original value. If you place this local variable inside that loop you should get the value as it's being updated.

I can say definitevily that the one case structure that you have that's driven by a local variable of "Stepsize" unnecessarily duplicates code. You're essentially doing the same thing in each case. I only saw one minor difference. Rather than having a case around the whole code, have the case around this just one bit of difference. Easier maintenance.

You're also using both VISA and old-style GPIB functions. Stick with VISA. The old-style GPIB functions should not be used for new code. They are there for compatibility with old (like more than 10 years ago) code.

Please, please, clean up the code, and try to pare down all those local variables.
Message 4 of 4
(2,345 Views)