I am hoping to use the ADC-11 and LabVIEW to write a simple VI that acquires/stores data and when a certain condition is met, the ADC-11's digital output is used to trigger. Does anyone know how I can write to the the ADC-11's digital output? Any example VIs you guys might have that you think may be helpful in what I am trying achieve is also most welcome
To call the UsbAdc11SetDo function you simply need to have the program reference the C:\Program Files\Pico Technology\Pico Full\usbadc11.dll file and define the function. The attached example will show you how to control the two digital outputs. Simply copy the example into the place where you want the outputs enabled.
Thanks very much for your help thus far, However I got one more question.
I only get a single pulse when I write to the digital output even though the condition that turns it on remains true. I would like to know how I can keep the output high and and whether you can keep it high for a defined period after the condition that has turned it on is no longer true.
I am going to assume that the condition that trues it on is actually not remaining true and causing the signal to fall. I simply wired up the open unit and close unit to the example I posted to double check that the functions are working correctly and they are. I fact if I turn the output on it would actually stay on until i either turned it off or disconnected the usb cable. If you want to keep the output high for a defined period and then turn it off you will need to simply add a wait timer into your program before the function to turn the output off. If you post your program I can attempt to look at it for you and give you some ideas as to why it isn't working but the function itself is working correctly.
I have attached my VI. The VI should detect when the breath waveform (a sinewave, approx freq of 0.2 Hz) is below a defined threshold. If it remains below the threshold for a given period i.e. the patient stops breathing, a trigger signal should be sent to a muscle stimulator via the ADC-11 digital output. So my problems now are:
1. I donot think I am getting a digital output when I should
2. The output should only stay high for 10 mins max after which period, it should not be able to be turned on (even if breath level is below the threshold) for the next 30 mins so as to allow the muscle to recover.
Regrading the first issue, I would be grateful if could help me rule out the VI not working. Regarding the second issue, any help/tips on how to implement this would be much appreciated
As you probably already gathered, I have limited experience in Labview, so you help is very much appreciated!
I have attached my VI (the right one this time). The VI should detect when the breath waveform (a sinewave, approx freq of 0.2 Hz) is below a defined threshold. If it remains below the threshold for a given period i.e. the patient stops breathing, a trigger signal should be sent to a muscle stimulator via the ADC-11 digital output. So my problems now are:
1. I donot think I am getting a digital output when I should
2. The output should only stay high for 10 mins max after which period, it should not be able to be turned on (even if breath level is below the threshold) for the next 30 mins so as to allow the muscle to recover.
Regarding the first issue, I would be grateful if could help me rule out the VI not working. Regarding the second issue, any help/tips on how to implement this would be much appreciated
As you probably already gathered, I have limited experience in Labview, so you help is very much appreciated!
I took a real quick look at the vi that you posted and noticed one thing. You do not have the input handle wired into your first UsbAdc11SetDo function. This should be wired to the handle that your open unit call returns. Without this you will not have any DO set...
The function I am using to read from the ADC-11 doesnot have a an output node for handle hence I donot know what to wire to the handle input on the UsbAdc11SetDo function. Could you please tell me how I do this.
Instead of using the LabView single method that was designed around the parallel version of the ADC-11 you need to call the updated USB ADC-11 calls to use the UsbAdc11SetDo. This is because the handle that is wired to this call comes from the USB handle that the open unit call returns. I have attached the example from which you will need to look at and modify for your application. You will want add the UsbAdc11SetDo functions after the stop function and before the close unit function. Also if you want to return values continuously you will want to put your for loop between all the open unit and close unit calls otherwise this will only run one time...
I have set the adc11_run's function method node to "2" and put my while loop between the open unit and close unit calls but I still cannot get the VI you uploaded to continously stream data. Would you by any chance have a VI that uses this function to continously acquires data and also uses the UsbAdc11SetDo function that I can look at?