LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Newbie Question

I am trying to sample a HP 34401A for a dc voltage, then plot the points
to a graph.
I can communicate withthe instrument through my GPIB board, and have
done single
voltage reads. But does anyone have an example or advice on the graphing
portion?
Thanks,
-LL
0 Kudos
Message 1 of 6
(3,018 Views)
Just connect the voltage output to a Waveform Chart (you find it on the
controls
palette). Put the Read Voltage vi and this graph in a loop and the graph
will
update the measured values.

Good Luck


"Lisa Lord" schreef in bericht
news:3B7CBB41.89C25714@yahoo.com...
> I am trying to sample a HP 34401A for a dc voltage, then plot the points
> to a graph.
> I can communicate withthe instrument through my GPIB board, and have
> done single
> voltage reads. But does anyone have an example or advice on the graphing
> portion?
> Thanks,
> -LL
>
0 Kudos
Message 2 of 6
(3,018 Views)
Wrap the data grabbing block in a while loop and feed the data to a CHART
(keep the chart and all related data pipes inside the while loop to have it
updating in real time).

There is a similar example in the tutorial book you should have got with
Labview, but using the random number generator instead of an instrument data
grabber.

Also you may want to put in a "sensible"delay in the loop say 500ms so you
grab a point only once every eg. 0.5 seconds

Good luck,

Peter


"Lisa Lord" wrote in message
news:3B7CBB41.89C25714@yahoo.com...
> I am trying to sample a HP 34401A for a dc voltage, then plot the points
> to a graph.
> I can communicate withthe instrument through my GPIB board, and have
> done single
> voltage reads. But does anyone
have an example or advice on the graphing
> portion?
> Thanks,
> -LL
>
0 Kudos
Message 3 of 6
(3,018 Views)
Here is a good link with many examples on how to use graphing in LabVIEW.

http://zone.ni.com/devzone/devzone.nsf/webcategories/FFD0B3DB8F25D884862567930070A782?opendocument

Hope this helps. /Mikael
0 Kudos
Message 4 of 6
(3,018 Views)
Lisa Lord wrote in message news:<3B7CBB41.89C25714@yahoo.com>...
> I am trying to sample a HP 34401A for a dc voltage, then plot the points
> to a graph.
> I can communicate withthe instrument through my GPIB board, and have
> done single
> voltage reads. But does anyone have an example or advice on the graphing
> portion?
> Thanks,
> -LL

Lisa,

I'll assume you want to sample one point at a time continuously, and
plot the points to a strip chart-style graph. Place your single
voltage read code in a while loop and wire the single value to a
Waveform Chart found in the Graph palette. The Waveform Chart has a
built-in FIFO buffer that will add each new single read to the chart.
The default length of the chart is 1024 points. You can change this
by
right-clicking the graph and selecting Chart History Length from
the pop-up menu. The pop-up menu will also have items for showing the
scroll bar for scrolling through the data and formatting the x and y
axes, etc.

If you want to sample a bunch of points at once from the HP, you can
use the SAMP:COUN scpi command to configure the instrument for
multiple readings. You'll have to parse these and convert them to an
array. You can then pass the array to a Wavefrom Chart (or Waveform
Graph if you don't want buffering) and it will plot all of the points
at once. It is also possible to put this type of code into a loop and
graph chunks of data at each iteration. Try the
Help->Examples->Fundamentals->Graphs and Charts help section. Email if
you need more help.

sm
0 Kudos
Message 5 of 6
(3,018 Views)
Hi Lisa,
I'm working on the same instrument driver. I've modified it a bit to make it a real time driver i.e. the results will be displayed as soon as they're recieved instead of waiting till all the readings are taken and then dumped in an array. Also I've used a chart instead of a graph, for the same reasons mentioned above. A chart displays real time values while the graph with plot the waveform after it takes all the readings. You can change the chart to a graph by simply right clicking on thee chart and choosing Replace>>Graph>>Waveform Graph.
Also I've put the chart in a subVI called chart, just because the HP34401A did not have enough place to fit a big chart.
I'm attaching the HP34401A instr driver (modified) and also the chart.vi
Let me know if yo
u have anyother problems.

Kunal.

P.S: I'm using LabVIEW 5, so you might have some problems
Download All
Message 6 of 6
(3,018 Views)