Welcome to our new forum
All users of the legacy CODESYS Forums, please create a new account at account.codesys.com. But make sure to use the same E-Mail address as in the old Forum. Then your posts will be matched. Close

Abfrage Node Status in V3?

eurowolf
2019-01-09
2019-01-10
  • eurowolf - 2019-01-09

    Hallo Forumsmitglieder.

    In V2 konnte ich den NodeStatus der CanOpen-Teilnehmer abfragen.
    Diese Funktion finde ich in V3 nicht mehr.

    Gibt es da neue Bausteine?

     
  • plcmax - 2019-01-09

    Hallo,
    das geht mit der CiA405.library.
    Aus dem Store Beispiel:
    https://store.codesys.com/canopen-examp ... re=default

    IF GetState.CONFIRM = TRUE THEN
       // GetState successful. Output STATE contains result.
       State := GetState.STATE;
       xEnable := FALSE;
    ELSIF GetState.ERROR <> CIA405.CANOPEN_KERNEL_ERROR.CANOPEN_KERNEL_NO_ERROR THEN
       // an error occured while processing GetState e.g. wrong NodeID or NetworkID
       xEnable := FALSE;
    END_IF
    // GetState needs the CAN network and the device NodeID (input DEVICE). 
    GetState(    ENABLE := xEnable,
               NETWORK := CANbus.NetId + 1, //CODESYS NetId starts by 0 (the number entered into the CANbus configurator); CiA405 NETWORK by 1; That is the reason why we have to increment it here.
               TIMEOUT := 0, // no timeout for GetState needed because it is processed locally.
             DEVICE := CANopenRemoteDevice.NodeID // Note: If you want to get the state of the CANopenManager, you can use the CANopenManager NodeID or NodeID 0.
                                         // A CANopenManager goes to OPERATIONAL if all mandatory (= not optional) slaves are operational.
    );
    

    Grüße
    plcmax

     
  • eurowolf - 2019-01-10

    Hallo plcmax,

    vielen Dank für den Tipp, werde das mal versuchen.
    LG
    eurowolf

     

Log in to post a comment.