LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Building tables in LABView

Hi there!
Ok, ok, I'm a rookie in LV AND I'm using LV 5.1 at work.  Smiley Surprised
I'm programing a "HP34401a automation" with the Agilent's VI for the multimeter.
The comunications has been stablished, and i can already get data from my HP and place it in a table. What happens here is that i don't have any control over the table - i can't insert measurements at line 3 column 3, by example.
I wan't a table like this:
 
Range: 100mV
20mV   Reading 1     Reading 2    Reading 3 ....
40mV   Reading 1     Reading 2    Reading 3 ....
60mV   Reading 1     Reading 2    Reading 3 ....
80mV   Reading 1     Reading 2    Reading 3 ....
 
Range: 1V
200mV   Reading 1     Reading 2    Reading 3 ....
400mV   Reading 1     Reading 2    Reading 3 ....
600mV   Reading 1     Reading 2    Reading 3 ....
800mV   Reading 1     Reading 2    Reading 3 ....
.
.
.
 
But i want a pause between the ranges - so the user can manually configure the HP range.
Did you get it?
I've tried to use the table atributes (active cell, focus, edit position), but it just won't do it.
PLEASE HELP ME!
Smiley Happy Smiley Happy
 
Regards,
VirVet
 
P.S.: c'mon guys! Make me love LV!
 
0 Kudos
Message 1 of 12
(5,085 Views)
 You have to make sure that the table is big enough before you update it.
Yours Sincerely
John
0 Kudos
Message 2 of 12
(5,071 Views)
Not sure what the agilent VI is doing for (against?) you, but here's the pseudo-code:



For each range
Set instrument to range.
Wait 1000 mSec
for each percentage {20%,40%,60%,80% in your example }
for each reading
Get reading. {Auto-index thru three FOR loops }

That produces a 3-dimensional array, organized by {Range, Percentage, Reading# }

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


LinkedIn

Blog for (mostly LabVIEW) programmers: Tips And Tricks

0 Kudos
Message 3 of 12
(5,064 Views)
Smiley Sad
As i noticed, the table don't have a 'formal' size.
It adapts itself to the number of readings.
 
I wish i could click at the run button, and then the program would execute the following steps:
 
Take 'n' readings and place in the table.
Wait for user to send the 'continue' command
Take 'n' readings and place in next row.
Wait for user to send the 'continue' command
Take 'n' readings and place in next row.
...
 
When the multimeter is at 'wait' mode, the user can change the range, the input signal, etc..
I guess it's a kind of loop.
But my table behaves like a politician. It just won't hear me!
My program is one single cycle.
 
Damm... It must be a very rookie question.
Ok, i'm not shy.
=]
 
 
 
0 Kudos
Message 4 of 12
(5,060 Views)

Nice.

i'm gonna try this one.

 

edit: but how can i prompt the user for changing the range?

Message Edited by virvet on 08-16-2005 01:34 PM

0 Kudos
Message 5 of 12
(5,062 Views)
but how can i prompt the user for changing the range?
Instead of the "wait 1000 mSec" that I wrote, use a ONE BUTTON DIALOG with a message like "Select your next range and click OK".
Steve Bird
Culverson Software - Elegant software that is a pleasure to use.
Culverson.com


LinkedIn

Blog for (mostly LabVIEW) programmers: Tips And Tricks

0 Kudos
Message 6 of 12
(5,048 Views)

Hi again...

I'm sending a sample VI of what i'm triyng to do.

At the first loop, i'll set the measurements and trigger confs.

At the second, i'll get the "n" measurements.

I tought it would give me a 2D array, but it does not. When I enable the Second Indexing, it builds a 3D array.

Any sugestions??

 

 

0 Kudos
Message 7 of 12
(5,029 Views)
Break this down and see what's happening.
What does the READ MEAS vi return? (You can tell by looking at the output wire with the WIRING tool, with the HELP window visible).

It returns a 1-D array of DBL. How many readings in that array? Apparently 50,000, since you did not specify otherwise.

So you autoindex that array in the READINGS loop. If N is 4 (your default value), then the result is a 2-D array, 4x50,000.


You then auto-index that AGAIN with another loop, this time with a CONFIG operation. Since you set N to 4 here, your final output array is a 3-D array, 4x4x50,000.

Rather a large one.

Judging from your original post, that sounds like exactly what you asked for. At least, your description of what you want calls for a 3-D array, and that's what I suggested you'd get in my first post.

If that's not what you want, perhaps you could elaborate more.

P.S. You'll get better performance if you convert to strings earlier - don't collect all the DBLs, then convert all to STR. Convert each batch to STR as soon as you get it, then accumulate the arrays of STRs. That's assuming you don't really need the numbers themselves.
Steve Bird
Culverson Software - Elegant software that is a pleasure to use.
Culverson.com


LinkedIn

Blog for (mostly LabVIEW) programmers: Tips And Tricks

0 Kudos
Message 8 of 12
(5,005 Views)
Thank you again for the help, you're very kind.
 
You said that I haven't specified the number of samples, bot by default it is 1 (per trigger). So, I guess this is not a problem here.
 
What's really driving me mad is how to manipulate data. I can't show my measurements on a
table!
 
All that I need is a (number of readings) columns x (lots of) lines, with the line headers - like 20mV, 40mV...
 
I'll keep on trying... Thank you again.
 
 
 
0 Kudos
Message 9 of 12
(4,997 Views)
A simple solution would be to build the 3D array, then just obtain 2D subsets of it, and append them together as a 2D array in whatever shape you like...

Use the "Get Array Subset", "Reshape Array", "Transpose 2D Array"...  etc.   You can generally make and shape array into any other shape array (dimensions too!) using those VIs
0 Kudos
Message 10 of 12
(4,993 Views)