NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Saving User Config file

Solved!
Go to solution

Hi

 

Im using teststand 2010.

Im busy with a sequence that reads volts from an Agilent HP Multimeter.

The user selectes the com port for communication.

How can i save this com port selection so that the next time the user enters this sequences it automatically connects using the save com port?

 

 

Help share your knowlegde
0 Kudos
Message 1 of 9
(4,210 Views)

Has any body done something like this before?

Help share your knowlegde
0 Kudos
Message 2 of 9
(4,168 Views)

Hello Shako,

 

There are many different ways to accomplish this task.  First you will want to create a station global variable to hold the information on the COM port as a preferred connection.  I would drop an if statement from the flow control step types within TestStand (TS). Place the if statement at beginning of the main sequence to check to see if the COM port variable (the previously mentioned station global variable) is not empty.  If this variable is empty, ask the user for which COM port to connect to usint a message pop-up and store this information in the station global variable you previously created.  You will have to navigate the variables pane to find the location of this user entered information.  However, if you use a message pop up, the information should be stored in Step.Result.  Else if the station global variable does have a chosen COM port stored in the station global variable, then either prompt the user to verify the COM port that was previous selected or connect to the COM port automatically, without prompting the user.

 

I hope that helps!

 

Regards,

Shawn S. | NIC
Instrument Driver/IVI PSE
National Instruments
0 Kudos
Message 3 of 9
(4,162 Views)

The method I use is pretty involved and causes you to modify the process model.

 

Basically you create a configuration entry point in the process model.  Then inside of there I put a call to a callback I created called Configuration Settings.  Doing this will then allow you to have a menu item under configuration.  The reason I like doing the callback method is because then you can override it with ANY sequence file to get customized behavior.

 

Now in your sequence file you override the callback and inside of there put a VI or module that displays the settings to the user (in your case it would be a list of com ports).  On the front panel you can also have a Save button and a Cancel button.  If they hit Save you write the values to a file.  If they hit Cancel you don't write the values.

 

Then during execution at the beginning of your MainSequence you read in the file they saved during the configuration settings and populate some Locals or FileGlobals with the correct values. 

 

This way the users only configure when they've changed out an instrument or something like that.

jigg
CTA, CLA
testeract.com
~Will work for kudos and/or BBQ~
0 Kudos
Message 4 of 9
(4,155 Views)

Sounds interesting.

Could you please upload an example for me?

 

Help share your knowlegde
0 Kudos
Message 5 of 9
(4,125 Views)
Solution
Accepted by topic author Shako

Let me know if you have any questions.

jigg
CTA, CLA
testeract.com
~Will work for kudos and/or BBQ~
0 Kudos
Message 6 of 9
(4,112 Views)

Can you convert for version 4.2 please?

 

 

Tnx! 

0 Kudos
Message 7 of 9
(4,061 Views)

Sorry for the late reply.

 

Thanks man this work like a dream.

And you can save any value.

 

Help share your knowlegde
0 Kudos
Message 8 of 9
(4,048 Views)

Here it is in TS 4.0.x. I didn't test it so hopefully it works.

jigg
CTA, CLA
testeract.com
~Will work for kudos and/or BBQ~
0 Kudos
Message 9 of 9
(4,023 Views)