Comments (4)
Attached is an all Linux example featuring the USB-2408-2AO, running ulTIn() in a 250 mS continuous loop (I have also run this at 500 mS and 100 mS sleep). Granted I am showing the data in degrees F. It does not show the aberration you are seeing.
Note that since this function returns static values (not data returned in an array) there really is no sample rate supplied to the ulTIn function, that is a 'function' of the sleep() timer. There is a data RATE parameter but that is set for settling time for the 24 bit A/D converter. Not to be confused with Sample Rate. to be clear, Sample Rate is not the same as Data Rate.
2408_TIn.zip
from uldaq.
@jeffreyg3 I fully understand the difference between the rate at which I read the temperature (controlled by sleep) and the data rate, which is the averaging time in the 2408. It is controlled by this function call:
err = ulAISetConfigDbl(devHandle, AI_CFG_CHAN_DATA_RATE, 0, dataRate);
This dataRate is what I was calling samplingRate, which may be the source of the confusion.
As you will recall from another recent issue I had on Linux it is necessary to set AI_CFG_CHAN_DATA_RATE because it is not read from the non-volatile memory (as it is on Windows) and defaults to a very short time which leads to very noisy temperature measurements.
My issue that that if I set dataRate to 60 it works fine. If I set it to 20 or less it works fine on Windows, but returns occasional spurious values on Linux. I have an application where I am seeing noise on the thermocouple with 60 Hz data rate, so I want to increase the averaging in the device by slowing down the data rate.
Please run the test program in the link in my original message and I am sure you will reproduce the problem.
from uldaq.
@MarkRivers per our off github conversations, this issue has been resolved to your satisfaction.
Please close this thread/topic.
from uldaq.
This problem is due to the cold junction compensation (CJC) value occasionally being read incorrectly from the device. This problem was observed on Ubuntu 18 and Centos 8.
The following is a workaround which adds a 100 microsecond sleep in AiUsb24xx::updateCjcValues().
corvette:~/devel/libuldaq-1.2.1>git diff
diff --git a/src/usb/ai/AiUsb24xx.cpp b/src/usb/ai/AiUsb24xx.cpp
index 38a3aa9..9341c71 100644
--- a/src/usb/ai/AiUsb24xx.cpp
+++ b/src/usb/ai/AiUsb24xx.cpp
@@ -534,6 +534,8 @@ void AiUsb24xx::updateCjcValues()
if(daqDev().getDeviceType() == DaqDeviceId::USB_2416 || daqDev().getDeviceType() == DaqDeviceId::USB_2416_4AO)
dataCount = 8;
+ // This usleep call is needed on Intel processors, otherwise occasionally the first 1 or 2 bytes of the CJC response are 0xFF so the value is
+ usleep(100);
daqDev().queryCmd(CMD_CJC, 0, 0, (unsigned char*) &data, dataCount * sizeof(short));
Measurement Computing should decide if this is the correct fix, or whether some other change should be made.
from uldaq.
Related Issues (20)
- Problem of running uldaq python example HOT 1
- configure unable to find libusb on M1 MacBook running MacOS 12 HOT 2
- libusb problem on M1 Mac HOT 7
- CounterMeasurementType Issue HOT 1
- can we use in k8s pod? HOT 5
- .
- TC-32 and TC-32 exp HOT 1
- Issue with hid_flush_input_pipe() HOT 2
- USB-1608GX drops occasionally drops first sample when run at high frequencies in continuous mode. HOT 1
- Question: generating pulses on multiple timers simulataneously HOT 2
- missing configure file HOT 1
- configure && make error HOT 5
- configure is missing from git archive HOT 1
- USB-TEMP config issue HOT 2
- Timer's status getter returns incorrect state HOT 3
- Refresh rate issue HOT 4
- Refresh rate issue 2 HOT 2
- USB-1808 Counter and Encoder issue HOT 1
- Using Multiple USB Devices HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from uldaq.