Visual Basic (Declaration) | |
---|---|
Public Overloads Shared Function Create( _ ByVal startNewCopy As Boolean, _ ByVal version As String, _ ByVal hostName As String, _ ByVal portNumber As Integer, _ ByVal secondsToWait As Integer _ ) As Application |
C# | |
---|---|
public static Application Create( bool startNewCopy, string version, string hostName, int portNumber, int secondsToWait ) |
C++/CLI | |
---|---|
public: static Application^ Create( bool startNewCopy, String^ version, String^ hostName, int portNumber, int secondsToWait ) |
Parameters
- startNewCopy
- If false, attempts to connect to an already-running instance of Agilent 89600 VSA software. If true, attempts to start a new instance. Note that this method will wait indefinitely for the new application to start. If you wish to specify a maximum time to wait, see the Create(Boolean,String,String,Int32,Int32) overload.
- version
Specifies the version string of the version to start. This string is of the form nn.n[_Modifier], where "n" is a single digit and "_Modifier" is an optional modifier used for special releases (i.e. "_Beta2").
If null or the empty string is specified, the latest available version is used. If a non-null string is specified and the requested version is not installed, a System.ArgumentException is raised. This parameter is ignored if startNewCopy is false.
You can find the version string from a currently running VSA by opening the About dialog (Help > About).
- hostName
- The hostname is currently restricted to the name of the host on which the calling application is running, or the value 'localhost'. If this parameter is null or the empty string, 'localhost' is assumed. It is currently not possible to programmatically connect to or start an instance of Keysight 89600 VSA software on a remote computer.
- portNumber
- The TCP port number to use for the connection. If set to a value less than 0, the first available port number greater than or equal to 60189 is used. If startNewCopy is false, there must already be a running instance of Keysight 89600 VSA. If startNewCopy is true, the specified port number must not already be in use. If it is, an System.ArgumentException is thrown.
- secondsToWait
- This parameter specifies the number of seconds to wait for a new instance of Keysight 89600 VSA software to start. A number less than or equal to 0 specifies to wait indefinitely. If the new instance of the application does not start within the stipulated time this function will return null.
Return Value
A handle to an Application object, or null if startNewCopy is false and no instances are running.Exception | Description |
---|---|
System.ArgumentException | Is raised if an explicitly requested version is not installed. |
System.ArgumentException | Is raised if an explicitly requested port number is already in use and a new instance of Keysight 89600 VSA is being started. |
.NET 6+ note: ApplicationFactory.Create behaves slightly differently than described here. See the intellisense help or the .NET 6+ Nuget Packages topic in the .NET Reference.
If startNewCopy is false, an instance that is listening at the indicated port number must already be running. If portNumber is less than 0, the default the returned instance is the one with the lowest port number. If startNewCopy is true, there must not already be an instance listening at the indicated port number.
On a 64-bit version of Windows, the Create() method will return a reference to the 64-bit version of the VSA when the version of the Agilent.SA.Vsa.VsaInterfaces assembly referenced by your program is 15.00 or later. When your program references an earlier version, the 32-bit version of the VSA is the default.
You can change the default by setting the Utilities > Startup Preferences > Programmatic Startup parameter. You can also specify whether to get a handle to a 32-bit or 64-bit instance by using the other overloads of the Create() method.
Target Platforms: Windows 11 Professional or Enterprise; Windows 10 Professional, Enterprise, or Education (64-bit)