Using Ethernet or a serial cable, Remote API is a method of communication between a controller and a laser marking engine. The controller can be a PLC, a CPU, or any other device with the capability of relaying commands via the protocol described herein. Properly utilizing the Remote API command set offers the user total control over a laser marking system.
The development of Remote API was pursued to program and control a laser marker with a sequence of commands. This is made possible whether or not a CPU is directly connected to the marking machine. FARO provides several embedded marking controllers, which, in turn, can be used in the absence of a CPU, as well as WinLase software that does run on a CPU, all of which can be controlled with Remote API.
Using an Ethernet or serial cable, it is feasible to remotely monitor and control the functionality of the marking system from basic to advanced operations. There is no need to have a full CPU embedded into a laser marking machine as an embedded FARO controller can help reduce the cost and footprint of a marking solution. It can also minimize the maintenance of the equipment due to the lack of a desktop OS.
Why Use Remote API
Remote API provides laser marking system builders with an edge over their competitors as they have greater flexibility to design exactly how the controls of their system operate, enabling the rapid progression of custom and tailor-made systems.
With the Remote API, custom software can be written that interfaces with multiple networked systems such as databases that permit a robust, dynamic marking system. Alternatively, a PLC can be used to control other systems like automation while controlling a laser marker in parallel. User controls that are simple, complex, or unique can control Remote API commands and effectively show responses to provide a system designer with total control of the look and feel of their equipment. Thus, the Remote API’s adaptability and detailed command set enables a system designer to go beyond the reaches of the limitations of the box fixed to a CPU and generate value by creating systems that focus on customer needs.
Benefits of Using the Remote API
The primary benefits of using the Remote API are:
- A marking engine that is more embeddable
- Increased flexibility of custom user interfaces
- Cost-effective as no PC/CPU with licensed software necessary
A Marking Engine that is More Embeddable
Marking systems require a lot of data, at high speed. This has typically been achieved by connecting a PC/CPU to specialized hardware to communicate to the scanning system and thereby control the laser. Making use of an embedded controller eliminates the space and power cost of the PC/CPU and reduces the footprint of the marking controller to exactly that – the size of the marking controller. This enables a straightforward system to build since the board is a component, rather than a PC/CPU which might need cautious and delicate handling – monitored for updates, viruses, and fully shut down before being powered off.
Increased Flexibility of Custom User Interfaces
System designers are free to design any software or hardware user interface they desire and then create the requisite commands that run the laser marker to complete a wide range of tasks. The command set is identical over RS232 (or RS485) as it is for TCP/IP, so once there is a familiarity with the command set, it can be used over either transport to make variations on the UI without the need for additional changes to the marker interface.
Cost-Effective as no PC/CPU with Licensed Software Necessary
Traditionally a laser marking system comes with custom software that allows the user to create and manage the instructions that it sends down to their controller. FARO has software that does this as well, but with the Remote API, it isn’t required which can reduce the cost of a system that might otherwise need a software license bundled into the price.
How it Works
The Remote API’s protocol is an ASCII encoded message-based communication. The sender's actions all commands, and responses are simultaneously relayed back. The system is polling-based and a line feed terminates all strings of command and response. The commands are numerical, and parameters are divided by commas, while the responses differ based on the command. Responses may consist of an ASCII numerical code, which represents an API response code and could precede additional comma-separated response parameters. Additional response codes are simple strings made up of the value of the requested response.
It is possible for simultaneous connections to be made to the marker, a feature that enables monitoring of the system on one connection while controlling it from another. Or, with astute orchestration, control can be surrendered between the connections for cases of complex administration and use. Some commands require exclusive mode access; this is due to the nature of operating a laser marker and the fact that numerous connections can be made to the system. This is can be accomplished by issuing a ‘take control’ command. With a successful outcome using this command, the subsequent connection can make more advanced calls.
Types of Control
So that new commands can be inserted later, there are multiple groups of commands separated numerically.
- Control Commands – Range 0 – 99
- Object Commands – Range 100 – 199
- Job Commands – Range 200 – 299
- Administration Commands – Range 500 – 599
Control commands control the high-level marking system. They contain commands to abort a running system (for safety), take/release control of the system, and to set configuration parameters such as monitoring system state and safety conditions as well as laser and lens settings. Commands are also available for directly controlling peripherals such as turning the laser on/ off, toggling/monitoring the GPIO, and reading and writing the onboard serial ports to control serial-attached peripherals.
Object commands influence objects which are present in the loaded marking job. These commands enable the acquisition and setting of strings and numeric values, alter the way the object is marked as well as changing location and size. Some commands allow for the addition and removal of objects as well as transforming (distorting/rotating) them.
Job commands are for loading or saving jobs to RAM or flash storage. They also start executing either continuously or singly. By setting them to wait for an external IO bit or not, it is possible to adjust the runtime behavior of jobs. This set of commands enables the management of how many jobs are ‘active’ for marking and select between them. Job attributes and the creation of new jobs also have a series of relevant commands.
Configuring a system can be done with administration commands but are less often used in this way than the control commands. This set of commands is better-suited to the overall system configuration rather than everyday functionality. Commands include the settings of the COM ports, setting/reading the current date and time of the system, setting/reading the network settings and giving the device a ‘nickname’.
In this simple example, we sum up a case of monitoring a running system. What this means is that there is an additional means of control. FARO provides embedded LEC products, which are equipped with the capability of stand-alone marking when selecting marking jobs and the start/stop marking process using IO lines.
This example disregards the initial phase of marking but shows how to monitor the status over TCP/IP.
Supposing the device has an IP address of 10.10.10.5. The subsequent ‘pseudo code’ describes (OS independent) the steps associated with connecting to and monitoring the marking engine.
Connect (IP=“10.10.10.5”, port=12500)
// assume the connection is OK
Connection->Send(“209\n”) // send the “GetJobStatus” command
Result = Connection->Receive (until new line character in ASCII is found)
If Result = “JobIdle”
Then // There are no commands currently being executed
If Result = “Busy”
Then // The job engine is currently marking or active with commands
This information has been sourced, reviewed and adapted from materials provided by FARO Technologies Inc.
For more information on this source, please visit FARO Technologies Inc.