LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

compactDAQ DAQ-MX setting sample time

This is my first time posting here, this is my question: I have a
Compact DAQ (9172) along with two modules (9205 & 9219). I am trying
to set it up so that the user can input a sample rate on the front
panel. So far I have been doing this by using DAQ Assistant to
continuously output data, and then feeding that into a true/false case
that gets called whenever a timer runs out (the timer is wired so that
it runs out according to the sample rate put in by the user). I do
not feel that I am going about this as effeciently as I could be...
since there's going to be a lot of needless sampling going on....my
question is, is there a way where the user input could directly change
the sampling rate of the DAQ Assistant? That way if I only need 5
samples a second, I could just have the daq sample at 5 Hz, instead of
going through loops.... I was thinking maybe some of the things on the
DAQmx pallette could help with this, but I have not been able to ke
those work (like the DAQmx Timing vi)

Much appreciate any assitance or suggestions, thanks
0 Kudos
Message 1 of 8
(4,461 Views)
Can you attach your vi. It will be easier to help if we can see what you're trying to describe.
Troy - CLD "If a hammer is the only tool you have, everything starts to look like a nail." ~ Maslow/Kaplan - Law of the instrument
0 Kudos
Message 2 of 8
(4,450 Views)

Duplicate Post??

Please don't ask the same question  in another thread using a different user name!!!Smiley Mad

0 Kudos
Message 3 of 8
(4,444 Views)
On May 12, 11:10 pm, Ravens Fan <x...@no.email> wrote:
> <a href="http://forums.ni.com/ni/board/message?board.id=170&view=by_date_a..." target="_blank">Duplicate Post??</a>
> Please don't ask the same question&nbsp; in another thread using a different user name!!!Smiley Mad

I guess the google groups and the ni forum are linked, i didn't double
post in either, but did post in each? Smiley Mad


Basically, I was wondering if there was an advantage to using the
"DAQ-MX Polymorphic VIs" rather than the DAQ-Assistant.... I would
like to sample something (some thermocouples) and want the user to be
able to input how many samples to read per second.... is this possible
by just using the DAQ-Assistant or do I need to get into the DAQ-MX
polymorphic VIs?

Thanks
0 Kudos
Message 4 of 8
(4,422 Views)
I hadn't heard of a LabVIEW forum in Google Groups.  But I guess it's possible it's a different portal to the same forum.  I would recommend accessing the forum by way of the www.ni.com website.
 
It looks like you can change the rate and number of samples by way of the DAQ assistant.  Expand down the bottom of the blue icon block and you will see the various inpus and outputs.
 
The express VI's are a good way to get started on something quickly, but as your needs grow, they may not have the flexibility to do what you want to do.  In which case you should start looking at the lower level DAQmx VI's.  One good tip for higher level express VI's is to right click on them and select Open Control Panel.  Note this is an operation that can only go one way, you can't undo it so you may want to do it on a copy of your VI first.  What it will do is turn the blue express VI into a yellow subVI which you can open and see the underlying code.  Also, don't forget to look at the numerous examples for DAQmx in the example finder.


Message Edited by Ravens Fan on 05-13-2008 11:28 AM
0 Kudos
Message 5 of 8
(4,417 Views)

Hi Panfilero

The DAQ Assistant provides an easy to use interface which, among other things, will allow you to setup your sampling rate through a control on the Front Panel. I've attached some images of how to configure the sampling rate for the DAQ Assistant. First, you must configure your DAQ Assistant's sampling mode to N-Samples or Continuous Samples. Then you can find the terminal on the Block Diagram that says Rate and wire in a numeric control into the terminal. You can find the terminal by either holding your mouse over the small terminals on the top left of the VI or by pulling down more terminals at the bottom and then selecting Rate as an option as show by Ravens Fan above.





To further give you flexibility and more programming power, take a look at the example that ships with DAQmx titled Cont Acq Thermocouple Samples-Int Clk. You can find this under Help»Find Examples...

NOTE: You cannot change the sampling rate while a DAQmx Task is running. This is something that will be setup before committing the task to the board (i.e. Start Task.VI or executing the DAQ Assistant). Therefore changing the Sampling Rate while your program is running is not an option and the Task will have to be stopped and started to do this programmatically. A workaround would be to provide an external clock.



Message Edited by PBear on 05-13-2008 11:08 AM
PBear
NI RF
Download All
0 Kudos
Message 6 of 8
(4,414 Views)
Thank you guys for your help, I'm including an attachment of how I have everything wired up... I'm unable to get data to write to my output file.... I was assuming that everytime I get a sample coming out of the daq assistant that it would go to my file.... am I wiring this wrong?

Thanks.

PS - this is a thread I originally started on google groups, I'm not sure how it ended up over here, but I'm responding to it in here now. thanks again



0 Kudos
Message 7 of 8
(4,396 Views)
You have a variable called RefNum Out.  Where is it's terminal?  Where are you getting the value from?
0 Kudos
Message 8 of 8
(4,376 Views)