LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

2D Array output confusion - Arrays and Loops

Solved!
Go to solution

 

Hi,

 

I am writing a program to make a 3-terminal measurement of a FET.

I'll be using 2 power supplies: for each increment of the gate voltage Vg, I make a Drain Voltage Sweep Vd and record Id and Vd.

 

Looking at the attached code, you'll see a SubVI called "2-terminal I.V" which outputs a Drain Voltage Array (1D) and a Drain Current Array (1D).

But because the output of the SubVI is in a For loop (to increment Vg), the final output is a 2D Array.

Every time an array exits a loop it gains a dimension.

 

So in the end I'm not sure what the indexes are. How can I prevent the array from gaining a dimension as they exit the For loop?

I'd like to see the output of the SubVI go straight out of the For loop, untouched.

 

I have attached the subVI as well, but I don't think you'll need it.

 

Thank you! I'm still very new to LabVIEW and I much appreciate your help.

 

Nicolas

 

 

Download All
0 Kudos
Message 1 of 6
(2,595 Views)
Solution
Accepted by htnicolas

You can disable autoindexing on any tunnel by right-clicking, wiht the obvious result that you only get the data from the last iteration. Is that want you want?

Message 2 of 6
(2,594 Views)

Yes Thank you very much!

 

 Erm... Now something else came up, maybe you can help me with that also.

 

The SubVI alone runs fine. However, when I run the entire program, an error message is displayed saying GPIB Read in the SubVi has an error.

This occurs even before the SubVI runs (Vd hasn't incremented at that point).

What does that mean? I can't see what the source of the error is!

 

Thank you so much,

 

Nicolas

0 Kudos
Message 3 of 6
(2,585 Views)

Did you add the correct GPIB addresses in the toplevel VI?

0 Kudos
Message 4 of 6
(2,579 Views)

Yes I did.

If I click 'continue' after the error dialog box pops up, then the SubVI proceeds without any problem... until Vg needs to increment again, and the error pops up again.

 

The problem is, the error doesn't even pop up at every increment of Vg, it seems quite random.

I am deeply perplexed.

Thanks,

 

Nicolas

0 Kudos
Message 5 of 6
(2,574 Views)

I found the cause of the error.

There are 3 stages in this program:

1) Set gate voltage

2) Make Vd sweep

3) Record gate voltage

 

I believe although I placed a flat sequence to process 1) and 2) sequentially, stage 2) and 3) were executing at the same time, and the GPIB Write/Read functions were interfering with each other.

I used a 3 frame flat sequence. Not very elegant I suppose... But it works.

 

 

I'll try with data dependency later, to remove the sequence.

 

 

0 Kudos
Message 6 of 6
(2,550 Views)