LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

6501DAQMX digital line count wrong


hammer3 wrote:Besides, even if I did previously define tasks, shouldn't this vi overwrite and supercede previous setups?

Nope.  What that function does is add channels to the task.  So if you already have a task defined with a channel, you are just adding more channels to it.



There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
Message 11 of 16
(981 Views)

OK. How do I OBLITERATE all previously existing tasks and create a NEW one programmatically?

0 Kudos
Message 12 of 16
(975 Views)

The task input to DAQmx Create Channel is optional--if you leave it unwired a task will be implicitly created when you create a new channel.

 

 

Alternatively, you could use the DAQmx Create Task function to explicitly create a new task programmatically:

 

Context Help_2013-04-18_17-54-23.png

 

 

If you're not using global virtual channels, you would really only need to call DAQmx Create Task if you needed to turn off auto cleanup (in the oddball case where you are creating tasks from an asynchronously called subVI that leaves memory when your application is still running).  Or, perhaps you are creating channels inside a loop using a shift register and want to intialize the shift register with an empty task.  

 

Giving the task a descriptive name can also be useful for debugging purposes (e.g. using NI IO Trace) if you have multiple DAQmx tasks running at once.

 

 

Best Regards,

John Passiak
Message 13 of 16
(961 Views)

Thank you all for your inputs, but I still find it all quite confusing. Is there a document that fully describes DAQmx in its entirety rather than having to search through Help files, which requires having to ask the right questions? I gave up trying to use the lower level, more efficient vis and successfully used the DAQ Assistant.

0 Kudos
Message 14 of 16
(952 Views)

Other than the DAQmx Help, you might want to check out the article Learn 10 Functions in NI-DAQmx and Handle 80 Percent of Your Data Acquisition Applications, or refer to the shipping examples (From LabVIEW, Help>>Find Examples...>>Hardware Input and Output>>DAQmx).

 

At the end of the day, the DAQ Assistant isn't necessarily less efficient than the lower level API--it's just a bit less flexible.

 

 

Best Regards,

John Passiak
0 Kudos
Message 15 of 16
(946 Views)

Thank you MUCH for that article. That DOES cover a lot of important info.

0 Kudos
Message 16 of 16
(942 Views)