From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Labview DAQ-mx task issue

Hi,

I created a series of DAQmx tasks for a USB-6525 DAQ, I created the tasks directly in my project explorer window (My computer ->New-> NIDAQ mx Task) and all the tasks are visible on the explorer.

Everything works OK when running my application, but when I create an .EXE or installer, all the tasks related actions are not working at all.

I'm running the exe and installer on the same development computer.

 

What is the correct procedure to create tasks in order for these to be included on my EXE or insteller?

 

Im using LabVIEW 2014.

 

Thanks.......

0 Kudos
Message 1 of 5
(2,311 Views)

I was about to say that I'm following the same procedure as you, and don't have this problem with Executables, but then I remembered that about 2-3 years ago, I had a similar issue where I was creating a somewhat complex DAQmx Task involving Scales, and had problems with both Tasks defined in MAX and Tasks defined in the Project.  Someone on the Forums suggested that I completely "byte the bullet" and use DAQmx functions to do everything, from creating the Task, choosing Channels, setting the Scales, and doing the Timing (and Triggering, when used).  Wasn't too bad, and (best of all) it worked!

 

However, I'm still surprised that you are having problems.  I've just been doing a small project using a USB-6002 to do some simple triggered pulse generation, and have defined the Tasks within the Project.  I haven't (yet) tried building an Executable, but I would expect it to work.  I'll try it out next week, if I can (assuming you haven't gotten this "solved" beforehand).

 

Bob Schor

0 Kudos
Message 2 of 5
(2,293 Views)

Hi Bob....

 

Thanks for your help.....

0 Kudos
Message 3 of 5
(2,267 Views)

Well, I built my Executable (specifying only the Top Level VI in the Build Spec as the Start-up), and it worked fine.  It will take me a little while to "unwind" this Test code from the rest of the Project, but I'll try to post it shortly. 

 

This is a Test routine, so it is pretty simple.  It has two Buttons -- Go and Stop.  The Block Diagram consists of an Event Loop and a Channel Message Handler (that's a Queued Message Handler with a Messenger Channel replacing the Queue).  The CMH Loop has the following States and Actions:

  • Init TrigPulse.  Generates the Triggered Pulse Task, an Analog Out Task that makes a TTL Pulse Train of 10 pulses at 50 Hz and pulls in a Project-defined DO Task.
  • Start Trigger.  Called by pushing "Go" button.  Loads Analog Waveform (waiting for PFI0 TTL Trigger), starts AO Task (still waiting, and goes to Do Pulses.
  • Wait Trigger.  Not used in this Test.
  • Do Pulses.  Raises PFI0 (starting AO Task) and goes to Wait Pulses.
  • Wait Pulses.  Waits 10 ms (so I can see Pulse on Oscilloscope), does Wait until Done on AO Task, stops AO Task, and adds another Delay (for monitoring purposes).
  • Close TrigPulse.  Called by pushing Stop button.  Stops AO, DO Tasks, exits Loop.

 

Routine starts by sending Init TrigPulse to the CMH.  Every time Go is pushed, the CMH does a Start Trigger -- Do Pulses -- Wait Pulses sequence.  When Stop is pushed, the Loop does Close TrigPulse and everyone stops.

 

Works the same in Development mode and as Executable.

 

Bob Schor

0 Kudos
Message 4 of 5
(2,241 Views)

Hmm.  Just reviewed this thread, and don't think it would be that helpful to post my simple test routine, which works (fortunately) as an Executable and in Development mode.  We're using different DAQ equipment, presumably setting it up slightly differently, etc.  Also, my code uses Channel Wires, which are not supported in LabVIEW 2014.

 

Can you make a very simple DAQmx Test routine (not unlike the simple Triggered Pulse routine I just described) that does one (or maybe two) functions that you need, and has relatively few VIs?  It would be instructive to see if it works in both Development and Application modes.  My guess is that it will work, which would imply that the problem isn't in building Executables, but something possibly slightly "wrong" in your code.

 

If you want us to look at your code and suggest where the problem might lie, you need to post your code.  Please do not post pictures of Block Diagrams -- we need to see the entire LabVIEW Project.  This is best done by compressing the folder that contains the Project and attaching the resulting .zip file.

 

Bob Schor

0 Kudos
Message 5 of 5
(2,233 Views)