Teledyne LeCroy Windows-based oscilloscopes include a feature called the Remote Control Assistant (RCA), which monitors and logs remote control commands received by the oscilloscope. Command errors, or received commands that cannot be executed, are flagged as errors with descriptive text describing the nature of the error. The RCA is an extremely helpful tool for debugging remote control programs intended to control the oscilloscope remotely. Figure 1 shows an example of the RCA setup, log, and event detail popup.
The RCA has several modes of logging operation: Off, Errors Only, and Full Dialog. In Errors Only mode, the RCA will keep a log of any mistakes in the commands received, and display the error when detected. In Full Dialog mode, all commands and responses are logged. This is the mode shown in Figure 1. The default mode is Errors Only.
The RCA can be set up, monitored, and cleared via the oscilloscope’s Utilities pull-down menu or via remote control. From the screen, use the Utilities pull-down menu, select Utilities Setup, and then the remote tab. From this point, the log mode can be selected, and any errors (or the entire dialog) can be viewed by pressing the Show Remote Control Log button.
Pointing at any entry in the log, right clicking the mouse, and selecting Properties will invoke the Event Detail pop up with detailed information on the reported error.
To operate the RCA by remote control, use the command COMM_HELP (or its short form: CHLP) and COMM_HELP_LOG (CHL).
CHLP is used to set up the logging mode and accepts an argument that determines the mode: OFF, EO, and FD, for Off, Errors Only, and Full Dialog, respectively. The remote query CHL? returns the contents of the log, in comma-delimited format. Use the command CHL? CLR to both read and clear the RCA.
The log in Figure 2 shows examples of several types of errors. For example, the line “at token : unknown command” indicates that VDV is not recognized (in this case, VDIV is the correct command). Some of the errors in Figure 2 are obvious (such as “700MVV”, which should be “700MV”), but there are many potential errors that can be harder to find. For example, the correct syntax for “MAXPT 10000” is “MAXPTS, 10000”.
While the Remote Control Assistant is best used during the development stage of a program, users may want to utilize additional commands and registers that report remote control errors once the application is running smoothly. In this way, remote control errors caused by communications problems (such as faulty or noisy cables) can be detected and trapped in error-handling subroutines.
The CMR? and EXR? queries report error conditions, such that a value greater than 0 indicates that either a command or execution error has occurred. See the Remote Control manual for information on interpreting the results of these queries. Service Request (SRQ) users can also set up the oscilloscope such that a remote control error generates a valid SRQ condition and notifies the remote controller.
Coding errors can be subtle, and commands that have been sent erroneously do not necessarily cause a user’s program to misbehave in any obvious way.
For example, if a program continually adjusts the volts per division setting with the VDIV command (perhaps to match the voltage range of a predictably changing input signal), but in one case has programmed “VDV” by mistake, the oscilloscope will still successfully trigger, perform math, transfer data, and so on. If the desired change in the volts per division setting is small, then such an error might go undetected.
An error in setting the memory length via the MSIZ command can cause the oscilloscope to select a smaller sample rate than desired, with potentially undesirable consequences such as inaccurate or incorrect parameter measurements and aliasing.
Careful programming can help the user avoid the problems discussed above (i.e., through the use of subroutines and string constants). Frequently, the user is not the original programmer and is adapting someone else’s code, or is modifying a driver written for a different instrument. In such circumstances, the value of the Remote Control Assistant is readily apparent.