LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Labview Stand-Alone Application Error - DAQmx Tasks

Solved!
Go to solution

I built a stand-alone application from a VI file that uses DAQmx.  When I try to run the new .exe file on another laptop, it cannot find the DAQmx tasks that I created in MAX for the control box.  This laptop does not have labview; I want to be able to run the application on any laptop as a tool.  Please help.  Thanks.

0 Kudos
Message 1 of 7
(3,014 Views)

Hello krang

 

This is likely due to not including the DAQmx drivers in your build.  Here are the full instructions for accomplishing what you are trying to do!

 

Note: Does not work for RT
Note: In the Wizard you don’t have to add the DAQmx objects in the source files page it is done automatically
Note: You can also use simulated devices for this procedure
Note: This procedure assumes you have installed all software, hardware and licenses.

 

OVERVIEW

Create a project which contains a VI referencing MAX Tasks, Channels and Scales. Build an executable out of this VI. Then build an installer. In the installer specifications include your MAX hardware configuration (Option is on the advanced page). Also go to the "Additional Installers" page to check NI-DAQmx.

 

DAQmx

Hand Test Steps for Application:

1. Open "Measurements and Automation Explorer" (MAX)
2. Verify Hardware is installed correctly and working

LabVIEW

Hand Test Steps for Application:

  • Open LabVIEW
  • Open New Empty Project

"Create DAQmx Task"

  • Right click "My Computer" in Project Explorer
  • Select New DAQmx Task >> Acquire Signals >> Analog Input >> Voltage >> Device >> ai(X) >> click next
  • Name Task >> "My Task Name"
  • Cick "Finish"
  • Click "OK"

"Create DAQmx Channel"

  • Right click "My Computer" in Project Explorer
  • Select New DAQmx Channel>> Acquire Signals >> Analog Input >> Voltage >> Device >> ai(X) >> click next
  • Name Task >> "My Channel Name"
  • Cick "Finish"
  • DAQ Assistant window will appear; under the Configuration Tab >> Select the Custom Scaling Drop Down Box
  • Select "Create New"
  • Select "LINEAR"
  • Name Scale >> "My Scale Name"
  • Cick "Finish"
  • Click "OK"
  • Cick "Run" to verify you get data
  • Click "Stop" to stop the application
  • Click "OK"

"Create VI"

  • Right click "My Computer" in Project Explorer
  • Select New >> VI "This will open two labview windows; Front Panel and Block Diagram"
  • Drag the task, scale and channel from Project Explorer to the Front Panel.
  • Right click "My Task Name" in Front Panel and select >> Generate Code >> Example
  • Right click "My Channel Name" in Front Panel and select >> Generate Code >> Example
  • Go to the Block Diagram window and wire the >> "error out" of the "Task" to the "error in" of the "Channel"
  • Select File >> Save >> name the VI "My VI Name" >> Select "OK"
  • Run This VI to see if you get data by clicking on the white run arrow.

"Save Project"

  • From Project Explorer >> File Save >> Name the Project when asked. "My Procect Name"

"Build Executable"

  • Right click "Build Specifications" select New >> Application.EXE
  • In the My Application Properties select "Source Files" in the Category view
  • Under "Source Files" select "My VI" and click the right arrow to move your VI from "Project Files" to "Startup Files"
  • Click "Build"
  • Click "Done"

"Test Executable"

  • From Project Explorer >> Right click "My Application" >> Properties
  • Highlight the path listed under "Destination Directory"
  • Copy this path and paste it in the windows run command.
  • Click "OK"
  • Double Click "My Application.exe" This will open your LabVIEW VI.
  • Run This VI to see if you get data by clicking on the white run arrow.

"Build Installer"

  • From Project Explorer >> Right click "Build Specifications" >> New >> Installer
  • In the "My Installer Properties" select "Source Files" in the Category view
  • Under "Source Files" select "My Application" and click the right arrow to move your application files from "Project View" to "Destination View"
  • In the "My Installer Properties" select "Additional Installers" in the Category view
  • add the corresponding Installers to make a stand alone Installer
  • add the "NI-DAQmx MAX Configuration Support xx" before building.
  • Click "Build"
  • Click "Done"

"Test Installer"

  • From Project Explorer >> Right click "My Installer" >> Properties
  • Highlight the path listed under "Installer Destination"
  • Copy this path and paste it in the windows run command.
  • Click "OK"
  • Go back a level and copy the "My Installer" folder to a safe location.
  • -verify on a clean machine that you can properly install the installer, and that your DAQmx application properly runs.

Please let me know if I can be of any further assistance in this regard.  All the best!

Sincerely,

Greg S.
0 Kudos
Message 2 of 7
(2,926 Views)

Since the DAQmx tasks and channels were already created for the existing vi, I skipped through to the build instructions.  The executable worked fine, but when I tested the installer on another machine, I still got the DAC error code 200428.  I also made sure the DAQmx drivers were included in the build.  I'm not sure whether the existing DAQmx tasks were included in the project file.  The instructions you provided seem to apply to creating a new task for the project instead of using existing ones.  How could I check to make sure DAQmx tasks are included in the installer?

0 Kudos
Message 3 of 7
(2,908 Views)
Solution
Accepted by topic author krang

Hello krang

 

I am sorry the above was not helpful to you.

 

I believe the answer you are looking for is available in the following document under section "Building an NI-DAQmx Application Installer" Step 6.

 

Creating an NI-DAQmx Application Installer with LabVIEW
http://zone.ni.com/devzone/cda/tut/p/id/5406

 

I have also included some more documentation on the errror code you have received as well as some other documents for your interest.

 

NI-DAQmx Base Error -200428
http://digital.ni.com/public.nsf/allkb/7705D38D59EF562886256F79007E4B5A

Programmatic Saves of NI-DAQmx Tasks, Channels, and Scales Examples
http://sine.ni.com/devzone/cda/epd/p/id/1668

What is the Difference Between a Static and Dynamic Example for NI-DAQmx Base?
http://digital.ni.com/public.nsf/websearch/81BFABF907AD65D886256F9A00824FEF

 

Please let me know of your progress on this issue.

 

Thank you for choosing National Instruments!

Sincerely,

Greg S.
0 Kudos
Message 4 of 7
(2,899 Views)

Thank you, Greg.  The application now works.  You've been a big help.

Message 5 of 7
(2,884 Views)

Hello krang

 

No problem!  It was my pleasure!  Thank you for choosing National Instruments!

Sincerely,

Greg S.
0 Kudos
Message 6 of 7
(2,879 Views)

what was wrong in your setup?

0 Kudos
Message 7 of 7
(1,182 Views)