From 04:00 PM CDT – 08:00 PM CDT (09:00 PM UTC – 01:00 AM UTC) Tuesday, April 16, 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: 

Error in communicating with DAQmx when building executable in different folder on the same laptop

Solved!
Go to solution

Hi all, 

 

I've recently wrote a programme in LabView 8.0 32-bit using an NI-DAQmx (USB-6210) and then built the executable application in the same folder where all the subVIs and .lvproj files are and the executable runs smoothly (let's call it Folder 1). I plan to run the executable on different PCs as well, so I built a second executable in a different folder (Folder 2) (with a global network address for eg H:\) as I plan to later move that executable into the C:\ of the target deployment PC. 

 

However, when I try to run the executable in Folder 2  from my current PC, it doesn't work. After troubleshooting,

 

1) it looks like there seems to be a problem with communication with the DAQmx. When I wired an error indication, I get the error below:

 

Error -229771

DAQmx Create Channel (AI-Voltage-Basic).vi:1780001<append>
<B>Task-Name: </B>VoltageRead

 

2) I understand from similar problems on the forum regarding running executables on different PCs that it could be the NI MAX or Labview Run-Time configuration (I'm pretty sure I will run into that problem later on as well lol) But right now that shouldn't be the issue since I'm still using the development PC to attempt to run the build.

 

3) So far, I've tried building yet another executable with the same network address (C: ) ie the desktop and it works fine as well so I've concluded it's something to do with the different network address.

 

For info: the communication to DAQmx is the bog standard Create Channel > Create Task > Read etc. There's only one USB-6210 so I didn't put in all that 'Find Device first' property nodes....

 

Maybe someone has an idea how to overcome this? Thanks a lot in advance!

 

 

tl;dr:   Executable works fine when built in different folder locations within the same network address, but not when built in a different folder with a different network address despite executing from same laptop because there's a problem with the communication to the DAQmx

0 Kudos
Message 1 of 10
(2,682 Views)
Solution
Accepted by topic author nikvl

I did not quite understand what is network address (similar to local drive root path) while interfacing local USB device through DAQmx.

 

Can you give full text of the error and check the code, because your text does not match -229771 code 

https://knowledge.ni.com/KnowledgeArticleDetails?id=kA00Z000000P7a7SAC&l=en-US

 

If it works when you build into the same folder as project (never do it)... Do you have any dynamic VI references, not insluded into exe, some relative paths that point to the file in project folder? You can also copy all this folder (with project files) to see if location matters.

Can you post vi? Create task usually comes before create channel. 

PS what is windows and daqmx version?

0 Kudos
Message 2 of 10
(2,661 Views)

I did not quite understand what is network address (similar to local drive root path) while interfacing local USB device through DAQmx.

Sorry, it was a literal translation from german, but basically I'm trying to get the executable that I built in my local drive which is C: to work in another drive, which can be accessed by everyone else on the network (and then moving it again to a local drive of a different PC). I tried moving the entire project folder into it (both the global drive and the local drive of the other PC) but the build wouldn't work.

 

Can you give full text of the error and check the code, because your text does not match -229771 code 

https://knowledge.ni.com/KnowledgeArticleDetails?id=kA00Z000000P7a7SAC&l=en-US

huh, weird. I copied and pasted whatever was in the error box indicator. That article is useful though, and now I'm thinking it's a network security/permissions problem

 

If it works when you build into the same folder as project (never do it)...

yeah, it was just to test if an executable would work. It also works if I build the executable in a different folder as the project (i.e on Desktop)

 

Do you have any dynamic VI references, not insluded into exe, some relative paths that point to the file in project folder? You can also copy all this folder (with project files) to see if location matters.

No dynamic VI reference, actually no path references except when a button is clicked and the data is exported to an excel sheet but it shouldn't be affected since that comes later. I did try copying everything in the folder and dumping it into the global drive to try to build it there but it wasn't successful.

 

Can you post vi? Create task usually comes before create channel. 

I'm not allowed to. First the DAQ is initialised but doesn't start reading until I press a 'start measurement' button. Also, why would the Create Task come before Create Channel? I looked back at my code and realised I don't have a Create Task at all. I honestly can't say if that was a deliberate decision on my part or unconsciously after cobbling together all the tutorials and/or forum suggestions. The code works though and I've taken several measurement curves both in development mode and the executable. The problem now is trying to build an executable somewhere else.

 

PS what is windows and daqmx version?

windows 10, daqmx version 18.0 

 

As next step I'm attempting to bypass that global drive altogether and try to get the executable on the local drive of the target PC (windows 7) but then I'd have to run an Installer.....

0 Kudos
Message 3 of 10
(2,650 Views)
Solution
Accepted by topic author nikvl

According to this KB:

https://knowledge.ni.com/KnowledgeArticleDetails?id=kA00Z0000019KYUSA2

starting your exe from a network drive could be the reason for the DAQmx error you are mentioning.

 

--

 

BTW: DAQmx 18 and LabVIEW 8.0, that will not work! DAQmx 8.9 is the highest version that supports LabVIEW 8.0

 

Regards, Jens

Kudos are welcome...
0 Kudos
Message 4 of 10
(2,639 Views)

>> As next step I'm attempting to bypass that global drive altogether and try to get the executable on the local drive of the target PC (windows 7) but then I'd have to run an Installer.....

If you are running executable from different machine, you will need at least labVIEW run-time engine and DAQmx run-time anyway. Remote panels will allow you to control VI, running on one machine from another without LabVIEW on it (through browser). 

 

>> It also works if I build the executable in a different folder as the project (i.e on Desktop)

If you copy this compiled exe and accomanying data folder (if it is created during build) to another local place and exe would work, then it is network permissions problem. Have just tried running exe from shared folder from different machine, it is ok and it is using files next to exe.

 

PS:

Create channel makes a task if it is not provided. Create task is used in specific cases (copy another task, assign task name, multiple calls of Create Channel in a loop, etc)

>> windows 10, daqmx version 18.0 

And LabVIEW is probably 18, not 8 (as in original post 😃

0 Kudos
Message 5 of 10
(2,632 Views)

So after a lot of hand-wringing and figuratively smashing things, I managed to get it running on the target PC 🙂 

 

I didn't actually solve the network permissions problem but I'd only needed it to move the application.exe from the local drive of my pc to the local drive of another anyway.

 

So, it turns out I was dealing with multiple error sources (one of it being the network permissions). Even after running the Installer on the target PC I couldn't get the executable to run but I did get the correct error code this time. And @Alexander_Sobolev was right, I went back to my VI and I needed to place the Create Task before the Create Channel....so yay! 

 

I think it's something to do with the task configuration in NI-MAX, I initially used MAX to create task to configure my sensor reading and later in LabView my code called from it and it worked because the task already existed, whereas on the target PC it didn't. 

 

Thanks again to both of you! 🙂

 

p/s: yep, it was a typo haha, it's LabView 18.0 

 

p/s/s: It's not strictly necessary but the remote panel thing sounds interesting, can you elaborate? (Sorry I'm just a LabView and DAQmx beginner)

0 Kudos
Message 6 of 10
(2,623 Views)

Yes, if you use MAX task, you need to either have it on target PC also, or create in program. Create channel.vi will not work if you wire in invalid task. But will create its own if you do not wire task input.

 

You can start with help

http://zone.ni.com/reference/en-XX/help/371361R-01/lvconcepts/viewing_fp_remote/

Also check license issues if you need to distribute executable, publising front panels to different PCs. I believe their run-time is not free.

 

Message 7 of 10
(2,608 Views)

If you know that you're are deploying an exe with a DAQmx task.  Create the task in the source project.   The build will contain a folder called NI-DAQ with an ini file containing all the DAQmx settings.   The exe knows how to use that file.


"Should be" isn't "Is" -Jay
0 Kudos
Message 8 of 10
(2,603 Views)

@JÞB wrote:

If you know that you're are deploying an exe with a DAQmx task.  Create the task in the source project.   The build will contain a folder called NI-DAQ with an ini file containing all the DAQmx settings.   The exe knows how to use that file.


When you say 'create task in the source project' does that mean simply placing the Create Task vi in the block diagram? (I want to learn good programming habits and not leave something just so because it worked lol) I checked and the build doesn't have that NI-DAQ ini file. My target PC has MAX on it, albeit an older version and I used the installer to add any missing MAX configuration files.

0 Kudos
Message 9 of 10
(2,588 Views)

@nikvl wrote:

@JÞB wrote:

If you know that you're are deploying an exe with a DAQmx task.  Create the task in the source project.   The build will contain a folder called NI-DAQ with an ini file containing all the DAQmx settings.   The exe knows how to use that file.


When you say 'create task in the source project' does that mean simply placing the Create Task vi in the block diagram? (I want to learn good programming habits and not leave something just so because it worked lol) I checked and the build doesn't have that NI-DAQ ini file. My target PC has MAX on it, albeit an older version and I used the installer to add any missing MAX configuration files.


No, that means... from project explorer, select a target (like My Computer) and right click>>Add...>>DAQmx Task.  You can even skip DAQmx Create ...vi in your code and just wire a Task Constant of MyTask since the Task is defined in the .lvproj file.  Scales and other things can persist to a lvproj, lvlib or lvlibp too.  Exe builds create an ini file with all the settings in human readable format.  Bonus, if you need to, you can even edit that ini to adjust scales or channel settings without a recompile on the exes machine ( great for calibrating multiple stations )

 

Every time I say "persist the DAQmx stuff in the project." someone else says "but, I keep my stuff in a configuration file"  Well, so do I!  I just let NI format the file and test the writer, parser and installer build spec for me!


"Should be" isn't "Is" -Jay
0 Kudos
Message 10 of 10
(2,564 Views)