Vehicle Spy Text API
Objective
The purpose of the Text API is to provide a simple text based command set for Vehicle Spy 3 to allow third party applications to take advantage of the power of Vehicle Spy without rewriting much code. The Text API command set is text based so it can be easily used over many interfaces such as RS232, USB, Ethernet, or Wireless. It is also independent of the operating system or development environment of the host. The command set is similar to what may be found in a programmable instrument consisting of commands and responses. You can easily write an object or function wrapper around the Text API. This will allow a more convenient use in professional languages such as C#, Visual Basic, LabVIEW, or C/C++. The Text API could also exist as a simple macro language itself.
Tips for Learning
The best way to learn the Text API is to experiment. The Text API terminal in Vehicle Spy 3 is a great tool for this purpose. Also, because most of the commands are based on the XML tags, you can just open the vs3 file in a text editor to see what properties can be manipulated via this extremely flexible API.
Summary of Rules
All commands start with the default root object.
Commands are separated by a <CR>,<LF> or <CR><LF> combination.
Commands are case insensitive. Arguments can be case sensitive if they are text based such as Description properties.
All objects and properties have the same text as their XML element names. Properties can be changed by calling out the property and supplying an argument. Property values can be returned by using a question mark ? to query the property.
The following rules are not yet supported
There is special encoding to support non ASCII, extended characters, the % escape character, and the ; comment character. Where % will be followed with the Text number in four digit hex form. For example, %000D would equal CR, %000A would be <LF>. The four digit Text allows Unicode support for text arguments such as descriptions.
The comment character is the semicolon. After the semicolon all characters are ignored until the next command.
The Text API is available as UNICODE via the Vehicle Spy 3 DLL.
Command and Queries
The basic communication consists of commands and queries. Commands set a property or execute a method. Queries request a property. Commands and Queries will return one of two of possible responses: ok or er. "ok" means that the command completed successfully. "er" means there was a problem with the command. The ok will have text following the command that indicates what command completed and any return values. Events can be either asked for with a method or can appear asynchronously in the receive stream. You also must specify, or "register", which events you wish to receive.
Table 1: Syntax of Commands, Queries, and Events
Examples:
A successful start command Host: Start Vehicle Spy 3:ok start A unsuccessful root command Host: Startasdf Vehicle Spy 3: er command not found:startasdf A successful query Host: AutoDetectHardware? Vehicle Spy 3: ok autodetecthardware 1 example: LoadFile Method This command starts with root object and ends with a carriage return. Host: loadfile text.vs3<CR> Vehicle Spy 3: ok loadfile
neoVI PRO Text API
The neoVI PRO supports two APIs, first is the Text API and the second is the neoVI RAW API. The Text API is the default API on the USB, COM, and Ethernet (via TCP) ports; therefore, all of the Text API commands here work with the Vehicle Spy 3 code running in the neoVI PRO.
Using the Text API
The following table indicates how you can interact with the Text API.