 Laura F.
		
			Laura F.
		
		
		
		
		
		
		
		
	
			02-23-2006 01:37 PM
Hi Munir,
I have looked at your pictures and the error is telling us the trouble - that each array for your different channel is a different size (or maybe just one array is a different size). You can break apart the waveform with the Get Waveform Components function and then use the Array Size function to determine what the array sizes are.
There are a few techniques that you could use to swap the waveforms to different channels. The easiest in my opinion is using a case structure to switch the outputs depending on the case. I've done a really simple example and am attaching it. You might want to do something a little more complex, with the array operations taking place inside the case structure.
Hope this helps,
Laura
 mbhatti2000
		
			mbhatti2000
		
		
		
		
		
		
		
		
	
			03-01-2006 11:19 AM
 Laura F.
		
			Laura F.
		
		
		
		
		
		
		
		
	
			03-02-2006 01:23 PM
Hello Munir,
I am glad to hear that you've got part of your program complete!
To answer your questions,
1. Yes, the stimulation (output) and measurement (input) portions can work in the same VI. If you are not passing data between the two portions, you could place the code inside separate while loops if necessary.
2. There are some programming precautions to consider depending on how your VI needs to work. If you plan to place both the input and output in the same loop be sure to put all of the configuration and start task VIs outside of the loop, as well as any stop and clear task VIs. You will need to take into account that a DAQmx Read function when doing a continuous operation can take a while to return data depending on your selections. For example, if you choose a sample rate of 1000 Hz and are reading 5000 samples each iteration, it will take 5 seconds for enough data to be acquired to return. If you need to update your output waveform during this time, you will have to wait until the next iteration. I don't think this will be a big problem, you can adjust your samples to read so that it works best for your program, I just want you to think about this.
3. Any example VI will work for measurements in this range. The important thing is that you set your maximum and minimum values correctly. For example, you could set the minimum to -100 mV and the maximum to 100 mV so that the driver applies the correct amount of gain to give you the best resolution for your measurement.
4. I am not familiar with EDF format and cannot find much information here about it. However, there are examples of writing to a text file in the example finder such as Write to Text File.vi (search for "text"). If you have further file I/O questions I would recommend starting a new thread in the LabVIEW forum since I am not an expert at it, and I am not sure how many people are looking at this thread.
Hope this helps!
Laura
 mbhatti2000
		
			mbhatti2000
		
		
		
		
		
		
		
		
	
			03-03-2006 08:43 AM