Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

DAQmx task example

Does anybody have an example of using a task in DAQmx (I’m in LV7.0) to do simple analog input?
When deploying a built application including a DAQmx task how do you copy it to the target machine?
Yours Sincerely
John Brohan www.TradersMicro.com
0 Kudos
Message 1 of 9
(4,600 Views)
Hello Jbrohan,

LabVIEW comes with shipping examples for the task you are trying to accomplish. Check in Help->Find examples and search for Hardware input/output->DAQmx and you should have many examples.
When you build an exe from your VI, you can choose to add and installer and in that case, the installer will take care of installing the application in the target machine. the following links to a knowledgebase entry that could answer most of your questions regarding building executable. Our developper exchange also has very good answers to most questions.

Serges L.
Message 2 of 9
(4,572 Views)
Sorry forgot the link: http://digital.ni.com/public.nsf/websearch/643587ADF69756DF86256B4D00720DC6?OpenDocument

Serges L.
0 Kudos
Message 3 of 9
(4,572 Views)
Hello Sergesl
Thank you for your helpful message!

It's true that there are many examples, but when I open the DAQmx Measure Voltage.llb the names all appear truncated on the left and it's hard to choose an easy one which will focus on getting the DAQmx working in the simplest manner possible.

I looked at several and found none which used a task, they all used the DAQmx create channel.vi or equivalent, starting from somewhere other than a task. The documentation about DAQmx emphasizes the use of MAX to make tasks. It's early days for me with DAQmx so I don't know who is right!!

I use two machines to do my testing, and I'd like to be able to move the task from the development to the target machine. "Export" does not seem to do this, since the tasks do not appear in the drop down list of a task constant. A quick search could not locate where these tasks are stored, nor how strongly they are bound to a particular ADC board! I really do not want customers working with MAX , or should I ?

Yours Sincerely
John
0 Kudos
Message 4 of 9
(4,568 Views)
Hello Jbrohan,

As I understand, you are building VIs for customers and you are wondering if it is better to create a task in MAX and use it in LabVIEW or if it is better to just create the virtual channel in LabVIEW. The answer is that it is easier to create the task in MAX and refer to is in LabVIEW using the task constant. However, if you do not want your customers to use MAX, then I strongly advise you to create virtual channels in LabVIEW just like the examples show, so that the customer would be able to select the hardware being used and change some of the task settings. If you do want to create your task in MAX, you can do so and it will automatically show up in LabVIEW in the task constant or control drop down list. The task constant is the first thing that shows up in the DAQmx palette. If you drop it on the block diagram and click on the drop down arrow, you should be able to see all the tasks that you created in MAX, start them and acquire data just like the once that are created directly in LabVIEW.

Serges L.
Message 5 of 9
(4,551 Views)
Thanks Sergesl
This is useful information, and I appreciate your kindness in replying promptly too!
Yours SIncerely
John
0 Kudos
Message 6 of 9
(4,545 Views)
I want to clarify a point regarding one of the questions posted:

****
I looked at several and found none which used a task, they all used the DAQmx create channel.vi or equivalent, starting from somewhere other than a task. The documentation about DAQmx emphasizes the use of MAX to make tasks. It's early days for me with DAQmx so I don't know who is right!!
****

Tasks are essential to a DAQmx operation. As Serges pointed out, you can create global tasks in MAX, or local tasks in LabVIEW. In the examples where DAQmx Create Virtual Channel.vi is called first, that VI is actually implicitly calling DAQmx Create Task.vi. So, even those examples that you saw are actually creating local tasks. Then the subsequent DAQmx Timing.vi and DAQmx Triggering.vi are simply modifying different aspects of that task.
Message 7 of 9
(4,503 Views)
Apart from making the code more clear, is there any performance gain in using Tasks created in Max compared to task created in LabVIEW?

Thanks,

Hernan
0 Kudos
Message 8 of 9
(4,411 Views)

is there any performance gain in using Tasks created in Max compared to task created in LabVIEW?



No, the performance of a task will be the same regardless of whether it is created in MAX or LabVIEW, because inside the driver there is no difference between these types of tasks.

Good luck,
Joe
0 Kudos
Message 9 of 9
(4,392 Views)