LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

I need some help with Program Using max

I wrote a program and in that program I create som tasks, everything worked out great until I put it on another machine. then everything went to pieces, I found the problem that when I Installed max on the test PC. that the card I used was setup as DEV1 and in My PC the card was DEV2 so everything is expecting to be at DEV2, How can I eitther setup my program so that is not neccassary or how can I programmaticall always make that device DEV 2 in max.

any help greatly appreciated.

Joe



Joe.
"NOTHING IS EVER EASY"
0 Kudos
Message 1 of 4
(2,691 Views)
Hello Joe,

Yes you can do this! When you export your configuration in MAX into a file from your PC, and then import this file into your Test machine, you don't have to change device numbers or anything - you are going to have the exact same configuration in your Test Machine than the one you had in your PC.

The steps below will tell you how to do this in Traditional and DAQmx:


To save Traditional NI-DAQ virtual channels:

Open MAX and go to Tools �Traditional NI-DAQ Configuration�Save Configuration As.

Save your current configuration to a file and close MAX.

Note: When you launch MAX, it searches for the name of the last active configuration file and uses that file as the new data source. Any changes you make in MAX are automatically saved to the file. Saving the configuration file also sets the new file as the active configuration file. So, if you do not want to use your saved configuration file the next time you open MAX, you can either change the active configuration file the next time you open MAX or simply rename the file you just saved. If you choose the second option, MAX will not find the last active configuration file and will create a new configuration file.


To use saved Traditional NI-DAQ virtual channels:

Open MAX and go to Tools�Traditional NI-DAQ Configuration �Set Active Configuration.

Browse to and select the saved file.

Note: When you set the active configuration to a saved file, remember that MAX will use that file as its new source until you use another configuration file or change the file name.


To save NI-DAQmx devices, tasks, and/or channels:

Select File�Export.

In the National Instruments Configuration Export Wizard window, select the location where you wish to save your file. If you do not use the default file name, you must type a name that ends in the .nce extension. If you wish to export all of MAX�s data, check the Export All Data box, click Next, and skip to step 5. Otherwise, click Next.

Select the tasks, global channels, and any other settings you wish to save.

Click Export.

A pane displays a report on the status of the export. This report may be edited and saved, but this is not required.

Click Finish.





To use saved NI-DAQmx devices, tasks and/or channels:



Select File�Import.

Type or browse the path to the directory containing the configuration file. Click Next.

An abbreviated configuration tree displays all devices, channels, and tasks saved in the configuration file. Click the check box next to each item you wish to import.

Click Import.

A pane displays a report on the status of the export. Type any edits to the report. Click Save Report when finished.

Click Finish.


Please let me know if I solved your question and if you have any additional questions.

Thanks,

LA
Message 2 of 4
(2,689 Views)
this will work for me now. But just a quick question, do you know how i could automate this inside labview.Or do you have any tips on how I could prvent this in the future.Thanks for the answer it was top notch and worked.


Joe



Joe.
"NOTHING IS EVER EASY"
0 Kudos
Message 3 of 4
(2,682 Views)
Hi Joe!

By the way, that was a great answer, LA! In response to your last post, Joe, you cannot automate this in LabVIEW. Even if there was a way to change the device number of your DAQ board in LabVIEW, you would have to tell it the original device number to gain access to it.

The reason for this is because often times there are multiple DAQ boards in a single computer. Because of this, there would be no way to autodetect which board your VI "wanted" to use. Like LA said, if you want to hardcode the device number into the VI, I would export the configuration to all the computers running the VI. However, you could make the device number a control that the user could change. This would enable the user to access multiple DAQ boards with the same VI. Also, this would allow for the VI to run properly no matter how the configuration is in MAX (provided that the user select the correct device number).

Hope this helps!

Travis H.
National Instruments
Travis H.
LabVIEW R&D
National Instruments
0 Kudos
Message 4 of 4
(2,674 Views)