06-18-2015 08:10 PM
I am writing a labview application to be installed on a PC as an executable file with the Labview Engine. I can put my DAQmx tasks in my project or NI Max. If I put them in my project and I build my application, do I lose the ability to change the IO settings in NI Max independent of my application?
What is the best way to mechanize this with all the features of things like DAQmx tasks being created in my project rather than NI MAX?
06-18-2015 09:16 PM
I'm not certain, but I suspect that the Task constants that you wire to a DAQmx function, whether they come from MAX or from the Project, will remain "constant" when built into an Executable. What I would be tempted to try is to use the Task and wire it to the appropriate Property Nodes to programmatically change the (hopefully few) parameters that might need to vary.
As for MAX vs Project for setting the Tasks, my preference is for Project. I'm not sure that there are compelling reasons for one over the other, but Project feels more "natural" to me. Maybe someone else will respond with a strong reason for one choice or the other ...
BS
06-19-2015 04:05 PM
Hi there,
As Bob says, the best way to do this is to create a DAQmx task using the DAQmx VIs, in that way you always is going be capable to change the channels settings using controls in the front panel of your application.
Here is a link with more information about it :
http://www.ni.com/product-documentation/5434/en/
Regards
06-19-2015 09:48 PM - edited 06-19-2015 09:57 PM
@id wrote:
I am writing a labview application to be installed on a PC as an executable file with the Labview Engine. I can put my DAQmx tasks in my project or NI Max. If I put them in my project and I build my application, do I lose the ability to change the IO settings in NI Max independent of my application?
What is the best way to mechanize this with all the features of things like DAQmx tasks being created in my project rather than NI MAX?
First. Yes persaisting the DAQmx features to the project removes them from MAX. You will not be able to run them or modifiy them from MAX but only within the Project Context.
This is not always BAD. For instance, no one can "Fat Finger" your configuration or install another Task with the same name that uses different settings. Using the Project provides a context boundary wheras MAX is universally accessable.
Using the Project to store "Tasks, Scales, etc" DOES NOT remove the ability to modify them though. Tasks stored in projects built into an EXEs wind up deployed as a text file in the exes support directory (Exe\Support\NI DAQ\<Something.txt> This is a human readable configuration file that has the tasks settings in it. If you need to change a setting (like increase a sample rate or change a physical channel) you can edit the file and the exe will use the new settings.
This is not always GOOD For instance, if the test system suffers a fault, MAX cannot selectively control the IO channels for troubleshooting.
Knowing the pros and cons of each method will help you work within your team to develop the best approach for your needs. I've recommended each approach to various clients. (And been right both ways!)
What I've never recommended is creating tasks programatically. However, I can see some use cases where hiding the configuration from everyone (on a removed BD) might be desired in a highly regulated enviornment where a possible change to a Task Property Could change code validation and the ECO process requires removing any possible "Hidden" access to the config files (Although a hash on the EXE folder could be used to disable testing)
06-20-2015 09:49 AM
Creating a task programmatically doesn't equate to hiding the configurations on a removed Block Diagram. I generally create tasks programmatically. If I want something to be able to be modified, I just pop a control on the Front Panel and it's easy for the user to change what's meant to be changed. This is no more of an abstraction than "hiding" the configuration in a text file that most users will never take a look at.
06-20-2015 10:15 AM
06-20-2015 10:22 AM
@Dennis_Knutson wrote:
It's also like to mention that I find it extremely irritating when someone posts a data acquisition question and the setup is done in MAX or the project. It makes it harder to help when all that is posted is the VI.
Agreed. For those posts I would generally ask the poster to "Generate Code... Configuration and example" off the right click to expose the properties. Easy enough to work around
08-23-2016 01:25 AM
to throw in my two pennies worth of opinion:
If you need to recalibrate any inputs, in-LabVIEW task definition can make changing of scales rather cumbersome. Whereas, if tasks are defined in MAX, calibration can be run and tested individually.
Michael