C Utility Program 2.0
C Utility Program 2.0
E96-703
®
C Utility Program
(Release 2.0)
WARNING
INSTRUCTION MANUALS
DO NOT INSTALL, MAINTAIN, OR OPERATE THIS EQUIPMENT WITHOUT READING, UNDERSTANDING,
AND FOLLOWING THE PROPER Elsag Bailey INSTRUCTIONS AND MANUALS; OTHERWISE, INJURY OR
DAMAGE MAY RESULT.
AVERTISSEMENT
MANUELS D’OPÉRATION
NE PAS METTRE EN PLACE, RÉPARER OU FAIRE FONCTIONNER L’ÉQUIPEMENT SANS AVOIR LU,
COMPRIS ET SUIVI LES INSTRUCTIONS RÉGLEMENTAIRES DE Elsag Bailey. TOUTE NÉGLIGENCE À
CET ÉGARD POURRAIT ÊTRE UNE CAUSE D’ACCIDENT OU DE DÉFAILLANCE DU MATÉRIEL.
PERTURBATIONS DU PROCÉDÉ
L’ENTRETIEN DOIT ÊTRE ASSURÉ PAR UNE PERSONNE QUALIFIÉE EN CONSIDÉRANT L’ASPECT
SÉCURITAIRE DES ÉQUIPEMENTS CONTRÔLÉS PAR CE PRODUIT. L’AJUSTEMENT ET/OU L’EXTRAC-
TION DE CE PRODUIT PEUT OCCASIONNER DES À-COUPS AU PROCÉDÉ CONTRÔLE LORSQU’IL EST
INSÉRÉ DANS UNE SYSTÈME ACTIF. CES À-COUPS PEUVENT ÉGALEMENT OCCASIONNER DES
BLESSURES OU DES DOMMAGES MATÉREILS.
NOTICE
I-E96-703A
®
Preface Original
List of Effective Pages Original
iii through vi Original
1-1 through 1-7 Original
2-1 through 2-4 Original
3-1 through 3-2 Original
4-1 through 4-21 Original
5-1 through 5-42 Original
6-1 through 6-6 Original
7-1 through 7-8 Original
A-1 through A-2 Original
B-1 through B-2 Original
C-1 Original
D-1 through D-5 Original
Index-1 through Index-2 Original
When an update is received, insert the latest changed pages and dispose of the super-
seded pages.
NOTE: On an update page, the changed text or table is indicated by a vertical bar in the outer mar-
gin of the page adjacent to the changed area. A changed figure is indicated by a vertical bar in the
outer margin next to the figure caption. The date the update was prepared will appear beside the
page number.
I-E96-703A
Table of Contents
Page
SECTION 1 - INTRODUCTION ....................................................................................................1-1
PURPOSE.....................................................................................................................1-1
MANUAL CONTENT......................................................................................................1-1
REQUIREMENTS .........................................................................................................1-1
Hardware...............................................................................................................1-1
Software ................................................................................................................1-2
Module Initialization ..............................................................................................1-2
Function Blocks.....................................................................................................1-2
USER QUALIFICATIONS ..............................................................................................1-3
MODULE MEMORY......................................................................................................1-4
GLOSSARY OF TERMS AND ABBREVIATIONS .............................................................1-4
REFERENCE DOCUMENTS..........................................................................................1-7
I-E96-703A iii
®
iv I-E96-703A
Table of Contents (continued)
Page
APPENDIX A - FILE SYSTEM CHECK COMMAND .................................................................. A-1
FSCK COMMAND DETAILS ......................................................................................... A-1
List of Figures
I-E96-703A v
®
List of Tables
No. Title Page
vi I-E96-703A
SECTION 1 - INTRODUCTION
PURPOSE
MANUAL CONTENT
Debugger Program Explains the abilities and use of the troubleshooting tool.
REQUIREMENTS
Hardware
or
PURPOSE
I-E96-703A 1-1
INTRODUCTION ®
or
Software
Module Initialization
Function Blocks
REQUIREMENTS
1-2 I-E96-703A
INTRODUCTION
Communication
Module Type Initialization Procedure1
System Used
IMMFP01/02/03 Plant Loop 1. Remove module.
2. Locate dipswitch SW2.
3. Set poles 1 and 7 of SW2 to 1.
4. Install module.
5. Wait until LEDs 1 through 6 are on.
6. Remove module.
7. Set poles 1 and 7 to 0.
8. Install module.
IMMFP01/02/03 INFI-NET 1. Remove module.
2. Locate dipswitch SW2.
3. Set poles 1 and 7 of SW2 to 1.
4. Install module.
5. Wait until LEDs 1 through 6 are on.
6. Remove module.
7. Set pole 6 to 1 and 7 to 0.
8. Install module.
9. Wait until LEDs 1 through 6 are on.
10. Remove module.
11. Set poles 1 and 6 to 0.
12. Install module.
IMMFC03 Plant Loop 1. Remove module.
2. Locate dipswitch U72.
3. Set poles 1 and 3 of U72 to 1.
4. Install module.
5. Wait until LEDs 1 through 6 are on.
6. Remove module.
7. Set poles 1 and 3 to 0.
8. Install module.
IMMFC03 INFI-NET 1. Remove module.
2. Locate dipswitch U72.
3. Set poles 1 and 3 of U72 to 1.
4. Install module.
5. Wait until LEDs 1 through 6 are on.
6. Remove module.
7. Set pole 4 to 1 and 3 to 0.
8. Install module.
9. Wait until LEDs 1 through 6 are on.
10. Remove module.
11. Set poles 1 and 4 to 0.
12. Install module.
NOTE: 1. 1 = open (OFF), 0 = closed (ON). Set all remaining poles to 0.
USER QUALIFICATIONS
USER QUALIFICATIONS
I-E96-703A 1-3
INTRODUCTION ®
MODULE MEMORY
Memory Memory
Area Size
Type Contents
RAM C RAM (2 parts) User specified (Total RAM allocated to C:)
1. C user RAM Idata section User specified (Max size of C idata section:)
Udata section User specified (Max size of C udata section:)
Segment data Derived from segment stack size (((stack size or 2
kbytes) = 2000)* no. of segment entry points)
Dynamic memory User specified (Min size of dynamic memory pool:)
pool
2. C system Checkpoint Buff- Derived from (no. of checkpoint buffers*(checkpoint
RAM ers buffer size + 30))
MBF buffers Derived from (no. of file buffers* (file buffer size + 40))
Code section User specified (Max size of C code section:)
Unused
Function block space Derived from (total RAM minus RAM allotted to C lan-
guage programming)
NVRAM Module format table 34 bytes
File directory Derived from (36*(5 + max no. of data files))
File space User specified (Total NVRAM allocated to C:)
Function block space Remaining NVRAM not used.
MODULE MEMORY
1-4 I-E96-703A
INTRODUCTION
Term Definition
Baud Rate at which data is transmitted over a serial bus in bits per second.
.C File ASCII text file (.C extension) that contains a file to be read by the compiler.
C Map File Module resident file (file number 32767) containing memory map of the C program.
The C Utility Program creates this file.
C RAM Continuous block of RAM memory in the module containing all configurable, RAM
resident structures of the C environment. It consists of two parts: C user RAM and C
system RAM memory.
C System RAM Part of C RAM memory containing code section, checkpoint buffers and MBF buffers.
C User RAM Part of C RAM memory containing data structures (segment stacks, C library data,
dynamic memory pool, etc.) accessible to the C program.
Checkpoint Buffers The MFP/MFC module buffers that provide temporary storage for file data transmit-
ted from primary MFP/MFC to backup MFP/MFC.
.CMD File A temporary file containing C program information used by the Microtec linker pro-
gram.
Code Section The executable code of the C program.
Code Section File Module resident file (file number 32765) containing the C program code section.
.CSP File Work station resident file (.CSP file extension) containing information about the C
environment of the module.
Compiler A program whose purpose is that of translating high-level language statements into a
form that can directly activate the device hardware.
Configuration The act of setting up equipment to accomplish specific functions or a list of parame-
ters associated with such a setup.
Controlway High speed, redundant, peer-to-peer communication link. Used to transfer informa-
tion between intelligent modules within the a process control unit.
CPM Communication port module. A module in the process control unit that allows the
work station to communicate with a module via the Controlway communication link.
CUP C Utility Program. The software used to specify and manage the C environment in
the module.
Dynamic File A module file that can be modified while the module is in EXECUTE mode.
EWS Engineering work station.
File Attributes The read and write access levels specified when a file is created in a module.
File ID Unique C file identifier (numerical).
Format Operation Operation performed on the module to format and initialize the user configurable
memory.
Format Specifica- The set of specifications that define the module memory format.
tions
Function Block The occurrence of a function code at a block address of a module.
Function Code An algorithm that manipulates specific functions. These functions are linked together
to form the control strategy.
Idata Section File Module resident file (file number 32766) containing C program initialized data such
as constants, character strings, etc.
Term Definition
INFI-NET Advanced data communication highway.
Linker (DOS) Work station resident linker program that combines a set of .OBJ files into one .LMS
Program file that can be run and tested within the work station.
.LMS File Work station resident file (.LMS file extension) containing a C program code section
and idata section.
.MAP File Work station resident file (.MAP file extension) containing the memory map of a C
program load module.
MBF Buffers Module resident buffers that provide temporary storage of file data while the file is
being accessed via the module bus.
MFC Multi-function controller module. A multiple-loop controller with data acquisition and
information processing capabilities.
MFP Multi-function processor module. A multiple-loop controller with data acquisition and
information processing capabilities.
Module Address A unique identifier of a specific device or a communication channel. Refers to Con-
trolway or module bus address.
Module Bus Peer to peer communication link used to transfer information between intelligent
modules within a process control unit.
NIU Network interface unit. Term used for all local and remote interfaces, computer inter-
faces and console interfaces.
Node A point of interconnection to a network.
Node Address A unique identifier of a specific device or a communication channel. Refers to Plant
Loop, Superloop or INFI-NET address.
NVRAM Nonvolatile random access memory. Retains stored information when power is
removed.
.OBJ File Work station resident file (.OBJ file extension) produced by a C compiler.
PCU Process control unit. A node on the plant-wide communication network containing
master and slave modules.
Plant Loop Network 90® data communication highway.
Segment A grouping of function blocks separated from other function blocks by function code
82 (segment control).
Segment Entry Point The function in the C program that is called by an invoke C command. There is one
entry point for every segment containing invoke C commands. Multiple invoke C
commands in a segment call the same entry point. Two or more segments may share
the same entry point.
Segment Stack An area in RAM used by the C program to store temporary data. There is one stack
for every segment that invokes C.
Set Point Target value for a process variable representing desired performance of the process
variable.
SPM Serial port module; a module in the process control unit that allows the work station
to communicate with a module via the module bus.
Udata Section File Module resident file containing C program uninitialized data such as uninitialized
arrays, etc.
REFERENCE DOCUMENTS
Number Document
I-E96-200 Function Code Applications Manual
I-E96-201 Multi-Function Processor Module IMMFP01
I-E96-202 Multi-Function Processor Module IMMFP02
I-E96-203 Multi-Function Processor Module IMMFP03
I-E96-211 Multi-Function Controller Module IMMFC03
I-E96-217 Serial Port Module IMSPM01
I-E96-221 Communication Port Module IMCPM02
I-E96-601 INFI-NET Communications Modules
I-E96-620 Plant Loop to Computer Interface INPCI01
I-E96-621 Plant Loop to Computer Interface INPCI02
I-E96-701 Personal Computer Software Computer-Aided
Drawing/Text (CAD/TXT)
REFERENCE DOCUMENTS
I-E96-703A 1-7
SECTION 2 - INSTALLATION
INTRODUCTION
INSTALL Enter
or
INTRODUCTION
I-E96-703A 2-1
INSTALLATION ®
Directory Contents
C:\CMFC Compiler Batch, Linker Batch, Help, and Bailey Utility
files. Also included is the CUP.EXE and CDEBUG.EXE
files.
C:\MCC68K Microtec C Compiler files.
C:\ASM68K Microtec Assembler and Linker files.
HARDWARE CONNECTIONS
HARDWARE CONNECTIONS
I-E96-703A 2-3
INSTALLATION ®
HARDWARE CONNECTIONS
2-4 I-E96-703A
SECTION 4 - C UTILITY PROGRAM
INTRODUCTION
Where:
This command brings up the CUP title page and, after a short
delay, the CUP MAIN MENU (see Figure 4-1). These menu
options are presented in the logical sequence of events needed
to prepare a C program for execution in a MFP or MFC module.
On-line help is available at any time (while in the CUP pro-
gram) by simultaneously pressing Alt - H.
INTRODUCTION
I-E96-703A 4-1
C UTILITY PROGRAM ®
TPS0236A
To create a new .CSP file, select A Read CSP File from the CUP
MAIN MENU. Enter the name of the new .CSP file at the CSP
Filename prompt. Press F10 to enter the file name. The CUP
program searches the current directory for the file. If the file
does not exist, the CUP program creates a new file. Entering
the name of an existing .CSP file loads that file. A path may be
specified while entering the file name. If a path is specified, the
edited .CSP file and any related files are placed in the specified
path. Entering the default CSP Filename (*.CSP) starts a wild-
card *.CSP file search.
Once the .CSP file is loaded or created, the CSP TITLE INFOR-
MATION screen (See Figure 4-2) will appear. The Loop Address,
PCU Address, Module Address, Module Type, Hardware Ver
(circuit board version), Software Ver (module firmware ver-
sion), and BATCH present? fields must be accurate according
to the existing INFI 90 system configuration. The values
entered in these fields are used as defaults for all subsequent
module functions. The user Name, Plant Site, Contract #, Pro-
gram Description, and Comments fields are for information only
and do not affect program execution.
TPS0237A
TPS0238A
Selecting A Edit Object File List allows the C object files ( .OBJ
file extension) and user supplied library files that make up the
C program to be entered. When entering library files on this
list, specify the proper file extension. The Microtec linker pro-
gram uses this list to determine which files must be linked
together for the C program. Up to 100 files can be entered in
this list. Pressing Page Up or Page Dn scrolls the list in groups of
ten files.
After building the list and exiting the screen, the CUP program
reads each object file and calculates memory (idata, udata,
and code) usage. If there are no object files on the list, the Can-
not compute memory requirements message appears. The cal-
culated memory values can then be transferred to the memory
requirement specifications of the C specification file ( .CSP file).
To transfer the specifications answer Y to the Transfer to CSP?
(Y/N) prompt. Make the appropriate corrections to any noted
errors before escaping this screen.
TPS0239A
Max size of C idata This field limits the maximum size (in bytes) of the initialized
section data section of memory.
Max size of C udata This field limits the maximum size (in bytes) for the uninitial-
section ized data section of memory.
Min size of dynamic This field limits the minimum size (in bytes) for the section of
memory pool memory reserved for dynamic memory functions. This section
contains any excess C configured program memory.
Name of Entry Point These eight fields list the names of the executable C programs
in each segment that contains a function code 143 (invoke C).
Stack Size These eight fields specify the size (in bytes) of the entry point
stacks.
Max size of C code This field limits the maximum size (in bytes) of C program.
section This value should be as large as the program itself plus some
extra memory to account for small program changes.
Number of checkpoint This field specifies the number of buffers used when sending
buffers file information to a redundant MFP or MFC module. If there is
no redundant MFP or MFC module, set this field to zero.
Size of each checkpoint This field specifies the size (in bytes) of each checkpoint buffer.
buffer For optimum performance, set this field to a value greater than
that of the largest file sent to the redundant MFP or MFC mod-
ule. If there is no redundant MFP or MFC module, set this field
to zero.
TPS0240A
Number of MBF buffers This field specifies the number of buffers that provide tempo-
rary storage of file data while accessing a file via the Control-
way or module bus communication link.
Size of each MBF buffer This field specifies the size (in bytes) of each MBF buffer. For
optimum performance, set this field to a value greater than
that of the largest file to be accessed during file transfers.
Total RAM allocated for This field sets the total RAM memory (in bytes) used for C pro-
C gramming and related files.
Total NVRAM allocated This request appears when no BATCH programs are used. This
for C field sets the total NVRAM memory (in bytes) used for C pro-
gramming and related files.
or
Total NVRAM allocated This request appears when Batch 90 programs are used in the
for C and BATCH same module as C programs. This field sets the total NVRAM
memory (in bytes) used for both C and Batch 90 programs.
TPS0241A
Number of data files This request appears when no Batch 90 programs are used.
for C This field specifies the maximum number of data files in the
module directory.
or
Number of data files for This request appears when Batch 90 programs are used in the
C and BATCH same module as C programs. This field specifies the maximum
number of data files in the module directory.
Where:
MODULE MANAGEMENT
TPS0242A
MODULE MANAGEMENT
I-E96-703A 4-9
C UTILITY PROGRAM ®
C PROGRAM MANAGEMENT
TPS0243A
C PROGRAM MANAGEMENT
4 - 10 I-E96-703A
C UTILITY PROGRAM
Command Description
BKUP1 Send a backup copy of the primary module hard drive to the redundant module hard drive.
CALL Execute a shell command file. The command file is an ASCII file that can contain any number
of data file commands found in this section. Example: CALL file where file is the DOS path
and file name.
CD1 Change the current module hard drive directory. Example: CD [path] where path is the new
directory path specification.
CFG Place the target module into configure mode.
CLS Clear the shell display window.
CP1 Initiate a module hard drive copy operation. Example: CP src dst where src is the source
path and file name. dst is the destination path and file name.
Command Description
CR1 Create a module hard drive file. Example: CR file where file is the path and file name to be
created.
CRN2 Create a module NVRAM file. Example: CRN file [access] [check] where file is the file num-
ber (allowable numbers from 1 to 32,759). access is the write access code (0 = no restrictions,
1 = local writes only, 2 = no writes allowed). 0 is the default value. check is checkpoint inhibit
code (0 = no, 1 = yes). 0 is the default value.
CWD1 Get the current module hard drive directory.
DF1 Get the number of free hard drive blocks.
DOS Invoke a DOS shell.
EXE Place the target module into execute mode.
FIXN2 Attempt to recover a bad NVRAM file. Example: FIXN [file] where file is the number of the
bad NVRAM file.
FSCK1 Check the module hard drive system. Example: FSCK type name1 name2... where type is
the type of check to perform. name is the file or device name. Refer to Appendix A for more
information about this command.
GET1 Transfer a module hard drive file to the work station. Example: GET module ews [count]
[offset] where module is the hard drive file path and file name. ews is the work station path
and file name. count is the number of bytes to transfer (default = all). offset is the file offset at
which to begin transfer (default = 0).
GETN2 Transfer a module NVRAM file to the work station. Example: GETN module ews [count]
[offset] where module is the NVRAM file number. ews is the work station path and file name.
count is the number of bytes to transfer (default = all). offset is the file offset at which to begin
transfer (default = 0).
HELP Get help on a command. Example: HELP [command] where command is the subject of the
inquiry. Entering HELP without the command field will display a complete list of file manage-
ment commands.
LS1 List the module hard drive directory. Example: LS [path] where path is the path of the direc-
tory to be listed.
LSN2 List the module NVRAM directory.
MAP Display the memory map of the module.
MD Make a module hard drive directory. Example: MD path where path is the path and name of
the new directory.
MKFS1 Make the hard drive file system. Example: MKFS num_inodes num_zones num_bufs
[sync_time] where num_inodes is the number of inode (files and/or directories) blocks.
num_zones is the number of zone blocks. num_bufs is the number of cache buffers.
sync_time is the time between file system syncs in seconds. Refer to Appendix B for more
information about this command.
MOD Select the target module. Example: MOD [address] where address is the module address.
NOP Null operation.
PUT1 Transfer a work station file to the module hard drive. Example: PUT ews module [count]
[offset] where ews is the path and file name of the work station file. module is the path and file
name of the module hard drive file. count is the number of bytes to transfer (default = all). off-
set is the file offset at which to begin transfer (default = 0).
Command Description
PUTN2 Transfer a work station file to the module NVRAM. Example: PUTN ews module [count]
[offset] where ews is the path and file name of the work station file. module is the number of
the module NVRAM file. count is the number of bytes to transfer (default = all). offset is the file
offset at which to begin transfer (default = 0).
QUIT Exit the data file command shell.
RD1 Remove a module hard drive directory. Example: RD dir where dir is the path and name of
the directory to be removed.
REWIND Restart the execution of a shell command file.The rewind command is used within a shell com-
mand file only. It causes execution of the command file to restart at the beginning. Refer to the
call command.
RM1 Remove a module hard drive file. Example: RM file where file is the path and file name of the
file to be removed.
RMN2 Remove a module NVRAM file. Example: RMN file where file is the number of the file to be
removed.
RST Reset the target module.
SLEEP Wait a specified number of seconds. Example: SLEEP seconds where seconds is the length
of the delay. This command is used within a shell command file only. It suspends execution of
the command file for the specified number of seconds. Refer to the call command.
SYNC Set hard drive sync time. Example: SYNC seconds where seconds is the number of seconds
between syncs.
NOTES:
1. This command functions in hard drive file systems only.
2. This command functions in NVRAM file systems only.
3. Brackets ([..]) denote an optional parameter. All optional parameters in the same command must be specified when changing even one
of the parameters.
MODEM SETUP
MODEM SETUP
I-E96-703A 4 - 13
C UTILITY PROGRAM ®
TPS0244A
TPS0267A
MODEM SETUP
4 - 14 I-E96-703A
C UTILITY PROGRAM
MODEM SETUP
I-E96-703A 4 - 15
C UTILITY PROGRAM ®
Refer to the instruction manual for the modem used for exact
setup procedures. After making all hardware connections,
modem setup can take place. Selecting H Modem Setup from
the CUP MAIN MENU causes the MODEM SETUP menu to
appear. See Figure 4-11. An explanation of each menu option
follows.
TPS0274A
MODEM SETUP
4 - 16 I-E96-703A
C UTILITY PROGRAM
TPS0275A
TPS0xxxA
Table 4-2 lists the error messages unique to the C Utility Pro-
gram and a brief explanation of each. Please note that a list of
error messages from INFI 90/Network 90 communication
interfaces exists in the interface documentation.
INTRODUCTION
bin
struct fbbuf
{
struct /* block (FOB) characteristics */
{
unsigned type : 8; /* data type of output value */
/* (BOOLEAN, I1, I2, or R4) */
unsigned qdef : 8; /* nonzero if quality defined */
/* (NOQUAL or QUAL) */
unsigned fcdata : 8; /* code specific data */
unsigned q : 1; /* quality */
unsigned ha : 1; /* high alarm/Boolean alarm */
unsigned la : 1; /* low alarm */
unsigned hdev : 1; /* high device alarm */
unsigned ldev : 1; /* low device alarm */
unsigned pad : 3; /* unused bits */
} info;
union /* block output (FOB) value */
{
struct
{
unsigned pad1 : 7;
unsigned val : 1; /* Boolean value */
unsigned pad2 : 8;
} bo;
struct
{
INTRODUCTION
I-E96-703A 5-1
MODULE SPECIFIC FUNCTIONS ®
bin
continued
/*
Get hours, minutes, seconds and time_sync flag from the Extended Executive
block and display these values on an attached terminal:
*/
/* get hours */
status = bin(20, &buffer);
if (status) return;
hours = (long int) buffer.fobval.r4;
/* get minutes */
status = bin(21, &buffer);
if (status) return;
minutes = (long int) buffer.fobval.r4;
/* get seconds */
status = bin(22, &buffer);
if (status) return;
seconds = (long int) buffer.fobval.r4;
/* get time sync flag */
status = bin(23, &buffer);
if (status) return;
time_sync = (long int) buffer.fobval.bo.val;
bin
5-2 I-E96-703A
MODULE SPECIFIC FUNCTIONS
blk_wrt
blk_wrt
I-E96-703A 5-3
MODULE SPECIFIC FUNCTIONS ®
blk_wrt
continued
struct bs_fc30
{
struct bs_ bs; /* common section structure */
unsigned char qa_on; /* quality/alarm on control */
unsigned char qa_off; /* quality/alarm off control */
float val; /* analog value */
unsigned long timestamp; /* timestamp value */
};
struct bs_fc45
{
struct bs_ bs; /* common section structure */
unsigned char qa_on; /* quality/alarm on control */
unsigned char qa_off; /* quality/alarm off control */
unsigned char val; /* value */
unsigned char unused; /* reserved for future use */
unsigned long timestamp; /* timestamp value */
};
The qa_on and qa_off fields are used to control the quality and
alarm parameters of the function block. These fields are set by
performing a bitwise OR with the desired operation values as
defined in the blk_wrt.h file:
blk_wrt
5-4 I-E96-703A
MODULE SPECIFIC FUNCTIONS
blk_wrt
continued
/*
Write value 3.14159 to function code 30 at block 100, assert
quality bad, and clear the high alarm:
*/
buffer.bs.fun_code = 30;
buffer.bs.block_no = 100;
buffer.bs.operations = BLK_WRT_V | BLK_WRT_QA;
buffer.val = 3.14159;
buffer.qa_on = BLK_Q_1 | BLK_HA_0;
buffer.qa_off = BLK_Q_0 | BLK_HA_1
status = blk_wrt(&buffer);
if (status) return;
/*
Write value f to function code 30 at block 200, and set the low
alarm:
*/
buffer.bs.fun_code = 30;
buffer.bs.block_no = 200;
buffer.bs.operations = BLK_WRT_V | BLK_WRT_QA;
buffer.val = f;
buffer.qa_on = BLK_LA_1;
buffer.qa_off = BLK_LA_0;
status = blk_wrt(&buffer);
if (status) return;
}
blk_wrt
I-E96-703A 5-5
MODULE SPECIFIC FUNCTIONS ®
bout
Overflow can occur for block outputs that are of type REAL.
This happens because the floating point representation used
internally by the module differs from C program floating point
representations. If the block output value is too large to be rep-
resented, the largest value of the same sign is output and the
return status of the bout() function is set to one.
void main(void)
{
long int status;
struct fbbuf buffer;
/*
Output a real value with quality to block 200, which is configured with a function
code 137 (output buffer):
*/
buffer.info.type = R4; /* output is type REAL */
buffer.info.qdef = QUAL; /* output has quality */
buffer.info.q = 0; /* output quality is good */
buffer.info.ha = 0; /* no high alarm */
buffer.info.la = 0; /* no low alarm */
bout
5-6 I-E96-703A
MODULE SPECIFIC FUNCTIONS
bout
continued
/*
Output a Boolean value without quality to block 300, which is configured with a
function code 94 (Output Buffer):
*/
buffer.info.type = BOOLEAN; /* output is type boolean */
buffer.info.qdef = NOQUAL; /* output has no quality */
buffer.info.ha = 0; /* no high alarm */
buffer.info.la = 0; /* no low alarm */
buffer.info.hdev = 0; /* no high device */
buffer.info.ldev = 0; /* no low device */
buffer.info.pad = 0; /* must zero pad element */
buffer.fobval.r4 = 23.6391; /* set output value */
bout
I-E96-703A 5-7
MODULE SPECIFIC FUNCTIONS ®
checkpoint_file
REMARKS: This function requests that a file be copied to the backup mod-
ule in a redundant pair configuration. This copy operation
allows changes in file data of the primary module to be
updated in the backup module. The mode parameter specifies
the action to take if a checkpoint buffer error, such as no buff-
ers currently available, occurs.
checkpoint_file
5-8 I-E96-703A
MODULE SPECIFIC FUNCTIONS
checkpoint_file
continued
char filename[100];
void main(void)
{
short mode;
long status;
mode = WAIT_UNTIL_COMPLETE;
checkpoint_file
I-E96-703A 5-9
MODULE SPECIFIC FUNCTIONS ®
cpfil
The C program can hold the NVRAM file open for write access
during a deferred mode checkpoint request, but the NVRAM
file will not be checkpointed until it is closed by the C program.
This close is required to allow the checkpoint function to
acquire the NVRAM file data and send it to the backup mod-
ule. Once checkpointing is complete, the C program can
reopen the NVRAM file for write access.
cpfil
5 - 10 I-E96-703A
MODULE SPECIFIC FUNCTIONS
cpfil
continued
void main(void)
{
long int filehandle, status;
/* checkpoint the NVRAM file using the wait until complete mode */
filehandle = open(DATA_FILE, O_RDONLY);
status = cpfil(2, filehandle, atoi(DATA_FILE));
close(filehandle);
cpfil
I-E96-703A 5 - 11
MODULE SPECIFIC FUNCTIONS ®
dadig_in
struct dadig_buf
{
unsigned char timestamp[6]; /* latched timestamp */
/* (6 byte integer) */
unsigned quality : 1; /* quality/hardware failure */
unsigned alarm : 1; /* alarm */
unsigned time_in_alarm : 1; /* time in alarm re-alarm */
unsigned alarm_suppressed : 1; /* alarms suppressed */
unsigned output_suspect : 1; /* output suspect */
/* out of range */
unsigned no_report : 1; /* no report/off scan */
unsigned red_tagged : 1; /* red-tagged */
unsigned output_value : 1; /* output value */
unsigned ex_stat_latched : 1; /* extended status latched */
unsigned quality_override : 1; /* quality override */
unsigned set_permissive : 1; /* set permissive */
/* (state of S2) */
unsigned pri_input_sel : 1; /* primary input select */
/* (S1 bit 1) */
unsigned alt_input_sel : 1; /* alternate input select */
/* (S1 bit 0) */
unsigned spare1 : 1; /* spare bit 1 */
unsigned spare2 : 1; /* spare bit 2 */
unsigned spare3 : 1; /* spare bit 3 */
};
dadig_in
5 - 12 I-E96-703A
MODULE SPECIFIC FUNCTIONS
dadig_in
continued
void main(void)
{
struct dadig_buf buffer;
long int status;
static char *yes = "YES";
static char *no = "NO";
dadig_in
I-E96-703A 5 - 13
MODULE SPECIFIC FUNCTIONS ®
dasin
struct dasbuf
{
unsigned short status; /* point status */
float val; /* point value */
float higher; /* limit or alarm higher than
current output */
float lower; /* limit or alarm lower than
current output */
union /* extended status */
{
unsigned long exs_int; /* extended point status */
{
struct
unsigned nu : 8; /* not used */
unsigned spare : 8; /* not used */
unsigned xrr : 1; /* exception report received */
unsigned rtag : 1; /* red-tagged */
unsigned hwfail : 1; /* hardware failure */
unsigned orng : 1; /* out of range */
unsigned lim : 1; /* limited */
unsigned aman : 1; /* auto/manual (1=auto) */
unsigned calc : 1; /* calculated */
unsigned spare2 : 1; /* spare */
unsigned offs : 1; /* off scan */
unsigned hdeva : 1; /* high deviation alarm */
unsigned ldeva : 1; /* low deviation alarm */
unsigned hrata : 1; /* high rate alarm */
unsigned lrata : 1; /* low rate alarm */
unsigned varal : 1; /* variable alarms */
unsigned alspr : 1; /* alarms suppressed */
unsigned realr : 1; /* time in alarm re-alarm */
} exs_bin;
} exstatus;
}
dasin
5 - 14 I-E96-703A
MODULE SPECIFIC FUNCTIONS
dasin
continued
dasbuf.status:
Constant Description
QBAD Point quality
HALRM High alarm
LALRM Low alarm
LEVL_2 Level two alarm
LEVL_3 Level three alarm
EXS_CHG Extended status change
R_TAG Red-tagged
S_AUTO Auto/manual (1=auto)
dasbuf.exstatus.exs_int:
void main(void)
{
struct dasbuf buffer;
long int status;
static char *yes = "YES";
static char *no = "NO";
/*
This example uses a pointer to a bitfield structure to directly access the elements
of dasbuf.status instead of performing bitwise AND operations with the defined
constants from the das.h file. This example structure is also defined in the
das.h file as struct "s".
*/
struct sts_bits /* defined in das.h as "s" */
dasin
I-E96-703A 5 - 15
MODULE SPECIFIC FUNCTIONS ®
dasin
continued
{
unsigned unused : 8;
unsigned q : 1; /* point quality */
unsigned ha : 1; /* high alarm */
unsigned la : 1; /* low alarm */
unsigned alev : 2; /* alarm level: */
/* 00 = normal */
/* 01 = unused */
/* 10 = level 2 */
/* 11 = level 3 */
unsigned exsc : 1; /* extended status changed */
unsigned rtag : 1; /* red-tagged */
unsigned a_m : 1; /* auto/manual (1=auto) */
} *sts;
dasin
5 - 16 I-E96-703A
MODULE SPECIFIC FUNCTIONS
filxfer
PURPOSE: This function transfers file data between two modules. This
function transfers NVRAM and hard disk files.
REMARKS: This function transfers file data between two modules. The
caller specifies the file, direction of transfer, file offset, and
number of bytes in the file to transfer. Any part of either file
can be transferred to any part of the other file and both files
must exist prior to the transfer. The specifications of the trans-
fer operation are passed to this function in a structure of type
fxspec. The status is also returned to the C program in this
structure. The format of the fxspec structure is defined in the
n90.h file as follows:
struct fxspec
{
short int op; /* operation code: 0=import, 16=export */
char *sfnp; /* source file string pointer */
char *dfnp; /* destination file string pointer */
/* format of string: */
/* fnp = "@Lxx @Nxx @Mxx file" */
/* @Lxx remote loop */
/* @Nxx remote node */
/* @Mxx remote module */
/* file file name or number */
long int sofs; /* source offset (0=start of file) */
long int dofs; /* destination offset (0=start of file)*/
long int nb; /* bytes to transfer (-1=entire file)*/
short int tim; /* operation timeout value in seconds */
short int wait; /* wait mode: */
/* 0 = immediate return */
/* 1 = wait until complete */
short int sta; /* operation return status: */
/* 1 = busy */
/* 0 = normal completion */
/* -1 = invalid specification */
/* -3 = local memory overflow */
/* -5 = timeout */
/* -6 = invalid operation */
/* -7 = interface unit error */
/* -8 = can't get request to interface unit
*/
/* -? = other error; see Table 5-1 */
long int tc; /* number of bytes transferred */
long int spr; /* reserved */
};
filxfer
I-E96-703A 5 - 17
MODULE SPECIFIC FUNCTIONS ®
filxfer
continued
Since the interface unit may do the actual file transfer, the
fxspec.sta offers an extended error status to indicate several
other transfer problems to the C program. Table 5-1 defines
the bits of the fxspec.sta structure element.
The remote module uses one module bus file (MBF) buffer for
each active transfer operation. If the selected section of the file
fits into an MBF buffer (i.e. fxspec.nb is less than the MBF
buffer size), the remote file will lock the file only long enough to
filxfer
5 - 18 I-E96-703A
MODULE SPECIFIC FUNCTIONS
filxfer
continued
read its contents into the MBF buffer. Otherwise, the remote
module will lock the file during the entire transfer operation. It
is recommended that the size of the MBF buffers is set large
enough to hold the size of the largest amount of data that is to
be transferred. The local module also uses an MBF buffer for
the transfer operation and its size should be set equal to the
size of the MBF buffer of the remote module. The MBF buffers
are allocated using the C Utility Program.
/*
transfer file 1000 at loop 1, node 2, module 10 to file 2000 at loop 5, node 4,
module 12
*/
fx.op = 0; /* import file data operation */
fx.sfnp = sfnp; /* set source spec */
fx.dfnp = dfnp; /* set destination spec */
fx.sofs = 0; /* start of source file */
fx.dofs = 0; /* start of destination file */
fx.nb = -1; /* transfer entire file */
fx.tim = 60; /* timeout value */
fx.wait = 1; /* wait until complete */
filxfr(&fx);
filxfer
I-E96-703A 5 - 19
MODULE SPECIFIC FUNCTIONS ®
filxfer
continued
filxfer
5 - 20 I-E96-703A
MODULE SPECIFIC FUNCTIONS
fltr3
REMARKS: This function converts an IEEE floating point value to its INFI
90 REAL 3 format equivalent. C programs use this function to
convert an internal floating point variable to the REAL 3 for-
mat that is usable by a network interface unit.
/*
convert a floating point value to a REAL 3 format value and display the status
on an attached terminal.
*/
flt = 3.1415926;
status = fltr3(&flt, r3);
fltr3
I-E96-703A 5 - 21
MODULE SPECIFIC FUNCTIONS ®
getargs
FORMAT: pp = getargs(void);
struct parblock *pp; return value is a pointer to the invoke C parameter block of
the current segment
struct parblock
{
short blockno; /* block number of Invoke C */
short tflag; /* non zero if the block has been tuned */
char S3, S4; /* program-readable character specs */
short S5, S6; /* program-readable short specs */
float S7, S8; /* program-readable float specs */
char S9; /* spare character parameter - not used */
short S10; /* spare short parameter - not used */
float S11; /* spare float parameter - not used */
struct /* private checkpointed data */
{
short qual; /* block quality and alarm status */
float bout; /* block output value */
} blockout;
char cpsave[8]; /* free-format checkpointed data buffer */
};
The following constants are defined in the n90.h file and can
be used to test or set each bit of the parblock.blockout.qual
structure element:
Constant Description
QBAD Used to set or test quality
HALRM Used to set or test high alarm
LALRM Used to set or test low alarm
getargs
5 - 22 I-E96-703A
MODULE SPECIFIC FUNCTIONS
getargs
continued
void main(void)
{
struct parblock *pp;
/*
get the block number, tune status and quality of the Invoke C block (function
code 143) and display the information on an attached terminal
*/
pp = getargs();
getargs
I-E96-703A 5 - 23
MODULE SPECIFIC FUNCTIONS ®
inque
REMARKS: This function examines the state of a serial port receive buffer
and returns the number of bytes currently in the buffer. The
inque() function should be called prior to calling the read()
function to determine the number of bytes in the receive
buffer. A call to the read() function will return only after the
number of bytes received by the port equals the number of
bytes specified to be read. In this manner, calling the inque()
function eliminates C program suspension.
inque
5 - 24 I-E96-703A
MODULE SPECIFIC FUNCTIONS
mb_addr
mb_addr
I-E96-703A 5 - 25
MODULE SPECIFIC FUNCTIONS ®
outque
outque
5 - 26 I-E96-703A
MODULE SPECIFIC FUNCTIONS
portopen
portopen
I-E96-703A 5 - 27
MODULE SPECIFIC FUNCTIONS ®
portopen
continued
The main point to consider when using the port I/O functions
is to use the inque() and outque() functions to monitor the
receive and transmit buffer space. The inque() function should
be used prior to a read() call to accurately determine the num-
ber of bytes to read. The outque() function should be used
prior to a write() function call to verify that enough free space
exists in the transmit buffer to write the new data. Using these
functions instead of relying on fixed byte reads and writes will
always guarantee that module execution is not suspended.
portopen
5 - 28 I-E96-703A
MODULE SPECIFIC FUNCTIONS
portopen
continued
Constants Description
Baud rates:
BAUD75 75 baud
BAUD110 110 baud
BAUD134 134.5 baud
BAUD150 150 baud
BAUD300 300 baud
BAUD600 600 baud
BAUD1200 1200 baud
BAUD1800 1800 baud
BAUD2000 2000 baud
BAUD2400 2400 baud
BAUD4800 4800 baud
BAUD9600 9600 baud
BAUD19200 19.2K baud
Data bits:
DATA7 Seven data bits
DATA8 Eight data bits
Parity:
EVENPAR Even parity
ODDPAR Odd parity
LOWPAR Low parity
HIGHPAR High parity
NOPAR No parity
Stop bits:
STOP1 One stop bit
STOP2 Two stop bits
Miscellaneous:
BREAKON Enables break detect
XONXOFF Enables ^S/^Q flow control
RTSCTS Enables RS-232 RTS and CTS handshaking
NOECHO Disables character echoing and translation
portopen
I-E96-703A 5 - 29
MODULE SPECIFIC FUNCTIONS ®
portopen
continued
void main(void)
{
char scratch[255]; /* local scratch buffer */
long int i; /* loop variable */
unsigned short mode; /* port mode value */
/*
The following code waits until all characters have been transmitted or until five
seconds have elapsed. This timed wait insures that the C program will exit even
if the data transmission gets suspended at the serial port.
*/
/* get current time in milliseconds */
i = sysclk();
/* loop to wait */
while((outque(PORT)) && (sysclk() - i < 5000));
portopen
5 - 30 I-E96-703A
MODULE SPECIFIC FUNCTIONS
putargs
FORMAT: putargs(pp);
struct parblock *pp; argument is a pointer to the Invoke C
parameter block of the segment
void main(void)
{
struct parblock *pp;
/*
Write data to the private checkpointed space of the parblock structure. This data
will then be sent to the backup in a redundant module configuration.
*/
putargs
I-E96-703A 5 - 31
MODULE SPECIFIC FUNCTIONS ®
putmsg
REMARKS: This function behaves much like the write() function for output
to the serial port. If gapless transmission of a message is
required, then the putmsg() function must be used. Note that
the target serial port must first be opened using open() or por-
topen() function.
void main(void)
{
char * message = "This is a test message!\n";
putmsg
5 - 32 I-E96-703A
MODULE SPECIFIC FUNCTIONS
r3flt
/*
Convert a REAL 3 value to a floating point value and display the value on an
attached terminal.
*/
flt = 3.1415926;
status = fltr3(&flt, r3);
if (status ! = 0) return;
r3flt(r3, &flt);
r3flt
I-E96-703A 5 - 33
MODULE SPECIFIC FUNCTIONS ®
rfilef
PURPOSE: This function copies a file from a module in the local process
control unit to a file in a module in the same local process con-
trol unit.
struct rffspec
{
short int loop; /* loop of remote module (set to 0) */
short int pcu; /* process control unit of remote module (set to 0) */
short int mod; /* remote module address */
short int rfid; /* remote file number */
short int lfid; /* local file number */
short int lfdscr; /* local file descriptor of file opened by */
/* caller or -1 if not opened by caller */
short int wait; /* wait mode: */
/* 0 = immediate return */
/* 1 = wait until complete */
short int maxtime; /* operation timeout value in seconds */
short int sts; /* operation return status: */
/* 1 = busy */
/* 0 = normal operation */
/* -1 = invalid specification */
/* -2 = cannot access remote file */
/* -3 = local memory overflow */
/* -4 = cannot write local file */
/* -5 = timeout */
/* -6 = communications error */
};
rfilef
5 - 34 I-E96-703A
MODULE SPECIFIC FUNCTIONS
rfilef
continued
If the caller does not open the file, it will be opened and closed
inside the function. The function obeys the same file access
rules as the C program.
The remote module uses one module bus file (MBF) buffer for
each active transfer operation. If the entire file fits into an MBF
buffer, the remote file will lock the file only long enough to read
its contents into the MBF buffer. Otherwise, the remote mod-
ule will lock the file during the entire transfer operation. It is
recommended that the size of the MBF buffers is set large
enough to hold the size of the largest file to be transferred. The
local module does not use an MBF buffer for the transfer oper-
ation. The MBF buffers are allocated using the C Utility Pro-
gram.
rfilef
I-E96-703A 5 - 35
MODULE SPECIFIC FUNCTIONS ®
rfilef
continued
void main(void)
{
static struct rffspec rf;
rfilef
5 - 36 I-E96-703A
MODULE SPECIFIC FUNCTIONS
rfiler
PURPOSE: This function copies a file from a module to the RAM memory
buffer of the local module in the same process control unit.
struct rfrspec
{
short int loop; /* loop of remote module (set to zero) */
short int pcu; /* process control unit of remote module (set to 0) */
short int mod; /* remote module address */
short int rfid; /* remote file number */
long int ofs; /* remote file offset */
long int cnt; /* maximum number of bytes to read */
char *ptr; /* pointer to destination buffer */
short int wait; /* wait mode: */
/* 0 = immediate return */
/* 1 = wait until complete */
short int maxtime; /* operation timeout value in seconds */
short int sts; /* operation return status */
/* 1 = busy */
/* 0 = normal operation */
/* -1 = invalid operation */
/* -2 = cannot access remote file */
/* -3 = local memory overflow */
/* -5 = timeout */
/* -6 = communications error */
long int nb; /* number of bytes read */
};
rfiler
I-E96-703A 5 - 37
MODULE SPECIFIC FUNCTIONS ®
rfiler
continued
The specified remote file data is read into the local buffer,
(pointed to by rfrspec.ptr) as the transfer occurs. If the transfer
operation is not successful, the contents of the local buffer are
indeterminate. Each active transfer request uses 200 bytes of
local dynamic memory. The dynamic memory pool of the local
module must be set accordingly or the operation will fail with
the rfrspec.sts element set to negative three. The size of the
dynamic memory pool is set using the C Utility Program.
The remote module uses one module bus file (MBF) buffer for
each active transfer operation. If the selected section of the file
fits into an MBF buffer (i.e.: rfrspec.cnt is less than the MBF
buffer size), the remote file will lock the file only long enough to
read its contents into the MBF buffer. Otherwise, the remote
module will lock the file during the entire transfer operation. It
is recommended that the size of the MBF buffers is set large
enough to hold the largest amount of data to be transferred.
The local module does not use an MBF buffer for the transfer
operation. The MBF buffers are allocated using the C Utility
Program.
rfiler
5 - 38 I-E96-703A
MODULE SPECIFIC FUNCTIONS
rfiler
continued
void main(void)
{
static struct rfrspec rf;
static char buffer[2000];
rfiler
I-E96-703A 5 - 39
MODULE SPECIFIC FUNCTIONS ®
sysclk
sysclk
5 - 40 I-E96-703A
MODULE SPECIFIC FUNCTIONS
time_ms
PURPOSE: This function allows access to the absolute time of the module.
time_ms
I-E96-703A 5 - 41
MODULE SPECIFIC FUNCTIONS ®
time_ms
continued
void main(void)
{
struct fbbuf bin_buff; /* buffer for bin() */
struct bs_fc30 buffer; /* buffer for blk_wrt() */
char timestamp[12]; /* buffer for timestamp data */
long int status, config;
/*
Verify that module is formatted for INFI-NET communications and supports
timestamping. Then timestamp function code 30, an exception report block, at
block 100.
*/
time_ms
5 - 42 I-E96-703A
SECTION 6 - DEBUGGER PROGRAM
INTRODUCTION
PROGRAM OPERATION
2. Type:
Where:
INTRODUCTION
I-E96-703A 6-1
DEBUGGER PROGRAM ®
NOTE: The [port] and [baud] fields are optional and can be entered
in any order.
TPS0394A
Open... Select this option and enter the desired source file name. The
screen displays the specified file. Any source file that is part of
the program can be opened.
View... Select this option and specify any DOS or ASCII file in the
module directory. The screen displays the specified file.
PROGRAM OPERATION
6-2 I-E96-703A
DEBUGGER PROGRAM
TPS0395A
Next This option searches for the next occurrence of the text string.
This line of code is highlighted.
Previous This option searches for and highlights the last occurrence of
the text string.
TPS0396A
Segment... This option specifies a segment that has function code 143
specification one set to two and starts execution of the C pro-
gram in that segment. Activating the debugger for the first
time stops all C programs.
PROGRAM OPERATION
I-E96-703A 6-3
DEBUGGER PROGRAM ®
Step Over This option executes a function without stepping through each
line of the function.
Step Into This option is used to step through each line of a function
before proceeding to the next line of the program.
TPS0397A
Global add... This option displays a listing of all global variables and allows
selection of one variable.
Local add... This option displays a listing of all local variables and allows
selection of one variable.
Remove... This option removes the specified variable from the watch
window.
Delete all This option removes all variables from the watch window.
TPS0398A
PROGRAM OPERATION
6-4 I-E96-703A
DEBUGGER PROGRAM
TPS0399A
Configure module This option puts the module into configure mode.
Execute module This option puts the module into execute mode.
TPS0400A
PROGRAM OPERATION
I-E96-703A 6-5
DEBUGGER PROGRAM ®
Breakpoint poll rate: Specifiy the rate (in seconds) at which the debugger queries
the module for breakpoint status changes.
Global watch poll rate: Specify the rate (in seconds) at which the debugger queries the
module for global variable value changes.
Jump to breakpoint: This option moves the cursor to the breakpoint location in the
program. Specify on or off.
Single step segment: Specify the desired segment (0 - 7) for single step execution.
Full Watch information: This option controls the amount of information displayed in
the watch window. Answer on and the watch widow displays
the file name, scope, segment number, name, type, and value
of each variable selected. If applicable, the function being exe-
cuted is displayed also. Answer off and only the variable name
and value are displayed.
TPS0401A
PROGRAM OPERATION
6-6 I-E96-703A
SECTION 7 - SAMPLE APPLICATION
INTRODUCTION
INTRODUCTION
I-E96-703A 7-1
SAMPLE APPLICATION ®
void
main() /* entry point of program */
{
int filenumb; /* stores the file number */
int
get_number()
{
FILE *fp; /* used to verify file */
char buf[20]; /* buffer for user entry */
void
display_file(filenumb)
int filenumb;
{
FILE *fp; /* pointer to specified file */
int count = 0; /* rolling line count */
char fil[20]; /* file name for fopen() */
char buf[BUFLEN]; /* buffer for each file line */
printf("-------------------------\n");
fclose(fp); /* done, so close file */
}
Link the compiled files into one program file using a standard
DOS linker program (not provided). Name this linked program
file SAMPLE. This creates a SAMPLE.EXE file.
SAMPLE.EXE Enter
2. Type:
Where:
CUP Enter
SAMPLE F10
Loop Address = 1
PCU Address = 2
Module Address = 3
No. 1 = C:\CMFC\MAIN
No. 2 = C:\CMFC\GETNUMB
No. 3 = C:\CMFC\DISPFILE
12. Select B Edit User Memory Specs from the EDIT C SPECIFI-
CATIONS menu.
13. Enter the following information into the EDIT USER RAM
SPECIFICATIONS screen.
15. Select C Edit System Memory Specs from the EDIT C SPEC-
IFICATIONS menu.
16. Enter the following information into the EDIT SYSTEM RAM
SPECIFICATIONS screen.
The compiled source files must be linked into one program file.
The module must be in configure mode and have been refor-
matted with the format specifications. Finally, the program file
needs to be downloaded into the module. To link and download
the program file, perform the following steps.
8. Press F10 .
4. Press F10 .
Where:
The file system check function provides six options to the pro-
grammer. All options perform an entire file system check. In
addition, each option provides supplemental, specialized infor-
mation or actions. The options are as follows:
Where:
Where:
10, 000 20, 000
Total blocks = 2 + --------------------- (rounded up) + --------------------- (rounded up)
4096 4096
10, 000
+ --------------------- (rounded up) + 20,000
32
= 2 + 3 + 5 + 313 + 20,000
COPYING PROCEDURE
CFG Enter
BKUP Enter
EXE Enter
COPYING PROCEDURE
I-E96-703A C-1
APPENDIX D - AVAILABLE C LANGUAGE FUNCTIONS
FUNCTION LIST
Table D-1 lists all the C language functions that are available
to the IMMFC03, IMMFP01, IMMFP02, and IMMFP03 mod-
ules. Some of the functions listed are not available in all firm-
ware revisions of the specified modules.
Availability
Function IMMFC03 IMMFP01 IMMFP02 IMMFP03
Module Module Module Module
abs X X X X
acos X X X X
asin X X X X
atan X X X X
atan2 X X X X
atof X X X X
atoi X X X X
atol X X X X
bin X X X X
blk_wrt X X X X
bout X X X X
bsearch1 X X X X
calloc X X X X
ceil X X X X
checkpoint_ — — — X
file
close X X X X
clrerr X X X X
cos X X X X
cosh X X X X
cot X X X X
cpfil X X X X
creat X X X X
dadig_in — X X X
dasin X X X X
ecvt X X X X
eprintf1 X X X X
except X X X X
FUNCTION LIST
I-E96-703A D-1
AVAILABLE C LANGUAGE FUNCTIONS ®
Availability
Function IMMFC03 IMMFP01 IMMFP02 IMMFP03
Module Module Module Module
exp X X X X
fabs X X X X
fclose X X X X
fdopen X X X X
feof — X X X
ferror — X X X
fflush — X X X
fgetc X X X X
fgetpos1 X X X X
fgets X X X X
file- X X X X
filxfer X X X X
floor X X X X
fltr3 X X X X
flushall X X X X
fmod X X X X
fopen X X X X
fprintf X X X X
fputc X X X X
fputs X X X X
fread X X X X
free X X X X
freopen — X X X
frexp X X X X
fscanf X X X X
fseek X X X X
fsetpos1 X X X X
ftell X X X X
ftoa — X X X
fwrite X X X X
getargs X X X X
getc — X X X
getchar — X X X
getl1 X X X X
gets X X X X
getw1 X X X X
inque X X X X
FUNCTION LIST
D-2 I-E96-703A
AVAILABLE C LANGUAGE FUNCTIONS
Availability
Function IMMFC03 IMMFP01 IMMFP02 IMMFP03
Module Module Module Module
isalnum X X X X
isalpha X X X X
isascii — X X X
iscntrl X X X X
isdigit X X X X
isgraph — X X X
islower X X X X
isprint — X X X
ispunct — X X X
isspace X X X X
isupper X X X X
isxdigit X X X X
itoa — X X X
itostr — X X X
labs1 X X X X
ldexp X X X X
log X X X X
log10 X X X X
longjmp — X X X
lseek X X X X
ltoa — X X X
ltostr — X X X
malloc X X X X
mb_addr X X X X
memccpy — X X X
memchr — X X X
memclr — X X X
memcmp — X X X
memcpy — X X X
memmove1 X X X X
memset — X X X
modf X X X X
movmem X X X X
open X X X X
outque X X X X
perrror1 X X X X
portopen X X X X
FUNCTION LIST
I-E96-703A D-3
AVAILABLE C LANGUAGE FUNCTIONS ®
Availability
Function IMMFC03 IMMFP01 IMMFP02 IMMFP03
Module Module Module Module
pow X X X X
pow2 X X X X
printf X X X X
putargs X X X X
putc — X X X
putchar — X X X
putl1 X X X X
putmsg X X X X
puts X X X X
putw1 X X X X
qsort1 X X X X
r3flt X X X X
rand1 X X X X
read X X X X
realloc — X X X
remove1 X X X X
repmem X X X X
rewind1 X X X X
rfilef X X X X
rfiler X X X X
scanf X X X X
setbuf X X X X
setjmp — X X X
setmem X X X X
sin X X X X
sinh X X X X
sprintf X X X X
sqrt X X X X
srand1 X X X X
sscanf X X X X
stcd_i X X X X
stcd_l X X X X
stci_d X X X X
stcu_d X X X X
stpblk X X X X
stpchr X X X X
strcat X X X X
FUNCTION LIST
D-4 I-E96-703A
AVAILABLE C LANGUAGE FUNCTIONS
Availability
Function IMMFC03 IMMFP01 IMMFP02 IMMFP03
Module Module Module Module
strchr X X X X
strcmp X X X X
strcoll1 X X X X
strcpy X X X X
strcspn — X X X
strerror1 X X X X
strlen X X X X
strncat X X X X
strncmp X X X X
strncpy X X X X
strpbrk — X X X
strrchr X X X X
strspn — X X X
strstr1 X X X X
strtod1 X X X X
strtok — X X X
strtol — X X X
strtoul1 X X X X
swab — X X X
sysclk X X X X
tan X X X X
tanh X X X X
time_ms X X X X
toascii — X X X
tolower X X X X
toupper X X X X
trunc X X X X
ungetc X X X X
unlink X X X X
vfprintf1 X X X X
vprintf1 X X X X
vsprintf1 X X X X
write X X X X
zalloc — X X X
NOTE:
1. These functions are linked in from the BAILEY.LIB file on the workstation. These functions con-
sume user program memory space.
FUNCTION LIST
I-E96-703A D-5
Index
A F
Available C functions ..................................................D-1 filxfer function............................................................5-17
fltr3 function ..............................................................5-21
B Format specifications ..................................................4-6
Function block requirements.......................................1-2
bin function ................................................................. 5-1 Functions
blk_wrt function .......................................................... 5-3 bin .........................................................................5-1
bout function............................................................... 5-6 blk_wrt...................................................................5-3
bout .......................................................................5-6
C checkpoint_file ......................................................5-8
cpfil......................................................................5-10
C program management .......................................... 4-10 dadig_in...............................................................5-12
C specification files..................................................... 4-1 dasin....................................................................5-14
checkpoint_file function .............................................. 5-8 filxfer....................................................................5-17
cpfil function ............................................................. 5-10 fltr3 ......................................................................5-21
Created directroies and files....................................... 2-2 getargs ................................................................5-22
CUP inque ...................................................................5-24
C program management..................................... 4-10 mb_addr ..............................................................5-25
C specification files ............................................... 4-1 outque .................................................................5-26
Data file management......................................... 4-11 portopen ..............................................................5-27
Error messages .................................................. 4-17 putargs ................................................................5-31
Format specification.............................................. 4-6 putmsg ................................................................5-32
Linker command file.............................................. 4-8 r3flt ......................................................................5-33
Main menu ............................................................ 4-2 rfilef .....................................................................5-34
Modem usage ..................................................... 4-13 rfiler .....................................................................5-37
Module management ............................................ 4-8 sysclk ..................................................................5-40
Object file list ........................................................ 4-4 time_ms...............................................................5-41
System memory specifications ............................. 4-5
User memory specifications.................................. 4-4
CUP error messages ................................................ 4-17
G
getargs function ........................................................5-22
D Glossary......................................................................1-4
I-E96-703A Index - 1
®
Index (continued)
Index - 2 I-E96-703A
For prompt, personal attention to your instrumentation and control needs or a full listing of
Bailey representatives in principal cities around the world, contact the Bailey location nearest you.
France Norway
Elsag Bailey S.A. Bailey Norge A.S.
Massy Bergen
Phone: 33-1-64-47-2000 Phone: 47-55-222-000
Telefax: 33-1-64-47-2016 Telefax: 47-55-222-010
Italy Singapore
Elsag Bailey Elsag Bailey Pte. Ltd.
Genoa Singapore
Phone: 39-10-658-1 Phone: 65-442-3200
Telefax: 39-10-658-2941 Telefax: 65-442-2700