8/8/2019 3:34 PM | |
Joined: 5/25/2010 Last visit: 9/12/2024 Posts: 29 Rating:
|
That's crazy there is no simple way to do that!!! A basic "AND" mask can do the job but i can't even use it in SCL. PEEK_BOOL is close to do the job but can't use a temporary variable... To test a bit in a word i do : Result := SHR(IN:=WORD_to_TEST, N:=Num_of_bit) if Result.%X0 ) then // bit = 1 ; end_if; I hope they will put back that kind of basic instruction. (credit to automatizzando for original idea.) ------------------------------------------------------------------------------------------ |
Last edited by: Jen_Moderator at: 08/19/2019 12:05:16New subject after splitting |
|
8/8/2019 4:45 PM | |
Joined: 7/7/2010 Last visit: 9/12/2024 Posts: 15180 Rating:
|
What are you talking about? MyWord.%X3 for S7-1200/1500 allows checking the 3rd bit of tag, similar to what you have below. You can use it anywhere a Boolean expression or tag can be used.
|
science guy |
|
Follow us on