LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Edit a DAQmx Task within a compiled project

I have a project that runs compiled.  There is a specific piece of hardware that is custom that the project code is targetting.  The hardware needs to run on any 1 of 3 laptops at anytime (depending on what is available).  Therefore it is more convienant for me to have tthe DAQmx task that drives the hardware with the project files so that I do not have to maintain changes to this task on 3 seperate machines within MAX.

Two of my laptops have LabVIEW installed on them (as that is the limit of my licensing).  On those two, making changes to the task is trivial as I just open the project and double-click.  But now I want to compile the project so that I don't have any problems on my 3rd laptop.  Is there anyway to progmatically open the DAQ Assistant for the task that is compiled into the project so that I can make changes to the hardware without having to recompile?

Thanks!

-Nic
0 Kudos
Message 1 of 3
(3,888 Views)
Hello Nic,

You cannot programmatically open the DAQ Assistant in a VI, however there are many ways to deploy tasks and channels. This topic is discussed in the NI-DAQmx Help file (Start>>All Programs>>National Instruments>>NI-DAQ), in the section entitled "Deployment". I have copied some of the information from that topic below for your reference.


Deploying Tasks and Channels

Your tasks and channels deploy automatically with your application under the following circumstances:

  • You use LabVIEW Express VIs for your DAQ applications.
  • You save your tasks within a LabWindows/CVI or Measurement project, and the tasks use local channels only.
  • You create your tasks and channels programmatically using the NI-DAQmx API.

You must deploy your tasks and channels using the MAX Export Wizard if you create your tasks and channels in the following ways:

  • You create your tasks and channels directly in MAX.
  • You create your tasks and channels in LabVIEW from the Task Name and Channel Name controls and do not generate configuration code.
  • You create your tasks in LabWindows/CVI and neither generate configuration code nor copy the tasks to your project.



The important thing to keep in mind is how you are attempting to deploy your task. If you are using the first method described above where tasks and channels are deployed automatically, then you will need to programmatically change your task attributes using the NI-DAQmx palette in LabVIEW. You can add controls to these VIs to programmatically change all the properties that are set in the DAQ Assitant configuration window. For example, the "Timing Settings" section of the DAQ Assistant (shown below) allows you to configure the Acquisition Mode, number of Samples to Read, and the Rate in Hz.



These same parameters can be changed programmatically in LabVIEW using the Sample Clock instance of the DAQmx Timing.vi. As you can see from the description of the VI below, the samples per channel, sample mode and rate inputs to this VI address the same properties as the DAQ Assistant.



Finally, if you use the second method described in the help file where you explicitly export your NI-DAQmx tasks from MAX, then you can simply edit these tasks on your deployment machine in MAX. The tasks should be saved under Data Neighborhood in the section called NI-DAQmx Tasks. You should recognize the configuration window from the DAQ Assistant, as the interface  is very similar. I have posted an example interface from a task in MAX below.



Either of these methods should allow you to deploy your NI-DAQmx application on either a machine with LabVIEW or one without. Let us know if you have any other questions about deployment or need any additional help.


Message Edited by Matt A on 03-24-2008 01:01 PM

Matt Anderson

Hardware Services Marketing Manager
National Instruments
0 Kudos
Message 2 of 3
(3,868 Views)

Nic,

I did a project last year where all the DAQmx tasks were created programatically in the vi.  Settings for all the tasks are stored in an .ini file.  Easy to make adjustments and it works great.  No more worrying about deploying MAX settings and I don't have to rebuild my .exe every time.



Message Edited by centerbolt on 03-24-2008 02:51 PM
0 Kudos
Message 3 of 3
(3,861 Views)