LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Alternatives to Collector.VI

Hello everyone,

 

I'm looking for something analagous to the Collector.VI.  I want to take an input signal X (created or acquired using the Simulate Signal and/or a DAQ) and collect 15 seconds worth of data after the user presses a button the front panel.  I am able to do this with the Collector.VI quite simply, but only for a fixed sampling rate. I want the user to be able to control both the sampling frequency and the number of points collected per iteration on the front panel.  This is really only an issue for the signals I've collected via DAQ - the Simulate Signals have fixed sampling rates/samples collected.

 

I don't have the drivers for the DAQ equipment at home, so I'm practicing building my code with the Simulate Signal VI.  I've attached the simple VI I've created - basically a very slightly modified version of a program I found on these forums about writing to a TDMS file.  It's working well, but only if I assume the sampling rate is 1000 Hz. I need to be able to take a sampling frequency the user inputs on the front panel, and always end up with a 15 second recording.  

 

In short - I need a way to wire in the 'number of points collected', which as far as I can tell, can only be changed by double-clicking on the Collector.VI. 

 

Could someone please suggest an alternative to the collector that will allow me to get the same results, but allow the user to modify the sampling frequency?  Any suggestions would be greatly appreciated.

 

Apologies if this is a simple problem.  Very new to LABVIEW, and I've not had much luck scouring the internet for help.

 

Thanks!

 

 

0 Kudos
Message 1 of 2
(2,537 Views)

Hi Caladyn, 

 

Typically, express vis are only recommended for newer LabVIEW users because they have limited functionality. To add the functionality you require, I would recommend building your own collector code. You can do this using queues. 

 

The way that you can build your own collector vi is to build a queue of 15000 elements. Once there are 15000 elements in the queue, every time there is a new data point, the oldest data point is removed from the queue and the new data point is added. A good example to use for getting started with queues can be found in the Example Finder. To access the example finder with a vi open, go to Help -> Find Examples. Then you can search for the "Queue Basics.vi". I'm not quite sure if you want to change the size of the queue dynamically during the program, or if you just want the user to set it at the start of the program. Can you clarify? 

 

Julianne K
Systems Engineer, Embedded Systems
Certified LabVIEW Architect, Certified LabVIEW Embedded Systems Developer
National Instruments
0 Kudos
Message 2 of 2
(2,507 Views)