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

Has any one seen this [:=]?

spfeif
2005-10-18
2005-10-19
  • spfeif

    spfeif - 2005-10-18

    There is code written in structured text that has the following:

    State is declared as INT.

    IF (State = 0) AND ( something )) THEN

            State [:=] 1;
    
            Counter [:=] 0.5;
    

    END_IF;

    Has any one seen this type of statement before? What is this? I have looked through CoDeSys help and Karl-Heinz book but no luck.

    Thanks

     
  • nanoPLC

    nanoPLC - 2005-10-19

    You should open sample, and look up - I have the sample of machine control fom current program path "imported". Will working.

    I have not found drag-and-drop function from the PLC library

    window to worksheet window. ( 2.42 version )

    I wait for 3.0? I hope that without of bugs comming soon.

    Happy logical programing

    regards

     
  • Ulrich Herschke

    Ulrich Herschke - 2005-10-19

    I saw an assignment [:=] already, but do not know where in CoDeSys.

    The ST in AB-CLX with Rockwell RSLogix5000 use this for initialising the variable to zero on start of plc. Normally all variables are there battery buffered = retain.

    regards Ulrich

    attached the excerpt from RSLogix help:

    Specify a non-retentive assignment

    The non-retentive assignment is different from the regular assignment described above in that the tag in a non-retentive assignment is reset to zero each time the controller:

    Β§ enters the RUN mode

    Β§ leaves the step of an SFC (This applies only if you embed the assignment in the action of the step and you configure the SFC for Automatic reset.)

    A non-retentive assignment has this syntax:

    tag [:=] expression ;

    where:

    Component: Description:

    tag represents the tag that is getting the new value; the tag must be a BOOL, SINT, INT, DINT, or REAL

    [:=] is the non-retentive assignment symbol

    expression represents the new value to assign to the tag

    If tag is this data type: Use this type of expression:

    BOOL BOOL expression

    SINT

    INT

    DINT

    REAL numeric expression

    ; ends the assignment

     

Log in to post a comment.