363
APPENDICES
A
Appendix 9 Sample Program on the Connected Device Side
Appendix 9.2 When Visual Basic
(R)
.NET is used
(4) Sample program on the connected device side
The program example of the connected device accessing the L02CPU in the E71-connected station is described.
In this program, data of D0 to D4 (five points) in the L02CPU in the E71-connected station are read with an A-
compatible 1E frame command (01: Batch read in word units). The following are basic operation procedures:
• Sending a command with the line disconnected (Connect the line. After completing the connection, the E71
sends a command.)
• Reconnecting the line with it connected (Disconnect the line. After the disconnection is completed, reconnect
it.)
The following is an outline of how to compile a program created using Microsoft
Corporation Visual Basic
.NET.
• Start Visual Basic
.NET.
• Create a project. From [File][New][Project], select "Visual Basic Project" in "Project Types" and "Windows
Application" in "Templates", and set the project name (e.g. AJSAMP) and location.
• Create a form and a program. Use the toolbox "Button" to create the sample window shown below (Form1.vb) and
create a program referring to the sample program.
• On the Build menu, click Build Solution to create an execution file (AJSAMP.EXE).
• Exit the Visual Basic
.NET.
• Execute the AJSAMP.EXE.
[Window example (Form 1.vb)]
(Object name)
Button5:
Checks the connection status.
Button4: Ends the program.
Button3: Cut off the line.
Button2: Sends the A-compatible 1E frame command
(reading in units of words).
Button1: Connects the station with the E71.