Hi Joan and Joaquin
Try with the undocumented function getbit(Word, BitNum)
It should return the bit at BitNum position. I didn't fully test it yet,
but try it anyway!
Regards to all Lookout programmers,
Roman Plevnik
Virtual Technologies
SLOVENIA
Joan wrote:
>Hello (hola) Joaquin>>I think the only solution is to use the following
formula>>mod( int(WORD) , 2) --> to get Bit 0>mod( int(WORD/2) , 2)
--> to get Bit 1>mod( int(WORD/4) , 2) --> to get Bit 2>mod( int(WORD/8)
, 2) --> to get Bit 3>mod( int(WORD/16) , 2) --> to get Bit 4>>and
so on...>>I hope it will help. I don't know an easier way to acomplish that.>>Joan
Lluch>Suministros Electricos Industriales, S.L.>>>>>Joaquin Villanueva wrote:>>>
Hello,>>>> I need to read bit v
alues from WORD (%MW) values read from a Telemecanique>>
PLC (TSX Premium) trough an Applicom card (UNI-TE), but I can't see how get>>
separate bits from these word values. In Lookout I can't see any bit>> manipulation
function, and the Applicom driver for UNI-TE don't let me>> adress the bits
of a word value. Sure I can do a lot of calculations to get>> the bits, but
there is any simplest solution for this?>>>> Any help will be appreciated>>
Thanks>> Joaquin Villanueva>> T-Systems, S.L.>>>