Jump to content
  • 0

gil geonics: USB-1604HS-2AO D/A problem


gilgeonics

Question

Trying to use a new USB-1604HS-2AO board (s.n. 1000127) in our equipment, but the D/A function isn't working. Driver software gives a message "X function can not be used with this board".

Trying Instacal, the "Calibrate" tab on the top line shows an A/D option, but the D/A option is greyed. The next line also shows an A/D graphic, but the D/A graphic is also greyed.

Does this mean the board is bad? Should I be able to test the D/A with Instacal?

Link to comment
Share on other sites

25 answers to this question

Recommended Posts

  • 0

Hello,

Sadly, InstaCal does not have an analog output test for your device. For a reason unknown to me, it was left out. So you can test the analog input and the digital IO registers but not the analog output.  What is the Driver Software you've referenced?

Best regards,
John

Link to comment
Share on other sites

  • 0

Hi John,

Thanks for your response; at least now I know that Instacal won't be a help. Is there other MCC software I could use to test?

Our software uses the library with OLD*.h files. The particular call that gives the "function can not be used" message is     FindAnalogChannelsOfType(... , ANALOGOUTPUT , .....).

We have used this DAQ (previous boards) and software for a number of units with no problems. So it looks like this particular board is the problem now.

Thanks & regards - Gil

Link to comment
Share on other sites

  • 0

Hi Gil,

FindAnalogChannelsOfType is a helper function found in the MCC C/C++ examples. The examples are in your public documents folder if you've installed InstaCal from the MCC DAQ CD download. The function you speak of is in Analog.h, which is in C:\Users\Public\Documents\Measurement Computing\DAQ\C\Samples\. I tested it with a USB-1602HS-2AO and found it to work with your device. Unfortunately, I didn't have the four-channel version handy, but they're both the same for Analog Output. 

I've attached a Visual Studio 2015 32-bit C Console project that tests the function. It outputs a slow sine wave to both channels.

Best regards,
John

Example_ULAO_02.zip

Link to comment
Share on other sites

  • 0

Hi again;

I thought I had found the answer to the USB-1604 D/A problem, i.e. add the call "cbIgnoreInstacal ()" when initializing the board. Unfortunately this throws a linker error " cannot open file '.\lib\cbw32.lib' ". The same message appears whether cbw32.lib is in the include\lib folder or in the main folder with the source files. Last summer all was working ok (with the call?).

Any suggestions? 

 

Link to comment
Share on other sites

  • 0

The cbIngoreInstaCal function is a relatively recent addition to the library. It is part of what we call the discovery interface. It must be the very first library call and followed up with the discovery functions to find a device. I don't believe you're using the discovery method and instead relying on the InstaCal board number assignment. Furthermore, because you get an error when attempting to use it, it tells me that you have an old version of our library. My programming example assumes you have version 6.55 or newer and relies on the InstaCal assigned board number. If you have an outdated Windows 7 system, you must run version 6.55. To get the updated *.lib, *.h, and DLLs, update your system using the MCC DAQ Software CD download. After, you can find the new files in C:\Users\Public\Documents\Measurement Computing\DAQ\C\

https://www.mccdaq.com/Software-Downloads

Link to comment
Share on other sites

  • 0

Hi John,

Thanks for the instructions. I did download v6.55, but after the re-start there was a message "failed to fetch" (or something like that). Couldn't find a DAQ folder anywhere under under c:\users, but did find under c:\program files\measurement computing, dated today. However this only contained .exe & .dll (and some .txt) files, all dated 2016 or 2017. No .libs or .h's.

Should I try one of the newer versions?

Thanks - Gil

Link to comment
Share on other sites

  • 0

The only way you get the programming support is to update InstaCal from the CD download. The mccdaq.exe download extracts into an image of our CD that we use to hand out with every device. Today it's download only. Once you have it extracted, uncheck everything except InstaCal. After its update, you will have the following folder C:\Users\Public\Documents\Measurement Computing\DAQ\C\. 

Link to comment
Share on other sites

  • 0

Hi again John,

I tried to download instacal again from the archived list, this time v6.60, with the same result as when I tried 6.55; I.e. notice "failed to fetch" after the re-start, and no MCC DAQ folder under c:\users\, only under c:\program files\ with old files.

What to try next? Thanks - Gil

Link to comment
Share on other sites

  • 0

Hi again John: Getting farther but still no cigar!

Instacal 6.55 installed from the link you sent. (It declined to install DAQami because the existing version was as new or newer.) I copied the cbw.h file to both the Include and source folders, and cbw32.lib to the lib folder. However when I tried to re-build the solution I got the following set of errors:

1>Contadc.c
1>c:\em633data\cbw.h(25) : warning C4005: 'CURRENTREVNUM' : macro redefinition
1>        c:\em633data\em633-e\cbw.h(23) : see previous definition of 'CURRENTREVNUM'
1>c:\em633data\cbw.h(1513) : error C2365: 'USB_IFC' : redefinition; previous definition was 'enumerator'
1>        c:\em633data\em633-e\cbw.h(1511) : see declaration of 'USB_IFC'
1>c:\em633data\cbw.h(1513) : error C2086: 'USB_IFC' : redefinition
1>        c:\em633data\cbw.h(1513) : see declaration of 'USB_IFC'
1>c:\em633data\cbw.h(1514) : error C2365: 'BLUETOOTH_IFC' : redefinition; previous definition was 'enumerator'
1>        c:\em633data\em633-e\cbw.h(1512) : see declaration of 'BLUETOOTH_IFC'
1>c:\em633data\cbw.h(1514) : error C2086: 'BLUETOOTH_IFC' : redefinition
1>        c:\em633data\cbw.h(1514) : see declaration of 'BLUETOOTH_IFC'
1>c:\em633data\cbw.h(1515) : error C2365: 'ETHERNET_IFC' : redefinition; previous definition was 'enumerator'
1>        c:\em633data\em633-e\cbw.h(1513) : see declaration of 'ETHERNET_IFC'
1>c:\em633data\cbw.h(1515) : error C2086: 'ETHERNET_IFC' : redefinition
1>        c:\em633data\cbw.h(1515) : see declaration of 'ETHERNET_IFC'
1>c:\em633data\cbw.h(1517) : error C2365: 'ANY_IFC' : redefinition; previous definition was 'enumerator'
1>        c:\em633data\em633-e\cbw.h(1515) : see declaration of 'ANY_IFC'
1>c:\em633data\cbw.h(1517) : error C2086: 'ANY_IFC' : redefinition
1>        c:\em633data\cbw.h(1517) : see declaration of 'ANY_IFC'
1>c:\em633data\cbw.h(1531) : error C2371: 'DaqDeviceDescriptor' : redefinition; different basic types
1>        c:\em633data\em633-e\cbw.h(1529) : see declaration of 'DaqDeviceDescriptor'

I only find "_IFC" in file  ifc.h, and the only versions I have under c:\users\ are both dated 25/01/2013, slightly different times & sizes, and both give the same compile errors as above when copied to the source directory.

Sorry to have to keep asking, but what to do from here?

Thanks for your help - Gil

Link to comment
Share on other sites

  • 0

Hi John,

So in cbw.h  I added "#ifndef USB_IFC" in front of the "typedef enum" section that throws the errors, and added "#endif" after.  No difference.

Changed to "#ifndef DaqDeviceInterface" - Same

Commented out whole "typedef" section, got many errors in other sections.

 

Link to comment
Share on other sites

  • 0

Gil,

Because of all the strange errors, I'm guessing you've mixed old and new cb*.lib, cb*.dll, analog.h, and cb*.h files; I recommend wiping your system of our components and software. Ensure to eliminate any .h or .lib files you may have copied to programming projects. After you're sure it's all gone, install only InstaCal from the 6.55 mccdaq.exe cd. Add the new .h and .lib files and any example modules like analog.h from the programming support found in C:\Users\Public\Documents\Measurement Computing\DAQ\ that you may use. Hopefully, the errors will go away. 

John

Link to comment
Share on other sites

  • 0

Hi,

Uninstalled Instacal and re-installed with the installer from the link you sent (same .exe that seemed to work a couple of days ago).

But now the only files in c:\users\.....\DAQ\c\ are  cbw.h, cbw32.lib and cbw64.lib,  all dated 2017,  plus folder sample32\ which has only a lot of small .c files dated 6/6/2016 plus 2 very small .bat files.

System32 no longer has any cb*.dll files. (There are a number of Cbs*.dll files in other \windows\ folders.)

What have I done wrong?  Try again?

Link to comment
Share on other sites

  • 0

I wonder why you're having so much trouble. However, there should be none of our cb*.dll files in System32. Instead, our dlls are in C:\Program Files\Measurement Computing\DAQ\ (assuming you have 32-bit Windows 7).

I don't believe I can sort this out. Sorry.

John

Link to comment
Share on other sites

  • 0

Hi John, Fausto,

I reloaded the MCC CD software with the current version, including TracerDAQ v2.3.4 and InstaCal v6.73. Tried TracerDAQ A/O test and it seemed ok as long as board was plugged in(waveform shifted when offset was changed), complained when unplugged. But same _IFC variable errors on compiling. 

Link to comment
Share on other sites

  • 0

Getting farther!! Replaced cbw files in source folder with versions from new download (v6.73) and compile is ok now.

But there are still problems. When cbIgnoreInstaCal() is not used, the D/A "function cannot be used" message is thrown. And when it is used (first cb call) the software doesn't seem to see the board at all: GetNameOfBoard returns 0 with no name for the board (""). 

Again, suggestions?  Thanks John & Fausto. 

Link to comment
Share on other sites

  • 0

Your troubles are because you're mixing components from our examples with discovery functions such as cbIngnoreInstaCal. The examples do not use cbIngnoreInstaCal; they use what is listed in the InstaCal board list. The following demonstrates the discovery interface and how to use cbIngnoreInstaCal to locate a USB-1604HS-2AO and determine the board number.

If you're not using this method, do not use cbIngnoreInstaCal.

 int BoardNum = -1;
 
   float Rev = (float)CURRENTREVNUM;
   ULStat = cbDeclareRevision(&Rev);
   cbErrHandling(PRINTALL, STOPALL);

   printf ("Demonstration of cbAInScan() in BACKGROUND mode\n\n");

    //Ignore InstaCal device discovery
    cbIgnoreInstaCal();

    //locate USB devices
    ULStat = cbGetDaqDeviceInventory(USB_IFC, inventory, &numberOfDevices);
    for( i = 0; i < numberOfDevices; i++)
        {
            DeviceDescriptor = inventory[i];


            //Product ID for USB-1604HS-2AO = 0xD8
            //Product IDs can be found in ULProps.txt located in 
            // C:\Program Files (x86)\Measurement Computing\DAQ

            if(DeviceDescriptor.ProductID == 0xD8)
            {
                BoardNum = i;
                ULStat = cbCreateDaqDevice(BoardNum, DeviceDescriptor);
                break;
            }
            
        }

   if(BoardNum < 0)
   {
       printf("USB device not found...press any key to exit\n");
       getch();
       return;
   }

Link to comment
Share on other sites

  • 0

Hi John,

I put your coding into the software, adding the type declaration

"DaqDeviceDescriptor DeviceDescriptor,inventory[50];".

I also moved "cbIgnoreInstaCal();" ahead of "ULStat = cbDeclareRevision(&Rev);"

However on running, "numberofdevices" is 1, and the coding exits with "USB device not found..".  The board is definitely connected - the blue LED is on and the system makes the appropriate beeps on connecting or disconnecting.

Suggestions?

Link to comment
Share on other sites

  • 0

The discovery routine looks for a device with a ProductID of 0xD8 corresponding to the USB-1604HS-2AO. If you are using a different model, change the ID appropriately. 

          //Product ID for USB-1604HS-2AO = 0xD8
            //Product IDs can be found in ULProps.txt located in 
            // C:\Program Files (x86)\Measurement Computing\DAQ

            if(DeviceDescriptor.ProductID == 0xD8)
            {
                BoardNum = i;
                ULStat = cbCreateDaqDevice(BoardNum, DeviceDescriptor);
                break;
            }

I used the attached program to verify it works.

VC_2013_USB-1602HS.cpp

Link to comment
Share on other sites

  • 0

Hi again John - spoke too soon re things being ok.

We have two different systems that use the USB-1604HS-2AO, call them E and G.

Problems started when trying to revise coding for E.   Revisions had nothing to do with DAQ coding, but after compiling, the A/O function was not operational. Revised initialization coding according to your example and eventually all seemed ok (D/A output ok, A/D channels all working), but some problems with E hardware.

After fixing hardware, the software now finds only 1 Analog input channel, and there is no D/A output, although the output code runs without error messages. The initialization coding with your test section modified to check 4 AI's seems to run ok.

Tried to check with system G, which runs ok with software dated Nov/22, and Win10. However when trying with same .exe on a different Win10 computer (or with a Win7) get message that cannot find A/O. Original installation continues to work ok.

What can be causing this behavior? Is instacal being updated automatically and changing something? (It is always being used when boards are switched) To get the revised E coding to run it was necessary to download the latest Instacal instead of v6.55 which you had suggested.

Suggestions? Thanks - Gil

 

Link to comment
Share on other sites

  • 0

Hey John, Fausto:

So migrated to a Win10 system and VS2022 (must have taken hardly an hour once the download done). No difference. Problem was hardware. I suppose I should be embarassed,  but I'm just grateful.

Thanks for your help along the way - Gil

 

Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...