Read every bit of a WORD in TwinCAT 2.11

Sohaib28

Member
Join Date
Aug 2015
Location
Cottbus
Posts
31
Hello Members:

I want to ask you that is that is there any possibility to read every bit of a data type WORD in TwinCAT. I want to see condition of every bit of the data type WORD. I want to know which bits are 1 and which are 0.

What do I need to do? Do I need to define an array? Is there anyone who could help me with pictures.
It would be very helpful if anyone tell me.
Thanks in advance.
Regards
 
Last edited:
%MX5.0 is bit0 in WORD 5 not in the byte.
but yes that is a correct thing.
you will need to make your word a marker like wordvariable :WORD AT %MW5;

another way is by:
for a=0 to 15 step 1
bitarray[a]= wordvariabele & (2^a)
end_for

these type of things can be found in the oscat library.
 

Similar Topics

Is there a way to use the FAL instruction to do +=2 instead of +=1? I have an array that is organized with alternating "data" and "flag" values...
Replies
5
Views
123
Hi, The hardware is: Click Plc model # CO-O1DD1-O HMI model # S3ML-R magnetic-inductive flow meter model # FMM100-1001. I will set the flow meter...
Replies
4
Views
114
Hi everyone i have a customer, who wants to show an alarm on the machine, if the I/O forces are enabled and set, on at ControlLogix L81E with...
Replies
3
Views
224
Hi Iam using monitouch hmi(V9 soft) with omron plc cj2m (CX programmer). In this I want to read a data from hmi to plc. The data was like...
Replies
0
Views
91
Hi everyone. Quick questions. On UnityPro, I want to open and quickly read tags from a .STA files witouth opening the program. I have 30 plc...
Replies
2
Views
129
Back
Top Bottom