Cancel
Showing results for 
Search instead for 
Did you mean: 

How to compose a word from bits

Creator
Creator
Time ago I used  "BitwiseIsBitOn" function for splitting the bytes in single bits. Now I should to do exactly contrary, so I should get to a Word from single bit.
For this I try to use "BitwiseByteSwap" function, but it seems don't accept signals.

In the attachment, you can see that my byte created from 4 signals and all  zeros. 
If I write BitwiseByteSwap ( "2" "10000") it works.
Pratically I should created that signal from 16 signals ( bool).
 
How can I do?
 
Thanks you 
 

Saluti

Giuseppe Musone

2 REPLIES 2

Re: How to compose a word from bits

Solution Partner Experimenter Solution Partner Experimenter
Solution Partner Experimenter

attachment??

Re: How to compose a word from bits

Siemens Phenom Siemens Phenom
Siemens Phenom

Hi Giuseppe,

 

When you want to get a BYTE from your single bits you should simple create a BYTE parameter or an exit.

As expression just do simple calculation: bit1*1 + bit2*2 + bit3*4 + bit4*8 .... and so on.

 

Best regards

Patrick