LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

dividing a column of data

I have written some labview code to control an agilent 4156C parameter analyzer. It is configured to perform a primary and secondary sweep measurement. The problem is that when the data is read from the machine it is written to text in a single column that looks like this:

 

V1 I1 V3

1 54 0

2 53 0

3 54 0

4 52 0

5 53 0

1 54 1

2 53 1

3 54 1

4 52 1

5 53 1

 

I would like to somehow be able to convert the data to this format:

 

V1 I1 V3 V1 I1 V3

1 54 0 1 54 1

2 53 0 2 53 1

3 54 0 3 54 1

4 52 0 4 52 1

5 53 0 5 53 1

 

The data is read from the parameter analyzer and sent out via an orange measurement (1-D array of Numeric type double) wire.

 

Is there a way I can alter the format of this data within the labview code or must it be done manually? I am very new to LabVIEW, sorry if I am misinterpreting or asking the wrong question.

 

Thanks

 

0 Kudos
Message 1 of 10
(2,749 Views)

Not sure if this is most efficient but it works. I was hoping to use reshape array but couldn't get it to work. Maybe someone will come along with something better. If your array is always 10 rows you could use split array, but this will work if your array is 10, 20, 100, 1000 rows etc, as long as the number of rows is a multiple of 10.

 

 

 

Edit: didn't see you were new to LabVIEW so I didn't show the labels. The VIs from left to right are: Array size, index array, quotient remainder, add (duh), index array, build array.

Message 2 of 10
(2,742 Views)

Thank you for your response. I tried following your solution but LabVIEW will not allow me to connect the functions the way that you have shown it in the picture. Either i am unable to correctly view the way the terminals are connected from the image provided or the datatype that I am using is unable to be manipulated in the manner you have specified. The array that I am hoping to manipulate is carried through an orange wire. I believe that means that it is a "Measurement (1-D array of) Numeric (double [64 bit real])". From what labview tells me, the blue wire is of type "long"? I am not sure if that makes a difference but LabVIEW will not let me connect the functions you have shown. 

 

Maybe you could also provide your actual VI so that I can be sure I am connecting them in the same fashion?

 

Thanks again for your help! much appreciated!

0 Kudos
Message 3 of 10
(2,715 Views)

Right-click the build array and select concatenate inputs. Then it should work. Also, that picture is a VI snippet. If you are using LV 2010 you can just click and drag it onto your block diagram, and I do not need to attach the VI. If you are not using LV 2010 let me know and I will save it back.

 

You can change the data type by clicking on the array: right-click-> representation -> <data type>.

0 Kudos
Message 4 of 10
(2,701 Views)

thanks, i was able to drag your vi into labview. But the array size wont connect to the index array and the index array wont connect to the quotient function. any ideas?

 

Thanks for your quick response!

0 Kudos
Message 5 of 10
(2,695 Views)

Okay, so i got this program to work. Thank you for all of your help but after studying the code you wrote i realized taht this only works to separate a set of data into two segments. 

 

I am essentially measuring I-V curves for a MOSFET, i need to sweep a range of voltages, step the gate voltage, and sweep again. This code will only allow me to sweep the gate voltage for one step. Is there a way to code this to work for more than one step? from what i see, the reshape array function must be expanded in order to do this, which is not possible to change between iterations of code. I know this might sound confusing, let me know if you need a clarification on what im trying to do. I have attached a typical set of data that i am getting.

0 Kudos
Message 6 of 10
(2,687 Views)

And what do you want the output file to look like for multiple gates? You never gave this in your example ( I don't think; unless I'm misunderstanding). I will take a guess at what you want thought. At that point I think it's time for you to try some things on your own, or take some tutorials on LabVIEW.

0 Kudos
Message 7 of 10
(2,667 Views)

@for(imstuck) wrote:

And what do you want the output file to look like for multiple gates? You never gave this in your example ( I don't think; unless I'm misunderstanding). I will take a guess at what you want thought. At that point I think it's time for you to try some things on your own, or take some tutorials on LabVIEW.


None of my guesses I'm trying really make sense, so I'll wait to hear back from you with more clarification.

0 Kudos
Message 8 of 10
(2,665 Views)

Hey, 

 

This is the format that I am trying to obtain. I really appreciate all the help you have given me. I have been doing tutorials and studying labview like you have suggested. Its just that the tutorials that they have dont delve deep into all the types of functions. I have been studying the functions with the information given on ni's website, it is just taking me a while to understand.

 

Thanks again! 

 

0 Kudos
Message 9 of 10
(2,661 Views)

Your array had some extra whitespace between X_Value and V1 in the header so I removed that. I have attached the modified text file that I used. I believe you can also use the read from spreadsheet file VI and tell it to ignore the headers (or row 1) but I didn't do that here. If you do that, then you can remove the delete from array.

 

Download All
0 Kudos
Message 10 of 10
(2,648 Views)