• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Frequently used words (click to add to your profile)

javaandroidc++linuxc#objective-ccocoa誰得qtrubypythongamewindowsbathyscaphephpguic翻訳omegattwitterframeworktestbtronarduinovb.net計画中(planning stage)directxpreviewerゲームエンジンdom

QtSDK と NI-DAQmxBase (Linux) を使った単純なサンプル


Commit MetaInfo

Revisãof15853f1cded7e985ac1237cfe62702285dac622 (tree)
Hora2012-11-01 20:37:02
Autorarakaki <alucky4416@user...>
Commiterarakaki

Mensagem de Log

CHG: USB-621x Debugged. worked.

Mudança Sumário

Diff

--- a/QtSimpleDAQ_CO_PulseGen.pro
+++ b/QtSimpleDAQ_CO_PulseGen.pro
@@ -20,6 +20,7 @@ HEADERS += mainwindow.h \
2020
2121 FORMS += mainwindow.ui
2222
23+unix:INCLUDEPATH += /usr/local/natinst/nidaqmxbase/include/
2324
2425 unix:LIBS += -lnidaqmxbase \
2526 /usr/local/lib/LabVIEW-2012/linux/libstdc++.so.5
--- a/daqthread.cpp
+++ b/daqthread.cpp
@@ -79,12 +79,13 @@ void DAQThread::run()
7979 switch (state) {
8080 case State_IDLE:
8181 if (event == Ev_Start) {
82- qDebug() << QString("start pulse output: freq = %1, ducy = %2").arg(pulse_freq).arg(pulse_duty);
82+ qDebug() << QString("start pulse output: freq = %1, duty = %2").arg(pulse_freq).arg(pulse_duty);
8383 // int32 DAQmxBaseCreateCOPulseChanFreq (TaskHandle taskHandle, const char counter[ ], const char nameToAssignToChannel[ ], int32 units, int32 idleState, float64 initialDelay, float64 freq, float64 dutyCycle);
8484 DAQmxErrChk (DAQmxBaseCreateTask("", &taskHandle));
8585 DAQmxErrChk (DAQmxBaseCreateCOPulseChanFreq (taskHandle, ctrname, "", DAQmx_Val_Hz, DAQmx_Val_Low, (float64)0.0, pulse_freq, pulse_duty));
8686 // int32 DAQmxBaseCfgImplicitTiming (TaskHandle taskHandle, int32 sampleMode, uInt64 sampsPerChanToAcquire);
87- DAQmxErrChk (DAQmxBaseCfgImplicitTiming (taskHandle, DAQmx_Val_ContSamps, (uInt64)0));
87+ DAQmxErrChk (DAQmxBaseCfgImplicitTiming (taskHandle, DAQmx_Val_ContSamps, (uInt64)1)); // error, when USB-621x
88+ //DAQmxErrChk (DAQmxBaseExportSignal(taskHandle, DAQmx_Val_CounterOutputEvent, "/Dev1/PFI6")); // not worked! , default "/Dev1/PFI4"
8889 DAQmxErrChk (DAQmxBaseStartTask (taskHandle));
8990 emit pulse_output_started();
9091 state = State_OUTPUT;
@@ -110,7 +111,7 @@ void DAQThread::run()
110111 // int32 DAQmxBaseCreateCOPulseChanFreq (TaskHandle taskHandle, const char counter[ ], const char nameToAssignToChannel[ ], int32 units, int32 idleState, float64 initialDelay, float64 freq, float64 dutyCycle);
111112 DAQmxErrChk (DAQmxBaseCreateCOPulseChanFreq (taskHandle, ctrname, "", DAQmx_Val_Hz, DAQmx_Val_Low, (float64)0.0, pulse_freq, pulse_duty));
112113 // int32 DAQmxBaseCfgImplicitTiming (TaskHandle taskHandle, int32 sampleMode, uInt64 sampsPerChanToAcquire);
113- DAQmxErrChk (DAQmxBaseCfgImplicitTiming (taskHandle, DAQmx_Val_ContSamps, (uInt64)0));
114+ DAQmxErrChk (DAQmxBaseCfgImplicitTiming (taskHandle, DAQmx_Val_ContSamps, (uInt64)1));
114115 DAQmxErrChk (DAQmxBaseStartTask (taskHandle));
115116 }
116117 break;