c_w_k Posted September 23, 2009 Report Share Posted September 23, 2009 Hello, I wondering how I can translate my C++ code that uses a "bit field", into LabVIEW code..... I have a C++ structure that contains a field of data type short that is a bit field: structure : status short done; // completion flag, this is a bit field // bit 0 is on when an acquistion is in progress // bit 1 is on when the FIFO contains a complete coad // bit 2 is on when a FIFO underrun has occured I need to use the field in an if statement as follows: if(ret == 0) && (status.done & 0x2)) -> this is the part I'm wanting to no how to do in LabVIEW...... { //do whats needed.... } Thanks CK Quote Link to comment
Dan DeFriese Posted September 23, 2009 Report Share Posted September 23, 2009 (edited) Here are my approaches to bit twidding. Dan Edited September 23, 2009 by Dan DeFriese Quote Link to comment
Mellroth Posted September 24, 2009 Report Share Posted September 24, 2009 Here are my approaches to bit twidding. Dan I think the middle picture is wrong, should be using an OR operation instead. Here is another way of doing the bit manipulation Bit manipulation.vi /J Quote Link to comment
Dan DeFriese Posted September 24, 2009 Report Share Posted September 24, 2009 I think the middle picture is wrong, should be using an OR operation instead. Thanks . Quote Link to comment
Mellroth Posted September 24, 2009 Report Share Posted September 24, 2009 Thanks . You're welcome /J Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.