Professional Documents
Culture Documents
FST4 Manual
FST4 Manual
Contents
1
2.3.10
Downloading an Update of the Project to the Controller...................... 29
2.3.11
Uploading Project Sources from the Controller.................................... 29
2.3.12
Listing the Compiled Project File .......................................................... 31
2.3.13
Removing Intermediate Files ................................................................ 31
2.3.14
The Project Documentation .................................................................. 31
2.4
Printing Projects ............................................................................................... 31
2.4.1
Print Preferences ...................................................................................... 33
2.4.2
Project Backup and Restore..................................................................... 34
2.5
Managing Control Programs............................................................................ 34
2.5.1
Creating New Programs ........................................................................... 34
2.5.2
Importing Modules from the Library ......................................................... 36
2.5.3
Program Properties................................................................................... 37
2.5.4
Deleting a Program ................................................................................... 38
2.5.5
Open a Program for Editing...................................................................... 39
2.5.6
Compiling a Program ................................................................................ 39
2.5.7
Selecting Programs for Download............................................................ 40
2.6
Controller Settings ........................................................................................... 41
2.6.1
Run Mode (Controller Settings)................................................................ 41
2.6.2
Drives (Controller Settings) ...................................................................... 43
2.6.3
Options (Controller Settings) .................................................................... 44
2.6.4
Password (Controller Settings)................................................................. 45
2.6.5
Download (Controller Settings) ................................................................ 45
2.7
The IO Configuration........................................................................................ 46
2.7.1
The IO Configuration Window .................................................................. 46
2.7.2
Adding and Editing IO Modules ................................................................ 47
2.8
The Driver Configuration.................................................................................. 49
2.8.1
The Driver Configuration Window ............................................................ 49
2.8.2
Adding a New Driver................................................................................. 50
2.8.3
Editing Driver Options ............................................................................... 51
2.9
The Allocation List............................................................................................ 52
2.9.1
The Allocation List Editor .......................................................................... 52
2.9.2
Adding and Editing Allocation List Entries ............................................... 53
2.9.3
Selecting an Operand from the Allocation List......................................... 54
2.10
Online Mode ................................................................................................. 54
2.10.1 Connecting the Controller to the PC for Online Mode ............................. 55
2.10.1.1 Communication Port Preferences ..................................................... 55
2.10.2 The Online Control Panel ......................................................................... 56
2.10.3 Entering the Controller Password............................................................. 57
2.10.4 Changing the Controller Password........................................................... 58
2.10.5 The Online Display ................................................................................... 58
2.10.6 Online Goto............................................................................................... 60
2.10.7 Changing the Online Display Format ....................................................... 60
2.10.8 Changing the Update Interval of the Online Display ................................ 60
2.10.9 Modifying Online Display Operand Values .............................................. 61
2.10.10
File Transfer .......................................................................................... 62
2.10.11
The Online CI Terminal......................................................................... 63
2.11
Programming in Statement List.................................................................... 64
2.11.1 The Statement List Editor ......................................................................... 64
2.11.2 The Shortcuts Window ............................................................................. 67
2.11.2.1 Inserting Module Calls ....................................................................... 67
2.11.2.2 Statement List Preferences............................................................... 68
2.11.3 Statement List Online ............................................................................... 69
2.11.4 Statement List Program Structure............................................................ 70
2.11.4.1 Step program ..................................................................................... 70
2.11.4.2 Parallel logic program........................................................................ 71
2.11.4.3 Executive part .................................................................................... 72
FST Version 4.02.21 Manual
3.4.11
Commands for forcing inputs and outputs.......................................... 106
3.4.12
Commands embedded in drivers........................................................ 108
3.5
The Real-time Clock ...................................................................................... 108
3.5.1
Setting the clocks manually .................................................................... 109
3.5.2
Function modules for setting and reading the real-time clock............... 109
3.6
Miscellaneous ................................................................................................ 110
3.6.1
Mass storage for programs, drivers and files ......................................... 110
3.6.2
RAM for programs and drivers ............................................................... 110
3.6.3
Function blocks ....................................................................................... 111
4 FST Drivers Reference.......................................................................................... 113
4.1
Input and output modules .............................................................................. 113
4.1.1
PLC security............................................................................................ 113
4.1.2
Digital input and output modules ............................................................ 114
4.1.2.1
IMXX ................................................................................................ 114
4.1.2.2
OMXX ............................................................................................. 117
4.1.2.3
TM10............................................................................................... 125
4.1.2.4
ASXX .............................................................................................. 125
4.1.2.5
Address assignment matrix............................................................ 127
4.1.3
Analog input and output modules ........................................................... 129
4.1.3.1
IO1X................................................................................................ 130
4.1.3.2
IO4X................................................................................................ 132
4.1.3.3
I06X................................................................................................. 137
4.1.3.4
IO7X................................................................................................ 137
4.1.3.5
Address assignment matrix............................................................ 139
4.2
FEC and HC0x ............................................................................................... 140
4.2.1
Local Ios .................................................................................................. 140
4.2.1.1
FEC Standard................................................................................. 140
4.2.1.2
FEC Compact................................................................................. 141
4.2.1.3
HC0X .............................................................................................. 141
4.2.1.4
Debouncing of Inputs ..................................................................... 141
4.2.2
IO extension ............................................................................................ 141
4.2.3
Analogue Potentiometer ......................................................................... 142
4.2.4
Rotary Switch.......................................................................................... 142
4.2.5
Fast counters.......................................................................................... 142
4.2.6
Incremental Encoder............................................................................... 143
4.3
Actuator Sensor Interface.............................................................................. 144
4.3.1
The ASi configurer .................................................................................. 144
4.3.2
CI commands.......................................................................................... 146
4.3.3
Error numbers......................................................................................... 147
4.3.4
Function modules ................................................................................... 147
4.4
Festo Fieldbus Master ................................................................................... 148
4.4.1
Set Festo fieldbus parameters ............................................................... 148
4.4.2
Soft error behaviour ................................................................................ 149
4.4.3
Using the nominal configuration............................................................. 149
4.4.4
The Festo fieldbus configurer ................................................................. 149
4.4.5
Programming fieldbus operands ............................................................ 152
4.4.6
Function blocks ....................................................................................... 153
4.4.7
CI commands.......................................................................................... 156
4.4.8
Error numbers......................................................................................... 156
4.5
Festo Fieldbus Slave ..................................................................................... 156
4.5.1
Selecting the driver and assigning parameters...................................... 156
4.5.2
How to use the module FBSLAVE ......................................................... 157
4.5.3
Cyclic updates......................................................................................... 158
4.5.4
Get status................................................................................................ 158
4.5.5
A-cyclic updates...................................................................................... 158
4.5.6
Sample program ..................................................................................... 159
FST Version 4.02.21 Manual
4.6
Profibus DP (CP62) ....................................................................................... 159
4.6.1
Selecting the driver and assigning parameters...................................... 159
4.6.2
Configuration........................................................................................... 160
4.6.3
Error messages from the driver.............................................................. 160
4.6.4
Modules................................................................................................... 161
4.7
Profibus FMS (CP62)..................................................................................... 162
4.7.1
Configuring the driver and assigning parameters .................................. 162
4.7.2
Extended CI commands for PROFIFMS ................................................ 162
4.7.3
Function modules ................................................................................... 162
4.7.4
Object directory....................................................................................... 163
4.7.5
Error return codes from function modules.............................................. 165
4.7.6
Error codes in status variable................................................................. 165
4.7.7
Heterogeneous networks........................................................................ 165
4.8
FEC Remote I/O Expansion .......................................................................... 166
4.8.1
System Overview .................................................................................... 166
4.8.2
Configuring Slave FECs ......................................................................... 167
4.8.3
Configuring the Master FEC................................................................... 167
4.8.4
Master at Runtime .................................................................................. 168
4.8.5
Slave at Runtime .................................................................................... 168
4.8.6
Diagnostic Program Module (REMDIAG)............................................... 169
4.9
File Handling Modules ................................................................................... 169
4.9.1
Operation result codes ........................................................................... 174
4.10
Strings......................................................................................................... 175
4.10.1 Configuring the driver and assigning parameters .................................. 175
4.10.2 Initialisation of strings ............................................................................. 175
4.10.3 Extended CI commands for strings ........................................................ 176
4.10.4 Modules for handling strings .................................................................. 176
4.11
Screen and Keyboard................................................................................. 184
4.11.1 Introduction ............................................................................................. 184
4.11.2 Operation of the user interface............................................................... 185
4.11.3 Functionality ............................................................................................ 185
4.11.3.1 Attributes.......................................................................................... 186
4.11.3.2 Feature flags .................................................................................... 187
4.11.4 Configuring the driver and assigning parameters .................................. 187
4.11.5 Initialising the user interface................................................................... 188
4.11.5.1 Initialising the user interface in text form ........................................ 188
4.11.5.2 Statements for screen pages .......................................................... 188
4.11.6 Extended CI commands for the user interface....................................... 189
4.11.7 Modules for accessing the user interface............................................... 190
4.11.8 Complete example.................................................................................. 195
4.11.9 Special applications ................................................................................ 199
4.12
32-Bit Arithmetic ......................................................................................... 199
4.13
Incremental Encoder .................................................................................. 201
4.13.1 Init/Reset................................................................................................. 201
4.13.2 Read counter registers (values) ............................................................. 201
4.13.3 Load counter 1 with new value ............................................................... 202
4.13.4 Load counter 2 with new value ............................................................... 202
4.13.5 Load counter 3 with new value ............................................................... 202
4.14
Fast counters.............................................................................................. 203
4.14.1 Using the module FECCNTR ................................................................. 203
4.14.2 Required drivers ..................................................................................... 203
4.14.3 Reset of a Fast Counter ......................................................................... 203
4.14.4 Defining the operation of a Fast Counter ............................................... 203
4.14.5 Starting a Fast Counter .......................................................................... 205
4.14.6 Status of a Fast Counter......................................................................... 205
4.15
Positioning .................................................................................................. 205
FST Version 4.02.21 Manual
4.18.9
Data received by handlers ................................................................. 238
4.18.10
Time offsets......................................................................................... 239
4.18.11
Error codes.......................................................................................... 239
5 Help Topics............................................................................................................ 240
5.1
Navigating Using the Table of Contents ........................................................ 241
5.2
Looking for Index ........................................................................................... 242
5.3
Finding Information with Full-Text Search..................................................... 242
6 Index ...................................................................................................................... 246
7 Modules ................................................................................................................. 248
7.1
32 Bit Arithmetik ............................................................................................. 248
7.2
AS-Interface modules .................................................................................... 248
7.3
Modules for accessing the user interface...................................................... 248
7.4
File Handling Modules ................................................................................... 248
7.5
Get date and time modules............................................................................ 249
7.6
FEC Remote E/A-Erweiterung....................................................................... 249
7.7
Function blocks .............................................................................................. 249
7.8
Festo Fieldbus Slave Module ........................................................................ 249
7.9
Incremental Encoder for FEC and HC0X CPUs............................................ 249
7.10
Profibus DP (CP62) Modules DP............................................................... 249
7.11
Profibus FMS Drivers ................................................................................. 249
7.12
Positioning with AM10, AM11 or AM20 or AM30....................................... 250
7.13
Function blocks to control the execution of programs............................... 250
7.14
Serial communication ................................................................................. 250
7.15
Further modules ......................................................................................... 250
7.16
Fast Counter for FEC and HC0x ................................................................ 250
7.17
String modules............................................................................................ 250
7.18
Modules for TCP/ IP ................................................................................... 252
Release Notes
Known Problems
If you want to make a printout of the entire Online Help it is suggested to use the PDF version.
1.3.2 EXTERNAL TOOLS
This version of FST 4 still uses some DOS programs, e.g. the OWS tools. Some of these
programs will not work correctly if the current FST project is stored in a path that is not
according to DOS rules, i.e. no spaces, max. 8+3 characters per folder name. Please use a
project path that is according to DOS rules if you want to use these programs.
On Windows 2000 all DOS tools are troublesome and the mouse does not work.
It is currently not possible to use Ethernet for the online features of the fieldbus configurators.
1.3.3 TCP/IP
Before you can use TCP/IP for programming (download) and online displays you once have
to download a project including the TCPIP driver via the RS232 connection.
When using TCP/IP for downloading a project, please make sure not to select the option
"Delete project before download" in the Controller Settings, since this will also stop the
TCP/IP driver.
When setting a password for the controller this will prevent modifications for both, serial
and TCP/IP access.
1.3.4 IO1x/IO4x
Use the versions with a suffix "N" together with kernel 2.23.01 or later only. The versions
without "N" will work with any kernel 2.2x, but may block the PLC cycle on defective or
missing hardware. Therefore they are no longer included in the FST standard installation. If
required you can install them from the folder \OLDLIB of the installation CD-ROM. If an
upgrade of your CPU module is required please contact your local Festo dealer.
1.1.1 HC1X + RTC + DRAD + FESTOBUS
When the HC1X is equipped with a ZL16/ZL17 chip, accessing the real-time clock the FST
modules F1x will cause the Festo fieldbus IO update to stop after some time. The problem is
under investigation.
1.1.2 HC2X + AS-INTERFACE (CP96)
Only up to two CP96 modules with the switch settings KSW=1 and KSW=4 can be used
together with the HC20 CPU. The switch positions KSW=2 and KSW=3 lead to memory
conflicts.
1.1.3 HC2X + OM22 PLC SAFETY
Only IO modules OM22 with a version of P16 or higher can be operated in PLC Safety mode
on the HC20 CPU.
1.1.4 FIND & REPLACE
When using the Find or Replace function of the STL Editor, the Allocation List Editor or the
Message Window please close the Find/Replace dialog box before closing the editor/message window from which you opened the Find/Replace dialog. The dialog box will
only work for the editor window from which it was opened. If you want to search in another
window please close the dialog box and reopen it again after you have selected the other
editor window.
10
11
1.5
The local IO for FEC and HC0X controllers are now automatically added to the IO configuration by default for new projects.
Bug fixes since FST 4.01.16
Longer timeouts for CI communication allow connection to busy CPUs.
Out of range constants in STL are no longer ignored.
Allow switching program status in online display even with fast update speed.
Direct printing of source code programs that are not selected for download is now
possible.
Sorted printout of source code and compilation log.
Correct display of large timer values.
Regard special case for EW in online display user defined tab.
Enable switch selection for IO modules only if more than one choice possible.
Sorted print out of cross-reference list.
1.6
What is new compared to FST 3
Note! Changed run-time code.
FST 4 now compiles code for CFMs, which do NOT include a task switch. For this to work,
CFMs no longer may have STEPs. This gives you a chance to have simple and direct "subroutines". The old FST 3.x method prohibited this entirely. The behaviour of CMPs hasnt been
touched.
In most cases you cannot see the difference at all. If you have used CFMs with steps change
them to CMPs - and (in most cases) forget this issue.
The new rules are easy to remember:
Mr. Westrik from Festo-NL has contributed the TCP/IP part of the FST 4 software. After a first download of the FST TCP/IP driver, it is also possible to use TCP/IP for all
online tasks - from CI commands to downloading. Simply change the settings in "Extras >> FST Preferences >> Communication port".
12
The communication method has changed significantly. Well, we still use the old
fashioned CI but we did further analysis on the implementation. The obvious situation where you will see this is a faster login to the remote controller.
Make and Download are separated, a Build All is also available.
"Make" will only compile and link what has been changed. This is what you are used to
with FST 3.x. "Build", contrary to "Make," will compile and link everything. Our "Make"
is pretty clever. So you don't need the "Build." But whenever in doubt - it's available.
There is a project specific IPC controller setting, which lets you automatically stop
and unload a project on the IPC controller when downloading.
Run-time options are selectable one by one instead of two pre-configured run-time
modes ("Machine Mode" and "Unit Mode" in FST 3.x notion.)
An AUTOSTART run-time option is available.
All kinds of online displays can be used at the same time, have the online display in
one window, a CI terminal in another window and STL online in one or more additional windows. Then try to transfer a file to or from the controller.
Conversion of FST 3.x Projects to FST 4.x
The conversion program FST3TO4.EXE is accessible by menu entry "Extras >> Convert
FST 3.x Projects". Just select the right path (of FST IPC 3.x or the FST IPC 3.x project
path) and select a project to convert.
It is recommended to rebuild the entire project by selecting menu item "Project >> Build
Project" or click the appropriate toolbar button.
What is still incomplete
The "Tip of the Day" is just a start. It is not a very powerful wizard. Ideas and new tips are
welcome.
What is still missing
Here is a list of things, which are not yet implemented in this version:
Ladder diagram
Windows version of OWS
The following new features/bug fixes require an update of the kernel version (firmware):
get runtime error when calling CFMs with steps (2.24.03)
version checking when starting STL online (2.24.02)
improved PLC Safety method (2.24.02)
online display of counters (2.23.03)
IO1x/IO4x (2.23.01)
You can check the detailed version with the CI command "L!". If this results in
"ACCESS ERROR" you have kernel version 2.22 or less.
If you an upgrade of your CPU module is required please contact your local Festo
dealer.
1.7
History
20.02.2001 4.02.21 CD-ROM "Edition April 2001"
14.08.2000 4.01.16 CD-ROM "Edition August 2000"
13
2.1
The Main Window
If you start FST a splash screen will be shown. It will be hidden automatically after a few
seconds. Click on it to dismiss it immediately.
FST works with a so-called multiple document interface (MDI). For each document a child
window will be opened inside the FST main window. The child windows can be accessed and
arranged with the commands of the Window menu.
The size and position of the window is stored between sessions. If the resolution of the
screen changes, the FST main window will receive the default size and position from Windows.
2.1.1 Windows Basics
This topic describes the most important standard controls of Windows:
The Title Bar
The System Menu
The Window Border
2.1.1.1
The Title Bar
The title bar is located along the top of a window. It contains the name of the application
and/or the document. To move the window, drag the title bar.
14
2.1.1.2
Restore
Use this command to return the active window to its size and position before you chose the
Maximise or Minimize command.
Size
Use this command to display a four-headed arrow so you can size the active window with
the arrow keys.
Note! This command is unavailable if you maximise the window.
Move
Use this command to display a four-headed arrow so you can move the active window or
dialog box with the arrow keys.
Note! This command is unavailable if you maximise the window.
Minimize
Use this command to reduce the window to an icon.
Maximize
Use this command to enlarge the active window to fill the available space.
Next
Use this command to switch to the next open document window. FST determines which
window is next according to the order in which you opened the windows.
Previous
Use this command to switch to the previous open document window. FST determines which
window is previous according to the order in which you opened the windows.
Close
Use this command to close the window. Closing the FST main window will terminate FST.
2.1.1.3
The Window Border
Drag the size bars at the corners or edges of the window to size the window using the
mouse.
2.1.1.4
Scrollbars
Scrollbars are displayed at the right and bottom edges of the window. The scroll boxes
inside the scroll bars indicate your vertical and horizontal location. Drag the slider or click
on the arrow buttons to move the location.
15
The following tools can be directly accessed from the toolbar. The tools that are currently
not available are dimmed (greyed).
Create a new program (Ctrl+N)
Open a program for editing (Ctrl+O)
Save the program code in the currently active editor window (Ctrl+S)
Save all unsaved changes
Remove the currently selected data from the document
Remove the currently selected data from the document and put it on the clipboard
(Ctrl+X)
Copy selected data onto the clipboard (Ctrl+C)
Insert a copy of the clipboard contents at the insertion point (Ctrl+V)
Reverse the last editing action, if possible (Ctrl+Z)
Find something in the currently active editor window (Ctrl+F)
Compile the program in the active editor window (Ctrl+F7)
Prepare the project for download (changes only) (F7)
Prepare the project for download (rebuild all)
Transfer the project to the controller (F5)
Open the Online Control Panel
Open an (other) Online Display window
Open the Online CI Terminal
Open the File Transfer window
Print the contents of the currently active window (Ctrl+P)
Context Help (Shift+F1)
16
NUM
SCRL
INS
From the different pull down menus you can access the following commands:
Project menu
Work with projects and exit FST.
Edit menu
Undo, Clipboard commands, find and replace, select all, delete
View menu
Display the Project Tree window, start the various internal tools like the IO Configuration or
the Controller Settings, display the message window, show or hide the toolbar, status bar
and STL shortcuts
Insert menu
Add new programs or modules to the project and make new entries to the active window,
e.g. adding a New Driver
Program menu
Manage control programs and print the contents of the active window
17
Online menu
Various online tools like the Online Display and download of the active project
Extras menu
Edit preferences, manage the FST Library, configure and execute external tools
Window menu
Close the active window and arrange the child windows
Help window
Online Help, Tip of the Day, About FST
2.1.4.1
The Window Menu Commands
FST works with a so-called multiple document interface (MDI). For each document a child
window will be opened inside the FST main window.
The Window menu offers the following commands, which enable you to arrange the child
windows in the FST main window.
Close
Use this command to close the active client window. FST suggests that you save changes to
your document before you close it. If you close a document without saving, you lose all
changes made since the last time you saved it.
You can also close a window by using the Close icon on the document's window.
Cascade
Arranges windows in an overlapped fashion.
Tile horizontal
Arranges windows vertically in non-overlapped tiles.
Tile vertical
Use this command to arrange multiple opened windows side by side.
Arrange Icons
Use this command to arrange the icons for minimised windows at the bottom of the FST
main window. If there is an open document window at the bottom of the FST main window,
then some or all of the icons may not be visible because they will be underneath this document window.
Window 1, 2, ...
FST displays a list of currently open document windows at the bottom of the Window menu.
A check mark appears in front of the document name of the active window. Choose a document from this list to make its window active.
2.1.4.2
The Edit Menu Commands
The Edit menu offers the following commands:
Undo
Use this c ommand to reverse the last editing action, if possible.
Cut
Use this command to remove the currently selected data from the document and put it on
the clipboard. This command is unavailable if there is no data currently selected.
FST Version 4.02.21 Manual
18
Cutting data to the clipboard replaces the contents previously stored there.
Copy
Use this command to copy selected data onto the clipboard. This command is unavailable if
there is no data currently selected.
Copying data to the clipboard replaces the contents previously stored there.
Paste
Use this command to insert a copy of the clipboard contents at the insertion point. This
command is unavailable if the clipboard is empty.
Delete
Use this command to remove the currently selected data from the document. This command
is unavailable if there is no data currently selected. The removed data is NOT copied to the
clipboard.
Find
Use this command to find a certain text within the active editor window using the standard
Find dialog.
Repeat
Use this command to repeat the last find.
Replace
Use this command to replace a certain text within the active editor window by another text
using the standard Replace dialog.
Select All
Selects everything in the document.
2.1.5 Viewing Properties
Select "View >> Properties" from the menu or "Properties" from the right click popup menu
to display and edit the properties of the selected entry in the active window.
2.1.6 Terminating FST
Select "Project >> Exit" from the menu to end your FST session.
FST prompts you to save documents with unsaved changes.
You can also use the Close command on the application System menu
icon of the FST main window .
19
2.2
Getting Help
The Tip of the Day dialog is also shown on each start-up of FST unless you disable the option "Show Tips on StartUp".
Click the Next button to show another tip.
Close the dialog box by clicking the Close button.
2.2.3 Help Topics
Select "Help >> Help Topics" from the menu to display the opening screen of the FST Online
Help.
From the opening screen, you can jump to step-by-step instructions for using FST and various types of reference information
2.2.4 Context Help
Use the Context Help command to obtain help on some portion of FST.
When you choose the toolbar's Context Help button
, the mouse pointer will change to
an arrow and question mark. Then click somewhere in the FST window, such as another
toolbar button. The help topic will be shown for the item you clicked.
FST Version 4.02.21 Manual
20
If you press the F1 key the help topic will be shown for the active window or command.
2.2.5 The Message Window
The message window is used to log results, e.g. of translating a program or downloading the
project.
Select "View >> Message Window" to bring the message window to the top and view its
contents.
Note! If you close the message window, its contents will be lost.
21
2.3
Working with Projects
Everything in FST is organised in projects. A project contains your source code for programs,
imported (compiled) modules from the library, the IO and driver configurations, the Allocation List and several settings and properties.
2.3.1.1
Project Name and Comment
Each project has a short name and a comment.
The name can be up to 8 characters long and is used to identify the project and will also be
transferred to the controller when it is downloaded. The project name is not case sensitive
and must be unique within the same project directory. The character set that is allowed for
project names is not restricted, but it is recommended to limit it to characters, numbers and
underlines. Spaces are not allowed.
The comment can be up to 255 characters long. Different from the project name the project
comment will not be available at runtime (in the controller) but can be used to give a short
description for your projects for easier recognition. Whenever you have to select a project in
FST this comment will be displayed together with the project name and can be used for
sorting lists. An even more detailed description can be stored in the project documentation,
which is usually a simple text file.
2.3.1.2
Controller Types
FST supports several controller types of the IPC family. In order to choose the correct drivers
or options for the controller your project is designed for, your project has a controller type
attribute. Projects can only be downloaded to a controller of the correct type. You are free to
change the controller type of a project if required.
Note! There is a separate instance of some project parts for each controller type within a
project. If you switch between controller types, you will work on the set of project parts that
belongs to the current controller type.
Common for all controller types
project name and comment
your source code for programs
the project documentation
the Allocation List
2.3.1.3
Organisation on Hard Disk
Everything that belongs to a project is stored in a single directory on your hard disk. The
name of that directory is the project's name. The project name is not stored at any other
location. For each project there is a file PROJECT.FW4 in the project's directory, which is
used to store the current settings and elements of that project such as the comment and
controller type. Please do not modify this file manually.
There are more files in the project's directory to store program source code, the project
documentation, the Allocation List and others which are created and managed by FST
and/or related tools. If you want to store your own files or files created by other tools that
belong to the project in the same directory, you can do so, but be careful with choosing
names. No general rule can be given which names are not used by FST.
FST Version 4.02.21 Manual
22
All projects a re subdirectories of one common project root directory. There is no index file
listing the existing projects. FST will create new projects as subdirectories of that project
root directory and will look for existing projects in that directory.
The project root directory can be anywhere on your computer, the network or even removable media. It need not necessarily be a subdirectory of your FST installation. It is recommended that you use this project root directory for storing FST projects only. Do not choose
the same directory as the one you have used for FST 3.x projects. FST 4.x will not allow
creating a new project if a directory with the desired project name already exists.
You can change the project root directory. This allows organising your projects on groups.
However you have to remember the different locations where you have stored FST projects.
If you want to use DOS based tools for you project, such as fieldbus configurators, use a
project path that does not c ontain long file names (max. 8 characters) or spaces.
2.3.2 The Project Tree Window
The Project Tree window gives you an overview of all the parts that belong to a project and
can be used as a shortcut bar to access the corresponding tools. Double click on the item or
use the right click popup menu for more features on some items.
When you create a new project the project tree will be displayed by default. You can close it
as any MDI child window if you don't need it. You can display the project tree again or bring
it to the top by selecting "View >> Project Tree" from the menu.
The project tree basically has always the same entries. Only the items "Programs", "CMPs"
and "CFMs" will have child items depending on the programs you are using for the individual project. The Project Tree offers the following features for accessing programs:
Double click on the entry of a source code program to open it in the editor. For imported modules no source code is available. They cannot be edited.
Right click on a program entry and then select "Properties" from the popup menu to
open the Program Properties dialog. This dialog will allow changing the program's
name, comment, type and number. It is not possible to change a program's language once it has been created
To delete a program right click on a program entry and then select "Delete" from the
popup menu. You can also press the DEL key to delete the selected program.
FST Version 4.02.21 Manual
23
All programs that have a check mark in the box left to the name and comment will be
downloaded to the controller. If a program is not checked it will not be available at
runtime. Select only one version of the same program at the same time.
Right click on a program entry or the "Programs", "CFMs" or "CMPs" folder and
then select "Insert..." from the right click popup menu to insert a new source code
program.
Right click on a program entry or the "Programs", "CFMs" or "CMPs" folder and
then select "Import..." from the popup menu to import an already compiled module
from the library.
24
When you start FST the project that was open when you quit FST the last time will be opened
automatically.
Note! You can have more than one instance of FST running, but the same project can be
opened only once at the same time. If a project is opened it is marked with a lock file.
2.3.4 Creating a New Project
To create a new project select "Project >> New..." from the menu. Then the New Project
dialog will be displayed that allows you to enter the name for the new project in an edit
field. Select the OK button to create a new project with that name. The currently open project - if any - will be closed and the new project will be loaded into the FST development
environment.
The same dialog with a different caption is also used for renaming or copying a project and
to restore a project from backup or uploaded sources.
25
The Project Settings dialog offers you also the following features:
Change the name of the project by entering it into the edit field.
Click on the button with three dots to get a list with the already existing projects.
That dialog is the same as it is used for entering the name of a new project.
The date when the project was created, which FST version has been used and the
user name will be displayed.
2.3.6.1
The Project Directory
Using different project directories is useful to sort a larger amount of projects in groups. But
you have to remember the different locations where you have stored FST projects.
If you want to view or change the current common root directory for FST projects, select
"Extras >> Preferences..." from the menu. In the tabbed dialog that will be displayed select
the General tab. Enter the path of the new directory or press the Browse button to select an
already existing directory. Relative paths (beginning with a dot) are subdirectories of the
directory where you have installed FST.
26
After changing the directory path and closing the dialog the currently open project will be
closed.
Note! If you want to use DOS based tools for you project, such as fieldbus configurators, use
a project path that does not contain long file names (max. 8 characters) or spaces.
2.3.7 The Project Explorer
If you want to delete, copy or rename projects use the Project Explorer. To open the Project
Explorer dialog select "Project >> Explore..." from the menu. A list with all projects in the
current project directory will be displayed in a dialog box.
27
Above the list box there are several buttons to execute the following operations:
Create a new project. You will be prompted for a project name and settings
Open the selected project.
Delete the selected project.
Create a copy of the selected project. You will be prompted for a name and settings as
for a new project.
This will display the Project Settings dialog for the selected project that allows you to
change the project's name, comment and controller type.
The Project Explorer dialog also offers the following features:
The projects are listed together with their comment and the controller type; each
displayed for each project in a separate column.
Adjust the width of each column by moving the separator in the header with the
mouse.
Each column of the list box can be sorted alphabetically by clicking on the column
header. Click again to reverse the sorting order.
To change the name of a project select it and then click on the name. An inplace edit
field appears. When you are finished press the "Enter" key or click outside the edit
field. To cancel editing press "Esc".
You can only display projects for one controller type by making the appropriate selection in the combo box above the list box.
If you only want to display the project names in a simple list, toggle the radio buttons in the
upper right corner of the dialog.
2.3.8 Preparing the Project for Download
Before a project can be downloaded and executed on the controller its components must be
compiled to a binary format. The results will be linked together to the project runfile.
To prepare the project for download select "Project >> Make Project" from the menu. All
modifications are automatically saved to disk and the progress and result of the compilation
and linking is displayed in the message window.
28
"Make Project" will only compile the programs that have not been changed since the last
make. If you want to compile all programs regardless whether they are changed select
"Project >> Build Project" instead. This is recommended after restoring a project from a nother computer or a change in the FST version, in case the translators have been changed.
2.3.9 Downloading the Project to the Controller
To download the project to the controller, select "Online >> Download Project" from the
menu. All required files will be transferred to the controller. The Download dialog gives you
some information about the progress of the transfers. Press the Abort button to stop the
downloading. Watch the message window for details.
Note!
Before you can download a project it has to be prepared for download first.
Projects can only be downloaded to a controller of the same type as specified in the
project settings.
2.3.10 Downloading an Update of the Project to the Controller
Instead of downloading the complete project to the controller, it is also possible to transfer
only the changes.
To download an update of the project to the controller, select "Online >> Update Project"
from the menu. All required files will be transferred to the controller. The Update dialog
gives you some information about the progress of the transfers. Press the Abort button to
stop the downloading. Watch the message window for details.
An update can only be downloaded if you at least once downloaded the complete
project to the same controller.
An update is not possible
If you add or remove programs.
After some changes to the driver configuration.
2.3.11 Uploading Project Sources from the Controller
It is possible to store the sources of a project in the controller.
If you want the sources to be stored in the controller you have to select the option "Load
sources" in the Download tab of the Controller Settings dialog.
FST Version 4.02.21 Manual
29
To upload the sources that have been stored in the controller, select "Online >> Upload
Project" from the menu. The controller will be searched for the sources and the file will be
uploaded. The Upload Source dialog gives you some information about the progress of the
transfer. Press the Abort button to stop the uploading. View the message window for more
details.
Then the Upload Project dialog will be displayed that allows you to enter the name for the
uploaded project in an edit field. Select the OK button to restore the project with that name.
The currently open project - if any - will be closed and the uploaded project will be loaded
into the FST development environment.
30
.
Note! This function is only available after preparing the project for download.
2.3.13 Removing Intermediate Files
During the process of preparing the project for download several intermediate files will be
generated. In order to free disk space you can clean up the project by selecting "Project >>
Clean Up" from the menu.
If you want to download the project again to a controller, all required files will be created
again.
This function is automatically called before backing up a project.
2.3.14 The Project Documentation
FST does not implement it's own text editor. For writing your project documentation you can
use any tool you like.
By default for each new project an empty file with the file name PROJECT.TXT will be created
in the project's directory. Double click on the item "Project Documentation" in the Project
Tree window or select "View >> Project Documentation" from the menu to open the document with whichever tool is registered for .txt files on your PC.
You can change the name and/or extension if you like by choosing "Properties" from the
right click popup menu of the entry "Project Documentation" in the Project Tree window.
Make sure you use an extension that is registered on your PC for the editing tool you want
to use. E.g. using the extension .doc will usually open Microsoft Word.
2.4
Printing Projects
You can print all or selected parts of the current project.
Select "Project >> Print..." from the menu to display the dialog to select the parts you want
to print.
31
Title Page:
The title page displays the project name together with some information on the FST version,
date and time and the user name.
Documentation:
The project documentation will only be printed, if the file PROJECT.TXT still exists. If you
have changed the name and/or extension of the project documentation, you have to use the
tool you are using to edit the file for printing.
Controller Settings:
The options you have chosen.
Project Tree:
The project tree shows all programs in a sorted list including the comment. If a program is
selected for download is indicated by an asterisk.
Input and Output Modules:
Print the IO configuration.
Drivers:
Print the driver configuration including the options for each driver
Allocation List:
Print the Allocation List.
Program Properties:
Print the file size and date and other information for each program.
Log Files:
Print the results of the last compilation for source code programs or the source path for
imported modules.
Cross Reference:
The cross-reference is a list of all operands that are used in your programs together with
their occurrence in a sorted list.
FST Version 4.02.21 Manual
32
Note!
Printing the cross-reference list requires that you prepare the project for download
before you start printing, since the required data to build the cross reference list will
be collected while the programs are compiled.
You can also print the contents of the currently active window by selecting "Program
>> Print" from the menu.
Before printing starts you will be asked for the printer and the paper size using the standard
Printer Setup dialog. While the pages are formatted and sent to the printer you can stop the
printing process by pressing the Cancel button in the Abort Printing dialog that is displayed.
A header and footer will be printed on each page except the title page. The header shows
the project's name, controller type and comment and which project part is printed on this
page. The footer contains the page number, time and date of the printout.
Note! Headers and footers cannot be customised.
You can change the print font and the margin widths of the printout.
2.4.1 Print Preferences
You can change the print font and the margin widths of the printout. Select "Extras >> Preferences..." from the menu. In the tabbed dialog that will be displayed select the tab "Print".
33
If you press the Browse button you will be asked for a printer to display the correct list of
available fonts before the standard font selection dialog is displayed.
Note! If you choose the margins smaller than the minimum printer margins, the printout will
be clipped.
2.4.2 Project Backup and Restore
Projects will be backed up as standard zip files.
Select "Project >> Backup" from the menu to select the project you want to update. Then
choose the location for the backup file using the standard file dialog. After removing all
intermediate files all files in the project directory will be zipped and stored in the file you
have selected.
We use the world wide accepted ZIP format (RFCs 1950 to 1952).
Many THX to Jean-loup Gailly and Mark Adler for zlib.
Select "Project >> Restore" from the menu to restore a project. Using the standard file dialog
select a zip file that contains a FST project. It will be restored at the current project directory
and opened into the FST development environment.
2.5
Managing Control Programs
Programs, CMPs and CFMs represent pieces of executable code. Since programs, CMPs and
CFMs are handled very similar they are referred to as programs as a common name.
A project can contain up to 64 programs, 100 program modules (CMPs) and 100 function
modules (CFMs). For each program FST can store up to 9 versions, but only one version can
be used in the controller at the same time.
You can write program yourself with FST using the Statement List language or use the a lready compiled program of the FST library for special tasks that usually have been created
from C source code. No matter how program have been created (in terms of source code),
always a compiled version (machine code) will be used in the controller.
2.5.1 Creating New Programs
To create a new source code program select "Program >> New..." from the menu. Then the
New Program dialog will be displayed that allows you to select the program type, number
and version and to enter a comment. Select the OK button to create a new program with
those settings. It will be automatically opened for editing.
You can also invoke the New Program dialog from the right click popup menu of the Project
Tree window or from the Insert menu ("Insert Program...", "Insert CMP...", "Insert CFM...").
The same dialog with a different caption is used to add imported modules from the library
and to save programs with a different name.
34
Type:
Select "Program" if you want to create a program, "CMP" if you want to create a subroutine
with or without steps and "CFM" if you want to create a subroutine without steps.
Number:
This number is used to refer to the program or subroutine later in the code. A program can
have the numbers from 0 to 63, CMPs and CFMs from 0 to 99. You can assign the numbers
as you like, but note the following special cases:
Only Program 0 will be executed automatically on start-up.
The context of Program 63 will be used for CI commands, avoid using this number for programs.
If you import a program with a file name like F<n> it is recommended to use the number <n>.
Version:
FST can store up to 9 versions of each program.
Comment:
This text will be displayed in lists and captions for easier identification of the program. The
string can be up to 255 characters long.
The New Program dialog offers the following features:
A list of the already existing programs in the current project will help avoid using the
same number again. The program name and comment are displayed for each project
in a separate column.
Adjust the width of each column by moving the separator in the header with the
mouse.
Each column of the list box can be sorted alphabetically by clicking on the column
header. Click again to reverse the sorting order.
If you only want to display the program names without comments in a simple list,
toggle the radio buttons in the upper right corner of the dialog.
35
Note!
There can be only one program with the same type, number and version! If you try to
create a program that already exist you will be prompted to overwrite it.
If another version for the source code program you are about to create exists the
new program will be a copy of the already existing program if it is a source code program of the same language.
2.5.2 Importing Modules from the Library
To import a module from the library select "Program >> Import..." from the menu. Then a
dialog box will be displayed that allows you to select the file for import.
You can also invoke the Import Module dialog from the right click popup menu of the Project
Tree window ("Import...").
Select a filename and press the OK button or double click the file name to open a dialog as
for New Program to select the program type, number and version. The comment text entry
will be automatically initialised to the file name in the library. Select the OK button to import
the file as program from the library with that type, number and version.
36
Language:
The source code language of the program.
Type:
Select "Program" if you want to have a program, "CMP" if you want to create a subroutine
with or without steps and "CFM" if you want to create a subroutine without steps.
Number:
This number is used to refer to the program or subroutine. A program can have the numbers
from 0 to 63, CMPs and CFMs from 0 to 99. You can assign the numbers as you like, but note
the following special cases:
Only Program 0 will be executed automatically on start-up.
The context of Program 63 will be used for CI commands, avoid using this number
for programs.
If you import a program with a file name like F<n> it is recommended to use the number <n>.
Version:
FST can store up to 9 versions of each program.
Comment:
This text will be displayed in lists and captions for easier identification of the program. The
string can be up to 255 characters long.
File, Size and Date:
Some information on the program's file on your computer
FST Version 4.02.21 Manual
37
Last compiled:
Date of the last successful compilation of the source code program. See the tab "Log file"
for the compiler output if any.
Version:
The operating system version of the compiled program, see the tab "log file" for the path
name of the source file in the library.
Note!
There can be only one program with the same type, number and version! If you try to
create a program that already exists you will be prompted to overwrite it.
The language of a program cannot be changed!
2.5.4 Deleting a Program
To delete a program from the project select "Program >> Delete..." from the menu. Then a
dialog box will be displayed that allows you to select a program. Double click a program or
select it and press the OK button to delete it.
You can also delete programs by selecting it and pressing the DEL key or via the right click
popup menu using the Project Tree window.
38
39
Note!
Unsaved changes in the source code will automatically be saved prior to the compilation.
The results of the compilation will also be stored in a log file. To view it select "View
>> Properties" from the menu. Then select the "Log file" tab of the Program Prope rties dialog
40
The Select Programs for Download dialog offers the following features:
The program name and comment are displayed for each program in a separate column.
Adjust the width of each column by moving the separator in the header with the
mouse.
Each column of the list box can be sorted alphabetically by clicking on the column
header. Click again to reverse the sorting order.
You can only display programs of one type or language by making the a ppropriate
selection in the combo boxes above the list box.
If you only want to display the program names without comments in a simple list,
toggle the radio buttons in the upper right corner of the dialog.
Note! Only one version of the same program can be selected for download.
2.6
Controller Settings
There are several runtime and download options for a FST project. They can be modified
using the tabbed dialog Controller Settings.
Double click on the entry Controller Settings in the Project Tree or select "View >> Controller
Settings" from the menu to show the Controller Settings dialog.
2.6.1 Run Mode (Controller Settings)
The Run Mode tab is the default tab of the Controller Settings dialog.
Autostart:
Check this option if you want the project to start after download without giving an explicit
Run command and regardless of the Start/Stop input.
The default setting is Off.
Start/Stop input:
Check this option if you want to configure a start/stop input. Enter the input to be used in
the edit box.
Note! It will not be checked if there is any hardware configured for this input. If there is no
hardware configured for this input it is always off unless explicitly set by CI command or a
driver.
The default setting is Off.
FST Version 4.02.21 Manual
41
Reset programs:
Check this option if you want all programs to be inactivated (resetted) - rather than stopped
(breaked) - if
The start/stop switch is switched to stop (falling edge)
An error occurs without the presence of an error program
Check this option if you do not want - in addition to activating program P0 - all stopped
(breaked) programs to be re-activated if
The start/stop switch is switched to run (rising edge)
The CI command "R" is executed
The default setting is On.
Delete project before download:
Check this option if you want the project that is active on the controller to be unloaded from
the memory before the download. If this option is not checked the operation of the project
in the controller will continue during the file transfers that are necessary to download the
new project.
Note! Do not enable this option if you want to use TCP/IP for downloading the project.
Deleting the project will also stop all FST drivers including TCP/IP.
The default setting is Off.
Error output:
Check this option if you want the output specified in the edit box below to reflect the error
state of the controller.
Note!
It will not be checked if any hardware is configured for this output.
The error output will not be switched off unless the error is reset.
The default setting is Off.
Error program:
Enter a program number other than zero (1..63) to configure it as error program. In case of
an error this program will be started.
The default setting is 0 (Off).
Reset outputs:
Check this option if you want all outputs to be resetted if
The start/stop switch is switched to stop (falling edge)
The CI command "S" is executed
An error occurs without the presence of an error program
When the project is started - rather than using the old values from the retentive
storage of operands
The default setting is On.
42
Project File:
Enter the drive where the project file should be stored on the controller.
If the drive you want is not listed in the combo box you can simply type the drive letter. If the
drive you choose is available of the controller will be checked prior to the download.
The default depends on the controller type
FEC Compact B:
FEC Standard B:
HC0X
B:
HC1X
C:
HC2X
C:
Startup Batch:
Enter the drive where the startup batch file should be stored on the controller.
If the drive you want is not listed in the combo box you can simply type the drive letter. If the
drive you choose is available of the controller will be checked prior to the download. Only
choose a drive where the STARTUP.BAT will be automatically started. This depends on the
controller type you are using.
The default depends on the controller type
FEC Compact B:
FEC Standard B:
HC0X
B:
HC1X
C:
HC2X
C:
FST Kernel:
FST Version 4.02.21 Manual
43
Enter the drive where the FST kernel resides on the controller. If the drive you want is not
listed in the combo box you can simply type the drive letter. If there is a FST kernel installed
on the drive you choose will be checked prior to the download.
The default depends on the controller type
FEC Compact A:
FEC Standard A:
HC0X
A:
HC1X
A:
HC2X
C:
2.6.3 Options (Controller Settings)
Select the Options tab of the Controller Settings dialog.
0
0
0
1
1
Additional parameters:
This text will be appended to the kernel's command line. It is usually blank and meant for
future extensions.
44
Enter a password that will be activated on the controller when the project is started. If you
do not want a password leave this field blank.
2.6.5 Download (Controller Settings)
Select the Download tab in the Controller Settings dialog.
45
46
47
48
2.8
The Driver Configuration
Certain functions in the controller (such as fieldbus operation) are supported by drivers.
These drivers are normally started before the FST operating system when the controller is
powered up. FST supports the management of these drivers. FST handles loading and
preparations for automatic starting of the drivers. The driver configuration is used to select
and configure the drivers for a project.
Each driver has its driver number. This number is usually used for only one driver, except
there are more drivers that are for the same purpose. In one project you can only use one
driver with the same number. Some drivers use the functions of other drivers. In this case
both drivers have to be configured for the project. For most drivers there are options, which
are individual for each driver.
There are drivers that require a more comprehensive configuration, such as a fieldbus configuration. This configuration is usually edited using a special configuration tool and stored
in a file. The contents of this file are incorporated into the project file that will be
downloaded to the controller and will be used by the driver.
Please note that there is a separate driver configuration for each controller type. If you
switch a project from one controller type to another the driver configuration will be empty. If
you switch back however, you again will have the original driver configuration for that controller type. In the driver configuration you can only insert drivers that are available for the
current controller type setting of the project.
2.8.1 The Driver Configuration Window
To open the Driver Configuration window select "View >> Driver Configuration..." from the
menu or simply double click on the "Driver Configuration" entry in the Project Tree window.
A MDI child window with the current driver configuration is shown
49
Note!
There is no undo function available. All changes are immediately saved to disk.
If an entry refers to a driver that is unknown to the FST library its name will be shown
in brackets []. If you select "View >> Properties" for that driver, the option settings
will be shown if available. However, they cannot be edited. A project with a driver
configuration that contains unknown drivers cannot be downloaded to the controller.
2.8.2 Adding a New Driver
To insert a new driver to the configuration select "Insert >> Driver..." from the menu, "Insert
Driver..." from the right click popup menu of the Driver Configuration window or simply
double click on an empty line. The Select Driver dialog will be shown that allows you to
choose a driver. Double click on the driver you want to add or press the OK button to add
the selected driver.
50
For each option there is a default value available. If you want to reset all options to their
defaults, press the Default button.
Most drivers are asking for a controller drive. Enter here the drive of the controller where
you want the driver executable file to be downloaded or where it already resides. If the
chosen drive is available on the controller will be checked prior to downloading the project.
Press the Help button to open the driver's chapter in the online help viewer.
Note! The options of an unknown driver cannot be edited. They are only displayed in a
simple dialog.
51
2.9
The Allocation List
PLC programs consist of program code for handling of data. This data is available in the form
of operands. An operand consists of an abbreviation identifying the equipment group and
an address specifying a level within the group. Output 3 in output word 5, for example, is
identified as O5.3.
FST also allows you to use symbolic designations for the operands: output O5.3 may switch
a motor on and off, for example, in which case you can refer to it as "MotorOn" in your
programs. In this way you can make the programs more easily comprehensible, and also
retain a clear overview even when there is a large number of operands.
You are largely free to decide on the names of the symbolic operands yourself. A name may
consist of up to nine characters, but the first character must be a letter or an underline
character (_). You can use any combination of letters, digits or underlines for the subsequent characters, but no spaces. The designation must, however, be different from that of
an absolute operand.
In the following the direct entry of an operand (such as O5.3) is referred to as an absolute
operand, whereas an entry in symbolic form (MotorOn) is referred to as a symbolic operand.
The assignment of symbolic operands to absolute operands is defined in the Allocation List.
It is advisable to create the Allocation List before program entry and then only to use the
symbolic operand designations in the control programs. The Allocation List can be edited
with the Allocation List editor, covering all functional aspects. It is also possible to insert
operands in the course of program entry, however.
2.9.1 The Allocation List Editor
To open the Allocation List editor select "View >> Allocation List" from the menu or simply
double click on the "Allocation List" entry in the Project Tree window. A MDI child window
with the current Allocation List is shown.
52
To remove the selected entries from the Allocation List simply press the DEL key or
select "Edit >> Delete" from the menu or "Delete" from the right click popup menu.
To insert a new entry simply press the INS key or select "Insert >> Operand..." from
the menu or "Insert Operand" from the right click popup menu or double click an
empty line.
To edit an entry select "View >> Properties" from the menu or "Properties" from the
right click popup menu or double click on the entry you want to edit.
To print the current Allocation List select "Program >> Print" from the menu.
To find and replace text in the comments use the appropriate functions from the Edit
menu.
Note! There is no undo function available. All changes are immediately saved to disk.
2.9.2 Adding and Editing Allocation List Entries
To insert an operand to the Allocation List select "Insert >> Operand..." from the menu,
"Insert Operand" from the right click popup menu of the Allocation List editor or simply
double click on an empty line in the Allocation List editor.
It is also possible to add entries to the Allocation List while typing the control programs in
the Statement List editor.
To change an entry in the Allocation List select it in the Allocation List editor and select
"View >> Properties" from the menu, "Properties" from the right click popup menu or simply
double click on the operand you want to change.
The Allocation List Entry dialog will be shown that allows you to enter the required settings.
Absolute Operand:
Enter here the absolute operand, e.g. O3.2 or FW4.
Symbolic Operand:
Enter here the symbolic operand, e.g. MotorOn.
You are largely free to decide on the names of the symbolic operands yourself. A name may
consist of up to nine characters, but the first character must be a letter or an underline
character (_). You can use any combination of letters, digits or underlines for the subsequent characters, but no spaces.
Comment:
Enter here a short comment for the operand. It can be up to 36 characters long.
If you use an operand in your programs, its comment from the Allocation List will be automatically inserted into the program text.
53
Note!
There can be only one entry for the same absolute or symbolic operand.
The symbolic operand must be different from that of an absolute operand.
You can enter an absolute operand with or without a symbolic designation, but a
symbolic operand always requires an absolute operand.
2.9.3 Selecting an Operand from the Allocation List
The Select Operand dialog is used for different purposes where you have to select an ope rand. It allows you to choose an operand from the Allocation List or to enter it directly (absolute or symbolic) in the edit field below the list box. Press the OK button to accept the ope rand entered.
54
55
If you want to use TCP/IP for the online connection select the "use TCP/IP" radio button, or
"use RS232" to use RS232.
For the RS232 connection you have to specify a com port and a baud rate. The com port can
be selected from the first combo box. It offers all COM ports found on your PC. Choose the
baud rate from the second combo box. Please note that not all controllers allow high baud
rates. 9600 is usually a good choice, if not successful, try 2400. Please see the system
documentation of the controller for details
If using TCP/IP you have to enter the IP address of the controller.
If you check the option "Save in Project" the settings will be stored in the project rather
than for FST in general.
Press the OK button to a ccept the new settings. All online displays will be closed automatically if you have made any changes.
2.10.2 The Online Control Panel
The Online Control Panel is used to
Display the name of the project that is currently loaded into the controller
Start and stop the project
Unload the project
Reboot the controller
Display the error in the controller
Reset any error in the controller
Display if the controller is protected by a password (locked)
Lock or unlock the controller
Change the password of the controller
To start the Control Panel select "Online >> Control Panel" from the menu. A small
MDI child window with the controls is shown
56
Project
The name of the project currently loaded in the controller is displayed in a text field, or
"<none>" if no project is loaded.
Press the Run button
to start the project. This will activate program 0 and activate any
stopped programs depending on the Controller Settings.
Press the Stop button
to stop the project. This will inactivate (reset) all programs and
reset all outputs depending on the Controller Settings.
Press the Break button
to break the project. This will stop (break) any active program
depending on the Controller Settings.
Press the Unload button
to unload the project. All drivers are killed and the project is
unloaded from the memory. To load the project again you have to download it or reboot the
controller.
Press the Boot button
Error
The number and a short description of the error in the controller are displayed in a text field.
Press the Reset button to reset the error in the controller.
Password
If the controller is protected by password (locked) is indicated by the two radio buttons for
the locked or unlocked state. Press either the Lock
or Unlock
radio button to lock or
unlock the controller. If you want to unlock the controller you have to enter the password.
The button next to the radio buttons is labelled either "Set Password" if currently no password is stored in the controller, or "Change Password" if a password is stored in the controller. Click on it to set or change the password that is stored in the controller.
Note!
If no password is stored in the controller it can be unlocked without entering a
password.
There is also the possibility to store a password with the project.
Before you can go online you have to connect the controller to your PC and possibly
configure the online settings.
2.10.3 Entering the Controller Password
If the controller is protected by a password and you want to unlock it for having full access
you have to type in the password. The FST Password dialog is displayed to enter the password.
57
Note! If no password is stored in the controller it can be unlocked without entering a password.
2.10.4 Changing the Controller Password
To change the password stored in the controller open the Online Control Panel. Press the
button labelled "change Password" or "Set Password". The Change Password dialog will be
displayed.
Old Password:
If you want to change the password you have to enter here the old password first.
New Password:
Enter here the new password. Leave blank to erase the password from the controller.
Again:
Enter here the new password again (same as for "New Password:").
Note! There is also the possibility to store a password with the project. See Controller Settings.
2.10.5 The Online Display
The Online Display is used to display and modify the current values of the PLC operands. To
start the Online Display select "Online >> Online Display" from the menu. A MDI child window with several tabs is shown.
58
59
To update the configuration in the master according to the actual configuration in the bus
select "Scan for Actual Configuration" from the right click popup menu. Please note that this
will temporarily disconnect all slaves from the master. All fieldbus outputs are reset to zero.
To assign the nominal configuration (i.e. the slaves used by the control programs) to the
master's slave list select "Assign Nominal Configuration" from the right click popup menu.
Please note that this will temporarily disconnect all slaves from the master. All fieldbus
outputs are reset to zero.
User Defined List
You can display a list of operands of different types that are of interest in the User Defined
tab. To configure an entry click the label button. A dialog will be shown that allow you to
choose or enter an operand.
Note!
The operands configured for the User Defined tab are stored with the project as absolute operands.
Before you can go online you have to connect the controller to your PC and possibly
configure the online settings.
2.10.6 Online Goto...
To position on a certain operand within the active page of the Online Display or a step in
Statement List Online select "Online >> Goto..." from the menu or "Goto.." from the right
click popup menu.
The Goto... dialog will be displayed that allows you to enter the number of the ope rand or
step.
60
Note! The setting is valid for all online windows of the same type, e.g. all Online Display
windows.
2.10.9 Modifying Online Display Operand Values
To modify an operand value place the mouse cursor over it and press the right mouse button (or select it using the Tab and Direction keys and press the Context Menu key). Select
"Modify operand..." from the popup menu. Depending on the operand type a dialog is
shown that allows you to change the value. Press the Modify button to transfer the new
value to the controller.
To simply toggle a one-bit operand Select "Toggle" from the popup menu.
Forcing Inputs and Outputs
Inputs and outputs can also be forced using the Modify Operand dialogs. Press the Force
button to force the input or output to the new value entered in the controller instead of the
Modify button. To un-force an input or output enter "N" for the new value before pressing
the Force button.
Note! In the online displays the values are always shown as seen by the control programs.
To reset all inputs and outputs to their natural value select "Clear Force Table" from the
right click popup menu of the Online Display window
FST Version 4.02.21 Manual
61
2.10.10File Transfer
The File Transfer window offers the following features:
Display the files and directories on the different drives of the controller
Information on the file dates and sizes
Information on the free space on the controller drives
Upload files from the controller to the PC
Delete files on the controller
Download files from the PC to the controller
To open the File Transfer window select "Online >> File Transfer" from the menu. A MDI child
window with a directory listing of the controller and several buttons is shown.
62
simple list of file names press the List radio button. To display the contents of a subdirectory, double click on the directory name in the list box (or select it and press the Upload
button. To display the contents of the parent directory or another drive, select it from the
combo box or press the Parent Dir button. To transfer the currently displayed directory again
press the Refresh button.
Note! Displaying the directory takes a little time. While the information is transferred the
lights in the status bar will be red. As soon as the transfer is finished it will be switched to
green again. If you want to stop the current transfer press the Stop button.
Uploading Files to the PC
To upload a file from the controller to the PC double click on the file name in the list box (or
select it and press the Upload button). You will be asked for the location where to store the
file on your PC using the standard file dialog. During the file transfer the progress is shown
in the status bar and the lights are switched to red. If you want to stop the current transfer
press the Stop button.
Deleting files on the controller
To delete a file on the controller select it and press the Delete button.
You will be asked if you are sure, then the file is removed from the controller.
Downloading files from the PC
To download a file from the PC to the controller press the Download button. You will be
asked to select a file for download using the standard file dialog. The file will be transferred
to the directory of the controller of which the directory is currently displayed (see the combo
box in the toolbar). During the file transfer the progress is shown in the status bar and the
lights are switched to red. If you want to stop the current transfer press the Stop button.
Remarks
Before you can go online you have to connect the controller to your PC and possibly
configure the online settings.
The File Transfer window does not work correctly if the controller is protected by a
password (locked).
2.10.11The Online CI Terminal
The FST PLC operating system is communicating with the FST program using the so-called
Command Interpreter (CI). The CI offers various commands to display and modify operand
values, start and stop control programs, transfer files etc. These commands are used by the
FST online displays. If you want to type the CI commands directly you can do so for special
purposes by using the CI Terminal. To start the CI Terminal in a MDI child window select
"Online >> Terminal" from the menu.
63
Note! Before you can go online you have to connect the controller to your PC and possibly
configure the online settings.
Enter the CI command in the edit field at the bottom of the window. Press the Enter key or
the Send button to send the command. The command and the reply will be displayed in the
window above.
Press the Enter key or the Send button again to repeat the last command.
Press the Clear button to erase the contents of the display window.
Press the Login button to start a login. If successful the version of the FST operating system,
the controller type and the name of the loaded project is displayed.
2.11 Programming in Statement List
The Statement List (STL) language is a text-based language for programming control programs in FST.
2.11.1 The Statement List Editor
This chapter describes the features and user interface of the Statement List editor. For a
description of the statement List language see the separate documentation on that subject.
The Statement List editor offers the following features:
Automatic formatting of the entered lines of text
Standard Windows text editor features such as undo, clipboard support, find and
replace
Insert and overwrite mode
Shortcut bar for all keywords
Automatic prompt for Allocation List entries
Automatic insertion of the comment to operands of the Allocation List
Insertion of operands from the Allocation List
Dialog based insertion of module calls
Syntax check
A different font for the program text can be selected
Before you can start programming in Statement List you have to create a project first. Then
add a new Statement List program to that project. The Statement List editor will be automatically opened. Of course you can also open an already existing program from the current
FST Version 4.02.21 Manual
64
project. If you have opened a program, you will see the code of the program in the work area
of the Statement List editor. If you have created a new program, the work area is blank.
Auto Format
You can now start to enter the program text. Whenever you leave a line it will be formatted
according to its syntax. If there are syntax errors in the line, formatting is not possible, and
the line will stay as you have entered it.
Allocation List Support
If there is an operand in the formatted line, which is entered in the Allocation List with a
comment, that comment will be used as the comment for the line, if it has not already a
comment entered. The automatic comment for operands is prefixed by a simple quote and
cannot be edited in the Statement List editor. If a line is formatted and an operand is detected, that is not yet entered in the Allocation List, you will be prompted to make an
Allocation List entry. If you do not want to enter the operand, click the cancel button or press
the ESC key. The automatic prompt for Allocation List entries can be switched off completely
in the Statement List editor preferences. Select "Insert >> Operand" from the menu to
choose an operand from the Allocation List to be inserted at the current cursor position
instead of typing it.
Inserting Keywords Using the Shortcut Bar
The Statement List shortcut bar allows an overview and quick insertion of all available
Statement List instructions. For each keyword a button is available from a floating toolbox.
Inserting Module Calls Using a Dialog Box
If you use the Module Call dialog for inserting a module call comments for the call parameters will be inserted automatically for modules from the library.
Syntax Test
If you want to check the syntax of the source code in the currently open editor window you
can simply compile the program.
65
Clipboard Support
The Statement List editor supports the Windows Clipboard. This allows you to copy or move
portions of text within the program, between different programs that are opened in FST or to
exchange text with other Windows applications.
Before you can move or copy text you have to make a selection. Drag the mouse over the
portion you want to select, or hold down the shift key while you are moving the insertion
point with the direction keys. To select all text select "Edit >> Select All" from the menu.
From the Edit menu or right click popup menu choose "Cut" or "Copy". The cut or copied
text is placed onto the Clipboard and is available for pasting. Move the insertion point to the
location where you want to insert the text and select "Edit >> Paste" from the menu or
"Paste" from the right click popup menu.
Note! If you simply delete text by pressing the DEL key or selecting "Edit >> Delete" from the
menu or "Delete" from the right click popup menu, the deleted text will not be copied to the
Clipboard.
Undoing Changes
To undo the last modification select "Edit >> Undo" from the menu. To undo all changes you
have made since you last saved the program or opened it close the program without saving.
Note! Preparing the project for download (Make) or compiling the program to check the
syntax will automatically save all changes.
Find and Replace
To find certain text within the Statement List source code position the insertion point from
where you want to start the search and select "Edit >> Find" from the menu. The standard
Find dialog will be displayed. Enter the text you want to search for and select any options.
Then click the Find next button to find, select and scroll to the next occurrence of the text to
find. The Find dialog will be kept open. Click the Find Next button again to proceed to the
next occurrence of the text. Click the Cancel button to dismiss the Find dialog.
To replace certain text in the Statement List source code position the insertion point from
where you want to start the search and select "Edit >> Replace" from the menu. The standard Find and Replace dialog will be displayed. In the "Find What?" text box type the search
text. In the "Replace With:" text box type the replacement text. Select any find options. Click
the Find next button to find, select and scroll to the next occurrence of the text to find. Then
click on Replace to replace the current selection with the replacement text. Click on Replace
all to replace all occurrences at once. Click the Cancel button to dismiss the dialog.
If you want to search for the same text as the last search again select "Edit >> Find Next"
from the menu. This will directly find, select and scroll to the next occurrence without opening the standard Find dialog.
Insertion and Overwrite Mode
For the Statement List editor you can toggle between insertion or overwrite mode with the
INS key. If the editor is in insertion mode the text "INS" is visible in the status line. By default the Statement List editor starts up in insertion mode.
Saving Changes
The changes you make to the source code will be saved to file...
If you explicitly save it by selecting "Program >> Save", "Program >> Save As..."or
"Program >> Save All" from the menu.
When you are changing the program properties
Prior to compiling it (syntax check) or preparing the project for download (make).
If the project is closed.
Prior to printing the project.
FST Version 4.02.21 Manual
66
Select "Program >> Save As" if you want to make a copy of the program. The same dialog as
for creating a new program will be displayed. The original program will not be erased. It will
keep the source code how it was saved the last time before the Save As.
Printing
Select "Program >> Print" to print the source code of the active Statement List editor. You
will be prompted to save any unsaved modifications first. Then the standard print dialog will
be shown to select a printer
Changing the Text Font
The font used for the program text can be changed in the Statement List Preferences.
2.11.2 The Shortcuts Window
The Statement List shortcut bar allows an overview and quick insertion of all available
Statement List instructions. For each keyword a button is available from a floating toolbox.
To display the shortcut bar select "View >> Shortcut bar" from the menu or "Shortcut bar"
from the right click popup menu. Click on the keyword to insert it at the insertion point of
the active Statement List editor window.
Note!
The shortcut bar will be automatically hidden, if the active window is not a Statement List editor and will be displayed again if you make a Statement List editor the
active window. If you do not want the shortcut bar to be displayed close the floating
toolbox window by clicking its close icon in the titlebar or select "View >> Shortcut
bar" from the menu or "Shortcut bar" from the right click popup menu again.
The visibility, size and position of the Shortcuts window will be saved between FST
sessions.
The Statement List instructions are also available from the "Insert >> STL Instruction" menu.
2.11.2.1
Inserting Module Calls
To insert a module call at the current editing position of your program select "Insert >> Module Call" from the menu. A list with all program and function modules of the project will be
displayed. Choose the one you want to call by double clicking it, or select it and press the
OK button.
Then the Module Call dialog is displayed. Enter the required parameters in the edit fields
after the keyword "WITH". If a description file is available for the module you have selected,
a comment for each of the parameters will be displayed. If you choose the OK button the
module call including the comments will be inserted into your source code.
67
68
69
<Mark>
Switch1
I1.1
O1.0
Horn
Each individual line represents a statement for the controller. A statement is composed of
the following parts:
STL instructions (e.g. IF, AND, THEN, SET, OTHRW)
PLC operands (e.g. inputs or outputs) "Switch1" and "Horn" are symbolic operands.
When you are entering a new program you can write it as a:
Step program
Parallel logic program
Executive part
2.11.4.1
Step program
A step program can contain up to 255 steps (1 to 255). Each step can be labelled with a
symbolic step mark.
In a step program you can set up branches or jumps to other parts of the program (JMP TO
step mark). Your program then continues with a step other than the directly following step.
A step may consist of one or more sentences. A complete sentence contains an IF clause, a
THEN clause and possibly an OTHRW clause. The first sentence of a step may be an incomplete sentence. In this case this is an executive part only (THEN...). This THEN clause is
always executed, without an input condition.
The program is executed step by step.
Note!
Control does not pass to the next step until a THEN or OTHRW statement has been executed
in the last sentence of the current step. Until this condition is met, the instructions in the
current step are executed again, cyclically each time the program is executed.
The STL language does not use "edge triggering". Conditions are evaluated for truth each
time they are processed without regard as to their prior status.
70
Mark3
F0.0
I0.0
O0.4
Mark4
2.11.4.2
Parallel logic program
A parallel logic program consists purely of sentences; in other words no step marks are
programmed. This means that a parallel logic program is identical to a step of a step program. Branches cannot be programmed in a parallel logic program.
The first sentence in a parallel logic program may be an incomplete sentence. All subsequent sentences must be complete sentences.
A parallel logic program is processed cyclically until it is reset (as is a ladder diagram program). If you want the program to be executed only once, you must reset it in the last sentence.
Example of a parallel logic program (P1) that is executed only once:
THEN RESET F0.0
IF
N
I1.0
THEN SET
O0.7
IF
I1.7
THEN SET
O1.7
OTHRWSET
F0.0
RESET O1.7
...
...
IF
F0.0
AND I1.0
THEN SET
O1.0
RESET P1
OTHRWRESET P1
71
2.11.4.3
Executive part
An executive part is essentially structured in the same way as an incomplete sentence in a
parallel logic program. There is no introduction with a THEN clause. All of the statements
entered are executed without an input condition. No branching is possible within the program. If you enter an IF clause further on in the executive part, an error results. Example of
an executive part:
SET
RESET
LOAD
TO
SET
CMP2
...
F0.0
O1.0
V50
TW7
T7
2.11.4.4
Comments
There are two types of comment that you can add to your STL program:
Short comments with up to 36 characters can be appended to a program line. They are
introduced with one quotation mark.
Example:
IF
N
I1.7
"No signal from sensor
Long comments can extend over a whole line. They are introduced with two quotation
marks.
Example:
""This is a long comment that can be as long as an entire line.
2.11.5 Statement List Instructions Reference
This chapter gives an overview of the Statement List instructions.
2.11.5.1
The STEP statement is very important in sequence programs as it determines the structure
of the program or, if branches are used, the sequence of processing.
STEP can be followed by a step mark with a maximum of nine characters or a number (label).
A step mark is required if you want to branch to this step from elsewhere in the STL program.
Example:
STEP
Setup
...
...
THEN JMP TO Setup
During the translation process the steps are renumbered internally, beginning at step 1
through to the maximum number.
Note!
In an STL program a step is not processed until a THEN or OTHRW clause in the last
sentence of the preceding step has been executed.
Processing of a step program is not cyclical.
72
IF always introduces a conditional part. Operands can be interrogated and linked by logical
associations within the statement. The result represents the condition for further processing.
Example:
IF
I1.0
AND N I1.1
...
THEN introduces the executive part. This part is executed if the condition is true. The statement may contain commands to modify outputs or flags etc., to carry out arithmetic operations, to activate timers or counters, or to call other programs or program modules.
Example:
THEN LOAD V100
TO
TP7
...
OTHRW introduces a second, alternative executive part. This part is executed if the result of
the conditional part of the step is not true and hence the THEN clause cannot be executed.
Example:
...
THEN SET
O1.0
OTHRW
RESET
O1.0
2.11.5.2
STL conditional part
These statements enable you to construct complex input conditions.
This is the logical operator AND. It allows logical ANDing of a number of input conditions.
The condition is fulfilled when all ANDed input conditions are true.
Example:
IF
I1.0
AND
I1.1
THEN SET
O1.0
OTHRWSET
O1.7
This is the logical operator OR. This operator allows you to create a logical expression with
several input conditions. The condition is fulfilled when at least one of the conditions is true.
Example:
IF
I1.0
OR
I1.1
OR
I1.7
THEN SET
O1.0
OTHRWSET
O1.7
This is the logical operator EXOR. This allows you to create a logical expression with two
input conditions. The condition is fulfilled when only one or the other input condition is true.
FST Version 4.02.21 Manual
73
Example:
IF
I1.0
EXOR I1.1
THEN SET
O1.0
OTHRWSET
O1.7
NOP means No operation. You can use this statement when you want to carry out an executive part without an input condition.
Example:
IF
NOP
THEN SET
F1.0
This is a negation. It allows you to invert an input condition. In the example below, if output
O1.0 is not active, the program jumps to the Setup step.
Example:
IF
N
O1.0
THEN JMP TO Setup
2.11.5.3
SET activates a one-bit operand. You can use this for setting an output to logical one, for
example.
RESET is the counterpart to SET. It deactivates one-bit operands, used, for example, for
setting an output to logical zero.
A LOAD statement reads a register or a multibit operand, i.e. its value is written to a multibit
accumulator. Normally this statement is followed by the keyword TO, indicating the destination of the operation.
Example:
THEN LOAD V500
TO
TP31
A TO statement assigns a value to a word operand. TO specifies the destination of the operation.
Example:
THEN LOAD V100
TO
R6
The value 100 is loaded into register 6.
A JMP TO statement causes the program to branch to a specific program step.
Example:
STEP
Mark
IF
I1.0
THEN SET
O1.0
JMP TO
Start
...
...
FST Version 4.02.21 Manual
74
STEP Start
...
The program branches to the step mark Start and the program continues executing there.
2.11.5.4
Special functions - Extended STL
These functions allow you to enter statements for multibit operands in your STL program.
The higher-order byte and the lower-order byte are swapped in the multibit accumulator.
Example:
THEN LOAD V$55AA
TO
OW0
SWAP
TO
OW1
$55AA is loaded to OW0, but $AA55 is loaded to OW1.
The SHIFT instruction executes a swap between the Single Bit Accumulator (SBA) and a
Single Bit Operand (SBO).
This instruction can be used to construct Shift Registers of varying lengths...longer or
shorter than the 16 bit manipulations performed by the SHL and SHR instructions.
To operate properly, the SBA must first be loaded and then any number of single bit SHIFT's
can be programmed.
Example:
STEP 10
IF
I1.0
" input activated
THEN LOAD I1.1
TO
F0.0 " a flag is used here to avoid
" writing to an input, which
" would otherwise occur
SHIFT O1.1 " SWAP F0.0 <-> O1.1
SHIFT O1.2 " SWAP O1.1<-> O1.2
SHIFT O1.3 " SWAP O1.2<-> O1.3
SHIFT O1.4 " SWAP O1.3<-> O1.4
STEP 20
IF
N
I1.0
" wait for input to go away
THEN JMP TO
10
" repeat
SHL stands for shift left. This statement is used to shift the contents of the multibit
accumulator one bit position to the left. The right-most bit is filled with a zero. The effect is
multiplication by 2. If you call the SHL statement three times in succession, this is equivalent to multiplication by 2x2x2, therefore multiplication by 8.
Example:
THEN LOAD V16
SHL
TO
R7
The value of R7 is then 32.
SHR stands for shift right. This statement is used to shift the contents of the multibit accumulator one bit position to the right. The left-most bit is filled with a zero. The effect is
division by 2. In similar fashion to SHL, repeated shifting to the right results in division by 2
each time.
FST Version 4.02.21 Manual
75
Example:
THEN LOAD V16
SHR
TO
R7
The value of R7 is then 8.
The effect of this statement is the same as that of SHL except that the highest-order, leftmost bit is shifted out of the accumulator and is re-inserted as an overflow on the right as
the lowest-order bit.
As in the case of SHR, the bits in the multibit accumulator are shifted, but this time to the
right. The right-most bit is pushed out of the accumulator and re-inserted as the highestorder bit.
A BID statement converts the contents of the multibit accumulator from binary to BCD representation. You can use BCD code to drive LEDs on control panels, for example.
Example:
THEN LOAD IW0
BID
TO
OW7
A DEB statement converts the contents of the multibit accumulator from BCD to binary code.
This conversion is necessary if you have connected BCD switches to an input in your controller and you want to transfer the switching status of the switches from the input word for
processing in a counter.
Example:
THEN LOAD IW7
DEB
TO
CW7
This command complements (INVerts) the contents of the multibit accumulator using the
one's complement method.
Example:
THEN LOAD OW1
INV
AND IW1
TO
OW1
This command complements the contents of the multibit accumulator using the two's complement method. In principle, the effect of using the CPL instruction is the same as multiplying a number by -1 when applied to signed integers.
Example:
IF
(
R32
<
V0
)
THEN LOAD R32
CPL
TO
R22
FST Version 4.02.21 Manual
76
2.11.5.5
Arithmetic functions
The INCrement instruction increases the value of any multibit operand by 1. Unlike other
arithmetic instructions, the INCrement operation may be carried out directly without the
need to first load the operand to be INCremented to the multibit accumulator.
While the INCrement instruction can be used with any multibit operand, it is most often used
in conjunction with Counters.
Example:
IF
I
1.3
THEN INC
R9
The DECrement instruc tion reduces the value of any multibit operand by 1. Unlike other
arithmetic instructions, the DECrement operation may be carried out directly without the
need to first load the operand to be DECremented to the multibit accumulator.
While the DECrement instruction can be used with any multibit operand, it is most often
used in conjunction with Counters.
Example:
IF
I2.2
AND N I3.6
THEN DEC
R9
In addition to the statements previously explained, the following arithmetic operations are
available:
(, ), +, -, *, /, <, <=, =, >=, >, <>
These functions allow you to program arithmetic operations and comparisons.
Example:
IF
(
FW0
=
V1234
)
AND
(
R1
<>
V0
)
THEN...
Note! In statements of this type you must be absolutely clear whether you need parentheses
(brackets), and if so for which expressions. It is all too easy to corrupt the logical structure
by omitting or wrongly placing parentheses.
2.11.5.6
Module calls
The Call Function Module instruction is used to request execution of an external program
routine. Function modules may be considered similar to special function calls.
Function modules may be written in one of several languages including STL and C.
Some program modules may use function units (FU) to pass information to/from user programs and function modules. Depending upon the specific function module being called, it
may be necessary to provide several parameters when using a CFM, see WITH instruction.
Note! CFMs must not contain steps. No task switch takes place after a call to a CFM.
The Call Program Module instruction is used to request execution of an external program
routine. Program modules may be considered similar to subroutines.
FST Version 4.02.21 Manual
77
Program modules may be written in one of several languages including STL and C.
Some program modules may use function units (FU) to pass information to/from user programs and program modules. Depending upon the specific program module being called, it
may be necessary to provide several parameters when using a CMP, see WITH instruction.
Note!
It is not permissible to use the CMP instruction from within a program module.
After each call to a CMP a task switch will take place to allow for steps inside the program
modules.
The WITH instruction is used to pass parameters to function or program module calls using
the function units (FU).
Example:
IF
I1.2
THEN
CFM 0
WITH V2
2.11.6 Customising FST
There are several possibilities to customise the FST program and runtime library.
Preferences
FST offers some options that can be set to individual needs or preferences.
Select "Extras >> Preferences" from the menu to open the Preferences dialog.
2.11.6.1
The Project Directory
Using different project directories is useful to sort a larger amount of projects in groups. But
you have to remember the different locations where you have stored FST projects.
If you want to view or change the current common root directory for FST projects, select
"Extras >> Preferences..." from the menu. In the tabbed dialog that will be displayed select
the General tab. Enter the path of the new directory or press the Browse button to select an
already existing directory. Relative paths (beginning with a dot) are subdirectories of the
directory where you have installed FST.
78
After changing the directory path and closing the dialog the currently open project will be
closed.
Note! If you want to use DOS based tools for you project, such as fieldbus configurators, use
a project path that does not contain long file names (max. 8 characters) or spaces.
2.11.6.2
Communication Port Preferences
Select "Extras >> Preferences" from the menu to open the Preferences tabbed dialog. Select
"Communication Port" to choose the communication method and configure the specific
settings.
79
If you want to use TCP/IP for the online connection select the "use TCP/IP" radio button, or
"use RS232" to use RS232.
For the RS232 connection you have to specify a com port and a baud rate. The com port can
be selected from the first combo box. It offers all COM ports found on your PC. Choose the
baud rate from the second combo box. Please note that not all controllers allow high baud
rates. 9600 is usually a good choice, if not successful, try 2400. Please see the system
documentation of the controller for details.
If using TCP/IP you have to enter the IP address of the controller. If you check the option
"Save in Project" the settings will be stored in the project rather than for FST in general.
Press the OK button to accept the new settings. All online displays will be closed automatically if you have made any changes.
2.11.6.3
Statement List Preferences
To view or change the preferences for the Statement List editor select "Extras >> Preferences" from the menu and select the "STL editor" tab.
80
81
If you press the Browse button you will be asked for a printer to display the correct list of
available fonts before the standard font selection dialog is displayed.
Note! If you choose the margins smaller than the minimum printer margins, the printout will
be clipped.
2.11.7 The FST Runtime Library
FST allows configuring various input and output modules and drivers. All available drivers
are registered in the FST Runtime Library.
If new hardware is developed new IO scripts or drivers or updates will be needed. FST gives
the necessary support to manage the FST Runtime Library.
2.11.7.1
IO Scripts (Runtime Library)
Select "Extras >> Library..." from the menu to open the FST Library tool. "IO Modules" is
already the default tab.
82
Select the controller type for the library from the combo box above the list box.
The IO script description, the file name, and other information (see below) are displayed for each installed IO script in a separate column.
Adjust the width of each column by moving the separator in the header with the
mouse.
Each column except the last one of the list box can be sorted alphabetically by clicking on the column header. Click again to reverse the sorting order.
If you only want to display the IO script descriptions in a simple list, toggle the radio
buttons in the upper right corner of the dialog.
To deinstall the selected entry from the FST library press the DEL key or the Deinstall
button.
To install a new IO script press the INS key or the Install... button.
To extract the selected entry onto a floppy or somewhere else to be reinstalled later
press the Extract button.
The additional data in the list box is for your information only and cannot be edited.
In:
Number of input bytes that are used in the processor's IO area.
Out:
Number of output bytes that are used in the processor's IO area.
IW:
Number of FST input words that are occupied by a module of this type.
OW:
Number of FST output words that are occupied by a module of this type.
Switch
The possible switch positions for a module of this type.
FST Version 4.02.21 Manual
83
84
If you only want to display the driver names in a simple list, toggle the radio buttons
in the upper right corner of the dialog.
To deinstall the selected entry from the FST library press the DEL key or the Deinstall
button.
To install a new driver press the INS key or the Install... button.
To extract the selected entry onto a floppy or somewhere else to be reinstalled later
press the Extract button.
85
Title:
Enter here the text that will appear in the Extras menu. You can use the Ampersand sign (&)
to define the following character as the shortcut. It will be underlined in the menu text. To
insert an Ampersand type "&&".
Program:
Enter here the path for the program to be executed. Press the "..." button to browse through
the files on your computer. It is also possible to use the macros described below
Parameters:
Enter here the parameters for your program. It is also possible to use the macros described
below.
FST Version 4.02.21 Manual
86
87
In order to use an IPC as PLC, the necessary PLC operating system software must be loaded
into the IPC. For this, FST uses the runtime kernel FSTPCR22.EXE. This contains PLC properties that are always required. The kernel is also responsible for loading and executing the
user project.
For the controllers that are prepared for FST, the FST PLC operating system is automatically
started on power-up. Additional parts of the PLC operating system can be subsequently
loaded into the controller as modules and/or as drivers together with a user project. The
properties of the FST PLC operating system are described in the following sections.
3.1
PLC operands
PLC programs consist of program code for handling of data. This data is available to the PLC
in the form of operands. It contains not only the values of operands, but also flags and many
special operands with specific properties. These operands are the classical PLC operands.
Operands with a value of one bit only are differentiated from those with 16 bits, called
words. In some cases, the operands can be used either as a bit value or together in the form
of a word value. In the case of FST software this applies to all inputs, all outputs, and all
flags. All other operands can only be used either as word or only as bit.
Where operands can be accessed either as bit or jointly in the form of a word, the convention is that the least significant bit (extreme right) contains the bit with the number 0. It
therefore follows that the most significant bit (extreme left) is bit number 15.
Other operands have special properties defined by the operating system. For example all
counters can be used either in the form of a counter value as counter word CW and in the
form of a 1-bit counter status C (expired or not expired). Timers are a similar case, having a
timer word TW and a timer status T. The FST PLC operating system ensures that these operands always change their values accordingly.
The individual operand types and their application in programs are described in the following.
Abbreviations
b - Bit number
w - Word number
Value ranges of multibit operands: All multibit operands are 16-bit values.
0 to 65535
(Unsigned decimal)
-32768 to +32767
(Signed decimal)
$0000 to $FFFF (Hexadecimal)
3.1.1 Inputs
256 possible input words (0 to 255) each with 16 bits (0 to 15), can be addressed as words
and as bits.
Input (bit):
Syntax:
Iw.b
Operations: Interrogate
Input word:
Syntax:
Operations:
IWw
Compare
3.1.2 Outputs
256 possible output words (0 to 255) each with 16 bits (0 to 15), can be addressed as words
and as bits.
FST Version 4.02.21 Manual
88
Output (bit):
Syntax:
Operations:
Output word:
Syntax:
Operations:
Ow.b
Interrogate, set, reset,
assign, assign negated
OWw
Load, compare
3.1.3 Flags
10,000 flag words (0 to 9999) each with 16 bits (0 to 15), can be addressed as words and as
bits.
Flag (bit):
Syntax:
Fw.b
Operations:
Interrogate, set, reset,
assign, assign negated
Flag word:
Syntax:
FWw
Operations:
Load, compare
3.1.4 Registers
256 registers (0 to 255), can only be addressed as words.
Syntax:
Rw
Operations: Load, compare
3.1.5 Timers
256 timers (0 to 255), can be programmed as pulse timer (T)
Timer status (bit):
Syntax:
Tnn, TONnn, TOFFnn
Operations:
Interrogate, set, reset, assign,
assign negated
Timer value:
TWnn
Operations:
Load, compare
Timer preset:
Operations:
TPnn
Load, compare
A pulse timer allows an output to be activated for a pre-determined time by an input pulse.
A pulse timer responds only to a rising edge of the input condition (pulse). This occurs when
there is a change in status from 0 to 1. The pulse starts the timer (Tnn=1). The timer preset
(start value) is loaded into the timer word and the timer starts running. The timer word is
then decremented until:
It reaches the value 0, the timer has then expired (Tnn=0, TWnn=0)
Another rising edge (pulse) is detected in the conditional part, as a result of which
the timer is started again (timer restart)
The timer status is reset (Tnn=0, Twnn=0)
89
A pulse at input I0.1 activates the output for the length of time determined by the timer
preset (10 seconds). The normally closed contact in the first rung prevents the timer from
being restarted if it is already active.
Example:
IF
AND N
THEN SET
WITH
IF
THEN SET
OTHRWRESET
I0.1
T1
T1
10S
T1
O0.1
O0.1
3.1.6 Counters
Operations:
One-bit:
Interrogate, set, reset, assign, assign negated
Multibit:
Load, compare
C0 to C255
Counter status, one-bit
CW0 to CW255 Counter word, multibit
CP0 to CP255
Counter preset, multibit
3.1.7 Constants
Operations:
Vnnnn
Load, compare
Multibit
90
the command interpreter, for which the program number has to be specified: FUp.w (p =
program number, w = FU number 32 to 38).
3.1.9 Programs
Operations:
P0 to P63
Interrogate, reset
One-bit
Multibit
91
TV
C, CP, CW
FU
Password
3.1.13.1
Configuration of the driver for retentive operands
For the FEC Compact, FEC Standard, HC0X and HC20 CPUs the above-mentioned operands
are always retentive. It is not necessary to configure any driver or something else. The
retentive storage of the operands cannot be switched off. Use the function module F9 (see
below) to reset all operands if required.
In order to make the above-mentioned operands retentive in the HC1X CPUs, the driver for
retentive operands "DRAD" must be selected and parameterised in the driver configuration
of each project that wants to use retentive operands. For "Special parameters", the default
setting " -q" should normally remain. This option suppresses multiline output on the controller screen when the driver is started.
3.1.14 Function modules for modifying operands
Overview
CHECKSUM
Checksum for a subrange of flag words
COPY
Copy a subrange of flag words
DINDEXMW
Indexed decrementing access to flag words
F9
Reset operands
IINDEXMW
Indexed incrementing access to flag words
NINDEXMW
Delete certain range of flag words
RINDEXMW
Indexed read access to flag words
WINDEXMW Indexed write access to flag words
CHECKSUM
Check sum for a subrange of flag words
Input parameters
FU32 Number of the first flag word
FU33 Number of the last flag word
Output parameters
FU32 Check sum
Note! The check sum is formed by simple addition of the flag words.
COPY
Copy a subrange of flag words
Input parameters
FU32 Number of the first source flag word
FU33 Number of the first target flag word
FU34 Number of flag words
Output parameters
None
Note! The flag word ranges may overlap.
DINDEXMW
Indexed decrementing access to flag words
Input parameters
FU32 Index to flag word
Output parameters
FU32 Value read
Note! The given flag word will be decremented by 1 if it is not already 0.
FST Version 4.02.21 Manual
92
F9
Reset operands
Input parameters
FU32 = 0
Reset all registers, counters, timers, flags
=1
Reset all registers
=2
Reset all flags
=3
Reset all timers
=4
Reset a ll counters
Output parameters
None
IINDEXMW
Indexed incrementing access to flag words.
Input parameters
FU32 Index of the flag word
Output parameters
FU32 Value that is read
Note! The given flag word will be incremented by 1 if it is not a lready 65535 ($FFFF).
NINDEXMW
Delete defined range of flag words
Input parameters
FU32 Index of the flag word
FU33 Number of flag words to be deleted
Output parameters
None
RINDEXMW
Indexed read access to flag words
Input parameters
FU32 Index of the flag word
Output parameters
FU32 Value read
WINDEXMW
Indexed write access to flag words
Input parameters
FU32 Index of the flag word
FU33 New value
Output parameters
None
93
3.2
Multitasking
The FST PLC operating system supports multitasking. It can execute the processing cycles of
a number of programs one after the other (referred to as tasks). While in a task one program
is being processed, the other currently active programs are not processed. However, execution of the program segments and switching to the next program (task change) takes place
so quickly that the programs appear to run in parallel. This is known as pseudo-parallel
program execution.
A task change takes place:
In STL step programs: after a step has been processed
In STL parallel logic programs: at the end of the program
In LDR programs: at the end of the program and after execution of a jump
In all programs: after a program module (CMP) is called
A program n can be activated (started) and deactivated (stopped) from within another program or module. The program is activated by setting the operand Pn, and
deactivated by resetting it.
STEP
IF
THEN SET
Call
I0.1
P2
RESET P4
A rising edge at I0.1 activates program number 2 and deactivates program number 4. The
program represented here and program 2 then run in pseudo-parallel mode.
Note!
Pseudo-parallel processing of a number of programs may considerably slow down
execution of individual programs in comparison with execution of one program on
its own.
If several programs are running in pseudo-parallel mode, the order in which they are
processed is identical to the order in which the programs were activated.
When a program starts another program, initially the latter program is only activated (included in the list of programs to be processed). It is not started until it is 'its turn'.
In the first example, program 0 (STL) starts program 4 (LDR) in step 1, program 4 in turn
starts program 3 (LDR). The order in which they are processed is as follows:
Program 0
Program 4
Program 0
Program 3
Program 4
Program 0 ... etc.
In the STL program, only one step is executed each time
In the second example, program 0 (STL) starts program 4 (STL) in step 1, program 4 in turn
starts program 2 (STL) in step 2. The order of processing is as follows:
Program 0
Step 1
Program 4
Step 1
Program 0
Step 2
Program 4
Step 2
Program 0
Step 3
Program 2
Step 1
Program 4
Step 3
Program 0 ... etc.
FST Version 4.02.21 Manual
94
Note!
Function modules and program modules are a fixed part of the calling program (i.e.
sub-routines). They are not processed in parallel with the calling program. They are
processed in the task of the calling program. A task change always takes place after
a program module is called, not after the call of a function module (This is a new feature of FST version 4!).
There is no limit to the number and type of programs that can be a ctive at the same
time.
For diagnostic purposes the current status of a program can be determined in online
mode with the display command. The response from the command interpreter to the
DPn command takes the following form:
= <type>,0,<status>,<step_number>
<type>: STL=0; LDR, FUP=1; C=2
Description of the third parameter:
..,..,0,.. The program is inactive.
It is not involved in the task change. (Pn=0)
..,..,2,.. The program is active, but suspended.
It is involved in the task change. (Pn=1, PSn=0)
..,..,3,.. The program is active and running.
Its task is being processed. (Pn=1, PSn=1)
3.2.1 The Start/Stop Switch
After reboot the project will always start automatically unless you have a start/stop input or
built in run/stop switch. A start/stop input or built in run/stop switch has the same influence on the running state of the project. The start/stop input can be configured in the
Controller Settings of the project.
At start-up the project will only start automatically if the internal switch (if any) is switched
to run and the s tart/stop input (if configured) is set.
During run time a reaction is always edge sensitive.
A falling edge (switching from run to stop) will cause all programs to be inactivated (resetted) or stopped (breaked), depending on the option "Reset programs" of the Controller
Settings.
A rising edge/switching from stop to run will start program 0 and all stopped (breaked)
programs, depending on the option "Reset programs" of the Controller Settings.
3.2.2 The Run LED
The Run LED of the FEC and HC0X controllers shows the current status of operation:
GREEN
programs are executed
YELLOW
no programs are executed
RED
an FST error occurred
3.2.3 Function blocks to control the execution of programs
Overview
F4
Start cyclical execution of a program.
F8
Stop all cyclical programs.
F23
Interrogate whether a program is ready for execution.
F26
Control programs whose numbers are stored in variables.
FST Version 4.02.21 Manual
95
F4
Start cyclical execution of a program.
Input parameters
FU32 Program number, 0 to 63
FU33 Time in msec, 1 to 65535
or 0 to deactivate
Output parameters
None
Note!
The resolution is 13.74 msec (5ms for the FEC Standard). All times specified in FU33
are truncated to a multiple of 13.74 msec (5ms for the FEC Standard). Instead of 100
msec, therefore, only 96.18 msec (100ms for the FEC Standard).
Function module F4 can be used more than once. In order to stop c yclical processing
for a program again, a value 0 must be specified in FU33. See also F8
A cyclical program must reset itself with RESET P in order to be called again when
the next interval has elapsed.
F8
Stop all cyclical programs.
Input parameters
None
Output parameters
None
Note! This module terminates the cyclical processing of programs. It is effective for all programs that are entered as cyclical with F4, it is therefore not selective. F4 must be used to
remove a single program from cyclical processing.
F23
Interrogate whether a program is ready for execution.
Input parameters
FU32 Number of the program
Output parameters
FU32 = 0
Program does not exist or
is not ready for execution
= -1 Program can be started
F26
Control programs whose numbers are stored in variables.
Input parameters
FU32 Number of the program
FU33 = 0
Start program
=1
Stop program
=2
Resume interrupted program
=3
Interrupt program
Output parameters
None
3.3
Error Handling
Errors can always occur in an automated system. One has to differentiate program errors
and system errors. A program error, for example, is division by zero. A system error, for
example, is the failure of an I/O group. The FST PLC operating system detects numerous
errors and handles them in a fixed way. The user can participate in error handling and, if
required, in solution of the problem. The error program is intended for this purpose.
If an error occurs during operation, a number is entered into the error word. This numbe r
corresponds to the error that has occurred (error number). At the same time two other
numeric values are stored, specifying more closely the location where the error occurred.
Generally, these are program number and step number. If the program does not have any
steps, the step number is zero. If the error does not occur in a program, the program number
is 255. In the case of I/O errors, the base address of the corresponding module is entered in
the second position, otherwise zero.
FST Version 4.02.21 Manual
96
A new error can be entered if the error word has the value zero, that is, if no other error has
occurred. This means that only the first error is stored. Later errors are ignored. If an error
output has been configured, this follows the error word. If it is non-zero, it is set. When it is
reset, the error output is also reset. Otherwise the error output can be interrogated by a
program in the same way as any other output.
3.3.1 Error handling without error program
If a new error is entered, all programs are stopped and all outputs (except the error output)
are reset (only if the option "Reset Outputs" in the Controller Settings is selected).
The error word and other information can be interrogated as operand E or EW or with function module F22, subfunction 0. The error is not reset by this interrogation. It can be reset by
resetting the error E or EW or with function module F22, subfunction 1.
If E or EW is set to a non-zero value, this corresponds to the occurrence of a new error and is
only possible if EW was previously zeroed.
Unloading the active project in the controller (Y) or loading a new project deletes the error
word and the error output, but not the starting and stopping of the project or individual
programs (CI, Run/Stop switch).
Note! Before restarting a project following an error, the error should be deleted (acknowledged) to allow the detection of a new error.
3.3.2 Error handling with error program
The error program is basically a normal FST program but it cannot be program P0. The
program to be used as error program is defined in the Controller Settings for the project or
with function module F21. F21 also allows the program to be modified or deactivated at any
time.
When set via the Controller Settings, the linker-loader checks whether the selected program
exists. Function module F21 does not carry out this check. If a non-existent program is
selected, the system behaves as if no error program were set.
If an error occurs, the error program is called immediately and exclusively. The programs
active at the time of error occurrence "sleep" as long as the error program is being executed
(active). If the error occurs in a program, this program is stopped before the error program is
called.
The error program can be a step program. Instead of the normal task change, a simple I/O
scan is carried out, but no other programs are executed. This applies also for cyclical programs. The statuses of programs can be modified in the error program (or via the CI), but
these continue to "sleep" as long as the error program is executing.
When function module F22, subfunction 2 is called, the "sleeping" programs are "woken".
Task change between the programs now takes place again as usual. All active programs are
executed, with execution continuing at the interruption point. Status changes by the error
program are taken into account. Calling function module F22, subfunction 2 also deletes the
error. If function module F22, subfunction 2 is called without an error program being exclusively executed, the error is deleted without any other action being taken. The error will not
be inactivated automatically, however.
97
F22, subfunction 3 resets all programs and outputs (even if the flag "Reset Programs" of the
Controller Settings is not set). The error and any error output are retained. It is not important
whether the call comes from the error program or elsewhere and independent of whether an
error is set or whether an error program is configured and/or active.
If an error occurs while the error program is active, all programs are stopped and all outputs
are reset in machine code. It is not important whether the error program was started by an
error or by a normal program call. If no error was entered, the new error is entered. If the old
error was not deleted, error number 39 "double error" is entered. The two additional information items contain the error source, as usual (i.e. the number of the error program and
the active step of the error program when the error occurred).
3.3.3 Special treatment of I/O Errors
The I/O errors 11 and 12 are treated a little bit different. Once error 11 or 12 has occurred
another error 11 or 12 will not happen again. To enable error 11 or 12 again, you have to
execute function module F25 (see below). If a project is started with the R command, I/O
errors will also be enabled again.
3.3.4 Error handling function modules
Overview
F21
Set or interrogate a program for error handling.
F22
Set error handling.
F25
Set error handling in the event of I/O errors.
F21
Set or interrogate a program for error handling
Input parameters
FU32 Number of the program for error handling or
0 to reset the function, or an inadmissible
program number (>= 64) to determine the current setting.
Output parameters
FU32 Current number of the program for error
handling
Note! Alternatively, an error program can also be set in the Controller Settings of the project.
F22
Set error handling
Input parameters
FU32
=0
=1
=2
=3
Output parameters
FU32
FU33
FU34
FU35
Error number
Program number
Step number
Always 0 (error address)
F25
Set error handling in the event of I/O errors
Input parameters
FU32 = 0
Deactivate the error detection
=1
Activate the error detection, default setting
Output parameters
None
FST Version 4.02.21 Manual
98
11
12
13
Watchdog activated
14
99
39
Arithmetic error.
Correct program.
57
59
Reload project.
Note! Drivers and modules can trigger other errors that are not listed here. These are then
described in the appropriate driver documentation.
3.4
The Command Interpreter (CI)
All Festo controllers have a Command Interpreter. It is generally called "CI". The CI is not a
man-machine interface. It is often used manually, however, as it provides a really simple
interface. The Command Interpreter interface is also used for a range of tasks by the FST
programming tool. The various program parts of the FST software handle communication
with the connected controller automatically and provide a much more powerful and convenient user interface.
The CI, which is part of the of the FST PLC operating system, can be operated as a terminal
or terminal emulator via the controllers serial interface (usually COM or COM1). As an option the COM port that is used for the CI on the controller can be changed to another COM
port in the Controller Settings of each project. This is pa rticularly useful, if you want to make
use of a FIFO that is supported by e.g. COM2, but not COM1.
This is the naming convention for the main CI COM port for the different controller types:
Controller
Port number
Description
FECs
HC0X
1
2
100
HC16
HC2X
In addition to the CI interface on a COM port, CI commands can be entered via the connected
keyboard and the results displayed on the connected monitor for HC1X and HC2X CPUs.
Using FST drivers a CI interface can be made available on additional interfaces like COM
ports and over TCP/IP.
Please note that the additional CI interfaces are restricted in some features (see below).
3.4.1 Command input
CI commands consists mainly of a single line as input and a response in the same line. The
majority of commands are not case-sensitive. Incorrect entries can be corrected with Backspace (Ctrl H) before concluding with CR (Enter).
Example:
>DF=0,0,0
>
The DF command interrogates the controllers error status. If no error is present, the controller responds "=0,0,0". Following pressing of the keys D, F, and CR, the entry is shown in the
screen and the IPC adds its response and redisplays its prompt. Invalid commands result in
the error message "ACCESS ERROR" or, rarely, the abbreviated form "ERR". Also, an acoustic signal sounds from the speaker.
Command
<command> "\r"
Response
Error Response
<command>
"b\r\nACCESS ERROR\r\n>\21"
101
102
After BREAK switch cyclically 2 times to 9600 Baud, 1 times to 2400 Baud (default).
Always 9600 Baud (old method)
Always 2400 Baud (useful for slow modem connections and Field PC Net alias
MpRAM).
After BREAK switch cyclically 3 times to 2400 Baud, 2 times to 9600 Baud.
All methods allow changing to any baud rate after login (see the MV command). After booting method 1 will be selected. After loading a project using Field PC Net method 4 will automatically be applied. The methods 1, 2 and 4 allow a connection with the any old FST host
software. From time to time the login may not succeed at once. Try again by hitting a key as
displayed by the FST host software. The new FST host software 3.21 knows about the different baud rates and will adapt to them.
The login method can also be selected by the function module COM1METH.
COM1METH
Input parameters
FU32 0
2x9600, 1x2400
1
always 9600
2
always 2400
3
3x2400, 2x9600
Return parameters
FU32 current/new login method
3.4.7 X Release interface
The X command releases the serial port used for the CI (usually COM1). This command only
works when entered via the serial port.
3.4.8 Commands for display of operands and statuses
DA[<YN>.]<WN>.<BN>
Display output bit
DAW[<YN>.]<WN>
Display output word
FST Version 4.02.21 Manual
103
DB<BN>
Display program module
The response consists of "=,0, , ".
The first value is the module type, either STL=0 LDR/FUP=1 or C=2.
The second value, memory range, is always 0.
The third value shows the status of the calling program.
The last value is the current step number within the module.
DBF<BN>
Display function module
The response consists of "=,0, , ".
The first value is the module type, either STL=0 LDR/FUP=1 or C=2.
The second value, memory range, is always 0.
The third value shows the status of the calling program.
The last value is the current step number within the module.
DD
Display current setting for decimal/hexadecimal display of words
The output is
"=D" for decimal display, unsigned
"=S" for decimal display, signed
"=H" for hexadecimal display
DE[<YN>.]<WN>.<BN>
DEW[<YN>.]<WN>
DF
Display error status word
Output:
Value of the status word
Number of program in which the error occurred
Step number within this program for example, "=59,3,24".
In the event of I/O errors, the program number shows the value 255 and the step number
shows the number of the input or output word in which the error occurred
DM<WN>.<BN>
Display flag bit
DMW<WN>
DO<WN>
Display function unit
The global function units FU0 to FU31 and FU39 to FU255 can be displayed.
DO<PN>.<WN>
Display local function unit
The local function units FU32 to FU38 can be displayed. These function units are separate
for each program.
DP<PN>
Display program status
6 values are given as a response.
The first value is the module type, either STL=0 LDR/FUP=1 or C=2.
The second value, memory range, is always 0.
The program status is the third value. Either 0 for inactive, 2 for active and halted, or 3 for
active and processing.
The fourth value is the step number. It is non-zero for STL step programs and ladder diagrams with branches as long as the program is active. When a step program is not yet a ctive, it is in step 0.
The two last values are the number and the step of a called module, if appropriate.
DR<RN>
FST Version 4.02.21 Manual
Display register
104
DS<PN>
DT<TN>
DTA<TN>
DTE<TN>
DTV<TN>
DTW<TN>
DV
Display baud rate
The DV command shows the current baud rate setting. Possible values are "=1200",
"=2400", "=4800", "=9600", "=19200", "=38400" or "=56000".
DZ<ZN>
DZV<ZN>
DZW<ZN>
MD={D | S | H}
Set display mode
The display mode can be set to decimal unsigned "=D", decimal signed "=S" or to hexadecimal "=H".
ME[<YN>.]<WN>.<BN>={0 | 1}
MEW[<YN>.]<WN>=
MF=<number>
Modify error word
The value 0 deletes the current error. Any other value generates the appropriate runtime
error.
MM<WN>.<BN>={0 | 1}
MMW<WN>=<number>
MO<WN>=<number>
Modify global function unit
Modifies global function units FU0 to FU31 and FU39 to FU255.
MO<PN>.<WN>=<number>
Modify local function unit
Modifies local function units FU32 to FU38. These function units are separate for each program.
MR<RN>=<number>
Modify register
MT<TN>={0 | 1}
MTA<TN>={0 | 1}
MTE<TN>={0 | 1}
MTV<TN>=<number>
MTW<TN>=<number>
MV=<baud>
105
Set counter
Set counter preset
Set counter word
106
Note!
I/Os may only be forced during troubleshooting. A "finished" product must not contain forced I/Os.
The force table is not retentive.
The force table is automatically deleted by a Y command or by loading a project.
This feature is not available for all controller types. Forcing is supported for HC1x
and HC20 CPUs in general, for FECs and HC0X CPUs starting from kernel version
2.25.
The following CI commands are available for forcing I/Os:
YF
DAF<WN>.<BN>
Result
Forced to 0
Forced to 0
Not forced
DAWF<WN>
Display output word
Result "=xxxxxxxxxxxxxxxx", bitwise with
=0
Forced to 0
=1
Forced to 0
=N
Not forced
DEF<WN>.<BN>
Result:
Forced to 0
Forced to 0
Not forced
DEWF<WN>
Display input word
Result "=xxxxxxxxxxxxxxxx", bitwise with
=0
Forced to 0
=1
Forced to 1
=N
Not forced
MAF<WN>.<BN>={0 | 1 | N}
Entry in force table for output bit setting
=0
Force to 0
=1
Force to 1
=N
Do not force
MAWF<WN>={val | N}
Entry in force table for output word setting
=val Force to value given
=N
Do not force
MEF<WN>.<BN>={0 | 1 | N}
Entry in force table for input bit setting
=0
Force to 0
=1
Force to 1
=N
Do not force
MEWF<WN>={val | N}
=val
=N
FST Version 4.02.21 Manual
108
Output parameters
F11
Set date
Input parameters
Output parameters
F12
Get time
Input parameters
Output parameters
F13
Get date
Input parameters
Output parameters
FU32
FU33
FU34
FU35
None
Hour (0 to 23)
Minute (0 to 59)
Second (0 to 59)
1/100 Seconds (0 to 99)
Hour (0 to 23)
Minute (0 to 59)
Second (0 to 59)
1/100 Seconds (0 to 99)
None
FU32
FU33
FU34
FU35
109
3.6
Miscellaneous
On drive B: are 120 KB (FC20 90 KB, FC34 H01 or newer 370 KB)
available for programs and drivers. Also, the Startup file - which is
generated automatically by FST - should be loaded on this drive.
Drive A: is occupied by system files. No user files can
be stored on this drive.
FEC Standard
On drive B: are 360 KB available for programs and drivers. Also, the
Startup file - which is generated automatically by FST - should be
loaded on this drive.
Drive A: is occupied by system files. No user files can
be stored on this drive.
HC0X
HC1X
ROM/RAM disk:
If no diskette drive is connected to the controller or no disk is inserted, the ROM/RAM drive is becomes drive A.
The ROM areas of this drive already contains various driver files
for use with the FST.
The RAM area has approx. 84 KB available for the project file
and/or other drivers.
Flash-Disk:
The Flash-Disk is drive C.
This drive has 512 KB available for the project file and other drivers.
Also, the Startup file - which is generated automatically by FST should be loaded on this drive.
Note! For each STL instruction approx. 10 bytes of code are generated.
110
None
FU32 4 blink bits
Bit
Change / sec Frequency / Hertz
0
0.25
2
1
0.5
1
2
1
0.5
3
2
0.25
Note!
This module does not use a timer. The module has to be called repeatedly in order to update
the blink bits.
FIFO
First-in-first-out storage
Input parameters
FU32 Mode
=0
To reset the FIFO
=1
To incorporate the value from FU 33 into FIFO
=2
To read out the next value from FIFO
=3
To determine the number of values stored in FIFO
Otherwise no function
FU33 If mode = 1 the new value
Output parameters
FU32 If mode (input) ...
=1
Returns 0 if successful,
otherwise 1 if no memory
=2
Next value from the FIFO or
0 if FIFO empty
=3
Number of values stored in the FIFO
Otherwise no value returned
LOADSYNC
Synchronisation of project (re-)loading
Input parameters
FU32 = 0
Prevent project loading
=1
Allow project loading
FST Version 4.02.21 Manual
111
Output parameters
None
Note! The CI commands S and Y! Always switch over to project loading allowed.
112
This manual describes the drivers and modules of the FST Runtime Library.
4.1
Input and output modules
This chapter describes the input and output modules supported by the FST IPC. This chapter
is not intended to replace the manual supplied, however, but focuses on special points of
FST IPC application. For pin assignment and technical data please refer to the manual supplied with the hardware.
4.1.1 PLC security
Most I/O modules are equipped with a PLC security function. This allows the runtime system
(FST IPC Kernel) to monitor the presence of configured modules when a project is started
and the function of the module at runtime. An FST error is triggered if a fault is detected. The
error numbers used are
11
12
Error 12
If Error 12 occurs, the configured module could not be found or there were several modules
with the same physical I/O address on the busboard.
Error 11
If Error 11 occurs, either the module is faulty, you have not connected the required external
power supply, or there is a short-circuit. For information on this, see the status input word
for the appropriate module. An additional FST input word has been assigned to each module
that supports this feature. The assignment of the individual bits is module-specific as shown
in the following table. Please note that the status input word is updated during each cycle.
Procedure for overload/short-circuit
In the event of a short-circuit (or an overload), please observe the following points.
It must be ensured that the output cannot be set until the cause of the problem has been
eliminated. If you are working in machine mode and have not set an error program, all outputs are automatically switched off when an error occurs. In system mode or if an error
program has been started you yourself must ensure that the output involved is reset. You
can evaluate the error information and the status input word to determine the output involved. Here you should bear in mind that the outputs are normally grouped in sets of 8 that
must be reset together.
Working without PLC security
If you do not wish to use the PLC security function for a module, you can select the appropriate module driver in the FST IPC I/O configurer. The following table shows the I/O modules and the appropriate drivers without security.
Module
OM11
OM40
OM21
IM11
IM51
113
Features
2x8 digital inputs
2x8 digital inputs
4x8 digital inputs
2x8 digital inputs (npn)
2x8 digital outputs
2x8 digital outputs
4x8 digital outputs
2x8 digital outputs (1A)
8 digital inputs,
8 digital outputs
8 digital inputs,
8 digital outputs
2x8 digital inputs,
2x8 digital outputs
6 relays (changeover contacts)
6 relays (changeover contacts)
16 relays (break contacts)
16 relays (break contacts)
16 digital inputs (TTL),
16 digital outputs (TTL)
16 digital inputs (TTL),
16 digital outputs (TTL)
8 pushbuttons, 8 LEDs
32 LEDs (red/green)
16 switches (E-M-E)
32 LEDs (green)
4.1.2.1
IMXX
IM10
2x8 opto-isolated digital inputs
Inputs:
Outputs:
Input words:
Output words:
Switch positions:
Sum of inputs:
Sum of outputs:
Special features:
Module identification:
Module check:
Status information
(additional input words):
Assignment of input words:
IW 15 14 13 12 11
0
E1
FST Version 4.02.21 Manual
Ident/Check/Status
*/*/1
*/*/2
*/*/1
*/*/1
*/*/2
*/*/1
*/*/1
*/*/2
*/*/0
*/*/0
*/*/0
-
16
1
1 to 9
144
10
5
E0
0
114
10
5
4
E0
Status 0
115
10
5
4
E0
E2
Status E0
Status E2
10
5
E0
E2
116
10
5
4
E0
Status Eo
5
A0
16
1
1 to 9
144
10
OM 11 PLC security
2x8 opto-isolated digital outputs with PLC security and control LEDs for the outputs
Inputs:
Outputs:
16
Input words:
Output words:
1
Switch positions:
1 to 8
Sum of inputs:
Sum of outputs:
128
Special features:
Module identification:
Yes
Module check:
yes
FST Version 4.02.21 Manual
117
Status information
(additional input words):
5
4
A0
6
5
4
Status A0
5
4
A0
A2
6
5
4
Status A0
Status A2
118
4
5
6
7
Reserved
Reserved
Reserved
Reserved
OM12
4x8 opto-isolated digital outputs with control LEDs for external 24V supply and overload
Inputs:
Outputs:
32
Input words:
Output words:
2
Switch positions:
1 to F
Sum of inputs:
Sum of outputs:
480
Special features:
Module identification:
No
Module check:
no
Status information
(additional input words):
Assignment of input and output words:
OW 15 14 13 12 11 10 9
0
A1
1
A3
5
A0
A2
5
4
A0
6
5
4
Status A0
119
4
5
6
7
Reserved
Reserved
Reserved
Reserved
OM20
2x8 opto-isolated digital outputs, 2x8 opto-isolated digital inputs
Inputs:
8
Outputs:
8
Input words:
1
Output words:
1
Switch positions:
1 to 9
Sum of inputs
72
Sum of outputs
72
Special features
Module identification:
Module check:
Status information
(additional input words):
Assignment of input and output words:
IW
15
14
13
12
11
10
0
OW 15
14
13
12
11
10
0
7
E0
7
A0
7
6
EO
7
A0
Status A0
6
5
4
Function
Reserved
Overload / short circuit
120
2
3
4
5
6
7
NO 24V
-
Reserved
No external voltage
Reserved
Reserved
Reserved
Reserved
Function
Reserved
Reserved
Reserved
No external voltage
Reserved
Reserved
Reserved
Reserved
5
4
3
E0
Status A0
Status A1
6
5
4
3
A0
121
6
7
Reserved
Reserved
8
8
7
E0
7
5
A0
122
10
5
K5
4
K4
3
K3
2
K2
1
K1
0
K0
3
K3
2
K2
1
K1
0
K0
OM70
6 relay outputs (changeover contacts) with indicator LEDs
Inputs:
Outputs:
6
Input words:
Output words:
1
Switch positions:
1 to 9
Sum of inputs:
Sum of outputs:
56
Special features:
Relay changeover contacts
Module identification:
Module check:
Status information
(additional input words):
Assignment of output words:
OW 15 14 13 12 11
0
10
5
K5
4
K4
10
7
K0
OM74
16 relay outputs (break contacts) with indicator LEDs
Inputs:
Outputs:
16
Input words:
Output words:
1
Switch positions:
1 to F
Sum of inputs:
Sum of outputs:
240
FST Version 4.02.21 Manual
123
Special features:
Module identification:
Module check:
Status information
(additional input words):
Assignment of output words:
OW 15 14 13 12 11
O
K1
10
5
K0
10
5
K0
OM75
16 relay outputs (break contacts) with indicator LEDs max. switching current per relay contact 2 A
Inputs:
Outputs:
16
Input words:
Output words:
1
Switch positions:
1 to F
Sum of inputs:
Sum of outputs:
240
Special features:
Reed relay, break contacts 2A
Module identification:
Module check:
Status information
(additional input words):
Assignment of output words:
OW 15 14 13 12 11
0
K1
FST Version 4.02.21 Manual
10
5
K0
124
4.1.2.3
TM10
TM10 PLC security
16 digital outputs (TTL), 16 digital inputs (TTL), with PLC security
Inputs:
16
Outputs:
16
Input words:
1
Output words:
1
Switch positions:
1 to 9
Sum of inputs:
144
Sum of outputs:
144
Special features:
TTL (5V)
Module identification:
Yes
Module check:
Yes
Status information
(additional input words):
Assignment of input and output words:
IW 15 14 13 12 11 10 9
0
E1
OW 15 14 13 12 11 10 9
0
A1
5
E0
6
5
A0
TM10
16 digital outputs (TTL), 16 digital inputs (TTL)
Inputs:
16
Outputs:
16
Input words:
1
Output words:
1
Switch positions:
1 to 9
Sum of inputs:
144
Sum of outputs:
144
Special features:
TTL (5V)
Module identification:
Module check:
Status information
(additional input words):
Assignment of input and output words:
IW 15 14 13 12 11 10 9
0
E1
OW 15 14 13 12 11 10 9
0
A1
5
E0
6
5
A0
4.1.2.4
ASXX
AS11
Universal display/switch-module with 8 pushbuttons and 8 LEDs
Inputs:
8
Outputs:
8
Input words:
1
Output words:
1
Switch positions:
1 to 6
FST Version 4.02.21 Manual
125
Sum of inputs:
Sum of outputs:
Special features:
Module identification:
Module check:
Status information
(additional input words)
48
48
Pushbuttons and LEDs only
8
5
8
5
7
7
6
4
6
4
4
3
4
3
2
2
2
2
0
1
0
1
AS12
Universal display/switch-module with 32 LEDs (16 red, 16 green)
Inputs:
Outputs:
32
Input words:
Output words:
2
Switch positions:
1 to 5
Sum of inputs:
Sum of outputs:
160
Special features:
LEDs only
Module identification:
Module check:
Status information
(additional input words):
Assignment of output words:
OW 15 14 13 12 11
0
A (green)
1
B (red)
10
AS13
Universal display/switch-module with 16 switches (E-M-E)
Inputs:
32
Outputs:
Input words:
2
Output words:
Switch positions:
1 to 5
Sum of inputs:
160
Sum of outputs:
Special features:
16 switches (E-M-E)
Module identification:
Module check:
Status information
(additional input words):
Assignment of input words:
IW 15 14 13 12 11
0
A
FST Version 4.02.21 Manual
10
126
AS14
Universal display/switch-module with 32 LEDs (green)
Inputs:
Outputs:
32
Input words:
Output words:
2
Switch positions:
1 to 5
Sum of inputs:
Sum of outputs:
160
Special features:
LEDs only
Module identification:
Module check:
Status information
(additional input words):
Assignment of output words:
OW 15 14 13 12 11
0
A
1
B
10
4.1.2.5
Address assignment matrix
The following tables are very helpful for planning ad-dressing of the individual modules. The
columns show the I/O modules, the rows show the processor I/O a ddresses. The module
address is set by means of the rotary switch on the underside of the module. Depending on
the module and switch position, the range shown for the switch position is assigned. All
addresses are shown in hexadecimal notation.
The same switch position may occur for different modules, but any single processor I/O
address can only be assigned once. This means that a module assigns all table rows associated with a switch position. There is a separate address range for inputs and outputs. The
FST IPC I/O configurer supports you in assigning addresses / switch positions. You would
always begin with the module that takes up the fewest I/O addresses, as it is then easier to
find space for the remaining modules.
Table 2: Address assignment digital output modules part I
AS11
120-123
1
220-223
2
320-323
3
1A0-1A3
4
2A0-2A3
5
3A0-3A3
6
127
A
B
C
D
E
F
128
OM22
1
TM10
1
AS13
1
A+
Resolution
12 bit
12 bit
12 bit
12 bit
PLC Security
*/-/-
16 bit
*/-/-
12 bit
*/-/
12 bit
12 bit
12 bit
12 bit
12 bit
129
4.1.3.1
IO1X
IO10
8 analog inputs, 0 to 4.096V, 12-bit
Input words (channels):
Output words (channels):
Switch positions:
Sum of inputs:
Sum of outputs:
Range:
Resolution:
Special features:
Module identification:
Module check:
Assignment of input words:
IW 15 14 13 12
0
1
2
3
4
5
6
7
Register value
0
100
200
500
1000
2000
4095
8
1 to 4
32
0 to 4,096V
12 bit
11
10 9
Channel # 1
Channel # 2
Channel # 3
Channel # 4
Channel # 5
Channel # 6
Channel # 7
Channel # 8
Physical value
0.000 V
0.100 V
0.200 V
0.500 V
1.000 V
2.000 V
4.095 V
IO11
8 analog inputs, 0 to 20mA, 12bit
Input words (channels):
8
Output words (channels):
Switch positions:
1 to 4
Sum of inputs:
32
Sum of outputs:
Range:
0 to 20mA
Resolution:
12 bit
Special features:
Module identification:
Module check:
130
IO12
8 analog inputs, 0 to 10V, 12 bit
Input words (channels):
8
Output words (channels):
Switch positions:
1 to 4
Sum of inputs:
32
Sum of outputs
Range:
0 to 10V
Resolution:
12 bit
Special features:
Module identification:
Module check:
Assignment of input words:
IW 15 14 13 12
0
1
2
3
4
5
6
7
Register value
0
410
819
2048
4095
11
10 9
Channel # 1
Channel # 2
Channel # 3
Channel # 4
Channel # 5
Channel # 6
Channel # 7
Channel # 8
Physical value
0V
1V
2V
5V
10V
131
4.1.3.2
IO4X
IO40 -10V to +10V
4 analog inputs, -10V to+10V , 12 bit
Input words (channels):
4
Output words (channels):
Switch positions:
1 to 6
Sum of inputs:
24
sum of outputs:
Range:
-10V to +10V
Resolution:
12 bit
Special features:
Module identification:
Yes
Module check:
Assignment of input words:
IW 15 14 13 12
0
1
2
3
11
10 9
Channel # 1
Channel # 2
Channel # 3
Channel # 4
Register value
- 2048
- 1024
0
205
1023
2047
Physical value
- 10 V
- 5V
0V
1V
5V
10 V
IO40 0V to 10V
4 analog inputs, 0V to 10V , 12 bit
Input words (channels):
4
Output words (channels):
Switch positions:
1 to 6
Sum of inputs:
24
Sum of outputs:
Range:
0V to 10V
Resolution:
12 bit
Special features:
Module identification:
Yes
Module check:
Assignment of input words:
IW 15 14 13 12
0
1
2
3
11
10 9
Channel # 1
Channel # 2
Channel # 3
Channel # 4
132
Register value
0
410
819
2048
4095
Physical value
0V
1V
2V
5V
10 V
4
1 to 6
24
-5V to +5V
12 bit
Yes
11
10 9
Channel # 1
Channel # 2
Channel # 3
Channel # 4
Register value
-2048
-1024
0
205
1023
2047
IO40 0V to 5V
4 analog inputs, 0V to 5V, 12 bit
Input words (channels):
Output words (channels):
Switch positions:
Sum of inputs:
Sum of outputs:
Range:
Resolution:
Special features:
Module identification:
Module check:
Physical value
-5.0 V
-2.5 V
0.0 V
1.0 V
2.5 V
5.0 V
4
1 to 6
24
0V to +5V
12-bit
Yes
133
1
2
3
Channel # 2
Channel # 3
Channel # 4
Register value
0
410
819
1638
2048
4095
Physical value
0.0 V
0.5 V
1.0 V
2.0 V
2.5 V
5.0 V
1 to 6
24
-10V to +10V
16 bit
Yes
10
Physical value
- 10 V
-5V
0V
1V
5V
10 V
IO41 0V to 10V
4 analog inputs, 0V to 10V, 16 bit
Input words (channels):
Output words (channels):
Switch positions:
Sum of inputs:
Sum of outputs:
Range:
Resolution:
Special features:
Module identification:
FST Version 4.02.21 Manual
4
1 to 6
24
0V to 10V
16 bit
Yes
134
Module check:
Assignment of input words:
IW 15
14 13 12 11
0
Channel # 1
1
Channel # 2
2
Channel # 3
3
Channel # 4
Register value
0
6554
13107
32768
65535
10
Physical value
0V
1V
2V
5V
10 V
10
Physical value
-5.0 V
-2.5 V
0.0 V
1.0 V
2.5 V
5.0 V
IO48 0 to 20mA
4 analog inputs, 0 to 20mA, 12 bit
Input words (channels):
4
Output words (channels):
Switch positions:
1 to 6
Sum of inputs:
24
FST Version 4.02.21 Manual
135
Sum of outputs:
Range:
Resolution:
Special features:
Module identification:
Module check:
Assignment of input words:
IW 15 14 13 12
0
1
2
3
Register value
0
204
819
1024
2048
4095
0 to 20mA
12 bit
Yes
11
10 9
Channel # 1
Channel # 2
Channel # 3
Channel # 4
Physical value
0 mA
1 mA
4 mA
5 mA
10 mA
20 mA
11
10 9
Channel # 1
Channel # 2
Channel # 3
Channel # 4
Physical value
4 mA
8 mA
12 mA
16 mA
20 mA
136
4.1.3.3
I06X
IO60/IO61 -10V to +10V
4 analog outputs, -10V to 10V, 12 bit
Input words (channels):
Output words (channels):
4
Switch positions:
0 to 4
Sum of inputs:
Sum of outputs:
20
Range:
-10V to 10V
Resolution:
12 bit
Special features:
Module identification:
Module check:
Assignment of output words:
OW 15 14 13 12 11
10 9
0
Channel # 1
1
Channel # 2
2
Channel # 3
3
Channel # 4
Register value
-2048
-1024
0
1024
2047
2
0 to 4
10
0V to 10V
12 bit
Physical value
-10 V
-5 V
0V
5V
10 V
4.1.3.4
IO7X
IO70/IO71 0V to 10V
2 analog outputs, 0V to 10V, 12 bit
Input words (channels):
Output words (channels):
Switch positions:
Sum of inputs:
Sum of outputs:
Range:
Resolution:
Special features:
Module identification:
Module check:
Register value
0
Physical value
0V
137
410
819
2048
4095
1V
2V
5V
10 V
Physical value
-10V
-5 V
0V
5V
10 V
IO73 0 to 20mA
2 analog outputs, 0 to 20mA, 12 bit
Input words (channels):
Output words (channels):
2
Switch positions:
0 to 4
Sum of inputs:
Sum of outputs:
10
Range:
0 to 20mA
Resolution:
12 bit
Special features:
Module identification:
Module check:
Assignment of output words:
OW 15 14 13 12 11
10 9
0
Channel # 1
1
Channel # 2
Register value
0
205
FST Version 4.02.21 Manual
Physical value
0 mA
1 mA
138
819
2048
4095
4 mA
10 mA
20 mA
4.1.3.5
Address assignment matrix
The following tables are very helpful for planning addressing of the individual modules.
The columns show the I/O modules, the rows show the processor I/O addresses. The module address is set by means of the rotary switch on the underside of the module. Depending
on the module and switch position, the range shown for the switch position is assigned. All
addresses are shown in hexadecimal notation.
The same switch position may occur for different modules, but any single processor I/O
address can only be assigned once.
This means that a module assigns all table rows associated with a switch position. There is
a separate address range for inputs and outputs.
The FST IPC I/O configurer supports you in assigning addresses / switch positions. You
would always begin with the module that takes up the fewest I/O addresses, as it is then
easier to find space for the remaining modules.
Table 7: Address assignment analog outputs part I
IO10
IO11
140-15F
1
1
240-25F
2
2
1CO-1DF
3
3
2CO-2DF
4
4
IO12
1
2
3
4
IO48
1
2
3
4
5
6
IO71
0
1
2
3
4
IO73
0
1
2
3
4
139
IO12
1
2
3
4
IO48
1
2
3
4
5
6
IO71
0
1
2
3
4
IO73
0
1
2
3
4
4.2
FEC and HC0x
The special IO drivers for FEC and HC0x controllers are described in this topic.
4.2.1 Local Ios
4.2.1.1
FEC Standard
In the IO configuration, select the module that corresponds with your hardware, e.g. FC440.
The inputs of the FEC Standard are grouped into FST input and output words. If you select
the "word" option that is available for each FEC Standard type, 16 inputs or outputs are
accessible through each FST input or output word. If you select the default IO script (without
"word"), 8 inputs or outputs are accessible through the 8 least significant bits each FST
input or output word.
For the analog IO separate modules must be selected: Standard Analog Input 0-20mA and
Standard Analog Output 0-20mA.
PLC Safety is available through a separate module: FEC Standard PLC Safety. This module
will generate FST error 12 if the hardware cannot be identified as a FEC Standard.
FST Version 4.02.21 Manual
140
141
The 12 inputs of the remote FEC are divided into two groups: 8 on the first, 4 on the second
group. The 8 bits of the first group are represented in the 8 least significant bits of the input
word given (e.g. I2.0 to I2.7). The 4 bits of the second group are represented in the 4 least
significant bits of the following input word (e.g. I3.0 to I3.3).
The 8 outputs are represented in the 8 least significant bits of the output word given (e.g.
O2.0 to O2.7).
The remote FEC must not have a control program running. The FEC must be in the factory
settings. Delete any files from drive B: using the File transfer utility of FST IPC.
The RUN/STOP switch must be in position STOP.
FST Error 99 will occur if a FEC has local IOs configured and is also accessed as remote FEC.
4.2.3 Analogue Potentiometer
FEC Compact and HC01 are equipped with an analogue potentiometer. It can be adjusted
using a screwdriver in the range 1 to 63.
To read the values from your programs enter the module Trimmer into your IO configuration
and specify the input word you want to use for the actual trimmer value.
4.2.4 Rotary Switch
FEC Standard controllers are equipped with a rotary switch with 16 positions (0-15), which
also serves as run/stop switch, where 0 means stop and all other positions run.
To read the switch position (1-15) from your programs enter the module Rotary Switch into
your IO configuration and specify the input word you want to use for the actual switch position.
For compatibility reasons for the FEC Standard the module Trimmer is still available. The
switch positions will result in the following values:
0
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
1
1
5
8
12
16
21
26
32
36
41
46
50
54
59
63
142
These counters are interrupt driven and once activated, operate independently of the users
control programs and therefore are not affected by factors such as control program scan
time.
Include the module Fast counter to your IO configuration. Enter 0 as switch if you are using
counter 0, 1 for counter 1. Specify the input word you want to hold the counter value.
The counter value is incremented on each rising edge of the corresponding input signal.
Please note that the counter values cannot be reset. If this is required the driver described
in a separate chapter can be used instead.
4.2.6 Incremental Encoder
The first two inputs of the second group of the FEC Compact (I1.0 and I1.1) as well as the
inputs I0.2 and I0.3 of HC0x can be used as incremental encoder up to 200Hz. Optionally a
reset signal can be connected to I0.7. Still, the inputs can be read as standard inputs.
For the FEC Standard series the following inputs are used:
FC4xx, FC5xx - I1.4, I1.5 and I1.70
FC6xx - I3.4, I3.5 and I3.0.
This encoder is interrupt driven and once activated, operates independently of the users
control programs and therefore are not effected by factors such as control program scan
time.
Include the module Incremental Encoder to your IO configuration and specify the input word
for the counter value (e.g. IW5). The following input word will hold the direction (e.g. IW6).
ABRESET
To reset the counter value call the module ABRESET.
Input parameters
none
Output parameters
none
ABMODE
Pin I0.7/I1.0/I3.0 can be used to reset the counter. The counter will be reset if I0.7/I1.0/I3.0
is active and a positive edge is detected on one of the A/B inputs. You can choose between
the following modes:
Input parameters
FU32 reference/reset mode:
0
no reset
1
direction 0, sin
3
direction 0, continuous
5
direction 1, single
7
direction 1, continuous
Output parameters
none
143
4.3
Actuator Sensor Interface
The Actuator Sensor Interface (ASi) connects sensors and actuators quickly and cheaply to
the IPC-PS1. Up to 4 CP96 AS-Interface modules can be used, each with up to 31 slaves.
The inputs and outputs of the slaves are copied to the user defined local function units of
the FST IPC.
Selecting and parameterising the driver
If you want to use the AS-Interface in a FST IPC project, you first have to add and parameterise the ASI driver in the driver configuration.
Target drive:
Enter the drive that contains the AS-Interface driver ASIDRV.EXE or to which it is to be
loaded.
4.3.1 The ASi configurer
Start the configurer in the FST software via the Extras > AS-Interace configuration from the
menu.
Note!
In order to be able to use the online features of the configuration tool, the AS-Interface
driver must be active on the IPC-PS1. It is sufficient to load (into the controller) the project
for which you have configured the ASi driver, without programs. The IPC must then be rebooted. This will be done automatically.
Selecting the master
Selecting Edit > Modul Number/IO-assignment from the menu opens a selection window
allowing you to choose one of 4 masters. The number of the master corresponds to the
address set on the CP96 module.
This selection window also defines the base address for the I/O image to which the ASi
slave/IOs are copied. This address must be given for correct configuration of the master
module. A CP96 module (ASi master) always occupies 8 I/O words in the local I/O area of
the FST IPC.
Figure 1: Selecting the Master module and assigning an I/O address
144
Selecting Edit > Configuration form the menu shows the configured slaves from 1 to 31 are
shown with I/O address, ID, I/O code and parameters. Any slave can be selected for further
processing with the cursor keys or the mouse.
Edit
Double clicking on a slave or selecting Edit from the right mousebutton popup menu opens
an input window allowing editing of the ID code, I/O code and parameters of the selected
slave. ID and I/O code should be taken from the appropriate documentation for the slave.
Entry of a parameter is optional. This parameter (0 to F) is transmitted to the slave when the
master is restarted. When slaves are designed accordingly, such parameters can be used to
set certain properties (such as the sensitivity of an ultrasound sensor).
Figure 2: Entering a slave into the configuration
Delete
Pressing the Delete key allows you to delete the selected slave from the nominal list.
Nominal-actual comparison
When selecting Nominal/actual compare from the right mousebutton popup menu a comparison of the slaves in the nominal list with the slaves present on the ASi bus is started. All
deviations are displayed in a dialog. If the nominal list is empty for example in the case of
a new project all slaves on the bus are inserted into the nominal list. Naturally, the reference list can be edited in the normal way.
There must be a connection to the IPC. The ASi driver must be installed. The IPC main runtime program must be active.
Figure 3: Result of the nominal-actual comparison
145
By default, all ASi slaves have the address 0. Each ASi slave can be assigned a new address
by address programming. This can also be done for slaves that already have an address
other than 0. Each ASi slave must have a unique address (per master). The addresses can be
modified by first selecting Edit > Slave Addresses and then from the list use drag and drop to
change the slave.
Online manipulation of individual slaves
Note! There must be a link to the IPC. The ASi driver must be installed. The IPC main runtime
program must be active.
The slaves detected on the bus are displayed with their I/Os in the ASi online display. The
display is dynamic. In other words, the display is automatically updated to reflect the status
of the inputs.
Manipulating slave outputs
First position the selection highlight on the slave whose outputs are to be manipulated. Now
it possible to manipulate the outputs by doubleclicking on the output, by pressing keys F5
to F8, or by using the right mousebutton popup menu.
4.3.2 CI commands
!7DLES
Display list of current slaves
!7DSxx
!7DOUF
!7DHARD
!7MMA
!7MSA
!7MPM
!7MA
Modify Output
(= slave address, output word)
!7MSP
!7MHARD
!7MERR
All numeric values given for the Modify command must be entered in hex. The command is
not case sensitive. The commands are used in the first line of the ASi configurer. The commands are not intended for manual entry. They are only documented here for the sake of
completeness.
FST Version 4.02.21 Manual
146
ASI_Para
ASI_Res
ASI_Mode
Sets the reaction of the AS-I driver to configuration errors
Input parameters
FU32 = 0
Soft reaction
> 0
Hard reaction
Output parameters
FU32 = -1 OK
=0
Driver not loaded
Note: The ASI_Mode module can only be used with the ASi driver.
ASI_Stat
Interrogates execution control level (OUF) flags
Input parameters
FU32
Master address (1 to 4)
Output parameters
FU32
= -1 OK
=1
Master address invalid
= 10 Master not found
FU33
Status flags
For the significance of the individual bits, please refer to the ASi master documentation. If
hard error reaction has been switched off with the ASi module, the user can use ASI_Stat to
interrogate the Config OK flag of the individual master and derive the desired reaction to the
error from the result.
147
AS-I_Para
Transfer a parameter to an ASi slave at runtime
Input parameters
FU32 Master address (1 to 4)
FU33 Slave address (1 to 31)
FU34 Parameter value (0 to $0F)
Output parameters
FU32 = -1 OK
=1
Master address invalid
=2
Slave address invalid
=3
Parameter value invalid
= 10 Master not found
= 11 Master timeout
FU33 Error code
Overview of possible error codes:
HFUN_OK
0x00 Execution successful
HFUN_NOK
0x01 Execution not successful
HFUN_SNA
0x02 Slave not in LAS
HFUN_MOFF 0x0C Master is offline
MAS-IBUSY
0xFD Master not ready
HOSTTOUT
0xFE Master timeout
Note: If the slave is not found, error code 0x02 is returned (Slave not in LAS).
ASI_Res
Restart cyclical update (including error monitoring) following a runtime error (slave failure)
Input parameters
None
Output parameters
FU32 = -1 OK
=0
Driver not loaded
Note: The ASI_Res module can only be used with the ASi driver.
4.4
Festo Fieldbus Master
Version 2.22
The fieldbus allows you to link up distant I/O modules (plant-floor units) with your IPC-PS1
to form a system network. Communication between the modules and the IPC is controlled by
the PS1-CP61 fieldbus module. This module has a fieldbus interface to which you can connect up to 31 participants, when using repeater technology up to 99. Additional FST operands are available for cyclical inputs and outputs of the participants. Modules can be used
to interrogate statuses and execute a-cyclic commands.
4.4.1 Set Festo fieldbus parameters
If you want to use the FESTO fieldbus in a project, you must enter and parameterise the
FESTOBUS driver in the configurer.
Destination Drive:
Enter here the target drive for the Festo fieldbus driver IPCFB22.EXE.
CP61 switch setting:
Enter the switch position here which you have set on the rear of your fieldbus module (PS1CP61).
Interrupt number:
Enter the number of the interrupt that the fieldbus module is allowed to use for communication with the CPU. Check which interrupts have already been assigned for other modules.
FST Version 4.02.21 Manual
148
149
Note!
If you remove a type from the project-specific type file for which there is already an entry in
the configuration, the designation Unknown type will subsequently appear in the configurer
instead of the type. You should delete any such entries.
150
Edit configuration
Once you have completed type selection for your current project you can enter the participants by selecting Edit > Configuration from the menu.
After selecting Insert from the local menu a window appears where you configure the participant:
Figure 2: Configuring fieldbus participant
Enter the participants number and type that you want to insert. The permissible entries are
explained in the table below:
Abbr. Meaning
Permissible entry
PA
Participant
number
1 to 99
Type
Type of
participant
IW
Number of
input units
OW
Number of
output units
151
When a project is started, the run- time system detects the actual configuration and compares it with the nominal configuration. If the nominal configuration is not a subset of the
actual configuration, an error is reported.
The Compare nominal/actual function supports the testing of the configuration data from
the PC. To be able to execute this function, your PC must be connected to the IPC in the
proper way.
Compare nominal/actual:
When you activate this function from the local menu the actual configuration is read from
the IPC and is compared with the nominal configuration that was drawn up on the PC. If the
configurations are identical, a message appears in the message line. If discrepancies occur
during the comparison, the following window appears after you activate this function.
Figure 3: Nominal and actual comparison
You are shown the number of deviations between the nominal configuration and the actual
configuration.
If there is no nominal configuration file in the project directory, the actual configuration that
is read from the IPC is stored as the nominal configuration. The file contains no comments,
however, so these details need to be added.
This function can be used for initial creation of the configuration file. The precondition for
this, however, is that the fieldbus and all participants are available.
Print fieldbus configuration
Selecting File > Print from the menu or pressing
IWp.w
OWp.w
p = participant number
w = word number
b = bit number
The word number is assigned from 0 onwards for each participant, separately for inputs and
outputs. For example, if you use the fieldbus module I/O extension 405 with 3 input cards
and 2 output cards (1 word each) as participant 5, the following operands are created:
152
I5.0.0 to I5.2.15
but also
O5.0.0 to O5.1.15
and
IW5.0 to IW5.2,
and
OW5.0 to OW5.1.
Most fieldbus modules occupy only one word; this is then word 0.
In the printout of the filedbus configuration you will find an aid to addressing for each participant.
4.4.6 Function blocks
Overview
F40
Configuration of a fieldbus participant.
F41
Read parameter field.
F42
Write parameter field.
F43
Reset all cyclical outputs on the filedbus.
F44
Status interrogation for a fieldbus participant.
F47
Set error handling.
F48
General configuration.
F40
Configuration of a fieldbus participant.
Input parameters
FU32 fieldbus participant number, 1 to 99
Output parameters
FU32 = -1 Nominal and actual data agree
=0
Nominal and actual data differ
FU33 Participant: actual type
FU34 Participant: number of inputs in bytes
FU35 Participant: number of outputs in bytes
If you are using the nominal configuration (see Section 1.2) nominal and actual data will
always agree by definition.
F41
Read parameter field of an intelligent participant.
Input parameters
FU32 fieldbus participant number, 1 to 99
FU33 Address of the participant word, 0 to 255
Output parameters
FU32 = -1 Command successfully processed
=0
Error, fieldbus participant not responding
FU33 Participant status
FU34 Participant word of address
FU35 Participant word of address + 1
FU36 Participant word of address + 2
FU37 Participant word of address + 3
For a description of the participant status see F44.
F42
Write parameter field of an intelligent participant.
Input parameters
FU32 fieldbus participant number, 1 to 99
FU33 Number of word parameters, 1 to 4
FST Version 4.02.21 Manual
153
154
155
"Configuration acquisition
"Status interrogation
STEP 3
IF
FU32
<> K2
THEN ...
4.4.7 CI commands
The Festo fieldbus has the driver number 0. For historical reasons, "!0" can be entered
instead of "$".
!0FA
Assign nominal configuration
!0FC
Display participant number
!0FI
Reinitialisation (acquisition of actual configuration)
Response "=1" for success, else "=0".
!0FN
Cyclic display of participant
Displays the definition of one participant per cycle. Output comprises participant number,
type number, number of output bits and number of input bits.
!0FR Start/continue cyclic transfer of data
!0FS
Stop cyclic transfer of data
4.4.8 Error numbers
No
14
Meaning of error
Critical driver error. Project
cannot be started even with
soft errors
60
Notes on elimination
This error occurs if the fieldbus driver was not found or
problems occur starting the
firmware of the CP 61
Correct fieldbus configuration
or connect missing participant
4.5
Festo Fieldbus Slave
This package allows you to operate the IPC as an intelligent slave in a Festo fieldbus.
4.5.1 Selecting the driver and assigning parameters
If you want to use the IPC to become a fieldbus slave, you must enter and parameterise the
FBSLAVE driver in the configurer. The following entries are required:
Destination Drive:
Enter here the target drive for the Festo CP61 firmware FBSLAVE.BIN.
CP61 switch setting:
FST Version 4.02.21 Manual
156
Enter the switch position here, which you have set on the rear of your fieldbus module
(CP61).
4.5.2 How to use the module FBSLAVE
Import the FBSLAVE file into your FST-IPC project. In the following examples I will assume
that it was imported as a program module with number 0 (CMP 0).
Initialisation/configuration
First the firmware must know things like fieldbus address, baud rate etc.
Input parameters
FU32 1 = Initialisation/configuration
FU33 Switch setting of CP61 (4..7)
FU34 Baud rate (0..3)
0 = 31.25 Kbit/s
1 = 62.5 Kbit/s
2 = 187.5 Kbit/s
3 = 375 KBit/s
FU35 Participant number (slave address) (1..99)
FU36 Output bytes (0..24) or words (0..12)
FU37 Input bytes (0..24) or words (0..12)
FU38 1 = Byte oriented
2 = Word oriented
Output parameters
None
Repeated initialising has no effect, only after reloading the binary code (FBSLAVE.BIN) can
the CP61 be reconfigured. You need to reboot the IPC to do so.
If inputs and outputs are mentioned I will use them as seen from the slaves perspective. So
if in this document I use the word input, it means input as seen by the slave and output as
seen by the master.
Example:
IF
NOP
THEN CMP 0
'FBSLAVE
WITH
V1
" Initialise
WITH
V4
" Switch setting CP61
WITH
V3
" Baud rate (3=375 Kbit/s)
WITH
V1
" Participant number ( slave address )
WITH
V24 " Inputs
WITH
V24 " Outputs
WITH
V1
" Byte oriented
From the master this slave will be seen as follows:
PA
1
Type
FB-IPC (byte)
IW
24
OW
24
Example:
IF
NOP
THEN CMP 0
'FBSLAVE
WITH
V1 " Initialise
WITH
V4 " Switch setting CP61
FST Version 4.02.21 Manual
157
WITH
WITH
WITH
WITH
WITH
V3
V1
V8
V12
V2
NOP
'FBSLAVE
V2 " Cyclic update
V10 " 1st flag word for outputs
V20 " 1st flag word for inputs
158
None
To read the parameter:
Input parameters
FU32 4 = read parameter
FU33 parameter field number
Output parameters
FU32 parameter field value
4.5.6 Sample program
"" Example program for Festo fieldbus Slave
STEP init
IF
NOP
THEN CFM 62
WITH
V1
WITH
V$D400
WITH
V3
WITH
V1
WITH
V24
WITH
V24
WITH
V1
STEP loop
IF
NOP
THEN LOAD
IW1
TO
FW9000
IF
THEN CFM 62
WITH
WITH
WITH
IF
THEN LOAD
TO
IF
THEN JMP TO loop
NOP
V2
V9000
V9100
NOP
FW9100 " fieldbus input byte 0
OW1
" LEDs on AS14
NOP
4.6
Profibus DP (CP62)
With this driver and the CP62 module you can connect Profibus DP slaves to the IPC and to
use them with the FST IPC.
Note! Before you can use the CP62 module it must be configured using the SyCon configuration software from the company Hilscher.
The inputs/outputs of the modules are copied cyclically to the local function units (inputs,
outputs or flag words) configured by the user.
4.6.1 Selecting the driver and assigning parameters
If you want to use the Profibus DP driver in an FST IPC project you must enter the PDP driver
in the driver configurer and assign the necessary parameters.
Note! The driver uses the same driver number as PROFI-DP for CP60. It can not be used
together in the same project.
FST Version 4.02.21 Manual
159
Destination drive:
Specify the IPC drive on which the Profibus DP driver PDP.EXE is located or onto which it is
to be loaded.
CP62 switch position:
Enter the address switch position of the CP62 module here.
DR-RAM size:
This can be either 2 or 8.
Use FW as IW:
If you select "Y" then the process data will be copied into FWs instead of IWs.
Use FW as OW:
If you select "Y" then the process data will be copied into FWs instead of OWs.
Offset for Inputs:
Enter the index where the input area of the process data starts.
Offset for Outputs:
Enter the index where the output area of the process data starts.
4.6.2 Configuration
Before you can use the CP62 module it must be configured using the SyCon configuration
software from the company Hilscher.
For DP-Master, following Parameters should be used:
Start up behaviour:
Automatic release of communication by the system after system initialised.
Watchdog time:
300ms
Addressing mode:
Word address (Important!)
Process Data exchange:
Buffered, program controlled data transfer
Error reaction:
The error reaction "Hard" or "Soft" (e.g.: participant missing or non-configured
participant on the bus) depends on the Bus- Parameter setting "Auto Clear".
"Auto Clear On" := Hard reaction.
4.6.3 Error messages from the driver
The driver enters the following error numbers in the FPC error word:
No
Meaning of the error
Pointer to error correction
1001
There is no communication
Probable cause:
between driver and Profibus
- Card address is not the same
card
with driver configuration
- No valid configuration in the
card system configuration
(SyCon)
1004
Configures Slave not in the
Only for hard reaction
Bus
1005
Input range exceeding
1006
Output range exceeding
160
4.6.4 Modules
Overview
DP_USIF
DP_GETSL
DP_GETDG
DP_CONTR
DP_USIF
The User Interface status cannot be edited; it will give back the actual status. The module
operates in conjunction with the DP driver (PDP).
Input parameters
None
Output parameters
FU32 = -1 OK
=0
driver not loaded
FU33 Current status or
0 = system not correctly initialised
DP_GETSL
Checks whether a diagnostic request is present.
Input parameters
None
Output parameters
FU32 = -1 OK
=0
driver not loaded
FU33 address of first participant with diagnostic requisition
or $FFFF = no request present
FU34 address of first missing participant
DP_GETDG
Request diagnostic information from a DP slave. This should be used in conjunction with the
DP_GETSL module.
Input parameters
FU32 Address of the slave (0 to 126)
FU33 Offset in diagnostic information
FU34 Group select
Output parameters
FU32 = -1 OK
=0
driver not loaded
=1
slave address invalid
FU33 Profibus status of the operation
FU34 Length of diagnostic information in bytes
(not incl. length byte)
FU35-38 The diagnostic information in consecutive
Order
Profibus status of the operation, typical values:
00
OK
C3
Partner not responding
04
No parallel master-slave function possible
Will give back max. 4 Words of diagnostic information for every call.
FST Version 4.02.21 Manual
161
Note! The module call must be repeated as many times as necessary until the value 0 is
returned in FE33. The other values are not valid until this is the case.
DP_CONTR
Profibus function "Global Control Request".
Input parameters
FU32 Slave address or
127 = all slaves (broadcast)
FU33 Control command
FU34 Group select
Output parameters
FU32 = -1 OK
=0
driver not loaded
FU33 Profibus status of the operation
All transfer parameters in BYTE format.
Profibus status of the operation, typical values:
00
OK
C3
Partner not responding
04
No parallel master-slave function possible
Note! The module call must be repeated as many times as necessary until the value 0 is
returned in FE33. The other values are not valid until this is the case.
4.7
Profibus FMS (CP62)
With this driver you can operate the Festo IPC in a Profibus FMS network using the CP62
module of the IPC product range.
Note! Before you can use the CP62 module it must be configured using the SyCon configuration software from the company Hilscher.
There are no external configuration files. The bus parameters, Communication Reference
List and Object Directory must be configured through SyCon.
4.7.1 Configuring the driver and assigning parameters
If you want to use the Profibus FMS driver in a FST IPC project, you must enter the PROFIFMS
driver in the driver configurer and assign the necessary parameters.
Destination drive:
Specify the drive on which the Profibus FMS driver PROFIFMS.EXE is located or onto which it
is to be loaded.
CP62 switch position:
Enter the switch position as set on the CP62 module. The default of CA means that the CP62
module uses a base memory segment of CA00h
Note! Make sure that the memory used by the CP62 is not in use by other modules.
4.7.2 Extended CI commands for PROFIFMS
This driver extends the IPC command interpreter with the following commands:
!39
Display driver identification and version number
Display driver info and version number. This information will also be displayed if an unknown command is entered (for example !39?).
4.7.3 Function modules
Overview
FMSREAD
Read (polled response)
FST Version 4.02.21 Manual
162
FMSWRIT
FMSREAD
Read (polled response)
Input parameters
Output parameters
FU32
FU33
FU34
FU35
FU36
Status variable
=0
=1
>1
Successfully completed
Still being processed
Terminated by error (see table)
FMSWRIT
Write (polled response)
Input parameters
Output parameters
FU32
163
Please note that not all operands are accessible. Only Inputwords, Outputwords, Registers
and a limited range of Flagwords can be accessed.
When operands are entered they should be entered according to the following table:
Index
100
101
102
103
110
111
112
113
120
121
122
123
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
Designation as per
IPC
EW0-EW63
EW64-EW127
EW128-EW191
EW192-EW255
AW0-AW63
AW64-AW127
AW128-AW191
AW192-AW255
R0-R63
R64-R127
R128-R191
R192-R255
MW0-MW63
MW64-MW127
MW128-MW191
MW192-MW255
MW256-MW319
MW320-MW383
MW384-MW447
MW448-MW511
MW512-MW575
MW576-MW639
MW640-MW703
MW704-MW767
MW768-MW831
MW832-MW895
MW896-MW959
MW960-MW1023
MW1024-MW1087
MW1088-MW1151
MW1152-MW1215
MW1216-MW1279
MW1280-MW1343
MW1344-MW1407
MW1408-MW1471
MW1472-MW1535
MW1536-MW1599
MW1600-MW1663
MW1664-MW1727
MW1728-MW1791
MW1792-MW1855
MW1856-MW1919
MW1920-MW1983
MW1984-MW2047
Type
Access
Array(64)*U16
Array (64)*U16
Array(64)*U16
Array(64)*U16
Array(64)*U16
Array(64)*U16
Array(64)*U16
Array(64)*U16
Array(64)*U16
Array(64)*U16
Array(64)*U16
Array(64)*U16
Array(64)*U16
Array(64)*U16
Array(64)*U16
Array(64)*U16
Array(64)*U16
Array(64)*U16
Array(64)*U16
Array(64)*U16
Array(64)*U16
Array(64)*U16
Array(64)*U16
Array(64)*U16
Array(64)*U16
Array(64)*U16
Array(64)*U16
Array(64)*U16
Array(64)*U16
Array(64)*U16
Array(64)*U16
Array(64)*U16
Array(64)*U16
Array(64)*U16
Array(64)*U16
Array(64)*U16
Array(64)*U16
Array(64)*U16
Array(64)*U16
Array(64)*U16
Array(64)*U16
Array(64)*U16
Array(64)*U16
Array(64)*U16
Read
Read
Read
Read
Read/write
Read/write
Read/write
Read/write
Read/write
Read/write
Read/write
Read/write
Read/write
Read/write
Read/write
Read/write
Read/write
Read/write
Read/write
Read/write
Read/write
Read/write
Read/write
Read/write
Read/write
Read/write
Read/write
Read/write
Read/write
Read/write
Read/write
Read/write
Read/write
Read/write
Read/write
Read/write
Read/write
Read/write
Read/write
Read/write
Read/write
Read/write
Read/write
Read/write
164
43h 67
80h 128
81h 129
165
Also the Communication references differ slightly from the default settings, viewed from the
CP62:
4.8
FEC Remote I/O Expansion
Introduction
This document describes the how to expand an FEC Compact controller with 1 to 4 additional modules to provide up to 100 I/O points.
Note! The I/O Expansion is not available for the FEC Standard series.
The architecture consists of several FEC Compacts in a Master-Slave arrangement. The
Master FEC contains all of usual user-application programs as well as a special software
driver to manage communication with the slave FECs. If only a single extension module is
required you can also use the IO script FEC Slave without installing drivers. See the chapter
"FEC and HC0X" for details.
The Slave FECs do not contain any user-application programs but must be loaded with a
special Slave software driver. The balance of this document provides detailed instructions.
4.8.1 System Overview
Systems should be created using FEC-FC30 only. FEC-FC20 modules can be used at the ends
of the daisy chain. However, doing so has been experienced as not being stable in some
situations and is therefore not recommended.
166
The modules must be connected together using Festo cable part number 183635. When
planning a system, please note that I/O updates may require up to 25 milliseconds due to
the nature of the serial data bus.
4.8.2 Configuring Slave FECs
Every FEC module, which you will use as a slave device, has to be configured in the following
manner. It is suggested that you create a separate FST project called FECSLAVE, which will
contain data that must be loaded into every slave. N o user written programs are required. It
is only necessary to add the FCSLAVE driver to the FECSLAVE project and load it into the
controller. The follow provides step-by-step instructions:
1.Create the FCSLAVE project
2.Select the FCSLAVE project as the current project
3.Open the Driver Configuration
4.Insert the FCSLAVE driver
5. You will be prompted for a Destination Drive. Accept the default B response.
6. A listing of ALL configured drivers will be shown. The FEC SLAVE driver "FCSLAVE" should
be listed.
Loading the Slave Software into the FEC
1. Connect your PC to the COMM port of the FEC Slave using the appropriate cable
2. Set the Run/Stop switch of the slave FEC to STOP
3. Switch on the Power to the Slave FEC
4. Download the FECSLAVE project
5. You will receive a warning: "No IO scan table, no programs." This is correct, as only drivers will be loaded.
6. Set the Run/Stop switch of the slave FEC to the RUN position.
Note! Until all slaves and the master are connected and the power is cycled, it is likely that a
Red or Orange LED will be shown. This is normal.
7. After the next power cycle, the FEC Slave should operate in the slave mode.
8. Repeat this Loading process for any other FEC Slaves.
4.8.3 Configuring the Master FEC
Adding the Driver
The master FEC is programmed and executes all of the user-application programs. As with
standalone FEC controllers, the system I/O configuration has to be recorded.
Additionally, the special FCMASTER software driver must to be included in the FST project.
The following provides step-by-step instructions:
Create (or select) your FST project.
Insert the FCMASTER driver to the Driver Configuration
You will be prompted for a Destination Drive. Accept the default B response
A listing of ALL configured drivers will be shown. The FEC Master driver "FCMASTER" should
be listed.
167
FEC Slave
If this I/O entry is selected, then during system initialisation the master checks if all expected slave devices respond. If a configured slave does not respond then system error 11
is generated. During runtime, if any slave device fails to respond, system error 11 will be
generated.
-orFEC Slaves without error 11
This I/O entry reacts in the same way during the initialisation phase. However, excessive
runtime communication errors between the master and any slave device will not generate an
error.
Each of the FEC Slave nodes must be entered into the FST Project I/O configuration of the
FEC Master.
You will be prompted for:
Switch:
Enter 0 for the first slave, 1 for the second slave etc.
IW:
Enter the starting IW (Input Word) number for the Slave. Each FEC requires 2 Input words
and each unit must be assigned unique, non-overlapping ranges.
OW:
Enter the starting OW (Output Word) number for the Slave. Each FEC requires 1 Output word
and each unit must be assigned unique, non-overlapping ranges.
Note! Dont forget that the FEC master also must be entered into the I/O configuration!
Optional I/O Entry
If desired the user may also include the FEC Slaves Error Counter I/O entry in the master
project. This will track the total global expansion bus errors that occur.
If this is desired then include the module "FEC Slaves Error Counter" into the IO configuration. For the IW enter the number of a non-conflicting "virtual" IW (Input Word), which will
be used to store the global error, count.
Runtime Functioning
The following describes the functionality of a configured and wired system.
4.8.4 Master at Runtime
Upon power up the master will initialise the remote (slave) FEC modules. If there is a discrepancy between the expected versus the actual configuration (the expected slaves do not
respond); then an I/O stage defective error will be generated and system error 11 will be
stored.
If during operation a communications problem develops (and the appropriate I/O entry is
included) then excessive communications errors result in system error 11 being generated
and the Master will stop attempting to update the slave FEC I/O points.
The system can be reinitialised by toggling the Run/Stop switch or cycling power.
168
Red
Flashing Orange
Flashing Green
Green
Communications error
No communications with master
Slave being initialised by master
Communications normal
4.9
File Handling Modules
Some standard CFM give access to the file systems on diskettes, hard disks, RAM-disks, etc.
as supported by the MS-DOS operating system on HC1X and HC2X CPUs. It is possible to
have up to 6 open files at a time. If more files than this are opened the CFM returns with
error number 4 (too many open files).
The naming convention uses numbers for files. If the file number is in the range 0 to 32767,
that is if it is a positive number, it will be translated into a file name directly. For example file
number 17 results in a "17" file name in the current working directory of the current disk.
For a negative file number the CFM search the string driver and use the string with the opposite number as file name. For example if the file number is "-3" and the string number 3
contains "C:\MYDATA.BIN" this will become the name of the associated file.
All file access CFM pass jobs to the MS-DOS task for further processing and return immediately. The real job will be done by the MS-DOS task somewhat later on a first comes first
served base. So more than one operation can be issued at the same time.
All read or write data functions use flag words as storage for read or written data. The reason is, that only the flag words offer a meaningful amount of memory.
All CFM return a result and support an operation status variable. A CFM result of zero means
the operation has been started, but need not be complete (and usually is not). A none zero
CFM result shows an error condition. The operation is not started and the actual returned
value indicates the error type, for example invalid parameters. A status variable value of
FST Version 4.02.21 Manual
169
zero means success. While the value is -1, the operation is still busy, not yet completed. If
any error occurs, the value will become >0 and the actual value can be used to obtain further
information of the kind of the error. For a list of error values see below.
Do not remove a diskette while there is an open file on it. Doing such in MS-DOS will produce lost clusters or even worse.
Remember, MS-DOS updates the file allocation table not steadily. The method used by MSDOS would take too much time. MS-DOS updates it when a file is closed. To make sure that
all written data is part of a file and all allocated memory (clusters) is noted in the file allocation table the file has to be closed. A simple but effective trick is to position to the desired
end of the file, write zero bytes to that location and close the file. This will force MS-DOS to
allocate enough memory from the disk and update the file allocation table. Doing this results in the best chance to save the integrity of the file system on a disk.
Another strategy uses a "check point a file" method. Request and save the current position
of the file read/write pointer. Then close the file, open it again, and seek to the saved position. This also ensures all data will be written to the disk and the file allocation table will be
updated. If the CHKDSK-command finds lost clusters on a disk, the file allocation table has
not been updated at the right moment. The first method prevents this nearly always, the
second is less sure but even saves partially written clusters to the disk.
The CI commands S and Y and the QUIT and EXIT commands will automatically close all files.
Overview
FCREATE
FOPEN
FCLOSE
FCLOSALL
FDELETE
FSEEK
FSEEKX
FWRITE
FREAD
FWRITSTR
FREADSTR
File create
File open
File close
File close all
File delete
File seek
File seek extended
File write
File read
File write string
File read string
170
Output parameters:
FU32 = 0 OK, function has been started,
= >0 error number after failure. Function is not started.
FOPEN File Open
Open an existing file in the given mode.
Input parameters:
FU32 File number for the MS-DOS file name.
A positive number is directly converted into a file name.
The number 17 translates into a file name "17". A negative number is used as opposite
index into the string table in the string driver. The associated string contains the file name.
FU33 Number of flag word FW used for status report.
The status is
FW[FU33] = -1 while function is busy,
= 0 when completed successfully,
= >0 error number after failure.
FU34 Number of flag word FW for the requested file handle.
Valid when the status flag word shows 0. This handle has to be used with all further operations with the opened file.
FU35 Mode in which to open the file.
0 = read-only access,
1 = write-only access,
2 = read/write access.
Output parameters:
FU32 = 0 OK, function has been started,
= >0 error number after failure. Function is not started.
FCLOSE File Close
Close a previously opened file. After closing a file the file handle is no longer valid and
cannot be used for any further operation.
Input parameters:
FU32 File handle for the MS-DOS file as obtained from file open or file create functions
FU33 Number of flag word FW used for status report.
The status is
FW[FU33] = -1 while function is busy,
= 0 when completed successfully,
= >0 error number after failure.
Output parameters:
FU32 = 0 OK, function has been started,
= >0 error number after failure. Function is not started.
FCLOSALL File Close All
Close all currently open files. After closing all files the file handles are no longer valid and
cannot be used for any further operation.
Input parameters:
FU32 Number of flag word FW used for status report.
FST Version 4.02.21 Manual
171
The status is
FW[FU33] = -1 while function is busy,
= 0 when completed successfully,
= >0 error number after failure.
Output parameters:
FU32 = 0 OK, function has been started,
= >0 error number after failure. Function is not started.
FDELETE File Delete
Delete a file. The file to be deleted may not be open.
Input parameters:
FU32 File number for the MS-DOS file name.
The number 17 translates into a file name "17".
FU33 Number of flag word FW used for status report.
The status is
FW[FU33] = -1 while function is busy,
= 0 when completed successfully,
= >0 error number after failure
Output parameters:
FU32 = 0 OK, function has been started,
= >0 error number after failure. Function is not started.
FSEEK File Seek
Move the file read/write pointer to a specified position. The position is given in bytes.
Input parameters:
FU32 File handle for the MS-DOS file as obtained from file open or file create
functions.
FU33 Number of flag word FW used for status report. The status is
The status is
FW[FU33] = -1 while function is busy,
= 0 when completed successfully,
= >0 error number after failure.
FU34
Low word of 4 byte file pointer position.
FU35
High word of 4 byte file pointer position.
Output parameters:
FU32 = 0 OK, function has been started,
= >0 error number after failure. Function is not started.
FSEEKX File Seek Extended
Move the file read/write pointer to a specified absolute or relative position. The position is
given in bytes.
Input parameters:
FU32 File handle for the MS-DOS file as obtained from file open or file create
functions.
FU33 Number of flag word FW used for status report.
The status is
FW[FU33] = -1 while function is busy,
= 0 when completed successfully,
= >0 error number after failure
FU34
Low word of absolute or relative 4 byte file pointer position.
FST Version 4.02.21 Manual
172
FU35
FU36
FU37
FU34
FU35
173
If the number of bytes is odd, only the low byte of the last flag word will be read.
FU36
Number of flag word FW for the number of bytes that actually have been
read.
Output parameters:
FU32
Number of string.
FU34
FU35
Delimiter (0..255).
0: delimiter is CR LF.
Output parameters:
FU32=
0
DONE, function has been executed successfully
200
String driver not found
201
Reached EOF before delimiter was found. File pointer remains unchanged.
202
Checked given amount of characters before delimiter was found. File pointer
remains unchanged.
>0
Error, see below.
FWRITSTR Write string to file.
Write string plus delimiter to file.
Note! This module needs to be called more than once in order to execute the function.
Input parameters:
FU32 File handle for the MS-DOS file as obtained from file open or file create
functions
FU33 Number of string.
FU34 Number of the bytes that will be written (max).
FU35 Delimiter (0..255).
0: delimiter is CR LF,
-1:no delimiter appended
Output parameters:
FU32 =
0
DONE, function has been executed successfully
200
String driver not found
>0
Error, see below.
4.9.1 Operation result codes
Most functions will set a status value in a flag word.
The status value has following meanings:
FST Version 4.02.21 Manual
174
-1 BUSY
0 OK
>0 ERROR
175
\f
formfeed
\n
linefeed
\r
return
\t
tab
Tabulator character
\<no>
176
STRADDR
STRAPPND
STRATOH
STRATOI
STRATOIX
STRATOU
STRCAT
STRCHECK
STRCHGET
STRCHSET
STRCI
STRCLR
STRCMP
STRCPY
STRDEL
STRDUMP
STRFILL
STRFILLW
STRFINDC
STRFINDS
STRGROW
STRHTOA
STRICMP
STRINIT
STRINSRT
STRITOA
STRLEFT
STRLEN
STRLOWER
STRMID
STRNCMP
STRNICMP
STRRIGHT
STRSTAT
STRUPPER
STRUSAGE
STRUTOA
STRADDR
Determine the internal address of a string.
Input parameters
FU32 Number of the string
Return parameters
FU32 Offset of the address
0 if string number is invalid
FU33 Segment of the address
0 if string number is invalid
As the lengths of the strings concerned are subject to dynamic change, the
strings may need to be moved within the string memory. The direct consequence of
FST Version 4.02.21 Manual
177
this is that after the address of a string has been determined it may change
immediately as a result of string operations with other strings. The addresses
of strings are therefore to be used under special conditions.
STRAPPND
Append a character at the end of a string.
Input parameters
FU32 Number of the string
FU34 character to append
Return parameters
FU32 0 if successful, otherwise error
STRATOH
Convert a hexadecimal string into a word.
Input parameters
FU32 Number of the string
Return parameters
FU32 0 if successful, otherwise error
FU33 Resultant value
Space characters and tabulator characters at the beginning and end of the string
are allowed. A '$' character before the hexadecimal numeric characters is also
allowed.
STRATOI
Convert a string into a signed word.
Input parameters
FU32 Number of the string
Return parameters
FU32 0 if successful, otherwise error
FU33 Resultant value
Space characters and tabulator characters at the beginning and end of the string
are allowed. A '+' or '-' character before the numeric characters is also
allowed.
STRATOIX
Convert a string into a signed word.
Input parameters
FU32 Number of the string
FU33 String position for the conversion
Return parameters
FU32 0 if successful, otherwise error
FU33 Resultant value
FU34 Number of characters used for the conversion
Space characters and tabulator characters at the beginning and end of the string
are allowed. A '+' or '-' character before the numeric characters is also
allowed.
STRATOU
Convert a string into an unsigned word.
Input parameters
FU32 Number of the string
Return parameters
FU32 0 if successful, otherwise error
FU33 Resultant value
Space characters and tabulator characters at the beginning and end of the string
are allowed. A '+' character before the numeric characters is also allowed.
STRCAT
Combine two strings in a third string.
Input parameters
FU32 Number of the first source string
FU33 Number of the second source string
FU34 Number of the destination string
FST Version 4.02.21 Manual
178
Return parameters
STRCHECK
Memory check for the string memory.
Input parameters
None
Return parameters
FU32 0 if successful, otherwise error
STRCHGET
Extract an indexed character from a string.
Input parameters
FU32 Number of the string
FU33 Character index,
1 for first character of the string
Return parameters
FU32 0 if successful, otherwise error
FU33 Extracted character
STRCHSET
Replace an indexed character in a string.
Input parameters
FU32 Number of the string
FU33 Character index, 1 for first character
FU34 Replacement character
in lower-order byte
Return parameters
FU32 0 if successful, otherwise error
STRCI
Execute a CI command.
Input parameters
179
Input parameters
Return parameters
STRDEL
Delete part of a string.
Input parameters
Return parameters
STRDUMP
Produce a debug output of a series of strings on the monitor of the IPC.
Input parameters
FU32 Number of the first string
FU33 Number of the last string
Return parameters
None
This module should not be used in normal operation. If necessary the extended CI
commands of the string driver can be used.
STRFILL
Create a string with a specified number of identical characters.
Input parameters
FU32 Number of the string
FU33 Number of characters
FU34 Filler character
Return parameters
FU32 0 if successful, otherwise error
STRFILLW
Fill a string with another string, right- or left-justified.
Input parameters
FU32 Number of the string to be created
FU33 Number of characters for this string
>0 for right-justified
<0 for left-justified
FU34 Number of the string to be transferred
Return parameters
FU32 0 if successful, otherwise error
If the length specified for the string to be created is too short, the resulting
string is truncated.
STRFINDC
Find a character in a string.
Input parameters
Return parameters
STRFINDS
Find a substring in a string.
Input parameters
Return parameters
FU32
FU33
FU32
FU33
FU32
FU33
FU32
FU33
STRGROW
FST Version 4.02.21 Manual
180
Enlarge the string memory for a single string from the available memory.
Input parameters
FU32 Number of the string
FU33 New maximum size of the string in characters
(without \0 at the end of the string)
Return parameters
FU32 0 if successful, otherwise error
The existing string is retained unchanged. After this a string with a length up
to the maximum length set here can be written to the address determined with
STRADDR. Each other invocation of a string module can change the set value
again.
STRHTOA
Convert a word into a hexadecimal string.
Input parameters
FU32 Value to be converted
FU33 Number of the string
Return parameters
FU32 0 if successful, otherwise error
A '$' character is inserted before the four hexadecimal numeric characters.
STRICMP
Compare two strings character by character.
Input parameters
FU32 Number of the first string
FU33 Number of the second string
Return parameters
FU32 0 if successful, otherwise error
FU33 1 if characters in first string
> characters in second string
0 if both strings are identical
-1 if characters in first string
< characters in second string
There is no differentiation between upper- and lower-case letters.
STRINSRT
Insert a string into another string from a specified position.
Input parameters
FU32 Number of the string into which the other
string is to be inserted
FU33 Position before which the string is to be inserted,
1 = before first character
FU34 Number of the string that is to be inserted
Return parameters
FU32 0 if successful, otherwise error
STRINIT
Set the size of the memory for strings and the maximum number of strings, and
reinstate the initialisation values of the strings.
Input parameters
FU32 Size of the string memory (minimum 1000)
FU33 Maximum number of strings (minimum 10)
Return parameters
FU32 0 if successful, otherwise error
STRITOA
Convert a signed word into a string.
Input parameters
FU32 Value to be converted
FU33 Number of the string
Return parameters
FU32 0 if successful, otherwise error
If necessary a '-' character is inserted before the numeric characters.
STRLEFT
FST Version 4.02.21 Manual
181
STRLOWER
Convert a string to lowe r case.
Input parameters
FU32 Number of the string
Return parameters
FU32 0 if successful, otherwise error
Note! Country-specific characters like , , are not converted.
STRMID
Convert a middle substring from a specified starting position and of a specified
length into a string.
Input parameters
FU32 Number of the source string
FU33 Start character in the source string,
1 for the first character of the source string
FU34 Number of characters
FU35 Number of the destination string
Return parameters
FU32 0 if successful, otherwise error
If the starting position is not found in the source string, a blank string is
produced. If the source string is too short, the destination string is shortened
accordingly.
STRNCMP
Compare the first characters of two strings.
Input parameters
FU32 Number of the first string
FU33 Number of the second string
FU34 Number of characters
Return parameters
FU32 0 if successful, otherwise error
FU33 1 if characters in first string
> characters in second string
0 if both strings are identical
-1 if characters in first string
< characters in second string
Upper-case and lower-case letters are differentiated. Upper-case letters have a
lower value than lower-case letters.
STRNICMP
Compare the first characters of two strings.
Input parameters
FU32 Number of the first string
FU33 Number of the second string
FU34 Number of characters
FST Version 4.02.21 Manual
182
Return parameters
STRUPPER
Convert a string to upper case.
Input parameters
FU32 Number of the string
Return parameters
FU32 0 if successful, otherwise error
Note! Country-specific characters like , , are not converted.
STRUSAGE
Determine the amount of used and free memory for strings.
Input parameters
None
Return parameters
FU32 Memory used by strings
FU33 Free memory remaining
STRUTOA
Convert an unsigned word into a string.
Input parameters
FU32 Value to be converted
FU33 Number of the string
Return parameters
FU32 0 if successful, otherwise error
STR2FLAG
Copy a string into a flag word area.
Input parameters
FU32
FU33
FU34
Return parameters
FU32
FU33
FLAG2STR
Copy a flag word area into a string.
FST Version 4.02.21 Manual
183
Input parameters
The user interface is divided into individual screen pages. The various screen pages are
accessed via a number, beginning at 0. Each screen page contains a user- definable number
of fixed frames, text blocks, display areas and input fields. Switching from one screen page
to another is normally taken care of by the user program in the FST. There are appropriate
program modules, which deal with this.
All screen pages are independent of each other.
The amount of memory space provided allows for up to 50 screen pages, each with a maximum of 50 input fields.
All input fields use the string data type from the string driver. There are no dynamic displays.
It is an easy matter to create such displays, however, by invoking the SCRWRITE module.
It is possible to switch between the FST user interface provided by this driver and the command interpreter of the main runtime program (FSTPCR22).
If the necessary extra effort is made, it is also possible to set up special-purpose screen
representations (for example to suit particular customer requirements). There is a number of
FST Version 4.02.21 Manual
184
modules for this purpose, which disregard the conditions that otherwise generally, apply
and which access the screen and keyboard directly.
4.11.2 Operation of the user interface
The method of operating the user interface is based on that for the FST software. The table
below shows the functions of the keyboard but without the standard letters that are entered
in the respective input fields.
Keyboard
TAB
ENTER
Down
Arrow
Function
Move to the next input field
ShiftTAB
Up arrow
HOME
END
BS
In overtype mode: one character to the left; in insert mode: delete the character to the left of the cursor
Left
arrow
Right
arrow
INS
DEL
Alt-F10
Processing of the entry of ESC, F1 to F10, CTRL-UP ARROW, CTRL-DOWN ARROW, PAGE-UP,
PAGE-DOWN, CTRL- HOME, CTRL-END, CTRL-PAGE-UP and CTRL-PAGE-DOWN must be dealt
with by the user program.
All inputs of standard characters (letters and digits) are made directly into the various
strings that are provided for each input field.
4.11.3 Functionality
If necessary, strings assigned for input fields are shortened to the maximum length of the
defined input field. In the case of input fields for passwords, the length is reduced to zero
before editing; i.e. the string is deleted.
It is possible to switch between the FST user interface and the command interpreter of the
runtime main program. This can be done in two ways: either directly via the keyboard or by
the user program in the FST via the SCRFLIP module:
In the CI:
The F command switches to the current screen page.
FST Version 4.02.21 Manual
185
186
15
V Meaning
a
l
u
e
0 No automatic activation
1 Automatic activation (== ACTIVATE)
15
Set by the driver in the event of syntax errors
If bit 2 is set (handshake with SCRKBD), it must be ensured that all inputs will be picked up
by the user program because otherwise input will be blocked. Bit 15 is set by the driver
during processing of the initialisation data.
4.11.4 Configuring the driver and assigning parameters
If you want to use the screen driver in an FST IPC project, you must enter the SCREEN driver
in the driver configurer and assign the necessary parameters. The driver for the user interface makes internal use of the driver for strings. This driver must therefore also be configured.
IPC drive:
Specify the drive on which the screen driver SCREEN.EXE is located or onto which it is to be
loaded.
Screen type:
Here you must specify the type of video card that is connected:
CGA CGA card with 80x25 characters
MGA MGA card with 80x25 characters
HGC HGC card with 80x25 characters
EGA EGA card with 80x25 characters
VGA VGA card with 80x25 characters
BG20 BG20 on the IPC with 40x30characters
The default setting is CGA.
File with screen layout [.TXT]:
Here you must specify the name of the file that contains the data for initialising the user
interface.
FST Version 4.02.21 Manual
187
<string>
<string>
188
Display for the message line; a maximum of 78 characters. In the case of MESSAGE_ERROR
the display is made with the attribute for error messages.
FUNCTION_KEY <key number> <upper string> <lower string>
Strings for the upper and lower halves of a label for a function key, each consisting of up to
8 characters.
INPUT_STRING
<X position> <Y position> <width> <string number>
INPUT_PASSWORD
<X position> <Y position> <width> <string number>
Definition of a positioned input field. All inputs are made in strings. These must then be
evaluated by the user program by means of appropriate string functions. For details refer to
the description of the string driver. The width specified here is the maximum length of the
edited string, and the string number indicates the number of the string (in the string driver)
that is used for the edited string. When INPUT_PASSWORD is used, the contents of the
string are not displayed.
FRAME
<X position> <Y position> <width> <height> <string for title>
For drawing a frame, positioned with the top left-hand corner (x,y) and a frame title. Even if
the title is blank it must be specified. The title must not be longer than the specified width
less two.
Example
Below is a simple example consisting of three screen pages for the production of an extraordinarily important basic foodstuff for mankind.
; default settings
FEATURE_FLAGS 1
ACTIVATE
; screen 0, first screen
SCREEN_INITIAL "[ Chewing Gum Production ]"
TEXT 30 10 0 "Chewing Gum Production is Ready"
FUNCTION_KEY 1 "START" ""
; screen 1, interrogation of production quantity
SCREEN "[ Chewing Gum Production ]"
TEXT 20 10 0 "How many?"
INPUT_STRING 45 10 5 1
FUNCTION_KEY 1 "START" "SYSTEM"
FUNCTION_KEY 2 "STOP" "SYSTEM"
; screen 2, error
SCREEN "[ Chewing Gum Production ]"
TEXT 20 10 1 "Production Interrupted"
MESSAGE_ERROR "Nothing Works Without Gum"
FUNCTION_KEY 1 "continue" ""
Switching between the individual screen pages and evaluation of the input of the production
quantity takes place within the control program and is not shown here.
4.11.6 Extended CI commands for the user interface
This driver includes a command interpreter add-on to allow operation of the user interface
via the command interpreter.
FST Version 4.02.21 Manual
189
190
Output parameters
SCRCLEAR
Clear screen.
Input parameters
None
Output parameters
None
This module should be used for special applications only and also works on the screen of
the runtime main program. The module is not necessary for normal applications.
SCRCUGPO
Determine current position of cursor.
Input parameters
None
Output parameters
FU32 X starting position, column, 0 to 79,
in the case of errors -1
FU33 Y starting position, line, 0 to 23,
in the case of errors -1
This module should be used for special applications only and also works on the screen of
the runtime main program. The module is not necessary for normal applications.
SCRCUSPO
Set current position of cursor.
Input parameters
FU32 X starting position, column, 0 to 79
FU33 Y starting position, line, 0 to 23
Output parameters
None
This module should be used for special applications only and also works on the screen of
the runtime main program. The module is not necessary for normal applications.
SCRCUTYP
Set cursor type.
Input parameters
FU32 0 = No cursor
1 = Underline cursor
2 = Block cursor
Output parameters
None
This module should be used for special applications only and also works on the screen of
the runtime main program. The module is not necessary for normal applications.
SCRDOKEY
Execution of a keyboard input.
Input parameters
FU32 Keyboard input
Output parameters
None
This module should be used for special applications only and also works on the screen of
the runtime main program. The module is not necessary for normal applications.
SCREDIT
Add an input field.
Input parameters
Output parameters
FST Version 4.02.21 Manual
FU32
FU33
FU34
FU35
X position
Y position
Width
= 0, standard input field
= 1, input field for password (string not visible)
FU36 String number
FU32 = 0 if display appears
191
None
None
SCRFILL
Fill an area with space characters.
Input parameters
FU32
FU33
FU34
FU35
FU36
Output parameters
FU32
SCRFKEY
Specify the label of a function key.
Input parameters
FU32
FU33
function key
FU34
key
Output parameters
FU32
half of the
= 0 if display appears
= -1 if the string does not exist, the number of the
function key is not admissible or the user interface is
not activated
Each function key has an upper and a lower string. Each string may contain up to 8 characters.
SCRFLAGS
Set properties of the user interface (feature flags).
Input parameters
FU32 0 = Interrogate current setting
1 = New setting
If FU32 = 1
FU33 Feature flags
Output parameters
FU32 Current setting of the feature flags
The basic setting is 0.
SCRFLIP
Toggle the screen display between the currently selected screen page in this driver and the
screen of the main runtime program FSTPCR22.
Input parameters
FU32 0
FSTPCR22 screen
1
Currently selected screen page in this driver
Output parameters
None
SCRFRAME
FST Version 4.02.21 Manual
192
Draw a frame.
Input parameters
Output parameters
FU32
FU33
FU34
FU35
FU32
SCRKBD
Interrogate the last input on the keyboard.
Input parameters
None
Output parameters
FU32 = 0 if no input is available
<>0 last input
Currently the following inputs are supported.
Key
Hexadecimal Low-order byte
Decimal
ESC
001B 27
Character codes
F1
013B 315
Scan codes
F2
013C 316
F3
013D 317
F4
013E 318
F5
013F 319
F6
0140 320
F7
0141 321
F8
0142 322
F9
0143 323
F10
0144 324
PAGE UP
0149 329
PAGE DOWN
0151 337
CTRL ARROW LEFT
0173 371
CTRL ARROW RIGHT
0174 372
CTRL END
0175 373
CTRL PAGE DOWN
0176 374
CTRL HOME
0177 375
CTRL PAGE UP
0184 388
If direct reading of the keyboard is activated (feature flags bit 1 = 1), all inputs are returned
without processing. Normal processing can be carried out using the SCRDOKEY module.
SCRMSG
Display a string in the message line, optionally as an error message.
Input parameters
FU32 Number of the string to be displayed
FU33 0 for normal display
1 for an error message
Output parameters
FU32 = 0 if display appears
= -1 if the string does not exist or
the user interface is not activated
To delete the message line, use a blank string.
SCRNEW
Draw a new, blank screen in the same way as FST.
Input parameters
None
Output parameters
None
FST Version 4.02.21 Manual
193
This module should only be used if the option of initialisation is not used but instead the
screen is built directly by programming in the user program.
SCRPUTS
Write a string at a set position on the screen.
Input parameters
FU32 Number of the string to be displayed
FU33 X starting position, column, 0 to 79
FU34 Y starting position, line, 0 to 24
FU35 0 for normal display
1 for highlighted display
Output parameters
FU32 = 0 if display appears
= -1 if the string does not e xist, the position is invalid
or the user interface is not activated
This module should be used for special applications only and also works on the screen of
the runtime main program. The module is not necessary for normal applications.
SCRUPDT
Refresh screen contents.
Input parameters
None
Output parameters
None
The only items redisplayed are data from the operand memory and strings, but not edited
strings.
SCRWRITE
Write a string at a set position on the screen
Input parameters
FU32 Number of the string to be displayed
FU33 X starting position, column, 0 to 79 or negative
FU34 Y starting position, line, 0 to 24
FU35 0 for normal display
1 for highlighted display
Output parameters
FU32 = 0 if display appears
= -1 if the string does not exist, the position is invalid
or the user interface is not activated
If the X position is negative, the string is displayed in such a way that it ends at the specified
position (right-justified).
SCRW0808
Write a string comprising large 8x8 block characters at a set position on the screen.
Input parameters
FU32 Number of the string to be displayed
FU33 X starting position, column, 0 to 72 or negative
FU34 Y starting position, line, 0 to 14
FU35 0 for normal display
1 for highlighted display
Output parameters
FU32 = 0 if display appears
= -1 if the string does not exist, the position is invalid
or the user interface is not activated
If the X position is negative, the string is displayed in such a way that it ends at the specified
position (right-justified). Internally the module uses the string with the number 0 as an
interim storage location.
SCRW0814
Write a string comprising large 8x14 block characters at a set position on the screen.
Input parameters
FU32 Number of the string to be displayed
FST Version 4.02.21 Manual
194
0
1
2
195
TEXT 25 9 0 "requested"
TEXT 25 11 0 "produced"
TEXT_UNSIGNED -42 9 0 1
FUNCTION_KEY 2 "STOP" ""
; screen 3
SCREEN "[ Chewing Gum Production ]"
TEXT 26 10 1 "Missing Liquid Rubber."
MESSAGE_ERROR " No Chewing without Rubber."
FUNCTION_KEY 1 "continue" ""
In the basic settings it is established that it is not to be permitted to switch from a screen
page to the screen of the runtime main program. As far as the plant operating staff is concerned, therefore, the CI is not accessible. For the automation engineer, on the other hand,
the CI can be reached at any time via a connected host. The program for the production
plant is listed below. It was not considered necessary to show the allocation list in this
context.
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022
0023
0024
0025
0026
0027
0028
0029
0030
0031
0032
0033
0034
0035
(1)
(2)
THEN CMP 1
LOAD PARAM_1
TO
KEYSTROKE
IF
=
'returned parameter 1
'the obvious
196
0036
TO
NPRODUCED 'produced so far
0037
0038
CMP 2
'SCRXCHG
0039
WITH K1
" flip to screen 1
0040
0041
0042 "" ----------------------------------------------------------------------0043
0044 STEP Screen_1
(3)
" request amount
0045
0046
THEN CMP 1
'SCRKBD
0047
0048
LOAD PARAM_1
'returned parameter 1
0049
TO
KEYSTROKE 'the obvious
0050
0051
IF
KEYSTROKE 'the obvious
0052
=
F1_KEY 'value for F1 key
0053
0054
THEN CMP 5
'STRATOU
0055
WITH K1
"convert user input in string 1
0056
0057
LOAD PARAM_1
'returned parameter 1
0058
TO
NERROR
"0 if a valid unsigned number
0059
0060
LOAD
PARAM_2
'returned parameter 2
0061
TO
AMOUNT
"user input value, amount to produce
0062
0063
IF
" ? user input valid
0064
(
NERROR
'error flag word
0065
=
ZERO ) " has to be zero
0066
AND (
AMOUN
'amount to produce
0067
>
ZERO ) " should be > 0
0068
0069
THEN CMP 2
'SCRXCHG
0070
WITH K2
" flip to screen 2
0071
0072
" timer 0 for production simulation
0073
LOAD K100 " 1 sec
0074
TO
TV0
" to produce a single chewing gum
0075
0076
SET
T0
" start timer (i.e. production)
0077
0078
0079 "" ----------------------------------------------------------------------0080
0081 STEP Screen_2
(4)
" production display
0082
0083
THEN CMP 1
'SCRKBD
0084
0085
LOAD PARAM_1
'returned parameter 1
0086
TO
KEYSTROKE 'the obvious
0087
0088
IF
KEYSTROKE 'the obvious
FST Version 4.02.21 Manual
197
0089
=
F2_KEY 'value for F2 key
0090
0091
" stop production
0092
THEN CMP 2
'SCRXCHG
0093
WITH K0
" flip to screen 0
0094
0095
JMP TO Screen_0 (2)
0096
0097
IF
N
T0
" 1 sec elapsed, simulate production
0098
0099
THEN INC
NPRODUCED 'produced so far
0100
0101
CMP 3
'STRUTOA
0102
WITH NPRODUCED 'produced so far
0103
WITH K2
" to string 2
0104
0105
CMP 4
'SCRWRITE
0106
WITH K2
" string 2
0107
WITH K-42 " X
0108
WITH K11
"Y
0109
WITH K1
" highlighted attribute
0110
0111
SET
T0
" start again
0112
0113
IF
" ? done
0114
NPRODUCED 'produced so far
0115
>
AMOUNT
'amount to produce
0116
0117
THEN CMP 2
'SCRXCHG
0118
WITH K0
" flip to screen 0
0119
0120
JMP TO Screen_0 (2) " done, back
0121
0122
IF
PLANTERR'error in plant
0123
0124
THEN CMP 2
'SCRXCHG
0125
WITH K3
" flip to screen 3
0126
0127
0128 "" ----------------------------------------------------------------------0129
0130 STEP Screen_3
(5)
" error display
0131
0132
THEN CMP 1
'SCRKBD
0133
0134
LOAD PARAM_1
'returned parameter 1
0135
TO
KEYSTROKE 'the obvious
0136
0137
IF
(
KEYSTROKE 'the obvious
0138
=
F1_KEY )
'value for F1 key
0139
0140
AND N PLANTERR'error in plant
0141
FST Version 4.02.21 Manual
198
0142
0143
0144
0145
0146
0147
THEN CMP 2
SET
'SCRXCHG
WITH K2
" flip to screen 2
T0
In the example, the steps and the screens are synchronised with each other. In real-world
situations a somewhat more complex method of synchronising will be required. In such
cases it is worth separating the actual automation tasks and representation on the screen
into two different programs. In order to save on computing time for screen display, the
program for this can be started as a cyclical program, for example every 500 msec (cf. function module F4).
4.11.9 Special applications
For the purposes of this driver for user interfaces, special applications are applications
where representation and operation do not follow the rules of the FST software but instead
are supposed to follow different rules, which are usually customer-specific. Bit 1 must be set
in the FEATURE_FLAGS. This is done with the SCRFLAGS module. Representation on the
screen is then created with two modules.
SCRCLEAR
Clear screen
SCRCUGPO
Determine current position of cursor
SCRCUSPO
Set current position of cursor
SCRCUTYP
Set cursor type
SCRPUTS
Write a string at a set position on the screen
These modules should be used for special applications only and also work on the screen of
the runtime main program. The modules are not necessary for normal applications.
The module for keyboard interrogation returns all inputs from the keyboard.
SCRKBD
Interrogate the last input on the keyboard
You can be returned to normal further processing via the SCRDOKEY module.
SCRDOKEY
LADD
Addition of 32-bit values.
Input parameters
FST Version 4.02.21 Manual
Output parameters
FU34
FU35
FU32
FU33
LCMP
Comparison of 32-bit values.
Input parameters
FU32
FU33
FU34
FU35
Output parameters
FU32
LDIV
Division of 32-bit values (result = 1st operand / 2nd operand).
Input parameters
FU32 Low word of the 1st operand
FU33 High word of the 1st operand
FU34 Low word of the 2nd operand
FU35 High word of the 2nd operand
Output parameters
FU32 Low word of the result
FU33 High word of the result
LMUL
Multiplication of 32-bit values.
Input parameters
FU32
FU33
FU34
FU35
Output parameters
FU32
FU33
LNEG
Change of sign for a 32-bit value.
Input parameters
FU32
FU33
Output parameters
FU32
FU33
LSUB
Subtraction of 32-bit values (result = 1st operand - 2nd operand).
Input parameters
FU32 Low word of the 1st operand
FU33 High word of the 1st operand
FU34 Low word of the 2nd operand
FU35 High word of the 2nd operand
Output parameters
FU32 Low word of the result
FU33 High word of the result
200
Channel 1
1
2
2
2
4
4
4
4
4
4
1
1
1
2
2
2
4
4
4
Channel 2
1
1
2
2
1
2
2
4
4
4
Channel 3
1
1
1
2
1
1
2
1
2
4
1
2
4
1
2
4
1
2
4
201
Output parameters
FU33
FU32
FU33
FU34
0
Current status of counter 1
Current status of counter 2
Current status of counter 3
202
203
204
Examples:
V$8080 Set output x.7, leave outputs x.0 - x.6 untouched
V$FF01 Set output x.0, reset outputs x.1 - x.7
Parameter 7 allows the programmer to decide whether or not the specified Fast Counter
should be automatically restarted after having reached the preselected value.
4.14.5 Starting a Fast Counter
input parameters
FU32 2= start of counter defined in FU33
FU33 0 = first counter
1 = second counter
output parameters
none
This function provides a means to activate a Fast Counter. Before this function is called, the
Fast Counter should first be defined.
Note! If you have started a Fast Counter (without Auto-Restart enabled) and the counter
value reaches the preselect value, you must Reset the counter before attempting to start the
counter again.
4.14.6 Status of a Fast Counter
input parameters
4.15 Positioning
This program module adds support for stepper and servo motors (AM1x and AM20) to your
FST IPC projects.
4.15.1 Import
Import the module AMXX into your project using Project Management - > Import File etc. You
now have available a function module which expects some input (up to 7 integers) and
produces some output (up to 7 integers) via FU32 .. FU38.
205
The module does not really check whether the given parameters fall within the allowed
value range. You will have to look into the current AM1x and AM20 documentation to get an
idea about allowed ranges.
4.15.2 How to use the module
The first input parameter is always the command number (i.e. 0 for get status, 1 for move
absolute, 2 for move relative etc.), the second parameter is always the motor number.
Supported are motor numbers from 1 up to 12, where motor 1 will always correspond to S0
on the module with switch selector 1, motor 2 will always correspond to S1 on the module
with switch selector 1, motor 3 will always correspond to S0 on the module with switch
selector 2 etc.
Motor KSW Label
1
1
S0
2
1
S1
3
2
S0
4
2
S1
...
... ...
11
6 S0
12
6 S1
The first return parameter (FU32) is always a status value.
Additional parameters are returned if the command was a request for information.
4.15.3 Overview
FU32 Function
0
Get status
1
Move absolute
2
Move relative
3
Reference move
4
Override speed
10
Configure polarity
11
Configure start speed and acceleration
12*
Set PID values
13
Set actual position
14*
Set positioning parameters
15*
Set DA output polarity (AM20 < S2.2)
16*
Set P division (AM20 > S2.2)
17*
Polarity for counting of increments (AM20 >= 2.2)
18*
Multiply acceleration by 16 (AM20 >= 2.3)
19*
Set Offset for D/A converter
20
Reset module
21
Stop motor
22*
Enable or disable motor
23*
Delete contouring error
30
Get revision
31
Get speeds / target position
32
Get polarity and PID parameters
33
Get status for AM20 user
40
Move with interpolation I
41
Move with interpolation II
206
AM20 only
AM20 only
FU32
FU33
FU32
FU33
FU34
FU35
FU36
FU37
FU38
0
Motor number
Status (see Table 1)
Switch status (see Table 2)
Extended status, (see Table 3)
Low word of current position
High word of current position
In position status (see Table 4)
Current contouring error
0= Linear ramp
1= no ramp (move with starting frequency without ramp)
0= Reset is finished
1= Reset is active
207
0= Axis is at a standstill
1= Axis is moving
Output parameters
4.15.6 Move relative
Input parameters
Output parameters
FU32 1
FU33 Motor number
FU34 Low word of new position (steps / increments)
Range: 0-65535
FU35 High word of new position (steps / increments)
Range: -128 - +127
FU36 Moving speed
Range / [unit] AM10:
- 0-32000 / [steps / sec]
Range / [unit] AM11:
- 0-16000 / [steps / sec]
Range / [unit] AM20:
- 0-32767 ; [10* incr/sec] < S2.3
- 0-65535 ; [10* incr/sec] >= S2.4
FU32 Status (see Table 1)
FU33 Extended status (see Table 3)
FU32 2
FU33 Motor number
FU34 Low word of relative position (steps / increments)
Range and unit see absolute move
FU35 High word of relative position (steps / increments)
Range and unit see absolute move
FU36 Maximum speed
Range and unit see absolute move
FU37 Direction
1 = positive
-1 = negative
FU32 Status (see Table 1)
FU33 Extended status (see Table 3)
FU32 3
FU33 Motor number
FU34 Speed for reference move
Range and unit see absolute move
FU35 Direction (see Table 5)
Output parameters
FU32 Status (see Table 1)
FU33 Extended status (see Table 3)
Important: the speed given for the reference move will be used for the entire movement.
This means you have to give a speed that is suitable as a start/stop frequency since there is
no ramp applied to the reference move.
FST Version 4.02.21 Manual
208
-1
-2
-3
Output parameters
FU32
FU33
FU34
FU32
4
Motor number
Override (0% ... 100%)
Status (see Table 1)
FU32 10
FU33 Motor number
FU34 Polarity of digital outputs, only AM10 and AM11.
Value for AM20 is always "0"
0 = active low
1 = active high
FU35 Polarity of limit switches
0 = normally closed
1 = normally opened
FU36 Polarity of reference switch
0 = normally closed
1 = normally opened
FU32 Status (see Table 1)
4.15.10
Configure start speed and acceleration
Input parameters
FU32 11
FU33 Motor number
FU34 Start speed
Range / [unit] AM10:
- 0-32000 / [steps / sec]
Range / [unit] AM11:
- 0-16000 / [steps / sec]
Range / [unit] AM20:
- 0-32767 ; [10* incr/sec]
FU35 Acceleration / Deceleration
Range / [unit] AM10, AM11:
FST Version 4.02.21 Manual
209
Output parameters
4.15.11
Configure PID values (AM20 only)
Input parameters
FU32 12
FU33 Motor number
FU34 P-Factor (range 0-255)
FU35 I-Factor (range 0-255)
FU36 D-Factor (range 0-255)
FU37 V-Factor (range 0-255)
Output parameters
FU32 Status (see Table 1)
4.15.12
Set actual position
Input parameters
FU32
FU33
FU34
FU35
Output parameters
FU32
13
Motor number
Low word of new position
High word of new position
Status (see Table 1)
4.15.13
Set positioning parameters (AM20 only)
Input parameters
FU32 14
FU33 Motor number
FU34 maximum allowed contouring error
Range / [unit]:
- 0-32767 / [increments]
FU35 In position window
Range / [unit]:
- 0-2557 / [increments]
Output parameters
FU32 Status (see Table 1)
4.15.14
Set D/A output polarity (AM20 > S 2.2 only)
Input parameters
FU32 15
FU33 Motor number
FU34 Polarity of D/A output
0 = normal
1 = inverted
Output parameters
FU32 Status (see Table 1)
4.15.15
Set P division (AM20 > S2.2 only)
Input parameters
FU32 16
FU33 Motor number
FU34 Division
0 = P factor will function normally
1 = P factor will be divided by 16
Output parameters
FU32 Status (see Table 1)
4.15.16
Set counter input polarity (AM20 >= S 2.3 only)
Input parameters
FU32 17
FU33 Motor number
FST Version 4.02.21 Manual
210
Output parameters
4.15.17
Set acceleration multiplicator (AM20 >= S 2.3 only)
Input parameters
FU32 18
FU33 Motor number
FU34 Multiplicator
0 = acceleration normal
1 = acceleration will be multiplied by 16
Output parameters
FU32 Status (see Table 1)
4.15.18
Set Offset for D/A converter (AM20 >= S 2.3 only)
Input parameters
FU32 19
FU33 Motor number
FU34 Offset:
0 - 127: positive
128-255: negative
Output parameters
FU32 Status (see Table 1)
4.15.19
Reset module
Input parameters
FU32 20
FU33 Motor number
Output parameters
FU32 Status (see Table 1)
Note that if you reset one motor of a two motor module the other one will be reset as well.
4.15.20
Stop motor
Input parameters
FU32 21
FU33 Motor number
Output parameters
FU32 Status (see Table 1)
Stop movement using the defined acceleration value.
4.15.21
Set / Reset enable (AM20 only)
Input parameters
FU32 22
FU33 Motor number
FU34 0 = reset enable output
1 = set enable output
Output parameters
FU32 Status (see Table 1)
4.15.22
Delete contouring error (AM20 only)
Input parameters
FE32 23: up driver version V1.17
FE33 Motor number
Output parameters
FE32 Status (see Table 1)
4.15.23
Get revision (AM20 only)
Input parameters
FU32 30
FU33 Motor number
Output parameters
FU32 Status (see Table 1)
FU33 Revision number
FST Version 4.02.21 Manual
211
4.15.24
Get speeds / target position
Input parameters
FU32 31
FU33 Motor number
Output parameters
FU32 Status (see Table 1)
FU33 Start frequency
FU34 Acceleration
FU35 Maximum frequency
FU36 Target position low word
FU37 Target position high word
4.15.25
Get polarity and PID parameters
Input parameters
FU32 32
FU33 Motor number
Output parameters
FU32 Status (see Table 1)
FU33 Polarity register (see Table 6)
FU34 P-Factor
FU35 I-Factor
FU36 D-Factor
FU37 V-Factor
Table 6: Polarity
Bit
Description
0
0= Interpolation inactive
1= Interpolation active
4.15.26
Get status for AM20 user
Input parameters
FU32 33
FU33 Motor number
Output parameters
FU32 Status (see Table 1)
FU33 Status flags (see Table 7)
FST Version 4.02.21 Manual
212
FU34
FU35
FU36
FU37
P-Factor
I-Factor
D-Factor
V-Factor
0= Enable is off
1= Enable is on
1= Motor is stopped
1= Motor is moving
4.15.27
Move with interpolation (AM20 >= 2.3 only)
Input parameters
FU32 40
FU33 Motor (1,3,5,7,9,11)
FU34 Low word of new position / distance for motor 1
FU35 High word of new position / distance for motor 1
FU36 Low word of new position / distance for motor 2
FU37 High word of new position / distance for motor 2
Output parameters
FU32 Status (see Table 1)
FU33 Error code:
0 = OK
-1 = wrong motor number
4.15.28
Move with interpolation (AM20 >= 2.3 only)
Input parameters
FU32 41
FU33 Motor (1,3,5,7,9,11)
FU34 Move relative or absolute
0 = absolute
1 = relative
FU35 Maximum speed
FU36 Direction for motor 1 (if relative move)
1 = positive
FST Version 4.02.21 Manual
213
Output parameters
4.15.29
-1 = negative
FU37 Direction for motor 2 (if relative move)
1 = positive
-1 = negative
FU32 Status (see Table 1)
FU33 Error code:
0 = OK
-1 = wrong motor number
-2 = Function 40 not yet called
Sample programs
4.15.29.1
Sample program for stepper motor (AM1x)
"" Sample program for stepper motor
"" Uses R0 for motor number
STEP init
"" Start with configuration
IF
NOP
THEN LOAD
V1
TO
R0
IF
THEN CFM 51
WITH
WITH
'Motor Number
NOP
V20
R0
CFM 51
WITH
WITH
WITH
WITH
WITH
V10
R0
V1
V0
V1
CFM 51
WITH
WITH
WITH
WITH
V11
R0
V10
V1000
STEP loop
IF
THEN CFM 51
WITH
WITH
LOAD
TO
IF
AND N
THEN CFM 51
WITH
FST Version 4.02.21 Manual
NOP
V0
R0
FU34
FW34
'FU34=extended status
F1.0
F34.7
V1
'Start Flag
'Run Flag
" AMxx module
" Start absolute move
214
WITH
WITH
WITH
WITH
R0
V2000
V0
V2500
'Motor Number
" Position low word
" Position high word
" Moving speed 2500 Hz
STEP
IF
THEN CFM 51
WITH
WITH
LOAD
TO
NOP
V0
R0
FU34
FW34
'FU34=extended status
IF
THEN
F34.7
NOP
IF
THEN CFM 51
WITH
WITH
NOP
'Run Flag
STEP
LOAD
TO
IF
N
THEN CFM 51
WITH
WITH
WITH
WITH
WITH
STEP wait
IF
THEN CFM 51
WITH
WITH
LOAD
TO
V0
R0
FU34
FW34
'FU34=extended status
F34.7
V1
R0
V0
V0
V5000
NOP
V0
R0
FU34
FW34
'FU34=extended status
IF
F34.7
THEN JMP TO loop
OTHRW JMP TO wait
4.15.29.2
'Run Flag
" AMxx module
" Start absolute move
'Motor Number
" Position low word
" Position high word
" Moving speed 5000 Hz
'Run Flag
215
'Motor Number
IF
THEN CFM 51
WITH
WITH
V20
R0
V10
R0
V0
V0
V1
CFM 51
WITH
WITH
WITH
WITH
V11
R0
V5
V1000
CFM 51
WITH
WITH
WITH
WITH
WITH
WITH
V12
R0
V1
V2
V0
V3
CFM 51
WITH
WITH
WITH
WITH
V14
R0
V10000
V20
V22
R0
V1
CFM 51
WITH
WITH
WITH
WITH
WITH
CFM 51
WITH
WITH
WITH
STEP loop
IF
THEN CFM 51
WITH
WITH
LOAD
TO
IF
FST Version 4.02.21 Manual
NOP
NOP
V0
R0
FU34
FW34
'FU34=extended status
F1.0
'Start Flag
216
AND N
THEN CFM 51
WITH
WITH
WITH
WITH
WITH
STEP
IF
THEN CFM 51
WITH
WITH
LOAD
TO
IF
THEN
STEP
IF
THEN CFM 51
WITH
WITH
LOAD
TO
IF
N
THEN CFM 51
WITH
WITH
WITH
WITH
WITH
STEP wait
IF
THEN CFM 51
WITH
WITH
LOAD
TO
IF
THEN JMP TO loop
ELSE
JMP TO wait
F34.7
V1
R0
V2000
V0
V2500
'Run Flag
" AMxx module
" Start absolute move
'Motor Number
" Position low word
" Position high word
" 10*2500 incr/sec
NOP
V0
R0
FU34
FW34
'FU34=extended status
F34.7
NOP
'Run Flag
NOP
V0
R0
FU34
FW34
F34.7
V1
R0
V0
V0
V5000
NOP
V0
R0
FU34
FW34
'FU34=extended status
F34.7
'Run Flag
217
218
4.16.3.2
Explanation of parameters
Man/Auto:
If this parameter is 0, the control loop is inactive and the manual value is copied to the
output value. If this parameter is 1, the control loop is active and the output value is calculated according to setpoint, process value and control parameters.
Setpoint:
The target for the controller in auto mode.
Process value:
The input value for the control loop.
Output value:
The output value from the control loop.
Manual value:
An operator override in case of manual mode.
Kp:
The proportional parameter for the control loop.
Ki:
The integral parameter for the control loop.
Kd:
The differential parameter for the control loop.
Time constant:
Indicator for the interval time with which the control loop calculates its output value.
If the time constant is 0 the control loop calculates approximately every 14 ms, if the time
constant is 1 the control loop calculates approximately every 28 ms, etc.
The Setpoint, Process value, Output value and Manual value are all in the range from 0 to
4095.
The Kp, Ki and Kd values are divided by 100 inside the control loop. So if you set a Kp of 125
in the table, the control loop calculates with 1.25.
4.17 Serial Communication
Version 1.33
This driver allows characters to be sent and received via standard COM ports.
HC1X and HC2X
Up to 4 ports are supported. These can be either COM1..COM4 or COM2..COM5.
Note! The serial port on the HC2X CPUs labelled "COM" is the COM1 port!
HC0X
The interfaces COM and EXT can be used for serial communication. Additional COM ports on
CP3x modules can be used:
Due to mutual exclusions of external interrupt sources (IRQs) you can
either use COM2 or COM4. If you do so, for HC01 the trimmer no longer can
be used. For HC0X this also requires to change jumper J1 (see the hardware
manual for details). On the HC02 there is no trimmer anyway, and no
jumpers have to be changed.
Due to mutual exclusions of external interrupt sources (IRQs) you can
either use COM3 or COM5.
If you want to use COM1 on HC02 you can do so, but this does not allow to
use the ethernet port any longer and requires to change another jumper
(see the hardware manual for details). On the HC01 you can use COM1
without restrictions.
219
FECs
The interfaces COM and EXT can be used for serial communication. Due to very limited
memory in the FC20, only FEC Compacts of the FC3x series and FEC Standards should be
used for serial communication.
Beginning with version 1.31 the driver supports FIFOs. Check the version number with the
CI-Command "!8" which is available since version 1.31.
4.17.1
Selecting and parameterising the driver
If you wish to use the serial driver in an FST project, you must enter the
correct driver(s) according to the table below in the driver configurer and
parameterise it.
4.17.1.1
HC1X and HC2X
Please use the SERIALDR driver.
4.17.1.2
HC0X
If you are using only COM and/or EXT please use the driver COMEXT.
If you are using CP3x please use HC0XCOM instead (this driver includes the
routines for COM and EXT as well).
For HC0X < S2.00 you also need to include the driver FOSEXT if you want to use
the EXT port (HC0X < S1.11 requires the use of FOSSIL2 instead of FOSEXT).
4.17.1.3
FEC Compact
Please use the driver COMEXT.
For the EXT port you also need to include the driver FOSEXT (FC20 < V1.21 and
FC30 < S1.10 require the use of FOSSIL2 instead of FOSEXT).
4.17.1.4
FEC Standard
Please use the driver COMEXT.
Note! Some of the modules provided also require the STRINGS driver.
Destination drive:
Enter the drive containing the serial driver or to which it is to be loaded.
4.17.2
Modules
The modules for serial communication require the serial interface that is used
as parameter (FU32). Please note the following assignment of port numbers:
COM 255
EXT
0
COM1 1
COM2 2
COM3 3
COM4 4
COM5 5
Note! You must not use the serial port that is used for the standard CI with these modules,
except when it is referred to as port 255 (COM).
The standard COM port for the CI is set in the Controller Settings of the FST project.
220
OPENCOM
Open (initialise) a serial interface with 9600 baud, 8 data bits, no parity.
Input parameters
FU32 Serial interface
Output parameters
FU32 0 = DONE
1 = ERROR
Use F30 instead of OPENCOM for other com port settings.
CLOSECOM
Close a previously opened serial interface.
Input parameters
FU32 Serial interface
Output parameters
FU32 0 = DONE
1 = ERROR
GETCOM
Read character from a serial interface.
Input parameters
FU32 Serial interface
Output parameters
FU32 0 = DONE
1 = ERROR
-1 = NOTHING RECEIVED
For FU32 = DONE
FU33 Received char. (0 to 255)
PUTCOM
Write character to a serial interface.
Input parameters
FU32 Serial interface
FU33 Char. to be sent (0 to 255)
Output parameters
FU32 0 = DONE
1 = ERROR
FST Version 4.02.21 Manual
221
PRINTCOM
Write an FST string to a serial interface.
Input parameters
FU32 Serial interface
FU33 Number of FST string to be sent
Output parameters
FU32 0 = DONE
1 = ERROR
READCOM
Read characters from a serial string to a delimiter and save to an FST string.
Input parameters
FU32 Serial interface
FU33 Number of FST string for the character string.
FU34 Maximum length
FU35 Delimiter (0 to 255)
Output parameters
FU32 0 = DONE
1 = ERROR
-1 = NOTHING RECEIVED
The delimiter is not written to the string.
READLCOM
Read characters from serial interface to selected standard end-of-record character (default
is CR) and save to FST string.
Input parameters
FU32 Serial interface
FU33 Number of the FST string for the character string.
FU34 Max. length including end-of-record character.
Output parameters
FU32 0 = DONE
1 = ERROR
-1 = NOTHING RECEIVED
The delimiter is written with the string.
F30
Open port and set interface parameter.
Input parameters
FU32 Serial interface
FU33 Interface parameter
Output parameters
None
7
6
Baud rate
3
2
Char. length
Bit
7
1
1
1
1
1
1
1
1
6
0
0
0
0
1
1
1
1
5
0
0
1
1
0
0
1
1
4
0
1
0
1
0
1
0
1
Bit
3
0
0
1
1
2
0
1
0
1
Bits/characters
5
6
7
8 (default)
0
Parity
Baud
19200
9600 (default)
4800
2400
1200
600
300
110
222
Bit
1
0
0
1
1
0
0
1
0
1
Parity
NONE (default)
ODD
NONE
EVEN
Note! For the COM port (255) only the settings N,8,1 are accepted.
Note! For the COM port (255) of FC20 only the baud rates 9600 or less are useful
due to the optocouplers.
F31
Activate CI.
Input parameters
F34
Interrogate settings and status of a serial interface.
Input parameters
FU32 Serial interface
Output parameters
FU32 Number of records in receive buffer
(separated by standard end-of-record characters).
F35
Change standard end-of-record character. Default is CR (13).
Input parameters
FU32 Serial interface
FU33 End-of-record characters (0 to 255)
Output parameters
None
BREAKCOM
Send hardware BREAK.
Note! This function is only implemented for the SERIALDR (HC1X and HC2x).
Input parameters
FU32 Serial interface
FU33 1 = BREAK on
0 = BREAK off
FST Version 4.02.21 Manual
223
Output parameters
None
IS485
Returns current port setting regarding RS485 support.
Input parameters
FU32 Serial interface
Output parameters
FU32 0 = DONE
1 = ERROR
FU33 1=RTS control for RS485 active
0=normal RS232 operation
Note!
FST driver SERIALDR Version 1.10 or greater is required.
This function is only implemented for the SERIALDR (HC1X and HC2x).
SETRTS
Enables/disables RTS control for RS485 serial communication via SM30 IPC module.
Input parameters
FU32 Serial interface
FU33 1 for RS485 operation,
0 for normal RS232 operation
Output parameters
FU32 0 = DONE
1 = ERROR
Note!
Has to be called before opening the port.
FST driver SERIALDR Version 1.10 or greater is required.
This function is only implemented for the SERIALDR (HC1X and HC2x).
4.18 TCP/IP driver
Version 1.12
This driver allows the IPC to communicate with other PCs and Controllers using the UDP or
TCP protocol from the TCP/IP protocol suite.
4.18.1
Introduction
In this document terms related to TCP/IP are used, for explanation please refer to one of the
many books and internet sites. A good starting point is http://www.whatis.com where all
kinds of technical terms are explained.
4.18.2
Driver overview
To function properly every TCP/IP participant (host) needs an IP address and netmask. The
FST TCP/IP driver allows 3 ways for configuring these: configuration in the Driver configuration screen, using function blocks or dynamically using the BOOTP or DHCP protocol.
Note! If the IP address is 0 (0.0.0.0) either through configuration or change through a function block the BOOTP/DHCP protocol will be automatically activated.
If the IP address is set the BOOTP/DHCP protocol will be deactivated.
The FST TCP/IP driver implements the following protocols / services for communication and
testing:
Protocol
Port
Service
Description
ICMP
UDP
UDP
UDP
n.a.
7
9
13
n.a.
echo
discard
daytime
224
UDP
UDP
UDP
UDP
UDP
UDP
TCP
TCP
TCP
TCP
TCP
19
37
991
992
993
995
7
9
13
19
991
chargen
time
CI
CI_EXT
CI_BIN
EasyIP
echo
discard
daytime
chargen
CI
The TCP command interpreter at port 991 can be accessed with a program like TELNET. Start
TELNET with parameters IP number and 991 (i.e. TELNET 10.10.10.1 991), now it is possible
to send and receive just as via the normal RS-232 command interpreter. Please note that
only 1 connection is allowed at the same time and the connection will automatically be
closed after 60 seconds of no interaction.
The command interpreter can also be accessed as follows: send an UDP datagram with the
CI command (without CR / LF) to the FST controller at port number 991 and the result will be
returned. For example DR0 will result in something like =1099.
Using the extended command interpreter on port 992 is similar with a small extension. The
response will be the original question and the CI reply separated by a NULL character. So
when sending DR0 the result will be DR0 NULL character =1099.
Using the TCP (telnet) way is more convenient for users, using UDP is better suited for programs that need to access FST operands.
Note!
Do not use the Y! command. This command will stop all programs and drivers, since TCP/IP
is implemented as a driver it will be stopped as well !
The LE commands are not available via the telnet interface.
4.18.3
Configuring the driver and assigning parameters
If you want to use TCP/IP in a FST IPC project, you must enter the TCP/IP driver in the driver
configuration and assign the necessary parameters.
Different driver names exist for different target systems, the following table lists the supported target systems and their driver:
TCPIPDRV
TCPIPFEC
TCPIPFC2
TCPIPHC0
PS1-HC02
TCPIP_15
TCPIPXXX
225
4.18.4
Configuration of TCP/IP driver for PS1-CP10, CP11, CP12 and CP14:
Destination drive:
Specify the drive on which the TCP/IP driver TCPIPDRV.EXE is located or onto which it is to
be loaded.
Interrupt of CP10/CP11/CP12/CP14 module:
The interrupt as configured on the module. Allowed values are 2, 3, 5, 6 and 7. Make sure
that the jumper on the network module is set accordingly and that there are no conflicts
with other IPC modules.
IO port configuration:
The IO port (in hexadecimal !) as configured on the module. Allowed values are 300, 320,
340 and 360. Make sure that the switches on the network module are set accordingly and
that there are no conflicts with other IPC modules.
IP address:
The IP address. Leave the address to 0.0.0.0 if the address is configured through the IP_IP
function block or dynamically through the BOOTP protocol.
IP netmask:
The IP netmask. Leave the mask to 255.255.255.0 if the netmask is configured through the
IP_MASK function block or dynamically through the BOOTP protocol.
IP address gateway:
The IP address for the standard gateway. Leave the address to 0.0.0.0 if there is no gateway
or the gateway address is configured through the IP_GATE function block or dynamically
through the BOOTP protocol.
4.18.4.1
Configuration of TCP/IP driver for PS1-CP15:
Only destination drive and IP configuration are needed. Additionally there is a configuration
file PKT.INI (in the FST runtime directory) that must be edited to reflect the settings to be
used. Most important parameters are BitRate, Channel, RadioType and SystemId.
The PKT.INI will be downloaded into the IPC when downloading the project. Please make
sure that after modification the file is downloaded since the project download will only
freshen files with different sizes.
Configuration of TCP/IP driver for FEC Compact, FEC Standard, PS1-HC02:
Only destination drive and IP configuration are needed.
Configuration of TCP/IP driver for 2 network cards:
Lots of parameters are needed. Destination drive, port and interrupt number for both cards,
IP configuration for both cards.
Please be careful when using the TCPIPXXX driver:
On the second card BOOTP/DHCP is not possible. The second card only allows a local network (no gateway option for routing).
Functions like EASY_S, EASY_R, UDP_SEND etc. will automatically select the first or second
network card based upon IP configuration and destination IP.
For performance reasons it is advised to use HC20 or better CPUs.
4.18.5
Extende d CI commands for TCP/IP
This driver extends the IPC command interpreter with the following commands:
!26 Display version number
Display driver info and version number. This information will also be displayed if an unknown command is entered (for example !26?).
226
227
228
Output parameters
FU32 0 if request send, otherwise error
This function module requests a block of operands.
Note!
The operand TYPE specified in FU33 (source of remote data requested) also defines the
Local Operand TYPE where the operand will be stored in the local (requesting) controller.
For example:
IF
THEN CMP 12
'EASY_R
WITH V3
" Table Index 3
WITH V4
" get Registers
WITH V10 " get 10 Registers
WITH V150 " 1st Remote Reg -> Local R150
WITH V34 " Remote Register data block
" is R34 to R43
WITH V99 " Status in FlagWord 99
If no response is received after approximately 50 milliseconds the status flagword will indicate a timeout. Only 1 request can be active for each index number.
Status values are:
-1
Packet send, no response or timeout yet
0
128
EASY_S
Send a block of operands to another controller.
Input parameters
FU32 Index number in IP table
FU33 Operand type,
1=flags,
2=inputs,
3=outputs,
4=registers,
11=strings
FU34 Number of operands to send (maximum 256)
FU35 Number of first operand to send
FU36 Number of first operand in remote controller
FU37 Number of flagword for status (-1 if no acknowledge wanted)
Output parameters
FU32 0 if data send, otherwise error
FST Version 4.02.21 Manual
229
128
IP_ALIVE
Checks the ARP table, to see if an IP address is known.
Input parameters
FU32 Index number in IP table
Output parameters
FU32 0 if successful, otherwise error
FU33 0 if IP address unknown
1 if IP address known
2 if IP address must be reached through a gateway
Be aware that if a controller is stopped, disconnected or otherwise no longer available it can
take up to 10 minutes before IP_ALIVE indicates that the IP address is unknown.
Other alternatives are available, for example testing the status value from EasyIP packets or
using the function module PING if no EasyIP communication is used.
IP_IP
Set or get the IP address.
Input parameters
FU32 1 to set the IP address
FST Version 4.02.21 Manual
230
231
4.18.7
More modules for TCP/IP
Overview of special modules
These modules are listed separately because their use requires special expertise, they are
rarely used etc.
DNS_NAME
Get/set hostname and domain name
DNSRESOL
Resolve hostname to IP address
IP_DNS
Get/set IP address for DNS server
IP_GATE
Get/set IP address for gateway
IP_MAC
Get Ethernet MAC address from network module
PING
Ping
SNTPTIME
Start time synchronisation
TCP_CLOS
Close TCP connection
TCP_HAND
Activate TCP handler
TCP_OPEN
Open TCP connection
TCP_RES
Reset TCP handler
TCP_SEND
Send a TCP datapacket
TCP_STAT
Status of TCP connection
TCP_STR
Send a string through TCP
TFTPFILE
Send / request a file
UDP_FW
Send a FW block to another IPC
UDP_HAND
Activate UDP handler
UDP_SEND
Send an UDP datapacket
UDP_STR
Send a string through UDP
All modules return an error code in FU32, see the table with all error codes for an explanation of the individual codes.
DNS_NAME
Get or set the hostname and domain name.
Input parameters
FU32 1 to set hostname
2 to get hostname
3 to set domain name
4 to get domain name
FU33 Number of the source string (set),
or destination string (get).
Output parameters
FU32 0 if successful, otherwise error
TCP/IP hosts normally have names in the format name.some.domain.com. In this case the
hostname is 'name' and the domain name is 'some.domain.com'. These names can be set
through BOOTP/DHCP or with this module. This function requires that the FST string driver
is installed in the project.
DNSRESOL
Resolve a hostname to IP address
Input parameters
FU32 1 to start hostname resolution
2 to get status
FU33 Number of the string with host-name to resolve
FU34 Index number in IP table
Output parameters
FU32 0 if successful, otherwise error
FU33 Resolver status
FST Version 4.02.21 Manual
232
233
PING
Send ping or get ping status
Input parameters
FU32 1 to send ping
2 to get status
FU33 IP address
FU34 IP address
FU35 IP address
FU36 IP address
Output parameters
FU32 0 if successful, otherwise error
FU33 Ping status
-1 = pinging
0 = host is alive
1 = timed out (no response after 5 seconds)
2 = not yet pinging
Sends a ping and wait for response. Use this to actively test if a host is alive.
SNTPTIME
Starts time synchronisation and get status
Input parameters
FU32 0 to get status
1 to start synchronisation
2 to start listen for broadcasts
FU33 Time offset to Greenwich Mean Time in hours
FU34 IP address
FU35 IP address
FU36 IP address
FU37 IP address
Output parameters
FU32 0 if successful, otherwise error
FU33 status
FU34 number of seconds since last synchronisation
-1 if not synchronised
The time synchronisation uses standard time codes (to allow worldwide synchronisation)
therefore the time difference with Greenwich Mean Time must be known. For some sample
values see the table at the end.
The status codes are:
-1 busy,
0 time synchronised,
1 timedout (no response from NTP server),
2 if listening active.
Timeserver programs are available from freeware to commercial packages and can be run on
standard windows PCs.
TCP_CLOS
Closes a TCP connection
Input parameters
FU32 Index number for handler
Output parameters
FU32 0 if successful, otherwise error
FST Version 4.02.21 Manual
234
TCP_HAND
Installs a handler to receive TCP datapackets
Input parameters
FU32 local port number to use
FU33 Number of first flagword to receive data
Output parameters
FU32 0 if successful, otherwise error
FU33 Index number for handler
Some additional data is written if a datapacket is received. See table below for layout. The
handler number returned in FU33 must be stored and used to send TCP datapackets.
TCP_OPEN
Actively opens a TCP connection
Input parameters
FU32 Index number for handler
FU33 Index number in IP table
FU34 Destination port number
Output parameters
FU32 0 if successful, otherwise error
TCP_RES
Resets closed TCP handler to listen state
Input parameters
FU32 Index number for handler
Output parameters
FU32 0 if successful, otherwise error
TCP_SEND
Send a TCP datapacket
Input parameters
FU32 Index number for handler
FU33 number of bytes to send
FU34 number of first flagword to send
Output parameters
FU32 0 if successful, otherwise error
TCP_STAT
Returns status of TCP connection
Input parameters
FU32 Index number for handler
Output parameters
FU32 0 if successful, otherwise error
FU33 1 if connected (send possible)
FU34 Extended state
FU35 Number of unacknowledged bytes in send buffer
Extended state values are:
0
LISTEN
1
SYNSENT
2
SYNRCVD
3
ESTABLISHED
4
5
6
7
8
9
10
11
FINWAIT1
FINWAIT2
CLOSEWAIT
CLOSING
LASTACK
TIMEWAIT
CLOSED
TCP_STR
Send a string through TCP
Input parameters
FU32 Index number for handler
FU33 Number of string to send
Output parameters
FU32 0 if successful, otherwise error
The FST STRING driver must be installed in the project.
TFTPFILE
Send or requests a file.
Input parameters
FU32 1 to send a file
2 to request a file
FU33 index number in IP table
FU34 number of the string with our file-name
FU35 number of the string with the remote filename
FU36 number of flagword for status
Output parameters
FU32 0 if successful, otherwise error
Uses the string driver for filenames. A waiting time of around 1 second must be inserted
between 2 transmissions with TFTPFILE.
Status values:
-1
Busy with file transfer.
0
File transfer successfully finished
1
Timeout error
2
Local file not found
3
Error reading from local file
4
Local file already exists (overwrite is not allowed, use
the FDELETE function module first)
5
Error writing to local file
127
Unexpected message received during file transfer
128
Received unknown error message
129
Received NOFILE error message
130
Received access error message
131
Received disk full error message
132
Received illegal operation error message
133
Received TID error message
134
Received file exists error message
135
Received NOUSER error message
136
Received option error message
236
UDP_FW
Send a block of flagwords to another IPC.
Input parameters
FU32 index number in IP table
FU33 number of flagwords to send (maximum 256)
FU34 number of first flagword to send
FU35 number of first flagword in target IPC
Output parameters
FU32 0 if successful, otherwise error
This function module just sends a block of flagwords, no retry is done if the target is unavailable and no indication is given if the target did not receive the flagwords. This module
has lost its use, use the module EASY_S instead.
UDP_HAND
Installs a handler to receive UDP datapackets
Input parameters
FU32 local port number to use
FU33 Number of first flagword to receive data
Output parameters
FU32 0 if successful, otherwise error
Some additional data is written if a datapacket is received. See table below for layout.
UDP_SEND
Send an UDP datapacket
Input parameters
FU32 local port number to use
FU33 index number in IP table
FU34 Destination port number
FU35 number of bytes to send
FU36 number of first flagword to send
Output parameters
FU32 0 if successful, otherwise error
UDP_STR
Send a string through UDP
Input parameters
FU32 Local port number to use
FU33 Index number in IP table
FU34 Destination port number
FU35 Number of string to send
Output parameters
FU32 0 if successful, otherwise error
The FST STRING driver must be installed in the project.
4.18.7.1
Modules for second network card
IP_IP2
Get/set IP address for 2 nd network card
IP_MASK2
Get/set IP netmask for 2 nd network card
IP_IP2
Set or get the IP address.
Input parameters
FU32 1 to set the IP address
2 to get the IP address
FST Version 4.02.21 Manual
237
FU33 IP address
FU34 IP address
FU35 IP address
FU36 IP address
Output parameters
FU32 0 if successful, otherwise error
FU33 IP address
FU34 IP address
FU35 IP address
FU36 IP address
IP_MASK2
Set or get the IP netmask.
Input parameters
FU32 1 to set the IP mask
2 to get the IP mask
FU33 IP mask
FU34 IP mask
FU35 IP mask
FU36 IP mask
Output parameters
FU32 0 if successful, otherwise error
FU33 IP mask
FU34 IP mask
FU35 IP mask
FU36 IP mask
4.18.8
EasyIP status values
Status values are:
-1
128
4.18.9
Data received by handlers
Handlers write data to flagwords if a packet is received. Also written is the IP address, port
number of the datapackets sender. The following table lists all data stored (FWx is the installed flagword):
FWx
Number of packets received by handler
FWx + 1
Sender IP address
FST Version 4.02.21 Manual
238
FWx + 2
Sender IP address
FWx + 3
Sender IP address
FWx + 4
Sender IP address
FWx + 5
Sender port number
FWx + 6
Number of databytes
FWx + 10
Start of actual datapacket
Note that the received size is the number of bytes, not the number of words.
4.18.10
Time offsets
Some values for the time offset:
Anchorage
-9
Buenos Aires
-3
London
0
Wetzlar
+1
Cairo
+2
Moscow
+3
Jakarta
+6
4.18.11
Error codes
If FU32 is <> 0 then the function module returned an error, following table lists the error
codes:
99 Invalid parameter
100 TCP/IP driver not loaded
101 Illegal IP address
102 Illegal table index (> 15)
103 Table position empty
104 Invalid port number
105 Invalid handler index (>15)
106 TCP send not possible, not connected
107 String driver not loaded
108 Illegal string number (too high)
109 Error in host- or domain name
110 Error modifying string
111 Invalid TCP handler
112 Unknown operand type
113 Datablock too large
114 Invalid value for status flagword
115 Table position already waiting for response
116 Invalid operand number to store response
117 Cannot send, cable disconnected, collision or other error
118 TFTP already sending or receiving
239
Help Topics
240
5.1
Navigating Using the Table of Contents
To view the table of contents, click the Contents tab in the navigation pane.
241
5.2
242
243
Example
Results
A single word
Select
Topics that contain the word "select." (You will also find its grammatical variations, such as "selector" and "selection").
A phrase
"new operator"
or
'new operator'
Wildcard expressions
Esc*
80?86
*86
Example
Results
raster OR vector
or
raster | vector<
244
245
Index
Source 22, 23, 24, 29, 30, 36, 38, 45, 66,
179, 180, 182, 219, 232
Start 13, 14, 20, 41, 42, 43, 75, 91, 95,
96, 97, 110, 142, 144, 195, 206, 208,
214, 215, 216, 217, 227
Start/stop input 41, 95
Startup batch 43
Startup file 110
Step 11, 12, 60, 69, 70, 71, 72, 73, 74,
75, 77, 94, 104, 167, 205, 214
Step number 95, 96, 98, 104
String module 177
Subroutine 35, 37
THEN 70, 71, 72, 73, 74, 75, 76, 77, 78,
90, 94, 155, 156, 157, 158, 159, 176,
196, 197, 198, 199, 203, 205, 214, 215,
216, 217, 229, 230
Timer 12, 59, 70, 73, 89, 90, 93, 105,
111, 195, 197, 199
TO 71, 72, 74, 75, 76, 159, 196, 197, 198,
199, 205, 214, 215, 216, 217
Undo 17, 18, 66
Version 1, 10, 11, 12, 13, 26, 32, 35, 38,
41, 95, 148, 175, 184, 219, 220, 224
247
Modules
Module name
7.1
Meaning
32 Bit Arithmetik
LADD
LCMP
LDIV
LMUL
LNEG
LSUB
SCRATTR
SCRCLEAR
SCRCUGPO
SCRCUSPO
SCRCUTYP
SRCDOKEY
SCREDIT
SCREKBD
SCRFILL
SCRFKEY
SCRFLAGS
SCRFLIP
SCRFRAME
SCRKBD
SCRMSG
SCRNEW
SCRPUTS
SCRUPDT
SCRWRITE
SCRW0808
SCRW0814
SCRXCHG
7.4
File Handling Modules
FCREATE
File create
FOPEN
File open
FCLOSE
File close
FCLOSALL
File close all
FDELETE
File delete
FSEEK
File seek
FSEEKX
File seek extended
FWRITE
File write
FST Version 4.02.21 Manual
248
Module name
FREAD
FWRITSTR
FREADSTR
7.5
F10
F11
F12
F13
Meaning
File read
File write string
File read string
7.6
FEC Remote E/A-Expansion
REMDIAG
The Remote FEC software package also includes software for
monitoring the status of the FEC Remote I/O devices from within
the user application program. If you want to include this capability
in your application, you need to import the REMDIAG Remote FEC
error counter into your FEC MASTER project.
7.7
F40
F41
F42
F43
F44
Function blocks
Configuration of a fieldbus participant
Read parameter field
Write parameter field
Reset all cyclical outputs on the fieldbus.
Status interrogation for a fieldbus participant
F47
F48
7.8
FBSLAVE
If you want to use the IPC to become a fieldbus slave, you must
enter and parameterise the FBSLAVE driver in the configurer.
7.9
Incremental Encoder for FEC and HC0X CPUs
ABRESET
To reset the counter value call the module ABRESET.
ABMODE
Pin I0.7/I1.0/I3.0 can be used to reset the counter. The counter
will be reset if I0.7/I1.0/I3.0 is active and a positive edge is detected on one of the A/B inputs. You can choose between 4
modes.
7.10 Profibus DP (CP62) Modules DP
DP_USIF
Get the current USIF status
DP_GETSL
Checks whether a diagnostic request is present
DP_GETDG
Obtains diagnostic information from a DP slave
DP_CONTR
Profibus function Global Control Request
7.11 Profibus FMS Drivers
FMSREAD
Read (polled response)
FMSWRIT
write (polled response)
PID Driver
PID Driver
PIDCFM
PID Regulator
FST Version 4.02.21 Manual
249
Module name
Meaning
7.14
Serial communication
OPENCOM
CLOSECOM
GETCOM
PUTCOM
PRINTCOM
READCOM
READLCOM
F30
F31
F32
F34
Interrogate status
F35
Change delimiter
BREAKCOM
SETRTS
IS485
7.15
Further modules
Blink
FIFO
LOADSYNC
STRAPPND
STRATOH
250
Module name
Meaning
STRATOI
STRATOIX
STRATOU
STRCAT
STRCHECK
Memory check
STRCHGET
STRCHSET
STRCI
Execute a CI command
STRCLR
Delete a string
STRCMP
STRCPY
STRDEL
STRDUMP
STRFILL
STRFILLW
STRFINDC
STRFINDS
STRGROW
STRHTOA
STRICMP
STRINIT
Initialisation or re-initialisation
STRINSRT
STRITOA
STRLEFT
Left substring
STRLEN
Length of a string
STRLOWER
STRMID
251
Module name
STRNCMP
Meaning
Compare the first characters of two strings,
differentiating between upper and lower case
STRNICMP
STRRIGHT
STRSTAT
STRUPPER
STRUSAGE
STRUTOA
7.18
EASY_R
EASY_S
IP_ALIVE
IP_IP
IP_MASK
IP_TABLE
DNS_NAME
DNSRESOL
IP_DNS
IP_GATE
IP_MAC
PING
SNTPTIME
TCP_CLOS
TCP_HAND
TCP_OPEN
TCP_RES
TCP_SEND
TCP_STAT
TCP_STR
TFTPFILE
UDP_FW
UDP_HAND
UDP_SEND
252
Module name
UDP_STR
Meaning
Send an UDP datapacket
253