5520A
Operators Manual
D-2
3. Separate the Command buttons and resize the form for ease of use (below is typical).
4. From the Toolbox, double click the Communications icon , placing the icon on
the Form1 screen. This custom control icon provides complete serial
communications capabilities for this program. Position the icon anywhere on the
Form1 screen that is convenient.
5. Double click on a clear area of the Form1 screen to open the Code window for
Form1. Enter the code shown below. If using COM2 on the PC, change the
command to Comm1.CommPort = 2. If not using the factory default settings for
the RS-232 ports, then change the command Comm1.Settings as required.
Sub Form_Load ()
Comm1.CommPort = 1 [if using COM2, enter = 2]
Comm1.Settings = “9600,N,8,1” [baud, parity, data, stop]
Comm1.PortOpen = True
End Sub
6. While still in the Code window, select Command1 from the Object list. Enter the
code shown below. The Chr(10) means ascii character 10 (line feed).
Sub Command1_Click ()
Comm1.Output = “REMOTE” + Chr(10)
End Sub
7. Select Command2 from the Object list. Enter the code shown below.
Sub Command2_Click ()
Comm1.Output = “LOCAL” + Chr(10)
End Sub
8. Select Command3 from the Object list. Enter the code shown below, where <uut
command> is the command you selected for the UUT response.
Sub Command3_Click ()
Comm1.Output = “UUT_SEND ““<uut command>”” ” + Chr(10)
End Sub
For example, “UUT_SEND ““REMS\n”” ”. Note the use of \n, which indicates a
Carriage Return (CR) as the end-of-line character. Other characters include \r (Line
Feed), \t (Tab), \b (Backspace) and \f (Form Feed). Also note the double quotes
around <uut command> to show embedded quotes.