Connections

Connection related API functions.

GHS.ghs_connect(ip_address: int, port_num: int) str[source]

Establishes a connection to the mainframe.

Parameters
  • ip_address – IP address needs to be an IPV4 address.

  • port_num – TCP port number (currently defined as 8006).

Returns

  • GHSReturnValue - Connect return status.

GHS.ghs_disconnect() str[source]

Disconnects from a connected mainframe.

Results in error when the handle is not valid and / or mainframe is not connected.

Returns

  • GHSReturnValue - Disconnect return status.

GHS.ghs_get_client_api_version() int[source]

Client’s API version.

This function can be useful when ghs_connect() returns GHSReturnValue_APIMismatch.

Returns

  • CLIENT_API_VERSION - Version number of the client.

GHS.ghs_get_current_access() str[source]

Current access permission to the mainframe.

The current access permissions might change at any time. For example, when Perception connects concurrently to the same mainframe, write access is dropped for the connected GEN DAQ API client. If a concurrently connected Perception disconnects, write access is granted to the connected GEN DAQ API client. API functions that require write access will return WriteAccessBlocked in case this client currently has no write access.

Returns

  • GHSAccess - Access permission.