• 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ão93f861bbcfd6cd217b1ee84ade376a446ee62b66 (tree)
Hora2012-08-22 15:24:50
Autorarakaki <alucky4416@user...>
Commiterarakaki

Mensagem de Log

CHG: FiniteSamps to ContSamps, and misc.

Mudança Sumário

Diff

--- a/daqthread.cpp
+++ b/daqthread.cpp
@@ -60,7 +60,7 @@ void DAQThread::run()
6060
6161 uInt32 serialnumber;
6262 DAQmxBaseGetDevSerialNum("Dev1", &serialnumber);
63- qDebug() << QString("%1 SerialNumber is 0x%2").arg("Dev1").arg(serialnumber, 0, 16, QChar('0'));
63+ qDebug() << QString("%1 SerialNumber is 0x%2").arg("Dev1").arg(serialnumber, 8, 16, QChar('0'));
6464
6565 // signal - daqmxbase ready
6666 emit daqmxbase_ready();
@@ -74,7 +74,7 @@ void DAQThread::run()
7474 DAQmxErrChk (DAQmxBaseCreateCOPulseChanFreq (taskHandle, ctrname, "", DAQmx_Val_Hz, DAQmx_Val_Low, (float64)0.0, pulse_freq, pulse_ducy));
7575
7676 // int32 DAQmxBaseCfgImplicitTiming (TaskHandle taskHandle, int32 sampleMode, uInt64 sampsPerChanToAcquire);
77- DAQmxErrChk (DAQmxBaseCfgImplicitTiming (taskHandle, DAQmx_Val_FiniteSamps, (uInt64)0));
77+ DAQmxErrChk (DAQmxBaseCfgImplicitTiming (taskHandle, DAQmx_Val_ContSamps, (uInt64)0));
7878 /*********************************************/
7979 // DAQmx Start Code
8080 /*********************************************/
@@ -91,12 +91,13 @@ void DAQThread::run()
9191 switch (state) {
9292 case State_IDLE:
9393 if (event == Ev_Start) {
94- qDebug() << "start pulse output."; // start Pulse output
94+// qDebug() << "start pulse output."; // start Pulse output
95+ qDebug() << QString("start pulse output: freq = %1, ducy = %2").arg(pulse_freq).arg(pulse_duty);
9596 // int32 DAQmxBaseCreateCOPulseChanFreq (TaskHandle taskHandle, const char counter[ ], const char nameToAssignToChannel[ ], int32 units, int32 idleState, float64 initialDelay, float64 freq, float64 dutyCycle);
9697 DAQmxErrChk (DAQmxBaseCreateTask("", &taskHandle));
9798 DAQmxErrChk (DAQmxBaseCreateCOPulseChanFreq (taskHandle, ctrname, "", DAQmx_Val_Hz, DAQmx_Val_Low, (float64)0.0, pulse_freq, pulse_duty));
9899 // int32 DAQmxBaseCfgImplicitTiming (TaskHandle taskHandle, int32 sampleMode, uInt64 sampsPerChanToAcquire);
99- DAQmxErrChk (DAQmxBaseCfgImplicitTiming (taskHandle, DAQmx_Val_FiniteSamps, (uInt64)0));
100+ DAQmxErrChk (DAQmxBaseCfgImplicitTiming (taskHandle, DAQmx_Val_ContSamps, (uInt64)0));
100101 // msleep(100);
101102 DAQmxErrChk (DAQmxBaseStartTask (taskHandle));
102103 state = State_OUTPUT;