NISysCfgInitializeSession

NI System Configuration 18.0 Function Reference for LabWindows/CVI

Edition Date: May 2018

Part Number: 373242M-01

»View Product Info
Download Help (Windows Only)

NISysCfgStatus NISysCfgInitializeSession( const char targetName[], const char username[], const char password[], NISysCfgLocale language, NISysCfgBool forcePropertyRefresh, unsigned int connectTimeoutMsec, NISysCfgEnumExpertHandle * expertEnumHandle, NISysCfgSessionHandle * sessionHandle );

Purpose

Initializes a system configuration session with a specific system. You must use this function to obtain a handle for a specified target that can be used in other System Configuration functions.

This function communicates to the device at the specified address. If the device is no longer online, but it has previously been discovered in Measurement & Automation Explorer (MAX), this function succeeds, allowing you to retrieve cached information about the device. To determine if a Real-Time target is online, use the NISysCfgGetSystemProperty function to return System Status.

Parameters

Input
Name Type Description
targetName const char [] Specifies the IP address (ex. "224.102.13.24" ), MAC address (ex. "00:80:12:34:56:AB" ), or DNS name (ex. "myhost" ) of the target on a local or Real-Time system. The target defaults to the local system. Values such as a NULL pointer, an empty string, and the strings localhost or 127.0.0.1 also mean the local system.
username const char [] Specifies the username for the system you are initializing. Leave this parameter NULL if your target is running LabWindows/CVI 2009 Real-Time Module or earlier or if you are connecting to the local system.
password const char [] Specifies the password for the system you are initializing. Leave this parameter NULL if no password has been set or if you are connecting to the local system.
language NISysCfgLocale Specifies the language.

Automatic

(default) Automatically chooses the language based on local Windows settings.

English

English

French

French

German

German

Japanese

Japanese

Korean

Korean

Chinese Simplified

Simplified Chinese

forcePropertyRefresh NISysCfgBool Forces properties to be refreshed every time they are read by default. If FALSE, properties are queried once and cached in memory, which can optimize performance.
connectTimeoutMsec unsigned int Specifies the time, in milliseconds, that the function waits before the operation times out. When the operation succeeds, the session handle that is returned is set to the default NISYSCFG_REMOTE_DEFAULT_TIMEOUT_MSEC, which is defined as 300000 (5 minutes) in nisyscfg.h. Call NISysCfgSetRemoteTimeout to change the default connection timeout for subsequent operations.
Output
Name Type Description
expertEnumHandle NISysCfgEnumExpertHandle * A handle to NI products and drivers on the system that can interact with the System Configuration functions.

Call NISysCfgNextExpertInfo to obtain information about each expert.

When it is no longer needed, this handle must be discarded using NISysCfgCloseHandle. This parameter can be NULL if you do not need this information.
sessionHandle NISysCfgSessionHandle * Returns a handle for the system configuration session for the system.

When it is no longer needed, this handle must be discarded using NISysCfgCloseHandle.

Return Value

Name Type Description
returnValue NISysCfgStatus The error code returned by the function in the event of an error or warning. A value of 0 indicates success. A positive value indicates a warning. A negative value indicates an error. Refer to Status Codes or nisyscfg_errors.h for details regarding error codes.

WAS THIS ARTICLE HELPFUL?

Not Helpful