05-05-2011 07:37 AM
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
05-05-2011 08:00 AM
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)
Blog for (mostly LabVIEW) programmers: Tips And Tricks
05-06-2011 08:41 AM
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.
05-06-2011 08:54 AM
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.
Blog for (mostly LabVIEW) programmers: Tips And Tricks