hello Posted October 6, 2023 Share Posted October 6, 2023 Hello, I am trying to measure thickness of the hollow disc, so that use usb-1808 with 2 analog channels and 2 rotary encoders. I try to find out of encoder input test in the Instacal but there is no encoder test menu in usb-1808. And I used function(cbCConfigScan, cbAInScan), but an error occured. There was no error in other devices, but an error occurred in usb-1808. err = cbCConfigScan(vSet.board, ch, BIT_32, CTR_DEBOUNCE3500ns, CTR_TRIGGER_AFTER_STABLE, CTR_RISING_EDGE, CTR_TICK20PT83ns, ch); I used this command on USB-QUAD08 and no error occurred, but when I used this command on USB-1808, an error occurred.(error code 137) int rate = 1800; err = cbAInScan(vSet.board, 0, 7, 2880000, &rate, vSet.inrange, ScanBuff, BACKGROUND | CONTINUOUS); I used this command on USB-1608G and no error occurred, but when I used this command on USB-1808, an error occurred.(error code 35) Would you let me know how to catch the encoder signal? Your kind advice would be appreciated. Link to comment Share on other sites More sharing options...
0 Fausto Posted October 6, 2023 Share Posted October 6, 2023 Hello @hello. MCC's InstaCal utility software does not have a test for the encoder channels. A helpful resource when programming with MCC's Universal Library API is the Universal Library Help. https://files.digilent.com/manuals/Mcculw_WebHelp/ULStart.htm USB-1808X User's Guide: https://files.digilent.com/manuals/USB-1808X.pdf The USB-1808 Series supports two encoder channels, which are counter numbers 2 and 3. Please verify the specified channel in your code. The Help also has a list of error codes. Error 137 refers to an invalid counter mode for the USB-1808X, even though it was valid for the USB-QUAD08. If you are intending to use an encoder channel, on the USB-1808X, then the third parameter (mode) in cbCConfigScan() should not be 'BIT_32'. The supported modes are listed in the Help. Next, the cbAInScan() function is for the eight analog input channels and is supported. Error code 35 refers to an invalid pointer. Please check your code. By installing the MCCDAQ software, the Universal Library API examples are copied to the Windows folder 'C:\Users\Public\Documents\Measurement Computing\DAQ'. Take a look at the 'CInScan03' example. Additionally, the following VB.NET zip link contains various USB-1808 examples, which includes an 'EncoderScanMode' example. https://files.digilent.com/downloads/example_programs/Product_Specific_Examples/USB-1808_Series/USB-1808_VB_NET.zip Regards, Fausto Link to comment Share on other sites More sharing options...
0 DAQman Posted October 6, 2023 Share Posted October 6, 2023 The attached code file demonstrates how to read two analog and two encoder input channels. It uses the cbDaqInScan function to read the analog inputs and encoders simultaneously into one buffer. The A/D data are displayed in counts. Use cbToEngUnits32 to convert the 18-bit counts to voltage. VC_USB-1808 DaqInScan.cpp Link to comment Share on other sites More sharing options...
Question
hello
Hello,
I am trying to measure thickness of the hollow disc, so that use usb-1808 with 2 analog channels and 2 rotary encoders.
I try to find out of encoder input test in the Instacal but there is no encoder test menu in usb-1808.
And I used function(cbCConfigScan, cbAInScan), but an error occured.
There was no error in other devices, but an error occurred in usb-1808.
err = cbCConfigScan(vSet.board, ch, BIT_32,
CTR_DEBOUNCE3500ns, CTR_TRIGGER_AFTER_STABLE, CTR_RISING_EDGE, CTR_TICK20PT83ns, ch);
I used this command on USB-QUAD08 and no error occurred, but when I used this command on USB-1808, an error occurred.(error code 137)
int rate = 1800;
err = cbAInScan(vSet.board, 0, 7, 2880000, &rate, vSet.inrange, ScanBuff, BACKGROUND | CONTINUOUS);
I used this command on USB-1608G and no error occurred, but when I used this command on USB-1808, an error occurred.(error code 35)
Would you let me know how to catch the encoder signal?
Your kind advice would be appreciated.
Link to comment
Share on other sites
2 answers to this question
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now