LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

if-else statement

I have this flow diagram, which I need to convert to a blcok diagram in LabVIEW. I have attached it here.
I am using an NI USB 6501 DAQ. Could someone tell me how to do it? I don't know how to use the if-else statement with the DAQ inputs.
0 Kudos
Message 1 of 11
(3,622 Views)
A state-machine would be a good choice for the implementation.

See: http://zone.ni.com/devzone/cda/tut/p/id/3024

Message Edited by andre.buurman@carya on 11-02-2007 04:58 PM

Regards,
André (CLA, CLED)
0 Kudos
Message 2 of 11
(3,610 Views)

This typically uses a case structure with two cases.

Simulate your Heat call and check for W (e.g. =0?) and wire the output to the selector terminal of a case structure. In one case, you would place the "terminalte heat call" and a boolean TRUE (for fail). In the other case you only place a boolean FALSE (for pass).

WIre the booleans to the same output tunnel for further processing after the case structure.

Is this supposed to occur repetitively?

0 Kudos
Message 3 of 11
(3,604 Views)
I figured it's a case with 2 cases, but the condition for W comes from the DAQ. And it says the condition has to be an integer right. But I'm trying to comapre it to what the DAQ reads. So how do I make the if(condition)-this condition is the one that is read from P0.1. How do I give this condition
0 Kudos
Message 4 of 11
(3,602 Views)
Also the pass and fail are supposed to be LEDs that light up
0 Kudos
Message 5 of 11
(3,596 Views)

Also it is not repetitive. once I'm done witht he heat mode, I have to check for cool mode, fan mode etc., whichc will be almost similar, but witha few changes.

Another thing... simulate heat is writing to P1.0 adn terminating heat is to stop writing to P1.0

0 Kudos
Message 6 of 11
(3,595 Views)
LabVIEW does not care where data comes from, it's just in a wire. (LabVIEW operates the same with all integers, they can come from a user control on the front panel, from the result of a calculation, from a DAQ, , etc....)
 
 
You just have an integer that you can wire directly to the selector terminal. Or you can use one of the comparison operations and wire the boolean output. Why don't you attach your code so we can better see what we are dealing with. 😉
 
 
Message 7 of 11
(3,592 Views)
Your story is difficult to follow, could you post a screenshot of what you already have?

Am I slow or are you guys just very fast?

Message Edited by andre.buurman@carya on 11-02-2007 05:12 PM

Regards,
André (CLA, CLED)
0 Kudos
Message 8 of 11
(3,593 Views)


@smm wrote:

Also it is not repetitive. once I'm done witht he heat mode, I have to check for cool mode, fan mode etc., whichc will be almost similar, but witha few changes.

Another thing... simulate heat is writing to P1.0 adn terminating heat is to stop writing to P1.0


Now you don't make any sense!

If writing something to P1.0 is not repetitve, there is no need to stop writing to it, because you only write once anyway. 😉

More logical scenario examples:

  • write repetitively until pass? (or fail)
  • write something else to P1.0 to terminate?

Can you define the problem in clearer terms please?

0 Kudos
Message 9 of 11
(3,586 Views)

Andre, I'm justt trying to implement what I have shown in the flow diagram. This is one case called heat mode.

Once my heat mode is done, I go to fan mode and then cool mode. The thing is , where it says simulate heat mode. There I have to write to P1.0 of the NI USB 6501. This thing turns on a signal W, which is read at P0.1.

If what I read off P1.0 is low (false), the FALSE LED turns on, or else if the P1.0 is true (1) , then it terminates heat call i.e it stops writing to P1.0. Further it checks if the W signal is present again, if yes, then PASS LED turns on or else FAIL.

I hope I'm trying to explain what I'm saying correctly. Try looking at the flow diagram.

0 Kudos
Message 10 of 11
(3,582 Views)