IL 1070259 Vega API Guide Rev002
Polaris_Vega_API_Guide
User Manual: Pdf
Open the PDF directly: View PDF
.
Page Count: 187
| Download | |
| Open PDF In Browser | View PDF |
Polaris Vega Application Program Interface Guide Rev 2, Part # IL-1070259 August 2017 Revision Status Revision Number Date Description 1 August 2016 First release 2 August 2017 Updated to document the optional video camera Part Number: IL-1070259 Copyright 2016-2017 Northern Digital Inc. All Rights Reserved. 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 2016-2017 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. The Polaris Vega System includes software that is distributed under the GPL v2 licence. NDI will provide, on request, and for a nominal fee, a complete machine-readable copy of the corresponding source code. For details on the GPL v2 licence refer to http://www.gnu.org/licenses/old-licenses/gpl-2.0.en.html. Polaris Vega Application Program Interface Guide Polaris Vega Application Program Interface Guide Table of Contents About This Guide . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . iii Warnings and Cautions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .iii Contact Information . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . iv 1 List of Commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1 2 Changes in Implementation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3 2.1 Deprecated Commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3 2.2 Deleted Commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3 2.3 New Commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4 2.4 Changed Commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5 2.5 Change in Concepts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5 3 Communicating with an NDI System . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11 3.1 Connection Requirements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11 3.2 Communication Overview. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11 3.3 Operating Modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12 3.4 General Syntax . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12 3.5 Receiving System Replies . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13 3.6 Best Practices. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15 3.7 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 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22 4.5 Bump Sensor User Parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28 4.6 Video Camera User Parameters. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28 4.7 User-Defined User Parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29 4.8 Complete List of User Parameters. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30 Polaris Vega Application Program Interface Guide i Table of Contents 5 Command Details . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40 6 Error and Warning Code Definitions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 157 6.1 Error Code Definitions. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 157 6.2 Warning Code Definitions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 160 Appendix A Keyed Features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 161 Appendix B Sample C Routines . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 164 Abbreviations and Acronyms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 172 Glossary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 173 Index . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 175 ii Polaris Vega Application Program Interface Guide About This Guide About This Guide This guide describes revision G.003.001 and later of the Polaris API, introduced with Polaris Vega. To determine the API revision number programmed into your system, use the APIREV (page 46) command. Note For information on previous revisions of the API, refer to the Polaris Application Program Interface Guide (IL1070101) available on the NDI support site at https://support.ndigital.com. 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 49) or TX (page 138) commands, 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. 2. No options exist for filtering data returned from the BX2 (page 60) command on the basis of system or tool status or location in the volume. Complete system and tool status information is always included in the reply and it is the application’s responsibility to interpret this data and ignore those measurements that fall outside of application requirements and constraints. Failure to do so may lead to inaccurate conclusions that may cause personal injury. Polaris Vega Application Program Interface Guide iii About This Guide Contact Information If you have any questions regarding the content of this guide or the operation of this product, please contact us: 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 updated information: https://support.ndigital.com. iv Polaris Vega Application Program Interface Guide 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.003.002 Table 1-1 Alphabetical List of Commands Command Page Description 3D 41 Returns the latest 3D position of either a single marker or multiple markers. * APIREV 46 Returns the API revision number that functions with your system. X BEEP 47 Sounds the system beeper. X BX 49 Returns the latest tool transformations, individual marker positions, and system status in binary format. X BX2 60 Returns various levels of data on the latest tool transformations, individual marker positions, and system status in binary format. X COMM 70 Sets the serial communication settings of the system. (Serial communication only.) Not used in the Polaris Vega System. X DFLT 73 Restores the user parameters to factory default values. X DSTART 74 Starts Diagnostic mode. X DSTOP 75 Stops Diagnostic mode. X ECHO 76 Returns exactly what is sent with the command. X GET 77 Returns the user parameter values. X GETINFO 79 Returns descriptive information about the user parameters. X GETLOG 81 Returns the contents of a system log file. X INIT 83 Initializes the system. X IRATE 84 Sets the illuminator rate. X IRED 86 Turns the markers on a wired tool on or off. X LED 88 Changes the state of visible LEDs on a wired tool. X PDIS 90 Disables the reporting of transformations for a particular port handle. X PENA 91 Enables reporting of transformations for a particular port handle. X PFSEL 93 Sets which tool faces to use to track a multi-faced tool. X PHF 95 Releases system resources from an unused port handle. X PHINF 96 Returns port handle status, and information about the tool associated with the port handle, including physical port location. X Polaris Vega Application Program Interface Guide 1 List of Commands 2 G.003.002 Table 1-1 Alphabetical List of Commands (Continued) Command Page Description PHRQ 102 Assigns a port handle to a tool. X PHSR 104 Returns the number of assigned port handles and the port status for each one. Assigns a port handle to a wired tool. X PINIT 107 Initializes a port handle. * PPRD 109 Reads data from the SROM device in a wired tool. (Polaris Vega only applicable to the SCU.) X PPWR 110 Writes data to the SROM device in a wired tool. (Polaris Vega only applicable to the SCU.) X PURD 112 Reads data from the user section of the SROM device in a wired tool. (Polaris Vega - only applicable to the SCU.) X PUWR 114 Writes data to the user section of a tool SROM device in a wired tool. (Polaris Vega - only applicable to the SCU.) X PVWR 116 Assigns a tool definition file to a wireless tool, overrides a tool definition file in a wired tool, and can be used to test a tool definition file before permanently recording the tool definition file onto the SROM device. X RESET 118 Resets the system (can specify either a hard reset or a soft reset). X SAVE 119 Saves all non-volatile user parameters that have been changed. X SET 120 Sets user parameter values. X SFLIST 121 Returns information about the supported features of the system. * STREAM 129 Initiates a streaming response to a specified command. X SYSLOG 131 Writes data to the Position Sensor or System Control Unit log file. X TCTST 133 Returns diagnostics on the active markers of a wired tool. X TSTART 133 Starts Tracking mode. X TSTOP 136 Stops Tracking mode. X TTCFG 137 Sets up a configuration for a wired tool so that you can test the tool without using a tool definition file. X TX 138 Returns the latest tool transformations, individual marker positions, and system status in text format. X USTREAM 150 Stops streaming of the indicated command X VCAP 151 Captures IR image data from the sensors. X VER 154 Returns the firmware revision number of critical processors installed in the system. X VSEL 156 Selects a characterized measurement volume. * Polaris Vega Application Program Interface Guide Changes in Implementation 2 Changes in Implementation This chapter describes the changes in implementation introduced by API revision G.003.001and G.003.002. For details on previous revisions of the API, refer to the Polaris Application Program Interface Guide, available on the NDI support site at https://support.ndigital.com. 2.1 Deprecated Commands The following commands are deprecated in this version of the API. 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. 2.2 Command Replacement 3D BX2 command IRATE User parameter Param.Tracking.Track Frequency PINIT PENA command calls PINIT SFLIST User parameters: Features.Tools.Active Ports, Features.Tools.Passive Ports, Features.Volumes *, Features.Tools.Wireless Ports VSEL User parameter Param.Tracking.Selected Volume Deleted Commands Deleted Commands are as follows: Deleted Command Description GETIO Deleted HCWDOG Deleted PSEL Deleted PSOUT Deleted PSRCH Deleted SENSEL Replaced by User Parameter Param.Tracking.Sensitivity (Table 4-8 on page 30) SETIO Deleted SSTAT Deleted VGET Replaced with VCAP VSNAP Replaced with VCAP Polaris Vega Application Program Interface Guide 3 Changes in Implementation 2.3 New Commands New commands in API revision G.003.001 are as follows: New Command Description BX2 (page 60) Returns various levels of data on the latest tool transformations, individual marker positions, and system status in binary format. STREAM (page 129) Initiates a streaming response to a specified command. USTREAM (page 150) Stops streaming of the specified command. VCAP (page 151) Captures IR image data from the sensors.(Replaces the VGET and VSNAP commands.) BX2 The BX2 command provides a flexible way of providing measurement data at various levels of detail. The reply can contain a single or multiple frames. Each frame can contain various levels of measurement data detail such as 6D, 3D or 2D data. • It does not repeat already reported information. • It works with the STREAM command to keep latency to a minimum and avoid missing or repeating information. • Addresses the problem of providing system wide failures and warnings in the multiconnection environment. STREAM STREAM initiates a streaming response to a command. For details on data streaming, see “Data Streaming” on page 8. USTREAM USTREAM terminates the streaming response to a command. For details on data streaming, see “Data Streaming” on page 8. VCAP The VSNAP and VGET commands are removed and replaced with a single VCAP command. The VCAP command contains options to specify and control the image data returned. The reply contains the image data for a single frame from all sensors with embedded “metadata” that includes sensor number, frame number, timestamp, exposure and other relevant information about the frames. Readable parameters provide additional information that will assist in interpreting the image data, such as the makeup of the frame sequence and the number and names of the image sensors. 4 Polaris Vega Application Program Interface Guide Changes in Implementation 2.4 Changed Commands “PHRQ” on page 102: New option in PHRQ allows you to add the specified type of measurement frame in the sequence and automatically add a “dummy” tool at the same time. This simplifies the process of setting up tracking of stray 3D targets. The change involves the redefinition of the previously Reserved 2 characters of the request. In case of the wireless tool request, new use for those characters is to specify Active Wireless or Passive Dummy Tool. PHRQ<1> DummyTool 2 characters In case of Tool Type = Wireless 01 adds passive dummy tool 02 adds active wireless dummy tool 2.5 Change in Concepts General Binary Format The General Binary Format (GBF) is used consistently in all new commands returning tracking or video data. Its advantage is that the host does not need to keep the context of the request to be able to parse it correctly. It can also contain various levels of detail corresponding to the reported tracking frame. It is structured as a list of individual, well-defined components. Each component holds the information on its unique type and its options that define the process of parsing its content. It uses little endian byte order as the existing binary command and all size byte values are interpreted as unsigned values. The general structure of the format is illustrated in Figure 2-1. All numeric values are 4 bytes (32 bits) unless otherwise specified. The first field in the payload is a 2 byte integer that indicates the number of components contained in the payload. Each component starts with a unique 2 byte value defining its type, followed by 4 bytes specifying the size of the component, including the 12 bytes for the header. If the parsing software cannot parse this component, it can use the size information to skip to the beginning of the next component. Item Format Option (2 bytes) is specific to the component type. Each type will have its own set of options that provide all the information needed to parse the content of the component. The Item Format Option implies the Item’s size. Item Count (4 bytes) describes the number of following items to parse. After parsing all the specified items, a new component starts with its definition of the component type and the parsing process repeats. Component ID’s are as follows: 01 – Frame Component 02 – 6D Data Component Polaris Vega Application Program Interface Guide 5 Changes in Implementation 03 – 3D Data Component 04 – 1D Data Component – buttons 05 – 2D Data Component 06 – reserved 07 – reserved 08 – reserved 09 – reserved 10 – Image Data Component 11 to 16 – reserved 17 – Sensor U,V Component 18 – System Alert Component An example of the GBF structure, with an example of the BX2 command is shown in Figure 2-1. Refer to page 67 for examples that contain the raw reply response converted to hex characters. 6 Polaris Vega Application Program Interface Guide Changes in Implementation Figure 2-1 General Binary Format structure and BX2 example Polaris Vega Application Program Interface Guide 7 Changes in Implementation Introduction of operating roles for host connections With the introduction of the multi-host option, there is a need to ensure only one connection to the Vega device has the capability of changing configuration options and the mode of the device. That connection will hold the Master role and other connections will be in a Monitor role. The Master connection will have full control of the system. If a connection in a Monitor role issues a command that would change the operation of the system then error code 0x39 (Permission Denied) will be returned. Initially a connection will be granted the Monitor role. When it issues a command that would require it to become the Master, the system assigns it the Master role, if the host is in the list of allowed Masters and there is not already another Master. There is a Master Time Out setting that tracks the activity on the Master connection. If the period of inactivity on the Master connection exceeds the threshold set in the Master Time Out parameter, then the Monitor can become the Master. Extended Binary Header To facilitate binary replies that have a binary payload greater than 65535 bytes long, a new binary header type is introduced. This header has a 32 bit length field and allows for reply lengths up to 2^32-1 bytes long. Either binary header may be used in response to any of the “new” binary commands, currently BX2 and VCAP. This extended binary reply header is intended for use with very large replies. If the reply length is less than 65535 bytes long, then the original binary header is used. Since TCP packets already include data checksums and to reduce processing time and allow for more efficient memory-tomemory transfer techniques, no CRC will be included in the header or at the end of the data. Thus, the extended header is the same length as the original header. The format of an extended binary header reply is as follows: A5C8<4 byte Reply Length> Data Streaming In previous versions of the API, the host and the system communicated in a strict Request-Response pattern. This version of the API introduces an option to continuously stream command responses for each new frame of data. For an application to make use of streaming, its communication drivers will have to be modified because most legacy applications expect the response to come after the request. Once streaming is enabled on the communication channel, the host can no longer assume that a given response received from the system belongs to the last request. The host addresses this in its parsing by always investigating the kind of reported data. Each streaming response will be clearly identified in its header then host processing routes each response to its corresponding process. See Figure 2-2 on page 9. 8 Polaris Vega Application Program Interface Guide Changes in Implementation Figure 2-2 Streaming Response Pattern This version of the API introduces two new streaming commands: STREAM (initiates a streaming response to a command) and USTREAM (terminates a stream). Newly introduced streamed replies will be wrapped in the Streaming Reply Format in a similar way to how the BX binary data is currently wrapped in the Binary Data Format. Both are shown in Figure 2-3 on page 10. Structures of both formats are similar. Both start with the header, followed by the binary data content and both are concluded by the CRC, ensuring correct content. Streaming reply starts with a new 2 byte identification sequence. The new parsing process checks for this sequence at the start of each reply. The header of the streaming message contains a unique string of bytes “Stream ID” which the host will use to identify which stream the response belongs to (in the case where more than one stream is initiated). If the reply is not a streaming reply, it belongs to the last pending non-streaming request. All of the tracking data is delivered in the new General Binary Format, see “General Binary Format” on page 5. Polaris Vega Application Program Interface Guide 9 Changes in Implementation Figure 2-3 Binary and Streaming Reply Format 10 Polaris Vega Application Program Interface Guide Communicating with an NDI System 3 Communicating with an NDI System 3.1 • “Connection Requirements” on page 11 • “Communication Overview” on page 11 • “Operating Modes” on page 12 • “General Syntax” on page 12 • “Receiving System Replies” on page 13 • “Best Practices” on page 15 • “Port Handles” on page 16 Connection Requirements The system must communicate with a host computer to pass measurement information to another application running on the host computer. Connection requirements are detailed below. The ethernet connection must handle the bandwidth of data being sent. The bandwidth is dependent on the amount of data being requested from the Vega System. The ethernet connection must be compliant with IEEE 802.3at and secure from any unauthorized connections. The severity of all connection-related hazardous situations is the responsibility of the system integrator because there is no essential performance of the Vega System. Note Operation on an open or uncontrolled network could limit communication bandwidth, increase latency or otherwise interfere with the normal operation of the Vega System and introduce risks which should be analyzed. Changes to the network including connection, disconnection or updates to any equipment may also affect operation of the system. 3.2 Communication Overview There are two methods of communication with the Polaris systems; request-response and streaming. Both methods are described below. Request-Response Communication In request-response communication, from the application perspective, the Polaris Vega 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. Immediately after sending a command, the application can begin to poll the serial buffer for a reply. Most commands reply almost instantly. After reaching the end of the reply, the application can send another command. There may be some delay in the response of the INIT command, and the commands used to read from and write to an SROM device in a wired tool. Polaris Vega Application Program Interface Guide 11 Communicating with an NDI System Streaming Communication The Polaris Vega System introduces an option to continuously stream command responses for each new frame of data. The STREAM command initiates streaming response and the USTREAM command terminates the streaming response. For details, see “Data Streaming” on page 8. 3.3 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 on a tool, or checking the system revision. A wireless tool must have a port handle assigned to it (PHRQ) before the application can load a tool definition file (PVWR) Both conditions must be satisfied before the tool 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. 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 BX2 and BX 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 active tools, but not track them. The system enters Diagnostic mode on successful DSTART command and exits Diagnostic mode on DSTOP command. 3.4 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 <:> ... 12 Polaris Vega Application Program Interface Guide Communicating with an NDI System 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 and in POSIXstyle parameters (which must be separated from each other by one or more spaces). This format requires a 16-bit CRC (Cyclic Redundancy Check) 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 164 for sample code to calculate the CRC. Format 2 ... A may be sent with every command; it need not be sent 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, SYSLOG commands and in POSIX-style parameters (which must be separated from each other by one or more spaces). 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 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. 3.5 Receiving System Replies Binary Replies Commands BX, BX2, GETLOG, and VCAP 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 unless the reply is an Extended Binary Reply. The will be either the requested data, or ERROR . The is a two-digit hexadecimal error number. See “Error Code Definitions” on page 157 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 Polaris Vega Application Program Interface Guide n+3 13 Communicating with an NDI System Extended Binary Header In order to facilitate binary replies that have a binary payload greater than 65535 bytes long, a new binary header type is introduced. This header has a 32 bit length field and allows for reply lengths up to 2^32-1 bytes long. Either binary header may be used in response to any of the “new” binary commands, currently BX2 and VCAP. This extended binary reply header is intended for use with very large replies. If the reply length is less than 65535 bytes long, then the original binary header is used. Since TCP packets already include data checksums and to reduce processing time and allow for more efficient memory-tomemory transfer techniques, no CRC will be included in the header or at the end of the data. Thus, the extended header is the same length as the original header. The format of an extended binary header reply is as follows: A5C8<4 byte Reply Length> ASCII Replies All commands return ASCII replies except BX, BX2, GETLOG, and VCAP, 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 107) or “Warning Code Definitions” on page 160 for details. • WARNING is returned only with the PENA command. See “Warning Code Definitions” on page 160 for a listing of the warning messages. • 14 The is a two-digit hexadecimal error number. See “Error Code Definitions” on page 157 for a listing of all the error messages associated with error numbers. Polaris Vega Application Program Interface Guide Communicating with an NDI System 3.6 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 49), TX (page 138), BX2 (page 60), and VCAP (page 151). • 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 121). See also 2.1. • 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 154). 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 46) for details. • 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 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. • 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. • 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 Polaris Vega Application Program Interface Guide 15 Communicating with an NDI System 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 29 for information on these user parameters. 3.7 Port Handles About Port Handles The system assigns each tool a port handle. Using the commands below, port handles are two characters in hexadecimal format, 0x01 to 0xFF. (BX2, for example, returns port handles as 4 characters.) 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: Command Description PHSR (page 104) Returns the number of assigned port handles and the port status for each one. Assigns a port handle to a wired tool. PHRQ (page 102) Assigns a port handle to a tool. PHRQ is followed by PVWR. PVWR (page 116) Assigns a tool definition file to a tool, overrides a tool definition file in a wired tool, 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. PINIT (page 107) Initializes a port handle. PENA calls PINIT. PHINF (page 96) Returns port handle status, and information about the tool associated with the port handle, including physical port location. PHF (page 95) Releases system resources from an unused port handle. This is required if a tool is disconnected. If a tool 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 91) Enables reporting of transformations for a particular port handle. PDIS (page 90) 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: • 16 the port handle was not enabled with PENA (page 91), Polaris Vega Application Program Interface Guide Communicating with an NDI System • the port handle has been disabled with PDIS (page 90), or • a wired tool 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 has been disconnected and port handle information is requested using PHINF (page 96), or • you have requested a port handle with PHRQ (page 102) but you have not yet used PVWR (page 116) to associate a tool definition file with the port handle. Polaris Vega Application Program Interface Guide 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. 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) Optional 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 Vega Application Program Interface Guide 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) Optional 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 Vega Application Program Interface Guide 19 User Parameters 4 4.1 User Parameters • “About User Parameters” on page 20 • “User Parameter Commands” on page 21 • “Device Names” on page 21 • “Alerts User Parameters” on page 22 • “Bump Sensor User Parameters” on page 28 • “Video Camera User Parameters” on page 28 • “User-Defined User Parameters” on page 29 • “Complete List of User Parameters” on page 30 About User Parameters User parameters store values for different aspects of the Polaris Vega 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: 20 • Image Capture User Parameters: These user parameters are used in conjunction with the VCAP command to store settings and values related to image capture. For example background or illuminated frame. • 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. • Network User Parameters: These user parameters store information about the network settings of the system. • Clock User Parameters: These parameters store information about the system clock, including the day, month, year, hour, minutes and seconds. • Volume User Parameters: These parameters store information about the Vega volume, including the volume shapes and supported wavelengths. Polaris Vega Application Program Interface Guide User Parameters • Video Camera User Parameters: These parameters store information about the optional video camera. For a full list of user parameters, see page 30. 4.2 User Parameter Commands The following commands are used with the user parameters: Command Description DFLT (page 73) Restores the user parameters to factory default values. GET (page 77) Returns user parameter values. GETINFO (page 79) Returns user parameter values and descriptive information about the user parameters, including use details, possible values and access rules. SET (page 120) Sets user parameter values. SAVE (page 119) Saves all non-volatile user parameters that have been changed. See the individual commands for more details. 4.3 Device Names Each hardware device in the system configuration has a unique device name. For passive systems, the Position Sensor and Video Camera Unit are the only hardware devices. For hybrid systems, the Position Sensor, System Control Unit and Video Camera Unit each have a device name. Each hardware device has its own set of user parameters and its own log file. Note For information on the log files, see GETLOG (page 81) and SYSLOG (page 131). 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. The list of devices will not show changes 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: Command: GET Device.* Reply: Device.Type.0=PS Polaris Vega Application Program Interface Guide 21 User Parameters Device.Type.1=SCU Device.Type.2=VCU Device.Instance.0=0 Device.Instance.1=0 Device.Instance.2=0 Device.Address.0=local Device.Address.1=192.168.1.11 Device.Address.2= Device.Port.0=8765 Device.Port.1=8765 Device.Port.2=0 The reply gives information about every device in the system configuration. For each device, there are four parameters as shown in the reply example above. • Device.Type.X describes the type of connected device: Device.Type Parameter Hardware Device • PS Position Sensor SCU System Control Unit VCU Video Camera Unit 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. For more information, refer to table Table 4-12. 4.4 Alerts User Parameters The alerts user parameters describe the status of a particular hardware device in the system. Alerts User Parameters Table 4-1 describes the alerts user parameters. Table 4-1 Alerts User Parameters User Parameter Description Info.Status. Alerts This user parameter describes the current state of the hardware device. See the alerts listed in Table 4-2 for the Position Sensor. For System Control Unit alerts, see Table 4-3. The bit corresponding to a particular alert is set when the system first detects the condition. This is accompanied by system response in Table 4-2 or Table 4-3. 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”. 22 Polaris Vega Application Program Interface Guide User Parameters Table 4-1 Alerts User Parameters (Continued) User Parameter Description Info.Status. New Alerts Read this user parameter when the diagnostic pending bit is set (bit 8 in the BX or TX System Status component). 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 system response in Table 4-2 or Table 4-3. The act of reading this user parameter clears it. 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 or Table 4-3. 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 Log to File Position Sensor LED BX2 Indication Code 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 See page 157. yes Error LED: on Power LED: off Fault 1 0x00000002 Sensor parameter fault The sensor parameters were not programmed properly, or cannot be read by the system. Not in use. INIT returns ERROR15 See page 157. yes Error LED: on Power LED: off Fault 2 0x00000004 Not in use. 0x00000008 Not in use. 0x00000010 Sets diagnostic pending bit (bit Illuminator voltage fault The illuminator voltage is outside 8) in TX or BX system status. See page 157. of operating range. This may be caused by a hardware failure. yes Error LED: on Power LED: off Fault 5 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. See page 157. yes Error LED: on Power LED: off Fault 6 Polaris Vega Application Program Interface Guide 23 User Parameters Table 4-2 Position Sensor Alerts (Continued) Hexadecimal Alert Value Log to File System Response Position Sensor LED BX2 Indication Code 0x00000040 Left sensor temperature fault The left sensor temperature cannot be read. 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. See page 157. yes Error LED: on Power LED: off Fault 7 0x00000080 Right sensor temperature fault The right sensor temperature cannot be read. 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. See page 157. yes Error LED: on Power LED: off Fault 8 0x00000100 Main temperature fault The main board temperature cannot be read. 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. See page 157. yes Error LED: on Power LED: off Fault 9 0x00000200 One of the image sensors on the PSU is not functioning. This may be caused by an internal hardware failure. 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. See page 157. yes Error LED: on Power LED: off Fault 10 0x00000400 0x00020000 Reserved 0x00040000 A Type 1 low power PSE is detected and there is insufficient power for tracking. A Type 2 PSE compliant with the 802.3at standard that outputs up to 30W must be used. INIT returns ERROR15 See page 157. no Error LED: on Power LED: on N/A 0x00080000 SCU configured but not present This may mean that the SCU is not functioning, has not powered up yet, or has been disconnected. It can also mean that the system is misconfigured. Active tools will not be available for tracking. no Error LED: on Power LED: on Alert 10 24 Polaris Vega Application Program Interface Guide User Parameters Table 4-2 Position Sensor Alerts (Continued) Hexadecimal Alert Value System Response Log to File Position Sensor LED BX2 Indication Code 0x00100000 System battery fault The system battery power is too low. This may be caused by a depleted or disconnected battery. 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. See page 157. yes Error LED: on Power LED: on Alert 1 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. See page 157. yes Error LED: on Power LED: on Alert 2 0x00400000 Video camera not functioning Video output is not available. The VCU signals a fault or fails to respond to the PSU. yes Error LED: on Power LED: on Alert 15 0x00800000 Incompatible firmware The combination of firmware on the Position Sensor is not compat ible. This may be caused by a failed attempt to update the firmware. INIT returns ERROR2E See page 157. yes Error LED: flashing Power LED: on Alert 3 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 119)). INIT returns ERROR15 See page 157. yes Error LED: on Power LED: on Alert 4 0x02000000 Not in use. 0x08000000 PTP clock is not synced PSU’s PTP clock is not synced with other devices on the same network. See page 157. no Error LED: on Power LED: on Alert 14 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. See page 157. no Error LED: on Power LED: on Alert 8 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. See page 157. no Power LED: flashes during warm-up when system is first powered on. Error LED: on Alert 9 Polaris Vega Application Program Interface Guide 25 User Parameters Table 4-2 Position Sensor Alerts (Continued) Hexadecimal Alert Value 0x80000000 Log to File System Response Position Sensor LED BX2 Indication Code Reserved 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: Note The Polaris Vega SCU only incorporates one (Status) LED located on the rear of the SCU. Table 4-3 System Control Unit Alerts 26 Hexadecimal Alert Value 0x00000001 Non-recoverable parameter fault The system parameter file or some other critical file is missing or has been corrupted (CRC check failed). 0x00000002 to 0x00000008 Reserved 0x00000010 Internal strober communication fault The SCU can detect the internal strober, but cannot communicate with it. 0x00000020 to 0x00000040 Reserved 0x00000080 Not in use. 0x00000100 Strober fault raised The SCU has detected a fault raised by the strober. There could be a voltage monitor fault or an active marker current monitor fault. 0x00000200 to 0x00400000 Reserved System Response Log to File SCU LED Indication INIT returns ERROR15 yes Rear LED: amber Sets diagnostic pending bit (bit yes 8) in TX or BX system status. Rear LED: amber yes Rear LED: amber Polaris Vega Application Program Interface Guide User Parameters Table 4-3 System Control Unit Alerts (Continued) Hexadecimal Alert Value System Response Log to File 0x00800000 Incompatible firmware 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 yes Rear LED: amber flash 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 119)). INIT returns ERROR15 See page 157. yes Rear LED: amber flash 0x02000000 Not in use. 0x04000000 Reserved 0x08000000 PTP clock not synced SCU's PTP clock is not synced with other devices on the same network. no Rear LED: amber flash 0x10000000 SCU fan not functioning as expected no Rear LED: amber flash 0x20000000 SCU battery voltage low. This may be caused by a depleted or disconnected battery. Strober alert raised A strober parameter is missing. yes Rear LED: amber flash yes Rear LED: amber flash 0x40000000 0x80000000 SCU LED Indication Not in use Video Camera Alerts Table 4-4 describes the VCU alerts that are returned by the VCU-0.Info.Status.Alerts and VCU0.Info.Status.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 Video Camera Alerts Hexadecimal Alert Value 0x00000001 0x00000002 Internal video camera error Polaris Vega Application Program Interface Guide System Response If this condition persists for more than 17 seconds, the system will reboot the video camera. Log to File PSU LED Indication no None 27 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. Video Camera User Parameters Table 4-6 lists the information user parameters that relate to the optional video camera. For details on the video camera, see the user guide that accompanied your system. Table 4-6 Video Camera User Parameters User Parameter Description VCU0.Info.Status.Alerts This user parameter describes the current state of the hardware device. See the alerts listed in Table 4-4 for the VCU. The bit corresponding to a particular alert is set when the system first detects the condition. The bit is cleared when the condition no longer exists. VCU0.Info.Status.New Alerts 28 This user parameter lists the current alerts status whenever an alert is set or cleared. The act of reading this parameter clears this parameter. Polaris Vega Application Program Interface Guide User Parameters 4.7 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. Polaris Vega Application Program Interface Guide 29 User Parameters 4.8 Complete List of User Parameters The following tables list the user parameters for the Polaris Vega System. 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 VCAP command. These user parameters apply only to the Position Sensor. Table 4-7 Image Capture User Parameters User Parameter Name Description Access Rules 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.Sensor.Number Number of image sensors in system. Read Settings User Parameters The following user parameters store settings for the hardware devices indicated in the Hardware Device column. Table 4-8 System Settings User Parameters 30 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 163 for details. The laser will turn off automatically after 35 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.Tracking. Available Volumes Available characterized measurement volumes. Read Position Sensor Polaris Vega Application Program Interface Guide User Parameters Table 4-8 System Settings User Parameters (Continued) Param.Tracking.Selected Volume Selects a characterized measurement volume. Can only be set in Setup mode. Read, write Position Sensor Param.Tracking.Sensitivity.Active Background IR sensitivity level (1lowest, 7-highest) for wired active tools. Read, write, save Position Sensor Param.Tracking.Sensitivity.Active Wireless Background IR sensitivity level (1lowest, 7-highest) for active wireless tools. Read, write, save Position Sensor Param.Tracking.Sensitivity.Passive Background IR sensitivity level (1lowest, 7-highest) for wireless passive tools. Read, write, save Position Sensor Valid only for API revision G.003.001 and later. Param.Tracking.Track Frequency Tool tracking frequency [Hz] Can only be set in Setup mode. Read, write Position Sensor Valid only for API revision G.003.001 and later. Param.Tracking.Frame Sequence Sequence of frame types currently being tracked. Read 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/disables the bump sensor. Read, write, save Position Sensor Param.Bump Detector.Bumped Indicates when the system has detected a bump. Read Position Sensor Param.Bump Detector.Clear Set to 'Clear' (1) to acknowledge reported bumps. Read, write Position Sensor Param.Simulated Alerts Simulates the 'Info.Status.Alerts' parameter, for testing purposes. Read, write, save Position Sensor, SCU Param.System Beeper Enables/disables the beeper sequence on system reset. Read, write, save Position Sensor, SCU Param.Connect.SCU Port TCP port for SCU connections Read, write, save SCU Valid only for API revision G.003.001 and later. Param.Connect.SCU Hostname Host name or address for SCU connection Read, write, save Position Sensor Valid only for API revision G.003.001 and later. Polaris Vega Application Program Interface Guide 31 User Parameters Table 4-8 System Settings User Parameters (Continued) Param.Tracking.Illuminated Frame Forces the collection of a frame with Read, write illuminators on. Takes effect on next DSTART or TSTART. Position Sensor Valid only for API revision G.003.001 and later. Param.Tracking.Background Frame Forces the collection of a background frame with illuminators off. Takes effect on next DSTART or TSTART. Read, write Position Sensor Read, write Position Sensor Read, write Position Sensor Valid only for API revision G.003.001 and later. Param.Exposure.Time Slot.Passive Time slot within the frame, to coordinate multiple position sensors. Valid only for API revision G.003.001 and later. Param.Exposure.Shutter Time.Other Exposure time for illuminated and background frames [us]. Valid only for API revision G.003.001 and later. Information User Parameters The following user parameters store status information for the hardware devices indicated in the Hardware Device column, and command time out values. Table 4-9 Information User Parameters Access Rules Hardware Device Time out for the specified command (sec). For the SCU, only the following commands have timeout values: APIREV, COMM, DFLT, ECHO, GET, GETINFO, GETLOG, INIT, 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 22 for details. Read Position Sensor, SCU Info.Status.New Alerts System hardware and operating status flags; see “Alerts User Parameters” on page 22 for details. Read Position Sensor, SCU Info.Status.Bump Detected Indicates if the system has detected a bump. Read Position Sensor Read Position Sensor User Parameter Name Description Info.Timeout. Info.Status.PTP.Clock State PTP Clock Master/Slave state. 32 Polaris Vega Application Program Interface Guide User Parameters Table 4-9 Information User Parameters (Continued) Info.Status.PTP.Sync State PTP Clock sync state. Read Position Sensor Info.Status.PTP.Master Offset PTP Clock master offset in µs. 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 Info.Status.Gravity Vector Gravity directional vector reported in Position Sensor coordinate space. Read Position Sensor Valid only for API revision G.003.001 and later. Features User Parameters The following user parameters store information about the features for the hardware devices indicated in the Hardware Device column. Table 4-10 Features User Parameters Hardware Device User Parameter Name Description Access Rules Features.Keys.Installed Keys 'Value' is the name of the installed feature. Read Position Sensor, SCU Features.Keys.Active Keys List of active feature keys; See page 161 for details. Read Position Sensor, SCU Features.Keys.Disabled Keys List of disabled keys; change takes effect on next reset. See page 161 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. Bootloader.Version Current bootloader revision number. Read Position Sensor Features.Firmware.Version Current firmware revision number. Read Position Sensor, SCU 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 Polaris Vega Application Program Interface Guide 33 User Parameters Table 4-10 Features User Parameters (Continued) 34 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 Features.Hardware.Part Num- Product part number. ber Read Position Sensor, SCU Features.Hardware. OEM Number Hardware device customer number. Read Position Sensor, SCU Features.Hardware.Model Hardware device model name. Read Position Sensor, SCU 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 Features.Firmware. Current combined firmware revision of Combined Firmware Revision the device. Read Position Sensor, SCU Features.Volumes.* Volume information from camera parameter files. Read Position Sensor Features.Video Camera Video camera is installed or not installed. Read Position Sensor Polaris Vega Application Program Interface Guide User Parameters 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. Table 4-11 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 162 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 162 for details. Config.Multi Firmware. List of combined firmware revisions loaded in the sysAvailable Combined Firmware tem. Revisions Config.Combined Firmware Revision Current combined firmware revision of the system. Read Read Hardware Device Information User Parameters The following user parameters store information about the hardware devices in the system. See “Device Names” on page 21 for information on how to use the hardware device user parameters. Table 4-12 Hardware Device User Parameters User Parameter Name Description Access Rules Device.Type Type of device in the system configuration. Read Device.Instance Instance of this type of device in the system configuration. Read Device.Address The network address of the device (or “local” if that is the device you are talking to). Read Device.Port The network port to connect to the device. Read Network User Parameters The following user parameters store information about the system network settings. Polaris Vega Application Program Interface Guide 35 User Parameters Table 4-13 Network User Parameters 36 User Parameter Name Description Access Rules Param.Network.IP Method Method of receiving IP address. Read, Write, Save Param.Network.Static.IP Address Requested ethernet interface IPv4 address. Read, Write, Save Param.Network.Static.Subnet Mask Requested ethernet interface IPv4 subnet mask. Read, Write, Save Param.Network.Static.Gateway Requested interface IPv4 gateway. Read, Write, Save Param.Network.DNS Servers DNS Server list. Space separated. Read, Write, Save Param.Network.Host Name Ethernet interface hostname, blank for default. Read, Write, Save Param.Network.MAC Address Ethernet interface MAC address. Read, Write, Save Param.Network.Service Name Service name advertised in DNS-SD. m=model h=host name, n=serial number, t=tracking group. Read, Write, Save Param.Network.Tracking Group Tracking group name. Enables discovery of group members. Read, Write, Save Param.Connect.Master Hosts List of hosts allowed to become configuration masters, blank=unrestricted. Read, Write, Save Param.Connect.Monitor Hosts List of hosts allowed to connect, blank=unrestricted, none=no monitor hosts. Read, Write, Save Param.Connect.Host Port TCP port to listen for host connections. Read, Write, Save Info.Connections. Address Remote IP address. Read Info.Connections.Port Remote IP port. Read Info.Connections.Rx Bytes Received byte count. Read Info.Connections.Tx Bytes Transmitted byte count. Read Info.Connections.Requests Number of API requests. Read Info.Connections.Replies Number of API replies. Read Info.Connections.Streams Number of active streams. Read Info.Connect.isMaster True if this connection is master. Read Info.Connect.isAuth True if this connection is authenticated. Read Param.Connect.Master Timeout Seconds of inactivity before another connection is allowed to become master (0=never) Read, Write, Save Polaris Vega Application Program Interface Guide User Parameters Param.Connect.SCU Port TCP port for SCU connections Read, Write, Save Param.Connect.SCU Hostname Host name or address for SCU connection Read, Write, Save Clock User Parameters The following user parameters store information about the system clock. Table 4-14 Clock User Parameters User Parameter Name Description Access Rules Param.Clock.Date Numerical value for the day of the month. Read, Write, Save Param.Clock.Day Of Week Numerical value for the day of the week. 0= Monday, 1= Tuesday, etc. Read, Write, Save Param.Clock.Hours Numerical value for the current hour using the 24 hour clock. Read, Write, Save Param.Clock.Minutes Numerical value for the current minute. Read, Write, Save Param.Clock.Seconds Numerical value for the current second. Read, Write, Save Param.Clock.Year Numerical value for the current year, using the last two digits of the year. For example, 2016 would be set as 16. Read, Write, Save Param.Clock.Month Numerical value for the current month. Read, Write, Save Volume User Parameters The following user parameters describe the volume shapes and supported wavelengths for the measurement volumes. Table 4-15 Volume User Parameters User Parameter Name Description Access Rules Features.Volumes.Index Indicates the volume that is being referred to. Read Features.Volumes.Name The volume name. Read Features.Volumes.Shape The shape type. Read Features.Volumes.Wavelengths Which wavelengths are supported in the volume. Read Features.Volumes.Paramn Shape parameters as described in SFLIST. Read Video Camera User Parameters The following parameters store information about the video camera. Polaris Vega Application Program Interface Guide 37 User Parameters Table 4-16 Video Camera User Parameters 38 User Parameter Name Description Access Rules Param.Video Camera.Allow Streaming Enables or disables video output.Video output is disabled by default. Note: INIT does not disable video streaming if it has been enabled. Read/Write VCU-0.Features.Firmware.Version Current firmware revision number for the video camera. Read VCU-0.Param.White Balance. [Red|Green|Blue] Selected white balance configuration. Values: 0 to 128 Read/Write/Save VCU-0.Param.White Balance.Name Lighting presets to control the R|G|B colour gains. Read/Write/Save VCU-0.Param.White Balance. Gains.[Name|Red|Green|Blue] Gain values that are set when the VCU-0.White Balance.Name is changed. Read/Write VCU-0.Param.System Gain A multiplier applied to the colour gains to increase or decrease overall brightness. Values: 0-15.998 Read/Write/Save VCU-0.Param.Brightness Brightness offset added to all pixels equally, not based on colour. Values: 0 to 255 Read/Write/Save VCU-0.Param.Contrast The contrast gain parameter applied to all colours. Value: 0-15.94 Read/Write/Save VCU-0.Param.Exposure Time Exposure time in microseconds. Read/Write/Save VCU-0.Param.Frame Rate The frame rate streaming out of the video camera in frames per second. Read VCU-0.Param.Resolution Selects the resolution of the video stream. Read/Write/Save VCU-0.Param.Stream Preset Video stream parameters, prioritizing quality, latency, or compression. Read/Write/Save VCU-0.Param.Vertical Flip Vertically flips the image generated by the video camera. Read/Write/Save VCU-0.Param.Clients IP address of the client connected to the video stream. Read VCU-0.Param.Disconnect Clients Set this parameter to disconnect the connected client. Values: “1” disconnects the client. The system will automatically reset this parameter to “0”. Write VCU-0.Param.Lens. Distortion.[k1|k2|k3|p1|p2] Lens distortion parameters for Zhang's method for the currently selected resolution parameters. Values come from factory characterization of the video camera. Read VCU-0.Param.Lens. Pinhole.[U0,V0,fx,fy] Lens pinhole parameters for the currently selected resolution. Values come from factory characterization of the video camera. Read Polaris Vega Application Program Interface Guide User Parameters VCU-0.Param.Lens.6D. [q0|qx|qy|qz|x|y|z] The orientation and location of the video camera in the Vega measurement coordinate space. Initial values come from factory characterization of the video camera. Read/Write/Save VCU-0.Param.Lens.6D.reset Use this parameter to reset the 6D values to factory defaults. Values: “1” resets the 6D parameters. The system will automatically reset this parameter to “0”. Write Polaris Vega Application Program Interface Guide 39 Command Details 5 Command Details 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. 40 Polaris Vega Application Program Interface Guide Command Details 3D Returns the latest three-dimensional marker position of a single marker or multiple markers. Deprecated Operating Mode Diagnostic, Tracking Prerequisite Command IRED (page 86), 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 45 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 157 for error code definitions. Polaris Vega Application Program Interface Guide 41 Command Details 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. Possible Values: +000 (best case) to +100 (worst case) 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. 42 Polaris Vega Application Program Interface Guide Command Details Reply Component Description 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. 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) 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. Polaris Vega Application Program Interface Guide 43 Command Details Reply Component Description 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) 1 hexadecimal character Indicates whether the marker is outside the characterized measurement volume. Out of 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) Out of Volume n 1 hexadecimal character Indicates whether the nth marker is outside the characterized measurement volume. Possible Values: 44 0 The marker is inside the characterized measurement volume. 1 The marker is out of volume. Polaris Vega Application Program Interface Guide Command Details Usage Notes 1. The specified port handle must be enabled using PENA (page 91). 2. You may need to use the 3D command about ten times if it is sent immediately after using IRED (page 86). 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 that accompanied the system 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 77) command to check the value of user parameters.) You can use the BX (page 49) or TX (page 138) 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 Vega Application Program Interface Guide 45 Command Details APIREV Returns the API revision number that functions with your system. Operating Mode All modes Syntax APIREV Replies Upon Success: . . On Error: ERROR See page 157 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.) Example Command: APIREV Reply: G.003.0016379 46 Polaris Vega Application Program Interface Guide Command Details BEEP Sounds the system beeper. Operating Mode All modes Syntax BEEP Parameter Description Number of Beeps Valid Values: 1 to 9 Replies Upon Success: On Error: ERROR Reply Component Description Beep Status G.003.002 See page 157 for error code definitions. Possible Values: 0 The system is busy beeping. 1 Beeping has started. X 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 Vega Application Program Interface Guide 47 Command Details Example Command: BEEP 1 Reply: 1D4C1 48 Polaris Vega Application Program Interface Guide Command Details BX Returns the latest tool transformations, individual marker positions, and system status in binary format. Operating Mode Tracking Note For information on previous revisions of the API, refer to the Polaris Application Program Interface Guide (IL1070101) available on the NDI support site at https://support.ndigital.com. Syntax Parameter Description Reply Option G.003.002 BX 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: 0001 Transformation data (default) X 0002 Tool and marker information X 0004 3D position of a single stray active marker X 0008 3D positions of markers on tools X 0800 Transformations not normally reported X 1000 3D positions of stray passive markers X Replies Upon Success: <01(Number of Handles)> ... ... ... Polaris Vega Application Program Interface Guide 49 Command Details 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.003.002 See page 157 for error code definitions. Reply Component Description Start Sequence 2 bytes: A5C4 X Indicates the start of the BX reply. Reply Length 2 bytes X Indicates the number of bytes in the reply body between the and the , exclusive. Header CRC 2 bytes X CRC16 of and Number of Handles 1 byte X The number of port handles for which information is returned. Handle n 1 byte X The port handle whose information follows. Handle Status 1 byte Possible Values: 50 01 Valid X 02 Missing X 04 Disabled X Polaris Vega Application Program Interface Guide G.003.002 Command Details 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 0001 (transformation data) (default) X Reply option 0002 (tool and marker information) X Reply option 0004 (latest 3D position of single stray active marker) X Reply option 0008 (3D position of markers on tools) X Reply option 0800 (reporting all transformations) X Reply option 1000 (3D position of stray passive markers) X System Status 2 bytes The status of the system. Bit field: bit 0 System communication synchronization error X bits 1 and 2 Reserved bit 3 Recoverable system processing exception. bit 4-5 Reserved bit 6 Some port handle has become occupied X bit 7 Some port handle has become unoccupied X bit 8 Diagnostic pending X bit 9 Temperature (system is not within operating temperature range) X bit 10 Hardware configuration changed (e.g. VCU or SCU has connected or disconnected) X bits 11 to 15 Reserved X Note The “diagnostic pending” bit is set whenever an alert is detected or cleared. To view the alerts status and clear the diagnostic pending bit, use GET (page 77) to check the Info.Status.New Alerts user parameter for every hardware device in the system. See “Usage Notes” on page 58 for more details. (For API revision G.001.003 and earlier, the diagnostic pending bit did not indicate when an alert was cleared.) Polaris Vega Application Program Interface Guide 51 Command Details Reply Option 0001 - Transformation Data Reply Component G.003.002 = or = Description Q0, Qx, Qy, Qz 4 bytes each 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 X Translational components of the transformation, in mm, reported as IEEE 32-bit, single precision, floating point numbers. Error X 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 32bit, single precision, floating point number. 52 Polaris Vega Application Program Interface Guide Reply Component Description Port Status 4 bytes G.003.002 Command Details Bit field: bit 0 Occupied X bit 1 Switch 1 closed X bit 2 Switch 2 closed X bit 3 Switch 3 closed X bits 4 Initialized X bit 5 Enabled X bit 6 Out of volume X bit 7 Partially out of volume X bit 8 Algorithm limitation (processing requires more buffer than is available) X bit 9 IR interference (a large bright IR object) X bits 10 and 11 Reserved 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 bit 15 Data buffer limitation (too much data; for example, too many markers) X X bits 16 to 31 Reserved Frame Number 4 byte unsigned number X The frame number is an internal counter related to data acquisition, which is derived from the PTP time. 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. - In the event of a system error that prevents tracking, all tools are reported as missing. Polaris Vega Application Program Interface Guide 53 Command Details Reply Option 0002 - Tool and Marker Information Reply Component Description Tool Information 1 byte G.003.002 = Bit field: Marker Information bit 0 Bad transformation fit X bit 1 Not enough acceptable markers for transforma- X tion bit 2 IR interference—environmental IR is interfering with the system (combination of port status bits 9 and 15 in reply option 0001) X bit 3 Fell behind while processing (same as port status bit 14 in reply option 0001) X bits 4 to 6 Tool face used X bit 7 Processing exception (same as port status bit 12 in reply option 0001) X 10 bytes (4 bits per marker) See below for an example. Possible Values: 0000 Not used because it was missing X 0001 Not used because it exceeded the maximum marker angle X 0010 Not used because it exceeded the maximum 3D error for the tool X 0011 Used to calculate the transformation X 0100 Used to calculate the transformation, but it is out of volume X 0101 Not used because it was outside the character- X ized measurement and was not needed to calculate a transformation. 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 = 54 Polaris Vega Application Program Interface Guide Command Details Reply Component Description Status 1 byte G.003.002 or = 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: Tx, Ty, Tz bit 0 Valid stray active marker X bit 1 Marker is missing X bit 2 Reserved bit 3 Marker is out of volume bits 4 to 7 Reserved 4 bytes each X X 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, 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 Vega Application Program Interface Guide 55 Command Details Reply Option 0008 - 3D Position of Markers On Tools Reply Component Description G.003.002 = Number of Markers 1 byte X Number of markers used in tool transformations. Out of Volume 1 byte/8 markers (1 bit per marker) X 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 X 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 58 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: 56 • 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 Vega Application Program Interface Guide Command Details • Other system conditions are not ideal; see “Alerts User Parameters” on page 22 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 58 for details. Reply Option 1000 - 3D Position of Stray Passive Markers Reply Component Description G.003.002 = Number of Markers 1 byte X Number of stray markers. Out of Volume 1 byte/8 markers (1 bit per marker) X 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 X Position of the nth marker in the coordinate system of the Position Sensor, reported as IEEE 32-bit, single precision, floating point numbers. Polaris Vega Application Program Interface Guide 57 Command Details 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 138). 2. Replies are returned in little endian format. 3. 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 22 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. 4. Reply Option 0001: • When the “diagnostic pending” bit is set in the system status, use GET (page 77) 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 22. • For wired tools, bits 1, 2, and 3 in the port status report switch status. 5. Reply Option 0008: Markers are returned in alphabetical order 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. Compatibility Notes 1. System Status: • 58 The external IR bit (bit 1) and system CRC error bit (bit 2) are not used by the system. Polaris Vega Application Program Interface Guide Command Details • 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 Vega Application Program Interface Guide 59 Command Details BX2 Returns the latest tool transformations, individual marker positions, and system status in the General Binary Format. The BX2 command provides a flexible way of providing measurement data at various levels of detail. The reply can contain a single or multiple frames. Each frame can contain various levels of measurement data details such as 6D, 3D or 2D data. • It does not repeat already reported information. • It works with the STREAM command to keep latency to a minimum and avoid missing or repeating information. • Addresses the problem of providing system wide failures and warning in the multiconnection environment. Operating Mode Tracking Syntax BX2 Reply Option Description --6d= tools|none specifies whether 6D information for tools are returned or not. Default is “tools” --3d= none|tools|strays|all specifies which 3D information is returned, none, tool 3D’s, stray 3D’s or all 3D’s. The default is none. (If selected, 3D’s will be returned for all frame types, not just passive frames.) --2d= none|tools|strays|all specifies which 2D (line of sight) information will be returned. The default is none. --sensor=none|tools|strays|all --sensor specifies which scaled sensor UV information is returned. Scaled UV can be used to visualize the images on the sensors and also provide diagnostic information related to UV brightness. The default is none. --1d=buttons|none --1d specifies whether buttons are reported or not. The default is buttons. Replies Upon Success: <2 byte Reply Length> ... or <4 byte Reply Length> ... 60 Polaris Vega Application Program Interface Guide Command Details On Error: ERROR See page 157 for error code definitions. Frame Component: 0x0001 The Frame status field contains error status information related to the frame. In all cases, a value of zero indicates no errors or fault conditions. All other measurement data details are included as part of the frame data payload. The payload itself follows the General Binary Format. Frame Data Item Frame Type 1 byte See below Frame Sequence Index 1 byte Frame Status 2 bytes Frame Number 4 bytes Frame Timestamp 8 bytes struct timespec (bytes 0-3=seconds since start of epoch, bytes 4-7=nanoseconds) Frame Data Payload Variable General Binary Format See below Frame Types will be as follows: DUMMY = ACTIVE_WIRELESS = PASSIVE = ACTIVE = LASER = ILLUMINATED = BACKGROUND = MAGNETIC = 0 1 2 3 4 5 6 7 Frame Status is as follows: Bit 0-15 This field uses the same codes as the 6D Port/ Tool Status, but only the ones which are applicable to the frame as a whole. 6D Data Component: 0x0002 The payload consists of a variable number of 6D data items. Each item has a tool handle (2 bytes in the interest of data alignment) followed by a 2 byte bit-field of port/tool status. If the tool is not missing, this will be followed by a transformation in the same format as the BX command (q0, qx, qy, qz, tx, ty, tz, error) Polaris Vega Application Program Interface Guide 61 Command Details 6D Tool Data Item Tool Handle 2 bytes Status 2 bytes See below Q0, Qx, Qy, Qz, Tx, Ty, 4 bytes Tz, Error each Port/Tool Status is as follows: Bit 0-7 Error codes as described in Port/Tool Status Error Codes (page 62) and Port/Tool Status Error Codes (Tool Missing) (page 62) Bit 8 Transform missing Bit 9-12 Reserved Bit 13-15 Which face of a multi-face tool is being tracked Table 5-1 Port/Tool Status Error Codes Error Code Description 0 Enabled 3 Tool is partially out of the characterized measurement volume 9 Tool is out of the characterized measurement volume Note The following error codes will only be reported if the tool is missing Table 5-2 Port/Tool Status Error Codes (Tool Missing) 62 Error Code Description 13 Too few markers detected 14 IR interference (a large bright IR object) 17 Bad transformation fit 18 Data buffer limitation (too much data; for example, too many markers) 19 Algorithm limitation (processing requires more buffer than is available) 20 Fell behind while processing Polaris Vega Application Program Interface Guide Command Details Table 5-2 Port/Tool Status Error Codes (Tool Missing) Error Code Description 21 Position sensors out of synch 22 Processing exception 31 Tool is missing 32 Tracking is not enabled for this tool 33 Tool has been unplugged from the System Control Unit 3D Data Component: 0x0003 The 3D component payload consists of a variable number of 3D items. Each item has a 4 byte handle reference to the port handle of the tool to which the 3D’s belong. If the 3D is “stray”, the handle reference will be -1. Location information will be equivalent to the 3D information in the BX command. If the marker is missing its 3D item then information will not be present. Note To provide additional diagnostic information for active and passive tools, all defined markers are reported with appropriate status and index (whether they are visible or not) for tools defined with up to 20 markers. For tools with more than 20 defined markers, only visible markers will be reported. 3D Tool Data Item Tool Handle Reference 2 bytes Number of 3Ds 2 bytes 0xffff for “stray” 3D 3D Data Item Status 1 byte -reserved- 1 byte Marker Index 2 bytes X, Y, Z 4 bytes each See below index of marker on tool, sequential # for strays For data alignment, the marker status field is 4 bytes as follows: 0x00 0x01 0x02 0x03 0x04 0x05 0x06 0x07 OK Missing (missing markers may not be reported in component at all) Not used: exceeded max marker angle Not used: exceeded max 3D error for tool Not used: Out of Volume Out of Volume – used in 6D Possible phantom marker (in volume, applies to stray markers only Saturated (in or out of volume, not used in 6D) Polaris Vega Application Program Interface Guide 63 Command Details 0x08 0x09-0xFF Saturated and out of volume (not used in 6D) reserved 1D Button Component: 0x0004 The 1D button component consists of a variable number of button state items. Each item contains a port handle (tool) reference or, in the case of non-tool buttons, a dummy tool reference corresponding to the frame in which the button was sampled. Button states are 1 byte each. Use 0 for open and 1 for closed. Note Currently the only supported states are CLOSED and OPEN. In future, button processing on the firmware may be enhanced to support additional states, such as PRESSED, RELEASED, CLICKED, DOUBLE-CLICKED, HOLD, etc. 1D Button Data Item Tool Handle Reference Number of buttons Button Data Item Button data 2 bytes 2 bytes 0xffff for “stray” (non-tool) buttons 4 bytes 1 byte for each 4 buttons (little endian) 2D Data Component: 0x0005 The 2D data component is as follows: Tool Line of Sight (LOS) Item Tool Handle Reference Number of Sensors LOS Sensor Item Sensor Reference Number of LOS Items LOS Item Base X,Y,Z LOS X,Y,Z Number Marker References (N) Marker References LOS Item padding 2 bytes 2 bytes 0xffff for “stray” LOS 2 bytes 2 bytes Index number of the sensor 4 bytes each 4 bytes each 2 bytes vector from origin to sensor LOS vector from sensor 0-65535 2 bytes each ((N+1)*2)%4 bytes Index of 3D item reported for tool handle 0 or 2 bytes of padding to ensure each item ends in a 4 byte boundary Sensor UV Component: 0x0011 This component is returned if the –sensor option is used. It returns simplified uv data that can be used for diagnostics. Component Item Tool Handle Reference 64 2 bytes 0xffff for “stray” LOS Polaris Vega Application Program Interface Guide Command Details Number of Sensors UV Sensor Item Sensor Reference Number of UV Items Scaled UV Item Scaled U, scaled V Width U, Height V Energy Peak Intensity Number Marker References (N) Marker References UV Item padding 2 bytes 2 bytes 2 bytes Index number of the sensor 1 byte each 1 bytes each 4 bytes 2 bytes 2 bytes 0-255 upper left of view is 0,0 Sum intensity of all centroid pixels 0-65535 2 bytes each Refers to 3D index for tool in 3D item ((N+1)*2)%4 0 or 2 bytes of padding to ensure each item ends in bytes a 4 byte boundary System Alert Component 0x0012 The System Alert Component returns all current system faults, alerts and events. The component header indicates the number of items. An item consists of a 2 byte type followed by a 2 byte code. Faults are conditions that indicate the system is unable to function correctly. In general the unit must be returned to NDI for repair. Alerts are conditions that may impact measurement performance but can be resolved on their own or without physical repair. Events may also impact performance or system behaviour but they are a normal part of operations and do not indicate a system malfunction. Component Item Condition Type - reserved Condition Code 1 byte 1 bytes 2 bytes each 0=fault, 1=alert 2=event Faults The following faults are returned as part of the BX2 component 0x0012: Error Code Description 1 2 3 4 5 6 7 8 9 10 Non-recoverable parameter fault Sensor parameter fault Main voltage fault Sensor voltage fault Illuminator voltage fault Illuminator current fault Sensor 0 temperature fault (left) Sensor 1 temperature fault (right) Main temperature fault Sensor fault Polaris Vega Application Program Interface Guide 65 Command Details Alerts The following alerts are returned as part of the BX2 component 0x0012: Error Code Description 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 Battery fault Bump detected Firmware incompatible Non fatal parameter fault Not used Not used Not used Temperature high Temperature low SCU disconnected Not used Not used Not used PTP synchronization fault Video camera not functioning For detailed information on system faults and alerts, refer to “Position Sensor Alerts” on page 23. Events The following events are returned as part of the BX2 component 0x0012: Event Code Description How the event is cleared 1 2 5 Active tool connected Active tool disconnected Hardware configuration changed (e.g. VCU or SCU has connected or disconnected) PHSR by the master connection PHSR by the master connection PHSR by the master connection Usage Notes The will be either Requested Data or ERROR . The BX2 command can be used alone to generate one reply for each BX2 request, or it can be used with the STREAM command to generate a continuous, non-repeating stream of tracking data. Data returned by the BX2 command is reported in a new binary format, see “General Binary Format” on page 5. The content is wrapped in the same Binary Reply Format as the BX command. When streamed, the entire response will be preceded by the Streaming Reply Format header, see “Data Streaming” on page 8. No options exist for filtering data returned from the BX2 (page 60) command on the basis of system or tool status or location in the volume. Complete system and tool status information is always included in the reply and it is Warning! the application’s responsibility to interpret this data and ignore those measurements that fall outside of application requirements and constraints. Failure to do so may lead to inaccurate conclusions that may cause personal injury. 66 Polaris Vega Application Program Interface Guide Command Details BX2 Binary Data structured in General Binary Format contains one or more tracking frames, similar to the BX command. It contains up to one full frame sequence of previously unreported data. Each frame will be contained in the Frame Data Component, see “General Binary Format” on page 5. Frame data component will contain various level of tracking data according to the specified BX2 commands. Each type of the tracking data such as 6D, 3D or 2D will be reported again in the General Binary Data Format as separate components. The content of the single frame of data contains various levels of tracking detail. Each lower level of information references the higher-level information, see Figure 5-1. Figure 5-1 Frame Component Overview Example Command: 6D tools (2 passive tools loaded and tracking) Command: BX2 --6d=tools --1d=none Reply: C4 00 00 F0 A5 BF 00 37 64 05 00 BD 00 2E 00 DE 07 38 02 39 D3 CB 00 DE 01 74 34 BD 00 75 00 83 01 57 00 3A Polaris Vega Application Program Interface Guide 00 12 00 B2 01 A2 00 BA 00 D9 00 10 60 00 00 00 00 00 01 00 00 00 02 00 00 2A 01 00 02 00 12 00 0C 00 00 00 00 00 02 00 00 00 03 00 00 20 79 3A 7E 3F 76 95 6A 42 C0 05 F6 C2 BD CA 8C C4 6F 7B 67 Command Details CE 3C 04 00 0D 01 F3 7D This string decodes as: Start sequence Reply length Header CRC 2 Bytes 2 Bytes 2 Bytes Unitless Bytes Unitless 0xA5C4 0x0064 0xD307 100 Bytes GBF version Component count 2 Bytes 2 Bytes Unitless Unitless 0x0001 0x0001 Version 1 1 Component 2 4 2 4 Bytes Bytes Bytes Bytes Unitless Bytes Unitless Count 0x0001 0x00000060 0x0000 0x00000001 Frame Component 96 Bytes Frame Type Sequence Index Frame Status Frame Number Timestamp 1 1 2 4 8 Byte Byte Bytes Bytes Bytes Type GBF version Component count 2 Bytes 2 Bytes Component 1 Component type Component size Item Format Option Item count 1 Item to parse Frame Item 1 0x02 0x00 0x0000 Count 0x382E05BF Seconds 0x577574CB Nanoseconds 0x2AD9A212 Passive OK 942540223 decimal Jun 30 2016 15:36:43 Unitless Unitless 0x0001 0x0002 Version 1 2 Data Components Data Component 1 Component type Component size Item Format Option Item count 2 4 2 4 Bytes Bytes Bytes Bytes Unitless Count Unitless Count 0x0012 0x0000000C 0x0000 0x00000000 System Alerts 12 Bytes 2 4 2 4 Bytes Bytes Bytes Bytes Unitless Bytes Unitless Count 0x0002 0x00000034 0x0000 0x00000002 6D Data Component 52 Bytes 0x0003 0x2000 Handle 3 OK, Face 1 Transform not missing +0.993079722 -0.044907056 -0.108508810 -0.001359776 58.645568848 mm -123.0112305 mm -1126.335571 mm 0.0252053421 mm RMS No System Alert Items Data Component 2 Component type Component size Item Format Option Item count Two 6D Data Items 6D Data Item 1 Tool Handle Handle status 2 Bytes 2 Bytes Q0 Qx Qy Qz Tx Ty Tz Error 4 4 4 4 4 4 4 4 Bytes Bytes Bytes Bytes Bytes Bytes Bytes Bytes Unitless Unitless Unitless Unitless mm mm mm mm 0x3F7E3A79 0xBD37F076 0xBDDE39DE 0xBAB23A83 0x426A9510 0xC2F605C0 0xC48CCABD 0x3CCE7B6F 6D Data Item 2 68 Polaris Vega Application Program Interface Guide Command Details Tool Handle Handle status CRC16 2 Bytes 2 Bytes 2 Bytes Polaris Vega Application Program Interface Guide 0x0004 0x010D Unitless Handle 4 Too Few Markers Transform missing 0x7DF3 69 Command Details COMM Sets the serial communication settings for the system. Operating Mode All modes Compatibility Not currently used in the Polaris Vega System Note For information of previous revisions of the API, refer to the Polaris Application Program Interface Guide (IL1070101) available on the NDI support site at https://support.ndigital.com. Syntax G.003.002 COMM 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 0 9600 bps X 1 14 400 bps X 2 19 200 bps X 3 38 400 bps X 4 57 600 bps X 5 115 200 bps X 6 921 600 bps X 7 1 228 739 bps X The data bits must be set to 8 bits in order to use any command that returns binary data (BX, GETLOG, or VCAP). The default is 8 data bits. Valid Values: 70 0 8 bits X 1 7 bits X Polaris Vega Application Program Interface Guide Parameter Description Parity The default is no parity. G.003.002 Command Details Valid Values: Stop Bits 0 None X 1 Odd X 2 Even X The default is one stop bit. Valid Values: Hardware Handshakin g 0 1 bit X 1 2 bits X The default is no hardware handshaking. Valid Values: 0 Off X 1 On X Replies Upon Success: OKAY On Error: ERROR See page 157 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 VCAP), 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: Polaris Vega Application Program Interface Guide 71 Command Details 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. 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. 72 Polaris Vega Application Program Interface Guide Command Details DFLT Restores the user parameters to factory default values. Operating Mode All modes 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 157 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 119) 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 * Reply: OKAYA896 Polaris Vega Application Program Interface Guide 73 Command Details DSTART Starts Diagnostic mode. Operating Mode Setup Prerequisite Command INIT (page 83) Syntax DSTART Parameter Description Reply Option 80 (Optional) Replies Upon Success: OKAY On Error: ERROR See page 157 for error code definitions. Usage Notes The frame number is reported in reply option 0001 of the TX (page 138) and BX (page 49) commands. In the Polaris Vega System, the frame number is derived from the PTP time, and reply option 80 is ignored. In order to facilitate active tool setup from a monitor connection, DSTART will return OKAY when in diagnostic mode. Example Command: DSTART Reply: OKAYA896 74 Polaris Vega Application Program Interface Guide Command Details DSTOP Stops Diagnostic mode. Operating Mode Diagnostic Prerequisite Command DSTART (page 74) Syntax DSTOP Replies Upon Success: OKAY On Error: ERROR See page 157 for error code definitions. Usage Notes If executed from setup mode, it will return OKAY. Example Command: DSTOP Reply: OKAYA896 Polaris Vega Application Program Interface Guide 75 Command Details ECHO Returns exactly what is sent with the command. Operating Mode All modes Syntax ECHO Replies Upon Success: Exactly what is sent with the command, with . On Error: ERROR See page 157 for error code definitions. Usage Notes The ECHO command can handle a maximum of ~50,000 characters. Exceeding this number will cause the system to return error 02. Example Command: ECHO Testing! Reply: Testing!A81C 76 Polaris Vega Application Program Interface Guide Command Details GET Returns the user parameter values. Operating Mode All modes 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 157 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. 5. For descriptive information about each user parameter, including type, attributes, and possible values, use the GETINFO command. For more information on user parameters, see “User Parameters” on page 20. Polaris Vega Application Program Interface Guide 77 Command Details Example Command: GET Info.Status.New Alerts Reply: Info.Status.New Alerts=08B32 78 Polaris Vega Application Program Interface Guide Command Details GETINFO Returns descriptive information about the user parameters. Operating Mode All modes 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. User parameter names are case-sensitive. Replies Upon Success: = ; ; ; ; ; ; (repeated for each user parameter, but no line feed after last parameter) On Error: ERROR