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

intel mac and Matlab


  • Please log in to reply
8 replies to this topic

#1 noor

noor
  • Members
  • 3 posts

Posted 19 June 2008 - 02:59 AM

I have leopard running on my Intel mac and I want to use Matlab to talk to my UE9 and U3, but I do not get it working. I'm an absolute beginner so maybe the answer is very simple but can somebody tell me what to do to get it working. Do I need special drivers? When I use dualboot I get it working under windows but I like to have it working under Mac as well.

#2 LabJack Support

LabJack Support
  • Admin
  • 8677 posts

Posted 19 June 2008 - 10:05 AM

Currently we provide no working MATLAB functions and examples for the Mac. The MATLAB functions and examples in the MATLAB_LJUD.zip download we provide on our website are meant for the LabJackUD high-level driver, which is for Windows only. All other operating systems we support use a low-level driver with a different set of functions calls then the LabJackUD driver.



#3 LabJack Support

LabJack Support
  • Admin
  • 8677 posts

Posted 19 June 2008 - 10:21 AM

Quick follow up, after installing the Mac driver if you run one of the C examples does it find your UE9 or U3. I just want to make sure the devices are running correctly on your Mac. Also, I have been told that in MATLAB there is a way to compile C code. If you have experience with C, you might want to consider trying to compile our Mac examples' C code in MATLAB. In particular the ue9.c/h and u3.c/h files contain helpful functions for calculating checksums, getting calibration constants, converting binary readings to voltage/temperate and more.

#4 noor

noor
  • Members
  • 3 posts

Posted 19 June 2008 - 10:48 AM

Quick follow up, after installing the Mac driver if you run one of the C examples does it find your UE9 or U3. I just want to make sure the devices are running correctly on your Mac.

Also, I have been told that in MATLAB there is a way to compile C code. If you have experience with C, you might want to consider trying to compile our Mac examples' C code in MATLAB. In particular the ue9.c/h and u3.c/h files contain helpful functions for calculating checksums, getting calibration constants, converting binary readings to voltage/temperate and more.


thank you for the reply. I can not program in C I only know how to use MATLAB. I do not know how to start the c programs from my mac. if I just click on them it opens the code in Xcode but I do not have a clue how to run them. I never tried to use c in Matlab but if I can have it run from there it would be fine. BUt no nothing that I tried got the UE9 or U3 working. (on Windows they both do then I use the matlab code)

#5 LabJack Support

LabJack Support
  • Admin
  • 8677 posts

Posted 19 June 2008 - 11:23 AM

I can not program in C I only know how to use MATLAB. I do not know how to start the c programs from my mac. if I just click on them it opens the code in Xcode but I do not have a clue how to run them.

To run the C example programs, in a terminal go to the the directory containing the examples. In the examples directory, type the "make" command (without the double quotes) to compile the C code. Keep in mind that the GCC compiler is needed for the "make" command to be available. I am not sure if GCC is included in default Mac installs. After compiling you should be able to run the application by typing "./program_name", so for example to run the Feedback test for the U3 type "./u3Feedback". If the program does not display a message saying something along the line of "no device was found" when a U3/UE9 is connected, then the Mac driver should be working fine.

BUt no nothing that I tried got the UE9 or U3 working. (on Windows they both do then I use the matlab code)

I am not sure if you read my first reply, but the MATLAB functions and examples available on our website will only work for Windows. For the Mac, a new set of MATLAB functions and examples would need to be made.

#6 noor

noor
  • Members
  • 3 posts

Posted 23 June 2008 - 01:42 AM

I can not program in C I only know how to use MATLAB. I do not know how to start the c programs from my mac. if I just click on them it opens the code in Xcode but I do not have a clue how to run them.

To run the C example programs, in a terminal go to the the directory containing the examples. In the examples directory, type the "make" command (without the double quotes) to compile the C code. Keep in mind that the GCC compiler is needed for the "make" command to be available. I am not sure if GCC is included in default Mac installs. After compiling you should be able to run the application by typing "./program_name", so for example to run the Feedback test for the U3 type "./u3Feedback". If the program does not display a message saying something along the line of "no device was found" when a U3/UE9 is connected, then the Mac driver should be working fine.

I ' will try this but since I never used the terminal I have already trouble to change directory (what is the comand for that?)

BUt no nothing that I tried got the UE9 or U3 working. (on Windows they both do then I use the matlab code)

I am not sure if you read my first reply, but the MATLAB functions and examples available on our website will only work for Windows. For the Mac, a new set of MATLAB functions and examples would need to be made.


I read the first mail it is a pitty, I better start to learn C . Are there anny planns to make Matlab functions for Mac available in the near future?

#7 LabJack Support

LabJack Support
  • Admin
  • 8677 posts

Posted 23 June 2008 - 11:55 AM

Currently we have no plans to make MATLAB functions and examples for the Mac.

#8 katlin

katlin
  • Members
  • 1 posts

Posted 06 March 2014 - 11:56 AM

Hello,

 

I have a similar problem and I am attempting to use your advice to compile to C, however, I don't understand how exactly to do this, I've got the directory changed in my terminal to LJUD_Samples, but I don't understand how to use the 'make' command. I have gcc, just please could you write out what the code looks like to compile to C?

Thank-you



#9 LabJack Support

LabJack Support
  • Admin
  • 8677 posts

Posted 06 March 2014 - 01:41 PM

UD examples will not work on Mac. First, you will want to download and use the C examples from the Exodriver (the Linux/Mac driver):

 

https://github.com/labjack/exodriver

 

Post #5 provides instructions on compiling and running the examples in a terminal:

 

To run the C example programs, in a terminal go to the the directory containing the examples. In the examples directory, type the "make" command (without the double quotes) to compile the C code. Keep in mind that the GCC compiler is needed for the "make" command to be available. I am not sure if GCC is included in default Mac installs. After compiling you should be able to run the application by typing "./program_name", so for example to run the Feedback test for the U3 type "./u3Feedback". If the program does not display a message saying something along the line of "no device was found" when a U3/UE9 is connected, then the Mac driver should be working fine.

 

For using C code in MATLAB refer to this MathWorks support page:

 

http://www.mathworks...s/1622_R13.html

 

Also, Iandol's U3/U6 MATLAB class may be useful:

 

https://github.com/i...ation/labJack.m

 

It use's loadlibrary/calllib to use the Exodriver's functions.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users