Hi,
I'm using SCXI-1600 DAQ module with SCXI-1100 multiplexer
and SCXI-1163 module for digital control.
The Delphi software reads all 32 analog channels via
SCXI-1100, and sometimes controls hardware using SCXI-1163.
The problem is that sometimes (once per 3-4 days) software looses SCXI connection. The front LED activity indicator doesn't blink, but software doesn't have any error
status messages and shows that everything is fine
(with the stable analog readings).
Can someone help me with this strange problem?
Thanks, Peter (pkravt[at]mail.ru).
All SCXI operations are executed in a separate thread.
Simplified code is follows:
procedure TDAQThread.Execute;
begin
...
// Initialize SCXI tasks
DAQErrorChk(DAQmxCreateTask('AI task', @TaskHandle));
DAQErrorChk(DAQmxCreateAIVoltageChan(TaskHandle,'SC1Mod3/ai0:31','',DAQmx_Val_Cfg_Default,-10.0,10.0,DAQmx_Val_Volts,nil));
DAQErrorChk(DAQmxCreateAIVoltageChan(TaskHandle,'SC1Mod4/ai0:31','',DAQmx_Val_Cfg_Default,-10.0,10.0,DAQmx_Val_Volts,nil));
DAQErrorChk(DAQmxCreateTask('DO task', @DOTaskHandle));
DAQErrorChk(DAQmxCreateDOChan(DOTaskHandle,'SC1Mod2/port0','',DAQmx_Val_ChanForAllLines));
DAQErrorChk(DAQmxCfgSampClkTiming(TaskHandle,'',200.0,DAQmx_Val_Rising,DAQmx_Val_FiniteSamps,2));
while not Terminated do begin // Until thread stops
...
AcquireAI;
...
UpdateValves;
...
// here goes delay for at least 3 seconds
end;
...
end;
procedure TDAQThread.AcquireAI;
Var i :integer;
data: array [0..4096] of double;
read: LongInt;
begin
DAQErrorChk (DAQmxReadAnalogF64(TaskHandle, 2, 5,DAQmx_Val_GroupByScanNumber,@data,256,@read,nil));
...
end;
procedure TDAQThread.UpdateValves;
var i: integer; read: LongInt; DO_data : array [0..31] of byte;
begin
...
DAQErrorChk(DAQmxWriteDigitalLines(DOTaskHandle, 1, 1, 2.0, DAQmx_Val_GroupByChannel, @DO_Data, @read, nil));
...
end;