LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

read from spread sheet to cluster

Hello,

can someone show me how to read from a spreadsheet, 

and make them into a cluster like the constants above?

how would i make it possible?

i am unfamiliar with different data types and clusters

thanks

Untitled.png

Download All
0 Kudos
Message 1 of 11
(4,505 Views)

i am unfamiliar with different data types and clusters

 


 

Either find a friend who knows LabVIEW and will do this for you, hire someone who knows LabVIEW and will do this for you, or learn LabVIEW.  If you don't know the "different data types" nor clusters, you really have a long way to go, and even if we were to do this for you, you'd probably only have more questions.

 

If you want to learn it yourself, there have been several recent replies in the Forum within the last week with suggested on-line tutorials to get you started.  Note that you will have to do a little work ...

 

BS 

0 Kudos
Message 2 of 11
(4,486 Views)

thanks for your help!

i am stuck in a problem, that's why i am here at the forum for help.

and yes. i have learned about clusters and different data types.

i am just not familiar with this situation.

if you are not willing to help or help me point to the right place, WHY ARE YOU ANSWERING THIS THREAD?

where are the links?

i have searched this forum before i post my question.

if you have nothing nice to say. please keep your comments to yourself.

great day to start a monday!

 

0 Kudos
Message 3 of 11
(4,473 Views)

You could cast every element of each row into the target data type.  Also, it looks like you rolled your own version of the Read From Spreadsheet File.vi

 

cluster.png

 

The tone in your answers to the last poster's questions may cause folks to ignore your questions. You may end up in this thread. 😄

Jim
You're entirely bonkers. But I'll tell you a secret. All the best people are. ~ Alice
For he does not know what will happen; So who can tell him when it will occur? Eccl. 8:7

Message 4 of 11
(4,429 Views)

My apologies.  You seem to be correct -- I went looking for the (frequent) posts from clueless people that resulted in someone (GerdW?  Hooovahh?) posting links to training, but couldn't find them -- perhaps the moderator removed them.

 

But I found something almost as good here -- the links to which I was referring are near the bottom.

 

And here is some information that might help you with your question (even).  The data in a .csv file is always text.  When you do a Read from Spreadsheet File, you can choose to convert all of the data to a specific format (say, double), but if your data is mixed, as yours seems to be, you are better off reading it as string.

 

Now you have a 2-D array of string.  If you pass this through a For loop, it will pick out each row.  If you pass the row into a For loop, it will pick out each column entry.  You know the format of the spreadsheet, hence you can interpret the columns as you desire (e.g. String, String, String, String, Double, Double, Double, String).  I'd recommend putting a Case statement inside the inner For, with the For loop index wired to the Case selector, and putting a "Scan from String" appropriate for each column in each Case (and don't forget the Default case, which you may be able to leave blank).  Once you have the element in the correct format for the Cluster, you can Bundle (I recommend defining a TypeDef for the Cluster, and using Bundle by Name -- harder to make silly mistakes).  When you are done with the inner For loop, you'll have one Cluster built (with each inner For setting one element of the Cluster) -- simply pass this Cluster out of the outer For loop using an indexing tunnel and there's your Array of Clusters.

 

BS

Message 5 of 11
(4,428 Views)
"great day to start a Monday". Since its Tuesday, no wonder you are lost and confused.:-)
0 Kudos
Message 6 of 11
(4,412 Views)

lol.

sorry. i just got in today.

i was sick yesterday ...and was in a grumpy mood.

i seriously thought today was a monday.

but thanks 

 

0 Kudos
Message 7 of 11
(4,400 Views)

Untitled.png

 

i set up the case like what was sugguested,

but my values are off.

is it possible to make it look like the same TYPE instead of 

constants number for that type?

 

I just like the idea of thermocouple type to be "T"

instead of 1114990

eventhough they are equivalent.

just wondering.

thanks 🙂

0 Kudos
Message 8 of 11
(4,364 Views)

Make sure your output cluster is using the same type ring as your input cluster.  It doesn't look like they are the same (digital in the output, ring on the input).



There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 9 of 11
(4,344 Views)

@super_saiyans wrote:
i set up the case like what was sugguested,

but my values are off.

is it possible to make it look like the same TYPE instead of 

constants number for that type?

[...]


I saw that a little while after posting.  I made an array of indicator out of the cluster constant and it looked right when I replaced the original indicator.  Then I ran the program again...  The values are correct, the representation is not.  I don't know what's happening, but I'll try again in the morning.

Jim
You're entirely bonkers. But I'll tell you a secret. All the best people are. ~ Alice
For he does not know what will happen; So who can tell him when it will occur? Eccl. 8:7

0 Kudos
Message 10 of 11
(4,335 Views)