LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

how to monitor a bit

HI i'm very new to labview, coming from a sequential command oriented programming background, so im on a relatively steap learning curve.

 

I have what you people call a "stacked sequence structure" which programs an oven for me. 1, 2, 3, 4, all send commands sequentially to the oven. What i would like to do is monitor the 'status byte' of the last step for bit 4 so i know when it has completed. [Bit 4 of the status byte tells me when the setpoint has been reached.]

 

 I need to know when bit 4 goes high, to exit my loop. What i wanted to do is send this info to a local variable, and check that periodically in my loop. However i'm not sure how to:

 

A - monitor a specific bit of a byte

B - write to a local variable

 

Please help

 

Thanks

Message Edited by lebogzy on 04-20-2009 12:39 PM
0 Kudos
Message 1 of 7
(2,610 Views)
isnt there liek an unbundle byte or something
0 Kudos
Message 2 of 7
(2,581 Views)

Try using the Number to Boolean Array.vi and Index Array.vi

 

Message Edited by Wayne.C on 04-20-2009 02:18 PM
0 Kudos
Message 3 of 7
(2,576 Views)

great! thank you for the reply. meanwhile i came up with this:

 

 

 

 

 

 

 

 

will this also work?

 

0 Kudos
Message 4 of 7
(2,570 Views)

There are several methods to accomplish this.  The difference will be how efficient the code is.  Yours will work but has an extra step in it.  You could also do it this way.

 

Message Edited by Wayne.C on 04-20-2009 02:49 PM
0 Kudos
Message 5 of 7
(2,562 Views)

SImply mask with "bitwise AND" and see if the result is not zero. (of course for a fixed personality, you would replace the lower part with a diagram constant, even simpler).

 

 (Wayne, using an inverted mask and bitwise OR seems a bit convoluted ;))

 

 

Message Edited by altenbach on 04-20-2009 12:23 PM
0 Kudos
Message 6 of 7
(2,540 Views)

altenbach,

 

My gate array and FPGA past are showing again.  It's not convoluted at all if its being implemented in physical gates and you don't want to use any flip-flops. 

Message 7 of 7
(2,518 Views)