08-27-2015 07:24 PM
Hello. I am trying to create like a graph that creates what will look like a hysteresis loop. This Vi ramps up to 200 Volts in 20 Volt increments, then it ramps back down to 0, in 20 Volt decrements. What I would like to do is create a graph that will plot this, showing it going from 0-200 then 200-0. I have tried an X-Y graph, which I thought it would be but cannot get the data types to match. Under the state labeled "Run Test" it shows Displacement and Voltage. I would like to have this graph show both the voltage and the displacelement value. The password is 2015. Thank you
Solved! Go to Solution.
08-27-2015 07:50 PM
Did you post the correct VI? The one you posted does not have a graph and it does not have a state labeled "Run Test" although there is a "Testing" state. None of the subVIs or typedef controls is present either.
You need to accumulate the data from the voltage and displacement measurements into arrays so that they can be plotted on the XY Graph.
Other comments: Eliminate the sequence structures. With a state machine you do not need them.
- Eliminate right to left wiring. It makes it difficult to understand your code.
- Eliminate local variables. With the state machine and shift registers you do not need them.
- Nested loop are generally not a good idea in state machines. Simply add a counter and repeat the "Testing" state 21 times. You will also need to move the file I/O to a different state so it does not get repeated.
- Consider an event structure for capturing user interactions.
Lynn
08-27-2015 08:18 PM
@johnsold wrote:
Did you post the correct VI? The one you posted does not have a graph I took my graph out because I couldn't get it to work.
it does not have a state labeled "Run Test" although there is a "Testing" state. Testing is the correct one
You need to accumulate the data from the voltage and displacement measurements into arrays so that they can be plotted on the XY Graph. This is what I was having trouble doing. I coudn't get the values to plot on the graph. Nothing I tried allowed connecting the values of the voltage and displacement to the graph.
Other comments: Eliminate the sequence structures. With a state machine you do not need them.
- Eliminate right to left wiring. It makes it difficult to understand your code.
- Eliminate local variables. With the state machine and shift registers you do not need them.
- Nested loop are generally not a good idea in state machines. Simply add a counter and repeat the "Testing" state 21 times. You will also need to move the file I/O to a different state so it does not get repeated.
- Consider an event structure for capturing user interactions. Originally I started with Event Structure but couldn't figure out how to get it to work for me.
Lynn
08-28-2015 10:45 AM
You can connect an array of complex data to it. Or you can connect a cluster of two arrays, or an array of x,y clustered points.
08-31-2015 11:03 AM
@Gregory wrote:
You can connect an array of complex data to it. Or you can connect a cluster of two arrays, or an array of x,y clustered points.
This worked. Thank you