12-31-2009 11:37 AM - edited 12-31-2009 11:38 AM
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!
12-31-2009 01:09 PM
12-31-2009 01:16 PM
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. 😉
12-31-2009 01:36 PM - edited 12-31-2009 01:37 PM
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. 😉
12-31-2009 04:00 PM
12-31-2009 10:13 PM
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.
Shift registers are explained in the LabVIEW manual.
01-01-2010 01:30 AM
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.
Actually, the VI in the first post is LabVIEW 7.1 and does actually contain a feedback node. It is just not used correctly. 😉
01-01-2010 07:48 AM
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.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.
01-02-2010 09:44 AM
LabVIEW 7 has feedback nodes they are not as efficient as shift registers, or feedback nodes in later versions.
Ton
01-02-2010 09:53 AM
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.