LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Code Development Digital output from Booloean data

I am currently evaluating Lab View for my company. I have started to develop code for a possible vi.  This vi is set up to compare the air flow rates through 2 hoses, a production part and a part which represents a restricted or bad part. What we are trying to accomplish with this vi is to read analog voltage inputs from 2 flowmeters(2 analog voltage inputs), compare the data from one flowmeter to the other, and based on this comparison, make a decision. This decision will have three results - a result that would indicate a good part, a result that would indicate a bad part, or a result that would indicate that the part is leaking. Once the decision is made, a digital output must be sent out to indicate whether the part is good, bad or leaking (3 separate digital outputs).  The way I have the vi set up currently, I am getting analog inputs, converting them to boolean data, and my end results are 3 differnt led's that light up on my front panel to indicate whether the part is good bad or leaking. I need to convert these booloean results to digital outputs to indicate the condition of the test part - only one of the three digital outputs will be sent out at any one time - the test part is either good, bad or leaking. These digital outputs will indicate to a plc whether or no to continue on with the test. I need to know if I can use my boolean result data to trigger a digital output, and if so, what sub vi's would accomplish this(any examples would be appreciated). I have analog inputs connected to ACH0, and ACH1. I have my digital outputs connected as follows: Good Part - DIO0, Bad part - DIO1, Leaking part -DIO2.  Hardware is PCI-6220 AND SCB-68. Thanks.

 

Thomas

0 Kudos
Message 1 of 2
(2,426 Views)
Use the function Write To Digital Port found in Functions palettle - NI Measurements - Data Aquisition - Digital I/O.  Write the integer value 1 for a good part, 2 for a bad part, and 4 for a leaking part.  These are binary values 0000 0001, 0000 0010, and 0000 0100, respectively.  As you can see by the position where the 1 is in, the DIO lines will be high on DIO0 for a good part, DIO1 for a bad part, and DIO2 for a leaking part.
- tbob

Inventor of the WORM Global
0 Kudos
Message 2 of 2
(2,419 Views)