02-23-2013 05:58 PM
Can someone quickly explain how to set a particalur bit within a byte? In C I would do it this way. Val|= 1 << x; but I'm little confused with the way the logical shift in Labview works because I can't seem to make it work correctly. Thanks so much!
02-23-2013 06:43 PM
02-23-2013 06:43 PM
The logical functions work on integer data types. Just OR the desired bit with the previous value of the byte to set the bit True. To set it False AND with a mask having all other bits True.
Lynn
02-23-2013 07:07 PM - edited 02-23-2013 07:09 PM
Thanks guys, can someone give me a quick example using the logical switch method of ORing the bits in. For example, if I need to set bits 6 & 7 to a particular setting, but leave the other data bits in tact how would I do this using the logical shift and OR method in labview?
02-23-2013 07:44 PM
Here is a simple example.
Lynn
02-24-2013 05:20 AM
Hi,
if you do not need it in some code that performs zilions of operations within a second,
much more programmer friendly is to convert the byte into boolean array (my humble opinion).