From a465c4c9caef1feb21476cb21a079871a41f4c54 Mon Sep 17 00:00:00 2001 From: MPIBR-kretschmerf Date: Fri, 3 Feb 2017 11:39:00 +0100 Subject: [PATCH] Added camera signal P0.3 as input and removed shutter listening --- NIDAQmxInterface.cpp | 26 +------------------------- NIDAQmxInterface.h | 3 +-- 2 files changed, 2 insertions(+), 27 deletions(-) diff --git a/NIDAQmxInterface.cpp b/NIDAQmxInterface.cpp index adc1469..5c47eae 100644 --- a/NIDAQmxInterface.cpp +++ b/NIDAQmxInterface.cpp @@ -31,7 +31,7 @@ void NIDAQmxInterface::DAQmxInitializeInterface() /* configure digital read task */ DAQmxErrChk(DAQmxCreateTask("DigIn", &daq->di_port)); DAQmxErrChk(DAQmxCreateDIChan(daq->di_port, "Dev1/port0", "", DAQmx_Val_ChanForAllLines)); - DAQmxErrChk(DAQmxCfgChangeDetectionTiming(daq->di_port, "Dev1/port0/line2,Dev1/port0/line6", "Dev1/port0/line2,Dev1/port0/line6", DAQmx_Val_ContSamps, 1)); + DAQmxErrChk(DAQmxCfgChangeDetectionTiming(daq->di_port, "Dev1/port0/line2,Dev1/port0/line3,Dev1/port0/line6", "Dev1/port0/line2,Dev1/port0/line3,Dev1/port0/line6", DAQmx_Val_ContSamps, 1)); DAQmxErrChk(DAQmxRegisterSignalEvent(daq->di_port, DAQmx_Val_ChangeDetectionEvent, 0, ChangeDetectionCallbackWrapper, this)); /* configure digital write task */ @@ -265,30 +265,6 @@ int32 CVICALLBACK NIDAQmxInterface::FcnCbckDetectDI(TaskHandle taskHandle, int32 if (read) { - /* SHUTTER ON condition, SHUTTER line changes from 0 to 1 */ - if (((daq->di_bit_prev & DAQ_PORT_DI_SHUTTER) == DAQ_PORT_NULL) & - ((daq->di_bit_now & DAQ_PORT_DI_SHUTTER) == DAQ_PORT_DI_SHUTTER)) - { - daq->di_cntr_imaq++; - daq->di_cntr_frame = 0; - - /* switch OFF box internal resonance generator */ - //DAQmxTriggerDO(DAQ_PORT_DO_FREQGEN, FALSE); - DAQmxSetDO(DAQ_PORT_DO_FREQGEN, FALSE, FALSE); - qDebug()<< "switch OFF box internal resonance generator"; - - } - - /* SHUTTER OFF condition, SHUTTER line changes from 1 to 0 */ - if (((daq->di_bit_prev & DAQ_PORT_DI_SHUTTER) == DAQ_PORT_DI_SHUTTER) & - ((daq->di_bit_now & DAQ_PORT_DI_SHUTTER) == DAQ_PORT_NULL)) - { - /* switch ON box internal resonance generator */ - //DAQmxTriggerDO(DAQ_PORT_DO_FREQGEN, FALSE); - DAQmxSetDO(DAQ_PORT_DO_FREQGEN, FALSE, TRUE); - qDebug()<< "switch ON box internal resonance generator"; - } - /* FRAME condition, line 2 changes from 1 to 0 */ if (((daq->di_bit_prev & DAQ_PORT_DI_FRAME) == DAQ_PORT_DI_FRAME) & ((daq->di_bit_now & DAQ_PORT_DI_FRAME) == DAQ_PORT_NULL)) { diff --git a/NIDAQmxInterface.h b/NIDAQmxInterface.h index 834874d..139eb1f 100644 --- a/NIDAQmxInterface.h +++ b/NIDAQmxInterface.h @@ -55,8 +55,7 @@ class NIDAQmxInterface: public QObject static const int DAQ_PORT_DI_SHUTTER = 0x01; static const int DAQ_PORT_DI_BACKLIGHT = 0x02; static const int DAQ_PORT_DI_FRAME = 0x04; - - static const int DAQ_PORT_DI_CAMERATRIGGER = 0x8; + static const int DAQ_PORT_DI_CAMERATRIGGER = 0x08; // static const int DAQ_PORT_DI_AIR = 0x08; // static const int DAQ_PORT_DI_WATER = 0x10;