LinearX LT360 Owner's manual

1
LT360 Precision Turntable
DLL Programming Manual
DLL Programming Manual
Precision Turntable

2LT360 Precision Turntable
DLL Programming Manual
LT360 Precision Turntable
DLL Programming Manual
LT360LIB.DLL Win32 OS
© 2006 LINEARX SYSTEMS INC.
All Rights Reserved.
Tel: (503) 612-9565
Fax: (503) 612-9344
Printed in the United States of America.
March 30, 2006.
This document was produced on a Pentium-4 / 2GHz PC with Win2K using Adobe PageMaker 7.0, Adobe
Illustrator 10.0, Adobe PhotoShop 7.0, MathType 4.0 for mathematics typography, and SnagIt 5.2 for screen
captures. Final masters were produced using an Xerox Docutech image setter. Help files were composed and
compiled using Windows Help Designer 3.1.

3
LT360 Precision Turntable
DLL Programming Manual
License Agreement and Limited Warranty
Carefully read all of the following terms and conditions of this agreement before opening and using the contents of this
package. The opening of this package indicates your acceptance of the terms and conditions of this license agreement. If you
are not willing to accept the terms and conditions of this agreement, then you should return the entire product, with the
package seal unbroken, to the place of purchase for a full refund of the purchase price.
■Copyright Ownership
Both the program and the documentation are protected under applicable copyright laws. LinearX is the holder of this copyright. Your right to use the program
and the documentation are limited to the terms and conditions described herein. Use of the software unless pursuant to the terms and conditions of this
license, or as otherwise authorized by law, is an infringement of the copyright.
■Limited Non-Exclusive License
You may: (a) use the enclosed program on a single computer, (b) physically transfer the program from one computer to another provided that the program is
used on only one computer at a time, and that you remove any copies of the program from the computer from which the program is being transferred, (c) make
copies of the program solely for backup or archival purposes. You must reproduce and include the copyright notice and label any backup copy.
You may not: (a) distribute copies of the program or the documentation to others, (b) lease, rent, grant sublicenses, or other rights to the program, (c) provide
use of the program in a computer service business, network, time-sharing multiple CPU or multiple users arrangement without the prior written consent of
LinearX, (d) translate or otherwise alter the program or related documentation without the prior written consent of LinearX.
■Terms
Your license to use the program and the documentation will automatically terminate if you fail to comply with the terms of this agreement. Your license
terminates in the event that you receive a license for an updated version of the product that replaces this product. If a license expiration date is printed on your
documentation, or provided through other means such as a time limited electronic or software key, your license expires on the day as shown in the documen-
tation, or on the day that the electronic or software key expires. If this license is terminated you agree to destroy all copies of the program and documentation.
■Limited Warranty
LinearX warrants to the original licensee that the disk(s) and or electronic key(s) on which the program is recorded will be free from defects in materials and
workmanship under normal use for a period of ninety (90) days from the date of purchase as evidenced by a copy of your receipt. If failure of the product
components has resulted from accident, abuse, or misapplication of the product, then LinearX or third party licensors shall have no responsibility to replace the
disk(s) or key(s) under this limited warranty.
This limited warranty and right of replacement is in lieu of, and you hereby waive, any and all other warranties, both expressed and implied, including but not
limited to warranties of merchantability and fitness for a particular purpose. The liability of LinearX or third party licensors pursuant to this limited warranty shall
be limited to the replacement of the defective disk(s) or key(s), and in no event shall LinearX or third party licensors be liable for incidental, indirect, punitive,
or consequential damages, including but not limited to loss of use, loss of profits, loss of data or data being rendered inaccurate, or losses sustained by third
parties even if LinearX or third party licensors have been advised of the possibility of such damages. This warranty gives you specific legal rights which may
vary from state to state. Some states do not allow the limitation or exclusion of liability for consequential damages, so the above limitation may not apply to you.
In addition to the foregoing, you should recognize that all complex software systems and their documentation contain errors and omissions. LinearX, its
distributors, and dealers shall not be responsible under any circumstances for providing information on or corrections to errors and omissions discovered at any
time in the product, whether or not they are aware of the errors or omissions. LinearX does not recommend the use of this product in applications in which
errors or omissions could result in loss of life, injury, or other significant loss.
This license agreement shall be governed by the laws of the state of Oregon and shall inure to the benefit of LinearX, its successors, administrators, heirs and
assigns or third party licensors.
■United States Federal Government Restrictions
If this software is acquired by or on behalf of the U.S. Federal government or its agencies, this provision applies. Use, duplication, or disclosure of this software
is subject to restrictions set forth in the appropriate FAR 52.227-19 and DFAR 252.227-7013 documents, as applicable. The software is "commercial computer
software" and is licensed only with "Restricted Rights". Other Federal restrictions may also apply.
LinearX Systems Inc.
9500 SW Tualatin-Sherwood Rd.
Tualatin, OR 97062-8586 USA
TEL:(503) 612-9565 FAX:(503) 612-9344 WEB: www.linearx.com
Copyright 2006, LinearX Systems Inc. All rights reserved. All other Trademarks are the property of their respective owners.

4LT360 Precision Turntable
DLL Programming Manual
Technical Support
LinearX provides detailed printed manuals and on-line help within the program as the primary
source for user information and assistance regarding the use of this product. If these sources do
not contain the answers to your questions, contact LinearX via any of the following methods:
Internet Forums: www.linearx.com/forums
Internet Web: www.linearx.com
Fax: (503) 612-9344
Tel: (503) 612-9565
Technical support is free and unlimited at this time, however we reserve the right to charge for
this service in the future as conditions, overhead, and support personnel requirements dictate.
When contacting us regarding a technical support issue, PLEASE follow these steps to aid us in
understanding and solving your problem:
(1) If your question involves specific details or parameters unique to your project and problem, please include a copy of
your design files with the necessary data so that we can reproduce your problem. This is only possible if you are
communicating via an electronic means such as Email or uploading files directly to our web site.
(2) If the issue regards error messages from the program, please include an exact description of the error message
and/or address information that the program reports.
(3) If there are specific steps involved to reproduce the issue, please note these exact steps required so that we can
reproduce the problem.
Note: Technical support
does not
include programming assistance. It is assumed that the reader has sufficient
experience and knowledge to incorporate the DLL into their own application.
Technical support hours are: Monday-Friday 9:00AM to 5:00PM Pacific Standard Time.

5
LT360 Precision Turntable
DLL Programming Manual
1.1 Overview of LT360LIB.DLL ........................................................ 7
1.2 Header / Include Files ............................................................ 8
1.3 Opening and Closing a Link ..................................................... 9
1.4 Error Messages ...................................................................... 11
1.5 Using LT360 Commands ..................................................... 16
2.1 Goto CCW .......................................................................... 17
2.2 Goto CW ........................................................................... 18
2.3 Step CCW ..................................................................... 19
2.4 Step CW .................................................................... 20
2.5 Set Smart Torque .................................................... 21
2.6 Set Baud Rate ......................................................... 22
2.7 Set Origin .................................................................... 23
2.8 Set Pulse Direction ........................................................ 24
2.9 Set Pulse Edge ........................................................... 25
2.10 Set Step Size .......................................................... 26
2.11 Set Velocity ........................................................... 27
2.12 Set Torque ............................................................ 28
2.13 Set Acceleration Function .......................................... 29
2.14 Set Name ............................................................... 31
2.15 Set Pulse Input ...................................................... 32
2.16 Set Analog Input ...................................................... 33
2.17 Set Display Polarity ................................................ 34
2.18 Set Input Polarity ................................................... 35
2.19 Set Output Polarity ................................................ 36
2.20 Set Move Abort .................................................... 37
2.21 Set Motor Home Check ......................................... 38
2.22 Set Output Mode .................................................... 39
2.23 Get Name ............................................................... 41
2.24 Get Title ................................................................. 42
2.25 Get Firmware Version ............................................. 43
2.26 Get Firmware Date .................................................. 44
2.27 Get Production Date .................................................. 45
2.28 Get Calibration Date .................................................. 46
Contents
Chapter 1: Overview 7
Chapter 2: Command Reference 17

6LT360 Precision Turntable
DLL Programming Manual
2.29 Get Calibration Due ..................................................... 47
2.30 Get Serial Number ...................................................... 48
2.31 Get Baud Rate ............................................................ 49
2.32 Get Position ............................................................ 50
2.33 Get Pulse Direction ................................................... 51
2.34 Get Pulse Edge .......................................................... 52
2.35 Get Step Size ........................................................... 53
2.36 Get Velocity ............................................................ 54
2.37 Get Torque ............................................................ 55
2.38 Get Acceleration Function ........................................ 56
2.39 Get Moving ............................................................ 58
2.40 Get Pulse Input ......................................................... 59
2.41 Get Analog Input .................................................... 60
2.42 Get Smart Torque ....................................................... 61
2.43 Get Display Polarity .................................................... 62
2.44 Get Input Polarity ...................................................... 63
2.45 Get Output Polarity ................................................... 64
2.46 Get Motor Home Check .............................................. 65
2.47 Get Revision Code ....................................................... 66
2.48 Get Output Mode ........................................................... 67
Contents

7
LT360 Precision Turntable
DLL Programming Manual
1.1 Overview of LT360LIB.DLL
A DLL (Dynamic Link Library) is provided for use by user application
programs to allow direct control of the LT360 Precision Turntable. The DLL
supports the Win32 OS environments. For other operating system environ-
ments, the universal RS-232 programming method should be used.
The DLL supports both methods of linking to LT360 turntables either via
serial RS-232 connections or the USB (Universal Serial Bus). Multiple LT360
units can be managed by the DLL simultaneously, from 1 to 128 units.
The DLL handles all of the management details necessary for easy serial
communications over either the PC's com ports or USB. The application
program needs only to place calls to the DLL through 4 simple functions.
The LT360LIB.DLL file should be placed in a folder where the Windows
system can find it. Typically placing a copy in the application folder is
common, or in the main Windows folder.
The DLL functions are 32 bit code and can be called by any Win32 applica-
tion written in any language. An appropriate header file is all that is required
for the exported functions for linking.

8LT360 Precision Turntable
DLL Programming Manual
1.2 Header / Include Files
Two example header / include files for linking and calling the DLL
functions are provided for C/C++ or Delphi/Pascal:
Header / Include Files
■LT360LIB.h C/C++
■LT360LIB.pas Delphi/Pascal
Other header files for different languages can be translated from these
examples. The header files contain all of the prototype exported
functions along with the command identifier constants used to make the
various function calls to the LT360 turntables.
The header files may require modification depending on the particular
behavior of the compiler/linker being used.

9
LT360 Precision Turntable
DLL Programming Manual
The procedure for opening a link is very easy. First connect an LT360 to
either a serial COM port or USB port on the computer. Then call one of
two functions to open the link:
LONGINT LT360LIB_OpenLinkUSB(void);
LONGINT LT360LIB_OpenLinkCOM(LONGINT ComNum, LONGINT BaudRate);
■LT360LIB_OpenLinkUSB
This call is used if the turntable is connected to the USB bus. There are no
parameters. Since there may be multiple LT360 units attached to the USB
bus, this function can be called more than once.
The function returns a Handle to each unit found, which is simply a numeric
index. The calling program should maintain and store these handles. If no
more LT360 units are found, then the handle returned is 0.
Note: The USB driver for the LT360 must be installed in the Win32 system.
■LT360LIB_OpenLinkCOM
This call is used if the turntable is connected to a serial COM port. There
are two parameters: the COM port number (ie. 1,2,3,4...) and the baud rate.
The default baud rate shipped with the LT360 is 9600. You must specify
the COM port number in which the LT360 is connected. The function may
be called multiple times with different com port numbers for LT360 units
attached to the different com ports.
The function returns a Handle to the unit found, which is simply a numeric
index. The calling program should maintain and store these handles. If no
LT360 unit is found, then the handle is 0.
Note: The 9 pin serial cable should be straight-through, not null modem.
■LT360LIB_CloseLink
To close a link to an LT360, call this function with the handle of the unit.
The return value is True if successful, and false if an error.
LONGBOOL LT360LIB_CloseLink(LONGINT Handle);
1.3 Opening and Closing a Link

10 LT360 Precision Turntable
DLL Programming Manual
■Example with USB link
The following code fragment demonstrates the sequence of calls for a
USB link to a LT360 unit.
// Open link via USB, save returned handle
H360 = LT360LIB_OpenLinkUSB();
...
// Call the LT360 to set the Step Size to 1 degree
LT360LIB_CmdValue(H360,lt_SetStepSize,'1.0');
// Call the LT360 to do a step CCW
LT360LIB_CmdValue(H360,lt_Step_CCW,null);
...
// Close the link when done
LT360LIB_CloseLink(H360);
■Example with COM link
The following code fragment demonstrates the sequence of calls for a
RS-232 serial port link to a LT360 unit.
// Open link via serial port, COM3 at 9600 baud, save returned handle
H360 = LT360LIB_OpenLinkCOM(3,9600);
...
// Call the LT360 to set the Step Size to 1 degree
LT360LIB_CmdValue(H360,lt_SetStepSize,'1.0');
// Call the LT360 to do a step CCW
LT360LIB_CmdValue(H360,lt_Step_CCW,null);
...
// Close the link when done
LT360LIB_CloseLink(H360);

11
LT360 Precision Turntable
DLL Programming Manual
1.4 Error Messages
The LT360 can display a variety of error codes on the front panel
display. The error message will be displayed over a 4 second interval
with a format such as Err0 or Er13.
The following list describes some of the error codes which can appear:
//-------------------------------------------------
// Show Error Display Codes
//-------------------------------------------------
// 0 - Motor Home Position Error
// 1 - RS232-OE Overrun Error
// 2 - RS232-PE Parity Error
// 3 - RS232-FE Framing Error
// 4 - RS232-BI Break Int Error
// 5 - RS232 Unknown Command
// 6 - RS232 Invalid Parameter
// 7 - RS232 Invalid Return
// 8 - USB Unknown Command
// 9 - RS232 Command Timeout
// 10 -
// 11 - Display Cntrlr Adr Failure
// 12 - Switch Cntrlr Adr Failure
// 13 - Torque Cntrlr Adr Failure
// 14 - Output Cntrlr Adr Failure
// 15 -
// 16 -
// 17 -
// 18 -
// 19 -
// 20 -
//-------------------------------------------------
Most errors produced by the LT360 will be RS-232 command or
parameter errors, especially if the user is programming via RS-232. The
USB processing routines also rely on the RS-232 command decoders, so
it is very possible to see RS-232 error codes while using the USB
interface.
The basic LT360 serial RS-232 communication parameters are: 9600
baud, 8 data bits, no parity, 1 stop bit, and no flow control.

12 LT360 Precision Turntable
DLL Programming Manual
Error - 0 : Motor Home Position Error
The stepper motor produces a specific number steps for a given amount
of platter rotation. The LT360 utilizes microstepping for additional
precision control. One particular phase of the motor is designated as
the Home position. For any given platter rotation, the motor should
always end in its Home position. This can be checked by the firmware
continuously, if the MotorHomeChk option is enabled. If the motor
position is not in the Home phase at the end of a movement, this error
will be shown.
In normal operation this error should never occur. If it does, the unit
must be powered off, or the MotorHomeChk option disabled, to clear
the error. It is possible for this error to be produced by noise in the
stepper motor controller, or by the load exceeding the torque capability
thereby causing the motor to skip steps.
If this error is shown repeatedly, either there is a problem internal in the
LT360 or the torque load is too great for the drive system.
Error - 1 : RS232-OE Overrun Error
This error indicates problems with the serial port communications. It
can be caused by differences in the communication parameters be-
tween the computer and the LT360. Make sure that the computer serial
port setup is 9600 baud, 8 data bits, no parity, and 1 stop bit. If the
LT360 baud rate has been changed, then the PC must be set the same.
Error - 2 : RS232-PE Parity Error
This error indicates problems with the serial port communications. It
can be caused by differences in the communication parameters be-
tween the computer and the LT360. Since the LT360 does not use
parity, this error is unlikely. Make sure that the computer serial port
setup is 9600 baud, 8 data bits, no parity, and 1 stop bit. If the LT360
baud rate has been changed, then the PC must be set the same.

13
LT360 Precision Turntable
DLL Programming Manual
Error - 3 : RS232-FE Framing Error
This error indicates problems with the serial port communications. It can be
caused by differences in the communication parameters between the
computer and the LT360, or invalid parameters in the computer UART of
the computer. Make sure that the computer serial port setup is 9600 baud,
8 data bits, no parity, and 1 stop bit. If the LT360 baud rate has been
changed, then the PC must be set the same. You may also need to reboot
the computer to clear and reinitialize the UART in the computer.
Error - 4 : RS232-BI Break Int Error
This error indicates problems with the serial port communications. It can be
caused by differences in the communication parameters between the
computer and the LT360. Make sure that the computer serial port setup is
9600 baud, 8 data bits, no parity, and 1 stop bit. If the LT360 baud rate has
been changed, then the PC must be set the same.
Error - 5 : RS232 Unknown Command
This error indicates that the character string sent to the LT360 did not
contain a valid command. This error will generally occur if you are writing
your own RS-232 program, and there are bugs in your program. Check the
command strings being sent to verify that they contain valid LT360 com-
mands. Case is not important, but spaces in the right or wrong places can
make a difference.
Error - 6 : RS232 Invalid Parameter
This error indicates that the LT360 was expecting a parameter value for this
command, but did not find one in the command string. Some commands
need parameters and some do not. This error will generally occur if you are
writing your own RS-232 program, and there are bugs in your program.
Check the command strings being sent to verify that they contain valid
LT360 commands and parameters. Case is not important, but spaces in the
right or wrong places can make a difference.

14 LT360 Precision Turntable
DLL Programming Manual
Error - 7 : RS232 Invalid Return
This error indicates that the LT360 was expecting to produce a return
value for a Get command, but the return value was an empty string.
This error will generally occur if you are writing your own RS-232
program, and there are bugs in your program. Check the command
strings being sent to verify that they contain valid LT360 commands
and/or parameters. Case is not important, but spaces in the right or
wrong places can make a difference.
Error - 8 : USB Unknown Command
This error indicates that the LT360 did not understand the command
index sent via USB. This error is very uncommon. It probably indicates
faulty communication over USB, such as a cable being disconnected or
dirty connections. Possibly some other unusual problem.
Error - 9 : RS232 Command Timeout
This error indicates that the LT360 received some characters, but never
received a termination character [Null(0) or CR(13)] before the 10
second timeout expired. When the first character is sent to the LT360, a
timer is started. If a termination character is not received within 10
seconds, then this error is produced and the command buffer is cleared.
Receiving all of the characters for a command string should take very
little time, on the order of micro or milli seconds, so if a termination
charcater does not arrive within 10 seconds, something is wrong. The
LT360 uses this timeout to clear the command buffer every 10 seconds
if characters are received with no termination character. The termina-
tion character is mandatory to notify the LT360 that the entire com-
mand string has been sent and it can now process it.

15
LT360 Precision Turntable
DLL Programming Manual
Error - 11: Display Controller Address Failure
This error indicates that the CPU in the LT360 cannot communicate with the
display controller. This error should never occur. If it does, a failure of a
component in the LT360 is indicated.
Error - 12: Switch Controller Address Failure
This error indicates that the CPU in the LT360 cannot communicate with the
switch controller. This error should never occur. If it does, a failure of a
component in the LT360 is indicated.
Error - 13: Torque Controller Address Failure
This error indicates that the CPU in the LT360 cannot communicate with the
stepper motor torque DAC controller. This error should never occur. If it
does, a failure of a component in the LT360 is indicated.
Error - 14: Output Controller Address Failure
This error indicates that the CPU in the LT360 cannot communicate with the
analog output DAC controller. This error should never occur. If it does, a
failure of a component in the LT360 is indicated.

16 LT360 Precision Turntable
DLL Programming Manual
The commands which a typical user application needs can all be called
using a single function:
This function has three parameters and returns a true/false result for
success or failure. The first parameter is the Handle to the LT360 unit
(returned from the OpenLink calls), the second parameter is the
Command Identifier, and the third parameter is a ParamValue string
(ASCIIZ string).
All user commands for the LT360 are sent using this function with
various command identifiers. They are described in the header files,
and on the following pages. The ParamValue string pointer is used both
as an In/Out parameter to send data or receive data from the LT360.
For some Set commands that do not require a parameter, this value can
be null/nil. For Get commands which return a value, the user must
supply a string pointer to the user allocated character space. Generally
32 characters of space is adequate for all command value returns.
Commands fall into two categories: Set and Get. Set commands are
Out commands which can send data to the LT360. Get commands are
In commands which return data from the LT360. Some Set commands
may or may not have a parameter value.
Numeric values sent as parameters to the LT360 must be converted into
a string. They are also returned as a string.
If the command or data sent to an LT360 is incorrect, an error message
will be displayed on the LT360 front panel. The function above will only
reflect an error if there is a problem with the data transmission.
1.5 Using LT360 Commands
LONGBOOL LT360LIB_CmdValue(LONGINT Handle, LONGINT CmdID, char *ParamValue);

17
LT360 Precision Turntable
DLL Programming Manual
■Class Set (out)
■Identifier lt_Goto_CCW
■Hex Value 0x1C
■Call LT360LIB_CmdValue(Handle, lt_Goto_CCW, '±nnn.n');
■Parameter Position (degrees)
Description
This command causes the LT360 to move to the desired location specified
by the parameter value using counter clockwise rotation. If the LT360 is
already at this location, no movement occurs.
The parameter value should have tenths of a degree precision, and may be
either unipolar (0..+360.0) or bipolar (0..±180.0).
The Goto 0 command can also be issued from the front panel of the unit, or
the LR360 remote using the switches on the front panel.
2.1 Goto CCW

18 LT360 Precision Turntable
DLL Programming Manual
2.2 Goto CW
■Class Set (out)
■Identifier lt_Goto_CW
■Hex Value 0x1D
■Call LT360LIB_CmdValue(Handle, lt_Goto_CW, '±nnn.n');
■Parameter Position (degrees)
Description
This command causes the LT360 to move to the desired location
specified by the parameter value using clockwise rotation. If the LT360
is already at this location, no movement occurs.
The parameter value should have tenths of a degree precision, and may
be either unipolar (0..+360.0) or bipolar (0..±180.0).
The Goto 0 command can also be issued from the front panel of the
unit, or the LR360 remote using the switches on the front panel.

19
LT360 Precision Turntable
DLL Programming Manual
■Class Set (out)
■Identifier lt_Step_CCW
■Hex Value 0x1E
■Call LT360LIB_CmdValue(Handle, lt_Step_CCW, null);
■Parameter (none)
Description
This command causes the LT360 to move from its current position by the
current step size using counter clockwise rotation. No parameter is re-
quired.
The step command can also be issued from the front panel of the unit, the
LR360 remote, or by the TTL Pulse input on the front panel.
2.3 Step CCW

20 LT360 Precision Turntable
DLL Programming Manual
■Class Set (out)
■Identifier lt_Step_CW
■Hex Value 0x1F
■Call LT360LIB_CmdValue(Handle, lt_Step_CW, null);
■Parameter (none)
Description
This command causes the LT360 to move from its current position by
the current step size using clockwise rotation. No parameter is re-
quired.
The step command can also be issued from the front panel of the unit,
the LR360 remote, or by the TTL Pulse input on the front panel.
The parameter value should have tenths of a degree precision, and may
be either unipolar (0..360.0) or bipolar (0..±180.0).
2.4 Step CW
Other manuals for LT360
1
Table of contents
Other LinearX Turntable manuals