FB_CX70xx_ResetOnBoardIO

FB_CX70xx_ResetOnBoardIO 1:

Der Baustein erlaubt es, einen Reset vom OnBoard-IO des Embedded-PC CX70xx auszuführen.

Typischer Anwendungsfall ist nach einem Fehler in der Kommunikation zu den OnBoard-IOs (CX7028). Zu einem solchen Fehler kommt es, wenn die Spannungsversorgung (Up) der OnBoard-IOs unterbrochen wird.

Hinweis

Zustand der IOs

Ausgänge, die im Prozessabbild noch gesetzt sind, werden nach einem Reset sofort wieder eingeschaltet.

Weitere Details zum OnBoard-IO finden Sie in der Dokumentation des Embedded-PC CX70xx.

FB_CX70xx_ResetOnBoardIO 2: Eingänge

VAR_INPUT
    bExecute      : BOOL;         // rising edge triggers process
    sNetId        : T_AmsNetID;   // AMS Net ID of the OnBoard IOs
    tTimeout      : TIME := DEFAULT_ADS_TIMEOUT; // maximum time allowed for execution of this ADS command
END_VAR

Name

Typ

Beschreibung

bExecute

BOOL

Positive Flanke startet den Baustein.

sNetId

T_AmsNetID

AMS Net ID der OnBoard-IOs

tTimeout

TIME

Gibt die Timeout-Zeit an, die bei der Ausführung des ADS-Kommandos nicht überschritten werden darf.

FB_CX70xx_ResetOnBoardIO 3: Ausgänge

VAR_OUTPUT
    bBusy       : BOOL;       // FB is working
    bError      : BOOL;       // FB has an Error
    nErrorID    : UDINT;      (* Error Code. If nErrorID=DEVICE_SRVNOTSUPP probably the image version need to be updated to support this feature. *)
END_VAR

Name

Typ

Beschreibung

bBusy

BOOL

Der Baustein ist aktiv und arbeitet.

bError

BOOL

Der Baustein hat einen Fehler.

nErrorID

UDINT

ADS Fehler Code
Beispiele:

DEVICE_SRVNOTSUPP: Die Image-Version des CX70xx unterstützt dieses Feature nicht. Ein Update (>=47912) ist notwendig.

Beispiel:

FUNCTION_BLOCK FB_Test_ResetOnboardIO
VAR
    AMSNetID    : T_AmsNetIdArr;    // link to the AMS Net ID of the OnBoard IOs
    State       : WORD;             // link to the State of the OnBoard IOs
    bReset      : BOOL;             // if Ready to Reset you can reset the OnBoard IOs
    fbReset     : FB_CX70xx_ResetOnBoardIO;
END_VAR
IF State<>8 AND NOT State.8 AND State.4 THEN // if OnBoard IO device signals an error and is not OP but present
    bReset := TRUE;
ELSE
    bReset := FALSE;
END_IF

IF NOT fbReset.bBusy AND bReset THEN
    fbReset(bExecute:=TRUE, sNetId:=F_CreateAmsNetId(AMSNetID));
ELSE
    fbReset(bExecute:=FALSE);
END_IF

Entwicklungsumgebung

Zielplattform

Einzubindende SPS- Bibliotheken

TwinCAT v3.1.4024.26

CX70xx

Tc2_SystemCX (System) >= 3.4.8.0