LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Is this VI the right procedure to multiple boolean button?

Solved!
Go to solution

Hello everyone. I made this VI's to use multiple boolean buttons for my scale (a "Open/Close" button and a "reset to zero" button). I want to make all commands from my device as boolean (ON/OFF) switches or buttons. Im asking for this procedure using while loop. Is this the right procedure. My VI is uploaded.

 

In my previous post, a user helped me and said, that i can use a Producer/Consumer state machine in this situation, but that program seems a bit advanced and difficult to me, because i'm inexperienced with Labview.  

 

Thanks in advance

 

Oesen 

 

 

Best regards

Oesen
0 Kudos
Message 1 of 12
(3,293 Views)

What you want is an event structure inside of a while loop.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
Message 2 of 12
(3,275 Views)

I used the program with that even structure, but i can't open or close the scale. Here is a screenshot :

Screen.png

 

Best regards

Oesen
0 Kudos
Message 3 of 12
(3,241 Views)

Are you sure your termination characters are correct?

 

When you run a VI in highlight mode, the carriage return/line feed characters won't show up on the wires.  Yet in your screenshot, your data on the wire shows a \r\n.  That makes me think you actually have 4 characters in that string control of backslash, r, backslash, n.  That is not the same as a carriage return and linefeed.

 

Make sure your string controls are in \code mode before you enter \r\n into them.

Message 4 of 12
(3,238 Views)

Thanks for the help!.. I needed to change to code display. The only problem is the zero zoint button now. ON/OFF button works, but the zero point button doesn't give any respond. 

Best regards

Oesen
0 Kudos
Message 5 of 12
(3,206 Views)

@Oesen wrote:

Thanks for the help!.. I needed to change to code display. The only problem is the zero zoint button now. ON/OFF button works, but the zero point button doesn't give any respond. 


What is the command supposed to be?  I didn't have any reference of the commands.

 

The way the VI is currently written, you need to toggle the Read switch in order to read the data from the instrument.  I should have made that a button.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
Message 6 of 12
(3,189 Views)

Yes.. But the command for Zero point is "T\r\n". It doesn't give any respond:

 

SC.png

Best regards

Oesen
0 Kudos
Message 7 of 12
(3,176 Views)
Solution
Accepted by Oesen

Hah, I pointed to the wrong control.  I setup the event to look at the string instead of the button.  That's one of the dangers of having multiple controls/indicators having the same label.  The fixed VI is attached.

 

Also, you don't need to use the Run Continuosly button.  Just run the VI normally and use the stop button to stop the VI.

 


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
Message 8 of 12
(3,172 Views)

Your image does not show the event actually running. It also looks like you have clicked the run continuous button. NEVER use that except in special debug situations.

Message 9 of 12
(3,170 Views)

@Dennis_Knutson wrote:

Your image does not show the event actually running.


That's what he meant by "not responding".  Took me awhile to figure that out too.  I corrected the VI to have the event point to the correct control.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
Message 10 of 12
(3,166 Views)