LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Little help creating block for simple closed loop test with USB 6008

OK, I am a rookie just playing around with a neighbor shop's stuff trying to see how I like LV.  I was simply trying to create a closed loop to compare input and output.  I am looping 1 ch of output to 1 ch of input.  I want to simply create a voltage or frequency from the output and be able to graph the output relative to the input and compare latency (if that will be accurate at all).  More or less just a test with the software. 

 

I created my graph and a control to adjust the voltage.  in the block, I opened the daq assist to open the output ch and connected it.  I am able to slide my control and get my output without problems but still not sure how to get this to loop so I can look at the output and input all in one graph and compare timing.  I am thinking this will require a basic PID loop but their software does not have that workbench so possibly something will nee created.  

 

Sorry for the ignorant questions.  Just trying to get a feel for the software at this point.  

0 Kudos
Message 1 of 4
(2,600 Views)

You can simply build an array of your two waveforms, then pass the array to a Waveform Graph.

This will allow you to view both plots on a single graph.

Could you please post your code so far so we can see what you are doing?

Cory K
0 Kudos
Message 2 of 4
(2,596 Views)

I am not sure what code you are referring to?  Block diagram?   Hard code?  I do not have LV here so I have to drive 10 mi to use it... I have not saved a thing yet though.  Only takes about 5 min to create. 

 

Simple problems that I had were:

 

1.  Stop button to cancel voltage output....  Thought was that the stop button in a loop may stop functions of the controls but may not stop output and I may have to create that functionality.  

 

2.  Was not initially seeing voltage on my graph.  I connected  myoutput to the graph but even though channel was outputting, graph would not show it. 

 

 

I will have to learn more about arrays.  I thought that might be what I was looking for but still learning a bit.  

 

0 Kudos
Message 3 of 4
(2,589 Views)

I thought you had written some code up in LabVIEW. I just wanted to look at your block diagram to see what you were doing. If it is going to be an issue, don't worry about posting the code.

 

Each 'waveform' basically consists of 3 important parts:

to - basically the first point to start at, time-zero

dt - the time between each data point, waveforms must be regularly spaced

y - this will be an array of all of your y points

 

By combining all of these components, you will generate a waveform.

When you use the DAQ assistant, it is using an express VI to generate these components for you.

When you talk about input and output, I'm assuming you are interfacing with hardware. Is this correct?

If so, what hardware are you using, and how is it connected?

 

Just so we're on the same page, by latency, do you mean the phase difference between an identical input and output signal?

If that is correct, please look at this thread. Krisna provides two different ways to do this.

Cory K
0 Kudos
Message 4 of 4
(2,564 Views)