08-19-2009 09:15 AM
Hello All,
I'm updating a DAQ program and am moving to virtual channels and tasks to define the DAQ. I figure I'd let MAX do the heavy lifting for configuring these items.
Anywho, in my VI I list the available tasks and virtual channels available for reference. You can select them and see a brief summary/description of what they are. From the control you can select Browse... to add new tasks or channels. I'd like to add the capability to edit existing tasks or channels. Again, I figure this is best done thru MAX. So I am looking for a way to invoke MAX from my VI and have it start in the task list or virtual channel list. Does anyone have suggestions on how to do this?
Cheers,
08-19-2009 09:35 AM
Reaper-
I have had a lot of good experiences in this area. Have you used projects before? If not try them out for this type of code solution. You can define tasks, channels and scales from project explorer exactly as you can in MAX (same interfaces) but they then are saved in the project and can ship with your application as *.aliases files. This seems to be the same as transfering a MAX configuration with the scope limited to the project so that other (outside the project's scope) MAX defined settings are not impacted.
In short- interface with DAQmx attributes from LV Project explorer and you won't need to call MAX directly at all
08-19-2009 09:36 AM - edited 08-19-2009 09:37 AM
If you're on Windows, MAX has a very tiny ActiveX interface. Meaning, it's not much. I haven't explored it much, but there's an example here. As far as I could tell, the ActiveX interface consists only of methods, and no properties.
If that doesn't do what you need, then an alternative you may wish to try is third-party automation tools. Some have ActiveX interfaces so you can call them from LabVIEW. I've used AutoIt successfully.
EDIT: Wasn't seeing all the available classes.
08-19-2009 09:46 AM
Thanks Jeff,
I am using a project definition for this app but have not explored creating tasks and channels within one. I don't have the need to predefine any tasks or channels as they will be completely user determined and changing a lot. Will this mechanism, via the project, allow the deployed app to modify existing channels ala the MAX dialog?
Cheers,
08-19-2009 10:06 AM
GReaper wrote:Thanks Jeff,
I am using a project definition for this app but have not explored creating tasks and channels within one. I don't have the need to predefine any tasks or channels as they will be completely user determined and changing a lot. Will this mechanism, via the project, allow the deployed app to modify existing channels ala the MAX dialog?
Cheers,
Nope, this method only works from project explorer.
HOWEVER, as I am understanding, you want the user to be able to dynamically define tasks at run time. Correct?
If so, there are all the tools you need (except for a UI) on the DAQmx>Advanced> subpallates "System setup" and "DAQmx Constants & Property nodes". The functions there will programatically define DAQmx objects and permit them to be created, saved, changed or deleted from the system (you can see the changes with MAX)