07-06-2010 09:44 AM
Hello,
I want to do some bit manipulation during a Register Read/Write Process.
Read a register value (16-bit), set a particular bit to "One" or "Zero",
Please note the bit position and logic i want to set is need to read from a text file.
Please find the attachment for the sample VI.
Please comment on this.
-mfp.
07-06-2010 09:48 AM
try casting your string as an array of U16's and index out the element you want, then you can use bit-wise bolean opeartors to set clear etc.
Ben
07-06-2010 09:53 AM - edited 07-06-2010 09:54 AM
Your attached example has missing subVIs and does not give a clue on what kind of bit manipulation you actually want to do.
You should also set the default to U16 at "hexadecimal string to number", currently you get U32
To set a bit of an U16 integer, you would do a logical OR with a number that only has the desired bit set (2^bit position). To clear a bit, you would use AND with a number that has all but the desired bit set. Mix & match!
07-07-2010 05:24 AM
Hi,
Sorry. i couldnot able to do that.
Please find the attachment for the Detailed VI.
Please comment on this.
-mfp.
07-07-2010 06:25 AM
07-07-2010 10:16 AM
Here's what I would do:
See if it makes sense (for demonstration, I replaced your derived input number with a control)