Precise Flow · Calibration · Test Equipment
German

S320 Controller – programming

The S320 Controller can be programmed by the PC by a serial link interface. A high-level language similar to Pascal is used, which is easy to learn and use. The PC sets up the program and transfers the data.

 

All functions of the S320 Controller are available in high-level language. Special system knowledge is not required. Provided libraries allow a quick programming. All development tools are included as standard with delivery! Therefore the S320 Controller is the tailored solution for your task – from measurement value acquisition to the evaluation of data on to controllers. And by the integrated interfaces it communicates practically with any type of partner!

 

In addition to the common functions of a high-level language as mathematical calculations and text manipulation, the development environment includes a number of ready-made functions as, e.g. linearizations, controller routines, determination of material values. As a result of this, complex measurement technique tasks can be realized quickly and reliably.


CPU of the S320 Controller
CPU of the S320 Controller

S320 programming with SPELL-OS

- High-level language similar to Pascal -

  • Pascal – widely-used
  • Easy learning and implementing
  • Efficient object code
  • Supplied libraries
  • Development tools are included in the scope of delivery

The S320 Controller can be programmed comletely free similar to a PLC. SPELL is used as programming language. SPELL is closely aligned to the well-known and widespread language PASCAL.

 

The language can be easily used, it is suitable also for more complex tasks and it generates efficient program codes compared with known interpreter languages. Furthermore, the language allows a far-reaching error check even during compilation thanks to its strict syntax.

Compared to standard Pascal according to ISO 7185, the language implemented in S320 Controller contains some modifications, extensions and also reductions, which serve to extremely satisfy the range of application, special features and efficiency of the S320 Controller. The differences to standard Pascal are described in corresponding chapters or are indicated as such within the text.

A first SPELL program is used for introduction, which reads a voltage and a current using an AD converter, calculates the capacity and displays all three measurement sizes including units.

 

Programming sample – directly executable

PROGRAM CalculateElectricPower;       {First program       }

INCLUDE "STDLIB";                     {Standard functions  }

VAR Voltage         : FLOAT;          {Variable declaration}
    Current         : FLOAT;
    Power           : FLOAT;
    chaVoltage      : PortHandle;     {Channel declaration }

    chaCurrent      : Porthandle;

BEGIN                                 {Main program        }
  chaVoltage := OpenPort("Voltage");  {Initialize AD conv. }
  chaCurrent := OpenPort("Current");
  ShowString(TopRight,  "Volt");      {Display units       }
  ShowString(MidRight,  "Amp ");
  ShowString(BotRight,  "Watt");

  REPEAT                              {Calculation loop    }
    Voltage  := AnalogIn(chaVoltage); {Read voltage        }
    Current  := AnalogIn(chaCurrent); {Read current        }
    Power    := Voltage * Current;    {Calculate el. power }

    ShowFloat(TopLeft,Voltage,4,2);   {Display voltage     }
    ShowFloat(MidLeft,Current,4,2);   {Display current     }
    ShowFloat(BotLeft,Power,4,2);     {Display power       }
  UNTIL False;                        {Endless loop        }
END.                                  {End of program      }

Analog and digital converters

are indicated with names in the device configuration and they can be scaled already in such a way, that the physical values can be read immediately. Using the function OpenPort a channel number is assigned to the channel according to its name. The port can be accessed by this channel number, here with AnalogIn.

The functions ShowFloat or ShowString are for the output of the results on the corresponding displays. In the case of ShowFloat the flow point number is displayed here with four pre-decimal places and two post-decimal places.

S320 Controller
SPELL-OS

Programming
similar to Pascal!

More information and technical details can be
found in the data sheet