bits to word Conversion
Dear all
please suggest in creating a Function Block for 16 bits to word conversion.
i searched in some previous Blogs i didnt understand that can any one please Suggest
with regards
veko
please suggest in creating a Function Block for 16 bits to word conversion.
i searched in some previous Blogs i didnt understand that can any one please Suggest
with regards
veko
Answers
Hi Veko,
Mention the software name you are using?
Mention the software name you are using?
Hi,
Build the function block using the below equation.
Using Structure Text to implement this equation takes the least amount of time to build the user defined function block.
Word_Value= (Bit_15_Value*32768) + (Bit_14_Value*16384) + (Bit_13_Value*8192) + (Bit_12_Value*4096) + (Bit_11_Value*2048) + (Bit_10_Value*1024) + (Bit_9_Value*512) + (Bit_8_Value*256) + (Bit_7_Value*128) + (Bit_6_Value*64) + (Bit_5_Value*32) + (Bit_4_Value*16) + (Bit_3_Value*8) + (Bit_2_Value*4) + (Bit_1_Value*2) + (Bit_0_Value*1)
Regards
Rahil
Its a standard system function .... "BcToDint" followed by "dint_to_word"
Search the online help in Control Builder
Search the online help in Control Builder
Add new comment