10-23-2019 11:00 AM
Hi, I have a problem!
Actually i have two sequential while loops and i see the plot at the end of the second loop.
If i put the graph inside the loop i need two different xy graphs, so is it possibile to have only a unique real time graph?
Regards,
Enrico.
10-23-2019 11:03 AM
Hi Enrico, what is a sequential while loop? If you are gathering data in 2 separate loops and you want to graph the data, you can create a 3rd loop to send the data to and graph it.
10-23-2019 11:07 AM
I have two different loop. Until now i can see at the end of the script my graph, instead i would like to see run time my graph. A solution could be to put 2 different graphs inside the two different loops but i prefer only one graph. Is it possibile?
PS: Sequential means that i run first a loop and than the other one, they are not in parallel.
10-23-2019 11:11 AM
Show us some code.
10-23-2019 11:56 AM
As Gregory suggested you could use a 3rd loop (parallel to the other two loops) and send the data to it for graphing. I believe that you could also use a state machine architecture to do what you want. For better answers you need to attach your code.
10-23-2019 07:01 PM
Currently i can't post vi because i'm not at home for two days.
I will try to explain better my problem: the goal of my vi is to make a polarization curve (back and forth). At the moment i have two different graphs because the two loops are not running at the same time. The point is that i would like to plot in real time the first curve and then the other one on the same graph. How can i solve my problem? Making a third loop of course i lose the concept of real time.
10-23-2019 09:15 PM
A pair of producers and a single consumer (Producer/Consumer) with the graph in the consumer will do what you want:
This is a fairly basic example, but you could also for example pass a plot index, and use an array of plots to have multiple plots on your graph (for different colours, etc).
10-23-2019 10:49 PM
All you need is exactly one while loop and a state machine architecture. Build up the graphs in a suitable data structure in a shift register and display with each iteration. Update the relevant data depending on the state.
10-24-2019 03:29 AM
This is What i need. Can you send me this vi? Thanks
10-24-2019 05:43 AM
@Enrico93 wrote:
This is What i need. Can you send me this vi? Thanks
You didn't say who (or even use kudos to make a suggestion), but I'm guessing you meant my image.
Unfortunately I didn't save it, and it wasn't a snippet (darn! 😞 ) so I had to recreate it from scratch.
As a result, I decided to add the multiple indices. You can add or remove as desired.
Since this one is a snippet, it should be draggable onto a block diagram.
A 2015 copy is attached just in case.