03-21-2024 03:07 AM
I use a simulated device to display voltage measurements when I have no real device connected. I get random spikes in the signal as you can see in the attached image. The weird thing is: as soon as I start the measurement & automation explorer, these are gone. So, what could be wrong?
int32 error = 0; char errBuff[2048] = { '\0' }; const int numChn = ss->getIndexCursor()->getActiveChannelCount(); const wxString taskname = wxString::Format(wxT("%s-%iChannels"), getDeviceName(), numChn); DAQmxErrChk(NI_CreateTask(taskname.mb_str(wxConvUTF8), &taskHandle)); DAQmxErrChk(NI_SetReadAttribute(getHandle(), DAQmx_Read_AutoStart, true)); std::vector<wxString> physicalChn; wxString phyChnStr = wxEmptyString; for (int i = 0; i < getDeviceConfig()->getXYChannelCount() * 2; i++) { phyChnStr = getDeviceName() + wxT("/ai") + wxString::Format(wxT("%i"), i); physicalChn.push_back(phyChnStr); } const char* channelName[16] = { "1x", "1y", "2x", "2y", "3x", "3y", "4x", "4y", "5x", "5y", "6x", "6y", "7x", "7y", "8x", "8y" }; for (int k = 0; k < getDeviceConfig()->getXYChannelCount() * 2; k++) { char cstring[128] = ""; strncpy(cstring, (const char*)physicalChn.at(k).mb_str(wxConvUTF8), 127); DAQmxErrChk(NI_CreateAIVoltageChannel(getHandle(), cstring, channelName[k], DAQmx_Val_RSE, -10, 10, DAQmx_Val_Volts, nullptr)); }
DAQmxErrChk(NI_RegisterEveryNSamplesEvent(getHandle(), DAQmx_Val_Acquired_Into_Buffer, getDeviceConfig()->getScanBlockSize(), 0, EveryNCallback, nullptr));
Betriebssystem (OS) Windows 10 Professional
Version des OS 10.00.19045
Info zum OS
Prozessor Intel(R) Core(TM) i7-4790K CPU @ 4.00GHz / Intel64 Family 6 Model 60 Stepping 3 / GenuineIntel / 4000 MHz
Anzahl von Prozessoren 8
Physikalischer Speicher 15,4 GB RAM
Laufwerk C:\ 549 GB von 930 GB frei
Laufwerk E:\ 1,16 TB von 1,81 TB frei
Software von NI: Version:
NI-DAQmx Device Driver 24.0.0f267
NI-DAQmx ADE Support 22.8.0
NI-DAQmx MAX Configuration 24.0.0
NI I/O Trace 18.5.0f0
LabVIEW Runtime 2014 SP1 f11 14.0.1
LabVIEW Runtime 2023 Q1 (64-bit) 23.1.0
Measurement & Automation Explorer 23.8.0f102
Measurement Studio Visual Studio 2010 Support - See individual versions below.
DotNET
Common 15.1.40.49152
Common (64-bit) 15.1.40.49152
NI-USI 15.0.2.6343
NI PXI Platform Services Configuration 24.0.0f155
NI PXI Platform Services Runtime 24.0.0f155
NI-PAL Software 24.0.0
NI 1588-2008 Network Management 18.1.0 18.1.0f0
NI System Configuration 24.0.0f129
NI-VISA 18.5
NiVisaServer.exe 17.5.0.49152
NIvisaic.exe 18.5.0.49152
NI-VISA Runtime 18.5
LabVIEW Runtime 2015 SP1 f10 15.0.1
LabVIEW Runtime 2016 f6 16.0.0
LabVIEW Runtime 2017 SP1 f3 17.0.1
LabVIEW Runtime 2020 SP1 20.0.1
LabVIEW Runtime 2021 SP1 f2 21.0.1
LabVIEW Runtime 2023 Q3 23.3.0
LabVIEW Runtime 2023 Q3 23.3.0
LabVIEW Runtime 2023 Q1 (64-bit) 23.1.0