Well I’ll try to explain to you better the problem. I’m acquiring two frequencies with a PCI 6602 and six analog channels with a PCI AT MIO 16 E1: I’m doing buffered acquisition. I’ve built three different VI and I’m using the multithreading. I start acquisition without problem;to save on file during acquisition I have a global variable boolean that start the saving in all the Vis. The global variable doesn’t guarantee me that in all the Vis the saving starts at the same time; is ther a way to syncronize the saving with anexternal botton without using the global variable? Well I use a buffer so when I start the saving the buffered datas goes to file and I don’t know in wich time those datas have been acquired. When I save analog datas, thanks to the function ”get waveform components” I know from the timer ”to” in wich time I’ve acquired them instead for the frequencies I can’ t do it.Is there a way to solve this problem?
O.K., The problem is synchronisation. First of all, I would not let individual subvi-parts of your main application save data. Instead, I would copy the data to a memory-vi that holds the data collected from the analog and digital boards. From another part of the program I would call this memory vi and save it's content to file.
I'm not familiar with the PCI 6602 board but is it not possible to synchronise it's measurements (measuring frequency is basically counting a number of pulses during a defined time) with the MIO board analog inputs acquisition time? It mght be an idea to measure the frequency faster, say 10 times as often as the analog acquisition (all samples). Temporarily save the results to the memory vi. The last frequency result in memo ry is the last you measured so you could reconstruct a given frequency at a given moment in recent history. This is all very non-real time, but at least gives you control over the measurements. If this fails you could think of building extra electronics (or better, using the division options of your counter board). Take an extra analog input channel and connect this to a digital output of he counter-card. Connect the counter input to the frequency-signal. Postprocessing the data saved to disk (and recalculating the original frequency) gives you the result you want.
If your PCI-6602 is reading the frequencies into a buffer (which you could do), then you can synchronize the acquisitions with a RTSI (Real-Time System Integration) line. The only thing is that you need a RTSI cable for PCI cards. Without that, you can't do RTSI timing. Basically, you can set up your acquisitions to start when a RTSI line is toggled, and then toggle the RTSI line with code to start both acquisitions at the same time. Then you can get the start time from the waveform component of one of the acquisitions, and that time will be for both.