LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Store decimal point data into array

Solved!
Go to solution

I have a set of data

 

lets say

 

"3.45, 1.21, 3.67, 1.23, 4.78"

 

I would like to store those data into an array. So how would i be able to store them as an array and yet be able to view the data?

0 Kudos
Message 1 of 15
(5,879 Views)

I'm not sure what you would be asking about.  It seems like you haven't taken any LabVIEW tutorials by the nature of your question.

 

I would recommend looking at the online LabVIEW tutorials
LabVIEW Introduction Course - Three Hours
LabVIEW Introduction Course - Six Hours

0 Kudos
Message 2 of 15
(5,867 Views)

Hi Olataro,

 

I would like to know what do you mean by store? do you mean to just write to an array or log the data for future reference(file/database..).

______________________________________________
Kudos are welcome
0 Kudos
Message 3 of 15
(5,859 Views)

HI guys. Thanks for your reply.

 

@ravens: Actually no, I've attended 5 day courses on FPGA system of the NI RIO board before. They primarily focus on setting up the board and also conducting timing operations. So unfortunately. i didnt receive much training in initializing arrays using labview (its quite confusing compared to C; especially if you have gotten used to program in c, haha). But, thank you for giving me hte link. I know how to initialize basic array from the youtube video Labview tutorial, but now I'm wondering how to create an array, like that in C programming.

 

@gogineni: Hmmm, it is kind of like both actually.

 

The coding I'm used to in C programming is something like this:

" arrayA[5]= {1.21, 1.34, 5.56, 5.32,4.64} "

I would like to be able to change the array easily without having to manually input the data one by one like the method in this video

http://www.youtube.com/watch?v=_GlQ1riWjPc

So basically I'm wondering if there are better methods than this video to input data into an array and store it? without using a numeric control.

0 Kudos
Message 4 of 15
(5,838 Views)

How do you have the data now?

 

You can create an array constant on the block diagram.  You can use a control.  You can save the data in the array control as the default data.

 

You can use file functions such as Read from "Spreadsheet" file to read the data in from a text file.

0 Kudos
Message 5 of 15
(5,826 Views)

While personally I am opposed to such code if you really wanted to the below code snip would work...

 

New Bitmap Image.png

Message 6 of 15
(5,802 Views)

Why go through all of  that when you could just use a spreadsheet string to array function?

 

Message 7 of 15
(5,788 Views)

Oooo.  I have not messed around with the spread sheet functions before!  I like that...

Much better than mine. Smiley Tongue

0 Kudos
Message 8 of 15
(5,776 Views)

Hi Olataro,

 


@Olataro wrote:

 

 The coding I'm used to in C programming is something like this:

" arrayA[5]= {1.21, 1.34, 5.56, 5.32,4.64} "

I would like to be able to change the array easily without having to manually input the data one by one like the method in this video

http://www.youtube.com/watch?v=_GlQ1riWjPc

So basically I'm wondering if there are better methods than this video to input data into an array and store it? without using a numeric control.


Control and indicators are input and output terminals for the block diagram. When you say "without using a numeric control", then what is the source of data?
Do you want to read data from file and write it into an array? if so then as Ravens suggested "You can use file functions such as Read from "Spreadsheet" file to read the data in from a text file." or

Do you just want to define an array with these values as seen from your C code? To just write and display data in an array, you can just connect an array contant to the array indicator as i have shown in my previous post or

As Ravens said "You can save the data in the array control as the default data" but the user can change it since it is a control.

 

Since you mentioned about FPGA cRIO course, are you acquiring data which you want to write into an array?

 

______________________________________________
Kudos are welcome
0 Kudos
Message 9 of 15
(5,754 Views)

@don: Hmm i dont really get the your VI design. Could you explain a little?

 

@raven: Hey! Thanks! Thats what I'm actually trying to do, but I'm having trouble trying to make it work! I'll try your design first before asking further! Thanks for the reference! By the way, if you are familiar with the 3D surface graph VI, could you help me a little bit with that (its in another topic) The NI trainer that i asked for guidance during the course had trouble understanding how to use that VI as well

 

@Gogineni: Yup, the idea is to obtain the data from a spreadsheet and sort them into 3 different arrays, and then pass them to the 3D surface VI. However, as Altenbach had suggested to me(from another topic),  i might be making the wrong array so i decided to see if there are alternative ways to do so. I'm currently using the method shown on the youtube video.

0 Kudos
Message 10 of 15
(5,735 Views)