05-30-2007 02:57 PM
05-30-2007 03:41 PM
11-12-2008 02:06 AM
11-12-2008 05:34 PM
hex-
Look one post above yours 🙂 If you click on that link about getting started with LabVIEW and LabJACK, you can bump up one thread section and just get to the basic LabVIEW section of their forums. It seems like there is a lot of information here and there are apparently examples (I got this from that getting started link) that LabJACK ships with that show example code of dealing with LabVIEW. I don't have any experience with dealing with LabJACK but I think that this is going to be your best point of contact (Although LabJACKSupport, I would think knows a little bit about it :))
Grant
11-12-2008 06:08 PM
11-13-2008 07:40 PM
12-03-2008 02:38 PM
I'm trying to use a Labjack U13 on a Mac and with Labview 8.5 Professional Development System. On this platform there are no drivers so I have been writing my own using the VISA functions. I have managed to get command/response to work fine but I need to use the Stream mode for better timing accuracy.
I can configure the stream, start it and stop it without any difficulty but I can not read any data while the stream is running. Regardless of the timeout period (anything from 100ms to 10s) the VISA Read function keeps returning Timeout errors with a Return count of 0.
Does anyone have any suggestions on what's wrong or where I should start looking next?
Thanks in advance.
12-03-2008 04:19 PM
I believe you are talking about the LabJack U3, correct?
As
an alternative, from our forum it looks some people have dabbled with
using CIN (code interface nodes) to connect a U3 with our Linux driver
(which is very similar to our Mac driver):
http://www.labjack.com/forums/index.php?showtopic=2934
I
am not familiar with using VISA to do USB. Does that mean you are not
using our Mac drivers at all, but rather VISA handles opening the
device and lets you connect to the different pipes to pass raw data in
and out? Did you notice (from Section 2.1 of the U3 User's Guide) that
stream data comes in on Endpoint 3, unlike all other data to the host
that comes in on Endpoint 2?
Note that the last paragraph of Section 2.1 has typos. It should say:
"All commands should always be sent on Endpoint 1, and the responses to commands will always be on Endpoint 2. Endpoint 3 is only used to send stream data from the U3 to the host."
12-03-2008 04:56 PM
Thanks for that. 🙂
Yes, it should be a U3.
I'll have a look down the Linux track should I have too many more problems.
Ah, I do remember having read that bit about endpoints. I figured I'd missed a trick somewhere and that makes sense now.
11-23-2009 12:45 AM
Nothing I have been trying the last few days has gotten Labview 8.6 or 9.0 to play nice with the Labjack.
I have written many small programs now with Labview and Xcode that work well (enough) using the CIN interface.
I have written many small programs now with Xcode that work well using the Labjack
When I write programs using Labview's CIN interface in Xcode that use Labjack code it does not work, the programs (of any complexity) compile, they even execute from Labview, but any hardware related functions just don't seem to do anything.
PLEASE HELP!!!!
example code:
/* this program runs great, it senses the labjack U3.*/
/* all the example programs witht he labjack also work and easily accept modification to output voltage read data etc*/
/* the program below is based off of this one but will not execute labjack functions ::shakes fist!!!:: */
#include <stdio.h>
#include "labjackusb.h"
int main (int argc, const char * argv[]) {
char str[80];
sprintf(str, "How many LabJacks are connected?\n");
int numU3s = LJUSB_GetDevCount(U3_PRODUCT_ID);
int numU6s = LJUSB_GetDevCount(U6_PRODUCT_ID);
int numUE9s = LJUSB_GetDevCount(UE9_PRODUCT_ID);
sprintf(str,"%sU3s: %d\n", str, numU3s);
sprintf(str,"%sU6s: %d\n", str, numU6s);
sprintf(str,"%sUE9s: %d\n", str, numUE9s);
puts (str);
return 0;
}
/* CIN source file does not work as it should */
/ * executes in Labview but outputs 0 instead of 1 */
#include "extcode.h"
#include <stdlib.h>
#include "labjackusb.h"
CIN MgErr CINRun(LStrHandle arg1);
CIN MgErr CINRun(LStrHandle arg1) {
/* ENTER YOUR CODE HERE */
/* simple code to set DAC0 value to arbitrary value. 0.05 - 4.95V */
LStrPrintf(arg1,"How many LabJacks are connected?\n");
int numU3s = LJUSB_GetDevCount(U3_PRODUCT_ID);
//int numU6s = LJUSB_GetDevCount(U6_PRODUCT_ID);
//int numUE9s = LJUSB_GetDevCount(UE9_PRODUCT_ID);
LStrPrintf(arg1,"U3s: %i\n", numU3s);
//sprintf(str,"%sU6s: %d\n", numU6s);
//sprintf(str,"%sUE9s: %d\n", numUE9s);
MgErr err;
goto done;
close:
return err;
//closeUSBConnection(hDevice);
done:
return noErr;
}