With the OBR 4600 and OVA 5000/5100 product lines, there is built in functionality to remotely (or locally) control and automate the software. The User Manuals for these products contain extensive detail on both how to set up a connection to the software and by extension the instrument, as well as the commands that are available. There have been some changes in best practices for remote access to these Luna instruments and this article will serve as an explainer.
SendCmd.exe Background and Deprecation Notice
In past releases, a program called SendCmd.exe was included with software releases and is referenced extensively in those User Manuals. Examples are given of how to use it to remotely control the OVA and OBR instruments. SendCmd.exe was a helper program meant to let users test Luna remote commands from the Windows Command Prompt. It opened a TCP/IP connection to the PC controlling the Luna device, sent the specified command, and printed any response to the command line. The intention was for users to get familiar with how the remote commands worked by using SendCmd.exe before writing their own software using the TCP/IP capabilities of their chosen programming language. Unfortunately, the User Guide examples gave the impression that SendCmd.exe was required in order to communicate with Luna devices. There have been numerous users that report writing software that initiated a SendCmd.exe process for every command they wanted to send, and attempted to parse the response printed in the Windows Command Prompt. This was never the intended usage of SendCmd, and is an inefficient way to communicate with the Luna device. This approach opens and closes a TCP/IP connection for every command sent, and makes it more difficult to parse the command responses than if the software made its own direct TCP/IP connection without going through SendCmd.exe.
SendCmd.exe had an additional problem: it attempted to print a list of valid commands and refused to send any command that it thought was invalid or formatted incorrectly. This meant that there were different versions of SendCmd for the OVA and the OBR (although both named SendCmd.exe). It also meant that SendCmd.exe had to be updated any time a new command or command parameter was added to the OVA or OBR software. Otherwise, the old SendCmd would think the new command was invalid and would refuse to send it. This meant that there were multiple versions of SendCmd (all simply named SendCmd.exe) that would only operate correctly with the product and software version that they were released with. This confusion made the fact that customers were writing software around initiating SendCmd processes even more difficult. For all of these reasons, SendCmd.exe has been discontinued. Luna software and application engineers have created example code in Python to show how to create a connection and how to send commands and retrieve responses from the instrument. This example code can be used as a starting point to write deployable code in a production environment.
Sample Code available
Please submit a support ticket at https://support.lunainc.com to be connected with an Applications Engineer and request a copy of the most up-to-date Remote Commands example code package. Readily available is some Python code. Our Applications Engineers may be able to provide additional support in other languages, depending on your application. We understand the desire for a self-service approach to obtaining these code samples. An effort is currently in-progress to have download links on the product pages for the OVA and OBR product lines.