09-12-2012 12:21 PM
Hello everyone. I have a scale with some commands i have to use, but the biologist i'm making the project to, wants boolean buttons of all commands. I have tried to make multiple cases (one case for one command), but i cant connect two "write cases" to the same Visa close. I have made a Open/Close boolean case for opening and closing the scale, and i want to make a boolean OK-button to zero pointing the scale value. So how do i make multiple boolean cases ?. I have uploaded my VI
Solved! Go to Solution.
09-12-2012 12:35 PM
You need a new architecture. You should configure the port once. Use an event structure inside of a while loop for sending the various commands (each button will have its own event case). Have another button with its own event case for quiting the application (exiting the while loop). Close the port after the while loop is completed.
09-12-2012 12:53 PM
Oesen,
You are going to need to employ some kind of architecture/design pattern for this. I would probably go for an event driven state machine. I have knocked up a real quick example.
The producer loop monitors your user interface and then controls the consumer loop. See if you can understand whats going on.
Kind Regards
09-12-2012 04:01 PM
Thanks for the answers 🙂
How do i test it with the Producer/Consumer program Lewis ?. Where can i write my strings and test it ?
09-13-2012 01:36 PM
Hey Oesen,
The VI I sent over is relatively complicated if you are new. How experienced are you with LabVIEW?
The VI is not finished/testable; its only to give you an idea of how you could do it. You should spend time trying to understand how the design pattern works and finish it yourself.
I changed your string controls to constants because I assumed that these would never be changed at run time. Look through the cases in the consumer loop to see them.
Kind Regards
09-13-2012 05:53 PM
Thanks for the answer Lewis
I'm a new Labviewer and I didn't made any program with loops before. The program seems a bit advanced to me, but i will examine it. Thanks for the help 🙂
09-14-2012 01:31 PM
For what you want to do, you will need some kind of design pattern and you will certainly need to get to grips with loops if you want to use LabVIEW.
We can help if you have questions and I would recommend taking some time out to learn some basicis.