LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Collecting data - how to format into array?

I'm collecting data from an instrument, formatting it as a string, and throwing it into a text file. As of now, it records data, goes to the next line, and records the next data point, etc. But what if I want to have it so that it starts a new line every six data points? For example" [datapoint1 datapoint2 ...... datapoint6 -> new line -> datapoint7 datapoint8....]

 

I was thinking maybe I could fill a 1D array and then resize it to something like [m/6 by 6], so that I would have 6 columns. I could also initialize a something by 6 array and have Labview fill in each entry in order. Unfortunately, I'm stuck, and I need some advice on what to do. I must not be understanding something about how arrays work in labview. I have attached my work so far. Any help would be appreciated!

 

 

Message Edited by questiona3 on 12-31-2009 11:38 AM
0 Kudos
Message 1 of 14
(4,338 Views)
Could you clean up your block diagram and repost. You have wires going in every direction, hidden under other wires, etc., making it very difficult to read.
0 Kudos
Message 2 of 14
(4,318 Views)

Obviously, you would need to build your array in a shift register.

 

Currently, you are taking a single string with each iteration and convert it into an array with exactly one element. No amount of reshaping will get your history data. 😉

 

I no longer have access to LabVIEW 7.1, so see how far you get and ask again when you get stuck. 😉

0 Kudos
Message 3 of 14
(4,316 Views)

OK, here's a quick draft, see if it makes sense.

 

Basically, you built the array in a feedback node and whenever you have six elements, you clear the feedback node and write the line with the six new elements to the file.

 

This example is very primitive and should be polished. Still it should get you some ideas. 😉

 

Message Edited by altenbach on 12-31-2009 11:37 AM
0 Kudos
Message 4 of 14
(4,307 Views)
Thank you very much for your help. I won't have a chance to work on it until next week, but I will let you know how it goes!
0 Kudos
Message 5 of 14
(4,290 Views)

altenbach wrote: 

Basically, you built the array in a feedback node ...


To poster: In LabVIEW 7 there is no feedback node, so you'll just have to make do with stone tools such as the quaint shift register. Smiley Wink

 

Shift registers are explained in the LabVIEW manual.

 

0 Kudos
Message 6 of 14
(4,270 Views)

smercurio_fc wrote:

altenbach wrote:  To poster: In LabVIEW 7 there is no feedback node, so you'll just have to make do with stone tools such as the quaint shift register. Smiley Wink

Actually, the VI in the first post is LabVIEW 7.1 and does actually contain a feedback node. It is just not used correctly. 😉

0 Kudos
Message 7 of 14
(4,257 Views)

altenbach wrote:

smercurio_fc wrote:

altenbach wrote:  To poster: In LabVIEW 7 there is no feedback node, so you'll just have to make do with stone tools such as the quaint shift register. Smiley Wink

Actually, the VI in the first post is LabVIEW 7.1 and does actually contain a feedback node. It is just not used correctly. 😉


Sorry - didn't open the VI. Just read LabVIEW 7 for some reason. 

0 Kudos
Message 8 of 14
(4,240 Views)

LabVIEW 7 has feedback nodes they are not as efficient as shift registers, or feedback nodes in later versions.

 

Ton

Free Code Capture Tool! Version 2.1.3 with comments, web-upload, back-save and snippets!
Nederlandse LabVIEW user groep www.lvug.nl
My LabVIEW Ideas

LabVIEW, programming like it should be!
0 Kudos
Message 9 of 14
(4,199 Views)

TCPlomp wrote:

LabVIEW 7 has feedback nodes they are not as efficient as shift registers, or feedback nodes in later versions.

 

Ton


Hmmm.. for some reason I thought LabVIEW 7 did not have feedback nodes, but LabVIEW 7.1 did. Not sure why I thought that. 

0 Kudos
Message 10 of 14
(4,195 Views)