I've been making a program with DAQmx elements on a test rig. Program surly can't run on a PC without DAQ drivers and/or NI HW.
But sometimes I want to upgrade those programs (with DAQmx elements) form my office or from my home, where I do not have NI HW or/and DAQ drivers.
I've been solving this issue with Diagram Disabe Structure, disabling every DAQmx element in my code. Sometimes its a pain in the ass, because I have to build or remove those Diagram Disabe Structures everytime I transfer the program from test rig to office or vice versa.
Is there any other elegant solution for this?
Solved! Go to Solution.
Look at the conditional disable structure.
In your project file, you define a conditional symbol for that project. (Project tree, right click the top line, select properties, look for Conditional Symbols.) For example, you could name it "DAQ" and define it as DAQ = True or false.
In your code, you replace the regular diagram disable with the conditional diagram disable. For the code you have with DAQmx functions, put it in the DAQ==True case, and in the other default case, just pass the wires through.
This way, you only need to change the value of the conditional symbol in the project tree once, rather than hunting down all the disable structures and flipping them.
FWIW, another option is to install the DAQ drivers on your dev machine even without any DAQ hardware present. I frequently develop without hardware then deploy to a system with DAQ devices.
I do craploads of development without devices attached. Just install the DAQmx drivers (they're free) like Kevin said.
You can even create simulated DAQ devices in MAX to do some (limited) debugging without your hardware:
Note that analog devices will just return sine waves, digital data always "counts up", counter tasks return 0, etc. You can't actually simulate the data manually in real-time. The simulated devices WILL simulate timing though, which is great. To actually generate meaningful sample data, look into Hardware Abstraction Layers. It's a good bit of work to get going with a simulated DAQ data generator, so it might not be worth the effort, but it is doable. With this method, you could even dynamically load the classes at run-time. That way you would never even try to load the DAQ drivers, it would just load your simulated data generator (note: that's NOT the same thing as a simulated DAQ device in MAX.)