Fkey (fn) functions, Program control of fkeys, Fnpgm statement – Rockwell Automation 1398-PDM-xxx IQ Master Version 3.2.4 for IA-2000 and IQ-5000 Positioning Drive Modules, IQ-55 User Manual

Page 172: Creating and replacing fkey routines, Xkey versus fkey, Fkey (f n ) functions

Advertising
background image

150

IQ Programming Structure • Fkey (Fn) Functions

Publication 1398-PM601A-EN-P — October 2000

TUTORIAL

Fkey (Fn) Functions

Function key programs are programs that are written and assigned to run whenever an associated Fkey
is pressed on the operator terminal. The ULTRA Plus or IQ system directory programs 1 through 24 are
designated for the storage of function key programs.

Function key programs may be assigned to the operator terminal keys in the Parameter menu Fkey Set
Up dialog box. Six different combinations of function keys can be defined. Each of these sets is referred
to as a mode. Once set up, the operator can scroll through the function key menus by pressing the
MODE key on the Operator Terminal. Each press of the mode key will advance the Operator Terminal
to the next mode. After the last defined mode is reached, the terminal will loop to the first mode.

Program Control of Fkeys

In addition to the operator having control over the function keys, the application program may select
and lock the function key mode. This is done using the PRINT instruction. Refer to Part 5

Language

Reference, PRINT, for more detailed information. The FNPGM statement may also be used to simulate
the pressing of an Fkey.

FNPGM Statement

The FNPGM statement simulates pressing an Fkey from within a program. The syntax is FNPGM =
number where number can be any of the Fkey program numbers 1 to 24. Only one Fkey program can be
running at a time. If an Fkey program is running when the FNPGM statement is executed, the current
Fkey program ends and the new Fkey program is started.

Creating and Replacing Fkey Routines

Fkey routines are very similar to regular application programs. They may not, however, contain subrou-
tines, Xkey routines, scanned event routines, the LOOP command or motion statements. Motion state-
ments include MOVD, MOVP, DV, DIF, DELAY, or DWELL. To create a new Fkey routine, or replace
an existing Fkey program, use the following procedure:

1.

Avoiding the commands listed above that are not permitted in Fkey routines, write your program
using the IQ Master editor.

2.

Set the Program Type to Fkey Routine. Program Type is a compiler options and is set in the Edit
menu, Compiler Options dialog box.

3.

Choose Compile from the Edit menu or press F2 to compile the Fkey program. If there are any
errors, correct them and compile.

4.

Choose the “Save Program to IQ” dialog box from the File menu or press F7.

5.

In the directory list box, select the system directory (System Dir).

6.

In the List Program list box, select the FN program number that you would like to replace with this
new routine.

7.

Choose the Executable only or Source and Executable radio button.

8.

Choose OK to save the program to the ULTRA Plus or IQ.

Xkey Versus Fkey

You can accomplish the same task using Xkeys or Fkeys. The difference is in how the routines are pro-
grammed and executed. Xkey routines are defined in the application program header. This means that
each application program may define the Xkey differently. Fkey programs are stored as system pro-
grams. Fkey programs are assigned to the Fkeys through the Parameter menu Fkey Set Up dialog box.

Xkey programs are defined in an application program and therefore can only be executed while a pro-

XNPGM

Simulates the pressing of an Xkey

Name

Description

Advertising