NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Get remote caller machine hostname

Hello,

 

in my project I'm using remote calls to execute certain subsequences on a separate machine. I would like this machine to get info about the caller, namely its hostname. It's clear that I can use a parameter to pass this info but I wonder whether there's any native method to do that?

 

Thanks in advance!

 

0 Kudos
Message 1 of 4
(3,747 Views)

Hi endeavor,

 

 

Passing the name as a parameter is generally the recommended way of doing this. The section of the TestStand manual which discusses remote sequence execution (attached below) indicates that you must pass values to remote sequences as parameters in order to access them.

 

Executing Sequences Remotely: https://www.ni.com/docs/en-US/bundle/teststand/page/executing-sequences-remotely.html

Tom D.
Staff Software Engineer
NI
0 Kudos
Message 2 of 4
(3,720 Views)

Hi Tom,

 

thanks for your reply. My question actually comes from an assumption that TestStand Remote Engine should be aware of who calls it, so it would be quite natural to get this info from the Engine.

0 Kudos
Message 3 of 4
(3,689 Views)

Hi endeavor,

 

It's certainly possible for a computer running the TestStand engine to pull its own name with the TestStand API, using the ComputerName property (documentation linked below). Whether you are able to pull the name of a calling computer is a different story. It could be possible, but if so it will likely be done through some low-level functionality which may not be well-documented.

 

On the client machine, calls to the TestStand API will generally refer to the instance of the TestStand engine running on that machine. So, it's a question of whether there is any documented way of referring to the instance of the TestStand engine from the server machine. Have you tried playing around with the ComputerName property on the client machine?

 

Also, if there is any way that you can retrieve the server machine's IP address through a call made within the TestStand engine on the client machine, then you could ping the server machine to grab its computer name.

 

ComputerName Property (Read Only): https://www.ni.com/docs/en-US/bundle/teststand-api-reference/page/tsapiref/engine-computername.html

Tom D.
Staff Software Engineer
NI
0 Kudos
Message 4 of 4
(3,665 Views)