LabVIEW

cancel
Showing results forΒ 
Search instead forΒ 
Did you mean:Β 

how to save in an array

Hello everybody,

I have been working on a project and faced a big problem which is putting me in a real difficult situation. Probably it will be a very basic question but anyway I could not do it πŸ™‚
I am doing a counting operation with 6602 counter card. As you can also see in the attachment vi, I configured the necessary functions and having no problem with the hardware and able to count the digital signals coming on source of CTR0 by using an external gate signal. My problem is: I want to save the number of counted signals during one gate period into an array continuously. The array should be 1D and extend until I stop the program. Then I want to display this array in a graph simultaneously while the signals are coming. I also want to save them into a file after I stop the program.
Although I have several steps, I could not even succeed to save them into the array even 😞 How am I be able to do that? I put a note on the block diagram showing which data I want to store in the array.
I would be really thankful if you could show me some directions about that...
0 Kudos
Message 1 of 5
(2,944 Views)
Either built your array (1) using a shift register or (2) using autoindexing.

Method (1) is useful if you want to monitor the progress.
Method (2) is useful if you only need the data after the run.

The attached quick modification shows both. (LabVIEW 7.0)

I could not find your note on the diagram that would show which data to place into an array, so I took a wild guess. Modify as needed. Sorry, I don't have any DAQ installed, so I cannot test.

(Additional note: If your VI runs for a long time and you have a good upper estimate for the final array size, it would be more efficient to initialize the shift register with the final array size, then replace array elements as you go. It will avoid memory reallocations during the run.)
Message 2 of 5
(2,929 Views)
I am sorry, I forgot to specify which data I am mentioning in the first post. Here you can see it.
Thanks again.
0 Kudos
Message 3 of 5
(2,921 Views)
Well, the solution is about the same. πŸ™‚
0 Kudos
Message 4 of 5
(2,915 Views)
Thanks a million altenbach! It is working perfect.
Thanks a lot!!
Take care..
0 Kudos
Message 5 of 5
(2,878 Views)