Wie kann unter CoDeSys in einen array bits adressieren?

8 Bits vom Byte 2:
Code:
    MyBool0:= xxx[2].0;
    MyBool1:= xxx[2].1;
    MyBool2:= xxx[2].2;
    MyBool3:= xxx[2].3;
    MyBool4:= xxx[2].4;
    MyBool5:= xxx[2].5;
    MyBool6:= xxx[2].6;
    MyBool7:= xxx[2].7;
 
Zuviel Werbung?
-> Hier kostenlos registrieren
8 Bits vom Byte 2:
Code:
    MyBool0:= xxx[2].0;
    MyBool1:= xxx[2].1;
    MyBool2:= xxx[2].2;
    MyBool3:= xxx[2].3;
    MyBool4:= xxx[2].4;
    MyBool5:= xxx[2].5;
    MyBool6:= xxx[2].6;
    MyBool7:= xxx[2].7;
8 Bits vom Byte 2:
Code:
    MyBool0:= xxx[2].0;
    MyBool1:= xxx[2].1;
    MyBool2:= xxx[2].2;
    MyBool3:= xxx[2].3;
    MyBool4:= xxx[2].4;
    MyBool5:= xxx[2].5;
    MyBool6:= xxx[2].6;
    MyBool7:= xxx[2].7;
 
Die Semicolon gibt es nur in der Programmiersprache Structured Text. Außerdem hast du eine Doppelzuweisung. Sollte ungefähr so aussehen (je nachdem was du vorhast):

1656446892341.png
 
Zurück
Oben