LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Array into Cluster

Hello,
 
 
Goal: slope/intercept indicator into a cluster indicator.
 
how do I go about doing this for this attached vi?
 
Thanks.
0 Kudos
Message 1 of 9
(3,861 Views)
Just drop an empty cluster on the front panel and place the indicators in it.

Lynn
0 Kudos
Message 2 of 9
(3,852 Views)
Just bundle them and create an indicator for the bundle output.
 

Message Edited by altenbach on 12-19-2005 01:42 PM

0 Kudos
Message 3 of 9
(3,850 Views)

Hello,

Thanks everyone for your suggestions. They are very useful.

I am having problems with an error that has motivated my subvi from an array to a cluster.

This is the error:

"Argument error; the number of columns does not equal the number of parameters."

What does this mean? I looked argument and parameters up in the dictionary, and I believed I fixed the issue but it tells me I still have the above problem.

Thanks again for your input.

0 Kudos
Message 4 of 9
(3,815 Views)
Do you know where this error is generated? What was the error code? Does it really occur in the code you showed in the first message or elsewhere later?
 
Please provide a sample data file and yor code that shows the error.
 
 
Some possible errors that can occur with linear fit (but they would generated different error codes):
  1. You have only a two-column file. In this case you need columns 0 and 1 (column 2 does not exists) error -20002
  2. You have only one row, thus only one data point. error -20006.
0 Kudos
Message 5 of 9
(3,806 Views)

Hello,

I have attached in Word, the error I am getting in the code.

I have also attached the subvi slope-yintercept.vi and the calibration in notepad that I am getting my slope/intercept.

Thanks for your input.

Download All
0 Kudos
Message 6 of 9
(3,795 Views)

Hello!

From the attached documents it is unclear to me what your program is doing (or how the database operations are/are not related to the first question), but I believe that the problem is the number of parameters you are passing to the database function.  This error is a runtime error meaning that you (probably) have everything wired correctly, and are just passing an incorrect number of arguments to the VI.

From the help of the Database Insert VI:

"The insert is performed on the columns in the columns array, or if the columns array is empty, all columns in table are used. The data input can either be a single element or a cluster with each cluster element corresponding to a column in the table. The order of the elements in the cluster determines which column each element is inserted into. Thus, the number of items in the cluster must equal the number of elements in the columns array, or if the columns array is empty, the number of items in the cluster must equal the number of columns in the table. In the case where data is a single element, the columns array must have one element, or there must be one column in the table. If create table? is set to TRUE, the VI attempt to create the table if it does not already exist."

I would start with this and make sure that everything matches up.

Hope this helps,




Travis M
LabVIEW R&D
National Instruments
0 Kudos
Message 7 of 9
(3,776 Views)

Hello,

I believe your observation is correct.  I have one idea for a solution and it is this:

For my slopeintercept.vi (found in first comment above), I believe I have to divide my data in notepad in 2D array or 1D array from my existing data in calibration which is 3D. This I believe would solve the parameter/argument problem.

Do you have any suggestions on how I can do this?

Thanks.

My data in notepad is enclosed to show you what my I mean by 3D.

0 Kudos
Message 8 of 9
(3,752 Views)

Hello!


I do not exactly know what you need to do with the data, but if you are asking about reading the information from the text file for use in LabVIEW, this can be done quite simply (on smaller files like this) with the read characters from file, then read from spreadsheet string.  Once you have the file of data represented as a 2-D array of numbers it’s just up to you to extract the information you are interested in for storage.  If the VI expects a cluster with 3 numbers, you can create a cluster with three elements from the items in the data array.  The attached example reads your text file and stores the numbers in a 2-D array of double-precision numbers.  From that point -- for demonstration purposes -- this VI converts each row in the array into a cluster of 5 numbers.

Hopefully this helps!



Travis M
LabVIEW R&D
National Instruments
0 Kudos
Message 9 of 9
(3,728 Views)