03-28-2013 09:36 PM
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?
Solved! Go to Solution.
03-28-2013 11:02 PM
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
03-29-2013 12:01 AM - edited 03-29-2013 12:04 AM
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..).
03-29-2013 06:14 AM
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.
03-29-2013 08:00 AM
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.
03-29-2013 10:08 AM
While personally I am opposed to such code if you really wanted to the below code snip would work...
03-29-2013 11:24 AM - edited 03-29-2013 11:27 AM
Why go through all of that when you could just use a spreadsheet string to array function?
03-29-2013 12:29 PM
Oooo. I have not messed around with the spread sheet functions before! I like that...
Much better than mine.
03-29-2013 01:47 PM
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?
03-29-2013 10:16 PM
@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.