LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Building array: write data every user controlled interval

Hi,


I'm sure this has been asked & answered somewhere but I'm having trouble coming across a good search string to find info on it.

 

I'm trying to integrate a data collecting array into an existing program that will only write every user defined interval. I understand array basics, but routing the writing through a case structure isn't working with the basic examples I've been able to find. I have a basic program working, but I don't know how good a solution it is. Is relying on local variables too often a bad habit one should avoid?

 

DataArray.png

The random number is just a place holder for instrument generated data. The Wait was just a debugging tool. The false case only sends false to Writing(local variable).

 

As probably apparent from the above vi, handling arrays is still a weaker part of my labview knowledge and any advice or suggestions would be greatly appreciated.

 

Thanks,

Lron

0 Kudos
Message 1 of 5
(2,835 Views)

You don't need any of the local variables, they just create additional data copies. Use a shift register instead.

 

Why don't you attach your VI and we show you how.

 

 If you want to grow the array by one element each time the case executes, use built array.

 

If you need to write to an indicator in both cases (writing, local of writing), place the terminal outside the case structure! Again, no local variable needed.

0 Kudos
Message 2 of 5
(2,828 Views)

Here's the vi from previous post.

0 Kudos
Message 3 of 5
(2,822 Views)

Try something like this. Modify as needed.

 

 

0 Kudos
Message 4 of 5
(2,808 Views)

Very cool, thanks for the help. I see what you were saying about local variables, I definitely would want to limit using them with arrays. They seemed so convenient and reminded me of text based programming that when I found them I felt like aha! something that makes sense.

0 Kudos
Message 5 of 5
(2,804 Views)