LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Best way to graph in an event driven program

Hello all,

I have a very simple event driven program (lots of buttons to perform various tasks for a stepper motor), and I want to know the best way to plot the data I'm getting.

The stepper is coupled to a high precision encoder, and thus I get very good data back which I would like to show on a plot.  My problem however, lies in the fact that I don't wish to have more than one graph.  I also don't want to have 15 or 20 local variables or property nodes, one in each event.  So what would the best way to go about this be?

I have considered using a case structure with a loop wrapped around it with a shift register, but that changes the way I have the UI set up...(is there a pretty way to have actual buttons that provide an integer on return?)

Thanks
0 Kudos
Message 1 of 2
(2,404 Views)
Hello.

I am not sure how you are getting the data from the encoder, but it sounds like you could have a separate loop just for monitoring the enconder, and generate the graph there.  In other words, you could have a loop with the event structure to handle all your buttons, and a separate loop where you read the encoder, and continously update the graph.

If you only want to update the graph when a button is pressed, you could have an event structure inside this second loop and trigger the event when any of the buttons are pressed.

Without knowing more about your application and VI structure, this is the best advice I can give you.

Hope this helps,

Alejandro
Message 2 of 2
(2,388 Views)