Professional Documents
Culture Documents
Bernhard Plagemann
Beck IPC GmbH
http://www.beck-ipc.com/fst
mail to: fst@beck-ipc.com
You can also manually initiate the installation by starting SETUP.EXE in the \INSTALL subdi-
rectory.
This version uses an InstallShield setup, which will add appropriate entries in the Start
menu for you.
If you do not have the permission to install programs on your PC, this version can also be
installed from the self-extracting file FST40221.EXE in the \INSTALL subdirectory. It will try
to create a directory/folder C:\FST40221. You can change this during the installation to
whatever you like.
This FST 4 does NOT touch any of your system INI files (WIN.INI, SYSTEM.INI,...) It will NOT
replace any system library (xxx.DLL, xxx.VXD,...) and it will currently NOT touch the registry
in your box (except for the Uninstall information when using the InstallShield setup).
Also install the tools in the \TOOLS folder of the CD-ROM if required.
Some modules and drivers that have been part of former FST releases can be found in the
\OLDLIB folder of the CD-ROM. Use these drivers only if required for old projects. Please
regard the important information in the README files for the individual drivers.
1.2 Uninstalling
If you installed FST 4 using the InstallShield setup, the uninstall information is stored in the
Windows registry. FST 4 can be removed from your PC using the Windows Control Panel
(Software).
To get rid of any FST 4 version installed from a self-extracting zip file simply remove the
installation directory/folder, usually C:\FST40220, and all its subdirectories/folders.
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.7 ONLINE
If you have problems with the online connection you should set the baud rate to 2400. This
is often the case when Festo fieldbus is active or the CPU is busy with communication, e.g.
on other serial ports.
Avoid long steps in control programs that are executed frequently since this will shorten the
time slot for CI communication. Please note that calling CFMs may take a considerable
amount of time, especially if several CFMs are called in sequence in the same step, e.g.
AMXX. Calling CMPs is uncritical since a task switch (invisible step) is inserted after each call
automatically.
If you get error 36, check which function module you are calling in the step where the error
occurred. Rename this module as a CMP and change your programs accordingly.
The modules FWRITSTR and FREADSTR of the FST runtime library are using steps and can be
used as CMPs only.
• Mr. Westrik from Festo-NL has contributed the TCP/IP part of the FST 4 software. Af-
ter 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 "Ex-
tras >> FST Preferences >> Communication port".
It is recommended to rebuild the entire project by selecting menu item "Project >> Build
Project" or click the appropriate toolbar button.
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"
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 Win-
dows.
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.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.
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)
Save the program code in the currently active editor window (Ctrl+S)
Remove the currently selected data from the document and put it on the clipboard
(Ctrl+X)
Copy selected data onto the clipboard (Ctrl+C)
Indicator Description
CAP The Caps Lock key is latched down.
NUM The Num Lock key is latched down.
SCRL The Scrl Lock key is latched down.
INS Insertion mode is active. Use the Ins key to toggle.
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
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
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 docu-
ment 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 docu-
ment from this list to make its window active.
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.
The Tip of the Day dialog is also shown on each start-up of FST unless you disable the op-
tion "Show Tips on StartUp".
• Click the Next button to show another tip.
• Close the dialog box by clicking the Close button.
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.
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 Different set for each controller type
• project name and comment • imported (compiled) programs from the li-
• your source code for pro- brary
grams • the IO configuration
• the project documentation • the driver configuration
• the Allocation List • the controller settings
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 individ-
ual 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 im-
ported 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 lan-
guage 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.
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.
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.
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.
• 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.
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.
Note! This function is only available after preparing the project for download.
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.
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.
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.
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 pro-
grams.
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.
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 num-
ber <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.
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!
Note! Only one version of the same program can be selected for download.
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.
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.
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:
FEC Compact 0
FEC Standard 0
HC0X 0
HC1X 1
HC2X 1
Additional parameters:
This text will be appended to the kernel's command line. It is usually blank and meant for
future extensions.
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.
Each IO module occupies a certain range in the IO area of the processor. Many modules
support several ranges that usually can be selected by a rotary switch on the bottom side of
these units. To identify a module for the FST IO configuration select it from the list of sup-
ported modules and enter the chosen switch setting.
FST will check your configuration for valid switch positions and overlapping in the IO area of
the processor. It however will not suggest switch positions that are still available. The
documentation for the individual modules contains the necessary information about the
occupied IO area of the processor. For some modules there are more options than just the
selection of an IO range. Some of these options require modifications on the hardware (e.g.
jumpers) while others are programmable by software, i.e. the FST IO driver. All of these
options are usually reflected in the name of the IO driver. Make sure to always select the
appropriate driver for the module's configuration. More details are given in the extra docu-
mentation for the individual IO modules.
You are free to choose any FST input or output word you like for the individual modules.
How many input and/or output words a module occupies is listed in the special documenta-
tion for the modules. FST will check your configuration for overlapping in the FST operands.
If there is an input word required for output modules these ope rands are usually used for
status information. This is described in the module's documentation as well.
Please note that there is a separate IO configuration for each controller type. If you switch a
project from one controller type to another the IO configuration will be empty. If you switch
back however, you again will have the original IO configuration for that controller type. In
the IO configuration you can only insert IO modules that are available for the current
controller type setting of the project.
Note!
• There is no undo function available. All changes are immediately saved to disk.
• If an entry refers to a module type that is unknown to the FST library the missing file
name will be shown in brackets []. To select another type of IO module for the entry
open it for editing as for any other entry. A project with an IO configuration that con-
tains unknown IO modules cannot be downloaded to the controller.
The IO Module Entry dialog will be shown that allows you to enter the required settings.
Switch:
Enter here the switch setting for the IO module.
Each IO module occupies a certain range in the IO area of the processor. Many modules
support several ranges that usually can be selected by a rotary switch on the bottom side of
these units. For some IO drivers this switch setting might be used for other purposes.
IW:
Enter here the FST input word you would like to use to access the IO modules input data
from your programs. If the IO module supplies more than one input word consecutive input
words will be used. How many input words are used for each IO module can be read in the
extra documentation for the individual IO module.
OW:
Enter here the FST output word you would like to use to access the IO modules output data
from your programs. If the IO module supplies more than one output word consecutive
output words will be used. How many output words are used for each IO module can be
read in the extra documentation for the individual IO module.
Note!
• FST will check your configuration for overlapping both in the IO range of the proces-
sor and the FST operands.
• If there is an input word required for output modules only these operands are usu-
ally used for status information. This is described in the module's documentation.
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.
Note! There is no undo function available. All changes are immediately saved to disk.
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 sub-
sequent 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 auto-
matically inserted into the program text.
To test the connection to the controller select "Online >> Login" from the menu. A small
dialog box will be displayed that informs you about the progress of the login procedure and
will display the result and other useful information about the controller if the login is suc-
cessful.
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 pass-
word is stored in the controller, or "Change Password" if a password is stored in the control-
ler. 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.
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 Set-
tings.
Festo Fieldbus
The Festo Fieldbus tab shows the slaves found on the bus when selecting the tab the first
time. If the configuration in the master has changed select "Refresh Display" from the right
click popup menu to update the list.
To simply toggle a one-bit operand Select "Toggle" from the popup menu.
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.
Directory Listing
If you open the File Transfer window all files and directories of the current drive and working
directory of the controller is displayed. Subdirectories (folders) will be labelled with a folder
icon ; files are labelled with a sheet icon . The directory path is shown in the combo box
in the toolbar of the File Transfer window.
In the status line of the File Transfer window the sizes of the selected and the sum of all files
are shown as well as the free space of the drive. To display the date and size of each file,
press the Details radio button in the File Transfer window's toolbar. To switch back to the
FST Version 4.02.21 Manual 62
simple list of file names press the List radio button. To display the contents of a subdirec-
tory, 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.
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).
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.
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 auto-
matically opened. Of course you can also open an already existing program from the current
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.
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.
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.
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.
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
Note!
• The shortcut bar will be automatically hidden, if the active window is not a State-
ment 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 Instruc-
tion" menu.
Font:
The font name and size used for the Statement List editor windows are displayed in the
preview window using the actual font.
Default:
Click this button to use the Windows default font.
Browse:
Click this button to display the standard font selection dialog to make your selection.
Note!
• The options and the font are common for all Statement List editor windows.
• If you change the font it will be used for newly opened windows only. Re-open the
project to apply the new font for the already open editor windows as well.
STEP <Mark>
IF Switch1
AND I1.1
THEN SET O1.0
OTHRWSET 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.
STEP Mark2
THEN RESET F0.0
IF F1.5
THEN SET O0.7
SET F0.0
OTHRW SET O0.0
JMP TO Mark1
STEP Mark3
IF F0.0
AND I0.0
THEN SET O0.4
STEP Mark4
...
SET F0.0
RESET O1.0
LOAD V50
TO TW7
SET T7
CMP2
...
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.
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 pro-
gram.
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.
THEN introduces the executive part. This part is executed if the condition is true. The state-
ment may contain commands to modify outputs or flags etc., to carry out arithmetic opera-
tions, to activate timers or counters, or to call other programs or program modules.
Example:
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
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.
NOP means No operation. You can use this statement when you want to carry out an execu-
tive 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
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 destina-
tion 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 op-
eration.
Example:
THEN LOAD V100
TO R6
The value 100 is loaded into register 6.
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 equiva-
lent 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 accu-
mulator 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, left-
most 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 highest-
order bit.
A BID statement converts the contents of the multibit accumulator from binary to BCD rep-
resentation. 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 control-
ler 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 com-
plement method. In principle, the effect of using the CPL instruction is the same as multiply-
ing a number by -1 when applied to signed integers.
Example:
IF ( R32
< V0 )
THEN LOAD R32
CPL
TO R22
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:
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 pro-
grams 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 pro-
grams 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
Font:
The font name and size used for the Statement List editor windows are displayed in the
preview window using the actual font.
Default:
Click this button to use the Windows default font.
Browse:
Click this button to display the standard font selection dialog to make your selection.
Note!
• The options and the font are common for all Statement List editor windows.
• If you change the font it will be used for newly opened windows only. Re-open the
project to apply the new font for the already open editor windows as well.
• 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 dis-
played 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 click-
ing 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
Installing a new IO Script
To install a new IO script press the INS key or the Install... button. You will be asked for the
path name of the new script using the standard file dialog. Then the new script will be in-
stalled. It is now available for your projects.
Extracting IO Scripts
To extract the selected entry onto a floppy or somewhere else to be reinstalled later press
the Extract... button. You will be asked for the path name where to store the script file using
the standard file dialog. Then a copy of the IO script will be created at the given location.
The IO script will not be removed from the FST Library.
Remarks
• There is a different library for each of the different controller types.
• Changing the FST Library does affect the FST installation rather than a single project.
• If you are deinstalling IO scripts that are used by projects, these projects no longer
can be loaded into the controller with this FST installation unless the IO script will be
installed again.
• IO scripts always have the extension ".iod".
Extracting Drivers
To extract the selected entry onto a floppy or somewhere else to be reinstalled later press
the Extract... button. You will be asked for the path name where to store the driver files
using the standard file dialog. Then a copy of the driver and all required files will be created
at the given location. The driver will not be removed from the FST Library.
Remarks
• There is a different library for each of the different controller types.
• Changing the FST Library does affect the FST installation rather than a single project.
• If you are deinstalling drivers that are used by projects, these projects no longer can
be loaded into the controller with this FST installation unless the drivers will be in-
stalled again.
• FST driver scripts always have the extension ".dmk".
Note!
• The tools appear in the order in the list box as they are in the Extras menu.
• Only the first 25 tools will be added to the Extras menu.
Press the New button to add a new tool to the Extras menu or
Press the Properties button to edit the settings for the selected tool
The External Tool dialog will be opened to enter the required settings.
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
Wait for Completion:
If this option is enabled, when calling the tool, the FST main window will be minimised until
the execution of the tool has terminated. If you do not check this option, the tool will just be
called and FST and the tool run in parallel.
Reload project:
This option will only work if you also enabled the option "Wait for Completion". If the execu-
tion of the tool has been finished, the current project will be read in again to update any
changes the tool may have caused.
Macros
The following macros will be replaced in the program and parameter strings:
<<<FSTDIR>>>
where FST.EXE sleeps
<<<RUNTIMEDIR>>>
one of "runtime.," e.g. "Runtime.FEC"
replacement for obsolete <<<DRIVERDIR>>> and <<<FBLIBDIR>>>
<<<ALLPROJECTS>>>
path to directory with project directories
<<<CURRENTPROJECT>>>
path to current project, == <<<ALLPROJECTS>>>\<<<PROJECT_CUR>>>
<<<TARGET>>>
new entry, "HC1X," "FEC," "HC2X," "HC0X"
<<<LANGUAGE>>>
new entry, "GB", "D"
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: IWw
Operations: 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.
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
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)
Example:
IF I0.1
AND N T1
THEN SET T1
WITH 10S
IF T1
THEN SET O0.1
OTHRWRESET 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: Load, compare
Vnnnn Multibit
Function units FU32 to FU38 are available for each program because they are used for pass-
ing parameters to modules. Only the program’s own FUs can be accessed from within the
programs, the syntax is therefore simply FUw. The FUs of all programs can be addressed in
3.1.9 Programs
Operations: Interrogate, set, reset
P0 to P63 One-bit
The program and program status operands provide information about the status of a pro-
gram:
P PS Status
0 0 Inactive
0 1 No meaning
1 0 Active but suspended
1 1 Active and being processed
A program with the number x can be started and stopped via the operand Px. After having
been started with the command SET Px, Px=1 and PSx=1. When it is stopped with the com-
mand RESET Px, Px=0 and PSx=0. The active program Px can be suspended with RESET PSx.
3.1.11 Errors
Operations: Interrogate, reset
E One-bit
EW Multibit
HCXX Part of the zero-power RAM is used for retentive storage of operands.
As a result, nearly all operands can be made retentive:
FW
R
FST Version 4.02.21 Manual 91
TV
C, CP, CW
FU
Password
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
STEP Call
IF I0.1
THEN SET 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 (in-
cluded 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.
= <type>,0,<status>,<step_number>
<type>: STL=0; LDR, FUP=1; C=2
A falling edge (switching from run to stop) will cause all programs to be inactivated (reset-
ted) 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.
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
The error word and other information can be interrogated as operand E or EW or with func-
tion 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 (acknowl-
edged) to allow the detection of a new error.
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 pro-
grams. 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 exclu-
sively executed, the error is deleted without any other action being taken. The error will not
be inactivated automatically, however.
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 infor-
mation 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).
F22
Set error handling
Input parameters FU32 =0 Read out the error stack
=1 Read out the error stack and delete
the error
=2 Error restart, read out the error stack
and delete the error
=3 Non-recoverable error, abort program
execution
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
3.3.5 Overview of error numbers
The FST controller errors are numbered and normally appear with very brief additional
information and sometimes without explanatory text. The following contains an overview of
the error messages of the FST PLC operating system.
The error status can be displayed with the CI command "DF". The response consists of 3
numeric values. The first is the error number, the other two give additional information on
the situation in which the error occurred. Normally the second value is the program number
and the third value is the step number. If the program number is 255, the error does not
result from a program but from an external cause. A typical cause of this type of error is an
I/O module fault. Here, as in other cases, the third value contains a value giving additional
information on the error cause. In the case of I/O module errors, this value gives the input or
output word number in which the error occurred. The module can then be more easily identi-
fied via the I/O configuration. In the case of driver errors, the third value contains a numeric
value indicating the number of the driver. For test purposes, the "MF" command of the CI
can be used to generate an error. This method allows a project’s error handling to be tested.
Note! Drivers and modules can trigger other errors that are not listed here. These are then
described in the appropriate driver documentation.
The CI, which is part of the of the FST PLC operating system, can be operated as a terminal
or terminal emulator via the controller’s serial interface (usually COM or COM1). As an op-
tion 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:
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).
>DF=0,0,0
>
The DF command interrogates the controller’s error status. If no error is present, the control-
ler 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 acous-
tic signal sounds from the speaker.
The CI reports to the connected terminal after either DC4 (Control-T) has been entered or a
hardware BREAK has been transmitted. Any command being processed is interrupted. The
controller responds with "FESTO IPC V2.nn" and the normal prompt ">" in the following line.
Please note that a hardware BREAK will not be detected by FEC and HC0X controllers!
Sending a hardware BREAK also sets the transmission speed on the controller side to a
standa rd rate of 9600 or 2400 Baud, depending on one of the following methods:
• 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 boot-
ing method 1 will be selected. After loading a project using Field PC Net method 4 will auto-
matically 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 differ-
ent 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
If the option "Reset Programs" of the Controller Settings is selected program P0 is started
or continued. If the flag is not set all stopped (breaked) programs are also continued.
The command "RB" calls a loaded program module (one that is included in the project).
Note!
The command uses the context of program P63, which should be kept reserved for this
purpose. The required parameters must be passed with the call. A parameter may be omit-
ted. In this case, the previous value is used.
It returns =<FU32>,<FU33>,<FU34>,<FU35>,<FU36>,<FU37>,<FU38>.
Example:
RB7,14,,9=4712,103,0,0,0,0,0
Call CMP 7 with FU32=14, FU33=Old value, FU34=9, Results FU32=4712, FU33=103, FU34
to 38=0
The command "RF" calls a loaded function module (one that is included in the project).
Note!
The command uses the context of program P63, which should be kept reserved for this
purpose. The required parameters must be passed with the call. A parameter may be omit-
ted. In this case, the previous value is used.
It returns =<FU32>,<FU33>,<FU34>,<FU35>,<FU36>,<FU37>,<FU38>.
>!<DN><command>
>
A driver does not have to support own commands, however. Many drivers respond to an
empty command with status information. Generally, driver commands have a similar struc-
ture to standard commands. For example, the string driver with the driver number 3 has
display commands for strings in which the appropriate string number is used.
Example:
>!3D12=‘FESTO
Note!
There are different real time clocks available on the different controller types.
HC1X There can be two different real time clocks in the system:
1. the I2C bus RTC
2. the SRAM RTC
The I2C bus real-time clock is not on the CPU modules, but depending on the busboard
either on the busboard or in the DC/DC voltage conversion module.
Systems based on a 3-slot busboard have no I2C bus real-time clock. A Goldcap capacitor
supplies the real-time clock with voltage for 3 to 5 days only.
The SRAM RTC is inside the CPU module and battery buffered. It lasts for about 10 years. A
CPU module is equipped with a SRAM RTC if it has a ZL16 or ZL17 SRAM inside. If a SRAM
RTC is found in the system it will be preferred to the I2C bus RTC.
HC2X This CPU is equipped with a SRAM RTC. The SRAM RTC is inside the CPU
module and battery buffered. It lasts for about 10 years.
Example:
>RF10,8,30,0,0
>
If you have imported the module F10 as CFM10, this commands sets the real-time clock and
the system clock to 08:30.
3.5.2 Function modules for setting and reading the real-time clock
Overview
F10 Set time
F11 Set date
F12 Get time
F13 Get date
F10
Set time
Input parameters FU32 Hour (0 to 23)
FU33 Minute (0 to 59)
FU34 Second (0 to 59)
FU35 1/100 Seconds (0 to 99)
Output parameters None
F11
Set date
Input parameters FU32 Year (1980 to 2099)
FU33 Month (1 to 12)
FU34 Day (1 to 31)
Output parameters None
F12
Get time
Input parameters None
Output parameters FU32 Hour (0 to 23)
FU33 Minute (0 to 59)
FU34 Second (0 to 59)
FU35 1/100 Seconds (0 to 99)
F13
Get date
Input parameters None
Output parameters FU32 Year (1980 to 2099)
FU33 Month (1 to 12)
FU34 Day (1 to 31)
FU35 Day of week (0=Sunday, 6=Saturday)
FEC Compact 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 On drive B: are 120 KB (HC02 H02 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.
Note! For each STL instruction approx. 10 bytes of code are generated.
Note!
• Further modules are described in the sections above.
• Most driver packages also include modules. These are described in the appropriate
driver documentation.
Overview
BLINK General blink bits
FIFO First-in-first-out memory
LOADSYNC Synchronisation of project (re)loading
BLINK
General blink bits
Input parameters None
Output parameters FU32 4 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.
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.
4.1.2.1 IMXX
IM10
2x8 opto-isolated digital inputs
Inputs: 16
Outputs:
Input words: 1
Output words:
Switch positions: 1 to 9
Sum of inputs: 144
Sum of outputs:
Special features:
Module identification:
Module check:
Status information
(additional input words):
IM12
4x8 opto-isolated digital inputs with PLC security and control LEDs for external 24V supply
Inputs: 32
Outputs:
Input words: 2
Output words:
Switch positions: 1 to F
Sum of inputs: 480
Sum of outputs:
Special features:
Module identification: No
Module check: No
Status information -
(additional input words):
4.1.2.2 OMXX
OM10
2x8 opto-isolated digital outputs
Inputs:
Outputs: 16
Input words:
Output words: 1
Switch positions: 1 to 9
Sum of inputs:
Sum of outputs: 144
Special features:
Module identification:
Module check:
Status information
(additional input words):
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): 1
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):
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):
OM22
2x8 opto-isolated digital outputs, 2x8 opto-isolated digital inputs with control LEDs for
external 24V supply and overload
Inputs: 16
Outputs: 16
Input words: 1
Output words: 1
Switch positions: 1 to F
Sum of inputs 240
Sum of outputs 240
Special features
Module identification: No
Module check: No
Status information -
(additional input words):
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):
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: Reed relay, break contacts
Module identification:
Module check:
Status information
(additional input words):
OM75
16 relay outputs (break contacts) with indicator LEDs max. switching current per relay con-
tact 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):
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):
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
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):
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):
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):
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:
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:
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:
IO40 0V to 5V
4 analog inputs, 0V to 5V, 12 bit
Input words (channels): 4
Output words (channels):
Switch positions: 1 to 6
Sum of inputs: 24
Sum of outputs:
Range: 0V to +5V
Resolution: 12-bit
Special features:
Module identification: Yes
Module check:
IO41 0V to 10V
4 analog inputs, 0V to 10V, 16 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: 16 bit
Special features:
Module identification: Yes
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
4.1.3.4 IO7X
IO70/IO71 0V to 10V
2 analog outputs, 0V to 10V, 12 bit
Input words (channels):
Output words (channels): 2
Switch positions: 0 to 4
Sum of inputs:
Sum of outputs: 10
Range: 0V to 10V
Resolution: 12 bit
Special features:
Module identification:
Module check:
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:
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
Error 11 will be generated if no supply voltage is present on the outputs or an overload
occurs on an output. The reason will be made available through the FST input word you
specified when including the IO module.
BIT 0 = A0 overload
BIT 1 = A1 overload
BIT 2 = nc
BIT 3 = nc
BIT 4 = A0 no 24V
BIT 5 = A1 no 24V
Note!
The input word reflects the actual status, to be sure that the reason is available later you
should write an error program.
4.2.1.3 HC0X
The 8 IOs of HC0X can be used as inputs or outputs.
Enter the module HC0X into the IO configuration. You do not have to enter a switch position
here. Enter the number of the FST input and output words that are to be used for the local
IOs (e.g. both 0). This will allocate one input and two output words.
The 8 IO bits are represented as the 8 least significant bits of input and output word given
(e.g. I0.0 to I0.7, O0.0 to O0.7). The 8 least significant bits of the second output word (e.g.
OW1) is used to define which pins are used as input or output: if a bit is set this means that
the corresponding pin is an output, otherwise it is an input.
4.2.2 IO extension
HC0x and FEC Compact can be connected to an (additional) FEC via the EXT interface and a
special (short!) cable.
Note! For the FEC Standard series the IO extension is not available.
If you want to have more than one extension module, use the IO extension driver, which is
described in a separate chapter.
To access the remote IO from your programs you have to enter the module Remote FEC
(HC0X) or FEC Slave (FEC Compact) into the IO configuration. You have to give the number of
the FST input and output words (e.g. 2 for both).
FST Version 4.02.21 Manual 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.
0 1
1 1
2 5
3 8
4 12
5 16
6 21
7 26
8 32
9 36
10 41
11 46
12 50
13 54
14 59
15 63
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.
This encoder is interrupt driven and once activated, operates independently of the user’s
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
Target drive:
Enter the drive that contains the AS-Interface driver ASIDRV.EXE or to which it is to be
loaded.
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 re-
booted. This will be done automatically.
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 com-
parison 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 refer-
ence 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 run-
time program must be active.
Figure 3: Result of the nominal-actual comparison
4.3.2 CI commands
!7DLES Display list of current slaves
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 com-
mands are not intended for manual entry. They are only documented here for the sake of
completeness.
The cyclical part of the driver monitors the Config OK flags of all configured masters. If
"hard" error reaction is set, the failure of a slave results in error number 710 + master a d-
dress (1 – 4) being entered into the IPC error word. Program execution is stopped. If an error
handling routine has been entered into the IPC configuration, this is now started. If this
behaviour is not desired, hard error reaction can be switched off with the AS-I_Mode module
(see below).
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.
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.
Destination Drive:
Enter here the target drive for the Festo fieldbus driver IPCFB22.EXE.
Interrupt number:
Enter the number of the interrupt that the fieldbus module is allowed to use for communica-
tion with the CPU. Check which interrupts have already been assigned for other modules.
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.
Enter the participant’s number and type that you want to insert. The permissible entries are
explained in the table below:
PA Participant 1 to 99
number
Modify:
Highlight the participant that you want to modify, and activate the Modify function by dou-
bleclicking or selecting Modify from the local menu. As in the case of Insert, a window ap-
pears similar to that in Figure 2. The entries can then be overwritten.
Delete:
You can delete a filedbus participant by selecting delete from the local menu.
Test functions
In order to ensure proper operation on the filedbus, on the one hand various tests are car-
ried out by the IPC run-time system while on the other hand the fieldbus configurer also
offers a test option.
FST Version 4.02.21 Manual 151
When a project is started, the run- time system detects the actual configuration and com-
pares 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.
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.
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:
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 par-
ticipant.
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
FU34 Address of participant word, 0 to 255
FU35 Participant word for address
FU36 Participant word for address + 1
FU37 Participant word for address + 2
FU38 Participant word for address + 3
Output parameters
FU32 = -1 Command successfully processed
=0 Error, fieldbus participant not responding
FU33 Participant status
For a description of the participant status see F44.
F43
Reset all cyclical outputs.
Input parameters None
Output parameters None
F44
Status interrogation for a participant.
Input parameters
FU32 <> 0 Number of the participant
=0 Reset all error entries
Output parameters
FU32 Status of the participant
FU33 number of short-term errors
FU34 number of long-term errors
FU35 total error count
FU36 Participant address for last error
F47
Status interrogation for a participant (FU32=1). Set exception handling programs (FU32=1).
Input parameters
FU32 = 1 Exception handling program assignment
FU33 Bit0 = 1 FU34 has the program number
Bit1 = 1 FU35 has the program number
Example:
THEN CFM47
WITH V1
WITH V3
WITH V3
WITH V17
WITH V0
In the event of a transmission error (such as cable break), Program 3 is set. If a participant
error occurs (such as short-circuit at participant output), Program 17 is started. If a response
to an a-cyclic command arrives (such as the participant is holding an ASCII file ready), no
program is started.
The activated programs are executed in the normal sequence (that is, by increasing program
number). Following completion of handling, they should deactivate themselves in order to
allow themselves to be called again.
Input parameters
FU32 = 2 Status interrogation
Output parameters
FU32 Always 0
FU33 Status of the participant
FU34 Value of short-term error
FU35 Value of long-term error
FU36 Total number of errors
FU37 fieldbus address of the participant with last error
F48
Register actual configuration and status or use nominal configuration.
Input parameters
FU32 = 1 Configuration acquisition
=2 Status interrogation after configuration acquisition
=3 use nominal configuration
Output parameters if FU32 = 1
FU32 = -1 Configuration acquisition running
Output parameter if FU32 = 2:
FU32 = 1 Configuration acquisition running
=2 Actual configuration = nominal configuration
=3 Actual configuration <> nominal configuration
=4 No configuration available
Output parameters if FU32 = 3 None
All fieldbus outputs are deleted prior to configuration acquisition. fieldbus inputs are not
updated for a period of up to several seconds.
The use of the function with FU=2 does not make sense. When a participant list is given (see
Section 1.2) actual and nominal data of this option match by definition.
STEP 2
THEN CFM 48
WITH K2 "Status interrogation
IF FU32
<> K1
THEN NOP
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
Destination Drive:
Enter here the target drive for the Festo CP61 firmware FBSLAVE.BIN.
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 slave’s 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
PA Type IW OW
1 FB-IPC (byte) 24 24
Example:
IF NOP
THEN CMP 0 'FBSLAVE
WITH V1 " Initialise
WITH V4 " Switch setting CP61
FST Version 4.02.21 Manual 157
WITH V3 " Baud rate (3=375 Kbit/s)
WITH V1 " Participant number ( slave address )
WITH V8 " Inputs
WITH V12 " Outputs
WITH V2 " Byte oriented
Example:
IF NOP
THEN CMP 0 'FBSLAVE
WITH V2 " Cyclic update
WITH V10 " 1st flag word for outputs
WITH V20 " 1st flag word for inputs
IF NOP
THEN CFM 62 " fieldbus slave module
WITH V2 " Cyclic update info
WITH V9000 " fieldbus outputs start at FW9000
WITH V9100 " fieldbus inputs start at FW9100
IF NOP
THEN LOAD FW9100 " fieldbus input byte 0
TO OW1 " LEDs on AS14
IF NOP
THEN JMP TO loop
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.
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).
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
Will give back max. 4 Words of diagnostic information for every call.
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.
Destination drive:
Specify the drive on which the Profibus FMS driver PROFIFMS.EXE is located or onto which it
is to be loaded.
FMSREAD
Read (polled response)
Input parameters FU32 Communication reference (CR=1 to 32)
FU33 Object index (20 to 65535)
FU34 Object subindex (0 to 241)
FU35 Number of the flag word for status variable
FU36 Low byte, identification of the operand type for data
0 = Input word
1 = Output word
2 = Flag word
3 = Register
High byte, identification of the Profibus data type
1 = Boolean
2 = Integer8
3 = Integer16
4 = Integer32
5 = Unsigned8
6 = Unsigned16
7 = Unsigned32
8 = Floating point
9 = Visible-string
10 = Octet-string
11 = Date
12 = Time-of-day
13 = Time-difference
14 = Bit-string
FU37 Number of the (first) operand word for data
FU38 Expected length in bytes
Output parameters FU32 Error number
= 0 Successfully processed
> 0 Error (see table)
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.
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! Don’t forget that the FEC master also must be entered into the I/O configuration!
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 pro-
duce lost clusters or even worse.
Remember, MS-DOS updates the file allocation table not steadily. The method used by MS-
DOS 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 alloca-
tion 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 re-
sults 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 posi-
tion. 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 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
FREAD File read
FWRITSTR File write string
FREADSTR File read string
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.
Input parameters:
FU32 File handle for the MS-DOS file as obtained from file open or file create func-
tions
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.
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.
Output parameters:
FU32 = 0 OK, function has been started,
= >0 error number after failure. Function is not started.
Output parameters:
FU32 = 0 OK, function has been started,
= >0 error number after failure. Function is not started.
The status is
FW[FU33] = -1 while function is busy,
= 0 when completed successfully,
= >0 error number after failure.
FU36 Number of flag word FW for the number of bytes that actually have been
read.
Output parameters:
FU32 = 0 OK, function has been started,
= >0 error number after failure. Function is not started.
4.10 Strings
Version 1.01
The FST string driver makes a new additional data type available: the STRING
data type. The default setting provides support for 256 strings. Individual
strings are addressed by way of the string number. Strings may contain any
characters with the exception of the NULL character (hexadecimal $00). Strings
can be as long as necessary within the scope of the set memory requirement. The
strings are not retentive.
XX = Number of strings
YY = Reserved memory capacity
ZZ = OK, if string memory is OK, or
= BAD, if string memory is defective
In these commands, "!3" is the prefix for a CI call in a driver; in this case it
is in driver 3 for strings.
THEN . . .
CMP 73 " delete with STRCLR
WITH V5 " from string 5
In order to copy string 6 into string 12, the STRCPY module must be invoked. The
STRCPY module may have been imported as CMP 74, for example. In STL the program
lines appear as follows:
THEN . . .
CMP 74 " copy with STRCPY
WITH R0 " from string with number in R0
WITH V12 " to string 12
Most string modules return a result for error detection.
Overview of modules:
FST Version 4.02.21 Manual 176
STRADDR Determine internal address of a string
STRAPPND Append a character at the end of a string
STRATOH Convert a hexadecimal string into a word
STRATOI Convert a string into a signed word
STRATOIX Convert a string into a signed word
STRATOU Convert a string into an unsigned word
STRCAT Combine two strings in a third string
STRCHECK Memory check
STRCHGET Extract a character from a string
STRCHSET Replace a character in a string
STRCI Execute a CI command
STRCLR Delete a string
STRCMP Compare two strings character by character,
differentiating between upper and lower case
STRCPY Copy string
STRDEL Delete part of a string
STRDUMP Display a number of strings
STRFILL Create a string with a specified number of identical characters
STRFILLW Fill a string with another string, right- or left-justified
STRFINDC Find a character in a string
STRFINDS Find a substring in a string
STRGROW Enlarge the string memory for an individual string
STRHTOA Convert a word into a hexadecimal string
STRICMP Compare two strings character by character,
not differentiating between upper and lower case
STRINIT Initialisation or re-initialisation
STRINSRT Insert a string into another string
STRITOA Convert a signed word into a string
STRLEFT Left substring
STRLEN Length of a string
STRLOWER Convert a string to lower case
STRMID Middle substring
STRNCMP Compare the first characters of two strings,
differentiating between upper and lower case
STRNICMP Compare the first characters of two strings,
not differentiating between upper and lower case
STRRIGHT Right substring
STRSTAT Status of string driver
STRUPPER Convert a string to upper case
STRUSAGE Used and free memory
STRUTOA Convert an unsigned word into a string
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
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
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 FU32 Number of the string with the CI command
FU33 Number of the string for the result of the command
Return parameters FU32 0 if successful, otherwise error
The string resulting from the command must not be more than 80 characters long.
The result of the CI command is not interpreted.
STRCLR
Delete a string.
Input parameters FU32 Number of the string
Return parameters FU32 0 if successful, otherwise error
This is the same as clearing a string or reducing its length to 0.
STRCMP
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
STRCPY
Copy one string into another string.
STRDEL
Delete part of a string.
Input parameters FU32 Number of the string
FU33 Index for first character to be deleted,
1 for first character
FU34 Number of characters
Return parameters FU32 0 if successful, otherwise error
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 FU32 Number of the string
FU33 Character to be found
Return parameters FU32 0 if successful, otherwise error
FU33 >0 position, 1 for first character
0 if character not found
STRFINDS
Find a substring in a string.
Input parameters FU32 Number of the string in which to search
FU33 Number of the substring to be found
Return parameters FU32 0 if successful, otherwise error
FU33 >0 position, 1 for first character
0 if substring not found
STRGROW
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
STRLEN
Length of a string.
Input parameters FU32 Number of the string
Return parameters FU32 0 if successful, otherwise error
FU33 Length
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
STRRIGHT
Transfer a right substring of a specified length to a string.
Input parameters FU32 Number of the source string
FU33 Number of characters
FU34 Number of the destination string
Return parameters FU32 0 if successful, otherwise error
If the source string is too short, the destination string is shortened
accordingly.
STRSTAT
Query the status of the string driver.
Input parameters None
Return parameters FU32 The set memory size for strings
FU33 Maximum number of strings
FU34 Memory used by strings
FU35 Free memory remaining
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 Number of the string
FU33 Maximum number of characters to be copied
FU34 Number of the flag word
Return parameters FU32 0 if successful, otherwise error
FU33 Number of characters actually copied
FLAG2STR
Copy a flag word area into a string.
4.11.1 Introduction
The user interface is based on the familiar FST software. It has very much the same look-
and-feel as this does. It has a blue frame with a title for the work area, a message line and
eight function keys. The method of operating this user interface is similar to that of operat-
ing the FST.
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 maxi-
mum 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 com-
mand 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
Keyboard Function
TAB Move to the next input field
ENTER
Down
Arrow
BS In overtype mode: one character to the left; in insert mode: delete the char-
acter to the left of the cursor
Alt-F10 Switch to the screen of the main runtime program (can be deactivated)
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
The D command switches to a specifiable page.
Switching by a program:
The SCRFLIP module switches between the current page of the user interface and the run-
time main program.
The SCRXCHG module switches between the pages of the user interface.
To switch to the screen of the main runtime program from the screen page itself:
Enter ALT-F10 on the keyboard (this function can be deactivated).
Note! The string driver is a prerequisite and is always used for handling strings.
4.11.3.1 Attributes
The FST software makes use of several standardised colour attributes for representing parts
of the screen. These standard attributes are accessible via a numbering system.
Number Attribute
0 Normal screen attribute
1 Highlighting screen attribute
2 Attribute of the frame
3 Attribute of edited fields
4 Attribute of function keys
5 Attribute of the message line
6 Attribute of the message line in the event of errors
In some cases the attribute can be freely chosen. It consists of one word (16 bits); its higher-
order byte contains the attribute and its lower-order byte must be equal to zero.
B V Meaning
i a
t l
u
e
3 0 No automatic activation
1 Automatic activation (== ACTIVATE)
Initialisation statements
ACTIVATE
Display on the screen is activated immediately after the project is loaded.
FEATURE_FLAGS <value>
The feature flags are set to the value that is passed here. As the feature flags also contain
the ACTIVATE flag, it is necessary either to leave out ACTIVATE or to place it after
FEATURE_FLAGS. The meanings of the individual bits of the feature flags are explained
above.
MESSAGE <string>
MESSAGE_ERROR <string>
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 ex-
traordinarily important basic foodstuff for mankind.
; default settings
FEATURE_FLAGS 1
ACTIVATE
; 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.
Overview of modules
SCRATTR Calculate screen attribute
SCRCLEAR Clear screen
SCRCUGPO Determine current position of cursor
SCRCUSPO Set current position of cursor
SCRCUTYP Set cursor type
SRCDOKEY Execution of a keyboard input
SCREDIT Add an input field
SCREKBD Clear keyboard buffer
SCRFILL Fill an area with space characters
SCRFKEY Specify the label of a function key
SCRFLAGS Set feature flags
SCRFLIP Toggle between screen page a nd FST CI
SCRFRAME Draw a frame
SCRKBD Interrogate the last input on the keyboard
SCRMSG Display a string in the message line
SCRNEW Draw a new, blank screen
SCRPUTS Write a string at a set position on the screen
SCRUPDT Refresh screen contents
SCRWRITE Write a string at a set position on the screen
SCRW0808 8x8 block characters
SCRW0814 8x14 block characters
SCRXCHG Switch between screen pages
The SCRCLEAR and SCRPUTS modules should not be used unless absolutely necessary
because they circumvent the check for an activated screen page.
SCRATTR
Calculate screen attribute
Input parameters FU32 Foreground colour
FU33 Background colour
FST Version 4.02.21 Manual 190
FU34 Flashing option if not equal to 0
Output parameters FU32 Attribute
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 FU32 X position
FU33 Y position
FU34 Width
FU35 = 0, standard input field
= 1, input field for password (string not visible)
FU36 String number
Output parameters FU32 = 0 if display appears
SCREKBD
Clear keyboard buffer
Input parameters None
Output parameters None
SCRFILL
Fill an area with space characters.
Input parameters FU32 X starting position, column, 0 to 79
FU33 Y starting position, line, 0 to 24
FU34 Width, >= 1
FU35 Height, >= 1
FU36 Attribute
Output parameters FU32 = 0 if display appears
= -1 if position is not admissible or
the user interface is not activated
SCRFKEY
Specify the label of a function key.
Input parameters FU32 Number of the function key, 1 to 8
FU33 Number of the string for the upper half of the
function key
FU34 Number of the string for the lower half of the function
key
Output parameters FU32 = 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 charac-
ters.
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
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
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
SCRXCHG
Switch between the predefined screen pages in the driver.
Input parameters FU32 Number of the screen page,
indexing from 0
Output parameters None
The predefined screen pages are transferred from the project on startup of the runtime main
program. This module does not switch (flip) between the screen page of the user interface
and the screen of the runtime main program.
; default settings
FEATURE_FLAGS 1
ACTIVATE
; screen 0
SCREEN_INITIAL "[ Chewing Gum Production ]"
TEXT 20 7 0 "The Most Important Food in the World"
TEXT 30 10 40704 " CHEWING GUM "
TEXT 22 15 0 "Chewing Gum Production is Ready."
FUNCTION_KEY 1 "START" ""
; screen 1
SCREEN "[ Chewing Gum Production ]"
TEXT 15 10 0 "How many?"
INPUT_STRING 30 10 5 1
FUNCTION_KEY 1 "START" ""
; screen 2
SCREEN "[ Chewing Gum Production ]"
FST Version 4.02.21 Manual 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 con-
cerned, 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.
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. func-
tion module F4).
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.
Overview
LADD Addition of 32-bit values.
LCMP Comparison of 32-bit values.
LDIV Division of 32-bit values.
LMUL Multiplication of 32-bit values.
LNEG Change of sign for a 32-bit value.
LSUB Subtraction of 32-bit values.
LADD
Addition of 32-bit values.
Input parameters FU32 Low word of the 1st operand
FU33 High word of the 1st operand
FST Version 4.02.21 Manual 199
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
LCMP
Comparison of 32-bit values.
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 Result in bit form
$xx01 1st operand < 2nd operand (signed)
$xx02 1st operand == 2nd operand (signed)
$xx04 1st operand > 2nd operand (signed)
$01xx 1st operand < 2nd operand (unsigned)
$02xx 1st operand == 2nd operand (unsigned)
$04xx 1st operand > 2nd operand (unsigned)
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 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
LNEG
Change of sign for a 32-bit value.
Input parameters FU32 Low word of the operand
FU33 High word of the operand
Output parameters FU32 Low word of the result
FU33 High word of the result
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
Overview
Function (passed in FE33)
-1 Init/Reset counters
0 Read counter registers (values)
1 Load counter 1 with new value
2 Load counter 2 with new value
3 Load counter 3 with new value
4.13.1 Init/Reset
Input parameters FU32 KSW setting (1 or 2)
FU33 -1
FU34 Operating mode (see table below)
Output parameters FU32 Current status of counter 1
FU33 Current status of counter 2
FU34 Current status of counter 3
The numbers 1, 2 and 4 in the following table refer to 1-, 2- or 4-edge counting on the given
channel. If only a single number is specified for two channels this means that they are cas-
caded.
Please consult the IM20/IM21 data sheets for more details and operating modes. It is,
however, not possible to use the IRQ possibilities of the IM2x hardware with this software
module.
Parameter 5 serves to further define the action(s) specified in parameter 4. This parameter
must be specified in hexadecimal format whereby the high byte indicates the program
number (to start) and the low byte indicates the output word to be modified. If parameter 4
<> V3, then either or both unused bytes are simply ignored.
Examples:
V$0600 specifies output word (OW) 0 and program 6.
V$0901 specifies output word (OW) 1 and program 9.
Parameter 6 only has meaning if Parameter 5 was assigned a value of 1 or 3, indicating that
a defined output word (OW) is to be modified when the defined Fast Counter reaches the
preselect value.
This parameter must be specified in hexadecimal format whereby the high byte indicates the
output "mask" to apply while the low byte, which bits within the specified output word
(OW) are to be Set or Reset. By separating these values, the user can separately specify
which bits are enabled or disabled from modification.
Example:
IF ... " User defined conditions
THEN SET CMPx " Call Fast Counter module
WITH V3 " Specify Status function
WITH Vy " Specify which Fast Counter to check
" Now check results...
IF (FU32 = V0) " Then counter is still active
THEN ... " User defined actions
LOAD FU33 " Get current counter value and
TO R21 " Save it in Register 21
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.
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
1 0= Linear ramp
1= no ramp (move with starting frequency without ramp)
3 0= Reset is finished
1= Reset is active
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)
Table 6: Polarity
Bit Description
5 0= Interpolation inactive
1= Interpolation active
0 0= Enable is off
1= Enable is on
1 1= Motor is stopped
1= Motor is moving
STEP init
"" Start with configuration
IF NOP
THEN LOAD V1
TO R0 'Motor Number
IF NOP
THEN CFM 51 " AMxx module
WITH V20 " Reset
WITH R0 'Motor Number
STEP loop
IF NOP
THEN CFM 51 " AMxx module
WITH V0 " Get status
WITH R0 'Motor Number
LOAD FU34
TO FW34 'FU34=extended status
STEP
IF NOP
THEN CFM 51 " AMxx module
WITH V0 " Get status
WITH R0 'Motor Number
LOAD FU34
TO FW34 'FU34=extended status
STEP
IF NOP
THEN CFM 51 " AMxx module
WITH V0 " Get status
WITH R0 'Motor Number
LOAD FU34
TO FW34 'FU34=extended status
STEP wait
IF NOP
THEN CFM 51 " AMxx module
WITH V0 " Get status
WITH R0 'Motor Number
LOAD FU34
TO FW34 'FU34=extended status
STEP init
FST Version 4.02.21 Manual 215
"" Start with configuration
IF NOP
THEN LOAD V3
TO R0 'Motor Number
IF NOP
THEN CFM 51 " AMxx module
WITH V20 " Reset
WITH R0 'Motor Number
STEP loop
IF NOP
THEN CFM 51 " AMxx module
WITH V0 " Get status
WITH R0 'Motor Number
LOAD FU34
TO FW34 'FU34=extended status
STEP
IF NOP
THEN CFM 51 " AMxx module
WITH V0 " Get status
WITH R0 'Motor Number
LOAD FU34
TO FW34 'FU34=extended status
STEP
IF NOP
THEN CFM 51 " AMxx module
WITH V0 " Get status
WITH R0 'Motor Number
LOAD FU34
TO FW34 'FU34=extended status
STEP wait
IF NOP
THEN CFM 51 " AMxx module
WITH V0 " Get status
WITH R0 'Motor Number
LOAD FU34
TO FW34 'FU34=extended status
PIDCFM
Setup and start the driver.
Input parameters FU32 Number of the 1st flagword used for the parameter
table
Output parameters FU32 0 if successful
256 if driver not installed
Note! Calling the PIDCFM function module will reset all flagwords in the complete parameter
table to 0.
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.
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).
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.
Overview
OPENCOM Open serial interface
CLOSECOM Close serial interface
GETCOM Send character
PUTCOM Receive character
PRINTCOM Send string
READCOM Receive string (incl. delimiter)
READLCOM Receive string (excl. delimiter)
F30 Set interface parameters
F31 Activate CI
F32 Clear buffers
F34 Interrogate status
F35 Change delimiter
BREAKCOM Set/Reset hardware break (SERIALDR only)
SETRTS Active handshake for RS485 (SERIALDR only)
IS485 Check if handshake is active (SERIALDR only)
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
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 5 4 3 2 1 0
Baud rate Char. length Parity
Bit 7 6 5 4 Baud
1 0 0 0 19200
1 0 0 1 9600 (default)
1 0 1 0 4800
1 0 1 1 2400
1 1 0 0 1200
1 1 0 1 600
1 1 1 0 300
1 1 1 1 110
Bit 3 2 Bits/characters
0 0 5
0 1 6
1 0 7
1 1 8 (default)
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 FU32 Serial interface
FU33 Driver mode:
0=Disable CI
1=Enable CI, disabled on receiving the CI command
"X"
2=Enable CI, ignore the CI command "X"
Output parameters None
Note! The standard COM port for the CI cannot be disabled.
The standard COM port for the CI is set in the Controller Settings of the FST project.
The default setting for the standard COM port is
Controller Port Number
FEC COM 255
HC0X COM 255
HC1X COM1 1
HC2X COM 1
F32
Erase interface buffer.
Input parameters FU32 Serial interface
Output parameters FU32 0 = DONE
1 = ERROR
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
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.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.
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 pro-
grams 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.
TCPIPHC0 PS1-HC02
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.
EASY_R
Request a block of operands from 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 wanted (maximum 256)
FU35 Number of first local operand to store response
FU36 Number of first operand in remote controller
FU37 Number of flagword for status
If no response is received after approximately 50 milliseconds the status flagword will indi-
cate a timeout. Only 1 request can be active for each index number.
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
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
IP_MASK
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
IP_TABLE
Set or get an IP address into or from table.
Input parameters
FU32 1 to set the IP address
2 to get the IP address
FU33 index number in IP table
FU34 IP address
FU35 IP address
FU36 IP address
FU37 IP address
Output parameters
FU32 0 if successful, otherwise error
FU33 index number in IP table
FU34 IP address
FU35 IP address
FU36 IP address
FU37 IP address
The IP table is a list of short addresses, which are used by other function modules.
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
-3 if resolver not yet started
-2 if resolver already busy, wait and try again
-1 if resolver busy
0 if resolver finished
1 if resolver timed out
Tries to find the IP address for a hostname. The IP address for DNS server(s) must be known.
This function requires that the FST string driver is installed in the project.
IP_DNS
Set or get an IP address for a DNS server
Input parameters
FU32 1 to set the IP address
2 to get the IP address
FU33 DNS server number (0, 1 or 2)
FU34 IP address
FU35 IP address
FU36 IP address
FU37 IP address
Output parameters
FU32 0 if successful, otherwise error
FU33 DNS server number
FU34 IP address
FU35 IP address
FU36 IP address
FU37 IP address
Up to 3 DNS servers are used when resolving a hostname into an IP address. The servers are
used consecutive (0, 1 then 2).
IP_GATE
Set or get the IP address for gateway.
Input parameters
FU32 1 to set the IP address
2 to get the IP address
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_MAC
Get the Ethernet MAC address.
Input parameters
FU32 Number of string to store the address
Output parameters
FU32 0 if successful, otherwise error
The FST STRING driver must be installed in the project.
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.
TCP_CLOS
Closes a TCP connection
Input parameters
FU32 Index number for handler
Output parameters
FU32 0 if successful, otherwise error
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
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
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.
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
Both terms in the same topic dib AND palette Topics containing both the
–or– words "dib" and "palette."
dib & palette
The first term without the ole NOT dde Topics containing the word
second term –or– "OLE," but not the word
ole ! dde "DDE."
Both terms in the same user NEAR kernel Topics containing the word
topic, close together "user" within eight words of
the word "kernel."