
21.4.11
UNIGATE fieldbus gateway for Fast Ethernet V. 2.1
17
Deutschmann Automation GmbH & Co. KG
Generating a script - only for UNIGATE SC-Fast Ethernet
7
Generating a script - only for UNIGATE SC-Fast Ethernet
7.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.
7.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.
7.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 gate-
way to send and receive data on the serial side as well as on the bus-side.
7.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.
The Ethernet gateway has 4 communication channels.
For the channels the following adjustments in the script in each case have to be made:
* The port numbers (Destination-Port and Source-Port)
* At client operation TCP or at UDP the destination-IP-address
* The mode or the protocol of the channel:
0 = TCP-server,
1 = TCP-client,
2 = UDP,
3 = Channel not used (closed)
WIthout these settings a connection to the gateway cannot be set up via the Ethernet. Only
ICMP-data traffic (PING) is possible.