I created a simple VI with LabView that inputs a number, converts it to a boolian string, and outputs the channels corresponding to the binary number on a DAQ (PCI-6221). For example, if I input 8, line 3 (port0) will go high. Inputting 9 will bring lines 0 and 3. Inputting 10 would bring lines 3 and 2 high, etc.
This program works in LabView. I then used the Math Interface Toolkit to convert the VI into a MEX file (dll) to be called from MATLAB. I named the MEX function DAQtrig, and the matlab syntax is DAQtrig(numeric); where numeric is a number (so like DAQtrig(8);). Whenver this line is called in matlab, the DAQ responds and brings the right lines high, but then the MATLAB program stops responding. It will not freeze the computer, but matlab will not longer accept any user input. The program is listed as "busy" in the matlab status bar. No errors are generated. I must terminate the thread (ctrl+alt+del -> task list) in order to stop the matlab program. The lines remain high until I run a LabView program that has access to the DAQ digital I/O lines.
Any suggestions? Any further info you need?
Thanks,
Steve
Department of Biomedical Engineering
UW-Madison