09-23-2009 04:00 AM - edited 09-23-2009 04:01 AM
Hi,
What is the correct way to reconfigure a DAQ on the fly?
Every 100s I am doing a 2000 point 4-channel triggered acquisition (50000 sample rate)
As a housekeeping function I also want to monitor the voltage of one of the channels so every 2s I do a single point acquisition with no trigger.
Since I only have access to one item of DAQ hardware I have to share the channels between the two tasks by reconfiguring on the fly.
(sorry program is too large / complex to post)
Initialise channels and trigger (happens once at at start of program):
Get data every 100s:
Every 2s get a single multi-channel sample without trigger then reinstate trigger:
Please could someone explain when I should use the "start task", "stop task" and "commit" the help is quite vague and unfortunately I end up "hacking" until it works which isn't the way I like to work! I am using a USB 6211.
The program above works OK but has an intermittent (approx. every 10mins) error on the "stop task" before reinstating the trigger. (from memory the description was "DAQ task not finished")
Thanks
Al
Solved! Go to Solution.
09-24-2009 07:11 AM
Hi Al1234,
So you wanted to be able to reconfigure DAQ on the fly?
I have found an interesting post that may be of some help: http://zone.ni.com/devzone/cda/epd/p/id/5712
There is also a forum thread that may help: http://forums.ni.com/ni/board/message?board.id=250&message.id=48174&requireLogin=False
What version of LabVIEW do you have? (Base, Professional etc..) I ask because this example uses event structures which are not usable in some versions.
Does this help at all? I'd be happy to answer some more questions if you have any.
Thanks,
09-24-2009 07:59 AM
You can create many different tasks uisng the same hardware but you just can't run more than one at a time.
So restructure your code so you only create each of the tasks once then start and stop those when you need.
Ben
09-24-2009 08:08 AM
09-24-2009 08:17 AM
Al1234 wrote:
...Then this task is stopped and the original task is reconfigured....
Al
You only have to configure it once and just start and stop the task.
I am a visual sorta guy so more images will help us help you.
Ben
09-24-2009 08:26 AM
09-24-2009 10:03 AM
09-24-2009 10:07 AM
Al1234 wrote:
I hadn't initialised separate tasks correctly for each operation. It now works perfectly!
I don't like using MAX for this so they're all done explicitly in code during the initialisation
Thanks
Al
Good!
Same here. By doing it in code I know when I backup my code and move it to another machine it will work. Depending on MAX....
I have read that we can include MAX in our projects but I have not tread that path yet.
Ben
09-25-2009 02:56 AM
I'm glad you got your application working ok.
Kind Regards,