Jump to content

As of July 17, 2015, the LabJack forums here at forums.labjack.com are shut down. New registrations, topics, and replies are disabled. All forums are in a read-only state for archive purposes.

Please visit our current forums at labjack.com/forums to view and make new posts. To post on the current forums, use your labjack.com login account. Your old LabJack forums login credentials have been retired. There are no longer separate logins for labjack.com and LabJack forums.


Photo

How to start UE9 using C/C++ ?

How to start UE9 using C/C++

  • Please log in to reply
3 replies to this topic

#1 Lingue

Lingue
  • Members
  • 27 posts

Posted 14 February 2014 - 06:02 AM

Hello every body good night... i'm sorry my english is not so good .

i have a question . i have a trouble with Python programing, i'm on training to teach Labjack ue9 with Programming C/C++ is more familiar to me . i think with C/C++  make me training to more easy...

can anyone tell me how to start programming with C/C++ in Labjack? I'm using Ubuntu 13.10 thanks

 

Best Regard... Labjack Support!



#2 LabJack Support

LabJack Support
  • Admin
  • 8677 posts

Posted 14 February 2014 - 02:40 PM

The Exodriver download provides C examples for Linux in the examples directory:

 

https://github.com/labjack/exodriver



#3 Lingue

Lingue
  • Members
  • 27 posts

Posted 18 February 2014 - 08:30 PM

The Exodriver download provides C examples for Linux in the examples directory:

 

https://github.com/labjack/exodriver

how to read temperature sensors LM35 with labjack ue9?  and print that data ... 



#4 LabJack Support

LabJack Support
  • Admin
  • 8677 posts

Posted 19 February 2014 - 01:12 PM

Take a look at the response in your Python topic with the same question for how to connect the sensor to the UE9. As for getting the reading, the process is the same in C though the calls will differ. An easy way to read the voltage is to use the eAIN function provided by the ue9.h/c code. ue9EFunctions.c demonstrates eAIN usage, and both the examples and ue9.h/c files are included in the UE9 examples directory in the Exodriver download.

 

A quick example (partial code and untested):

    //Open the UE9 and get the calibration constants. For full code, which also provides
    //the close code, refer to ue9EFunctions.c.

    //Read the voltage from AIN0 which the LM35's Vout is connected to.
    double dblVoltage = 0;
    double dblTempC = 0;

    if( (error = eAIN(hDevice, &caliInfo, 0, 0, &dblVoltage, LJ_rgBIP5V, 12, 0, 0, 0, 0)) != 0 )
        goto close;

    //Convert to Celsius
    dblTempC = dblVoltage * 100;

    printf("Temperature (Celsius) = %.3f\n", dblTempC); 



0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users