From: Theresa on
Good afternoon!

We are trying to read an HEDL 5540 encoder using a NI 6024 card in matlab. We've hooked up Channel A to PCI8/GPCTR0_Source and Channel B to DIO6.

Below is the code we have so far. We don't think we're successfully reading the PCI8 pin.

handles.dio = digitalio('nidaq','Dev1');
handles.ai = analoginput('nidaq','Dev1');
hline = addline(handles.dio, 0:7, 'in');
fc=2000;
addchannel(handles.ai,0:7);
set(handles.ai,'InputType','SingleEnded');
set(handles.ai,'TriggerType','HwDigital');
set(handles.ai,'TriggerRepeat',10000);
set(handles.ai,'HwDigitalTriggerSource','PFI8');
set(handles.ai,'TriggerCondition','PositiveEdge');
set(handles.ai,'TriggerFcn',{@encodercallback,handles})
start(handles.ai)

Any help would be much appreciated!

Theresa