Download Print this page
Hide thumbs Also See for U12:

Advertisement

Quick Links

Published on LabJack (http://labjack.com)
U12 User's Guide
The complete manual for the LabJack U12. To make a PDF of the whole manual, click "Export All" towards the upper-right of this
page. If you are looking at a PDF or hardcopy, realize that the original is an online document at
http://labjack.com/support/u12/users-guide.
User's Guide
1 - Installation
The LabJack U12 requires a PC running Windows 98SE, ME, 2000, or XP. To determine your operating system version, go to:
Start => Settings => Control Panel => System => General
and make sure the version number is 4.10.2222 or higher (Win98SE=4.10.2222, WinME=4.90.3000, Win2000=5.0.2195,
WinXP=5.1.XXXX).
It does not matter if the hardware or software is installed first.
If you experience installation problems on Windows 98 Second Edition, before contacting us, please go the Windows 98 Second
Edition support page.
1.1 - Hardware Installation
With the PC on and using the included cable, connect the LabJack U12 to the USB port on the PC or USB hub. The USB cable
provides power and communication for the LabJack U12. The status LED should immediately blink 4 times (at about 4 Hz), and
then stay off while the LabJack enumerates.
Enumeration is the process where the PC's operating system gathers information from a USB device that describes it and it's
capabilities. The low-level drivers for the LabJack U12 come with Windows and enumeration will proceed automatically. The first
time a device is enumerated on a particular PC, it can take a minute or two, and Windows might prompt you about installing
drivers. Accept all the defaults at the Windows prompts, and reboot the PC if asked to do so. The Windows Installation CD might
also be needed at this point. Make sure a CD with the correct version of Windows is provided. Enumeration occurs whenever the
USB cable is connected, and only takes a few seconds after the first time.
When enumeration is complete, the LED will blink twice and remain on. This means Windows has enumerated the LabJack
properly.
If the LabJack fails to enumerate:
Make sure you are running Windows OS version 4.10.2222 or higher,
Try connecting the LabJack to another PC,
Try connecting a different USB device to the PC,
Check our online forum and/or contact LabJack.
1.2 - Software Installation
Although, the low-level USB drivers for the LabJack are included with Windows, high-level drivers are needed to send and receive
data. Get started by going to labjack.com/support/u12.
When the LabJack installation is finished, it will start the National Instruments LabVIEW Run-Time Engine (LVRTE) setup. The
LVRTE is required for the example applications such as LJtest. If prompted to reboot after this installation, go ahead and do so.
Virus scanners can often interfere with the installation of the LVRTE. If you have trouble running the example applications, repeat
the LabJack software installation to make sure the LVRTE is installed.
To test the installation, start LJtest by selecting
1

Advertisement

loading

Summary of Contents for LabJack U12

  • Page 1 1.1 - Hardware Installation With the PC on and using the included cable, connect the LabJack U12 to the USB port on the PC or USB hub. The USB cable provides power and communication for the LabJack U12. The status LED should immediately blink 4 times (at about 4 Hz), and then stay off while the LabJack enumerates.
  • Page 2: Hardware Description

    Figure 2-1. LabJack U12 top surface. Figure 2-1 shows the top surface of the LabJack U12. Not shown is the USB and DB25 connector, which are both on the top edge. The DB25 connector provides connections for 16 digital I/O lines, called D0-D15. It also has connections for ground and +5 volts.
  • Page 3 AI0 and AI1 to ground will have a maximum value near 170 volts, and will seriously damage the LabJack. Whether or not the ground (GND) connection is needed (Figure 2-3) will depend on the nature of Vs.
  • Page 4 Vs is the supply voltage (+5V in Figure 2-4). When Va is connected to AI0, as shown in Figure 2-4, the input bias current of the LabJack affects the voltage divider circuit, and if the resistance of R1 and R2 is too large, this effect must be accounted for or eliminated. This is true for any signal with too high of a source impedance.
  • Page 5 2.2 - AO0 & AO1 The LabJack U12 has 2 screw terminals for analog output voltages. Each analog output can be set to a voltage between 0 and the supply voltage (+5 volts nominal) with 10-bits of resolution.
  • Page 6 2.4 - D0-D15 Connections to 16 of the LabJack’s 20 digital I/O are made at the DB25 connector, and are referred to as D0-D15. These 16 lines have no overvoltage/short-circuit protection, and can sink or source up to 25 mA each (total sink or source current of 200 mA max for all 16).
  • Page 7 U12 ground will become the preferred ground for the other systems and they could try to send high currents into the U12. To prevent this it is often a good idea to put a 10-100 ohm resistor (or even a fuse) in series with GND on the U12 and any grounds from active systems.
  • Page 8: Example Applications

    3.1 - LJconfig Every LabJack has a local ID and serial number. The local ID is a value between 0 and 255 that can be changed by the user. The serial number is a value between 256 and 2,147,483,647 that is unique among all LabJacks and cannot be changed by the user.
  • Page 9 Figure 3-2 will appear. Figure 3-2. LJconfig Change Local ID Enter a new local ID between 0 and 255 and push the “Change” button. The new local ID will be written and the LabJack will be forced to re-enumerate.
  • Page 10 The main window for LJlogger is shown in Figure 3-5. The white colored items and the “SDX” buttons are controls to be edited/selected by the user. The grey colored items are indicators which display various information about the LabJack. Clicking the button labeled “Save Panel Settings”...
  • Page 11 Figure 3-6. LJlogger Configuration Clicking on the “Internet Setup” button in Figure 3-6 brings up the Internet configuration window shown in Figure 3-7. Basic customization of the HTML file can be done by clicking on “Advanced HTML Configuration” which brings up Figure 3-8. Clicking on the “Trigger Setup”...
  • Page 12 Figure 3-8. LJlogger HTML Configuration Figure 3-9. LJlogger Trigger Configuration Figure 3-9 shows 9 example triggers: Trigger #0: If the scaled data from analog input row 7 (Figure 3-5) is greater than 5, then set AO1 to 5 volts. Once triggered, there is a 10 second delay before it can be triggered again.
  • Page 13 1. When you press this button it locks button 3 on (autoscale) position. 2. When you press this button it locks button 4 on (autoscale) position. 3. Pressing this button autoscales the x-axis. 4. Pressing this button autoscales the y-axis. 5.
  • Page 14 LabJack (except the USB of course). Note that the U12 is not the “Test Fixture”. Rather, the U12 is the device under test (DUT) and might connect to a test fixture. LJtest is installed as part of the normal U12 software package. It can typically be run by doing Start => Programs => LabJack U12...
  • Page 15 Figure 3-14. LJtest If all tests fail except “OS Version” and “Driver Version”, it generally indicates LJtest does not detect a LabJack U12 at all. Check for proper blinking of status LED upon power-up, and if using Windows 98 SE check out the related file (Win98sehid.zip) from the downloads page at labjack.com.
  • Page 16 Write To File: Appends data to a tab-delimited ASCII file called ljsht.dat in the current directory. Data is written as seconds since 1904, followed by tempC/tempF/RH for each probe. 3.9 - LJSHTmulti Displays readings from up to 20 EI-1050 digital temperature/humidity probes connected to a single LabJack U12.
  • Page 17: Programming Reference

    – Functions with this input take either a local ID, serial number, or -1. A local ID or serial number will specify a specific LabJack, while –1 means the first found LabJack. Every LabJack has a local ID and serial number. The local ID is a value between 0 and 255 that can be changed by the user.
  • Page 18 *idnum – Local ID, serial number, or -1 for first found. demo – Send 0 for normal operation, >0 for demo mode. Demo mode allows this function to be called without a LabJack. channel – Channel command is 0-7 for single-ended, or 8-11 for differential.
  • Page 19 *idnum – Local ID, serial number, or -1 for first found. demo – Send 0 for normal operation, >0 for demo mode. Demo mode allows this function to be called without a LabJack. resetCounter – If >0, the counter is reset to zero after being read.
  • Page 20 *idnum – Local ID, serial number, or -1 for first found. demo – Send 0 for normal operation, >0 for demo mode. Demo mode allows this function to be called without a LabJack. channel – Line to read. 0-3 for IO or 0-15 for D.
  • Page 21 *idnum – Local ID, serial number, or -1 for first found. demo – Send 0 for normal operation, >0 for demo mode. Demo mode allows this function to be called without a LabJack. *stateIO – Output states for IO0-IO3. Has no effect if IO are configured as inputs, so a different function must be used to configure as output.
  • Page 22 The execution time of this function, in milliseconds, depends on transfermode and can be estimated with the below formulas. The actual number of samples collected and transferred by the LabJack is the smallest power of 2 from 64 to 4096 which is at least as big as numScans*numChannels.
  • Page 23 RAM buffer to the PC application. A call to this function should be followed by periodic calls to AIStreamRead, and eventually a call to AIStreamClear. Note that while streaming the LabJack U12 is too busy to do anything else.
  • Page 24 – If >0, the current count (CNT) is returned instead of the 2nd, 3rd, and 4th analog input channels. 2nd channel is bits 0-11. 3rd channel is bits 12-23. 4th channel is bits 24-31. This feature was added to the LabJack U12 starting with firmware version 1.03, and this input has no effect with earlier firmware versions.
  • Page 25 *reserved – Reserved for future use. Send a pointer to a 0. *ljScanBacklog – Returns the scan backlog of the LabJack RAM buffer. This is the number of scans remaining in the U12 buffer after this read. If this value is growing from read to read, data is not being read fast enough and the buffer will eventually overflow.
  • Page 26 *idnum – Local ID, serial number, or -1 for first found. demo – Send 0 for normal operation, >0 for demo mode. Demo mode allows this function to be called without a LabJack. trisD – Directions for D0-D15. 0=Input, 1=Output.
  • Page 27 *idnum – Local ID, serial number, or -1 for first found. demo – Send 0 for normal operation, >0 for demo mode. Demo mode allows this function to be called without a LabJack. timeoutMult – If enabled, read timeout is about 100 milliseconds times this value (0-255).
  • Page 28 *idnum – Local ID, serial number, or -1 for first found. demo – Send 0 for normal operation, >0 for demo mode. Demo mode allows this function to be called without a LabJack. portB – If >0, asynch PortB is used instead of PortA.
  • Page 29 FAR* data5 ) 4.14 - BitsToVolts Converts a 12-bit (0-4095) binary value into a LabJack voltage. No hardware communication is involved. Volts=((2*Bits*Vmax/4096)-Vmax)/Gain where Vmax=10 for SE, 20 for Diff. Declaration: long BitsToVolts ( long chnum, long chgain, long bits,...
  • Page 30 *idnum – Local ID, serial number, or -1 for first found. demo – Send 0 for normal operation, >0 for demo mode. Demo mode allows this function to be called without a LabJack. resetCounter – If >0, the counter is reset to zero after being read.
  • Page 31 *idnum – Local ID, serial number, or -1 for first found. demo – Send 0 for normal operation, >0 for demo mode. Demo mode allows this function to be called without a LabJack. *trisD – Directions for D0-D15. 0=Input, 1=Output.
  • Page 32 *idnum – Local ID, serial number, or -1 for first found. Outputs: *idnum – Returns the local ID or –1 if no LabJack is found. If error, returns 512 plus a normal LabJack errorcode. 4.21 - GetWinVersion Uses a Windows API function to get the OS version.
  • Page 33 FAR* reserved2 ) 4.23 - LocalID Changes the local ID of a specified LabJack. Changes will not take effect until the LabJack is re-enumerated or reset, either manually by disconnecting and reconnecting the USB cable or by calling ReEnum or Reset.
  • Page 34 38/33 microseconds to just over 1.3 seconds. If you have enabled the LabJack Watchdog function, make sure it’s timeout is longer than the time it takes to output all pulses. The timeout of this function, in milliseconds, is set to: 5000+numPulses*((B1*C1*0.02)+(B2*C2*0.02))
  • Page 35 Note that due to boot-up tests on the LabJack U12, if PulseOutStart is the first command sent to the LabJack after reset or power- up, there will be no response for PulseOutFinish. In practice, even if no precautions were taken, this would probably never happen, since before calling PulseOutStart, a call is needed to set the desired D lines to output.
  • Page 36 *idnum – Local ID, serial number, or -1 for first found. demo – Send 0 for normal operation, >0 for demo mode. Demo mode allows this function to be called without a LabJack. timeoutMS – Amount of time, in milliseconds, that this function will wait for the PulseOutStart response.
  • Page 37 Note that internally this function operates on the state and direction of IO0 and IO1, and to operate on any of the IO lines the LabJack must operate on all 4. The DLL keeps track of the current direction and output state of all lines, so that this function can operate on IO0 and IO1 without changing IO2 and IO3.
  • Page 38 Inputs: *idnum – Local ID, serial number, or -1 for first found. softComm – If >0, forces software based communication. Otherwise software communication is only used if the LabJack U12 firmware version is less than V1.1. waitMeas – If >0, this is a T or RH measurement request.
  • Page 39 Up to 18 bytes can be written/read. Communication is full duplex so 1 byte is read at the same time each byte is written. If more than 4 bytes are written or read, this function uses calls to WriteMem/ReadMem to load/read the LabJack’s data buffer.
  • Page 40 Execution time for this function is 20 milliseconds or less (typically 16 milliseconds in Windows). If you set the watchdog to reset the LabJack, and choose too small of a timeout period, it might be difficult to make the device stop resetting.
  • Page 41 – Send 0 for normal operation, >0 for demo mode. Demo mode allows this function to be called without a LabJack. active – Enables the LabJack watchdog function. If enabled, the 32-bit counter is disabled. timeout – Timer reset value in seconds (1-715).
  • Page 42: Description Of Errorcodes

    Returns: optionBits Inputs: demo – Send 0 for normal operation, >0 for demo mode. Demo mode allows this function to be called without a LabJack. ledOn – If >0, the LabJack LED is turned on. disableCal – If >0, voltages returned will be raw readings that are not corrected using calibration constants.
  • Page 43 It is recommended that the function GetErrorString be used to interpret errorcodes, but this list is provided as a convenience.
  • Page 44 Error Number Description No error. Unknown error. No LabJacks found. LabJack n not found. Set USB buffer error. Open handle error. Close handle error. Invalid ID. Invalid array size or value. Invalid power index. FCDD size too big. HVC size too big.
  • Page 45 If bit 8 is set, the error occurred in the stream thread. Bit 10 is set for Windows API errors. 5 - Low-Level Function Reference This section describes the bytes that are sent to the U12 over USB. Most users are going to use the functions provided by the UW driver (Section 4).
  • Page 46 >>> d = u12.U12() open called Writing: [0x0, 0x0, 0x0, 0x0, 0x0, 0x57, 0x0, 0x0] Received: [0x57, 0x0, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0] >>> d.rawAISample() Writing: [0x8, 0x9, 0xa, 0xb, 0x1, 0xc0, 0x0, 0x0] Received: [0x80, 0x0, 0x99, 0xb, 0x28, 0x99, 0x2c, 0x5] 'IO3toIO0States': <BitField object: [ IO3 = Low (0), IO2 = Low (0),...
  • Page 47 'D15toD8Directions': <BitField object: [ D15 = Input (1), D14 = Input (1), D13 = Input (1), D12 = Input (1), D11 = Input (1), D10 = Input (1), D9 = Input (1), D8 = Input (1) ] >, 'D7toD0OutputLatchStates': <BitField object: [ D7 = 0 (0), D6 = 0 (0), D5 = 0 (0), D4 = 0 (0), D3 = 0 (0), D2 = 0 (0), D1 = 0 (0), D0 = 0 (0) ] >,...
  • Page 48 Bits 15-8 of Counter Least Significant Byte of Counter LabJackPython Example >>> import u12 >>> d = u12.U12() open called Writing: [0x0, 0x0, 0x0, 0x0, 0x0, 0x57, 0x0, 0x0] Received: [0x57, 0x0, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0] >>> d.rawCounter()
  • Page 49 After receiving a AIBurst command, the LabJack collects 4 channels at the specified data rate, and puts data in the buffer. This continues until the buffer is full, at which time the LabJack starts sending the data to the host. Data is sent to the host 1 scan at a time while checking for a command from the host.
  • Page 50 Mux Settings – 0b0000 = 0-1 (Differential), 0b0001 = 2-3 (Differential), 0b0010 = 4-5 (Differential), 0b0011 = 6-7 (Differential). Single-Ended readings = 0b1000 + AI Number. LabJackPython Example >>> import u12 >>> d = u12.U12() open called Writing: [0x0, 0x0, 0x0, 0x0, 0x0, 0x57, 0x0, 0x0] Received: [0x57, 0x0, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0] >>>...
  • Page 51 Interval ) which is the interval between samples in cycles. The data is put in the buffer as it it is sampled. Simultaneously, the LabJack pulls data out of the buffer and tries to send it to the host. This continues until the LabJack receives any command from the host.
  • Page 52 B2/C2 – Period of second half cycle is ~70+5C+121BC or about BC*20µs LabJackPython Example Connect a jumper wire from D0 to CNT. >>> import u12 >>> d = u12.U12() open called Writing: [0x0, 0x0, 0x0, 0x0, 0x0, 0x57, 0x0, 0x0] Received: [0x57, 0x0, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0] >>>...
  • Page 53 01X11111 (Reset) XXXXXXXX XXXXXXXX LabJackPython Example >>> import u12 >>> d = u12.U12() open called Writing: [0x0, 0x0, 0x0, 0x0, 0x0, 0x57, 0x0, 0x0] Received: [0x57, 0x0, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0] >>> d.rawReset() Writing: [0x0, 0x0, 0x0, 0x0, 0x0, 0x5f, 0x0, 0x0] 5.9 - Re-Enumerate...
  • Page 54 {'FirmwareVersion': '1.10'} 5.11 - Read RAM Reads 4 bytes out of the U12’s internal memory. Note: Bytes are read down from the starting address. For example, if you read at address 0x203, then byte 0 comes from 0x203, byte 1 comes from 0x202, byte 2 comes from 0x201, and byte 0 comes from 0x200.
  • Page 55 >>> print r {'DataByte3': 5, 'DataByte2': 246, 'DataByte1': 139, 'DataByte0': 170} >>> bytes = [ r['DataByte3'], r['DataByte2'], r['DataByte1'], r['DataByte0'] ] >>> import struct >>> print struct.unpack(">I", struct.pack("BBBB", *bytes))[0] 100043690 5.12 - Write RAM Writes 4 bytes to the U12’s internal memory.
  • Page 56 User area 0x400 - 0x1FFF Circular RAM buffer. LabJackPython Example >>> import u12 >>> d = u12.U12() open called Writing: [0x0, 0x0, 0x0, 0x0, 0x0, 0x57, 0x0, 0x0] Received: [0x57, 0x0, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0] >>> d.rawWriteRAM([1, 2, 3, 4], 0x200)
  • Page 57 Number of bytes to write (0-18) Number of bytes to read (0-18) LabJackPython Example >>> import u12 >>> d = u12.U12() open called Writing: [0x0, 0x0, 0x0, 0x0, 0x0, 0x57, 0x0, 0x0] Received: [0x57, 0x0, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0] >>>...
  • Page 58 Echo of byte 6 from Command Echo of byte 7 from Command LabJackPython Example >>> import u12 >>> d = u12.U12() open called Writing: [0x0, 0x0, 0x0, 0x0, 0x0, 0x57, 0x0, 0x0] Received: [0x57, 0x0, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0] >>>...
  • Page 59 Echo of byte 6 from Command Echo of byte 7 from Command LabJackPython Example >>> import u12 >>> d = u12.U12() open called Writing: [0x0, 0x0, 0x0, 0x0, 0x0, 0x57, 0x0, 0x0] Received: [0x57, 0x0, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0] >>>...
  • Page 60: Appendix A - Specifications

    Appendix A - Specifications Parameter Conditions Typical Units General USB Cable Length meters User Connection(s) Length CE compliance meters Supply Current (1) Operating Temperature °C Clock Error ~ 25 °C ±30 0 to 70 °C ±50 -40 to 85 °C ±100 +5 Volt Power Supply (+5V) Voltage (Vs) (2)
  • Page 61 (1) Current drawn by the LabJack through the USB. The status LED is responsible for 4-5 mA of this current. (2) Self-powered would apply to USB hubs with a power supply, all known desktop computer USB hosts, and some notebook computer USB hosts. Bus-powered would apply to USB hubs without a power supply and some notebook computer USB hosts.