LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Array Question

I want to store Data in a Buffer (2000 Datapoints). If the Datapoint 1000 is
higher than a specifies Limit, I want to copy the complete Buffer to Disk.
What is the best way doing this?

Marcel
0 Kudos
Message 1 of 5
(2,864 Views)
You can specify your limits using numeric controls on your front panel or by using constants on your diagram. You can check if Datapoint 1000 is within your limits using Index Array from the Array function palette and using the Greater? function or In Range and Coerce function on the Comparison function palette. To write the array to a file, you can use the Array to Spreadsheet String function on the String function palette.
Look at the array example programs that ship with LabView, including Using Spreadsheet Format.vi. To find the examples, from any LabView window, goto Help >> Find Examples >> Search, then enter ARRAY into the box titled Type a keyword to find.
0 Kudos
Message 2 of 5
(2,864 Views)
Hi,
you can do it in following way:
1. Read your 2000 points into array.
2. Then use "Functions->Array->Index Array.vi" to read the element #1000 from this buffer.
3. Then compare the output of previous function with your limit (use "Functions->Comparison->Greater?")
4. Then use "Case structure" to check the result of comparison.
5. If the value exceeds the limit then use some functions from "Functions->File I/O" palette to save data to disk. You can use "Write to spreadsheet file.vi" to save numeric arrays into TXT files.

Good luck.

Oleg Chutko.
0 Kudos
Message 3 of 5
(2,864 Views)
Thanks for your response. I am struggeling with reading the points in the
array. How can I hav a array with a fixed size ? I tried to understand the
examples in Labview, but it I could not find something like this.

I hope someone can help me.

Marcel


"Oleg" schrieb im Newsbeitrag
news:506500000005000000F80C0100-1042324653000@exchange.ni.com...
> Hi,
> you can do it in following way:
> 1. Read your 2000 points into array.
> 2. Then use "Functions->Array->Index Array.vi" to read the element
> #1000 from this buffer.
> 3. Then compare the output of previous function with your limit (use
> "Functions->Comparison->Greater?")
> 4. Then use "Case structure" to check the result of comparison.
> 5. If the value exceeds the limit then use some fun
ctions from
> "Functions->File I/O" palette to save data to disk. You can use "Write
> to spreadsheet file.vi" to save numeric arrays into TXT files.
>
> Good luck.
>
> Oleg Chutko.
0 Kudos
Message 4 of 5
(2,864 Views)
Use the LabView help to look at the array functions Oleg and I pointed you to. Press Ctrl-H to toggle the context help: it gives basic help for whatever you point to. The LabView examples do show you how to get started. Study their diagrams with the help open.
Look at the attached LabView 6.1 example.
0 Kudos
Message 5 of 5
(2,864 Views)