LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

DAQ reconfiguring trigger on the fly

Solved!
Go to solution
 

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):

initialise channels and trigger

 

Get data every 100s:

get data

 

Every 2s get a single multi-channel sample without trigger then reinstate trigger:

Get a single 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

Message Edited by Al1234 on 09-23-2009 10:01 AM
0 Kudos
Message 1 of 9
(3,174 Views)

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,

Owen.S
Applications Engineer
National Instruments
0 Kudos
Message 2 of 9
(3,146 Views)

 

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

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
Message 3 of 9
(3,140 Views)
yes the code is structured to do one thing at once.
The large data sample every 100s is done using a finite triggered sample. I wait until this is finished then the new task is configured every 2s and run. Then this task is stopped and the original task is reconfigured. At some point the triggered task doesn't release the hardware to allow reconfiguration causing the error.
Al
0 Kudos
Message 4 of 9
(3,134 Views)
Solution
Accepted by topic author Al1234

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

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
Message 5 of 9
(3,129 Views)
That might be the solution. I was reconfiguring parameters individually but I'll try it the proper way using tasks configured by MAX.
Thanks
Al
0 Kudos
Message 6 of 9
(3,126 Views)
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
0 Kudos
Message 7 of 9
(3,114 Views)

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

 

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
Message 8 of 9
(3,111 Views)

I'm glad you got your application working ok.

 

Kind Regards,

Owen.S
Applications Engineer
National Instruments
0 Kudos
Message 9 of 9
(3,090 Views)