06-14-2011 04:41 AM
Thank you
For now I have used the express VI, Write to measurement file.
The headers full of rubbish I dont want but it lays the time stamps and channels out correctly. However the first few logs are not 1 second apart, but I guess this is because i am using the wait function so at least the first one wont be 1 second long. Anyway to avoid that or is it just the way it is?
Also I cant wire a waveform to the Excelsheet VI, I will have to split out the Y components. Only problem then is I lose the time stamp.
06-14-2011 04:48 AM
Good point about the spreadsheet VI. I wouldn't worry about using the write to measurement file. Express VIs are perfectly OK to use if they do the job your after. Your loop isn't running anywhere near fast enough to cause problems by using this method.
What wait method are you using in the second loop?
CG
06-14-2011 04:54 AM
just using the wait until next ms multiple, with the multiple set to 1000ms so a second. Once it gets going its fine, logging 1 per second.
I have the same method in the top loop, but its 25ms multiple.
If I remove it completely, everything still works, but the front panel doesnt seem to refresh any faster. Is it better to remove the wait timer from the producer loop and try use the DAQmx timing VI to control things? Will that work?
Also why can't I wire a Task and Physical channels into a DAQmx create channel VI? It says i must have the physical channel constant there, but the task is optional. I thought I could use the task input to define the correct scales for each of my pressure transducers. But I keep getting errors about duplicate channels.
06-14-2011 04:57 AM
if I want to post my VI how do i do that? Can i just post the VI or do I need to post the whole project with the controls and sub VI's?
06-14-2011 05:00 AM
If you have changed the lower level subVIs then you will need to include them. If you have just used standard subVIs in your top level VI just send me that. You can just post it on here as an attachment if you don't mind other people being able to see it.
CG
06-14-2011 05:04 AM
Added the lot in a zip file
06-14-2011 05:25 AM
I'm not an expert on the Write to Measurement File.vi but have you tried writing to file without including the DAQmx task? This may be where you're getting the unwanted preamble from.
Removing timing from the top loop will mean that you are updating the screen an extremely fast rate. This could be processor intensive so it's up to you to decide whether it's worth it. I would recommend a small wait.
You don't need to select channels if you have already configured a task to use specific channels. You can apply the scaling to the channels in the task and just wire the task through. This can be done through MAX by configuring a Virtual Channel. (MAX help should be able to guide you through that process).
Regards,
CG
06-14-2011 05:40 AM
Ok will try that
Thanks for all your help
One last question though, I need to get clear in my head the differences between Acquisition mode, samples to read and rate.
I assume that i need to pick continuous (ie until I tell it to stop).... but samples and rate? I dont understand why I might need say 5 samples of the same channel per rate. So if I pick 1000Hz rate, it is going to sample each channel 5 times.... so thats 5000 samples for each channel total? is that right?
06-14-2011 05:52 AM
I agree that this is a confusing topic. I'll try and clear it up for you.
You would correct in thinking that you should use continuous acquisition. This mode will continually fill up the hardware buffer on your device. The DAQmx Read function then takes the samples from the hardware at the rate you specify and in the chunks size that you specify.
Finite Acquisition allows you to confgure the number of samples you wish to acquire over a period of time
In Finite Acquisition mode the 'Samples per Channel' actually specifies the number of samples to acquire. In continuous mode it sets the buffer size on the hardware so you can for example, set the hardware to only ever hold 100 samples. The general rule is that you should take about 1/4 of the hardware buffer every time you Read with the DAQmx function. (So you would set the 'Samples to Read' value to 250 if the buffer size was 1000.
The rate actually specifies when you take your samples. Eg. A rate of 10 Hz will take a reading every 100ms.
I hope I have been reasonably clear. Let me know if there is anything you still don't understand.
Best Regards,
Chris
06-14-2011 05:58 AM
Thats clear now, thanks!
Thanks again for your help and responsiveness.