LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Delta X in spreadsheet in terms of seconds instead of samples

Hi Paul,

I am looking to simultaneously collect three analog input channels while changing the voltage to my analog output channel when the program is running.  This voltage controls a MOSFET which itself controls a motor.  This program will help me discover where the optimal voltage occurs in a cycle.  Therefore, it is important for me to have a spreadsheet that is updated at the same rate across all channels.

After my data is collected, I can see that my three analog input channels update every 0.01 s, but that when 1 s passes, the x axis values return to 0 s.  This is fairly insignificant as it would be simple to change the axis in the spreadsheet.  However, I need the analog output channel to update every 0.01 s as well.  Right now it only updates every second, regardless of whether I choose 1 or 100 samples in the properties section of the simulate signals express VI.

I am thinking about looking into using a buffer for my data to output the results to the spreadsheet after they are collected but I'm not familiar with exactly how this works. 

Jenna

0 Kudos
Message 11 of 29
(1,305 Views)
Since I can not execute your VI due to lack of all the libraries and hardware, I have to look only at sections.  Currently the level for the DC is set to 100HZ, but only one point in the properties panel.. When I set this to 100 points, I get 100 out.  or 1S worth of data.  If I read your response right, you still only get 1 and that is puzzling to me, but not terminal.  If that is the case, we can create an array of data from the one DC offset.  See attached picture of the lower right corner of your diagram with mods.
As for the timing reset, there is a couple of methods to handle it, and you seem to have a grasp on that.  so hopefully this helps.

Paul
0 Kudos
Message 12 of 29
(1,300 Views)

Hi Paul,

With 100 samples in the simulate signal VI I get 100 samples out... but they are the same value even if I have been changing it throughout that second.  I only see changes in the voltage offset value at every second... almost as if the program is writing updates only once every second.  For example if I changed the voltage from 2.2 V to 3.0 V at 1.85 seconds, I would only see that change in the spreadsheet at 2 s. 

When I try a program with only my analog output set up, I see the changing voltages in the spreadsheet as they changed while I was performing my experiment.  This problem might have more to do with conserving CPU since it seems as though the analog output channel can update in the absence of the analog input channels.

Thanks,

Jenna

0 Kudos
Message 13 of 29
(1,292 Views)
Ok, I am assuming that the analog output is being done from the block of 3 VIs that I can not see above the DC express VI.  As I do not have the DAS16.llb, I have no way of seeing what is available to me.  It appears to me that your ao is being monitored in the inner while loop with curCount2 in it.  and then your AO is stopped by the VI right after that loop.  That Rate2 is used to set the timing of the value changes, and the I16 array "data" contains the Digital to analog counts used to set the IO?  Is there a VI in that library to convert that cluster of data to a 'real values' or do you know the scaling equation to get the actual value?  Maybe the toEng.vi that is used above?  Another option, may be to use another analog input and directly monitor the voltage of your analog output?
We are close to resolving this... I see why your timing resets every seconds, the fix may not be as fun...
How long are you acquiring your data for at at time typically?  What is the maximum amount of time you would be acquiring samples?

Paul
0 Kudos
Message 14 of 29
(1,288 Views)
Hi Paul,
 
Yes the Analog output is accomplished by feeding the simulated signal to the "From Eng" VI which goes to the Analog Output Scan background VI.  I am also pretty sure that you are right about the current count 2 (which makes sure that the AOut channel is running)... but I don't think the data array sets anything... its more of a feedback to see how fast the program is updating.  What do you mean by real values?  In terms of voltage?
 
I tried to use the ToEng to transfer to voltage values... and it worked... but it still only updates every second.
 
There is no set amount of time that I have to acquire my data.  But probably the maximum amount of time would be around 5 minutes if everything was working well (but I can't say for sure because I haven't started testing). 
 
Thanks
0 Kudos
Message 15 of 29
(1,282 Views)
so you want to ramp your AO between 1.75V and 2.2V?  with one second of measure at each point?  Or do you want to go faster?  Is there a settling time involved.  I do understand why you can only update AO at one second intervals now, but when you only do that, you can go faster.  It has to do with your AI acquistion time... You are waiting on the values from your AI channels.  Again, many ways to skin a cat here.  so to speak... and no, I am not a dog person...  Smiley Tongue
If I understand your ramp, correctly, then we need only figure out your settling time at each AO point.

Paul
0 Kudos
Message 16 of 29
(1,277 Views)

Ideally I would like to change my AO between 1.75 and 2.2V with 0.01 seconds of measure at each point.  I'm not sure if there is a settling time involved... but if there is, it is most definitely less than 1 second (because I can hear the changes in the motor almost instantly).  Is there any way to separate what the AI and AO channels are doing so that I am not waiting on the values from my AI channels?

I think you understand what's going on correctly.  I will be changing the voltages from between 1.75 and 2.2V randomly while the program is running.

0 Kudos
Message 17 of 29
(1,273 Views)
Ok one clarification, and 2 questions.
by settling time, I am referring to your system settling time.  Action/reaction time. IE, change the motor voltage, and it takes some amount of time for the system to react for you to get the results your looking for... but we can work on that later.

1.  do you have an 'extra' analog input that you can wire your mosfet control voltage (possible the IC output voltage?) to?
2.  do you truly want bounded RANDOM values, or to increment at x.xx sec intervals from the low to high in y.yy volt increments?

Paul
0 Kudos
Message 18 of 29
(1,262 Views)
I will be changing the voltage values myself at random using the numerical slide control... so I don't want it to increment steadily if that's what you're asking.  I do have extra analog inputs that I can wire my mosfet control voltage to (I'm just wondering if this would slow the response down?).  I guess maybe it wouldn't make a difference if I'm only writing from the analog input channels...
 
I think you may be onto something.  I'll give it a try and let you know.  Thanks for the idea!
 
 
0 Kudos
Message 19 of 29
(1,259 Views)

Ok so I've tried it.  The good news is that it appears to be updating every 0.01 seconds... the bad news is that my change in voltage only takes effect every 1 s.  Maybe the settling time is longer than I thought.

You said something about my AOut waiting for the AIn channel values?  I think I'm still running into that problem because my newest analog input channel is reading from the AOut channel on my circuit board.  So the analog in is waiting for the analog out which is also waiting for the 3 other analog inputs (if this makes any sense!).

Jenna

0 Kudos
Message 20 of 29
(1,250 Views)