LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

checkbox doubt

HI,

    in the given attchment there is checkbox which will be used for some selection operations. Here, when the checkbox is pressed(ON), i would like to display output voltage and current limit. when it is OFF, some more parameters are displayed.

         i have no idea to do this because i am new to labview and programming. CAn any explain me clearly possibly with an example.

0 Kudos
Message 1 of 2
(2,197 Views)

The first thing I'd recommend is using the state machine architecture. Your while loop is ok for just reading and writing from a serial port, but since things are starting to be complex, you need a software architecture that can handle more complex tasks. You are read more about the state machine at: http://zone.ni.com/devzone/cda/tut/p/id/3024

 

When you build you state machine I'd recommend having a Monitor state that uses an Event Structure. You are read about Event structures and event driven programming at: http://zone.ni.com/devzone/cda/tut/p/id/3331

 

Your event driven state machine could timeout and perform the read/write serial port code. Then, if the checkbox is checked, it could service that request in another state and change the UI however you want. 

 

Also, I'd recommend initializing and closing your serial port only once, not over and over again. 

 

If you get stuck on any of this just ask and I'll help out!

0 Kudos
Message 2 of 2
(2,141 Views)