From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

handling multiple buttons

Hello all,

 

I am working on project to control fluke multimeter. I got the communication and am able to read the values from it  and representing the values in graph. Here the problem comes, when i am switching the multimeter to voltmeter,ammeter and ohmmeter  it is reperesenting all the values in the single graph. Thats unfair. what i have to do is to seperate the graphs  when the event has occured like if i switch to voltmeter it has to get the values in to voltmeter graph and for the others in different graphs  w.r.t time.I attached the VI

 

can anyone give suggestions on this pls!

 

Thanks

Kumar2249

0 Kudos
Message 1 of 4
(3,148 Views)

Your basic architecture is not set up to allow changes (Volts/Ohms/Amps) after the program is started.

You wait until the user clicks one of those and then you don't pay attention any more.

 

Usually, you want the EVENT structure to be INSIDE the WHILE loop.

When an event happens, you handle it, and then loop back for another event.

In this case, I would have a TIMEOUT event, so that you can check the serial port every X mSec,

 

Something like this:

 

Repeat  {while loop }

    case EVENT of

    VOLTS button - Value Change:

        Send command for VOLTS mode to instrument

        Shift Register = 0 (VOLTS mode)

    OHMS button - Value Change

        Send command for OHMS mode to instrument

        Shift Register = 1 (OHMS mode)

    AMPS button - Value Change

        Send command for AMPS mode to instrument

        Shift Register = 2 (AMPS mode)

    TimeOut:

        if Incoming Data

            Process data into numbers.

            case Shift Reg of

            0:  Pass number to VOLTS chart

            1:  Pass number to OHMS chart

            2:  Pass number to AMPS chart

            default: do nothing

           end case

        end if

      Stop Button - Value Change

          Stop Loop

      end case

until Stopped (end loop)

Steve Bird
Culverson Software - Elegant software that is a pleasure to use.
Culverson.com


Blog for (mostly LabVIEW) programmers: Tips And Tricks

Message 2 of 4
(3,142 Views)

Thanks for your reply, i got the solution in different manner using local variable.

 

But in your case can you please tell me what i have to do in time out case. I got ur logic but in labview point I am not able to do so.

0 Kudos
Message 3 of 4
(3,117 Views)

can you please tell me what i have to do in time out case

 

That's where you would check the serial port for incoming data, and handle it if there's some there.  

 

I don't know of any events that happen based on a serial port , so you have to use old-fashioned polling.

 

The timeout is to give you a chance to do so.

 

Steve Bird
Culverson Software - Elegant software that is a pleasure to use.
Culverson.com


Blog for (mostly LabVIEW) programmers: Tips And Tricks

0 Kudos
Message 4 of 4
(3,111 Views)