11
9. Generating a Script
9.1
What is a Script?
A Script is a sequence of commands, that are executed in that exact order. Because of the fact that also mechanisms are given
that control the program flow in the Script it is also possible to assemble more complex processes from these simple commands.
The Script is memory-oriented. It means that all variables always refer to one memory area. While developing a Script you do not
have to take care of the memory management though. The Protocol Developer takes on this responsibility for you.
9.2
Memory efficiency of the programs
A Script command can carry out e. g. a complex checksum like a CRC-16 calculation via data. For the coding of this command
only 9 byte are required as memory space (for the command itself). This is only possible when these complex commands are
contained in a library.
A further advantage of this library is, that the underlying functions have been in practical use for a couple of years and therefore
can be described as ’void of errors’. As these commands are also present in the native code for the controller, at this point also
the runtime performance of the Script is favorable.
9.3
What can you do with a Script device?
Our Script devices are in the position to process a lot of commands. In this case a command is always a small firmly outlined task.
All commands can be put into classes or groups. A group of commands deals with the communication in general. This group’s
commands enable the Gateway to send and receive data on the serial side as well as on the bus-side.
9.4
Independence of buses
Basically the Scripts do not depend on the bus, they are supposed to operate on. It means that a Script which was developed on
a Profibus Gateway can also be operated on an Interbus without changes, since the functioning of these buses is very similar. In
order to also process this Script on an Ethernet Gateway, perhaps further adjustments have to be made in the Script, so that the
Script can be executed reasonably.
There are no fixed rules how which Scripts have to operate properly. When writing a Script you should take into account on which
target hardware the Script is to be executed, so the necessary settings for the respective buses can be made.
9.5
Further settings at the Gateway
Most devices require no further adjustments, except for those made in the Script itself. However, there are also exceptions to it.
These settings are made by means of the software WINGATE. If you know our Fieldbus Gateway-series, you are already familiar
with the proceeding with it. An example is the adjustment of the IP-address and the net-mask of an Ethernet-Gateway. These
values have to be known as fixed values and are not available for the runtime. Another reason for the configuration of the values
in WINGATE is the following: After an update of the Script these values remain untouched, i. e. the settings that were made once
are still available after a change of the Script. Only this way it is also possible that the same Script operates on different Ethernet-
Gateways, that feature different IP-addresses.
9.6
The use of the Protocol Developer
The software tool Protocol Developer can be downloaded from our website http://www.wenglor.com
It is a tool for an easy generation of a Script for our Script Gateways. Its operation is exactly aimed at this use. After starting the
program the Script that was loaded the last time is loaded again, provided that it is not the first start.
Typical for Windows Script commands can be added by means of the mouse or the keyboard. As far as defined and required for
the corresponding command, the dialog to the corresponding command is displayed, and after entering the values the right text
is automatically added to the Script. The insertion of new commands by the Protocol Developer is carried out in a way that existing
commands will not be overwritten. Generally a new command is inserted in front of the one where the cursor is positioned. Of
course the commands can also be written by means of the keyboard or already written commands can also be modified.
Sensoren für Ihren Erfolg
www.
wenglor
.com
Sensoren für Ihren Erfolg
www.
wenglor
.com