Basic EMACSYS Programers Interface

BEPI is a powerful yet simple programming language which can be used within EMACSYS applications to interact with inputs and outputs. It also introduces the concept of virtual I/O which can be used by the programmer to control program flow.

The language is designed to be simple and easy to learn and as such it does not have the complexity of other high level languages. This simplicity is deliberate. It means that it is quick to learn and even those with little or no experience of programming can product applications with a very short learning curve.

For those with experience of programming it is powerful method of customizing their EMACSYS. For those without experience it is a great introduction to the subject with the reward of achieving a practical result.

BEPI programs are written in a text editor such as Notepad and then compiled and downloaded using the BEPI Compiler. This can also be used to monitor EMACSYS inputs and outputs and the variables.

BEPI Structure

A BEPI program consists of 3 section: Declaration of variables, the main program section and subroutines. All three sections will reside in a single file:

Variables

End

Start

End

sub SubroutineName

subend

The only section which is manatory is the main section (Start.......End) although only the most trivial programs will not need variables.

Examples are provided with the compiler application but can be viewed on the following links:

  • Variables are always global and so there is no need to declare local varaibles.
  • Only 3 types of variable, 1 byte, 2 bytes and 4 bytes all unsigned.
  • Single dimension arrays of any of the available data types.
  • Single comparison ‘if’ statements with optional ‘else’.
  • ‘for’ loops nested up to five levels.
  • Direct access to all digital and analogue I/O.

Features

  • Example 1 is a very simple application in which the outputs follow inputs.
  • Example 2 shows how the virtual I/O can control outputs.
  • Example 3 shows how inputs and virtuals can control outputs and introduces ‘if’ statements
  • Example 4 flashes an output and introduces the ‘if’ ... ‘else’ statement.
  • Example 5 uses the Real Time Clock to control outputs.
  • Example 6 expands on Example 5 to show how the virtuals can be used to manipulate data.
  • Example 7 is a more complex application which introduces ‘for’ loops and arrays.
  • Example 8 repeats the functionality of Example 7 but introduces subroutines.

BEPI

 

 

BEPI