Format of Programs The example programs in this manual, and the utility programs provided by Omron Adept with your system, provide examples of programming format and style. Notice that Omron Adept programs contain numerous comments and blank lines. When program lines are entered, extra spaces can be entered between any elements in the line. The eV+ editors add or delete spaces in program lines to make them conform with the standard spacing. The editors also automatically format the lines to uppercase for all keywords and lowercase for all user-defined names.
When you complete a program line (by entering a carriage return, moving off a line, or exiting the editor), the editor checks the syntax of the line. If the line cannot be executed, it is displayed in red in the ACE editor. Certain control structure errors are displayed in the status bar of the editor and the program is marked as not executable. (Error checking stops at that point in the program. Thus, only one control structure error at a time can be detected.) Program Organization The first step of every eV+ program must be a .PROGRAM instruction. This instruction names the program, defines any arguments it receives or returns, and has the format:
.PROGRAM program_name(parameter_list) ;Comment The program name is required, but the parameter list and comment are optional. After the .PROGRAM line, there are only two restrictions on the order of other instructions in a program. l AUTO, LOCAL, or GLOBAL instructions must precede any executable program instructions. Only comment lines, blank lines, and other AUTO, LOCAL, or GLOBAL instructions are permitted between the .PROGRAM step and an AUTO, LOCAL, or GLOBAL instruction. l The end of a program is marked by a line beginning with .END. The eV+ editors automatically add this line at the end of a program. 1 Program Variables eV+ uses three classes of variables: GLOBAL, LOCAL, and AUTO.
These are described in detail in Variable Classes on page 47. 1 The .PROGRAM and .END lines are automatically entered by the Omron Adept-supplied eV+ program editors. If you use another text editor for transfer to a eV+ system, you MUST enter these two lines. In general, any editor that produces unformatted ASCII files can be used for programming. eV+Language User's Guide, v2.x, 18318-000 Rev A Page 23