NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Programmatic Selection of " Run on Remote Computer "

Is there any way in the teststand to select the  " Run on Remote PC " and set the Remote Host name Programmactically
 
Manually we can set that options , when you click the Step Settings, click on the Module tab, then click on the Labview Advanced Settings, there is are options for running a VI on a remote PC.But i am looking for the programmatic selection and setting of remote host name.
 
Please let me know if any one knows. Yours inputs are highly valuable.
0 Kudos
Message 1 of 17
(5,329 Views)
Hey Prithivi,
 
What version of TestStand are you using?  In 4.0 you can just choose the option Specify Expression for Host.  I'm attaching a picture of this.  Then in the Remote Host box just put the variable that stores the host.  For instance you can put Locals.MyHost  where MyHost is a local variable of type string.  In your sequence somewhere you can change Locals.MyHost to whatever host you want. 
 
Hope this helps some,
jigg
CTA, CLA
testeract.com
~Will work for kudos and/or BBQ~
0 Kudos
Message 2 of 17
(5,314 Views)

Dear Friend,

Thanks for your reply. You are right . But even without opening the Advanced settings from the Module settings, we need to set the remote host name and Remote VI Path programatically .I hope we can achieve this with Teststand API calls. Let us share if we have any idea.

 

0 Kudos
Message 3 of 17
(5,269 Views)

Hey Prithivi,

You would just need to change the Local variables to the correct path and host dynamically.  You can do it in a pre-expression for the step.  You do not need to go through the API to change the Local variables.  Then when the step goes to execute on remote host it will just look and see what's in that variable. 

Regards,

jigg
CTA, CLA
testeract.com
~Will work for kudos and/or BBQ~
0 Kudos
Message 4 of 17
(5,258 Views)
Dear Jigg,
 
When the step is already selected as " Run in Remote Computer" , then what you said is correct. But we need to programmatically set whether the step is running in local or remote & as i said remote host name and path.
 
For example, let us assume , we have configured the Labview adapter module step as running in local . Here based on the user option, we need to programmatically configure the step to run in remote PC or Local PC.I think in this case what you suggested will not work.Am i right?
 
Thanks
Prithivi
0 Kudos
Message 5 of 17
(5,255 Views)
unless you point the remote host to be the local computer. 
 
I'll have to look into changing that check box programatically.  I'm not sure about that.
jigg
CTA, CLA
testeract.com
~Will work for kudos and/or BBQ~
0 Kudos
Message 6 of 17
(5,252 Views)
Step.TS.SData.ViCall.RemoteHost = my remote host
Step.TS.SData.ViCall.RemoteVIPath = my remote path
 
Setting these properties will automatically check the Run VI on a Remote Computer. 
jigg
CTA, CLA
testeract.com
~Will work for kudos and/or BBQ~
0 Kudos
Message 7 of 17
(5,251 Views)

Thanks Jigg,

Instead of using SData , we can use the step.Module. This is recommended by NI. Since Sdata is the hidden properties.Thanks for your valuable help.

I have one more question .

 Is is possible to read the complete path of the labview module assigned in the step? When the user selects relative path in the select VI dialog prompt.

we can read this by Step.Module.AsLabVIEWModule.VIPath . But if we selcets as a relative path , then it is giving only the name of the VI. But Is it possible to read the complete path of the VI?

Your inputs are highly valuable.

 

 

0 Kudos
Message 8 of 17
(5,212 Views)
Hi Prithivi,
 
I'm not sure whether you can read in the complete path of the labview module easily, but here's a simple workaround:

Since the relative path is always relative to the sequence file's path, you can simply prefix the sequence file's path to the relative path.
For instance, you can use:
Locals.Path = RunState.SequenceFile.Path + Step.Module.AsLabVIEWModule.VIPath
 
Hope this helps!
Jervin Justin
NI TestStand Product Manager
0 Kudos
Message 9 of 17
(5,186 Views)

Hi Prithivi,

I just realized that the path doesn't have to be relative to the Sequence File, but can be relative to any of the Search Paths that you have.

What you can do instead is use the FindFile Method in TestStand. This method will search the Search Paths for a file or relative path that you specify, and you can configure it to also look at the current Sequence File's path.

For example:
RunState.Engine.FindFile(Step.Module.AsLabVIEWModule.VIPath, Locals.Path, False, FindFile_PromptHonorUserPreference, FindFile_AddDirToSrchList_Ask, False, RunState.SequenceFile)

This will looks at the current Sequence File's path and your Search Paths for the Relative Path and store the resulting full path in Locals.Path.

Sorry for the confusion, hope this helps!

Jervin Justin
NI TestStand Product Manager
Message 10 of 17
(5,175 Views)