Polaris API Guide
User Manual: Pdf
Open the PDF directly: View PDF
.
Page Count: 198
| Download | |
| Open PDF In Browser | View PDF |
Polaris Application Program Interface Guide Revision 5 March 2011 Revision Status Revision Number Date Description 1 September 2005 Initial release. Describes the API that is compatible with Polaris combined firmware revision 024, and Polaris Vicra/Polaris Spectra API revision G.001.002. 2 July 2006 3 September 2006 Minor edits. 4 May 2007 Added description of API revision G.001.004. This API revision includes support for the hybrid Polaris Spectra System SCU, strobers, GPIO devices, and active tools. 5 March 2011 Removed references to the Polaris System. Added description of API revision G.001.005. Added description of API revision G.001.003, best practices information, and more details on user parameters. Part Number: IL-1070101 Copyright 2005-2011 Northern Digital Inc. All Rights Reserved. p Printed in Canada. Published by: Northern Digital Inc. 103 Randall Dr. Waterloo, Ontario, Canada N2V 1C5 Telephone: Toll Free: Global: Facsimile: Website: + (519) 884-5142 + (877) 634-6340 + (800) 634 634 00 + (519) 884-5184 www.ndigital.com Copyright 2005-2010, Northern Digital Inc. All rights reserved. No part of this document may be reproduced, transcribed, transmitted, distributed, modified, merged or translated into any language in any form by any means - graphic, electronic, or mechanical, including but not limited to photocopying, recording, taping or information storage and retrieval systems - without the prior written consent of Northern Digital Inc. Certain copying of the software included herein is unlawful. Refer to your software license agreement for information respecting permitted copying. DISCLAIMER OF WARRANTIES AND LIMITATION OF LIABILITIES Northern Digital Inc. has taken due care in preparing this document and the programs and data on the electronic media accompanying this document including research, development, and testing. This document describes the state of Northern Digital Inc.’s knowledge respecting the subject matter herein at the time of its publication, and may not reflect its state of knowledge at all times in the future. Northern Digital Inc. has carefully reviewed this document for technical accuracy. If errors are suspected, the user should consult with Northern Digital Inc. prior to proceeding. Northern Digital Inc. makes no expressed or implied warranty of any kind with regard to this document or the programs and data on the electronic media accompanying this document. Northern Digital Inc. makes no representation, condition or warranty to the user or any other party with respect to the adequacy of this document or accompanying media for any particular purpose or with respect to its adequacy to produce a particular result. The user’s right to recover damages caused by fault or negligence on the part of Northern Digital Inc. shall be limited to the amount paid by the user to Northern Digital Inc. for the provision of this document. In no event shall Northern Digital Inc. be liable for special, collateral, incidental, direct, indirect or consequential damages, losses, costs, charges, claims, demands, or claim for lost profits, data, fees or expenses of any nature or kind. Product names listed are trademarks of their respective manufacturers. Company names listed are trademarks or trade names of their respective companies. Polaris Application Program Interface Guide - Revision 5 Polaris Application Program Interface Guide - Revision 5 Table of Contents Table of Contents Read Me First! . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . iii Warnings and Cautions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .iii About This Guide . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . iv Conventions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . iv Contact Information . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .iv 1 List of Commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1 2 Changes in Implementation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4 2.1 Differences Between Polaris Vicra/Polaris Spectra API Revision G.001.002 and G.001.003 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5 2.2 Differences Between Polaris Vicra/Polaris Spectra API Revision G.001.003 and G.001.004 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7 2.3 Differences Between Polaris Vicra/Polaris Spectra API Revision G.001.004 and G.001.005 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11 3 Communicating with an NDI System . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12 3.1 Communication Overview. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12 3.2 Operating Modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12 3.3 General Syntax . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13 3.4 Receiving System Replies . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14 3.5 Best Practices. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15 3.6 Port Handles . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16 4 User Parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20 4.1 About User Parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20 4.2 User Parameter Commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21 4.3 Device Names . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21 4.4 Alerts User Parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23 4.5 Bump Sensor User Parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30 4.6 User-Defined User Parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30 Polaris Application Program Interface Guide - Revision 5 i Table of Contents 4.7 Complete List of User Parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31 5 Commands. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37 6 Error and Warning Code Definitions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 167 6.1 Error Code Definitions. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 167 6.2 Warning Code Definitions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 170 Appendix A Keyed Features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 171 Appendix B Sample C Routines . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 175 Abbreviations and Acronyms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 183 ii Polaris Application Program Interface Guide - Revision 5 Read Me First! Read Me First! This guide describes the Application Program Interface (API) commands that can be used with the Polaris Vicra System, and the Polaris Spectra System. Before sending any commands to the system, read the user guide that accompanied your system to ensure that you have a full understanding of the functionality. Read this chapter before continuing with the rest of the guide. Warnings and Cautions Warnings In all NDI documentation, warnings are marked by this symbol. Follow the information in the accompanying paragraph to avoid personal injury. Warning! 1. When using reply option 0800 with the BX (page 47) or TX (page 146) command, you must take appropriate action to detect the following events: the tool or marker is out of volume, the bump sensor has been tripped, or the system is outside of the optimal operating temperature range. You must determine whether these events are detrimental to your application. If one or more of the events listed occurs, reply option 0800 enables the system to return data that may lead to inaccurate conclusions and may cause personal injury. Cautions Caution! In all NDI documentation, cautions are marked with the word “Caution!”. Follow the information in the accompanying paragraph to avoid damage to equipment. 1. Before an input/output line on a synchronization port can be used as an input, its output value must be set to a high level with SETIO (page 127). If you set the input to low and use the line as an input, there will be incorrect status readings and you may cause damage to the interface electronics. Polaris Application Program Interface Guide - Revision 5 iii About This Guide About This Guide This guide describes firmware revisions G.001.002, G.001.003, G.001.004 and G.001.005 of the API. To determine the API revision number programmed into your system, use the APIREV command. Conventions Terminology System refers to the Polaris Vicra System, or Polaris Spectra System. Compatibility This API guide describes several versions of the API. Some commands or options are not available for each revision of the API. In this case, compatibility is indicated in columns at the right hand side of the page. (See, for example, “List of Commands” on page 1.) At the beginning of each command description, the systems compatible with the command are listed. Where necessary, specific compatibility differences are listed in the Compatibility Notes near the end of the command description. Contact Information If you have any questions regarding the content of this guide or the operation of this product, please contact us: 103 Randall Drive Waterloo, ON, Canada N2V 1C5 Fritz-Reichle-Ring 2 D-78315 Radolfzell Germany Phone: + 1 (519) 884-5142 Toll Free: + 1 (877) 634-6340 Global: + (800) 634-634-00 Fax: + 1 (519) 884-5184 Phone: + 49 (77 32) 939 19 00 Global: + (800) 634 634 00 Fax: + 49 (77 32) 939 19 09 Email: support@ndigital.com Website: www.ndigital.com Email: support@ndieurope.com Website: www.ndieurope.com Unit 301, 3/F Core Building 1 No. 1 Science Park East Avenue, Hong Kong Science Park, Shatin, New Territories, Hong Kong Phone: + (852) 2802 2205 Fax: + (852) 2802 0060 Email: APsupport@ndigital.com Website: www.ndigital.com NDI is committed to continuous improvements in the quality and versatility of its software and hardware. To obtain the best results with your NDI system, check the NDI Support Site regularly for update information: http://support.ndigital.com. iv Polaris Application Program Interface Guide - Revision 5 List of Commands 1 List of Commands Table 1-1 lists all the API commands, and whether they are supported by each revision of the API. Compatibility is indicated as follows: X indicates that the command is supported. * indicates that the command is deprecated. Deprecated commands will no longer be enhanced to support new hardware devices or new API features. Support for deprecated commands may be discontinued in future releases. G.001.002 G.001.003 G.001.004 G.001.005 Table 1-1 Alphabetical List of Commands 3D 39 Returns the latest 3D position of either a single marker or multiple markers. X X X X APIREV 44 Returns the API revision number that functions with your system. X X X X BEEP 45 Sounds the system beeper. X X X X BX 47 Returns the latest tool transformations, individual marker positions, and system status in binary format. X X X X COMM 58 Sets the serial communication settings of the system. X X X X DFLT 61 Restores the user parameters to factory default values. X X X X DSTART 63 Starts Diagnostic mode. X X X X DSTOP 64 Stops Diagnostic mode. X X X X ECHO 65 Returns exactly what is sent with the command. X X X X GET 66 Returns the user parameter values. X X X X GETINFO 68 Returns descriptive information about the user parameters. X X X X GETIO 72 Returns the current status of the input/output lines of a synchronization port. X X GETLOG 74 Returns the contents of a system log file. X X X X HCWDOG 76 Sets up a host communication timeout check. * * * * INIT 78 Initializes the system. X X X X IRATE 79 Sets the illuminator rate. * * * * IRED 81 Turns the markers on a wired tool on or off. X X LED 83 Changes the state of visible LEDs on a wired tool. X X PDIS 85 Disables the reporting of transformations for a particular port handle. X X X X PENA 86 Enables reporting of transformations for a particular port handle. X X X X PFSEL 88 Sets which faces to use to track a multi-faced tool. X X X X PHF 90 Releases system resources from an unused port handle. X X X X PHINF 91 Returns port handle status, and information about the tool associated with the port handle, including physical port location. X X X X Command Page Description Polaris Application Program Interface Guide - Revision 5 1 List of Commands G.001.002 G.001.003 G.001.004 G.001.005 Table 1-1 Alphabetical List of Commands (Continued) PHRQ 99 Assigns a port handle to a tool or GPIO device. X X X X PHSR 101 Returns the number of assigned port handles and the port status for each one. Assigns a port handle to a wired tool, GPIO device, or strober. X X X X PINIT 104 Initializes a port handle. X X X X PPRD 106 Reads data from the SROM device in a wired tool or GPIO device. X X PPWR 108 Writes data to the SROM device in a wired tool or GPIO device. X X PSEL 110 Selects an SROM device as the target for reading or writing with PPRD or PPWR. X X PSOUT 111 Sets the states of the general purpose input/output (GPIO) lines in a GPIO device. X X PSRCH 112 Returns a list of valid SROM device IDs for a wired tool or GPIO device. X X PURD 114 Reads data from the user section of the SROM device in a wired tool or GPIO device. X X PUWR 116 Writes data to the user section of a tool SROM device in a wired tool or GPIO device. X X PVWR 118 Assigns a tool definition file to a wireless tool, overrides a tool definition file in a wired tool or GPIO device, and can be used to test a tool definition file before permanently recording the tool definition file onto the SROM device. X X X X RESET 120 Resets the system (can specify either a hard reset or a soft reset). X X X X SAVE 122 Saves all non-volatile user parameters that have been changed. X X X X SENSEL 123 Sets the IR sensitivity level, or returns the current IR sensitivity level. * * * * Serial break 37 Resets the system (soft reset). X X X X SET 125 Sets user parameter values. X X X X SETIO 127 Sets the current status of the input/output lines of a synchronization port. X X SFLIST 129 Returns information about the supported features of the system. X X X X SSTAT 136 Returns the status of the system processors. * * * * SYSLOG 138 Writes data to the Position Sensor or System Control Unit log file. X X X X TCTST 140 Returns diagnostics on the active markers of a wired tool. X X TSTART 140 Starts Tracking mode. X X X X TSTOP 143 Stops Tracking mode. X X X X TTCFG 144 Sets up a configuration for a wired tool, so that you can test the tool without using a tool definition file. X X Command Page Description 2 Polaris Application Program Interface Guide - Revision 5 List of Commands G.001.002 G.001.003 G.001.004 G.001.005 Table 1-1 Alphabetical List of Commands (Continued) TX 146 Returns the latest tool transformations, individual marker positions, and system status in text format. X X X X VER 158 Returns the firmware revision number of critical processors installed in the system. X X X X VGET 160 Retrieves data previously captured with VSNAP. X X X X VSEL 163 Selects a characterized measurement volume. * * * * VSNAP 165 Captures one complete frame sequence of video data from the sensors. X X X X Command Page Description Polaris Application Program Interface Guide - Revision 5 3 Changes in Implementation 2 Changes in Implementation This chapter describes the changes in implementation from previous versions of the API. Read this chapter if you have written an application and you wish to update it to function with a more recent version of the API. To update an application written for: To function with: Read: Polaris Vicra API revision G.001.002 Polaris Vicra or Polaris Spectra API revision G.001.003 Page 5 Polaris Vicra or Polaris Spectra API revision G.001.003 Polaris Vicra or Polaris Spectra API revision G.001.004 Page 7 Polaris Vicra or Polaris Spectra API revision G.001.004 Polaris Vicra or Polaris Spectra API revision G.001.005 Page 7 Note If you have written an application for a Polaris combined firmware revision not listed above, contact NDI technical support. 4 Polaris Application Program Interface Guide - Revision 5 Changes in Implementation 2.1 Differences Between Polaris Vicra/Polaris Spectra API Revision G.001.002 and G.001.003 This section lists the changes between revisions G.001.002 and G.001.003 of the API. Read this section if: • you have written an application compatible with revision G.001.002 of the API for the Polaris Vicra or Polaris Spectra System, and • you wish to update the application to use some or all of the new features in revision G.001.003 of the API. These changes are additions to the API. Any applications written to function with revision G.001.002 of the API will still function with revision G.001.003. Addition to GETINFO The GETINFO command has the following addition: GETINFO + will return top-level user parameter categories. GETINFO.+ will return the next level of categories under the specified category. For example: Command: GETINFO + Command: GETINFO PS-0.+ Command: GETINFO PS-0.Features.+ Reply: Device=;4;0003;;;; Config=;4;0003;;;; PS-0=;4;0003;;;;2D77 Reply: Features=;4;0003;;;; Info=;4;0003;;;; Param=;4;0003;;;; Cmd=;4;0003;;;;31E6 Reply: Hardware=;4;0003;;;; Firmware=;4;0003;;;; Tools=;4;0003;;;; Keys=;4;0003;;;;1DF5 Change to PHINF Reply option 0010 in the PHINF command now returns a value of 010 for a tool with marker wavelength 930 nm if the tool was characterized using NDI 6D Architect version 2.02 or later. Tools characterized with earlier versions of NDI 6D Architect will still have a value of 000 for a marker wavelength of 930 nm. Changes in Concepts 1. Device Names: Each device in the system configuration has a device name. Use the device name as a prefix to a user parameter. This allows you to read or set user parameters for each system component separately. If you omit the device name, the system will default to the parameters for the first Position Sensor in the configuration (PS-0). In the case of a one-Position Sensor passive system, this is the only Position Sensor. See “Device Names” on page 21 for details. 2. Keyed Features: The system may use optional keyed features which, if enabled, may require special consideration. For details on keyed features, see “Keyed Features” on page 171 and the user guide that accompanied your system. Polaris Application Program Interface Guide - Revision 5 5 Changes in Implementation New User Parameters New user parameters are as follows: 6 New User Parameter Description Access Rules Param.Laser.Laser Status Starts/stops firing the positioning laser. Use this parameter when the Positioning Laser keyed feature is enabled. See “Positioning Laser” on page 174 for details. Read, write Config.Multi Firmware.Load Combined Firmware Revision Combined firmware revision to load on next reset (selection automatically saves when set). Use this parameter when the Multi Firmware keyed feature is enabled. See “Multi Firmware Feature” on page 172 for details. Read, write Config.Multi Firmware.Update Combined Firmware Revision Combined firmware revision to replace on next upgrade or downgrade. Use this parameter when the Multi Firmware keyed feature is enabled. See “Multi Firmware Feature” on page 172 for details. Read, write, save Config.Password Enter the password to enable the ability to change and save the system configuration. Use this parameter when the Password Protect keyed feature is enabled. See “Password Protect Feature” on page 174 for details. Read, write Config.Combined Firmware Revision Combined firmware revision of the current system configuration. Read Device.Type.0 Type of device in the system configuration. Read Device.Instance.0 Instance of this type of device in the system configuration. Read Polaris Application Program Interface Guide - Revision 5 Changes in Implementation 2.2 Differences Between Polaris Vicra/Polaris Spectra API Revision G.001.003 and G.001.004 This section lists the changes between revisions G.001.003 and G.001.004 of the API. Read this section if: • you have written an application compatible with revision G.001.003 of the API for the Polaris Vicra or Polaris Spectra System, and • you wish to update the application to use some or all of the new features in revision G.001.004 of the API. These changes are additions to the API. Any applications written to function with revision G.001.002 or G.001.003 of the API will still function with revision G.001.004. New Commands New commands are as follows: New Command Description GETIO (page 72) Returns the status of the input/output lines of a synchronization port. IRED (page 81) Turns the markers on a wired tool on or off. LED (page 83) Changes the state of visible LEDs on a wired tool. PPRD (page 106) Reads data from the SROM device in a wired tool or GPIO device. PPWR (page 108) Writes data to the SROM device in a wired tool or GPIO device. PSEL (page 110) Selects a tool SROM device as the target for reading or writing with PPRD or PPWR. PSOUT (page 111) Sets the states of the general purpose input/output (GPIO) lines in a GPIO device. PSRCH (page 112) Returns a list of valid SROM device IDs for a wired tool or GPIO device. PURD (page 114) Reads data from the user section of the SROM device in a wired tool or GPIO device. PUWR (page 116) Writes data to the user section of the SROM device in a wired tool or GPIO device. SETIO (page 127) Sets the status of the input/output lines of a synchronization port. TCTST (page 140) Returns diagnostics on the active markers of a wired tool. TTCFG (page 144) Sets up a configuration for a wired tool, so that you can test the tool without using a tool definition file. Changes in Concepts 1. Data rate: In API revisions G.001.002 and G.001.003, it was possible to get repeated information from the system if you requested information at a faster rate than the system could update. This behaviour has been changed for the commands 3D (page 39), BX (page 47), and TX (page 146), so that the system will return a maximum of one reply per frame. This matches the behaviour of Polaris combined firmware revisions 018 and 024. For all other commands, it is still possible to request and receive a reply more than once per frame. 2. GPIO devices: GPIO devices can be used with the hybrid Polaris Spectra System, and are connected to the System Control Unit (SCU) or strobers. Like active tools, GPIO devices are Polaris Application Program Interface Guide - Revision 5 7 Changes in Implementation assigned a port handle, which must be initialized and enabled before the GPIO device can be used. 3. Strobers: Strobers provide an interface for active tools, and can be used with the hybrid Polaris Spectra System. Like active tools, strobers are assigned a port handle. It is not necessary to initialize and enable the port handle for a strober. The SCU contains an “internal strober”; the tool ports and GPIO port on the front of the SCU are part of this internal strober. The internal strober is also assigned a port handle. 4. Log files: The Position Sensor and SCU now each have their own log file. Previous versions of the API supported only the Position Sensor and so the system only had one log file. This change results in a change in the log name specified in the commands GETLOG (page 74) and SYSLOG (page 138). See these commands for details. 5. Alerts: The alerts in the Info.Status.Alerts and Info.Status.New Alerts user parameters are defined differently for the SCU and strober than for the Position Sensor. For details, see “Alerts User Parameters” on page 23. 6. LED behaviour: The behaviour of the LEDs on the Position Sensor has changed. To see which alerts now have different LED behaviour, see “Position Sensor Alerts” on page 24. 7. Diagnostic pending bit: The “diagnostic pending” bit (bit 8 in the BX or TX system status) now indicates whenever an alert is detected or cleared in the Info.Status.New Alerts user parameter. Previously, the “diagnostic pending” bit was set only when an alert was detected. 8. VSnap User Parameters: The user parameters Cmd.VSnap.Illuminated Frame and Cmd.VSnap.Background Frame, used to specify which frames to capture with the VSNAP (page 165) command, can now only be set when the system is in Setup mode. Previously these parameters could be set in any mode, but did not take effect until the next DSTART (page 63) or TSTART (page 142) commmand was issued. 9. Param.Tracking.Sensitivity and Param.Tracking.Selected Volume: These two user parameters can now be set only when the system is in Setup mode. Previously these user parameters could be set in any mode, but would not take effect while the system was in Tracking or Diagnostic modes. 10. Alerts Parameters: The system response (LEDs and error codes) to some of the Position Sensor alerts has changed. See Table 4-2 on page 24 for details. New alerts have been defined for the SCU and strobers. See Table 4-3 on page 27 and Table 4-4 on page 29 for details. 11. Alerts System Response: Some of the alerts indicated in the alerts parameters result in the system not returning data unless reply option 0x0800 is used with the BX or TX command (see “Alerts User Parameters” on page 23 for details). Previously, the system resumed returning data once the Info.Status.New Alerts parameter was read, regardless of whether the alert was actually resolved. Now the system will not return data in these cases until the alert is resolved. Changed Commands 1. BX (page 47) and TX (page 146) 8 • Bits 6 and 7 in report when a port handle has become occupied or unoccupied due to an active tool, strober, or GPIO device being connected or disconnected. • Reply option 0x0001: For GPIO devices, bits 1, 2, and 3 report the status of GPIO lines defined as inputs. (For wired tools, these bits report switch status). Polaris Application Program Interface Guide - Revision 5 Changes in Implementation • Reply option 0x0004 reports the 3D position of a single, stray marker on an active tool. 2. GETLOG (page 74): The way the log name is specified has changed, to allow access to the logs in both the Position Sensor and the SCU. If you specify the log name using the format from previous versions of the API, the system will retrieve the log file for the Position Sensor. This maintains backwards compatibility with previous versions of the API. 3. PHINF (page 91) • Reply option 0x0001: Strobers are reported as 08 and GPIO devices are reported as 0C. • Reply option 0x0001: For GPIO devices, bits 1, 2, and 3 report the status of GPIO lines defined as inputs. (For wired tools, these bits report switch status). • Reply option 0x0008: For GPIO devices, bits 1, 2, and 3 report the status of GPIO lines defined as inputs, and bits 5, 6, and 7 report the status of GPIO lines defined as outputs with feedback. (For wired tools, bits 1, 2, and 3 report switch status, and bits 5, 6, and 7 report LED status.) • Reply option 0x0020: For Polaris, Polaris Vicra, and passive Polaris Spectra, is the Position Sensor serial number. For hybrid Polaris Spectra, this is the device name of the strober that the tool is plugged into (STB-1 or STB-2). If the tool is plugged into the SCU, this is STB-0. • Reply option 0x0040: This new reply option reports the status of the four GPIO lines in a GPIO device. 4. PHRQ (page 99): For hybrid Polaris Spectra, specifying all wildcards for the for a wired tool or GPIO device will default to STB-0 (the tool ports on the SCU). 5. SYSLOG (page 138): A log name must now be specified, to allow access to the logs in both the Position Sensor and the SCU. If you do not specify a log name, the system will write to the log file for the Position Sensor. This maintains backwards compatibility with previous versions of the API. 6. TCTST (page 140): The low threshold for marker current is now 0x0A. 7. VER (page 158): Reply option 3 now reports information for the System Control Unit. The second line of the response was the Tool Interface Unit part number for Polaris. For Polaris Spectra, the second line of the response is the serial number of the System Control Unit. New Error Code A new error code, 0x42, indicates when the command is specific to a device that is not connected to the system. New Device Types The following new device types are supported: Device Type Hardware Device SCU System Control Unit STB Strober Polaris Application Program Interface Guide - Revision 5 9 Changes in Implementation In G.001.003, only a device type of PS (Position Sensor) was supported. For details on device types, see “Device Names” on page 21. New User Parameters New user parameters are as follows: 10 New User Parameter Description Access Rules Hardware Device Param.Serial Port Hardware configuration of the serial port. Read SCU Param.Strober Name User-defined strober name (up to 31 chars). Read, write Strobers Features.Firmware. Package Number Current firmware package number Read Position Sensor, SCU Features.Firmware. Available Versions List of firmware revisions loaded in the device Read Position Sensor, SCU Features.Firmware. Available Combined Firmware Revisions List of combined firmware revisions loaded in the device. Read Position Sensor, SCU Features.Firmware. Combined Firmware Revision Current combined firmware revision of the device. Read Position Sensor, SCU Param.System Ext Sync Mode Enables/disables the external sync mode (see the user guide for details). Read, write SCU Config.Multi Firmware.Available Combined Firmware Revisions List of combined firmware revisions loaded in the system. Read Config (no hardware device specified.) Polaris Application Program Interface Guide - Revision 5 Changes in Implementation 2.3 Differences Between Polaris Vicra/Polaris Spectra API Revision G.001.004 and G.001.005 This section lists the changes between revisions G.001.004 and G.001.005 of the API. Read this section if: • you have written an application compatible with revision G.001.004 of the API for the Polaris Vicra or Polaris Spectra System, and • you wish to update the application to use some or all of the new features in revision G.001.005 of the API. These changes are additions to the API. Any applications written to function with revision G.001.002, G.001.003 or G.001.004 of the API will still function with revision G.001.005. New User Parameters New user parameters are as follows: New User Parameter Description Access Rules Hardware Device Param.Default wavelength. Return Warning Read, write Position Sensor Read Position Sensor, SCU Enables/disables returning a warning on PINIT if the default wavelength was selected for the tool corresponding to the port handle. Features.Firmware. Current safeloader firmware revision Safeloader Version number. Changed Commands 1. GET (page 66) and GETINFO (page 68): On a multi-line GET or GETINFO command, there is no longer a beteen the last parameter=value pair and the . 2. PINIT (page 104): WARNING05 (In combined firmware 006 and later, WARNING05 is returned when the system selects a default marker wavelength to track a tool (if the tool’s tool definition file did not specify a marker wavelength)). Polaris Application Program Interface Guide - Revision 5 11 Communicating with an NDI System 3 Communicating with an NDI System This chapter describes various aspects of communicating with an NDI system. It contains the following sections: 3.1 • “Communication Overview” on page 12 • “Operating Modes” on page 12 • “General Syntax” on page 13 • “Receiving System Replies” on page 14 • “Best Practices” on page 15 • “Port Handles” on page 16 Communication Overview From the application perspective, the Polaris Vicra, or Polaris Spectra System is a serial device, which is listening for incoming commands. Upon receiving a command, the system performs some action and returns the status of this action. The system never initiates communication with the application except on power up or reset, when it returns RESET . (If only an SCU is connected it will return SCUONLY .) Immediately after sending a command, the application can begin to poll the serial buffer for a reply. Most commands reply almost instantaneously. After reaching the end of the reply, the application can send another command. There may be some delay in the response of the PINIT command, and the commands used to read from and write to an SROM device in a wired tool. Note The application must read the complete response from the system before sending another command. Failure to do so may result in an error or in unpredictable system behaviour. 3.2 Operating Modes The system has three modes of operation: Setup, Tracking, and Diagnostic. Some commands will only work if they are sent while the system is in a specific mode of operation. If a command is sent when the system is in a mode not valid for that command, the system returns ERROR0C. Setup Setup mode allows you to configure the system and tools. Tasks done while the system is in Setup mode may include initializing the system, writing to the SROM device on a tool, or checking the system firmware revision. The order of the commands sent while in Setup mode is important. For example, a port handle must be initialized (PINIT) before it can be enabled (PENA). The system enters the Setup mode either on successful power up, on sending a reset, or on exiting from Tracking or Diagnostic modes. 12 Polaris Application Program Interface Guide - Revision 5 Communicating with an NDI System Tracking In Tracking mode, the system measures the positions and orientations of tools in real time and returns the information to the host computer when requested. The BX and TX commands are the most commonly used commands in Tracking mode. The system enters Tracking mode on successful TSTART command and exits Tracking mode on TSTOP command. Diagnostic Diagnostic mode allows you to control and observe tools, but not track them. The system enters Diagnostic mode on successful DSTART command and exits Diagnostic mode on DSTOP command. 3.3 General Syntax Commands must be sent from the host computer to the system in one of the two following formats. To ensure the integrity of data transmission, NDI recommends using format 1, as well as verifying the returned CRC on the host computer. Format 1 <:> ... A <:> must be sent with every command even if no parameters are required. There are no characters or spaces separating the parameters or the individual parts of the commands, except in user parameter names and string values used with the SET, GET, GETINFO, DFLT, and SYSLOG commands. Commands and parameters are not case-sensitive, except for user parameter names and string values used with the SET, GET, GETINFO, DFLT, and SYSLOG commands. This format requires a 16-bit CRC value and therefore may be more useful in application software. The application software can incorporate a CRC calculation and add it to the command each time a command is sent to the system. Including a CRC provides a communications check to ensure that there are no communication problems between the system and the host computer. The CRC is used in both the commands and replies. It is based on all the characters in the command, up to the CRC itself. It is calculated using the polynomial x16 + x15 + x2 + 1. See “Sample C Routines” on page 175 for sample code to calculate the CRC. Format 2 ... A must be sent with every command even if no parameters are required. There are no characters or spaces separating the parameters or the individual parts of the commands, except in user parameter names and string values used with the SET, GET, GETINFO, DFLT, and SYSLOG commands. Commands and parameters are not case-sensitive, except for user parameter names and string values used with the SET, GET, GETINFO, DFLT, and SYSLOG commands. It is not necessary to calculate a Cyclic Redundancy Check (CRC) value when using this format, so this format is useful for sending commands to the system in an application such as a terminal program. Polaris Application Program Interface Guide - Revision 5 13 Communicating with an NDI System 3.4 Receiving System Replies Binary Replies Commands BX, GETLOG, and VGET return binary replies. All other commands return ASCII replies. If a complete command is received by the system, replies are sent back in the format: The system always returns in the reply regardless of whether the command was sent in format 1 or format 2. The will be either the requested data, or ERROR . The is a two-digit hexadecimal error number. See “Error Code Definitions” on page 167 for a listing of all the error messages associated with error numbers. Binary replies are returned in little endian format. For example, a 32-bit reply is returned in the format: Bits 7-0 15 - 8 23 - 16 31 - 24 Reply byte n n+1 n+2 n+3 ASCII Replies All commands return ASCII replies except BX, GETLOG, and VGET, which return binary replies. If a complete command is received by the system, replies are sent back in the format: The system always returns in the reply regardless of whether the command was sent in format 1 or format 2. The will be either the requested data, OKAY, WARNING, WARNING , or ERROR . • WARNING is returned only with the PINIT command. See PINIT (page 104) or “Warning Code Definitions” on page 170 for details. • WARNING is returned only with the PENA command. See “Warning Code Definitions” on page 170 for a listing of the warning messages. • 14 The is a two-digit hexadecimal error number. See “Error Code Definitions” on page 167 for a listing of all the error messages associated with error numbers. Polaris Application Program Interface Guide - Revision 5 Communicating with an NDI System 3.5 Best Practices This section provides guidelines on how to write an application in order to minimize updates required when there are changes to the API. If your application is written correctly, it will still work when additions are made to the API; you will only need to update your application if you wish to take advantage of the new features. • Ignore the value of any returned field that is listed as “reserved” in the API guide. The values of reserved fields may change in future API releases. • Program the application to allow all possible values of a returned field, not only the values that are currently defined. This allows for future expansion. For example, if a field returns one character, but currently only characters 0 and 1 are defined, do not write your application such that 0 and 1 are the only acceptable values; more values may be defined in the future. • Use the frame number, and not the host computer clock, to identify when data was collected. The frame number is incremented by 1 at a constant rate of 60 Hz. Associating a time from the host computer clock to replies from the system assumes that the duration of time between raw data collection and when the reply is received by the host computer is constant. This is not necessarily the case. The frame number is returned with the command BX (page 47) or TX (page 146). • Use both the shape type and the shape parameters to represent the characterized measurement volume graphically. There may be multiple volumes with the same shape type. All volumes of the same shape type use the shape parameters the same way. The shape type and shape parameters are returned with the command SFLIST (page 129). • When checking the firmware revision, check only the combined firmware revision, not the firmware revision of the individual components. The combined firmware revision ensures that all components in a system have compatible firmware. To check the combined firmware revision, read the value of the user parameter Config.Combined Firmware Revision or use the command VER 5 (page 158). See “User Parameters” on page 20 for information on reading user parameters. • When checking for protocol compatibility, check for the API revision instead of the combined firmware revision. An application written for a particular API revision will function with any system that supports that API revision. See the command APIREV (page 44) for details. • Use an application-specific parameter file to set the user parameter values every time the system is initialized. This ensures that the settings are consistent every time, and allows you to adopt new values or incorporate new parameters without having to update the application software. See “User Parameters” on page 20 for information on setting user parameters. • Use device names to access user parameters. See “Device Names” on page 21 for instructions on how to determine the device names of the hardware devices in your system and how to access user parameters using device names. • Use GET Device.* to determine which devices are in the system configuration, instead of programming device names directly into the application. This will allow the addition or removal of devices without breaking the application. When setting or reading a user parameter value for every hardware device in the system, create a loop to repeat the action for every device name determined using GET Device.*. See “Device Names” on page 21 Polaris Application Program Interface Guide - Revision 5 15 Communicating with an NDI System for instructions on how to determine the device names of the hardware devices in your system and how to access user parameters using device names. 3.6 • Read the timeout values of the API commands from the user parameter Info.Timeout. ; do not program the timeout values directly into the application. See “User Parameters” on page 20 for information on user parameters. Note: since the timeout values are the same for every system configuration, it is not necessary to prefix the Info.Timeout user parameters with a device name unless you are communicating with an SCU that is not connected to a Position Sensor. (In this case you must use the SCU’s device name.) • Do not use the system log to record minor system events. The system log is intended for major milestones only, and may not have enough space to accommodate numerous minor entries. For minor entries, use the user parameters Param.User.String0 to Param.User.String4 as required. These parameters can be used for any purpose; the system does not make use of them. For example, an incoming inspection result might be a major milestone to be saved in the system log; a cleaning schedule might be a minor entry to be saved in a user parameter. See “User-Defined User Parameters” on page 30 for information on these user parameters. Port Handles About Port Handles The system assigns each tool, GPIO device, and strober a port handle. Port handles are two characters in hexadecimal format, 0x01 to 0xFF. Port handles can be assigned to tools only while the system is in Setup mode. Port Handle Commands The following commands are used for port handles: 16 Command Description PHSR (page 101) Returns the number of assigned port handles and the port status for each one. Assigns a port handle to a wired tool or GPIO device. PHRQ (page 99) Assigns a port handle to a tool or GPIO device. PHRQ is followed by PVWR. PVWR (page 118) Assigns a tool definition file to a tool, overrides a tool definition file in a wired tool or GPIO device, and can be used to test a tool definition file before permanently recording the tool definition file onto the SROM device of a wired tool or GPIO device. PINIT (page 104) Initializes a port handle. PHINF (page 91) Returns port handle status, and information about the tool, GPIO device, or strober associated with the port handle, including physical port location. Polaris Application Program Interface Guide - Revision 5 Communicating with an NDI System Command Description PHF (page 90) Releases system resources from an unused port handle. This is required if a tool, GPIO device, or strober is disconnected. If a tool, GPIO device, or strober is disconnected and then reconnected, the system assigns it a new port handle. The old handle is reported as disabled and should be freed using PHF. PENA (page 86) Enables reporting of transformations for a particular port handle. PDIS (page 85) Disables the reporting of transformations for a particular port handle. The order in which these commands are used is detailed in Figure 3-1 on page 18 (for wired tools) and Figure 3-2 on page 19 (for wireless tools). Disabled Transformations A transformation may be reported as DISABLED if: • the port handle was not enabled with PENA (page 86), • the port handle has been disabled with PDIS (page 85), or • a wired tool, GPIO device, or strober has been disconnected and the port handle has not been freed. Unoccupied Port Handle A port handle may be reported as UNOCCUPIED if: • the tool, GPIO device, or strober has been disconnected and port handle information is requested using PHINF (page 91), or • you have requested a port handle with PHRQ (page 99) but you have not yet used PVWR (page 118) to associate a tool definition file with the port handle. Polaris Application Program Interface Guide - Revision 5 17 Communicating with an NDI System Flow Charts for Port Handle Usage Figure 3-1 details the logic for using port handles with wired tools, GPIO devices, and strobers. Initializing and enabling a strober is optional. Get port handles that need to be freed (PHSR 01) Are there port handles to be freed? yes Free port handle (PHF) no Get port handles that need to be initialized (PHSR 02) Are there port handles to be initialized? yes Initialize handles (PINIT) yes Enable port handles (PENA) no Get port handles to be enabled (PHSR 03) Are there port handles to be enabled? no Start tracking (TSTART) Figure 3-1 Flow Chart for Port Handle Usage - Wired Tools 18 Polaris Application Program Interface Guide - Revision 5 Communicating with an NDI System Figure 3-2 details the logic for using port handles with wireless tools. Get port handles that need to be freed (PHSR 01) Are there port handles to be freed? yes Free port handle (PHF) no Request port handle (PHRQ) yes Do I need a handle for a port? no Do I need to load a tool definition file? no yes Load tool definition file (PVWR) Get port handles that need to be initialized (PHSR 02) Are there port handles to be initialized? yes Initialize handles (PINIT) yes Enable port handles (PENA) no Get port handles to be enabled (PHSR 03) Are there port handles to be enabled? no Start tracking (TSTART) Figure 3-2 Flow Chart for Port Handle Usage - Wireless Tools Polaris Application Program Interface Guide - Revision 5 19 User Parameters 4 User Parameters This chapter contains the following sections about user parameters: 4.1 • “About User Parameters” on page 20 • “User Parameter Commands” on page 21 • “Device Names” on page 21 • “Alerts User Parameters” on page 23 • “Bump Sensor User Parameters” on page 30 • “User-Defined User Parameters” on page 30 • “Complete List of User Parameters” on page 31 About User Parameters The user parameters store values for different aspects of the Polaris Vicra or Polaris Spectra System. Some user parameters store values for the full system configuration; others store values pertaining to a particular hardware device in the system. Some user parameters are read-only parameters that store useful information about the system; some user parameter values can be changed, to allow you to configure the system. User parameters fall under the following categories: • Image Capture User Parameters: These user parameters are used in conjunction with the VSNAP and VGET commands to store settings and values related to image capture. • Settings User Parameters: These user parameters store settings for each hardware device in the system. For example, the illuminator rate and the available characterized measurement volumes are stored in the settings user parameters. • Information User Parameters: These user parameters store status information for each hardware device in the system, and command timeout values. • Features User Parameters: These user parameters store information about the features of each hardware device in the system. • System Configuration User Parameters: These user parameters store information about the configuration of the system. These user parameters describe the configuration of the entire system, not a particular device. • Hardware Device Information User Parameters: These user parameters store information about which hardware devices are part of the system. For a full list of user parameters, see page 31. 20 Polaris Application Program Interface Guide - Revision 5 User Parameters 4.2 User Parameter Commands The following commands are used with the user parameters: Command Description DFLT (page 61) Restores the user parameters to factory default values. GET (page 66) Returns user parameter values. GETINFO (page 68) Returns user parameter values and descriptive information about the user parameters, including use details, possible values, and access rules. SET (page 125) Sets user parameter values. SAVE (page 122) Saves all non-volatile user parameters that have been changed. See the individual commands for more details. 4.3 Device Names Note Device names are supported in API revisions G.001.003 and later. Each hardware device in the system configuration has a unique device name. For passive systems, the Position Sensor is the only hardware device. For hybrid systems, the Position Sensor, System Control Unit, and strobers each have a device name. Each hardware device has its own set of user parameters. Each Position Sensor and System Control Unit has its own log file. Device names allow you to specify for which hardware device you wish to access the user parameters or log file. Note For information on the log files, see GETLOG (page 74) and SYSLOG (page 138). Determining the Devices in the System Configuration Use the GET command to determine which hardware devices are in your system. To ensure future compatibility if more devices are integrated into your system, your application should read the list of devices every time you connect to a system, or whenever a component is connected or disconnected. Note The list of devices does not update while the system is in tracking mode. If a strober is connected while the system is in tracking mode, the list of devices will not show the change until the system exits tracking mode. The most general method of reading the list of devices to ensure consistent behaviour in the future is as follows: Polaris Application Program Interface Guide - Revision 5 21 User Parameters Command: GET Device.* Reply: Device.Type.0=SCU Device.Instance.0=0 Device.Type.1=PS Device.Instance.1=0 Device.Type.2=STB Device.Instance.2=0 Device.Type.3=STB Device.Instance.3=1 Device.Type.4=STB Device.Instance.4=2C845 The reply gives information about every device in the system configuration. For each device, there are two parameters: • Device.Type.X describes the type of connected device. Device types are as follows: Device.Type Parameter Hardware Device • PS Position Sensor SCU System Control Unit STB Strober Device.Instance.X describes the instance of that type of device in the configuration. Parameters with the same X index value (for example, Device.Type.0 and Device.Instance.0) describe the same device. In the example above, the reply is for a hybrid Polaris Spectra System with an a System Control Unit, a Position Sensor, and two strobers. Since the System Control Unit also contains an internal strober, a total of three strobers are enumerated. Constructing Device Names User parameters for a particular device can always be accessed using the full device name. To construct the device name for a particular device, use the following syntax: - For the configuration in the example above, the device names are SCU-0, PS-0, STB-0, STB-1, and STB-2. The internal strober in the System Control Unit is always STB-0. Accessing User Parameters Using Device Names Each device has its own set of user parameters. To ensure that the user parameters for the correct device are accessed, prefix the parameter with the device name. All references to user parameters for a device can be made using the device name. To access the user parameters for a particular device, use the following syntax: - . For example, use GET PS-0.Param.Tracking.Sensitivity to check the sensitivity level for the Position Sensor. 22 Polaris Application Program Interface Guide - Revision 5 User Parameters To view information about the parameters supported by the device, use the following commands: GET PS-0.* GETINFO PS-0.+ GETINFO PS-0.* Note See the GET (page 66) and GETINFO (page 68) commands for details. The system configuration user parameters (beginning with Config) and the hardware device user parameters (beginning with Device) describe the configuration of the entire system. Do not prefix these user parameters with a device name. 4.4 Alerts User Parameters The alerts user parameters describe the status of a particular hardware device in the system. To access the user parameters for a particular device, prefix the parameter with the device name as described in “Device Names” on page 21. Alerts User Parameters Table 4-1 describes the alerts user parameters. Table 4-1 Alerts User Parameters User Parameter Info.Status. Alerts Description This user parameter describes the current state of the hardware device by reporting the alerts listed in Table 4-2 (for the Position Sensor), Table 4-3 (for the System Control Unit), or Table 4-4 (for the strobers). The bit corresponding to a particular alert is set when the system first detects the condition. This is accompanied by the system response detailed in Table 4-2, Table 4-3, or Table 4-4. The bit is cleared when the condition no longer exists. Note: the “bump detected” bit will be cleared only when you set the Param.Bump Detector.Clear Position Sensor user parameter to “1”. Info.Status. New Alerts Read this user parameter when the diagnostic pending bit is set (bit 8 in the BX or TX system status). This user parameter lists the current alerts status whenever an alert is set or cleared. The act of reading this parameter clears both this parameter and the diagnostic pending bit. The bit corresponding to a particular alert is set when the system first detects the condition, and is cleared when the system first detects that the condition has been resolved. This is accompanied by the system response detailed in Table 4-2, Table 4-3, or Table 4-4. The act of reading this user parameter clears it. Info.Status. Read this user parameter if the overflow bit is set in the user parameter Info.Status.Alerts or Alerts Overflow Info.Status.New Alerts for a particular hardware device. No bits are currently defined in this parameter. Param.Simulated Alerts Simulates the Info.Status.Alerts parameter for the hardware device specified, for testing purposes. To test the response of a particular alert, set the value of this parameter to the value of the alert (see Table 4-2, Table 4-3, or Table 4-4). Polaris Application Program Interface Guide - Revision 5 23 User Parameters Position Sensor Alerts Table 4-2 describes the Position Sensor alerts that are returned by the Info.Status.Alerts and Info.Status.New Alerts user parameters. The returned value is an integer, which you must convert to an 8-character hexadecimal number. The hexadecimal number is made up of the following individual alert values OR’d together: Table 4-2 Position Sensor Alerts Hexadecimal Alert Value System Response Position Sensor LED Indication 0x00000001 Non-recoverable parameter fault The system parameter file or some other critical file is missing or has been corrupted (CRC check failed). INIT returns ERROR15 Error LED: on Status LED: off 0x00000002 Sensor parameter fault The sensor parameters were not programmed properly, or cannot be read by the system. INIT returns ERROR15 Error LED: on Status LED: off 0x00000004 Main voltage fault The input voltage to the Position Sensor is outside of the operating range. This may be caused by a problem with the power supply. Sets diagnostic pending bit (bit 8) in TX or BX system status. Need reply option 0800 in TX or BX to return data. Power LED: off Status LED: on Error LED: on 0x00000008 Sensor voltage fault One of the voltages supplied to the sensor is outside of the operating range. This may be caused by a hardware failure. Sets diagnostic pending bit (bit 8) in TX or BX system status. Need reply option 0800 in TX or BX to return data. Error LED: on Status LED: off 0x00000010 Illuminator voltage fault The illuminator voltage is outside of operating range. This may be caused by a hardware failure. Sets diagnostic pending bit (bit 8) in TX or BX system status. Error LED: on Status LED: off 0x00000020 Illuminator current fault The illuminator current is outside of operating range. This may be caused by a hardware failure. Sets diagnostic pending bit (bit 8) in TX or BX system status. Error LED: on Status LED: off 0x00000040 Left sensor temperature fault The left sensor temperature sensor is outside of functional range. INIT returns ERROR15 Sets diagnostic pending bit (bit 8) in TX or BX system status. The system will not return tracking data, even if reply option 0800 in TX/BX is used. Error LED: on Status LED: off (API revision G.001.003 and earlier: INIT is possible; system returns data in TX and BX if 0800 option is used.) 24 Polaris Application Program Interface Guide - Revision 5 User Parameters Table 4-2 Position Sensor Alerts (Continued) Hexadecimal Alert Value 0x00000080 Right sensor temperature fault The right sensor temperature sensor is outside of functional range. System Response INIT returns ERROR15 Sets diagnostic pending bit (bit 8) in TX or BX system status. The system will not return tracking data, even if reply option 0800 in TX/BX is used. Position Sensor LED Indication Error LED: on Status LED: off (API revision G.001.003 and earlier: INIT is possible; system returns data in TX and BX if 0800 option is used.) 0x00000100 Main temperature fault The main board temperature sensor is outside of functional range. INIT returns ERROR15 Sets diagnostic pending bit (bit 8) in TX or BX system status. The system will not return tracking data, even if reply option 0800 in TX/BX is used. Error LED: on Status LED: off (API revision G.001.003 and earlier: INIT is possible; system returns data in TX and BX if 0800 option is used.) 0x00000200 to 0x00080000 Reserved 0x00100000 System battery fault The system battery power is too low. This may be caused by a worn-out battery, or the battery may not be connected. This battery powers the bump sensor and the system clock. Sets diagnostic pending bit (bit 8) in TX or BX system status. Need reply option 0800 in TX or BX to return data. Status LED: on Error LED: flashing 0x00200000 Bump detected The bump sensor has detected a bump. Sets diagnostic pending bit (bit 8) in TX or BX system status. Need reply option 0800 in TX or BX to return data. Status LED: on Error LED: flashing 0x00400000 Reserved 0x00800000 Firmware incompatible The combination of firmware on the Position Sensor is not compatible. This may be caused by a failed attempt to update the firmware. INIT returns ERROR2E Status LED: on Error LED: on Polaris Application Program Interface Guide - Revision 5 (API revision G.001.003 and earlier: status LED is on; error LED is flashing.) 25 User Parameters Table 4-2 Position Sensor Alerts (Continued) Hexadecimal Alert Value System Response 0x01000000 Recoverable parameter fault The user parameter file has been corrupted (CRC check failed) or is missing. To correct this problem, check that the settings of the user parameters are set correctly, and save them (use SAVE (page 122)). INIT returns ERROR15 Internal flash memory is full The system cannot store any additional data to the file system. The flash memory can only be cleared by NDI. Sets diagnostic pending bit (bit 8) in TX or BX system status. Positioning Laser battery fault The laser battery power is too low. This may be caused by a worn-out battery, or the battery may not be connected. Sets diagnostic pending bit (bit 8) in TX or BX system status. 0x02000000 0x04000000 Position Sensor LED Indication Status LED: on Error LED: on (API revision G.001.003 and earlier: status LED is on; error LED is flashing.) Status LED: on Error LED: off (API revision G.001.003 and earlier: status LED is on; error LED is flashing.) Status LED: on Error LED: off (API revision G.001.003 and earlier: status LED is off; error LED is flashing.) 0x08000000 and 0x10000000 Reserved 0x20000000 Temperature characterized high The Position Sensor temperature is above the optimal operating range (see the user guide for details). Sets temperature bit (bit 9) in TX or BX system status. Need reply option 0800 in TX or BX to return data. Status LED: on 0x40000000 Temperature characterized low The Position Sensor temperature is below the optimal operating range (see the user guide for details). Sets temperature bit (bit 9) in TX or BX system status. Need reply option 0800 in TX or BX to return data. Power LED: flashes during warm-up when system is first powered on. Status LED: on 0x80000000 Overflow. Read the value of the user parameter Info.Status.Alerts Overflow. Status LED: on Note Some of the alerts indicated in Table 4-2 result in the system not returning data unless reply option 0x0800 is used with the BX or TX command. In API revision G.001.003 and earlier, the system resumed returning data once the Info.Status.New Alerts parameter was read, regardless of whether the alert was not resolved. In API revision G.001.004 and later, the system will not return data in these cases until the alert is resolved. 26 Polaris Application Program Interface Guide - Revision 5 User Parameters System Control Unit Alerts Table 4-3 describes the SCU alerts that are returned by the Info.Status.Alerts and Info.Status.New Alerts user parameters. The returned value is an integer, which you must convert to an 8-character hexadecimal number. The hexadecimal number is made up of the following individual alert values OR’d together: Table 4-3 System Control Unit Alerts Hexadecimal Alert Value System Response 0x00000001 Non-recoverable parameter fault The system parameter file or some other critical file is missing or has been corrupted (CRC check failed). INIT returns ERROR15 Position Sensor current fault The Position Sensor current is outside of the expected range. This may be caused by a problem with the Position Sensor, SCU, or cables. Sets diagnostic pending bit (bit Status LED: on 8) in TX or BX system status. Error LED: on Position Sensor communication fault The SCU can detect the Position Sensor, but cannot communicate with it. This may be caused by a problem with the Position Sensor or cable. Sets diagnostic pending bit (bit Status LED: on 8) in TX or BX system status. Error LED: on 0x00000002 0x00000004 SCU LED Indication Error LED: on Status LED: off Rear LED: amber Rear LED: amber Rear LED: amber 0x00000008 Reserved 0x00000010 Internal strober communication fault The SCU can detect the internal strober, but cannot communicate with it. Sets diagnostic pending bit (bit Error LED: on 8) in TX or BX system status. Status LED: off Strober communication fault The SCU can detect the strober connected to the SCU, but cannot communicate with it. Sets diagnostic pending bit (bit Status LED: on 8) in TX or BX system status. Error LED: on Strober communication fault The SCU can detect the second connected strober, but cannot communicate with it. Sets diagnostic pending bit (bit Status LED: on 8) in TX or BX system status. Error LED: on 0x00000020 0x00000040 0x00000080 to 0x00080000 Reserved 0x00100000 Too many strobers Too many strobers are connected to the system. Rear LED: amber Rear LED: amber Rear LED: amber Sets diagnostic pending bit (bit Status LED: on 8) in TX or BX system status. Error LED: off Rear LED: green Polaris Application Program Interface Guide - Revision 5 27 User Parameters Table 4-3 System Control Unit Alerts (Continued) Hexadecimal Alert Value 0x00200000 System Response No strober connected to strober cable The SCU can detect a strober cable with no strober connected. SCU LED Indication Sets diagnostic pending bit (bit Status LED: on 8) in TX or BX system status. Error LED: off Rear LED: green 0x00400000 0x00800000 0x01000000 0x02000000 0x04000000 28 System firmware incompatible Not all components in the system have compatible firmware. To correct this, update the firmware, or load a different firmware revision (if the Multi Firmware feature is installed). INIT returns ERROR2E Firmware incompatible The combination of firmware on the SCU is not compatible. This may be caused by a failed attempt to update the firmware. INIT returns ERROR2E Recoverable parameter fault The user parameter file has been corrupted (CRC check failed) or is missing. To correct this problem, check that the settings of the user parameters are set correctly, and save them (use SAVE (page 122)). INIT returns ERROR15 Internal flash memory is full The system cannot store any additional data to the file system. The flash memory can only be cleared by NDI. Sets diagnostic pending bit (bit Status LED: on 8) in TX or BX system status. Error LED: off External sync frequency out-of-range The system will have aliased the outof-range external sync frequency in order to continue to operate. Sets diagnostic pending bit (bit Status LED: on 8) in TX or BX system status. Error LED: off 0x08000000 to 0x40000000 Reserved 0x80000000 Overflow. Read the value of the user parameter Info.Status.Alerts Overflow. Status LED: on Error LED: on Rear LED: amber Status LED: on Error LED: on Rear LED: amber Status LED: on Error LED: on Rear LED: amber Rear LED: green Rear LED: green Status LED: on Rear LED: green Polaris Application Program Interface Guide - Revision 5 User Parameters Strober Alerts Table 4-4 describes the strober alerts that are returned by the Info.Status.Alerts and Info.Status.New Alerts user parameters. The returned value is an integer, which you must convert to an 8-character hexadecimal number. The hexadecimal number is made up of the following individual alert values OR’d together: Table 4-4 Strober Alerts Hexadecimal Value Strober LED Indication Alert System Response 0x00000001 Non-recoverable parameter fault The system parameter data or some other critical data is missing or has been corrupted (CRC check failed). Sets diagnostic pending bit (bit 8) in TX or BX system status. Status LED: off Error LED: on 0x00000002 Marker current fault The marker current is above the limit when no markers are activated. This is a strober hardware fault. Sets diagnostic pending bit (bit 8) in TX or BX system status. Status LED: off Error LED: on 0x00000004 Input voltage fault. The input voltage to the strober is outside of the expected range. This may be caused by a problem with the strober, SCU, or cables. Sets diagnostic pending bit (bit 8) in TX or BX system status. Status LED: off Error LED: on 0x00000008 Sets diagnostic pending bit Internal voltage 1 fault (bit 8) in TX or BX system The internal voltage 1 is outside of the status. expected range. This may be caused by a problem with the strober, SCU, or cables. Status LED: off Error LED: on 0x00000010 Sets diagnostic pending bit Internal voltage 2 fault (bit 8) in TX or BX system The internal voltage 2 is outside of the expected range. This may be caused by a status. problem with the strober, SCU, or cables. Status LED: off Error LED: on 0x00000020 to 0x00400000 Reserved 0x00800000 Firmware incompatible The combination of firmware on the strober is not compatible. This may be caused by a failed attempt to update the firmware. Sets diagnostic pending bit (bit 8) in TX or BX system status. Status LED: on Error LED: on 0x01000000 Recoverable parameter fault The user parameter data has been corrupted or is missing. To correct this problem, check that the settings of the user parameters are set correctly. Sets diagnostic pending bit (bit 8) in TX or BX system status. Status LED: on Error LED: on 0x02000000 to 0x80000000 Reserved Polaris Application Program Interface Guide - Revision 5 29 User Parameters 4.5 Bump Sensor User Parameters Table 4-5 lists the user parameters that relate to the bump sensor. For details on the bump sensor, see the user guide that accompanied your system. Table 4-5 Bump Sensor User Parameters User Parameter Description Info.Status.Bump Detected This user parameter indicates when the system has detected a bump. The system sets this user parameter to “1” upon detecting a bump. The system resets this user parameter to “0” once you have set the Param.Bump Detector.Clear user parameter to “1”. Param.Bump Detector.Clear Set this user parameter to clear all bumps detected up to that point. This clears the “bump detected” bit in the Info.Status.Alerts user parameter, and sets the Info.Status.Bump Detected user parameter and the Param.Bump Detector.Bumped user parameter to “0”. Values: “1” clears all detected bumps. The system will automatically reset this user parameter to “0”. Param.Bump Detector.Bumped This user parameter indicates when the system has detected a bump. The system sets this user parameter to “1” upon detecting a bump. The system resets this user parameter to “0” once you have set the Param.Bump Detector.Clear user parameter to “1.” Param.Bump Detector. Bump Detection 4.6 This user parameter enables the bump detector. Values: “1” bump detector enabled (default). “0” bump detector disabled. User-Defined User Parameters There are five user parameters, Param.User.String0 to Param.User.String4, that can be used to store user-defined information. For example, these parameters could be used to keep track of the system maintenance or cleaning schedule. These parameters can be used for any purpose; the system does not make use of them. The user-defined user parameters are associated with a particular hardware device in the system. To access the user parameters for a particular device, prefix the parameter with the device name as described in “Device Names” on page 21. 30 Polaris Application Program Interface Guide - Revision 5 User Parameters 4.7 Complete List of User Parameters The following tables list the user parameters for the Polaris Vicra and Polaris Spectra Systems. If you have upgraded the firmware in your system, you may have access to additional user parameters. To view a complete list of user parameters for your system, use the command GET * (for parameter names and values) or GETINFO * (for parameter names, values, and usage details). Image Capture User Parameters The following user parameters are used in conjunction with the VSNAP and VGET commands. See VSNAP (page 165) and VGET (page 160) for details. These user parameters apply only to the Position Sensor. To access these user parameters, prefix the user parameter name with the device name of the Position Sensor. Table 4-6 Image Capture User Parameters User Parameter Name Description Cmd.VSnap.Illuminated Frame Forces the collection of a frame with illuminators on. Read, write API revision G.001.004 and later: can only be set in Setup mode. API revision G.001.003 and earlier: takes effect on next DSTART or TSTART. Cmd.VSnap.Background Frame Forces the collection of a background frame with illuminators off. API revision G.001.004 and later: can only be set in Setup mode. API revision G.001.003 and earlier: takes effect on next DSTART or TSTART. Read, write Cmd.VSnap.Manual Shutter Exposure time for illuminated and background frames [usec] Read, write Cmd.VSnap.Frame Types Enumeration of tool classes reported in a frame sequence Read Cmd.VGet.Threshold.Shutter Time Exposure time for threshold calculations [usec] Read, write Cmd.VGet.Threshold.Trigger Spot detection trigger threshold [% full scale] Read Cmd.VGet.Threshold.Background Background suppression threshold [% full scale] Read Cmd.VGet.Sensor.Color Depth Number of bits per pixel on the video sensor Read Cmd.VGet.Sensor.Width Number of horizontal pixels on the video sensor Read Cmd.VGet.Sensor.Height Number of vertical pixels on the video sensor Read Cmd.VGet.Start X Image capture start column Read, write Cmd.VGet.End X Image capture end column Read, write Cmd.VGet.Color Depth Image capture returned bits per pixel Read, write Cmd.VGet.Stride Image capture horizontal pixel step Read, write Cmd.VGet.Sample Option Image capture sample option for the stride; see VGET (page 160) for details. Read, write Cmd.VGet.Compression Image capture returned data compression Read, write Polaris Application Program Interface Guide - Revision 5 Access Rules 31 User Parameters Settings User Parameters The following user parameters store settings for the hardware devices indicated in the Hardware Device column. To access the user parameters for a particular device, prefix the user parameter name with the device name (see “Device Names” on page 21 for details). Table 4-7 System Settings User Parameters 32 User Parameter Name Description Access Rules Hardware Device Param.Laser.Laser Status Starts/stops firing the positioning laser. Use this parameter when the Positioning Laser keyed feature is enabled. See “Positioning Laser” on page 174 for details. The laser will turn off automatically after 60 s. Read, write Position Sensor Param.User.String0 User-defined string (up to 63 chars) Read, write, save Position Sensor, SCU Param.User.String1 User-defined string (up to 63 chars) Read, write, save Position Sensor, SCU Param.User.String2 User-defined string (up to 63 chars) Read, write, save Position Sensor, SCU Param.User.String3 User-defined string (up to 63 chars) Read, write, save Position Sensor, SCU Param.User.String4 User-defined string (up to 63 chars) Read, write, save Position Sensor, SCU Param.Firmware. Current Version Current firmware revision number Read Position Sensor, SCU Param.Tracking. Available Volumes Available characterized measurement volumes Read Position Sensor Param.Tracking. Selected Volume Selects a characterized measurement volume. Can only be set in Setup mode. Read, write Position Sensor Param.Tracking.Sensitivity Background IR sensitivity level (1highest, 7-lowest) Read, write, save Position Sensor Param.Tracking.Illuminator Rate Illuminator activation frequency [Hz] Can only be set in Setup mode. Read, write Position Sensor Param.Default Wavelength. Return Warning Enables/disables returning a warning on PINIT if the default wavelength was selected for the tool corresponding to the port handle. Read, write Position Sensor Param.Bump Detector. Bump Detection Enables the bump sensor. Read, write, save Position Sensor Param.Bump Detector.Clear Set to 'Clear' (1) to acknowledge reported bumps. Read, write Position Sensor Param.Bump Detector.Bumped Indicates if the system has detected a bump. Read Position Sensor Polaris Application Program Interface Guide - Revision 5 User Parameters Table 4-7 System Settings User Parameters Param.System Beeper Enables/disables the beeper sequence on system reset. Read, write, save Position Sensor, SCU Param.Watch Dog Timer If non-zero, the Position Sensor beeps if no host communication occurs after this amount of time (sec). Read, write Param.Simulated Alerts Simulates the 'Info.Status.Alerts' parameter, for testing purposes. Read, write, save Position Sensor, (read/write only SCU, strobers on strobers) Param.Host Connection Communication port being used for this connection Read Position Sensor, SCU Param.Serial Port Hardware configuration of the serial port. Read SCU Param.Strober Name User-defined strober name (up to 31 chars). Read, write (saves on write) Strobers Param.System Ext Sync Mode Enables/disables the external sync mode (see the user guide for details). Read, write SCU Position Sensor Information User Parameters The following user parameters store status information for the hardware devices indicated in the Hardware Device column, and command timeout values. To access the user parameters for a particular device, prefix the user parameter name with the device name (see “Device Names” on page 21 for details). Table 4-8 Information User Parameters Access Rules Hardware Device Timeout for the specified command (sec). For the SCU, only the following commands have timeout values: APIREV, COMM, DFLT, ECHO, GET, GETINFO, GETIO, GETLOG, INIT, SETIO, SYSLOG, RESET, SAVE, SET,VER. Read Position Sensor, SCU Info.Status.System Mode System operating mode Read Position Sensor Info.Status.Alerts System hardware and operating status flags; see “Alerts User Parameters” on page 23 for details. Read Position Sensor, SCU, strobers Info.Status.New Alerts System hardware and operating status flags; see “Alerts User Parameters” on page 23 for details. Read Position Sensor, SCU, strobers Info.Status.Alerts Overflow System hardware and operating status flags over- Read flow; see “Alerts User Parameters” on page 23 for details. Position Sensor, SCU Info.Status.Bump Detected Indicates if the system has detected a bump. Read Position Sensor Info.Status.New Log Entry Indicates a new system log entry has been made; set to 'False' (0) to clear. Read, write Position Sensor, SCU User Parameter Name Description Info.Timeout. Polaris Application Program Interface Guide - Revision 5 33 User Parameters Features User Parameters The following user parameters store information about the features for the hardware devices indicated in the Hardware Device column. To access the user parameters for a particular device, prefix the user parameter name with the device name (see “Device Names” on page 21 for details). Table 4-9 Features User Parameters 34 Hardware Device User Parameter Name Description Access Rules Features.Keys.Installed Keys.0 'Value' is the name of the installed feature. Read Position Sensor, SCU Features.Keys.Disabled Keys List of disabled keyed features; change takes effect on next reset. See page 171 for details. Read, write, save Position Sensor, SCU Features.Tools.Enabled Tools Maximum number of tools that can be enabled simultaneously Read Position Sensor Features.Tools.Active Ports Maximum number of wired active tools that can be enabled simultaneously Read Position Sensor Features.Tools.Passive Ports Maximum number of passive tools that can be enabled simultaneously Read Position Sensor Features.Tools.Wireless Ports Maximum number wireless active tools Read that can be enabled simultaneously Position Sensor Features.Firmware.Version Current firmware revision number Read Position Sensor, SCU, strobers Features.Firmware. Major Version Current firmware major revision number Read Position Sensor, SCU Features.Firmware. Minor Version Current firmware minor revision number Read Position Sensor, SCU Features.Firmware. Build Number Current firmware build revision number Read Position Sensor, SCU Features.Firmware.Available Versions List of firmware revisions loaded in the device Read Position Sensor, SCU Features.Firmware. Maximum Versions Number of firmware revisions that may Read be stored in the device simultaneously Position Sensor, SCU Features.Firmware. Configuration Check System configuration checksum (for NDI use only) Read Position Sensor, SCU Features.Firmware.Package Number Current firmware package number Read Position Sensor, SCU Features.Hardware. Serial Number Hardware device serial number Read Position Sensor, SCU, strobers Features.Hardware. OEM Number Hardware device customer number Read Position Sensor, SCU, strobers Features.Hardware.Model Hardware device model name Read Position Sensor, SCU, strobers Polaris Application Program Interface Guide - Revision 5 User Parameters Table 4-9 Features User Parameters (Continued) Features.Firmware. Safeloader Version Current safeloader firmware revision number. Read Position Sensor, SCU Features.Firmware. Available Combined Firmware Revisions List of combined firmware revisions loaded in the device. Read Position Sensor, SCU Read Position Sensor, SCU Features.Firmware. Current combined firmware revision of Combined Firmware Revision the device. System Configuration User Parameters The following user parameters store information about the configuration of the system. These user parameters describe the configuration of the entire system, not a particular device. Do not prefix these user parameters with a device name. Table 4-10 System Configuration User Parameters User Parameter Name Description Access Rules Config.Multi Firmware. Load Combined Firmware Revision Combined firmware revision to load on next reset (selection automatically saves when set). Use this parameter when the Multi Firmware keyed feature is enabled. See “Multi Firmware Feature” on page 172 for details. Read, write Config.Multi Firmware. Update Combined Firmware Revision Combined firmware revision to replace on next upgrade Read, write, save or downgrade. Use this parameter when the Multi Firmware keyed feature is enabled. See “Multi Firmware Feature” on page 172 for details. Config.Password Enter the password to enable the ability to change and save the system configuration. Use this parameter when the Password Protect keyed feature is enabled. See “Password Protect Feature” on page 174 for details. Read, write Config.Multi Firmware. Available Combined Firmware Revisions List of combined firmware revisions loaded in the system. Read Config.Combined Firmware Revision Current combined firmware revision of the system. Read Polaris Application Program Interface Guide - Revision 5 35 User Parameters Hardware Device Information User Parameters The following user parameters store information about the hardware devices in the system. Do not prefix these user parameters with a device name. See “Device Names” on page 21 for information on how to use the hardware device user parameters. Table 4-11 Hardware Device User Parameters 36 User Parameter Name Description Access Rules Device.Type.0 Type of device in the system configuration Read Device.Instance.0 Instance of this type of device in the system configuration Read Polaris Application Program Interface Guide - Revision 5 Resetting the System with a Serial Break 5 Commands Before sending any commands to the system, read the user guide that accompanied your system to ensure that you have a full understanding of the system functionality. The user guide is available on the NDI Support Site at http://support.ndigital.com. Resetting the System with a Serial Break Resets the system. Operating Mode All modes Compatibility All systems Syntax The method depends on the host computer. Reply RESET Usage Notes 1. The serial break is a special condition, and is specific to the host computer operating system. Refer to your computer manuals to determine how to generate a serial break. 2. The serial break is a good recovery method in the following situations: • System warm boot: the system is powered up, but you don’t know the communication setup, or which mode the system is in. • Synchronization error: while in the Tracking mode, the BX or TX reply status returns that synchronization errors have occurred. • Loss of communication: the host computer and the system can no longer communicate. 3. After a serial break: • All processors receive a soft reset. Use RESET 1 to perform a hard reset. • The system serial communication settings return to the default values: 9600 baud, 8 data bits, no parity, 1 stop bit, and no hardware handshaking. • Upon initialization, the SCU emits one beep, and the Position Sensor emits a distinctive 2beep sequence. To disable the beep, use the command SET (page 125) to set the value of the user parameter Param.System Beeper to “0”, then use the command SAVE (page 122). For more information on user parameters, see “User Parameters” on page 20. Polaris Application Program Interface Guide - Revision 5 37 Commands Compatibility Notes 1. A serial break will reset the system if it is physically connected to the host computer. For systems that use a wireless connection, use RESET (page 120) to reset the system. 2. After a serial break, all processors receive a soft reset. Use RESET 1 to perform a hard reset. 3. If only an SCU is present, the reply string will be SCUONLYC3E3. Example Command: N/A Reply: RESETBE6F 38 Polaris Application Program Interface Guide - Revision 5 3D 3D Returns the latest three-dimensional marker position of a single marker or multiple markers. Operating Mode Diagnostic, Tracking) Compatibility All systems Prerequisite Command IRED (page 81), only for active markers in Diagnostic mode Syntax 3D Parameter Description Port Handle 2 hexadecimal characters. Specifies for which type of marker the system will report data (see “Usage Notes” on page 43 for details). The specified port handle must be initialized (PINIT) and enabled (PENA). Reply Option Specifies which information will be returned. The reply options cannot be OR’d. Valid Values: 1 Single marker 3D data, with error value 2 Single marker 3D data, with error value and out-of-volume information 3 Single marker 3D data, with line separation value 4 Single marker 3D data, with line separation value and out-of-volume information 5 3D data for up to 50 markers, with line separation and out-of-volume information Replies Upon Success: On Error: ERROR See page 167 for error code definitions. Polaris Application Program Interface Guide - Revision 5 39 Commands Reply Component Description Number of Visible Markers 3 characters (a sign and 2 decimal digits) The number of markers detected by the system. For reply options 1 to 4, only one marker can be in view. If more than one marker is in view, the system will return 00 for the number of markers. Reply Option n Data The data specific to the requested reply option. See the reply option information below for details: Reply option 1 (3D data for a single marker, with error value) Reply option 2 (3D data for a single marker, with error value and out-of-volume information) Reply option 3 (3D data for a single marker, with line separation value) Reply option 4 (3D data for a single marker, with line separation value and out-of-volume information) Reply option 5 (3D data for up to 50 markers, with line separation and out-of-volume information) Reply Option 1 - 3D data for a single marker, with error value = Reply Component Description Tx, Ty, Tz 9 characters each (a sign, and 8 decimal digits with an implied decimal in the position XXXX . XXXX) Position of the marker, in the coordinate system of the Position Sensor. Error Value 4 characters (a sign, and 3 decimal digits with an implied decimal in the position X . XX) The normalized error number associated with the calculation for this marker position. Note: The Polaris Vicra and Polaris Spectra Systems will not calculate an error, and will return +000 instead. Possible Values: +000 (best case) to +100 (worst case) 40 Polaris Application Program Interface Guide - Revision 5 3D Reply Option 2 - 3D data for a single marker, with error value and out-of-volume information = Reply Component Description Tx, Ty, Tz 9 characters each (a sign, and 8 decimal digits with an implied decimal in the position XXXX . XXXX) Position of the marker, in the coordinate system of the Position Sensor. Error Value 4 characters (a sign, and 3 decimal digits with an implied decimal in the position X . XX) The normalized error number associated with the calculation for this marker position. Note: The Polaris Vicra and Polaris Spectra Systems will not calculate an error, and will return +000 instead. Possible Values: +000 (best case) to +100 (worst case) Out of Volume 1 hexadecimal character Indicates whether the marker is outside the characterized measurement volume. Possible Values: 0 The marker is inside the characterized measurement volume. 1 The marker is out of volume. Reply Option 3 - 3D data for a single marker, with line separation value = Reply Component Description Tx, Ty, Tz 9 characters each (a sign, and 8 decimal digits with an implied decimal in the position XXXX . XXXX) Position of the marker, in the coordinate system of the Position Sensor. Line Separation 4 characters (a sign, and 3 decimal digits with an implied decimal in the position X . XX) The minimum distance (in mm) between the two lines of sight calculated from the marker image on the left and right sensor to the IR source. Possible Values: +000 (best case) to +999 (worst case) Polaris Application Program Interface Guide - Revision 5 41 Commands Reply Option 4 - 3D data for a single marker, with line separation value and out-of-volume information = Reply Component Description Tx, Ty, Tz 9 characters each (a sign, and 8 decimal digits with an implied decimal in the position XXXX . XXXX) Position of the marker, in the coordinate system of the Position Sensor. Line Separation 4 characters (a sign, and 3 decimal digits with an implied decimal in the position X . XX) The minimum distance (in mm) between the two lines of sight calculated from the marker image on the left and right sensor to the IR source. Possible Values: +000 (best case) to +999 (worst case) Out of Volume 1 hexadecimal character Indicates whether the marker is outside the characterized measurement volume. Possible Values: 0 The marker is inside the characterized measurement volume. 1 The marker is out of volume. Reply Option 5 - 3D data for up to 50 markers, with line separation value and out-of-volume information = ... Reply Component Description Txn, Tyn, Tzn 9 characters each (a sign, and 8 decimal digits with an implied decimal in the position XXXX . XXXX) Position of the nth marker, in the coordinate system of the Position Sensor. The system will report up to 50 3D positions, including phantom markers. If the system detects more than 50 IR sources, it will only report the first 50. The IR sources are not reported in any particular order. Line Separation n 4 characters (a sign, and 3 decimal digits with an implied decimal in the position X . XX) Line separation of the nth marker. The minimum distance (in mm) between the two lines of sight calculated from the marker image on the left and right sensor to the IR source. Possible Values: +000 (best case) to +999 (worst case) 42 Polaris Application Program Interface Guide - Revision 5 3D Reply Component Description Out of Volume n 1 hexadecimal character Indicates whether the nth marker is outside the characterized measurement volume. Possible Values: 0 The marker is inside the characterized measurement volume. 1 The marker is out of volume. Usage Notes 1. The specified port handle must be initialized using PINIT (page 104) and enabled using PENA (page 86). 2. You may need to use the 3D command about ten times if it is sent immediately after using IRED (page 81). This allows time for the system to implement the activation signature and optimize the signal by adjusting the range control. 3. Reply Options 1 to 4: You cannot have more than one marker in view. Any other IR sources in view will prevent the system from returning marker data. 4. Reply Option 5: The system does not distinguish between real markers, phantom markers, or other IR sources. You must determine whether the reported marker positions are valid. See the user guide for more information on phantom markers. 5. The 3D command returns data regardless of the bump status, temperature status, and other system status conditions. Before trusting the marker positions returned by the 3D command, you should check these conditions by reading the Info.Status.Alerts user parameter. (Use the GET (page 66) command to check the value of user parameters.) You can use the BX (page 47) or TX (page 146) command to request 3D data that is filtered when the bump status, temperature status, or other system conditions are not ideal. Compatibility Notes Reply Option 1 and Reply Option 2: The system will not calculate an error, and will return an error value of +000. Example Command: 3D 011 Reply: +01-12345678+12345678-12345678+0954B7B In this case, one marker is in view. Polaris Application Program Interface Guide - Revision 5 43 Commands APIREV Returns the API revision number that functions with your system. Operating Mode All modes Compatibility All systems Syntax APIREV Replies Upon Success: . . On Error: ERROR See page 167 for error code definitions. Reply Component Description Family 1 ASCII character. This character is always G.. (Other types of NDI measurement systems use other characters.) Major revision number 3 ASCII characters The major revision number is incremented whenever there is an incompatible change in the API. (Whenever a command is deprecated or when its response is changed in a way that may break an application.) Minor revision 3 ASCII characters number The minor number is incremented whenever there is an addition to the API that is compatible with all existing applications and usage. (Compatible changes are additions to the API command or option set that will not affect any existing applications.) Compatibility Notes The APIREV command is compatible with the Polaris Vicra System and the Polaris Spectra System. Example Command: APIREV Reply: G.001.004A0C0 44 Polaris Application Program Interface Guide - Revision 5 BEEP BEEP Sounds the system beeper. Operating Mode All modes Compatibility All systems Syntax BEEP Parameter Description Number of Beeps Valid Values: 1 to 9 Replies Upon Success: On Error: ERROR G.001.004 G.001.005 Beep Status G.001.003 Reply Component Description G.001.002 See page 167 for error code definitions. X X X X Possible Values: 0 The system is busy beeping. 1 Beeping has started. Usage Notes 1. The beep duration is shorter than the beep used for reset and fatal error conditions. 2. Disabling the system beeper (by setting the value of the user parameter Param.System Beeper) does not affect the BEEP command. Compatibility Notes The system will never return a beep status of 0. If you send the BEEP command while the system is busy beeping, the system will return a beep status of 1, but will not initiate the second sequence of beeps. Polaris Application Program Interface Guide - Revision 5 45 Commands Example Command: BEEP 1 Reply: 1D4C1 46 Polaris Application Program Interface Guide - Revision 5 BX BX Returns the latest tool transformations, individual marker positions, and system status in binary format. Operating Mode Tracking Compatibility All systems Syntax G.001.002 G.001.003 G.001.004 G.001.005 BX 0001 Transformation data (default) X X X X 0002 Tool and marker information X X X X X X Parameter Description Reply Option Optional. Specifies which information will be returned. If no reply option is specified, the system returns information for reply option 0001. The reply options are hexadecimal numbers that can be OR’d. If multiple reply options are used, the replies are returned for each port handle in order of increasing option value, with the following exceptions: Reply option 0800 is not reported separately from the other options; it simply enables the system to return certain information in the other options. Reply option 1000 is reported after all handle-specific options but before the and . Valid Values: 0004 3D position of a single stray active marker 0008 3D positions of markers on tools X X X X 0800 Transformations not normally reported X X X X 1000 3D positions of stray passive markers X X X X Replies Upon Success: <01(Number of Handles)> ... ... ... Polaris Application Program Interface Guide - Revision 5 47 Commands Note The reply for the BX command is binary data. Note If a handle status is “disabled,” the system will not return any of ... for that port handle. On Error: ERROR G.001.005 2 bytes: A5C4 G.001.004 Start Sequence G.001.003 Reply Component Description G.001.002 See page 167 for error code definitions. X X X X X X X X X X X X X X X X X X X X Indicates the start of the BX reply. Reply Length 2 bytes Indicates the number of bytes in the reply body between the and the , exclusive. Header CRC 2 bytes CRC16 of and Number of Handles 1 byte The number of port handles for which information is returned. Handle n 1 byte The port handle whose information follows. Handle Status 1 byte Possible Values: 48 01 Valid X X X X 02 Missing X X X X 04 Disabled X X X X Polaris Application Program Interface Guide - Revision 5 G.001.002 G.001.003 G.001.004 G.001.005 BX Reply option 0001 (transformation data) (default) X X X X Reply option 0002 (tool and marker information) X X X X X X Reply Component Description Reply Option m Data The data specific to the requested reply option. See the reply option information below for details: Reply option 0004 (latest 3D position of single, stray, active marker) System Status Reply option 0008 (3D position of markers on tools) X X X X Reply option 0800 (reporting all transformations) X X X X Reply option 1000 (3D position of stray passive markers) X X X X X X X X X X X X 2 bytes The status of the system. Bit field: bit 0 System communication synchronization error bits 1 and 2 Reserved bit 3 Recoverable system processing exception. bits 4 and 5 Reserved bit 6 Some port handle has become occupied X X bit 7 Some port handle has become unoccupied X X bit 8 Diagnostic pending X X X X bit 9 Temperature (system is not within operating temperature range) X X X X bits 10 to 15 Reserved Note The “diagnostic pending” bit is set whenever an alert is detected or cleared. To view the alerts status and clear the diagnositc pending bit, use GET (page 66) to check the Info.Status.New Alerts user parameter for every hardware device in the system. See “Usage Notes” on page 56 for more details. (For API revision G.001.003 and earlier, the diagnositc pending bit did not indicate when an alert was cleared.) Polaris Application Program Interface Guide - Revision 5 49 Commands Reply Option 0001 - Transformation Data G.001.005 Q0, Qx, Qy, Qz 4 bytes each G.001.004 Description G.001.003 Reply Component G.001.002 = or = X X X X X X X X X X X X Rotational components of the transformation, quaternion, unitless, reported as IEEE 32-bit, single precision, floating point numbers. The value for Q0 is always non-negative. Tx, Ty, Tz 4 bytes each Translational components of the transformation, in mm, reported as IEEE 32-bit, single precision, floating point numbers. Error 4 bytes The error is an RMS value, given in mm. It is the result of the least squares minimization between the marker geometry in the tool definition file and the data from the tool’s markers measured by the system. Reported as IEEE 32-bit, single precision, floating point number. 50 Polaris Application Program Interface Guide - Revision 5 4 bytes G.001.005 Port Status G.001.004 Description G.001.003 Reply Component G.001.002 BX X X X X Bit field: bit 0 Occupied bit 1 Switch 1 closed/GPIO line 1 active X X bit 2 Switch 2 closed/GPIO line 2 active X X bit 3 Switch 3 closed/GPIO line 3 active X X bits 4 Initialized X X X X bit 5 Enabled X X X X bit 6 Out of volume X X X X bit 7 Partially out of volume X X X X bit 8 Algorithm limitation (processing requires more buffer than is available) X X X X bit 9 IR interference (a large bright IR object) X X X X X X X X bits 10 and 11 Reserved Frame Number bit 12 Processing exception (same as tool information bit 7 in reply option 0002) bit 13 Reserved bit 14 Fell behind while processing (same as tool information bit 3 in reply option 0002) X X X X bit 15 Data buffer limitation (too much data; for example, too many markers) X X X X bits 16 to 31 Reserved X X X X 4 byte unsigned number The frame number is an internal counter related to data acquisition. The counter starts at power up and does not reset until the system is reset (either with RESET or a serial break), the system is powered up again, or reply option 80 is sent with the TSTART command. The frame rate is 60 Hz. The frame number corresponds to the frame in which the raw data, used to calculate the accompanying transformation, was collected. Note If the handle status is “missing,” the system returns only the port status and the frame number. - Tools are reported as missing if a transformation cannot be determined. - GPIO devices and strober port handles that are initialized and enabled are reported as missing. - In the event of a system error that prevents tracking, all tools and GPIO devices are reported as missing. Polaris Application Program Interface Guide - Revision 5 51 Commands Reply Option 0002 - Tool and Marker Information G.001.002 G.001.003 G.001.004 G.001.005 = bit 0 Bad transformation fit X X X X bit 1 Not enough acceptable markers for transformation X X X X bit 2 IR interference—environmental IR is interfering with the system (combination of port status bits 9 and 15 in reply option 0001) X X X X bit 3 Fell behind while processing (same as port status bit 14 in reply option 0001) X X X X bits 4 to 6 Tool face used X X X X bit 7 Processing exception (same as port status bit 12 in reply option 0001) X X X X Reply Component Description Tool Information 1 byte Bit field: Marker Information 10 bytes (4 bits per marker) See below for an example. Possible Values: 0000 Not used because it was missing X X X X 0001 Not used because it exceeded the maximum marker angle X X X X 0010 Not used because it exceeded the maximum 3D error for the tool X X X X 0011 Used to calculate the transformation X X X X 0100 Used to calculate the transformation, but it is out of volume X X X X 0101 Not used because it was outside the characterized X measurement volume and was not needed to calculate a transformation. X X X Example - Marker Information: A tool with markers located at T, R, C, and A, where all four markers were used to determine the calculation, would have the following reply: Marker Reply T 0011 S 0000 R 0011 Q 0000 ... ... D 0000 C 0011 B 0000 A 0011 Reply Option 0004 - 3D Position of Single Stray Active Marker = or 52 Polaris Application Program Interface Guide - Revision 5 BX G.001.004 G.001.005 Valid stray active marker X X bit 1 Marker is missing X X bit 2 Reserved bit 3 Marker is out of volume X X X X Description Status 1 byte G.001.003 bit 0 Reply Component G.001.002 = The status of the stray active marker. A stray marker on an active tool is not fixed with respect to the other markers that make up the tool. Bit field: bits 4 to 7 Reserved Tx, Ty, Tz 4 bytes each Position of the marker in the coordinate system of the Position Sensor, reported as IEEE 32-bit, single precision, floating point numbers. The marker position is reported only if the marker status is “valid,” or “out of volume” and reply option 0800 is used. Note If no stray active marker is defined (for example, for wireless port handles, GPIO devices, strobers, or wired tools with no stray marker defined in the tool definition file), the status is 00, and no position information is returned. If the marker is missing, or if the marker is out of volume and reply option 0800 is not used, the system returns only the status. Polaris Application Program Interface Guide - Revision 5 53 Commands Reply Option 0008 - 3D Position of Markers On Tools Reply Component Description G.001.002 G.001.003 G.001.004 G.001.005 = Number of Markers 1 byte X X X X X X X X X X X X Number of markers used in tool transformations. Out of Volume 1 byte/8 markers (1 bit per marker) The bit is set when the marker is outside the characterized measurement volume (see example below). Reply size = (number of markers)/8, rounded up to the nearest integer. Txn, Tyn, and Tzn 4 bytes each Position of the nth marker, reported in the coordinate system of the Position Sensor, reported as IEEE 32-bit, single precision, floating point numbers. The system will report the positions of markers used in tool transformations, as well as markers that exceeded the maximum marker angle or maximum 3D error specified in the tool definition file. See “Usage Notes” on page 56 for more information. Example - Out of Volume The information is returned in the format illustrated in the following example: one bit per marker, in little endian format. In this example there are nine markers, all of which are out of volume: Marker Number Bit Field Reply Reply Byte 9 8 7 6 5 4 3 2 1 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 1 0 1 F F n n+1 Reply Option 0800 - Reporting All Transformations This option enables the reporting of transformations or translations in situations where translations or transformations are calculated, but by default are not reported by the system. Such situations include: 54 • The tool or marker is outside of the characterized measurement volume. • The bump sensor has been tripped. • The system is outside of the optimal operating temperature range. Polaris Application Program Interface Guide - Revision 5 BX • Other system conditions are not ideal; see “Alerts User Parameters” on page 23 for a full list of these conditions. This reply option must be OR’d with reply option 0001 to obtain transformations for tools in the situations listed above. It must be OR’d with reply options 0004, 0008, or 1000 to obtain position information for markers in the situations listed above. When using reply option 0800 with the BX command, you must take appropriate action to detect the events listed above, and determine whether they are detrimental to your application. If one or more of the events listed above Warning! occurs, reply option 0800 enables the system to return data that may lead to inaccurate conclusions and may cause personal injury. Appropriate action to detect the events listed above includes: • reading the out-of-volume flag in reply options 0001 and 0002 when tracking tools • reading the out-of-volume information in reply options 0004, 0008, and 1000 when tracking stray markers • reading the temperature flag in the system status • reading the diagnostic pending bit in the system status • reading the Info.Status.New Alerts user parameter for every hardware device in the system when the diagnostic pending bit is set. See “Usage Notes” on page 56 for details. Reply Option 1000 - 3D Position of Stray Passive Markers Reply Component Description G.001.002 G.001.003 G.001.004 G.001.005 = Number of Markers 1 byte X X X X X X X X X X X X Number of stray markers. Out of Volume 1 byte/8 markers (1 bit per marker) The bit is set when the marker is outside the characterized measurement volume (see example below). Reply size = (number of markers)/8, rounded up to the nearest integer. Txn, Tyn, Tzn 4 bytes each Position of the nth marker in the coordinate system of the Position Sensor, reported as IEEE 32-bit, single precision, floating point numbers. Polaris Application Program Interface Guide - Revision 5 55 Commands Note At least one passive port handle must be enabled, to activate the illuminators on the Position Sensor. If no passive port handles are enabled, will return 00 and no other data will be returned. Stray passive markers are defined as markers which are not used to calculate any of the transformations for any enabled, passive tools. Stray active wireless tool markers are not reported. Example - Out of Volume The information is returned in the format illustrated in the following example: one bit per marker, in little endian format. In this example there are nine markers, all of which are out of volume: Marker Number Bit Field Reply Reply Byte 9 8 7 6 5 4 3 2 1 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 1 0 1 F F n n+1 Usage Notes 1. The BX reply format requires fewer characters than the text format; this allows transformations to be reported more quickly. For replies in text format, use TX (page 146). 2. To use the BX command, the data bits parameter must be set to 0 (8 bits) using COMM (page 58). 3. Replies are returned in little endian format. 4. By default, transformations will not be reported if the tool is either partially or wholly out of the characterized measurement volume, if the bump sensor has been tripped, if the system is outside of the optimal operating temperature range, or if certain other alerts have occurred (see “Alerts User Parameters” on page 23 for details). To report these transformations, you must use reply option 0800 OR’d with the desired reply option(s). The accuracy of these transformations is unknown. 5. Reply Option 0001: • When the “diagnostic pending” bit is set in the system status, use GET (page 66) to read the Info.Status.New Alerts user parameter for every hardware device in the system. The act of reading these parameters clears the parameters and the “diagnostic pending” bit. For more information on alerts and their associated user parameters, see “Alerts User Parameters” on page 23. • For wired tools, bits 1, 2, and 3 in the port status report switch status. For GPIO devices, these bits report the status of GPIO lines defined as inputs. 6. Reply Option 0008: Markers are returned in alphabetical according to how they are labelled in the tool definition file. For example, for a tool with markers labelled A, G, M and S, the system will return the marker positions in the order A G M S. Reply option 0008 only returns data for markers that the system detects. To identify which marker is which, compare the reply option 0008 data to the data returned with reply option 0002. The marker order is the same for both replies; each marker that does not have a status of 0000 (“missing”) in reply option 0002 corresponds to a marker in reply option 0008. 56 Polaris Application Program Interface Guide - Revision 5 BX Compatibility Notes 1. System Status: • The external IR bit (bit 1) and system CRC error bit (bit 2) are not used by the system. • In API revision G.001.004 and later, the diagnostic pending bit (bit 8) is set whenever an alert is detected or cleared. In API revision G.001.003 and earlier, the diagnostic pending bit is set only when an alert is detected. 2. Reply Option 0002: • Reply 0010 means that the marker was not used because it exceeded the maximum 3D error for the tool. Example Command: BX 0801 Reply: A5C4005723130201013F3AF3CABE5B7209BF1C07713E635592C39E831F43332973C500511 33DA5BD9F00000031000002CC02013EA1B5D03D137D21BD787C673F72394A4286B6CB4360 6EF4C50468C13ED4E74100000031000002CD000059C9 This is the hexadecimal representation of the binary data being returned. This example returns data for two tools. Polaris Application Program Interface Guide - Revision 5 57 Commands COMM Sets the serial communication settings for the system. Operating Mode All modes Compatibility All systems Syntax G.001.002 G.001.003 G.001.004 G.001.005 COMM 0 9600 bps X X X X 1 14 400 bps X X X X 2 19 200 bps X X X X 3 38 400 bps X X X X 4 57 600 bps X X X X 5 115 200 bps X X X X 6 921 600 bps X X X X 7 1 228 739 bps X X X X Parameter Description Baud Rate The data transmission rate between the system and the host computer, in bits per second. The default baud rate is 9600 bps. Valid Values: Data Bits The data bits must be set to 8 bits in order to use any command that returns binary data (BX, GETLOG, or VGET). The default is 8 data bits. Valid Values: Parity 0 8 bits X X X X 1 7 bits X X X X The default is no parity. Valid Values: 58 0 None X X X X 1 Odd X X X X 2 Even X X X X Polaris Application Program Interface Guide - Revision 5 G.001.002 G.001.003 G.001.004 G.001.005 COMM 0 1 bit X X X X 1 2 bits X X X X Parameter Description Stop Bits The default is one stop bit. Valid Values: Hardware The default is no hardware handshaking. Handshaking Valid Values: 0 Off X X X X 1 On X X X X Replies Upon Success: OKAY On Error: ERROR See page 167 for error code definitions. Usage Notes 1. The system serial communication parameters have a default setting of 00000 (i.e. 9600 baud, 8 data bits, no parity, 1 stop bit, hardware handshaking off). 2. To use any command that returns binary data (BX, GETLOG, or VGET), you must set the data bits to 0 (8 bits). 3. If you change the baud rate using the COMM command, you must also change your host computer baud rate; otherwise, a system reset or other unexpected communication behaviour will occur. The host application should wait approximately 100 ms after receiving the OKAY reply from the system before changing its own communication parameters. 4. NDI strongly recommends using hardware handshaking when using the higher baud rates. 5. Most Windows applications do not allow you to choose 1.2 Mbaud. To allow you to communicate at this speed, NDI has aliased 19 200 baud to 1.2 Mbaud when using a USB connection. Thus, to communicate at 1.2 MB: a) Connect the system using a USB connection (this is the only option for passive systems). b) Set the system to 1.2 Mbaud ( parameter value 7). c) Set the application on the host computer to 19 200 baud. The virtual COM driver maps the communications speed to 1.2 Mbaud, so the application will actually communicate with the system at 1.2 Mbaud. Polaris Application Program Interface Guide - Revision 5 59 Commands Do not set the System to 19 200 baud when using a USB connection; if the system is set to 19 200 baud, it will be unable to communicate with the host computer, because setting the host application to 19 200 baud will result in the aliased rate of 1.2 Mbaud. Example Command: COMM 30001 Reply: OKAYA896 This changes the serial communication parameters to 38400 baud, 8 data bits, no parity, 1 stop bit, hardware handshaking on. 60 Polaris Application Program Interface Guide - Revision 5 DFLT DFLT Restores the user parameters to factory default values. Operating Mode All modes Compatibility All systems Syntax DFLT Parameter Description User Parameter Name A string, identifying the name of the user parameter. May include a trailing wild card character (*) Use DLFT * to restore all user parameters to default values. User parameter names are case-sensitive. Replies Upon Success: OKAY On Error: ERROR See page 167 for error code definitions. Usage Notes 1. The user parameter name may include a trailing wild card character (*). 2. Use DFLT * to return all user parameters to their default values. 3. The user parameter values set using the DFLT command persist until the system is reset or initialized. To save the user parameters at their factory default values, use SAVE (page 122) after using the DFLT command. 4. To view a list of user parameters and their current values, use GET *. 5. User parameter names are case-sensitive. 6. For more information on user parameters, see “User Parameters” on page 20. Example Command: DFLT * Polaris Application Program Interface Guide - Revision 5 61 Commands Reply: OKAYA896 62 Polaris Application Program Interface Guide - Revision 5 DSTART DSTART Starts Diagnostic mode. Operating Mode Setup Compatibility All systems Prerequisite Command INIT (page 78) Syntax DSTART Parameter Description Reply Option 80 (Optional, resets the frame counter to zero) Replies Upon Success: OKAY On Error: ERROR See page 167 for error code definitions. Usage Notes If the reply option 80 is not used, only resetting the system resets the counter for the frame number. The frame number is reported in reply option 0001 of the TX (page 146) and BX (page 47) commands. Example Command: DSTART Reply: OKAYA896 Polaris Application Program Interface Guide - Revision 5 63 Commands DSTOP Stops Diagnostic mode. Operating Mode Diagnostic Compatibility All systems Prerequisite Command DSTART (page 63) Syntax DSTOP Replies Upon Success: OKAY On Error: ERROR See page 167 for error code definitions. Example Command: DSTOP Reply: OKAYA896 64 Polaris Application Program Interface Guide - Revision 5 ECHO ECHO Returns exactly what is sent with the command. Operating Mode All modes Compatibility All systems Syntax ECHO Replies Upon Success: Exactly what is sent with the command, with . On Error: ERROR See page 167 for error code definitions. Compatibility Notes The ECHO command can handle a maximum of 1037 characters. Exceeding this number will cause the system to return error 02. Example Command: ECHO Testing! Reply: Testing!A81C Polaris Application Program Interface Guide - Revision 5 65 Commands GET Returns the user parameter values. Operating Mode All modes Compatibility All systems Syntax GET Parameter Description User Parameter Name A string, identifying the name of the user parameter. May include a trailing wild card character (*). Use GET * to return all user parameter values. User parameter names are case-sensitive. Replies Upon Success: = (repeated for each user parameter name, but no line feed after the last parameter) On Error: ERROR See page 167 for error code definitions. Reply Component Description User Parameter Name Variable size Full name of the user parameter Value Value of the user parameter Usage Notes 1. The user parameter name may include a trailing wild card character (*). 2. Use GET * to return the names and values of all user parameters. 3. Numeric user parameter values are returned as decimal strings. 4. User parameter names are case-sensitive. 66 Polaris Application Program Interface Guide - Revision 5 GET 5. For descriptive information about each user parameter, including type, attributes, and possible values, use the GETINFO command. 6. For more information on user parameters, see “User Parameters” on page 20. Compatibility Notes Accessing parameters by prefixing them with a device name (e.g. GET PS-0.*) is not supported by API revision G.001.002 or earlier. Example Command: GET PS-0.Info.Status.New Alerts Reply: PS-0.Info.Status.New Alerts=06E75 Polaris Application Program Interface Guide - Revision 5 67 Commands GETINFO Returns descriptive information about the user parameters. Operating Mode All modes Compatibility All systems Syntax GETINFO Parameter Description User Parameter Name A string, identifying the name of the user parameter. May include a trailing wild card character (*). Use GETINFO * to return information for all user parameters. Use GETINFO + to return top-level user parameter categories. Use GETINFO .+ to return the next level of categories under the specified category. See the examples on page 70. User parameter names are case-sensitive. Replies Upon Success: = ; ; ; ; ; ; (repeated for each user parameter, but no line feed after last parameter) On Error: ERROR