FB_BangOlufsenGetClientConnectionState

FB_BangOlufsenGetClientConnectionState 1:

Reads the status of the Ethernet connection between the Masterlink Gateway and the TwinCAT Bang & Olufsen Server.

Examples

Download demo project

VAR_INPUT

sNetId           : T_AmsNetId;
sMLGWClientName  : STRING(80);
bExecute         : BOOL;
tTimeout         : TIME := t#5s;

sNetId: AMS Net ID of the target device on which the TwinCAT Bang & Olufsen Server is operated.

sMLGWClientName: Name of the Masterlink Gateway Client whose connection status is to be read.

bExecute: The command is triggered by a rising edge at this input.

tTimeout: Indicates the time before the function is cancelled.

FB_BangOlufsenGetClientConnectionState 2:

sMLGWClientName convention

  • Upper/lower case is ignored
  • Letters and numbers
  • No special characters or umlauts, except “_” (underscore)
  • Minimum length 1 character
  • Maximum length 80 characters

VAR_OUTPUT

bBusy                       : BOOL;
bError                      : BOOL;
udiErrorId                  : UDINT;
eMLGWClientConnectionState  : E_MLGWClientConnectionState;

bBusy: This output remains TRUE until the block has executed a command request, but at the longest for the time period applied at the tTimeout input. No new commands are accepted at the inputs as long as bBusy = TRUE.

bError: This output is switched to TRUE if an error occurs during the execution. The command-specific error code is contained in udiErrorId. If the function block is called again with TRUE on bExecute, then bError is reset to FALSE and udiErrorId to 0.

udiErrorId: Contains the command-specific error code of the most recently executed command. Is reset to 0 by the execution of a command at the inputs.

eConnectionState: This output is set to eMLGWClientConnected as soon as the connection is established. If there is no connection the output is set to eMLGWClientDisconnected.

Requirements

Development environment

Target system

Required libraries

TwinCAT 2.11 R3/x64

PC/CX

TcBangOlufsen library from V1.0.0