09-22-2011 05:26 AM
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?
Solved! Go to Solution.
09-26-2011 01:41 AM
Has any body done something like this before?
09-26-2011 09:33 AM - edited 09-26-2011 09:35 AM
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!
09-26-2011 10:50 AM
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.
09-29-2011 02:36 AM
Sounds interesting.
Could you please upload an example for me?
09-29-2011 12:11 PM
Let me know if you have any questions.
10-04-2011 12:48 PM
Can you convert for version 4.2 please?
Tnx!
10-05-2011 01:22 AM
Sorry for the late reply.
Thanks man this work like a dream.
And you can save any value.
10-06-2011 02:02 PM
Here it is in TS 4.0.x. I didn't test it so hopefully it works.