Jump to content
  • 0

Universal Library API -- cbTIn and cbVIn not returning


amaningd

Question

We use USB-TEMP and USB-TEMP-AI devices in production. They are configured in InstaCal, then we query temperatures and voltages, respectively, through our in-house Windows/Visual C++ software using the Universal Library API.  Recently, we've run into issues where calls to the cbTin and cbVin functions don't return, causing their threads to lock up.  Our code is basically as shown below:

int nStatus = 0;

nStatus = cbTin(nBoardID, nChannel, CELSIUS, &fTemperature, FILTER):
// or: nStatus  = cbVIn(nBoardID, nChannel, nADCRange, &fVoltage, 0);

// nStatus = 0 if no errors
if(nStatus != 0)
{
    // Get error info from nStatus, display error msg...
    return -1;
}

return 0;

Is there an issue with how we are using these API calls, and are there alternatives to these API functions that return immediately instead of blocking?

Thanks!

Link to comment
Share on other sites

3 answers to this question

Recommended Posts

  • 0

Good day @amaningd

Your code looks OK to me,

Just as a test, I recommend you run our examples:  ULTI01.C and VIn01.C

I can confirm these 2 example do work correctly using InstaCal/Universal Library 6.73.

You can also test your devices functionality using the InstaCal test utility for analog input.

If they do not work correctly, please let me know.

Regards,

Jeffrey

Link to comment
Share on other sites

  • 0

Thanks for your reply!  The example C programs and reading temperatures/voltage through InstaCal both worked fine. 

To clarify, the issue we are having is intermittent.  We did reproduce the issue occur again later today when trying to read temperature in our software.  While leaving our software locked up and open in the background, we tried to open InstaCal, but it was stuck at the splash screen. During this time, the USB-TEMP and USB-TEMP-AI units' green LEDs were both on, so they both seemed to be properly connected.  After we unplugged and reconnected both devices, our software became responsive again (albeit with an error message from the Universal Library and InstaCal was able to finish opening. Could a problem with USB communication cause the API calls to wait indefinitely instead of returning an error code immediately?

Link to comment
Share on other sites

  • 0

Please try opening InstaCal again, but not when you have any other software opened, running, or locked up.

If InstaCal hangs or gets stuck at the splash screen can be indicative of damaged or less-than-fully-functional USB-TEMP or USB-TEMP-AI.

'Could it be a problem with USB communications?'  it is possible.  The spec for maximum USB cable length for either of those devices is 3 meters. 

That is from the USB-TEMP/TEMP-AI to the computer.  if you are using any USB cable extenders, USB hubs (powered or not), or various lengths USB-A/B cables so as to pass through bulkheads (for example), I recommend you remove them and just as a test, use a single 3 meter or less USB cable, 1 each to your devices. 

Please let me know your results.

Regards,

Jeffrey

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...