LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Using XY Graph to plot current and voltage

Hi,

   I'm making an I-V curve tracer, and am hoping to plot current and voltage measurements I'm acquiring onto an XY Graph in realtime.  I'm using Labview 2010 on Windows Vista, with the VISA drivers installed; my acquisition hardware is an Arduino Uno communicating over USB to serial via VISA drivers.

My data is coming in over the serial port formatted like "voltage,current":

237,521

320,402

....

 

I've read through the relevant documentation for the graph builder, the 4 samples included with LabView, and quite a few posts on this forum.  I modified Jazlan's sample VI to read the current and voltage, and display the values on the front panel - it works just fine.  However, when I wire those values to an Express XY Graph builder (and set the 'clear data on each call' property to false) and run the software, it just sort of freezes... I try to stop it, but it keeps running for about 10-20 seconds.  The current/voltage values are not updated, nor is anything displayed in the XY graph.

 

Am I not sending the correct input to the graph builder?

Should I just wire up my values directly to the XY graph by concatenating values to an array, and then clustering it?

Also, on the right border of my case structure, one of the orange squares is not solid - how do I fix that?

 

any help much appreciated!

imran

Download All
0 Kudos
Message 1 of 5
(5,492 Views)

UPDATE: It seems that it works the first time I run the VI, but once I stop it and try to run it again, it freezes for about 20 seconds and nothing gets updated.  Do I need to clear some value every time it executes, or re-initialize the port?  Any suggestions?

 

thanks

0 Kudos
Message 2 of 5
(5,488 Views)

 


@skunkwerk wrote:

UPDATE: It seems that it works the first time I run the VI, but once I stop it and try to run it again, it freezes for about 20 seconds and nothing gets updated.  Do I need to clear some value every time it executes, or re-initialize the port?  Any suggestions?

 

thanks


 

How are you stopping the VI? You need to make sure that you are hitting the stop button and not the stop sign or the X in the top right hand of the window.

 

Second you need to change the tunnels on the while loop with shift registers.

 

I would also suggest that you make a loop for talking to the serial prot and one for plotting data.

Tim
GHSP
0 Kudos
Message 3 of 5
(5,485 Views)

thanks for the tip Tim,

    I wired up the stop button to the VISA close block, and now I'm able to run and stop it multiple times without freezing.

 

1)  I know how to add shift registers, but why do I need one?  It doesn't seem like I need to pass values from one iteration of the while loop to another...

 

regards,

imran

0 Kudos
Message 4 of 5
(5,481 Views)

The reason that you would use shift registers is that as your code become more complex you will want a way to recove from errors or start and stop again witout having to shut down the cod eto do it. By using shift registers it allows you to set up a system liek a state machine that allows you to react to what is going on in your code. You could intitilize your code which would set up all of the Daq stuff then read and then stop. If you got an error you could stop the daq and reinitilize the code and start again without have to stop the code to do it. It make the code more seemless.

Tim
GHSP
0 Kudos
Message 5 of 5
(5,469 Views)