What specifically are you trying to accomplish? Maybe there is a better way of doing it. Also CoDeSys is not case sensitive, it appears to me that you have the same variable defined twice.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi,
I have
and need bit access in to small part this array, I created this:
At view array jednotky :
Jdnotka[1] : BOOL := INVALID 16#F0
Jdnotka[2] : BOOL := INVALID 16#F3
Jdnotka[3] : BOOL := false;
It's number contains in buffer. But i Think that CoDeSys partitions on 20 singl bits. Way? How to repair?
Related
Talk.ru: 1
Talk.ru: 2
Talk.ru: 3
Hi Paul,
Thats a quite normal behavior in CoDeSys. A boolean needs a byte of memory space so your pointer points to the 20 first bytes. Whats about typing ```
buffer[1].0
```? This code accesses the first bit of first index.
regards
Ralph
Related
Talk.ru: 1
But I need access over some variable. Buffer[0].somevar is not possible.
What specifically are you trying to accomplish? Maybe there is a better way of doing it. Also CoDeSys is not case sensitive, it appears to me that you have the same variable defined twice.
True you can only reference a bit by a constant not ba a variable
a simple trick is to do the following:
tmp := shr(INbyte, N);
Bit := tmp.0;
in the open source library OSCAT.LIB you can find functions like this to get a bit referenced by a variable.
w www.oscat.de w