Show/Hide Toolbars

Irinos Measurement System

Navigation: MscDll Reference Guide > API (programming interface) > Connection

MSC_GetDeviceState

Scroll Prev Top Next More

This function returns the communication status to the Irinos-System. It serves only as a diagnostic tool. For normal operation, it is not required. Its implementation is suggested in order to have extended diagnostic capabilities in case of communication problems.

 

Definition


MSC_STATUS

MSC_GetDeviceState(

    MSC_HANDLE Handle,

    unsigned long* LastMsgReceived,

    unsigned long* SndErrorCounter,

    unsigned long* RcvErrorCounter,

    unsigned long* CmdDiscarded,

    unsigned long* CmdDiscardedArray,

    unsigned long Flags

);

 

Parameter


Handle

Device-Handle, which has been returned by a previous call of the function MSC_OpenDevice.

LastMsgReceived

Returns the time since the reception of the last data frame.

SndErrorCounter

Returns the error counter of data frames, which could not be sent. The counter is set to 0 either by the function MSC_Start or if the flags value MSC_RESET_ERROR_COUNTERS is set.

RcvErrorCounter

Returns the error counter of data frames, which could not be received completely. The counter is set to 0 either by the function MSC_Start or if the flags value MSC_RESET_ERROR_COUNTERS is set.

CmdDiscarded

Returns a counter which is increased each time if an opcode is received which was not expected. This counter is the summary of the CmdDiscardedArray. The counters will be set to zero by the function MSC_Start or if the flags value MSC_RESET_DISCARDED_COUNTERS is set.

CmdDiscardedArray

Pointer to an user provided array of 256 unsigned long values. Each value contains the error counter for an opcode specified by index. The counters will be set to zero while function MSC_Start or if the flags value MSC_RESET_DISCARDED_COUNTERS is set.

Flags

Contains bitwise information for the MscDll. The flags may be combined.

MSC_RESET_ERROR_COUNTERS
This bit clears the send- and receive error counter.

MSC_RESET_DISCARDED_COUNTERS
This bit clears the counter for invalid telegrams.

 

Return value


If successful, MSC_STATUS_SUCCESS will be returned. In case of an error, an error code will be returned.

 

See also


MSC_OpenDevice

MSC_Start