09-14-2012 04:49 AM
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
Solved! Go to Solution.
09-14-2012 06:59 AM
What you want is an event structure inside of a while loop.
09-15-2012 08:49 AM
I used the program with that even structure, but i can't open or close the scale. Here is a screenshot :
09-15-2012 09:41 AM
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.
09-17-2012 04:33 AM
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.
09-17-2012 08:24 AM - edited 09-17-2012 08:26 AM
@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.
09-17-2012 10:42 AM
Yes.. But the command for Zero point is "T\r\n". It doesn't give any respond:
09-17-2012 10:53 AM - edited 09-17-2012 10:54 AM
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.
09-17-2012 10:54 AM
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.
09-17-2012 10:57 AM
@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.