I have a question that is similar to the one by AdamPsych from Jan. 22nd.
Similar to his setup, I use the U3 to control 8 parallel lines to set flags for my EEG-System.
Unlike him, I use the FIO-lines, i.e. I have 8 wires that go from FIO0 - FIO7 to pin 2-9 of a DB25 connector, with each pin signalling a different flag (e.g. FIO0 goes to pin 2 and signals "S 1"), and a combination of pins signalling the sum of flags (e.g. FIO0 and FIO1 go to pins 2 and 3 and signal "S 3", a combination of "S 1" from pin 2 and "S 2" from pin 3).
The problem now is, that FIO7 appers to have a faster onset time. When I use all FIO, I not only end up with a flag "S255", but also a Flag "S128" just prior to "S255". Also, FIO0 needs to stay activated longer than the other FIO to be detected by the EEG-System, i.e. appears to have a slower onset time.
When hhoking the U3 to an Oscilloscope, it looks like the FIO7 is faster to reach the output voltage than the other lines.
The code I use looks like this (see attachment for the entire matlab function sendLJ.m 2.28KB 967 downloads)
%% Add Values to Lines
ljudObj.AddRequest (ljhandle, LabJack.LabJackUD.IO.PUT_DIGITAL_BIT, 0,1, 0, 0); % Set FIO0 to "on"
%% Execute the requests.
%% Wait Duration
%% Set Lines back to 0
ljudObj.AddRequest (ljhandle, LabJack.LabJackUD.IO.PUT_DIGITAL_BIT, 0, 0, 0, 0); % Set FIO0 to "off"
I also tried to use "PUT_DIGITAL_PORT" instead of BIT, as this seems to have worked for AdamPsych, but I still have the same problem:
ljudObj.AddRequest (ljhandle, LabJack.LabJackUD.IO.PUT_DIGITAL_PORT, 0,1, 8, 0); % Set FIO0 to "on" with an 8bit-Signal.
Is there any way to change this, i.e. have the same timing for all lines? What exactly is the difference between PORT and BIT? And finally, is there a more elegant solution to send signals over multiple lines at the same time?
Thanks a lot!