VirtualPcanGatewayStatus

This parameter is used to obtain the running status of the System service that is part of the Virtual PCAN-Gateway solution. This service works together with the device driver PCAN-LAN. Both make the interaction with PCAN-LAN hardware possible (PCAN-Gateway Ethernet/Wireless) by using the PCAN environment under Windows.

This parameter can be used to ensure that the Virtual PCAN-Gateway communication is working.

  Caution

The Virtual PCAN-Gateway product is available only for Windows systems. It is not supported under Linux.

Availability

It is available since PCAN-Basic version 4.1.0.

Supported By

  • None: The status of the service is not tied to any Channel connection, i.e. no specific Channel can be used for this query.

Access Mode

This parameter can only be read. It cannot be modified.

Possible Values

The information about a service status is returned as a numeric “flag” value, that matches the type ServiceStatus.

Important: The retrieved value must be converted to the ServiceStatus type. Example (C#): ServiceStatus status = (ServiceStatus)uintBuffer;

Default Value

Does not apply.

Initialization Status

Get: Not relevant since this parameter is not Channel dependent.

Example

The following code shows how to retrieve the status of the Virtual PCAN-Gateway service:

C#
uint serviceState;

if (Api.GetValue(PcanChannel.None, PcanParameter.VirtualPcanGatewayStatus, out serviceState) == PcanStatus.OK)
{
    ServiceStatus status = (ServiceStatus)serviceState;
    Console.WriteLine($"PCAN-LAN service status: {status}");
}
else
    Console.WriteLine("Error retrieving the status of the Virtual PCAN-Gateway service.");

See Also