FB_SoEReadDcBusCurrent
With the function block FB_SoEAX5000ReadDcBusCurrent the DC-Bus current
(S-0-0381) can be read.
Inputs
VAR_INPUT
sNetId : T_AmsNetId := '';
bExecute : BOOL;
tTimeout : TIME := DEFAULT_ADS_TIMEOUT;
END_VAR
Name | Type | Description |
---|---|---|
sNetId | T_AmsNetId | String, which contains the AMS Network ID of the PC (type: T_AmsNetId). |
bExecute | BOOL | The function block is enabled via a positive edge at this input. |
tTimeout | TIME | Maximum time allowed for the execution of the function block. |
Inputs/outputs
VAR_IN_OUT
Axis : NCTOPLC_AXIS_REF;(* reference to NC axis *)
END_VAR
Name | Type | Description |
---|---|---|
Axis | Axis data structure of the type NCTOPLC_AXIS_REF |
Outputs
VAR_OUTPUT
bBusy : BOOL;
bError : BOOL;
iAdsErrId : UINT;
iSercosErrId : UINT;
fDcBusCurrent : REAL;
dwAttribute : DWORD;
END_VAR
Name | Type | Description |
---|---|---|
bBusy | BOOL | This output is set when the function block is activated, and remains set until a feedback is received. |
bError | BOOL | This output is set after the bBusy output has been reset when an error occurs in the transmission of the command. |
iAdsErrId | UINT | Returns the ADS error code of the last executed command when the bError output is set. |
iSercosErrId | UINT | In the case of a set bError output returns the Sercos error of the last executed command. |
fDcBusCurrent | REAL | Returns the attributes of the Sercos parameter. |
dwAttribute | DWORD | Returns the DC bus current (e.g. 2,040 equals 2,040 A). |
Sample
fbReadDcBusCurrent : FB_SoEReadDcBusCurrent_ByDriveRef;
bReadDcBusCurrent : BOOL;
fDcBusCurrent : REAL;
(* NcAxis *)
NcToPlc AT %I* : NCTOPLC_AXIS_REF;
IF bReadDcBusCurrent THEN
fbReadDcBusCurrent(
Axis := NcToPlc,
bExecute := TRUE,
tTimeout := DEFAULT_ADS_TIMEOUT,
fDcBusCurrent=>fDcBusCurrent
);
IF NOT fbReadDcBusCurrent.bBusy THEN
fbReadDcBusCurrent(Axis := NcToPlc, bExecute := FALSE);
bReadDcBusCurrent := FALSE;
END_IF
END_IF