I've tried to find a solution in the existing topics, but could unfortunately not find a fitting solution.
I use a USB 6008 to read out a voltage on ai0. When I run the VI with the USB device connected at my development pc it works fine (DAQ assistant was used to read out the value on ai0). After making an executable on my development pc this also works. However, when I move the executable to the computer on which I want to use it it doesn't read out the voltage. If I startup NI Max I notice that the computer is able to read the value, so physically everything should be fine. To me it seems like some link/connection is missing in the software. Does anyone know what can be missing/faulty in my executable?
NI DAQmx is installed on the computer on which it should run.
Solved! Go to Solution.
Is the device and channel named the same way on the deployment PC as it was on your development PC? Show the MAX screen on each PC and compare.
You should really avoid "hard-coding" device info into your applications. Make your code dynamic, search for the USB-6008 device, and if it is present on the actual PC, get its actual DEV number and use it for your code! Something like this:
Thanks for the solutions!
The first one worked for me as the quick and dirty solution to get things working. Thanks!
I'll look into the nicer programming solution as well for my learnings, thanks!
I like the programming version. How is this done if you would like to collect data from multiple channels? I know how to do it through MAX but am trying to improve my coding.
There's a wonderful White Paper called "Learn 10 Functions in NI-DAQmx ..." (the rest is something like "and handle 90% of your tasks"). Search for the phrase I mentioned on the Web. There are simple VIs to do exactly what you want shown there.
That is a good read and I am putting it in my binder of go to references. Unfortunatly it did not answer how to do what Blokk did but with 2 AI channels triggered off of PFI0.
Anyone else know? Blokk?
Ill keep digging. . .
See the middle of my snippet. It is obvious, just create another CHx string as required for your experiment...
edit: try to put together a VI which will automatically get the dev indexes using a serial number or model name, then creating the Physical channel "descriptors", like this:
Yes I figured it was something like that but I was unsure what to do with it after that. In the case you provided Should I then have 2 DAQmx Create Channels within the case statement? I'll try it tomorrow.
What I found was if you modify your Concatenate string to include ai0:4 it will scan AI0 through AI4. This works and I have both signals, however I want to apply a scale to just one of them. I'd like to use the DAQmx Create scale I am going to continue to tinker.
I should also let it be known that I am trying to trigger both AI0 and AI1 off of PFI0.
Thanks for all the help. This forum is great.
Of course you can use 2 or more Create Channels function, and use the same task wire between them. Imagine, you need to use a cDAQ with a voltage and a thermocouple module: one Create virtual channel you specify for voltage, the other for temperature measurement. Using the same task wire, and later a single Read DAQmx function will give you both measurements...
Read that DAQmx reference paper through...