File I/o With Xcode 3.0 For Mac
32 and 64 bit driver source code and C/C examples. Other Downloads and Resources. Git repository of source code and C/C examples. Mac-only installer for the pre-built Exodriver binaries.
Introducing the Exodriver The native USB drivers for Linux and Mac OS X have merged into a single driver: the Exodriver. The Exodriver is a thin interface (think exoskeleton) to LabJack devices. It’s written as a C library that uses for USB communication. The library can open, close, read from, and write to a LabJack U3, U6, UE9, and U12. Because it’s a library and doesn’t have any kernel code, it’s easy to build. U12 users also have the option to use the ljacklm high-level driver, which requires the Exodriver. For more details visit the.
Mac OS X Quickstart Mac OS X users can use the rather than building the Exodriver from the source. We also provide a if you would like to use Xcode to build LabJack applications with the Exodriver. C language examples are provided with the. If you would prefer to build the Exodriver from the source, the instructions in the next section work on Mac OS X. Note to U12 Users on Mac OS X: Use the “Customize install” option of the pre-built installer to add the LabJackHID kernel extension. This is a null kernel extension which prevents the OS’s HID driver from claiming a LabJack HID device. This is only required by U12 devices, otherwise it does not need to be installed.
Quickstart: Building from the source First, make sure the following requirements are met:. A modern Linux or Mac OS X system. A C compiler (gcc, e.g., build-essential on Debian/Ubuntu, Xcode on Mac OS X). library and header files installed (from the source or -dev binary packages) Linux notes:. Most distributions have libusb-1.0 installed, and only the header/development files are needed. It is recommended to not build from source code and to use the libusb-1.0 version from your distribution's package manager. If using Ubuntu or a Debian based distribution, take a look at the.
This includes Raspbian on the Raspberry Pi. It provides a full list of commands to fulfill requirements and install Exodriver. Mac OS X note:. Additional instructions on building universal binaries for libusb-1.0 and Exodriver can be found at the. Now after the requirements have been met, building the Exodriver is easy. (click the “Download ZIP” button on that page), build and install it. On both Linux and Mac OS X, in the Exodriver directory run $ sudo./install.sh After installing the Exodriver, build the U3, U6, or UE9 example programs: $ cd examples/U6/ $ make Run one of example programs like this: $./u6BasicConfigU6 For more information, consult.
INSTALL.Linux details which kernel versions are required, and how to manually install the driver and set device permissions properly without the install.sh script. INSTALL.MacOSX lists which releases of Mac OS X are supported. 'git clone' only works once for a repository. If the repository's directories and files already exist on your computer you cannot use 'git clone' again.
To update your files after a 'git clone', go into the repository's directory (exodriver) and use the 'git pull' command to update your files. Alternatives to this are to delete the exodriver directory and perform the 'git clone', or not use 'git' all together and download the and source code from github (there is a 'Downloads' button) and build/install from those. or to post comments. ExodriverNativeUSBSetup does not work on Mac OS X 10.5.8. Python generated this error when importing u3:: Could not load the Exodriver driver. Ethernet connectivity only. Check that the Exodriver is installed, and the permissions are set correctly.
The error message was: dlopen(liblabjackusb.dylib, 6): no suitable image found. Did find: /usr/local/lib/liblabjackusb.dylib: unknown required load command 0x8000002 Compiling/installing Exodriver from the Quickstart instructions here solved the problem. or to post comments. Hey folks, I'm upgrading an old Xcode project of mine for a U3 done a few years ago, and it seems I missed the memo with what got taken out on the way to Exodriver-land. What happened to u3.h, u3.c and all the functions they had such as getCaliInfo and such? If someone could provide me an upgrade guide, I'd appreciate it. My U3 is a 1.20 hardware version.
I'd install the old drivers (tell me again why USB needs this stuff? I like the idea of libraries much more, thanks for moving in that direction) but I'd rather stay current, and it doesn't look like you have the old driver installer handy on this here web site. Dave. or to post comments.
API-wise not too much has changed, just the inner workings. The C examples still exist that include the u3.c/h files, and can be found with the Exodriver source code located here:.
This isn't obvious on this page's documentation now that I read it, so I'll make a note to include this when we update the page next time. The labjackusb.h header file has the version history which explains the changes. In the U3's case some of the pipe defines changed.
Driver installation can now be done with source code or Mac installer. If you would like the old driver e-mail. or to post comments. First try disconnecting and reconnecting your U3 and see if that helps. Your U3 may still be using the old, default udev rules from before the installation which may cause permission issues. Reconnecting makes it use the currently installed settings.
If this does not resolve the issue, refer to the INSTALL.Linux file in the. The 'liblabjackusb Library Installation' section provides more details on the udev rules and what group your current user needs to be a part of so you do not need to run as root. or to post comments. Am I right in thinking that the Exodriver is the only method for doing 1-wire comms? I read somewhere else that 1-wire must be done via the LJ 'low-level' driver.
From the U3 User's Guide, chapter 4: The low-level U3 functions are described in Section 5, but most Windows applications will use the LabJackUD driver instead. The above lead me to this Exodriver page. I'm sort of surprised that it would be this convoluted to do 1-wire (or other protocols) via a LabJack.
or to post comments. I'm having trouble with your MacOS prebuilt installer (10.7.5).
After completing installation and firing up python I get the following message when trying to 'import u3':: Could not load the Exodriver driver. Ethernet connectivity only. Check that the Exodriver is installed, and the permissions are set correctly.
The error message was: dlopen(liblabjackusb.dylib, 6): no suitable image found. Did find: /usr/local/lib/liblabjackusb.dylib: stat failed with errno=13 Any advice on how to proceed/troubleshoot would be appreciated. If this is truly a permissions issue which is the file(s) that need to have permissions changed and where are they. One think that may be an issue for me is when to connect the U3. Does this need to be attached prior to running the installer?. or to post comments.
'stat failed with errno=13' indicates file or folder permission issues. Check your /usr/local/lib directory and make sure both the directory and the library files (libusb and liblabjackusb) have read and execute permissions for all users and groups. The installer should install the files with the correct file permissions, and /usr/local/lib should have these permissions but I've seen cases where this is not true. Using a terminal you can check permissions with the following commands: ls -l /usr/local/ ls -l /usr/local/lib Permissions should look like 'drwxr-xr-x' or '-rwxr-xr-x'. To change the permissions in a terminal use the chmod command on the directory and files you want to change. For example, to add read and execute permissions to the /usr/local/lib directory for all users and groups use this command: sudo chmod a+rx /usr/local/lib The U3 does not need to be connected prior to running the installer. or to post comments.
Currently we only support and tested building the Exodriver with gcc. Try building the Exodriver like normal and see if that works. Otherwise, if you haven't done so already, download and install XCode (it includes gcc) and then try building libusb and Exodriver with the default configuration.
If you are having trouble with building and installing libusb look at their documentation in their download. If you do not want to worry about compiling, you can use the Mac installer on this page which installs both libusb and Exodriver (32 and 64-bit) for you. or to post comments.
I feel I must be doing something wrong without realizing it. I installed the exodriver with the Mac installer, but when I try to compile/run the in XCode 4.6.2, it fails with the following error: ' The run destination My Mac 64–bit is not valid for Running the scheme 'Exodriver example'. The scheme 'Exodriver example' contains no buildables that can be built for the SDKs supported by the run destination My Mac 64–bit. Make sure your targets all specify SDKs that are supported by this version of Xcode.' From Qt Creator, using C with either GCC or Clang I received the error ' Symbols not found for architecture x8664' when trying to call any LabJackUSB function after including the header file (#include 'labjackusb.h'). From terminal, I saw that the exodriver seems to have all three possible architectures (x86, x8664, and PPC).
Uncertain why it wasn't working, I followed the instructions above to rebuild libusb-1.0 and the exodriver from source. I believe you can use MATLAB scripts/code. Currently we do not have Mac OS X MATLAB examples, but someone on the forum wrote a U6 MATLAB class that could help: I am not sure if the class provides digital I/O functionality. If not, you can set a digital line using the Feedback low-level function with Bit/PortStateWrite IOType: The Exodriver source code provides U6 C examples that demonstrate this. A quick note, with a LabJack T7 or UE9 you can communicate through TCP which most languages support and not use the USB driver. or to post comments. Hi, I installed the pre-installer for Mac OSX and tried to test the labjack system, however I get an error message like this: PTB-INFO: Connection to Psychtoolbox kernel support driver instance #0 (Revision 0) established.
PTB-INFO: Connection to Psychtoolbox kernel support driver instance #1 (Revision 0) established. labJack: Loading the exodriver library failed: Failed to preprocess the input file. Output from preprocessor is:/bin/bash: gcc-4.2: command not found open method I'm not sure what I did wrong, and how I can resolve this issue. or to post comments. Hi LabJack I had my UE9 running via USB with my x86 based LapTop with Ubuntu 10.10. 'exodriver/examples/UE9/ue9SingleIO' was running fine. After ugrade Ubuntu 10.10 - 12:04 I ran into problems.
I did run the exodriver/install.sh again, no complaints. But running the 'ue9SingleIO' now fail if run by me, ok as root: $./ue9SingleIO libusb error: LIBUSBERRORACCESS Open error: could not find a UE9 with a local ID or serial number of -1 $ sudo./ue9SingleIO sudo password for xyz: Set DAC0 voltage to 2.500 V.
Voltage read from AI0: 0.5098 V Temperature read internal temperature sensor (channel 133): 289.5 K Accecs trouble seems to be here. Open('/dev/bus/usb/007/002', ORDWR) = -1 EACCES (Permission denied) write(2, 'libusb error: LIBUSBERRORACCES'., 34libusb error: LIBUSBERRORACCESS. This is in response to both your posts. Yes, the owner/group should be root/adm after running install.sh. Did you try power cycling your UE9 afterwards? If you had your UE9 connected during installation it could still be using the default root/root permissions and not the root/adm permissions from the newly installed 10-labjack.rules udev rules file. Pny usb hub combo driver for mac.
Power cycling the LabJack or restarting Ubuntu will resolve this issue and from then on the root/adm permissions will be in effect. Also, if you were not part of the adm group before running the installer script you will need to log off the user and log back in for the group changes to take effect. or to post comments. /etc/udev/rules.d was the old default installation directory for the rules, but with the current install script it is /lib/udev/rules.d by default and the /etc path as an alternative if the /lib path is not found.
The issue might of been that udev was using the rules file from /etc that used SYSFS. SYSFS was deprecated and supposed to be removed from udev at some point, and we changed it to ATTRS a couple of years ago.
I can look into updating the install script to account for this and remove duplicates to ensure the latest rules are being used. Thank you for pointing this out. Update: The newest version of install.sh checks for the old rules file and removes it. or to post comments Pages.
Still unclear on using input/output I have an Intro. To programming class, where we use a compiler called Bloodshed with Windows on PCs. Obviously, I have to use a Mac, which doesn't have windows. But, during class, using Bloodshed, all that needs to be done for the compiler to read an input file is to 1-save a file in Text Editor, then 2-start a new program and declare the variable inFile as an ifstream data type, then 3-initialize the file by opening it using the syntax: inFile.open(sourcename) Is there a way on Xcode use these similar steps for C? All I know is what I learn on Bloodshed, and then try and use it with Xcode. I have an Intro. To programming class, where we use a compiler called Bloodshed with Windows on PCs.
Obviously, I have to use a Mac, which doesn't have windows. But, during class, using Bloodshed, all that needs to be done for the compiler to read an input file is to 1-save a file in Text Editor, then 2-start a new program and declare the variable inFile as an ifstream data type, then 3-initialize the file by opening it using the syntax: inFile.open(sourcename) Is there a way on Xcode use these similar steps for C? All I know is what I learn on Bloodshed, and then try and use it with Xcode. I am writing a program that requires me to get info from a file 'Data3.txt'. Using assertions I've found out where the problem is, but I'm not sure how to fix it. This is where the error is.
Ifstream inData; inData.open ('Data3.txt'); assert (inData); This is the output. Assertion failed: (inData), function main, file /Users/stanton/Desktop/Programs/Project-3/CoffeySPrj3.cpp, line 36. Abort trap logout I think the problem might be where I'm storing 'Data3.txt'. I've tried storing it in various different folders in the Project-3, but I still get the same error. Does anyone know what folder I'm supposed to put Data3.txt in? I am writing a program that requires me to get info from a file 'Data3.txt'.
Using assertions I've found out where the problem is, but I'm not sure how to fix it. This is where the error is. Ifstream inData; inData.open ('Data3.txt'); assert (inData); This is the output.
File I/o With Xcode 3.0 For Mac Download
Assertion failed: (inData), function main, file /Users/stanton/Desktop/Programs/Project-3/CoffeySPrj3.cpp, line 36. Abort trap logout I think the problem might be where I'm storing 'Data3.txt'. I've tried storing it in various different folders in the Project-3, but I still get the same error. Does anyone know what folder I'm supposed to put Data3.txt in? Code: dhcp-155-33-114-131:COLOR='Red'/COLOR timothywiesner$ /Users/timothywiesner/Documents/infile/build/Debug/infile; exit; 0 logout The red hilited shows the working directory is your home directory.
Unless you happen to have a 'sample.txt' file there, your program won't read it. If you want to know what your program's working directory is when it runs, look up the C function getcwd. Use it to show what the program actually has, and compare that to what you want it to have. As a rule, I advise the use of error checking and error reporting.
Right now, you have neither. If you're getting an error you won't know it, and any error that does happen won't have its cause identified. That means one of the few ways to find out what's wrong is to use the debugger to step through the code. But you aren't doing that either. You have to do something concrete to debug what's happening (or not happening). Guessing what's wrong is not sufficiently concrete to be a long-term debugging strategy.
GNU gdb 6.3.5 (Apple version gdb-1708) (Thu Nov 3 21:59:02 UTC 2011) Copyright 2004 Free Software Foundation, Inc. GDB is free software, covered by the GNU General Public License, and you are welcome to change it and/or distribute copies of it under certain conditions.
Type 'show copying' to see the conditions. There is absolutely no warranty for GDB. Type 'show warranty' for details.
This GDB was configured as 'x8664-apple-darwin'.tty /dev/ttys000 hello Switching to process 2669 thread 0x0 Program ended with exit code: 0.