Sei sulla pagina 1di 590

Using SIMVOX Real Time

Simulation Software for PCs


and AXP Workstations

This manual applies to Type SPE311 and Type SPE312 SIMVOX


Process Simulation Software.

User Manual
UM25.0:SPE311
Original September 1995
D4U01321002
ENVOX, Instrument Information System, PROFLEX, PROVOX, PROVUE, and RS3 are marks of one
or more of the Fisher-Rosemount group of companies.

SIMVOX is a registered mark of Munger Company, Inc.


Other marks are the property of their respective owners.

Fisher-Rosemount Systems, Inc. 1995. All rights reserved.


Printed in USA

The contents of this publication are presented for informational purposes only, and while every effort
has been made to ensure their accuracy, they are not to be construed as warranties or guarantees,
express or implied, regarding the products or services described herein or their use or applicability. We
reserve the right to modify or improve the designs or specifications of such products at any time without
notice.
SIMVOX -- Version 2.3

Table of Contents
1.0 Introduction to SIMVOX . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
1.1 What is SIMVOX? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
Figure 1.1 Real I/O vs. SIMVOX . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
Figure 1.2a Real I/O vs. SIMVOX for Allen Bradley PLC3 . . . . . . . . . . . . . . 4
Figure 1.2b Simulated I/O vs. SIMVOX for Allen Bradley PLC3 . . . . . . . . . . 4
Figure 1.3a Real I/O vs. SIMVOX for Allen Bradley PLC5 . . . . . . . . . . . . . . 5
Figure 1.3b Simulated I/O vs. SIMVOX for Allen Bradley . . . . . . . . . . . . . . . 5
Figure 1.4a Real I/O vs. SIMVOX for Modicon MODBUS . . . . . . . . . . . . . . 6
Figure 1.4b Simulated I/O vs. SIMVOX for Modicon MODBUS . . . . . . . . . . 6
Figure 1.5a Real I/O vs. SIMVOX for Modicon MODBUS + . . . . . . . . . . . . . 7
Figure 1.5b Simulated I/O vs. SIMVOX for Modicon MODBUS + . . . . . . . . 7
Figure 1.6a Real I/O vs. SIMVOX for TI Siemens . . . . . . . . . . . . . . . . . . . . . 8
Figure 1.6b Simulated I/O vs. SIMVOX for TI Siemens . . . . . . . . . . . . . . . . . 8
Figure 1.7a Real I/O vs. SIMVOX for GE Series 6 . . . . . . . . . . . . . . . . . . . . . 9
Figure 1.7b Simulated I/O vs. SIMVOX for GE Series 6 . . . . . . . . . . . . . . . . 9
Figure 1.8a Real I/O vs. SIMVOX for Rosemount RS3 . . . . . . . . . . . . . . . . . . 10
Figure 1.8b Simulated I/O vs. SIMVOX for Rosemount RS3 . . . . . . . . . . . . . 10
1.1.1 SIMVOX -- Controller Communications . . . . . . . . . . . . . . . . . . . . . . . . . 11
1.1.2 SIMVOX Operations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
1.1.3 Simulations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
1.2 Why SIMVOX? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
1.3 About the Manual . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
1.4 Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
2.0 Computer System Requirements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
3.0 SIMVOX Installation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
3.1 Installation of hardware on Windows NT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
3.1.1 Serial Card Installation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
3.1.2 Adding COM ports to Windows NT . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22
3.2 Installation of hardware on OpenVMS AXP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
3.2.1 RS232 Ports Installation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
3.2.2 Terminal Server and VAX LAT Port Configuration . . . . . . . . . . . . . . . . 23
3.2.2.1 Terminal Server Configuration . . . . . . . . . . . . . . . . . . . . . . . . . 23
3.2.2.2 VAX LAT Port Configuration . . . . . . . . . . . . . . . . . . . . . . . . . . 26
3.3 Installation of software on Windows NT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28
3.3.1 Copying the Software to your hard disk . . . . . . . . . . . . . . . . . . . . . . . . . 28
3.3.2 Windows NT Registry changes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28
3.3.3 Windows NT Tasking changes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30
3.3.4 Installing VAX/HP utilities . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30
3.4 Installation of software on OpenVMS AXP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32

Original September 1995 1


UM25.0:SPE311
SIMVOX -- Version 2.3

3.5 Architecture/Installation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36
3.5.1 PROVOX E/I Card . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36
3.5.2 PROVOX IDI Card . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39
3.5.3 Allen Bradley PLC3 & PLC5 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40
3.5.4 Modicon MODBUS & MODBUS+ . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41
3.5.5 TI565 (NITP) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42
3.6 Cable Connections . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43
4.0 SIMVOX Functionality . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47
4.1 SIMVOX Main Menu . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48
Communications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48
Tools . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49
Simulation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51
Help . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53
Exit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53
4.2 Modify SIO File . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54
Modify Menu Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54
File . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54
Edit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55
Help . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56
4.3 Tieback . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57
Tieback Menu Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57
File . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57
Edit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59
Tools . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61
Help . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62
4.4 Tags . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63
Tags Menu Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63
File . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63
Edit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65
Tools . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 67
Help . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 67
4.5 Calculations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 69
Calculations Menu Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 69
File . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 69
Edit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71
Tools . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 72
Help . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 73
4.6 Manipulate by Channel . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 74
Manipulate Menu Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 74
Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 74
Tools . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 75
Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 75
Help . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 77

Original September 1995 2


UM25.0:SPE311
SIMVOX -- Version 2.3

5.0 Programmatic Access . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 78


5.0.1 Analog I/O . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 79
5.0.2 Discrete I/O . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 80
5.0.3 Discrete Control Devices . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 81
5.0.4 Loops . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 83
5.0.5 Pulse Count Inputs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 85
5.0.6 Time Proportional Outputs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 85
5.0.7 Miscellaneous . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 85
6.0 Using SIMVOX . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 87
6.1 Using Built--In SIMVOX Functionality . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 88
6.1.1 Generating Simulated I/O Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 88
6.1.2 Building Tieback Objects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 90
6.1.2.1 Generating Tieback CDV files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 90
6.1.2.2 Loading Tieback CDV files . . . . . . . . . . . . . . . . . . . . . . . . . . . 92
6.1.2.3 Discrete Control Device Detail Dialog . . . . . . . . . . . . . . . . . . . 93
6.1.2.4 Assigning Discrete Control Device personality . . . . . . . . . . . . 94
6.1.2.5 Loop Detail Dialog . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 97
6.1.2.6 Assigning Loop evaluation condition . . . . . . . . . . . . . . . . . . . . 98
6.1.2.7 Assigning Loop personality . . . . . . . . . . . . . . . . . . . . . . . . . . . 101
6.1.2.7.1 Level Loop . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 103
6.1.2.7.2 Temperature Loop . . . . . . . . . . . . . . . . . . . . . . . . . . . 107
6.1.2.7.3 Pressure Loop . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 110
6.1.2.7.4 Other Loop . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 112
6.1.2.8 Controlling Tieback Execution . . . . . . . . . . . . . . . . . . . . . . . . . 112
6.1.3 Building Tag Objects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 113
6.1.3.1 Generating Tag CDV files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 113
6.1.3.2 Loading Tag CDV files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 115
6.1.3.3 Tag Detail Dialog . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 116
6.1.3.4 Assigning Tag evaluation condition . . . . . . . . . . . . . . . . . . . . . 117
6.1.3.5 Assigning Tag personality . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 120
6.1.3.5.1 Analog Input -- Level Tag . . . . . . . . . . . . . . . . . . . . . 121
6.1.3.5.2 Analog Input -- Temperature Tag . . . . . . . . . . . . . . . . 125
6.1.3.5.3 Analog Input -- Pressure Tag . . . . . . . . . . . . . . . . . . . 127
6.1.3.5.4 Analog Input -- Other Tag . . . . . . . . . . . . . . . . . . . . . 128
6.1.3.5.5 Discrete Input -- Switch Tag . . . . . . . . . . . . . . . . . . . . 128
6.1.3.5.6 Discrete Input -- Other Tag . . . . . . . . . . . . . . . . . . . . . 130
6.1.3.5.7 Pulse Count Input -- Meter Tag . . . . . . . . . . . . . . . . . 130
6.1.3.7 Controlling Tag Execution . . . . . . . . . . . . . . . . . . . . . . . . . . . . 132
6.1.4 Building Calculation Objects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 133
6.1.4.1 Creating Calculations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 134
6.1.4.1.1 Add . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 134
6.1.4.1.2 Modify . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 135
6.1.4.1.3 Delete . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 136
6.1.4.2 Loading Calculation CDV files . . . . . . . . . . . . . . . . . . . . . . . . 137
6.1.4.3 Calculations Detail Dialog . . . . . . . . . . . . . . . . . . . . . . . . . . . . 138

Original September 1995 3


UM25.0:SPE311
SIMVOX -- Version 2.3

6.1.4.4 Calculation Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 139


6.1.4.4.1 Mathematical functions . . . . . . . . . . . . . . . . . . . . . . . . 139
6.1.4.4.2 Process functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . 143
6.1.4.4.3 Operators . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 149
6.2 Developing Tiebacks/Models as External Program . . . . . . . . . . . . . . . . . . . . . . . . 150
6.2.1 Porting existing code to SIMVOX . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 150
6.2.2 Compiling/Linking your Tieback/Model . . . . . . . . . . . . . . . . . . . . . . . . . 152
6.2.3 Spreadsheet access to SIMVOX via DDE . . . . . . . . . . . . . . . . . . . . . . . . 153
6.2.3.1 Reading from SIMVOX via DDE . . . . . . . . . . . . . . . . . . . . . . . 154
6.2.3.2 Writing to SIMVOX via DDE . . . . . . . . . . . . . . . . . . . . . . . . . 155
7.0 Problems and Solutions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 157
8.0 Examples . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 159
8.1 Level Model Definition . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 159
8.1.1 Level Model Steps . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 160
8.2 Temperature Model Definition . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 164
8.2.1 Temperature Model Steps . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 165
Appendix A -- PROVOX EIC and IDI API . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . A--1
Appendix B -- PROVOX VIOC (DM6004) API . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . B--1
Appendix C -- Allen Bradley PLC3 and PLC5 API . . . . . . . . . . . . . . . . . . . . . . . . . . . . C--1
Appendix D -- Modicon API . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . D--1
Appendix E -- TI/Seimens API . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . E--1
Appendix F -- Error Messages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . F--1
Appendix G -- Modeling Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . G--1
Appendix H -- Address Schemes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . H--1

Original September 1995 4


UM25.0:SPE311
SIMVOX -- Version 2.3

1.0 Introduction to SIMVOX


SIMVOX is a package of software process simulation tools, residing in Windows NT and
OpenVMS AXP operating systems. Simulation is defined as the modeling of a process.

Process simulation has many advantages. Primarily, simulations mimic process conditions,
enabling engineers to answer a number of important questions about their process prior to
start--up, such as:

D How does the process respond to changes in inputs?

D Are the logical operating rules correct and adequate for this process?

D Are the failure sequences valid for all possible upset conditions?

D How will the operators adapt to the display interface?

... and many more. The answers, in turn, enable the engineer to better understand the process
through the Distributed Control System (DCS) or PLC system, expedite analysis of the
configuration, test desirability of system modifications and consequently, start up the DCS or
PLC faster.

SIMVOX simulation tools are designed to enable the engineer to answer these questions faster,
and more accurately than ever before.

Original September 1995 1


UM25.0:SPE311
SIMVOX -- Version 2.3

1.1 What is SIMVOX?


SIMVOX is a software environment with built--in process modeling tools which, together with
user written models, comprise a process environment. In this environment, the process
configuration may be observed and analyzed. User written models are defined as the following:

1. Configuring personalities of Discrete Devices, Loops, and objects comprising Flow, Level,
Temperature and Pressure without programming in 3GL (3rd Generation Languages, i.e., C,
FORTRAN, Pascal, etc.), within the modeling environment provided by SIMVOX.

2. Exercising full control over behavior of each modeled object within the environment from the
workstation. Specifically, Point--and--Click access to object parameters as they are being
executed in the background, on--line modification and the ability to view results immediately.

3. Seamless integration of special, process specific object handling specified as 3GL programs
(if necessary) or spreadsheet calculations. External programs access the SIMVOX environment
and affect the built--in models via the programming API (section 5.0). Spreadsheets, e.g., Excel
may access the SIMVOX environment via DDE (section 6.2.3.). Similarly, the SIMVOX
graphical front end (Real Time Vision Pro) may access the SIMVOX environment via DDE.

The following subsections are a brief overview of the SIMVOX environment, with figures
depicting SIMVOX vs. real I/O and simulated I/O.

Original September 1995 2


UM25.0:SPE311
SIMVOX -- Version 2.3

DataHighway
SR 90 Controller
20 -- Series Controller
124 DEGREES
External Interface Card 40 GPMC
I / O Card File
64% LEVEL
I/O Termination Panels 1200 LBS
RS232C
AI
Continuation of
I / O Bus AO

Interface Cable DI/DO

DataHighway
SR 90 Controller
20 -- Series Controller
External Interface Card
I / O Card File

Interface Cable
Continuation of
SIMVOX
I / O Bus Workstation

SIMVOX SOFTWARE
SIM CONFIGURATION UTILITY
TIEBACK/MODEL:
DCD, SIMPLE LOOPS,
Mass & Energy Balance

Figure 1.1 Real I/O vs. SIMVOX

Original September 1995 3


UM25.0:SPE311
SIMVOX -- Version 2.3

RS232 Front Panel Channel 0 Port

SIMVOX PLC3
Workstation
Remote I/O

Actual Plant Equipment


SIMVOX SOFTWARE
SIM CONFIGURATION UTILITY AI
TIEBACK/MODEL: AO
DCD, SIMPLE LOOPS,
Mass & Energy Balance DI/DO

Figure 1.2a Real I/O vs. SIMVOX for Allen Bradley PLC3

RS232 Front Panel Channel 0 Port

SIMVOX
PLC3
Workstation

Remote I/O Disabled

SIMVOX SOFTWARE
SIM CONFIGURATION UTILITY
TIEBACK/MODEL:
DCD, SIMPLE LOOPS,
Mass & Energy Balance

Figure 1.2b Simulated I/O vs. SIMVOX for Allen Bradley PLC3

Original September 1995 4


UM25.0:SPE311
SIMVOX -- Version 2.3

RS232

SIMVOX
Workstation
1785 KE/KF 1770 KF2

SIMVOX SOFTWARE DataHighway Plus


SIM CONFIGURATION UTILITY
TIEBACK/MODEL:
DCD, SIMPLE LOOPS,
Mass & Energy Balance

PLC5 PLC5
Remote I/O Remote I/O

Actual Plant Equipment Actual Plant Equipment


AI AI
AO AO
DI/DO DI/DO

Figure 1.3a Real I/O vs. SIMVOX for Allen Bradley PLC5

RS232

SIMVOX
Workstation
1785 KE/KF 1770 KF2

SIMVOX SOFTWARE
SIM CONFIGURATION UTILITY DataHighway Plus
TIEBACK/MODEL:
DCD, SIMPLE LOOPS,
Mass & Energy Balance

PLC5 PLC5

Remote I/O Disabled Remote I/O Disabled

Figure 1.3b Simulated I/O vs. SIMVOX for Allen Bradley

Original September 1995 5


UM25.0:SPE311
SIMVOX -- Version 2.3

RS232

SIMVOX
Modicon MODBUS
Workstation
Remote I/O

Actual Plant Equipment

AI
SIMVOX SOFTWARE
AO
SIM CONFIGURATION UTILITY
TIEBACK/MODEL: DI/DO
DCD, SIMPLE LOOPS,
Mass & Energy Balance

Figure 1.4a Real I/O vs. SIMVOX for Modicon MODBUS

RS232

SIMVOX Modicon MODBUS


Workstation
Remote I/Odisabled

SIMVOX SOFTWARE
SIM CONFIGURATION UTILITY
TIEBACK/MODEL:
DCD, SIMPLE LOOPS,
Mass & Energy Balance

Figure 1.4b Simulated I/O vs. SIMVOX for Modicon MODBUS

Original September 1995 6


UM25.0:SPE311
SIMVOX -- Version 2.3

MODBUS + end--to--end cable

SIMVOX Modicon MODBUS +


Workstation
SA85 Remote I/O

Actual Plant Equipment

AI
AO
SIMVOX SOFTWARE
SIM CONFIGURATION UTILITY DI/DO
TIEBACK/MODEL:
DCD, SIMPLE LOOPS,
Mass & Energy Balance

Figure 1.5a Real I/O vs. SIMVOX for Modicon MODBUS +

MODBUS + end--to--end cable

SIMVOX
Modicon MODBUS +
Workstation
SA85 Remote I/O Disabled

SIMVOX SOFTWARE
SIM CONFIGURATION UTILITY
TIEBACK/MODEL:
DCD, SIMPLE LOOPS,
Mass & Energy Balance

Figure 1.5b Simulated I/O vs. SIMVOX for Modicon MODBUS +

Original September 1995 7


UM25.0:SPE311
SIMVOX -- Version 2.3

Front Panel Port


RS232
SIMVOX TI Siemens
Workstation
Remote I/O

Actual Plant Equipment

AI
SIMVOX SOFTWARE AO
SIM CONFIGURATION UTILITY
TIEBACK/MODEL: DI/DO
DCD, SIMPLE LOOPS,
Mass & Energy Balance

Figure 1.6a Real I/O vs. SIMVOX for TI Siemens

Front Panel Port

RS232
SIMVOX
TI Siemens
Workstation
Remote I/O Disabled

SIMVOX SOFTWARE
SIM CONFIGURATION UTILITY
TIEBACK/MODEL:
DCD, SIMPLE LOOPS,
Mass & Energy Balance

Figure 1.6b Simulated I/O vs. SIMVOX for TI Siemens

Original September 1995 8


UM25.0:SPE311
SIMVOX -- Version 2.3

CCM Module RS232 port

SIMVOX GE Series 6
Workstation
RemoteI/O

Actual Plant Equipment

AI
SIMVOX SOFTWARE
AO
SIM CONFIGURATION UTILITY
TIEBACK/MODEL: DI/DO
DCD, SIMPLE LOOPS,
Mass & Energy Balance

Figure 1.7a Real I/O vs. SIMVOX for GE Series 6

CCM Module RS232 port

SIMVOX
GE Series 6
Workstation

Remote I/O Disabled

SIMVOX SOFTWARE
SIM CONFIGURATION UTILITY
TIEBACK/MODEL:
DCD, SIMPLE LOOPS,
Mass & Energy Balance

Figure 1.7b Simulated I/O vs. SIMVOX for GE Series 6

Original September 1995 9


UM25.0:SPE311
SIMVOX -- Version 2.3

Peerway

RS3 Control File

Remote I/O

Actual Plant Equipment

AI
AO
DI/DO

Figure 1.8a Real I/O vs. SIMVOX for Rosemount RS3

Peerway

RS3 Control File RS3 Control File

Special Hardware Special Hardware

SIMVOX
Workstation
Remote I/O Disabled

SIMVOX SOFTWARE
SIM CONFIGURATION UTILITY
TIEBACK/MODEL:
DCD, SIMPLE LOOPS,
Mass & Energy Balance

Figure 1.8b Simulated I/O vs. SIMVOX for Rosemount RS3

* SIMDI is the SIMVOX Device Interface (Intelligent I/O card for RS--485 communications).

Original September 1995 10


UM25.0:SPE311
SIMVOX -- Version 2.3

1.1.1 SIMVOX -- Controller Communications

SIMVOX represents the process. Consequently, control information must be supplied by a


controller. For SIMVOX, a controller may be one or more of the following devices:

1. PROVOX SR90 UOC+ and IFC;


2. PROVOX 10 Series UOC and IFC;
2. Allen Bradley PLC 3 and PLC 5;
3. Modicon PLC;
4. TI Siemens -- TI565 PLC;
5. GE Series 6; and
6. Rosemount RS3.

In SIMVOX, control information is received/read from the control device and process
information is sent/written back to the control device. The process model can only access the
control information as read only. Based on the control information, the process behavior
changes and new information is sent back to the control device. Communication between the
Controller and SIMVOX is accomplished via serial COM ports or special hardware as described
in the following table:

Controller Platform Controller SIMVOX Communication


Communication Device Device
PROVOX EIC Serial COM Port
PROVOX IDI Serial COM Port
PROVOX VIOC Serial COM Port
Allen Bradley PLC3 Channel 0 port Serial COM Port
Allen Bradley PLC5 1770--KF2 or 1785--KE/KF Serial COM Port
Modicon 984 MODBUS port Serial COM Port
Modicon 984 MODBUS+ port SA--85 card
TI--565 Front Panel--RS232 port Serial COM Port
GE Series 6 CCM Module--RS232 port Serial COM Port
Rosemount RS3 RS3 Communications Con- SIMDI -- Intelligent I/O
trollers card

For example, for the PROVOX/EIC connection to SIMVOX, the External Interface (E/I) card is
installed in a Control Input/Output Card File. The card files Power/Communication card is then
connected to the I/O Driver Board of a Unit Operations Controller plus (UOC+), an Integrated
Function Controller (IFC) or an SR90 Controller. Finally, the top serial port on the E/I card is
connected to an RS--232 COM port on the Workstation that has SIMVOX installed in it.

Original September 1995 11


UM25.0:SPE311
SIMVOX -- Version 2.3

Establishment of communication between SIMVOX and the E/I card is accomplished by first
creating a simulated I/O configuration file. SIMVOX provides this operation through a menu
selection. This disk--resident I/O configuration file details the I/O channel types to be simulated
and should conform to the channel definitions in the Controller. SIMVOX then communicates
with the Controller through the E/I card. The simulated I/O channels appear as physical
hardware to the Controller. Consequently, to the Controller, there is no difference between
SIMVOX generated signals and real field I/O.

Similarly, for PLC controllers, a disk--resident I/O configuration file detailing maximum table
sizes is utilized.

For RS3, a special intelligent I/O interface card (SIMDI, SIMVOX Device Interface) is used. On
the RS3 side, each SIMDI communicates to 16 RS--485 communications lines. Specifically, each
RS3 File has 8 controllers and each controller has 8 RS--485 communications lines which are
brought out to the Comm Term Panel. From the Comm Term Panels, one, two or more lines per
controller are connected to each SIMDI, with a maximum of 16 lines per SIMDI. On the
SIMVOX side, SIMDI communicates with the SIMVOX I/O driver. Similar to other platforms, a
disk resident file is used to describe the I/O configuration to be simulated.

1.1.2 SIMVOX Operations


The SIMVOX database of I/O channel values reflects the current state of the process being
simulated as it appears to a Controller. This state may be monitored by the user through a menu
selection in SIMVOX. The user may also monitor the process state from the DCS console, e.g.,
Provue on the PROVOX highway. SIMVOX displays values of output channels as the controller
performs its functions. Similarly, input channels or process information is displayed.

Original September 1995 12


UM25.0:SPE311
SIMVOX -- Version 2.3

1.1.3 Simulations
Simulations are specified directly through the SIMVOX user interface. There are three different
subsystems which affect and control the modeling of various objects. These are:

1. Control Device Tieback;


2. Non Control Device Tags; and
3. Calculations.

These subsystems are discussed in detail in section 4 (for navigation) and section 6 (for
modeling configuration).

To allow user written simulations as external 3GL programs to read from and write to I/O
channels, SIMVOX provides a library of callable subroutines. Functionally, simulations are
partitioned as tiebacks and models.

Tieback applications are generally used to resolve Discrete Control Devices and simulate
single--input, single--output loop tag operations. In both cases the outputs are tied back in
software to the inputs, hence the name. In the case of Discrete Device tiebacks, a template is
used as a pattern for issuing changes to inputs corresponding to changes in output (setpoint). For
loop tiebacks, analog output channels are tied to analog input channels in software.

Models, on the other hand, emulate the actual process and may be simple or complex.
Simulation of a single input such as a limit switch closure based upon a level is an example of a
simple model. More complex models may be programmed to emulate process conditions based
upon predetermined equipment status in system dynamics. The level of simulation complexity is
restricted only by the computing power of the SIMVOX Workstation.

Original September 1995 13


UM25.0:SPE311
SIMVOX -- Version 2.3

1.2 Why SIMVOX?


SIMVOX provides all the tools necessary to simulate a process without utilizing the actual
physical I/O of the DCS or PLC. Thus, it is ideally suited for process modeling, configuration
checkout, and training.

FEATURE BENEFIT
Configurable tieback simulation Eliminates need for
through software. hardwired switches and
signal generators to perform
tieback.

Emulation of the I/O for up to 8 A large number of


controllers. (Depending on controllers can be
selected simulation computer). simultaneously simulated.

No physical I/O cards needed The I/O system can be


shipped early to the plant
site for field wiring.

Windows user interface with Easy to use.


point and click access.

Supports process modeling. Extensive models can be


programmed to mimic a real
process.

Configuration checkout. Faster and cheaper

Simulations provide a training Hands on, realistic environment


tool. for operator training.

Complete checkout of control Reduction of startup time.


strategies.
Supports simulation of hybrid Comprehensive checkout,
systems testing and training

Original September 1995 14


UM25.0:SPE311
SIMVOX -- Version 2.3

1.3 About the Manual


Section 1 of this manual is an introduction and brief overview of SIMVOX. It may be freely
copied and used as an aid in specifying SIMVOX for projects.

The remainder of the manual is intended for Process Engineers and Simulation Programmers
with an understanding of the host operating systems (Windows NT and OpenVMS AXP), menu
driven systems, inter--computer communications and any 3GL programming language. The
thrust is to facilitate rapid understanding, installation and productive use of SIMVOX. From that
standpoint, various problem scenarios and troubleshooting aids are given.

Section 2 of this manual describes the computer system requirements for SIMVOX. Section 3
guides the user through the installation process of both software and hardware. SIMVOX
functionality is described in detail in Section 4. The syntax of each command, its parameters and
its result is given. Then in Section 5, functionality of SIMVOX library subroutines is discussed.

In sections 4 and 6, the user is given a flavor of how to use the various menus to specify a
simulation. Examples are presented for Tiebacks of different types, and models of different
types. Additionally, for external programs, the user is guided through compilation and linking
of model/tieback programs.

In section 7, various communication and configuration problem situations are discussed and their
solutions are proposed.

The Examples section (section 8) comprises models of various complexities and types. This
section is intended such that new example sheets may be inserted to add to your library of
solutions using SIMVOX.

Original September 1995 15


UM25.0:SPE311
SIMVOX -- Version 2.3

1.4 Summary
The use of SIMVOX and its integration into projects has produced many positive results.
SIMVOX provides comprehensive and quality results on current and future control system
configuration, testing, and operator training projects.

PROVOX and RS3 are registered trade marks of Fisher--Rosemount Systems, Inc.
Windows and Windows NT are registered trade marks of Microsoft Corporation.
DEC, Alpha, AXP and OpenVMS are registered trade marks of Digital Equipment Corporation.
SIMVOX is a registered trade mark of Munger Company, Inc.
Munger Company, Inc. acknowledges all other tradenames and trademarks used in this document as the property of their respective owners.

Original September 1995 16


UM25.0:SPE311
SIMVOX -- Version 2.3

2.0 Computer System Requirements


SIMVOX runs on Windows NT and OpenVMS AXP Workstations. Under Windows NT, a 486
DX2/66 is the minimum requirement; a Pentium PC is recommended. Alternatively, a DEC
Alpha PC may be used. SIMVOX is also available under DEC Alpha machines running
OpenVMS AXP operating system. SIMVOX supports simulation of a maximum of eight (8)
controllers depending on the computer selected. The following table delineates the relationship:

Computer Platform Maximum Controllers

Intel 486 DX2/66 -- Windows NT 4


Pentium -- Windows NT 6
DEC Alpha PC 150 MHz -- Windows NT 8
and OpenVMS AXP
DEC Alpha Workstation -- OpenVMS AXP 8

In general, the following is the list of lowest level Intel--based hardware required to use
SIMVOX.

486 DX2 66 MHz PC minimum (Pentium recommended)


16 Meg Memory minimum (32 recommended)
500 Meg hard disk drive minimum
VGA color monitor
Mouse/Pointer device
Network connectivity hardware (as needed, 3COM suggested)
1--4 serial ports using 16550 UARTs
DigiBoard manufactures these. What you need is a Serial Comm board with 4
ports and the associated cable. DigiBoard part numbers are as follows:

ISA bus -- CM--DGB--77000003 PC/4


CM--DGB--76000008 Cable Assembly 4 port DB25

EISA bus -- DigiPC4E -- 74000737 with cable assembly

The following additional software will be required on the PC:

Windows NT 3.5 or later


Sybase Open Client and Net--Library (if direct network link is required between
SIMVOX workstation and the PROVOX configuration system, ENVOX).

Original September 1995 17


UM25.0:SPE311
SIMVOX -- Version 2.3

In order to port existing simulation code into the Windows NT environment, one or both of the
following compilers will be required:

Microsoft C/C++ 32 bit compiler for Windows NT; or


Microsoft PowerStation FORTRAN compiler for Windows NT
DEC C Compiler for OpenVMS AXP

Note that compilers are primarily required if you are porting existing VAX simulation code to
the Windows NT or OpenVMS AXP Workstation. Please refer to Section 6 where porting issues
are addressed. Additionally, a compiler may be required if special process conditions must be
handled which are not available in the built--in SIMVOX environment.

NOTE

Software functionality under both Windows NT and


OpenVMS AXP is identical. Consequently in this
manual, only the differences between the two platforms
are addressed, e.g., installation.

Original September 1995 18


UM25.0:SPE311
SIMVOX -- Version 2.3

3.0 SIMVOX Installation


SIMVOX installation comprises hardware setup and software loading.
For Windows NT, SIMVOX software is distributed on 3.5 high density diskettes, with an
installation program.

For OpenVMS AXP, the SIMVOX software is distributed on 4mm tape. Customers can request
distribution on 8mm tapes or TK50 CompacTapes. The standard OpenVMS backup utility must
be used to restore the files from tape to disk.

The following sections detail the required steps.

Original September 1995 19


UM25.0:SPE311
SIMVOX -- Version 2.3

3.1 Installation of hardware on Windows NT

3.1.1 Serial Card Installation

The following serial card configuration instructions are specific for the DigiBoard manufactured
DigiCHANNEL PC/4 cards (ISA bus). Furthermore, the configuration of the serial card should
conform to whatever other devices are already included in the Workstation.

NOTE

For EISA bus cards, follow manufacturers instructions


to configure the board. Additionally, DigiBoard has spe-
cial drivers which must be used with EISA bus cards
under Windows NT. Please contact your DigiBoard rep-
resentative for these, or call Munger Company Inc. for
assistance.

Prior to installing the serial card, it must be configured. Configuring the serial card comprises the
following steps:

a. Assigning Status Register address;


b. Assigning I/O port addresses;
c. Selecting and configuring the IRQ (Interrupt Request); and
d. Configuring port jumpers.

Note that with few exceptions, all the DigiBoard factory settings will be adequate for SIMVOX.
These are noted as follows. For hardware specific details, please refer to the DigiBoard
documentation you received with the serial card.

a. Status Register address.

The factory setting for the serial card is 140h. This does not need to be changed. The status
register is the leftmost bank of rocker/dip switches on the serial card.

D switches 1--7 specify the address and should be (left to right for 140h)
ON OFF ON OFF ON ON ON

D switches 8 and 9 should always be ON

Original September 1995 20


UM25.0:SPE311
SIMVOX -- Version 2.3

D switch 10 enables/disables the status register. It should always be ON.

b. I/O port addresses.

The factory settings for the serial card are:

D Port 1 100h
D Port 2 108h
D Port 3 110h
D Port 4 118h

No change is required to the I/O port addresses. There are four banks of rocker/dip switches on
the serial card, next to the status register switches. For factory settings, these should be as
follows (left to right):

Port 1 ON OFF ON ON ON ON ON ON
Port 2 ON OFF ON ON ON ON OFF ON
Port 3 ON OFF ON ON ON OFF ON ON
Port 4 ON OFF ON ON ON OFF OFF ON

Note that switch 8 is the enable/disable switch for the port. It must always be ON.

c. Selection of the IRQ (Interrupt Request)

Factory setting for the serial card is IRQ3. This must be changed. SIMVOX recommended
setting is IRQ5 (but this is dependent on existing devices and their use of the IRQ lines). Please
follow manufacturers instructions.

d. Jumper locations.

For the DigiBoard, you must configure two jumpers. These are the Odd/Even interrupt jumpers
and the Board Id jumper.

If the selected IRQ is even, then configure the even jumpers by placing the shunt on pins 2 & 3
of J1--8. If the selected IRQ is odd, then configure the odd jumpers by placing the shunt on pins
1 & 2 of J1--8.

The factory setting for the board ID is 0. No change is required for SIMVOX. SIMVOX
currently supports only 1 serial card for communications.

Original September 1995 21


UM25.0:SPE311
SIMVOX -- Version 2.3

3.1.2 Adding COM ports to Windows NT


After configuring the serial card, it should be installed into the workstation, and the workstation
rebooted. When Windows NT has completed booting, COM ports relative to the serial card
should be added to the system. This task is performed from the Control Panel icon in the Main
group of the Program Manager. The following steps should be performed:

a. Double click on the control panel icon. This will display the control panel group. Now double
click on the Ports icon. The Ports dialog box will be displayed with the existing COM ports.

b. Press the Add push--button. The Advanced Setting for the New Port dialog box will be
displayed. The COM port number of the next available port will also be displayed. Select this
number.

c. Next enter the Base I/O port address of the COM port. This will be 100h, 108h, 110h and 118h
for the 4 ports, respectively.

d. Now specify the IRQ selected and configured on the serial card.

e. Lastly, select the FIFO checkbox.

f. Press the OK push--button to add the COM port to the system. Windows NT will now prompt
you to reboot the system or not. Wait to reboot after all COM ports have been added. Add the
remaining 3 ports in the same manner, specifying their port number and port address. After this,
reboot the system.

Original September 1995 22


UM25.0:SPE311
SIMVOX -- Version 2.3

3.2 Installation of hardware on OpenVMS AXP


On OpenVMS, asynchronous RS232 ports must be used for SIMVOX communications with
controller devices. Various RS232 port cards are available from Digital Equipment Corp. and
third party suppliers for the AXP systems. Additionally, SIMVOX has built--in capability for
communications through terminal servers. This is detailed in section 3.2.2.

3.2.1 RS232 Ports Installation


Please refer to manufacturer and DEC documentation.

3.2.2 Terminal Server and VAX LAT Port Configuration


SIMVOX allows VAX controller device communications through LAT--compatible terminal
servers such as the DECserver 200.
The following sections provide information on how to configure your terminal server and VAX
LAT port for use with SIMVOX. It assumes that you are familiar with terminal server
commands, the LATCP utility, and the DCL SET TERMINAL command.

NOTE:
Munger Company, Inc. does not support this feature
because of SIMVOXs inability to enforce strict timing
constraints on local area network communications. We
would appreciate any feedback of your success or
failure.

3.2.2.1 Terminal Server Configuration


When using normal serial ports, SIMVOX requires setting various communication parameters
such as the baud rate, frame size, and parity. Since it is not possible to set these parameters
programmatically for terminal server ports, you must do so manually. First, you must get to the
terminal server Local prompt. You can do this at a terminal that is directly connected to the
server. If this is not possible, login to VMS as SYSTEM and use the VMS NCP utility as
follows:

Original September 1995 23


UM25.0:SPE311
SIMVOX -- Version 2.3

$ set default sys$system


$ run ncp

NCP>connect node dts1


Console connected (press CTRL/D when finished)

#
DECserver 200 Terminal Server V2.0 (BL29) -- LAT V5.1
DHM St. Louis Terminal Server #1

Please type HELP if you need assistance

Enter username> manager

Local>

DTS1 is the terminal server name as configured in the DECnet node database. The server
expects a password at the #. The DECserver 200 default password is ACCESS.
From the Local prompt you need to set privilege as follows. The DECserver 200 default
password is SYSTEM:
Local> set privilege
Password>
Local>

The port that you wish to configure will probably have the following default settings:

Local> list port 7

Port 7:
Character Size: 8 Input Speed: 9600
Flow Control: XON Output Speed: 9600
Parity: None Modem Control: Disabled

Access: Local Local Switch: None


Backwards Switch: None Name: PORT_7
Break: Local Session Limit: 4
Forwards Switch: None Type: Soft

Preferred Service: None


Virtual Login: None

Authorized Groups: 0
(Current) Groups: 0

Enabled Characteristics:

Autobaud, Autoprompt, Broadcast, Input Flow Control, Loss Notification,


Message Codes, Output Flow Control, Verification

Type the following commands to configure the desired port:


Local> define port 7 parity even access remote speed 19200
Local> define port 7 autobaud disabled autoprompt disabled broadcast disabled
Local> define port 7 loss disabled message disabled
Local> define port 7 verification disabled flow control disabled
Local> define port 7 input flow control disabled output flow control disabled

The final port configuration should be as follows:

Original September 1995 24


UM25.0:SPE311
SIMVOX -- Version 2.3

Local> list port 7

Port 7:

Character Size: 8 Input Speed: 19200


Flow Control: None Output Speed: 19200
Parity: Even Modem Control: Disabled

Access: Remote Local Switch: None


Backwards Switch: None Name: PORT_7
Break: Local Session Limit: 4
Forwards Switch: None Type: Soft

Preferred Service: None


Virtual Login: None

Authorized Groups: 0

Enabled Characteristics:

You must logout the newly configured port to get the new settings to take effect:
Local> logout port 7

Note the name of the port in the LIST PORT display above. In our example, the ports name is
PORT_7. You will need this information in the next section when you configure the VAX
port.
Next, determine the LAT node name of your terminal server. You can do this by typing the
following command:
Local> list server

DECserver 200 V2.0 BL29 LAT V5.1 ROM BL20 Uptime: 37 04:14:40

Address: 00--00--B5--00--11--18 Name: DTS1 Number: 0

Identification: DHM St. Louis Terminal Server #1

Circuit Timer: 80 Password Limit: 3


Console Port: 1 Queue Limit: 24
Inactivity Timer: 30 Retransmit Limit: 8
Keepalive Timer: 20 Session Limit: 32
Multicast Timer: 30 Software: PRO801ENG
Node Limit: 100

Service Groups: 0

Enabled Characteristics:

Announcements, Broadcast, Dump, Lock

The servers name is shown in the Name: field of the display. Depending on how your system
manager has set up your server, this name may or may not be the same as the node name in the
DECnet database. In our example, the servers name is DTS1. You will need this information
in the next section.
If you connected to the server using NCP, logout of the server and exit NCP as follows:
Local> logout
Local --020-- Logged out port 49

Press CTRL/D to return to the NCP prompt:

Original September 1995 25


UM25.0:SPE311
SIMVOX -- Version 2.3

NCP>exit

3.2.2.2 VAX LAT Port Configuration


Once the port has been configured on the terminal server, you can configure the VAX LAT port.
First, log on to the VAX as SYSTEM. Then, determine the port name to create by selecting one
that does not exist. To determine what exists, type the following:
$ show devices lt

Device Device Error


Name Status Count
LTA0: Offline 0
LTA2: Online spooled 0
alloc
LTA190: Online 0
LTA192: Online 0
LTA193: Online 0

This example will create port LTA3. Note that VMS allows you to have LAT ports in the range
LTA0 thru LTA999. Because of the four character limitation for port ID in SIMVOX, only LTA0
thru LTA9 should be used. However, if this is not possible you can define any port in the given
range and then define a four character VMS logical name to point to the port. When specifying
the port ID in SIMVOX, you can now use the four character logical name.
To create a port you must run the LATCP program as follows:
$ set default sys$system
$ run latcp

LCP> create port lta3


Local Port Name = LTA3: <application>

LCP> set port lta3 /node=dts1 /port=port_7

Local Port Name = LTA3: <application>

Specified Remote Node Name = DTS1


Specified Remote Port Name = PORT_7
Link Name = LAT$LINK

LCP> exit
$

DTS1 is the terminal servers LAT node name, as shown in the LIST SERVER display from
the previous section. PORT_7 is the terminal server port name, as shown in LIST PORT
display from the previous section.
You must also configure the LAT terminal with notype_ahead and altypeahd, as in the
previous SIMVOX release, as follows:

Original September 1995 26


UM25.0:SPE311
SIMVOX -- Version 2.3

$ show terminal/permanent lta3

Terminal: _LTA3: Device_Type: Unknown Owner: No Owner


Input: 9600 LFfill: 0 Width: 80 Parity: None
Output: 9600 CRfill: 0 Page: 24
Terminal Characteristics:
Interactive Echo Type_ahead No Escape
No Hostsync TTsync Lowercase No Tab
Wrap Scope Remote No Eightbit
Broadcast No Readsync No Form Fulldup
No Modem No Local_echo No Autobaud No Hangup
No Brdcstmbx No DMA No Altypeahd Set_speed
Line Editing Overstrike editing No Fallback No Dialup
No Secure server No Disconnect No Pasthru No Syspassword
No SIXEL Graphics No Soft Characters No Printer Port Numeric Keypad
No ANSI_CRT No Regis No Block_mode No Advanced_video
No Edit_mode No DEC_CRT No DEC_CRT2 No DEC_CRT3

$ set terminal/permanent lta3 /notype_ahead /altypeahd


$ show terminal/permanent lta3

Terminal: _LTA3: Device_Type: Unknown Owner: No Owner


Input: 9600 LFfill: 0 Width: 80 Parity: None
Output: 9600 CRfill: 0 Page: 24
Terminal Characteristics:
Interactive Echo No Typeahead No Escape
No Hostsync TTsync Lowercase No Tab
Wrap Scope No Remote No Eightbit
Broadcast No Readsync No Form Fulldup
No Modem No Local_echo No Autobaud No Hangup
No Brdcstmbx No DMA Altypeahd Set_speed
Line Editing Overstrike editing No Fallback No Dialup
No Secure server No Disconnect No Pasthru No Syspassword
No SIXEL Graphics No Soft Characters No Printer Port Numeric Keypad
No ANSI_CRT No Regis No Block_mode No Advanced_video
No Edit_mode No DEC_CRT No DEC_CRT2 No DEC_CRT3

$
The terminal configuration is complete.

Original September 1995 27


UM25.0:SPE311
SIMVOX -- Version 2.3

3.3 Installation of software on Windows NT


After hardware installation is completed, the SIMVOX software should be loaded onto the hard
disk.

3.3.1 Copying the Software to your hard disk


SIMVOX for Windows is distributed on 3.5 high density diskettes. The user must install this
software onto the system. To do this, an install executable is provided. For proper installation
and operation of SIMVOX, the following steps must be performed:

To copy files from the distribution media to the hard disk, do the following:

(1) Login as System Administrator.

(2) Install SIMVOX from one of three places in Windows NT:

a. From the Program Manager window, pull down the File menu and choose the Run option.
Complete the Run dialog box with:

a:instalit

where a: is the drive that contains the SIMVOX diskette labeled 1.

b. From the NT command line prompt, type:

a:\instalit

where a: is the drive that contains the SIMVOX diskette labeled 1.

c. From the File Manager, select the drive that contains the SIMVOX diskette labeled 1. Then
double click on the instalit.exe file.

This procedure prompts you to specify the hard disk where SIMVOX will be located. It then
copies all the SIMVOX files to the SIMVOX directory, and creates the SIMVOX program group
and icon. When this procedure completes, SIMVOX software is installed.

3.3.2 Windows NT Registry changes


Windows NT Registry is a database of system settings. It can be considered analogous to the
Windows 3.1 *.ini files.

Original September 1995 28


UM25.0:SPE311
SIMVOX -- Version 2.3

Prior to modifying the Windows NT Registry, you must add the Registry Editor to your
Administrative Tools group. To do this, select the Administrative Tools group, and then perform
the File--New option. This will display the New Program Object dialog box. Select the Program
Item radio button, and press OK. This will display the Program Item Properties. Browse your
hard disk to locate the WINMSD.EXE file. It should be located in the Windows NT system32
directory.

Complete the Program Item Properties dialog box with WINMSD.EXE and press the OK
push--button. This will add the Registry Editor to your Administrative Tools group.

Now double click on the WinMSD icon. Select the Tools pulldown and select Registry Editor.
This will display the top level registry keys.

NOTE

The editing of Registry Keys should be done with


caution, by qualified personnel.

For EISA bus cards, Registry changes may not be


required.

To edit the keys, follow these steps:

a. Double click on the SYSTEM entry. This will display keys under System. One of these will be
CurrentControlSet.

b. Double click on CurrentControlSet. This will display keys under CurrentControlSet. One of
these will be Services.

c. Double click on Services. This will display a large number of keys. One of these will be
Serial.

d. Double click on Serial. This will display the Parameters key. Also, the Parameter keys will be
displayed. One of these keys will be RxFIFO, of type REG_DWORD, and value 0x8. To edit the
value for this key, double click on the key entry on the right side of the display. A dialog box will
be displayed prompting you to enter new data. Complete and save the dialog box with the value
0xE. Alternatively, you may first delete this key and then add it again with the value 0xE. To
delete the key, single click on RxFIFO so that the line is highlighted. Then select Edit--Delete
from the menu bar. This will delete the key. To add it back, select Edit--Add Value from the
menu bar and complete the dialog boxes. The value to specify must be 14 decimal or E hex.

Original September 1995 29


UM25.0:SPE311
SIMVOX -- Version 2.3

e. Now double click on the Parameters key. This will display the keys for the four serial ports.
Single click on each serial key and the corresponding values will be displayed. For each serial
key, select the Edit--Add Value from the menu bar to add the following values:

Value Name Type Value Comment

Indexed REG_DWORD 0x1 This should always be 1


InterruptStatus REG_DWORD 0x140 Depends on status register address
PortIndex REG_DWORD n port1=1, port2=2, port3=3, port4=4

NOTE

Key names are case sensitive.

f. After adding values for all four ports, exit the Registry Editor. This will save the specified
values.

3.3.3 Windows NT Tasking changes


Lastly, to complete the software installation process, you must tell Windows NT what kind of
multi--tasking you require. This is done through the Control Panel group

Select the Control Panel group and then select the System icon. This displays a dialog box with
various system settings. Press the Tasking... push--button to display the tasking parameters. In
this dialog box, specify Foreground and Background Applications Equally Responsive, and
press the OK push--button.

Press OK again in the System dialog box. This will save the new settings.

3.3.4 Installing VAX/HP utilities


NOTE : VAX/HP utilities are for PROVOX only.

To install the VAX utilities from tape to your hard disk, follow these steps:

1. SET DEF [SIMNT]


Move to the SIMVOX NT Utilities directory. This directory must already exist.

2. MOUNT/Foreign Tapedev : SIMNT


Where Tapedev represents the name of the tape drive on your system.

Original September 1995 30


UM25.0:SPE311
SIMVOX -- Version 2.3

3. Backup/Rewind/Log Tapedev : SIMNT.SAV/SAVE [...]


This will restore all the files to your system

4. Copy OPT.OPT from the SIMNT directory to your login directory

5. Build the 3 executables


$ @ Linksio
$ @ Linktie
$ @ Linkpts

Original September 1995 31


UM25.0:SPE311
SIMVOX -- Version 2.3

3.4 Installation of software on OpenVMS AXP


SIMVOX is distributed on a 4mm, 8mm or TK50 tape. The user must install this software onto
the system. To do this, command procedures are provided. For proper installation and operation
of SIMVOX, the following steps must be followed and should be performed by the system
manager from an account with SYSTEM privileges.

To copy files from the distribution media to the hard disk, follow these steps:

NOTE

The $ symbol preceding each line is the VMS prompt


and should not be typed.

1. Login to the SYSTEM account.

2. Assign the following logical names by typing:

$ DEFINE/SYSTEM/EXEC SIMVOX_DIR ddcn:[SIMVOX]

Replace ddcn with the device name, controller letter, and unit number of the disk where
SIMVOX programs will reside. SIMVOX may be installed on any device in the VAX.
However, [SIMVOX] must be a root level directory.

$ DEFINE $DIST mmcn:

Replace mmcn with the device name, controller letter, and unit number of the drive on which
SIMVOX distribution media will be mounted.

3. Create the directory SIMVOX by typing:

$ CREATE/DIR/PROT=(S:RWE,O:RWE,G:RWE,W:RWE) SIMVOX_DIR

4. Set your default directory by typing:

$ SET DEFAULT SIMVOX_DIR

5. Allocate the device used for distribution media:

$ ALLOCATE $DIST

6. Insert SIMVOX distribution media into drive.

7. Mount SIMVOX distribution media by typing:

$ MOUNT/FOR $DIST

Original September 1995 32


UM25.0:SPE311
SIMVOX -- Version 2.3

8. Copy files from the distribution media to the SIMVOX directory by typing:

$BACKUP/REW/VER$DIST:SIMVOX.BCK/SAVE/SELECT=[SIMVOX_ALP.RELEASE...]*.* *.*

9. Dismount and deallocate the distribution media device:

$ DISMOUNT $DIST

$ DEALLOCATE $DIST

10. Install SIMVOX programs by invoking the command procedure,


SIMVOX_INSTALL.COM, as follows:

$ @SIMVOX_INSTALL

11. Move the SIMVOX UID files to SYS$SHARE by invoking the command procedure,
SIMVOX_MOVE_UID.COM, as follows:

$ @SIMVOX_MOVE_UID

When this procedure completes, SIMVOX software is installed.

The following additional steps are required for SIMVOX installation each time the computer
system is booted and for proper functioning of communications between the VAX and the
Controller Device.

1. The user must now modify the system login and startup command procedures to insure that
SIMVOX is installed each time the system is booted. To accomplish this, edit
SYS$MANAGER:SYLOGIN.COM to include the following:

$ @SIMVOX_DIR:SIMVOX_LOGIN.COM

Also, edit SYS$MANAGER:SYSTARTUP_VMS.COM to include the following:

$ @ddcn:[SIMVOX]SIMVOX_INSTALL.COM

Replace ddcn with the device name, controller letter, and unit number of the disk where
SIMVOX programs reside.

2. It is recommended that the user dedicate serial ports for SIMVOX communiactions with the
controller device. These ports must be setup with typeahead disabled and alternate typeahead
enabled.
SYS4MANAGER:SYSTARTUP_VMS.COM should be edited to incorporate the following
commands for boot--up setup of serial ports.

$ SET TERMINAL ttcn:/PERMANENT/NOTYPE_AHEAD

$ SET TERMINAL ttcn:/PERMANENT/ALTYPEAHD

$ SET PROTECTION=W:RWLP ttcn:/DEVICE

Original September 1995 33


UM25.0:SPE311
SIMVOX -- Version 2.3

Replace ttcn with the device name, controller letter, and unit number of the communication port.

Original September 1995 34


UM25.0:SPE311
SIMVOX -- Version 2.3

3. The alternate typeahead buffer size should be at least 512 bytes. To check buffer size on your
system, do the following:

$ RUN SYS$SYSTEM:SYSGEN

This will give you the prompt SYSGEN>. At this prompt, enter the following:

SYSGEN> USE CURRENT

SYSGEN> SHOW TTY_ALTYPAHD

The current buffer size is displayed by the system. If it is already 512 bytes, no changes are
required. The user may simply enter a CONTROL--Z and exit. If, however, the buffer size is
less than 512 bytes, the following commands must be entered to modify it:

SYSGEN> SET TTY_ALTYPAHD 512

SYSGEN> WRITE CURRENT

SYSGEN> ^Z

If a change was required to the alternate typeahead buffer size, the user must reboot the
VAX/VMS computer operatting system.

In the final step of SIMVOX installation, it is the System Managers responsibility to issue user
accounts with the necessary privileges. From the SIMVOX standpoint, users accessing the
SIMVOX simulation tools should have the following minimum privileges:

TMPMBX, NETMBX, WORLD

Original September 1995 35


UM25.0:SPE311
SIMVOX -- Version 2.3

3.5 Architecture/Installation

3.5.1 PROVOX E/I Card


The External Interface (E/I) card is a microprocessor--based interface, providing communications
between SIMVOX and the PROVOX Controller. The Controller is either a Unit Operations
Controller plus (UOC+), an Integrated Function Controller (IFC), or an SR90 Controller. Figure
3.1 depicts an overview of the hardware layout.

A Control Input/Output Card File is utilized to mount the E/I card. The first slot (left to right) of
the card file is reserved for the power connector card, the second slot for the primary
power/communication card, and the third slot for the secondary power/communication card.
The remaining 14 slots are reserved for I/O cards. Any one of the 14 slots may be used for the
E/I card; however, for ease of configuration, it is highly recommended that the E/I card be
mounted in card slot 14. Figure 3.2 shows the Control I/O Card File slot assignments.

Each card file on the system I/O bus must have a unique address. The power connection card
has a set of DIP switches which allow the user to assign an address to each card file. This
address should be assigned with power turned off. Figure 3.3 details the switch settings
corresponding to the various card file addresses. It is recommended that for SIMVOX use, the
user assign address 16 to the card file. Together with the E/I card being installed in card slot 14,
this scheme allows the user full flexibility in using File--Card--Channels in the remaining address
space with little obstruction from the E/I card.

The installation of power cables to the card file is beyond the scope of this manual. Please refer
to Fisher Controls Planning Notes for information on how to connect the power.

Connection of cable (I/O bus in Figure 3.1) from the controller to the power/communication card
in the I/O card file completes the hardware installation of the E/I card. The cable pinout used is
described in Section 3.6.

NOTE

Physical cards for I/O being simulated by the E/I card


must not be installed in the I/O file along with the E/I
card. Other cards, not being simulated, can remain in
the I/O card file.

Original September 1995 36


UM25.0:SPE311
SIMVOX -- Version 2.3

DataHighway

SR 90 Controller
20 -- Series Controller

External Interface Card

I / O Card
File

Interface Cable

I / O Bus
SIMVOX

Figure 3.1 Overview of Hardware Layout

Original September 1995 37


UM25.0:SPE311
SIMVOX -- Version 2.3

FILE SWITCH
ADDRESS SETTINGS

4 3 2 1
1 O O O O
2 O O O C
3 O O C O
4 O O C C
5 O C O O O = OPEN
6 O C O C C = CLOSED
7 O C C O
8 O C C C
Ex. Address 8:
9 C O O O
10 C O O C 1
11 C O C O 2
12 C O C C 3
13 C C O O 4
14 C C O C CLOSED OPEN
15 C C C O
16 C C C C

Figure 3.3 Card File Address Switch Settings

Original September 1995 38


UM25.0:SPE311
SIMVOX -- Version 2.3

3.5.2 PROVOX IDI Card

The Intelligence Device Interface (IDI) card is a microprocessor--based interface, providing


communications between SIMVOX and the PROVOX SR90 Controller. Figure 3.2 depicts an
overview of the hardware layout. The cable pinout used is described in Section 3.6.

NOTE

Physical cards for I/O being simulated by the IDI card


must not be installed in the I/O file along with the IDI
card. Other cards, not being simulated, can remain in
the I/O card file.

DataHighway
SR 90 Controller

I / O Card
File

Twisted Pair RS485


I / O Bus
Interface
IDI
IDI

SIMVOX

Figure 3.2 Overview of Hardware Layout

Original September 1995 39


UM25.0:SPE311
SIMVOX -- Version 2.3

3.5.3 Allen Bradley PLC3 & PLC5


The PLC3 and PLC5 communications with SIMVOX use RS--232. For PLC3, the front panel
Channel 0 port is used and is connected to a standard COM port in the SIMVOX Workstation.
For PLC5, a 1770 KF2 or a 1785 KE/KF module is used. These modules also connect to a
standard COM port in the SIMVOX Workstation. The cable pinout used is described in Section
3.6.

Allen Bradley PLC3:

PLC3 SIMVOX
RS232

Channel 0 port

Allen Bradley PLC5:

PLC5

DataHighway

1770 KF2 or
1785 KE/KF

RS232
SIMVOX

Original September 1995 40


UM25.0:SPE311
SIMVOX -- Version 2.3

3.5.4 Modicon MODBUS & MODBUS+


The Modicon PLC communications with SIMVOX use RS--232 (Modbus) or special
hardware (SA--85 for Modbus+). For Modbus, the front panel RS--232 port is used and is
connected to a standard COM port in the SIMVOX Workstation. For Modbus+, the
SA--85 card (along with the Windows NT kernel mode driver) is installed in the
SIMVOX Workstation. This makes the SIMVOX Workstation a node on the Modbus+
network. SIMVOX can then communicate with any PLC on the network. Note that
SIMVOX is the master in all communications.

Modicon MODBUS:

RS232
Modicon SIMVOX
Special
cable

Modicon MODBUS +:

PLC PLC

MODBUS+ Special
Network cable

SIMVOX

The Modbus Plus cable is a special cable with two end node connectors, one on each end, or a
cable to place the SIMVOX workstation on the MODBUS+ network. This cable is available
from Modicon as the following part numbers:
97--9841--100 MBPlus 100 Foot Reel
97--9841--500 MBPlus 500 Foot Reel
97--9841--01K MBPlus 1000 Foot Reel
(For further information, refer to the Modicon Modbus Plus Network Planning and Installation
Guide)

Original September 1995 41


UM25.0:SPE311
SIMVOX -- Version 2.3

3.5.5 TI565 (NITP)


The TI/Seimens PLC TI565 communications with the SIMVOX Workstation use RS--232. The
front panel RS--232 port of the PLC connects to a standard COM port in the SIMVOX
Workstation. The cable pinout used is described in Section 3.6.

RS232
TI565 SIMVOX
(NITP)

Original September 1995 42


UM25.0:SPE311
SIMVOX -- Version 2.3

3.6 Cable Connections


PROVOX EIC:

The E/I card has two 25--pin D--shell female connectors, for communication with various field
devices. With card mounted in the file, only the top connector may be used to communicate with
SIMVOX. For SIMVOX, the bottom connector is unusable.

The required pinout for cable between the SIMVOX Workstation and the control system
communication device is identical and is detailed in Figure 3.4a and Figure 3.4b. The only
exceptions to this rule are Modbus, Modbus+, and RS3 connectivity which are described below.

By installing a Communication Line Monitor in the cable between the PC and the E/I card, the
user can check line status. Figure 3.5 depicts the Quick Check status with both the PC and the
E/I card connected, and Figure 3.6 is the required pinout of the cable.

Modicon MODBUS:

The SIMVOX -- Modicon MODBUS cable is Modicon AS--W952--012.

Modicon MODBUS+:

If SIMVOX will be a node on the MODBUS + network with multiple PLCs then a cable with a
Terminating Connector (AS--MBKT--185) and an Inline Connector (AS--MBKT--085) will be
required. The Terminating Connector side of the cable is attached to the SIMVOX Workstation
and the inline connector side is attached to the MODBUS + network. If the SIMVOX
Workstation and PLC are directly connected, a cable with two terminating connectors will be
used.

RS3:

Option 1 -- The SIMDI card is installed in the SIMVOX Workstation

A special cable is used to connect the RS3 Comm Term Panels to the SIMDI Intelligent I/O card.
This cable is available from Munger Company, Inc. Please contact SIMVOX Tech Support for
information.

Option 2 -- The SIMDI card is installed in an external PC

In this case, the Option 1 cable connects the SIMDI to RS3. Additionally, this external PC
connects to the SIMVOX Workstation via RS--232.

Original September 1995 43


UM25.0:SPE311
SIMVOX -- Version 2.3

DB25 Connector for RS--232C

13
25
12
24
11
23
Data Terminal Ready 10
22
9 Signal Ground
21
8 Data Set Ready
20
7 Clear To Send
19
6 Request To Send
18
5 Received Data
17
4 Transmitted Data
16
3
15
2
14
1

Figure 3.4a Pinout of Cable

2 3 E/I Card
3 2 IDI
4 VIOC
PLC3
Workstation 5
PLC5
6 TI565
20 GE
7 7 RS3 --Option 2

Figure 3.4b

Original September 1995 44


UM25.0:SPE311
SIMVOX -- Version 2.3

E/I CARD SIDE


PC SIDE Yellow Red
20
19
11
8 All on with both
On with only PC sides connected
6
side connected
5
4
Both 2 and 3 3 Flashing with
on with both 2 communication active
sides connected
With no communications, only 2
and
on theflashes
E/I card side.
Both 2 and 3
flash with OFF
communications active
ON
FLASHING

Figure 3.5

INMAC EIA QUICK CHECK Product # 322--1

Original September 1995 45


UM25.0:SPE311
SIMVOX -- Version 2.3

E/I Card
PC IDI
VIOC
PLC3
PLC5
DB25 Pin DB25 Pin TI565
Female Pin Connections: Male GE
2 3 RS3
3 2
4
5
6
20
7 7

Figure 3.6

Original September 1995 46


UM25.0:SPE311
SIMVOX -- Version 2.3

4.0 SIMVOX Functionality


SIMVOX is a completely Windows oriented system, with significantly enhanced functionality,
with pull--down/pop--up menu systems, point--and--click capability, and multi port simulation
capability on a standard Workstation.

While maintaining compatibility with existing simulations developed in FORTRAN and C,


SIMVOX (taking advantage of lower cost hardware), brings ease of use, on--line simulation
development and deployment, integrated simulation environment, and much more together into a
single system. Currently, a maximum of 1, 4, 6 or 8 datasets are supported, based on the license
agreement.

NOTE

A dataset is the basic organizational unit in SIMVOX.


Each dataset represents the I/O associated with a single
E/I card (896 channels), a single IDI card (1152
channels) or a single PLC.

In this section, an overview of the various menu systems is presented. The Tieback, Tags, and
Calculations subsystems are presented in greater detail in section 6.

Original September 1995 47


UM25.0:SPE311
SIMVOX -- Version 2.3

4.1 SIMVOX Main Menu


From a basic functionality standpoint, SIMVOX follows the design objectives embodied in its
predecessor, VAX/VMS SIMVOX. These are:

D Communications
D Tools
D Simulation
D Help

Communications
The Communications sub menu of the SIMVOX main menu allows you to initiate and
terminate communications with the control system using one of the communication drivers
(PROVOX EIC, PROVOX IDI, PROVOX DM6004 VIOC, Allen Bradley PLC3, Allen Bradley
PLC5, Modicon MODBUS etc.). The following Communications options are provided:

1. Initiate;
2. Terminate; and
3. Speed.

The Initiate option is used to start communications with control hardware, e.g., EIC, IDI, VIOC,
Allen Bradley PLC3, Allen Bradley PLC5, Modicon MODBUS etc. on a specific dataset, based
on the driver selected. It displays a dialog box from which you can select the dataset, the COM
port to use and the Simulated I/O (SIO) file to use. This option is also available as a toolbar icon
labeled I.

The datasets are displayed in a dropdown list. A dataset is synonymous to data associated with a
single I/O communication driver. Your SIMVOX version may have one, four or more datasets.
Each dataset has independent communications control, and every dataset in active
communication allocates a port until communications are terminated. You cannot select a
dataset which already has communications active on it. If such a dataset is selected, the OK
push--button will be greyed.

The drivers are also displayed in a dropdown list. Only the drivers available in your version will
be usable. Files for other drivers may not exist or will be unusable.

The COM ports are also displayed in a dropdown list. Only the available COM ports are
displayed. Consequently, you cannot select a port that already has communications on it or is
being used by another process.

To successfully communicate data between SIMVOX and the control device, a simulated I/O file
is used. This I/O file describes the addressing configuration and

Original September 1995 48


UM25.0:SPE311
SIMVOX -- Version 2.3

address types for the simulated dataset. Except for PROVOX EIC, IDI and DM6004 VIOC (for
which the simulated I/O file is binary with an unpublished format) the SIO file can be created
using any text editor. However, the SIO files must be in a specified format in order for them to
be read correctly. This format is different for different drivers. Directory names and filenames
can be directly entered in the available fields or available directories can be browsed by pressing
the Browse push--button.

The Process Speed effects the scaling time of processed events which use Integration. Its default
value is 1.00 indicating that the process will run real--time. A speed of 2.00 indicates that the
process will be running twice as fast.

The Status field displays the current communication status of the selected dataset i.e. Active or
Inactive. It is not editable.

After completing the displayed dialog box, you must press the OK push--button for
communications to start.

When communications are started, a separate process is created. This process will have a name
based on the driver. For example, an EIC process will be called EIC--n, where n is the dataset.
Under Windows NT, this process has its own window and it continues to run in the background
performing communications with the controller. You can double click on the Process icon to get
its window. The current communications status for the dataset is displayed in the window. You
can minimize the window and send it to the desktop without affecting communications.
Terminating this process will terminate communications. Under OpenVMS, this process is
detached and runs in the background without a window.

The Terminate communications option first determines if there are any communication
processes active. If none are found, it posts a message that no communications are active.
Alternatively, it displays datasets which have active communications processes, in a dropdown
list,. You must select one and then press the OK push--button to terminate communications.

After communications are established, the Speed option can be used to adjust the process speed.

Tools
The following Tools options are provided:

1. SIO Generate;
2. Control Device Tieback Generate;
3. Non Control Tags Generate; and
4. Modify SIO.

Original September 1995 49


UM25.0:SPE311
SIMVOX -- Version 2.3

Note that these tools are specifically designed for Fisher--Rosemount ENVOX and Proflex
configuration platforms only. For RS3, tools are being developed to extract configurations from
the ConfiguWrite system. For PLC systems, and external Convert utility exists which takes
spreadsheet configuration data into SIMVOX readable files.

The SIO Generate, Control Device Tieback Generate, and Non Control Tags Generate
options allow you to first select ENVOX or PROFLEX as the DCS configuration source .

For ENVOX, SIO Generate, Control Device Tieback Generate, and Non Control Tags
Generate depend on a network link between the NT workstation and the VAX/VMS workstation
where the ENVOX Sybase database is located. On the NT workstation, the Sybase Net Library
software must be present. On the VAX/HP system, the appropriate TCP/IP Network software
must be present such that the NT workstation can access the Sybase database. With this link
present, the SIMVOX tools directly read the ENVOX databases (and corresponding devices), for
I/O information, Discrete Control Device and Loop information, and AI, AO, DI, DO and PCI
object information. The read data is written to text files in the NT workstation in a specific
format, ready to be loaded into the SIMVOX environment.

If the Network link between the NT workstation and the VAX/HP system is not present, 3
VAX/HP resident utilities are provided with SIMVOX which perform the same tools functions.
These utilities (which reside on the OpenVMS/OpenVMS AXP/HP system) are TBGEN.EXE
(for Tieback files), PNTGEN.EXE (for Tags files) and SIOGEN.EXE. They allow you to select
the ENVOX database, and the PROVOX device, from which configuration data is read and a
target file created. Target files are ASCII, CDV for control devices (Tiebacks) and non--control
devices (Tags). For SIO, the target file is binary (non printable). The created SIO, Tieback or
Tags files can be transferred to the NT Workstation using Kermit, FTP or any other file transfer
program.

For PROFLEX, you can specify the controller device definition file, which SIMVOX will read
and then parse out the necessary information. A log file will be created with any errors found.

The format of SIO files, Tieback files, and Tags files created from either ENVOX or PROFLEX
is identical. After generation, these files are ready to be loaded into SIMVOX for simulation.

The SIO Generate option is discussed fully in Section 6.1.1.

The Control Device Tieback Generate option is discussed fully in Section 6.1.2.

The Non Control Tags Generate option is discussed fully in Section 6.1.3.

Original September 1995 50


UM25.0:SPE311
SIMVOX -- Version 2.3

The Modify SIO option allows you to create a new SIO file or to edit an existing file which was
created at the VAX/HP level. When the option is selected, a separate window is opened, into
which, you can load existing files or open blank sheets to create new Simulation I/O
configurations. Please refer to section 4.2 for details regarding the Modify SIO window. With the
exception of IDI block data, all other EIC, IDI and VIOC simulated I/O data is editable. For IDI
block data, it is recommended that you use the host resident utilities as discussed above.

Simulation
The Simulation options allow you to manage the tieback and model processes. The following
Simulation options are provided:

1. Start Model;
2. Stop Model;
3. Calculations;
4. Control Device Tieback;
5. Non Control Tags;
6. Manipulate by Channel;
7. Training Manager; and
8. Launch Application.

The Start Model option allows you to select an external program to run under the SIMVOX
environment. The program selected is executed as a detached process. Such a program may be
existing code which has been ported to the Workstation, or it may be a program written to handle
special process conditions not available in the built--in SIMVOX environment.

When selected, this option displays a dialog box which requires you to specify the Directory and
File name of the executable model to start. You can browse available directories and filenames
by pressing the Browse push--button. Also, the dataset to be attached to must be specified. All
datasets available on your version are displayed in a dropdown list. You may select none, one or
any number for the subject program to attach to. When the program is started, the selected
datasets are formatted into the command line which the program can retrieve to determine which
datasets it must attach to. Please refer to the Programming API for detailed information on this.

The Stop Model option first determines if there are any simulation processes active. If none are
found, it posts a message that no models are active. Alternatively, it displays a dropdown list of
active models. You must select one and then press the OK push--button to terminate it.

The Calculations option allows you to Add, Modify, Delete, View, and control user defined
calculations by tag. Calculations are mathematical expressions based on Process and Control
variables which evaluate into values. When the option is selected, a

Original September 1995 51


UM25.0:SPE311
SIMVOX -- Version 2.3

separate window is opened, into which, you can load existing calculations files or open blank
sheets to create new calculations. Please refer to Section 4.5 and 6.1.4 for details regarding the
Calculations window. This option is also available from the Toolbar as an icon labeled C.

The Control Device Tieback option allows you to open tieback files created from the ENVOX
database, and to View and control individual tieback objects by tag. Specifically, tieback objects
are Discrete Control Devices and Loops. These tieback objects can be individually controlled to
have personalities. When the option is selected, a separate window is opened, into which you can
load existing tieback files. Please refer to Sections 4.3 and 6.1.2 for details regarding the Tieback
window. This option is also available from the Toolbar as an icon labeled TB.

The Non Control Tags option allows you to open tags files created from the ENVOX database,
and to Add, Modify, Delete, View and control individual tag objects. Specifically, tag objects are
Analog Inputs, Analog Outputs, Discrete Inputs, Discrete Outputs and Pulse Count Inputs. These
tag objects can be individually controlled to have personalities. When the option is selected, a
separate window is opened, into which you can load existing tags files or open a blank sheet to
create new tag objects. Please refer to Sections 4.4 and 6.1.3 for details regarding the Tags
window. This option is also available from the Toolbar as an icon labeled TAGS.

The Manipulate by Channel option allows you to open datasets and view/control data at the
lowest level. When the option is selected, a separate window is opened from which you can open
one or all four datasets. The simulated I/O in SIMVOX can be modified using the channel
values. Channel corresponds to an I/O channel in PROVOX; an I/O/N register in Allen Bradley;
a coil, discrete input, input register, holding register in Modicon; and a WX, WY, X or Y register
in TI. The values of Analog Inputs, Discrete Inputs, Weigh scales and other types are displayed
and can be directly edited. Please refer to Section 4.6 for details regarding the Manipulate
window. This option is also available from the Toolbar as an icon labeled M.

The Training Manager option is a training tool used to setup complex field scenarios. Once a
scenario is started it executes a list of macros that simulate various failures and actions. The
operator trainee responds/reacts to failures and actions injected into the process by scenarios.
This option is also available from the Toolbar as an icon labeled Training. While scenarios are
active, the Event Logger captures operator actions into a text file. This log is useful for training
purposes to identify deficiencies in operator responses and recording operator ability/compliance
to Standard Operating Procedures for regulatory purposes.

The Launch Application option allows you to run any external program (not related to
SIMVOX) by selecting the filename from the list of available directories.

Original September 1995 52


UM25.0:SPE311
SIMVOX -- Version 2.3

Help
The following Help options are provided:

1. Help; and
2. About.

The Help option allows you to access the SIMVOX on--line help. Much of the information in
this document is also included in the on--line help.

The About option displays the About box. The SIMVOX revision level, licensee and serial
number information is included here.

Exit
The following Exit options are provided:

1. To Command Prompt; and


2. SIMVOX.

The To Command Prompt option opens a command prompt window, allowing you to perform
MS--DOS commands under Windows NT.

The SIMVOX option will terminate SIMVOX and close the window. Note that if any of the
other SIMVOX windows were opened, e.g., Tags, Tieback, Calculations, etc., they will continue
working regardless of the main menu window being inactive. However, the main menu window
must stay running if SIMVOX data is being accessed via DDE by other applications.

Original September 1995 53


UM25.0:SPE311
SIMVOX -- Version 2.3

4.2 Modify SIO File


When this option is selected, the Modify SIO program is started and the Modify window is
displayed. At the top of this window is the menu bar and immediately below it is the Toolbar.
Much of the functionality provided by the menu bar options is also provided by icons on the
Toolbar with a single mouse click.

Modify Menu Options


The following options are provided:

1. File
2. Edit; and
3. Help

File
Under File, the available options are:

1. New;
2. Open;
3. Save;
4. Save As; and
5. Exit.

The New option allows you to open a blank sheet. This opens a child window under the Modify
window entitled new.sio. Once opened, you can specify a simulated I/O configuration using the
Edit pull--down or by using the Toolbar icons.

The Open option allows you to open an existing SIO file for editing. This opens a child window
under the Modify window with the file name as its title. Once opened, you can edit the simulated
I/O configuration using the Edit pull--down or by using the Toolbar icons.

The Save option allows you to save the file to disk. The contents of the window are saved in the
SIO format on disk. The window is left open.

The Save As option allows you to save the open file to disk and give it a new name. Again, the
window remains open. To shut a child window, simply double click on the top left corner of the
child window.

The Exit option exits Modify SIO and the main window and all child windows are shut down.

Original September 1995 54


UM25.0:SPE311
SIMVOX -- Version 2.3

Edit
Under Edit, the available options are:

1. Add Channels;
2. Delete Channels;
3. Cut;
4. Copy;
5. Paste;
6. Undo; and
7. Dialog.

These options are also available from the Toolbar.

The Add Channels option allows you to add new channels to the SIO file. It can either define a
single channel or a range of I/O channels on a single I/O card. When selected, a dialog box is
displayed, where platform specific data can be specified. The File field is used to select the I/O
file for the operation. The valid range for I/O files is between 1 and 16. The Card field is used to
select the I/O card for the operation. The Channel field supports a variety of ways to specify a
channel range for EIC and IDI I/O file types. VIOC types do not utilize this field. Cards may be
defined or redefined by selecting the * in the channel field and selecting a type. For example,
for PROVOX, the file, the card, and the channel numbers must be specified in addition to the
channel types. Channel types are available in a drop down list. Note that the dropdown list is
context sensitive, i.e., if a card has been defined as analog, the list does not present you with
discrete channel types. Additionally, the Modify process enforces channel mixing rules from a
platform specific standpoint.

The Delete Channels option allows you to delete existing channel definitions from the SIO file.
When selected, a dialog box is displayed, where platform specific data can be specified. For
example, for PROVOX, the file, the card, and the channel numbers must be specified.

The Cut option allows you to cut a card definition from the specified location. You must select
the card to cut first. To select a card, simply click on the card number column heading. The
selected card will be highlighted. Once cut, the data is saved in an internal buffer and can be
pasted at a new location. Again you must select the paste location before pasting.

The Copy option simply copies the selected card into an internal buffer. The buffer may be
pasted any number of times in subsequently selected card locations.

The Paste option pastes the internal buffer in the selected location.

Original September 1995 55


UM25.0:SPE311
SIMVOX -- Version 2.3

The Undo option reverses the last action.

Lastly, the Dialog option activates a dialog box, giving all the I/O block information (which has
already been defined for the card).

Help
Under Help, the available options are:

1. Help; and
2. About.

The Help option allows you to access the Modify SIO on--line help. Much of the information in
this document is also included in the on--line help. Additional details regarding Toolbar icons are
also provided.

The About option displays the About box. The Modify revision level, licensee and serial number
information is included here.

Original September 1995 56


UM25.0:SPE311
SIMVOX -- Version 2.3

4.3 Tieback
When this option is selected, the Tieback program is started and the tieback main window is
displayed. At the top of this window is the menu bar and immediately below it is the Toolbar.
Much of the functionality provided by the menu bar options is also provided by icons on the
Toolbar with a single mouse click.

Note that only one main Tieback program need be started. Within the main window of the
tieback, you can open a child window for each dataset. Opening multiple tieback programs will
result in data loss and unpredictable window events.

Tieback Menu Options


The following options are provided:

1. File;
2. Edit;
2. Tools; and
3. Help.

File
Under File, the available options are:

1. New;
2. Open;
3. Close;
4. Save;
5. Save As;
5. Save All; and
6. Exit.

The New option allows you to open a blank sheet for a given dataset. A dialog box will be
displayed, where you can specify the target dataset. Only the available datasets, i.e., datasets
which do not currently have a file open will be available to select from. The communications
platform that this tieback file will be using also needs to be specified. Available platforms are
displayed in a dropdown list. The child windows displayed will not have any Discrete Control
Device or Loop objects in them. You can, however, use the Edit--Add pulldown menu option to
add Discrete Control Device or Loop objects to the child window. The titles of these blank child
windows will be as follows:

[new.tbk] DCD DSn


[new.tbk] LOOP DSn

Original September 1995 57


UM25.0:SPE311
SIMVOX -- Version 2.3

where n is the dataset number.

The Open option allows you to open a tieback file for a given dataset. A dialog box will be
displayed, where you can specify the target dataset and the tieback file to open. Only the
available datasets, i.e., datasets which do not currently have a file open will be available to select
from. You can either directly enter the directory and file name into the dialog box fields or use
the Browse button to select from available files on disk.

After completing the dialog box, press the OK push--button to load the selected file into the
selected dataset. This opens two child windows under the main Tieback window. One for
Discrete Control Device objects, and the other for Loop objects. The titles of these child
windows will be as follows:

[filename.tbk] DCD DSn


[filename.tbk] LOOP DSn

where filename.tbk is the file you selected, and n is the dataset.

Opening a tieback on a dataset whose simulated I/O file does not match the addresses for the
Discrete Control Device and Loop tags will result in a communications error with the tieback
program. The type of tieback file loaded must match the communications type on that dataset.

Once opened, the Discrete Control Device and Loop object data is displayed in a
spreadsheet--like form. Each row corresponds to a single object. To allow multiple child
windows on the screen without forming a clutter, each child window only displays 10 objects at
a time. Of course, you can scroll within each child window to view records as necessary.

The top right corner of each child window has the maximize and minimize buttons. By pressing
the minimize button, the child window can be reduced to an icon, and placed at the bottom of the
main tieback window. You can drag the icon and move it to improve the visibility as necessary.
Double clicking on the icon will restore the child window to its original dimensions.

The top left corner of the child window contains the System menu options for the window.
Double clicking on it will close the window.

As mentioned, each tieback file is loaded into a pair of child windows. Closing one will close the
other as well.

Original September 1995 58


UM25.0:SPE311
SIMVOX -- Version 2.3

After loading the tieback into a dataset, there is a 15 second delay. After this delay, the tieback
process starts resolving the Discrete Control Device and Loop objects on a 1 second scan. Each
Discrete Control Device and Loop can be defined to have it own scan rate. In addition, you can
take individual objects off--line. Off--line objects are not resolved at all. Additional detail of
tieback control is provided in section 6.1.2.

All 4 datasets can be loaded into child windows. It is not necessary to start additional Tieback
programs. In fact, doing so will give unpredictable results.

The Close option allows you to close all open dataset child windows. To close a single dataset,
double click on the top left corner of the Discrete Control Device or Loop window for that
dataset. When either window for a particular dataset closes, other processes in the system, i.e.
Tags, Calculations, Tiebacks in other datasets will fail when they try to reference Discrete
Control Devices/Loops in the now closed dataset. Note that selecting Close will close the
Discrete Control Device and Loop windows on ALL datasets.

The Save option allows you to save open tieback files to disk. If there is only one dataset open,
Save will write its window contents to the disk file. If more than one dataset is open, a dialog
box will be displayed, prompting you to select which dataset to save. When the file is saved, the
original contents of the file are lost, i.e., no backup file is created. The window is left open.

The Save As option allows you to save the open file to disk and give it a new name. Again, the
window remains open. To shut a child window, simply double click on the top left corner of the
child window.

The Save All option allows you to save all the open files to disk.

Note that changes made to the tieback file via the Notepad application, or other text editor, while
the dataset is still open will be overwritten with data from the dataset when the save options are
used.

The Exit option terminates the Tieback and the main window and all child windows are shut
down.

Edit
Under Edit, the available options are:

1. Add;
2. Modify; and
3. Delete.

Original September 1995 59


UM25.0:SPE311
SIMVOX -- Version 2.3

The Add option can be selected when a new dataset child window (blank sheet) is opened as
well as to add new objects to existing tieback files in open child windows.

When selected, a dialog box is displayed from where you must select the dataset and the tieback
object (Discrete Control Device, Loop or Template) to be added. Only the available datasets, i.e.,
datasets which currently have open child windows will be available to select from. Additionally,
the tag type must be selected by clicking on the appropriate radio button. The default object is
Discrete Control Device. After selecting the tieback object, press the OK push--button.
Depending on the type selected, a dialog box will be displayed. Completing this dialog box and
pressing the OK push--button will add the tieback object to the child window. (Look at Section
6.1.2.3 -- Discrete Control Device Detail Dialog and Section 6.1.2.5. -- Loop Detail Dialog for
details on completing the dialog box)

Now you can elect to add another tieback object of the same type or select a different type.
When you are done adding tieback objects, simply press the Done push--button to return to the
child window display.

The Modify option can be selected to modify an existing tieback object. When selected, a dialog
box is displayed from where you must select the dataset and the tieback object to be modified.
Only the available datasets, i.e., datasets which currently have open child windows will be
available to select from. Also, the tieback object must be selected by clicking on the appropriate
radio button. The default tieback object is Discrete Control Device. Now you can press the OK
push--button. Depending on the tieback object selected, a dialog box will be displayed.

In this dialog box, you will be able to select, by tag, the object you want to modify. The tags will
be available in a dropdown list. Picking a specific tag will display the object details. Now you
can modify the object fields. You can either Save this object or clone it by using the Save As
button. To save the object, simply press the Save button. If you press the Save As button, a
dialog box will be displayed. In this dialog box, simply enter a new tag and, if the new object is
for a different dataset, specify the new dataset. Now press the OK push--button. SIMVOX will
check for valid tag and valid I/O address before adding the object to the database. Duplicate tags
within the same dataset are not allowed. If the new object passes these tests, it will be displayed
in the appropriate datasets child window.

Now you can elect to modify another tieback object of the same type or select a different type.
When you are done modifying tieback objects, simply press the Done push--button to return to
the child window display.

Original September 1995 60


UM25.0:SPE311
SIMVOX -- Version 2.3

The Delete option is available only when an entire dataset is off--line. This is because the on--line
nature of objects (interdependence) would otherwise be disrupted. For example, a Loop may be
tracking the value of a tieback object. This link is created when the objects are loaded into child
windows. Subsequent deletion of that tieback object without reloading and reestablishing the
links will give unpredictable results. It is recommended, therefore, that object deletions be
performed with caution.

To delete an object, first take the dataset off--line. This is done from a Toolbar icon. Please refer
to the on--line help for details. Selecting the dataset on/off--line button will display a dialog box.
Select the dataset and then the off--line radio button. Press OK to take the tieback objects for the
entire dataset off--line.

Now select the Delete option. This will display a dialog box from where you can select the
dataset, the tieback object to delete. The tags of the selected tieback object are displayed in a
dropdown list. You can select a specific tag and then press the OK push--button. This will
remove the object from the SIMVOX database, and delete it from the datasets child window.

When you are done deleting, press the Done push--button. This will reload the tieback objects
into the child windows. Note that this does not currently reload other objects, i.e., Tags or
calculations. You must perform that function manually to ensure that the dynamic links are
properly resolved.

Tools

Under Tools, the available options are:

1. Select;
2. Scan On/Off;
3. Reset; and
4. Document.

The Select option allows you to perform searches on tags by specifying specific tags or partial
tags. The specified tag or partial tag is matched with loaded data and the result (matching tags)
are displayed. The * (asterisk) is a wild card. It may be used to prepend or append a series of
letters. For example:

To display tags with: Specify Mask as:

All tags which begin X X*


All tags which end with X *X
All tags which have X embedded *X*

Original September 1995 61


UM25.0:SPE311
SIMVOX -- Version 2.3

For Tiebacks, you can perform the search for Discrete Devices or Loops by using either a partial
tag substring.

The Scan On/Off option allows you to take an entire dataset Online or Offline. Note that this
does not automatically lock the individual tags. A dataset must be Offline for the Edit--Delete to
be available.

The Reset option allows you to reinitialize the I/O and dynamic links of an entire dataset. All
tags are initialized to their individual initial values and all dynamic links to other tags are
resolved.

The Document option allows you to create and print a document file comprising the tags and
their dependencies for an entire dataset.

Help
Under Help, the available options are:

1. Help; and
2. About.

The Help option allows you to access the Tieback on--line help. Much of the information in this
document is also included in the on--line help. Additional details regarding Toolbar icons are also
provided.

The About option displays the About box. The Tieback revision level, licensee and serial
number information is included here.

Original September 1995 62


UM25.0:SPE311
SIMVOX -- Version 2.3

4.4 Tags
When this option is selected, the Tags program is started and the tags main window is displayed.
At the top of this window is the menu bar and immediately below it is the Toolbar. Much of the
functionality provided by the menu bar options is also provided by icons on the Toolbar with a
single mouse click.

Note that only one main Tags program need be started. Within the main window of the Tags, you
can open a child window for each dataset. Opening multiple tags programs will result in data
loss and unpredictable window events.

Tags Menu Options


The following options are provided:

1. File;
2. Edit;
2. Tools; and
3. Help.

File
Under File, the available options are:

1. New;
2. Open;
3. Close;
4. Save;
5. Save As;
6. Save All; and
7. Exit.

The New option allows you to open a blank sheet for a given dataset. A dialog box will be
displayed, where you can specify the target dataset. Only the available datasets, i.e., datasets
which do not currently have a file open will be available to select from. Also, the
communications platform that this tags file will be using needs to be specified. Available
platforms are displayed in a dropdown list. The child window displayed will not have any tag
objects in it. You can, however, use the Edit--Add pulldown menu option to add tag objects to the
child window. The title of the blank child window will be as follows:

[new.pts] POINTS DSn

where n is the dataset number.

Original September 1995 63


UM25.0:SPE311
SIMVOX -- Version 2.3

The Open option allows you to open an existing tags file for a given dataset. A dialog box will
be displayed, where you can specify the target dataset and the tags file to open. Only the
available datasets, i.e., datasets which do not currently have a file open will be available to select
from. You can either directly enter the directory and file name into the dialog box fields or use
the Browse button to select from available files on disk.

After completing the dialog box, press the OK push--button to load the selected file into the
selected dataset. This opens a child window under the main Tags window. The title of this child
window will be as follows:

[filename.pts] POINTS DSn

where filename.pts is the file you selected, and n is the dataset.

Once opened, the Tag object data is displayed in a spreadsheet--like form. Each row corresponds
to a single object. You can scroll within each child window to view records. Vertical scroll bars
are provided so that data, hidden from view, at the bottom of the spreadsheet, can be displayed.
Object data, hidden from view, on the right side of the spreadsheet, can be displayed by scrolling
horizontally.

The top right corner of each child window has the maximize and minimize buttons. By pressing
the minimize button, the child window can be reduced to an icon, and placed at the bottom of the
main Tags window. You can drag the icon and move it to improve the visibility as necessary.
Double clicking on the icon will restore the child window to its original dimensions.

The top left corner of the child window contains the System menu options for the window.
Double clicking on it will close the window.

After loading the tags into a dataset, there is a 15 second delay. After this delay, the tags process
starts resolving the modeling defined for the tag objects on a 1 second scan. Each object can be
defined to have it own scan rate. You can also take individual objects off--line. Off--line objects
are not resolved at all. Additional detail of tag control is provided in section 6.1.3.

All 4 datasets can be loaded into child windows. It is not necessary to start additional Tag
programs. In fact, doing so will give unpredictable results.

The Close option allows you to close all open dataset child windows. To close a single dataset,
double click on the top left corner of the window for that dataset. Selecting Close will close the
windows of ALL the datasets. Closed windows mean that the tag objects are not loaded and
therefore, not being modeled.

Original September 1995 64


UM25.0:SPE311
SIMVOX -- Version 2.3

The Save option allows you to save open tags files to disk. If there is only one dataset open,
Save will write its window contents to the disk file. If more than one dataset is open, a dialog
box will be displayed, prompting you to select which dataset to save. When the file is saved, the
original contents of the file are lost, i.e., no backup file is created. The window is left open,
however.

The Save As option allows you to save the open file to disk and give it a new name. Again, the
window remains open. To shut a child window, simply double click on the top left corner of the
child window.

The Save All option allows you to save all open files to disk.

Note that changes made to the tags file via the Notepad application, or other text editor, while the
dataset is still open will be overwritten with data from the dataset when the save options are
used.

The Exit option terminates the Tags process and the main window is shut down, including all
child windows.

Edit
Under Edit, the available options are:

1. Add;
2. Modify; and
3. Delete.

The Add option can be selected when a new dataset child window (blank sheet) is opened as
well as to add new objects to existing tag files in open child windows.

When selected, a dialog box is displayed from where you must select the dataset and the tag type
of the object to be added. Only the available datasets, i.e., datasets which currently have open
child windows will be available to select from. Additionally, the tag type must be selected by
clicking on the appropriate radio button. The different type of tags that can be added are Analog
Input, Analog Output, Discrete Input, Discrete Output, and Pulse Count Input. The default tag
type is Analog Input. After selecting the tag type, press the OK push--button. Depending on the
tag type selected, a dialog box will be displayed. Completing this dialog box and pressing the
OK push--button will add the tag to the child window. (Look at Section 6.1.3.3. -- Tag Detail
Dialog for details on completing the dialog box)

Now you can elect to add another tag of the same type or select a different type. When you are
done adding tag objects, simply press the Done push--button to return to the child window
display.

Original September 1995 65


UM25.0:SPE311
SIMVOX -- Version 2.3

The Modify option can be selected to modify an existing tag object. When selected, a dialog
box is displayed from where you must select the dataset and the tag type of the object to be
modified. Only the available datasets, i.e., datasets which currently have open child windows
will be available to select from. The tag type must also be selected by clicking on the appropriate
radio button. The default tag type is Analog Input. After selecting the tag type, press the OK
push--button. Depending on the tag type selected, a dialog box will be displayed.

In this dialog box, you will be able to select, by tag, the object you want to modify. The tags will
be available in a dropdown list. Picking a specific tag will display the object details. Now you
can modify the object fields. You can either Save this object or clone it by using the Save As
button. To save the object, simply press the Save button. If you press the Save As button, a
dialog box will be displayed. In this dialog box, simply enter a new tag and, if the new object is
for a different dataset, specify the new dataset. Now press the OK push--button. SIMVOX will
check for valid tag and valid I/O address before adding the object to the database. Duplicate tags
and I/O addresses within the same dataset are not allowed. If the new object passes these tests, it
will be displayed in the appropriate datasets child window.

Now you can elect to modify another tag of the same type or select a different type. When you
are done modifying tag objects, simply press the Done push--button to return to the child window
display.

The Delete option is available only when an entire dataset is off--line. This is because the on--line
nature of objects (interdependence) would otherwise be disrupted. For example, a Loop may be
tracking the value of a tag object. This link is created when the objects are loaded into child
windows. Subsequent deletion of that tag object without reloading and reestablishing the links
will give unpredictable results. It is recommended, therefore, that object deletions be performed
with caution.

To delete an object, first take the dataset off--line. This is done from a Toolbar icon. Please refer
to the on--line help for details. Selecting the dataset on/off--line button will display a dialog box.
Select the dataset and then offline radio button. Press OK to take the tag objects for the entire
dataset off--line.

Now select the Delete option. This will display a dialog box from where you can select the
dataset, the tag type to delete and the object to delete. The tags of the selected tag type are
displayed in a dropdown list. You can select a specific tag and then press the OK push--button.
This will remove the object from the SIMVOX database, and delete it from the datasets child
window.

Original September 1995 66


UM25.0:SPE311
SIMVOX -- Version 2.3

When you are done deleting, press the Done push--button. This will reload the tag objects into
the child window. Note that this does not currently reload other objects, i.e., Discrete Control
Device and Loop, or calculations. You must perform that function manually to ensure that the
dynamic links are properly resolved.

Tools
Under Tools, the available options are:

1. Select;
2. Scan On/Off;
3. Reset; and
4. Document.

The Select option allows you to perform searches on tags by specifying specific tags or partial
tags. The specified tag or partial tag is matched with loaded data and the result (matching tags)
are displayed. The * (asterisk) is a wild card. It may be used to prepend or append a series of
letters. For example:

To display tags with: Specify Mask as:

All tags which begin X X*


All tags which end with X *X
All tags which have X embedded *X*

For Tags, you can perform the search for a particular type of tag, e.g., AI, AO, etc., using either a
partial tag substring or a partial strategy substring.

The Scan On/Off option allows you to take an entire dataset Online or Offline. Note that this
does not automatically lock the individual tags. A dataset must be Offline for the Edit--Delete to
be available.

The Reset option allows you to reinitialize the I/O and dynamic links of an entire dataset. All
tags are initialized to their individual initial values and all dynamic links to other tags are
resolved.

The Document option allows you to create and print a document file comprising the tags and
their dependencies for an entire dataset.

Help
Under Help, the available options are:

Original September 1995 67


UM25.0:SPE311
SIMVOX -- Version 2.3

1. Help; and
2. About.

The Help option allows you to access the Tags on--line help. Much of the information in this
document is also included in the on--line help. Additional details regarding Toolbar icons are also
provided.

The About option displays the About box. The Tags revision level, licensee and serial number
information is included here.

Original September 1995 68


UM25.0:SPE311
SIMVOX -- Version 2.3

4.5 Calculations
When this option is selected, the Calculations program is started and the Calculations main
window is displayed. At the top of this window is the menu bar and immediately below it is the
Toolbar. Much of the functionality provided by the menu bar options is also provided by icons
on the Toolbar with a single mouse click.

Note that only one main Calculations program need be started. Within the main window of the
Calculations, you can open a child window for each dataset. Opening multiple Calculations
programs will result in data loss and unpredictable window events.

The Calculations functionality is similar to Tags.

Calculations Menu Options


The following options are provided:

1. File;
2. Edit;
3. Tools; and
4. Help.

File
Under File, the available options are:

1. New;
2. Open;
3. Close;
4. Save;
5. Save As;
6. Save All; and
7. Exit.

The New option allows you to open a blank sheet for a given dataset. A dialog box will be
displayed, where you can specify the target dataset. Only the available datasets, i.e., datasets
which do not currently have a file open will be available to select from. The child window
displayed will not have any calculation objects in it. You can, however, use the Edit--Add
pulldown menu option to add calculation objects to the child window. The title of the blank child
window will be as follows:

[new.clc] Calculations DSn

Original September 1995 69


UM25.0:SPE311
SIMVOX -- Version 2.3

where n is the dataset number.

The Open option allows you to open an existing calculations file for a given dataset. A dialog
box will be displayed, where you can specify the target dataset and the calculations file to open.
Only the available datasets, i.e., datasets which do not currently have a file open will be available
to select from. You can either directly enter the directory and file name into the dialog box fields
or use the Browse button to select from available files on disk.

After completing the dialog box, press the OK push--button to load the selected file into the
selected dataset. This opens a child window under the main Calculations window. The title of
this child window will be as follows:

[filename.clc] Calculations DSn

where filename.clc is the file you selected, and n is the dataset.

Once opened, the Calculations object data is displayed in a spreadsheet--like form. Each row
corresponds to a single object. You can scroll within each child window to view records which
are not visible. For this vertical scroll bars are provided. Object data, hidden from view, on the
right side of the spreadsheet, can be displayed by scrolling horizontally.

The top right corner of each child window has the maximize and minimize buttons. By pressing
the minimize button, the child window can be reduced to an icon, and placed at the bottom of the
main Calculations window. You can drag the icon and move it to improve the visibility as
necessary. Double clicking on the icon will restore the child window to its original dimensions.

The top left corner of the child window contains the System menu options for the window.
Double clicking on it will close the window.

After loading the calculations into a dataset, there is a 15 second delay. After this delay, the
Calculations process starts resolving the expressions defined for the objects on a 1 second scan.
Each object can be defined to have it own scan rate. You can also take individual objects
off--line. Off--line objects are not resolved at all. Additional detail of calculation control is
provided in section 6.1.4.

All 4 datasets can be loaded into child windows. It is not necessary to start additional Calculation
programs. In fact, doing so will give unpredictable results.

Original September 1995 70


UM25.0:SPE311
SIMVOX -- Version 2.3

The Close option allows you to close all open dataset child windows. To close a single dataset,
double click on the top left corner of the calculation window for that dataset. Selecting Close
will close the calculation windows for ALL the datasets. Closed windows means that the
calculation objects are not loaded and therefore, not available to other subsystems in SIMVOX.

The Save option allows you to save open calculations files to disk. If there is only one dataset
open, Save will write its window contents to the disk file. If more than one dataset is open, a
dialog box will be displayed, prompting you to select which dataset to save. When the file is
saved, the original contents of the file are lost, i.e., no backup file is created. The window is left
open, however.

The Save As option allows you to save the open file to disk and give it a new name. Again, the
window remains open. To shut a child window, simply double click on the top left corner of the
child window.

The Save All option allows you to save all open files to disk.

Note that changes made to the calculations file via the Notepad application, or other text editor,
while the dataset is still open will be overwritten with data from the dataset when the save
options are used.

The Exit option terminates the Calculations process and the main window is shut down,
including all child windows.

Edit
Under Edit, the available options are:

1. Add;
2. Modify; and
3. Delete;

The Add option can be selected when a new dataset child window (blank sheet) is opened as
well as to add new objects to existing calculation files in open child windows.

When selected, a dialog box is displayed where you must enter the details of the new calculation
to be added. (The data fields to be entered are described in detail in Section 6.1.4.3). Only the
available datasets, i.e., datasets which currently have open child windows will be displayed.
After completing the dialog box, you can press the OK push--button. This will add the
calculation to the child window.

Original September 1995 71


UM25.0:SPE311
SIMVOX -- Version 2.3

The Modify option can be selected to modify an existing calculation object. When selected, a
dialog box is displayed from where you must select, by tag, the object you want to modify. The
tags will be available in a dropdown list. Picking a specific tag will display the object details.
Now you can modify the object fields. You can either Save this object or clone it by using the
Save As button. To save the object, simply press the Save button. If you press the Save As
button, a dialog box will be displayed. In this dialog box, simply enter a new tag and, if the new
object is for a different dataset, specify the new dataset. Now press the OK push--button.
SIMVOX will check for valid tag before adding the object to the database. Duplicate tags within
the same dataset are not allowed. If the new object passes this test, it will be displayed in the
appropriate datasets child window.

The Delete option is available only when an entire dataset is off--line. This is because the on--line
nature of objects (interdependence) would otherwise be disrupted. For example, a Loop may be
tracking the value of a calculation object. This link is created when the objects are loaded into
child windows. Subsequent deletion of that calculation object without reloading and
reestablishing the links will give unpredictable results. It is recommended, therefore, that object
deletions be performed with caution.

To delete an object, first take the dataset off--line. This is done from a Toolbar icon. Please refer
to the on--line help for details. Selecting the dataset on/off--line button will display a dialog box.
Select the dataset and then the offline radio button. Press OK to take the calculation objects for
the entire dataset off--line.

Now select the Delete option. This will display a dialog box from where you can select, by tag,
the object to delete. The tags in the selected dataset are displayed in a dropdown list. You can
select a specific tag and then press the OK push--button. This will remove the object from the
SIMVOX database, and delete it from the datasets child window.

When you are done deleting, press the OK push--button. This will reload the calculation objects
into the child window. Note that this does not currently reload other objects, i.e., Discrete
Control Device and Loop, or Tags. You must perform that function manually to ensure that the
dynamic links are properly resolved.

Tools
Under Tools, the available options are:

1. Select;
2. Scan On/Off;
3. Reset; and
4. Document.

Original September 1995 72


UM25.0:SPE311
SIMVOX -- Version 2.3

The Select option allows you to perform searches on tags by specifying specific tags or partial
tags. The specified tag or partial tag is matched with loaded data and the result (matching tags)
are displayed. The * (asterisk) is a wild card. It may be used to prepend or append a series of
letters. For example:

To display tags with: Specify Mask as:

All tags which begin X X*


All tags which end with X *X
All tags which have X embedded *X*

The Scan On/Off option allows you to take an entire dataset Online or Offline. Note that this
does not automatically lock the individual tags. A dataset must be Offline for the Edit--Delete to
be available.

The Reset option allows you to reinitialize the I/O and dynamic links of an entire dataset. All
tags are initialized to their individual initial values and all dynamic links to other tags are
resolved.

The Document option allows you to create and print a document file comprising the tags and
their dependencies for an entire dataset.

Help
Under Help, the available options are:

1. Help; and
2. About.

The Help option allows you to access the Calculations on--line help. Much of the information in
this document is also included in the on--line help. Additional details regarding Toolbar icons are
also provided.

The About option displays the About box. The Calculations revision level, licensee and serial
number information is included here.

Original September 1995 73


UM25.0:SPE311
SIMVOX -- Version 2.3

4.6 Manipulate by Channel


When this option is selected, the Manipulate program is started and the manipulate window is
displayed. At the top of this window is the menu bar and immediately below it is the Toolbar.
Much of the functionality provided by the menu bar options is also provided by icons on the
Toolbar with a single mouse click.

Manipulate Menu Options


The following options are provided:

1. Options;
2. Tools;
3. Functions; and
4. Help.

Options
Under Options, the available options are:

1. New Dataset;
2. Update Rate; and
3. Exit.

The New Dataset option allows you to open a dataset child window under the Manipulate main
window. Prior to opening the child window, a dialog box is presented where you can select the
dataset. It is assumed that you started communications on the selected dataset prior to opening
the dataset for data manipulation. Consequently, the child window will be titled as follows:

[filename.sio] Dataset n

where filename.sio is the file you used to start communications with and n is the dataset number.

The data displayed in the child window is formatted as dictated by the SIO file used for the
dataset. You can use the keyboard arrow keys to navigate the rows and columns of data
displayed or use the mouse to position the cursor on a specific cell. Only the input channels, e.g.,
Analog Inputs and Discrete Inputs will be editable. The Output channels are controlled by the
controller. You can, however, move the cursor to an output channel and edit a value in. The value
is discarded by the manipulate process. Only the values edited into input channel cells are
checked for validity and then saved in the SIMVOX database. Once saved in the SIMVOX
database, they are asynchronously communicated to the controller by the communication
process.

Original September 1995 74


UM25.0:SPE311
SIMVOX -- Version 2.3

With a dataset open, the channel data values are updated by default on a 15 second scan.

The Update Rate option can be used to change the rate of update. When selected, a dialog box is
displayed with a dropdown list of time values in seconds. The maximum time value is 15. You
can select an update time value from the list and press the OK push--button. This will change the
update time for the subject child window (window in focus).

The Exit option exits the Manipulate program and the main window and all child windows are
shut down.

Tools

Under Tools, the available options are:

1. SIO Configuration; and


2. Counts.

The SIO Configuration option immediately changes the display to show the underlying SIO
configuration. This allows you to view the type of channels for which data was being displayed.
This is an invaluable tool in troubleshooting configuration problems. By selecting SIO
Configuration again, the display will change back to the default.

The Counts option switches the I/O channel value display format. For Analog channels, it
changes the display to show A/D counts. For discrete channels, no data is displayed. By selecting
Counts again, the display will change back to the default where analog data is displayed in
percent and discrete data is displayed as 0 or 1.

Functions

Under Functions, the available options are:

1. Lock;
2. Unlock;
3. Unlock All;
4. Toggle;
5. Set Input; and
6. Ramp Input.

The Lock option allows you to lock channels such that they may be accessed for modification
only through the Manipulate window. A locked channel cannot be modified programmatically
using library functions or by other features of SIMVOX. Locked channels have a red
background and a white foreground. A dialog box is displayed where you can specify the
platform specific address of the channel to be locked. This functionality is also provided from
the Toolbar icon labeled L. With the cursor positioned on a specific file--card--channel, press
the toolbar icon L to lock that channel.

Original September 1995 75


UM25.0:SPE311
SIMVOX -- Version 2.3

The Unlock option allows you to unlock channels such that they are again accessible for
modification either from the built--in modeling environment or programmatically by external
programs. Unlocked channels have a white background and a grey/black foreground. A dialog
box is displayed where you can specify the platform specific address of the channel to be
unlocked. This functionality is also provided from the Toolbar icon labeled U. With the cursor
positioned on a specific file--card--channel, press the toolbar icon U to unlock that channel.

The Unlock All option allows you to unlock all locked channels such that they are again
accessible for modification either from the built--in modeling environment or programmatically
by external programs. Unlocked channels have a white background and a grey/black foreground.
No dialog box is displayed. The action is carried out immediately. This functionality is also
provided from the Toolbar icon labeled UA.

The Toggle option works only on discrete channels and allows you to toggle the discrete value
from 0 to 1 or 1 to 0. A dialog box is displayed where you can specify the platform specific
address of the channel. Note that this functionality is also provided by simply double clicking on
the discrete channel cell. This functionality is also provided from the Toolbar icon labeled T.
With the cursor positioned on a specific file--card--channel, press the toolbar icon T to toggle the
discrete channel.

The Set Input option allows you to set the value of Analog Input, Pulse Count Input or Weigh
Scale Interface channels. A dialog box is displayed where you can specify the platform specific
address of the channel to be modified, and also specify the new value. Analog Input values are
specified in percent, 0 to 100. Pulse Count Input values are specified as counts and rate. This
functionality is also provided from the Toolbar icon labeled S.

The Ramp Input option allows you to ramp (or linearly increment) the value of Analog Input or
Pulse Count Input channels, either up or down, over a time period. The increments are calculated
by dividing the difference between the target and the original value by the transition time. A
dialog box is displayed where you can specify the platform specific address of the channel to be
ramped, the new value, and a time period. Analog input values are specified in percent, 0 to 100.
Pulse Count Input values are specified as counts and a rate period. This functionality is also
provided from the Toolbar icon labeled R.

Original September 1995 76


UM25.0:SPE311
SIMVOX -- Version 2.3

Help
Under Help, the available options are:

1. Help; and
2. About.

The Help option allows you to access the Manipulate on--line help. Much of the information in
this document is also included in the on--line help. Additional details regarding Toolbar icons are
also provided.

The About option displays the About box. The Manipulate revision level, licensee and serial
number information is included here.

Original September 1995 77


UM25.0:SPE311
SIMVOX -- Version 2.3

5.0 Programmatic Access


Programmatic access to the simulated I/O channels is accomplished through callable subroutines
included with SIMVOX. These subroutines are the building blocks of external tiebacks and
models. SIMVOX provides these services through a well defined Application Programming
Interface (API), via a Dynamic Link Library (DLL). The SIMVOX DLLs for this purpose are as
follows:

Platform DLL and LIB Name

EIC SIMAPI.DLL, SIMAPI.LIB


IDI SIMAPI.DLL, SIMAPI.LIB
VIOC SIM10.DLL, SIM10.LIB
RS3 RS3API.DLL, RS3API.LIB
TI565 TIAPI.DLL, TIAPI.LIB
GE Series None
Allen Bradley PLC3 and PLC5 SIMAPI_A.DLL, SIMAPI_M_LIB
Modicon SIMAPI_M.DLL, SIMAPI_M.LIB

All library calls follow a similar calling format, comprising a dataset number as the minimum
argument or parameter. Additional parameters are dependent on individual functions and
include an I/O address, e.g., file--card--channel, a value to read/write, a returned error code and
an error destination. The error code returned reflects the success or failure of the call. In all
cases a return code of zero indicates success. Any other return code indicates failure. Non--zero
error codes with corresponding messages are detailed in Appendix F.

Tiebacks and Models may access I/O channels on a given dataset only if they are attached to that
dataset. SIMVOX library subroutines SIM10_ATTACH_DS, SIM20_ATTACH_DS,
SIM_AB_ATTACH_DS, SIM_MOD_ATTACH_DS or SIM_TI_ATTACH_DS (for Provox
VIOC, Provox EIC/IDI, Allen Bradley PLC3/PLC5, Modicon MODBUS/MODBUS+, or TI565
respectively) must be called to perform the attaching process. Details for these subroutines can
be found in Appendices A--E and also in the SIMVOX on--line help.

Typically, each tieback and model has a hard coded dataset number in it. Should the need to
attach to a different dataset arise, this hard coded number must be changed and the program
recompiled and linked. Alternatively, you may use the SIM10_GETDS, SIM20_GETDS etc., or
SIM10_GET_ALL_DS, SIM20_GET_ALL_DS etc. functions which retrieve the dataset
number(s) from the command line. Dataset numbers are placed in the command line when
external tiebacks/models are started from the SIMVOX main menu system. With these functions,
programs need not be compiled and linked each time a dataset changes.

Original September 1995 78


UM25.0:SPE311
SIMVOX -- Version 2.3

It is important to remember that while both input and output channels can be monitored, only
inputs may be changed. Furthermore, individual input channels may be locked by the user.
Please refer to section 4.6 for details on channel locking. Such locked channels are inaccessible
for changing by tiebacks and models and attempted modifications will result in an error
condition. This error condition is mainly for the users information and does not affect the
simulation in any way.

SIMVOX library routines can be grouped together based on the function and type of channel
they access. These groups are: Analog I/O, Discrete I/O, Discrete Control Devices, Loops, Pulse
Count Inputs, Time Proportional Outputs, and miscellaneous support routines. The following
subsections describe functionality of these groups. Detailed information about each subroutine
and its corresponding argument list can be found in Appendices A--E.

5.0.1 Analog I/O


Analog input/output function calls can either be made in count, percent, or engineering units
format. Each analog value is stored as an integer number in the range of 0 to 4095. This range
represents --25% to +100% for all analog channel types. Using the appropriate call, you may
access this information in counts or percent. In either case, conversion to engineering units must
be done programmatically by the user.

Note that for all Analog I/O channel types, 0% corresponds to 819 counts. If for any reason, you
must know or set the exact number of counts on the channel, working in counts is suggested.
For most applications, however, working in percent or engineering units is much easier.

WSI channel types behave the same as analog inputs, with values in the range --25.0 to 100.0
percent. If the configuration has WSI channels in it, use the Analog Input GET and SET
functions to retrieve and set WSI channel values.

The following are the analog input/output subroutines for PROVOX EIC and IDI:

SIM20_GETAIC -- Get analog input value in counts


SIM20_GETAIP -- Get analog input value in percent
SIM20_GETAOC -- Get analog output value in counts
SIM20_GETAOP -- Get analog output value in percent
SIM20_SETAIC -- Set analog input value in counts
SIM20_SETAIP -- Set analog input value in percent
SIM20_GETAIE -- Get analog input value in engineering units
SIM20_GETAIC_FCC -- Get analog input value in counts
SIM20_GETAIP_FCC -- Get analog input value in percent

Original September 1995 79


UM25.0:SPE311
SIMVOX -- Version 2.3

SIM20_GETAOC_FCC -- Get analog output value in counts


SIM20_GETAOP_FCC -- Get analog output value in percent
SIM20_SETAIC_FCC -- Set analog input value in counts
SIM20_SETAIP_FCC -- Set analog input value in percent
SIM20_GETAIE_FCC -- Get analog input value in engineering units

Analog input/output subroutines for PROVOX VIOC, Allen Bradley PLC3 and PLC5, Modicon
MODBUS and MODBUS+, and TI565 are similar to the above (Appendices B--E).

5.0.2 Discrete I/O

Discrete input/output subroutine calls can operate on a single channel or on all sixteen channels
of a card. The single--channel GETDI call returns a value of 1 or 0; likewise the single--channel
SETDI call will accept only values of 1 or 0. The GETDIW call returns a value corresponding
to all sixteen channels of the card. Only the bottom 16 bits of the variable are used. Each bit
represents the value of a channel on that card (channel 1 corresponds to bit 0, or the least
significant bit; channel 8 corresponds to bit 7); likewise the SETDIW call will accept only values
in the range of 0 through 65535.

The following are the discrete input/output subroutines for PROVOX EIC and IDI:

SIM20_GETDI -- Get discrete input channel value


SIM20_GETDIW -- Get discrete input word (16 channels)
SIM20_GETDO -- Get discrete output channel value
SIM20_GETDOW -- Get discrete output word (16 channels)
SIM20_SETDI -- Set discrete input channel value
SIM20_SETDIW -- Set discrete output word (16 channels)
SIM20_GETDI_FCC -- Get discrete input channel value
SIM20_GETDIW_FCC -- Get discrete input word (16 channels)
SIM20_GETDO_FCC -- Get discrete output channel value
SIM20_GETDOW_FCC -- Get discrete output word (16 channels)
SIM20_SETDI_FCC -- Set discrete input channel value
SIM20_SETDIW_FCC -- Set discrete output word (16 channels)

Discrete input/output subroutines for PROVOX VIOC, Allen Bradley PLC3 and PLC5, Modicon
MODBUS and MODBUS+, and TI565 are similar to the above (Appendices B--E).

Original September 1995 80


UM25.0:SPE311
SIMVOX -- Version 2.3

5.0.3 Discrete Control Devices


When the Discrete Control Device subroutine is invoked, the output pattern for the setpoint of
the Discrete Control Device is evaluated and the process variable is set to the corresponding
input pattern identified by the Discrete Control Device template.

Each Discrete Control Device template requires a 35--element array to define the template. The
elements of the array are defined as follows:

Elements Use
1 Number of setpoints (1--16)
2 Number of discrete outputs (1--8)
3 Number of discrete inputs (1--16)
4--19 Discrete output patterns for each of the 16 possible set-
points (0--255)
20--35 Discrete input patterns for each of the 16 possible setpoints
(0--65535)

To further clarify, element 4 contains the output pattern for setpoint #1, element 5 contains the
output pattern for setpoint #2, e.t.c. The output pattern is the decimal representation of the bit
pattern of the discrete outputs for a given setpoint. For example, if setpoint #3 has outputs 1, 2,
3, and 5 in the ON or ONE state, the number that goes into element 6 would be 23. Note that
output 8 represents the most significant bit while output 1 is the least significant bit.

Output # 1 2 3 4 5 6 7 8
Value 1 1 1 0 1 0 0 0
Weight: 1 2 4 8 16 32 64 128

Output Pattern = 1 + 2 + 4 + 16 = 23 (decimal)

Input patterns are handled in a similar manner.

Each Discrete Control Device tag to be evaluated requires a separate call to the Discrete Control
Device subroutine. The Discrete Control Device subroutine requires a 16--element input array
and an 8--element output array. These arrays contain the file--card--channel addresses of the
discrete input and output channels associated with the Discrete Control Device. The names of
the arrays should reflect the tag of the Discrete Control Device to simplify troubleshooting the
tieback program.

Original September 1995 81


UM25.0:SPE311
SIMVOX -- Version 2.3

For example, if a Discrete Control Devices tag was XV--2217 the input and output arrays could
be named XV_2217_I and XV_2217_O respectively. It is recommended that the array name end
in I if the array is an input array and an O (O, not zero) if the array is an output array.

NOTE

Unused elements in the arrays should be set to zero.

A transition time and transition PV are provided in case the user wishes to simulate the time it
takes for a valve to stroke from one position to another. The transition time is the number of
seconds to wait before setting up the new PV on the inputs after a new SP appears on the
outputs. The transition PV is the PV to set up on the inputs during the transition time. If you do
not wish to simulate a transition time, these arguments should both be set to zero.

NOTE

There is a two second or longer time lag from when a


console setpoint is sent and when confirmation is seen,
outside of the transition time.

Following is an example of using the Discrete Control Device subroutine for PROVOX EIC and
IDI to evaluate a two--output, four--input Discrete Control Device with the tag CV--100.
CV--100 uses the template called TEMPLATE which appears as follows:

SP # SP Value O1 O2 I1 I2 I3 I4
1 closed 0 0 0 0 0 0
2 tank A 1 0 0 1 0 1
3 tank B 0 1 1 0 1 0
4 tank A & B 1 1 1 1 1 1
Addresses for outputs and inputs are:

Output 1 @ 2--2--1
Output 2 @ 2--2--2
Input1 @ 1--1--1
Input 2 @ 1--1--2
Input 3 @ 1--1--3
Input 4 @ 1--1--4

Original September 1995 82


UM25.0:SPE311
SIMVOX -- Version 2.3

The FORTRAN code for the above Discrete Control Device is as follows:

INTEGER DS /1/
INTEGER ERROR
INTEGER CV_100_o (8) /20201,20202,0,0,0,0,0,0/
INTEGER CV_100_i (16) /10101,10102,10103,10104,0,0,0,0,0,0,0,0,0,0,0,0/
INTEGER TEMPLATE (35) /4,2,4,
0,1,2,3,0,0,0,0,0,0,0,0,0,0,0,0,
0,10,5,15,0,0,0,0,0,0,0,0,0,0,0,0/

.
.
.
CALL SIM20_DCD (DS, TEMPLATE, CV_100_o, CV_100_i, 1, ERROR, 1, 0, 0)

To simulate a transition time of 3 seconds, and a PV of I1=1, I2=1, I3=0, I4=1 as inputs during
the transition time. The following Discrete Control Device call will be used.

CALL SIM20_DCD (DS, TEMPLATE, CV_100_o, CV_100_i, 1, ERROR, 1, 3, 11)

The C code for the above Discrete Control Device is as follows:

long ds =1;
long error
long cv_100_o [8] ={20201,20202,0,0,0,0,0,0};
long cv_100_i [16] ={10101,10102,10103,10104,0,0,0,0,0,0,0,0,0,0,0,0};
long template [35] ={4,2,4,
0,1,2,3,0,0,0,0,0,0,0,0,0,0,0,0,
0,10,5,15,0,0,0,0,0,0,0,0,0,0,0,0};
.
.
.
SIM20_DCD (&DS, TEMPLATE, CV_100_o, CV_100_i, 1, &ERROR, 1, 0, 0);

To simulate a transition time of 3 seconds, and a PV of I1=1, I2=1, I3=0, I4=1 as inputs during
the transition time. The following Discrete Control Device call will be used.

SIM20_DCD (&DS, TEMPLATE, CV_100_o, CV_100_i, 1, &ERROR, 1, 3, 11);

See the SIMVOX Examples section for complete examples of tieback programs which use
Discrete Control Device calls.

5.0.4 Loops
There are two loop functions in the SIMVOX library for PROVOX EIC and IDI. These are
SIM20_LOOP and SIM20_LAGLOOP. For PROVOX VIOC, Allen Bradley PLC3, Allen
Bradley PLC5, Modicon MODBUS, Modicon MODBUS+ and TI565 there is one loop function,
SIM10_LOOP, SIM_AB_LOOP etc.

SIM10_LOOP, SIM20_LOOP etc. simply tie output to input. SIM20_LAGLOOP ties output to
input with a first order lag. The time constant for the lag is specified by the user.

Original September 1995 83


UM25.0:SPE311
SIMVOX -- Version 2.3

When the loop subroutine is invoked for REVERSE acting loops, the PV (analog input) is set to
the valve output (analog output) multiplied by the gain. For DIRECT acting loops, the PV is set
to (100 -- valve output) multiplied by the gain. This DIRECT/REVERSE action is the SIMVOX
operand described in the following table:

VALVE PROVOX PV IVP SIGNAL SIMVOX


SIGNAL CONTROL OPERAND
ACTION ACTION NEEDED
FO/IC DIRECT UP UP DOWN REVERSE
FO/IC REVERSE UP DOWN UP DIRECT
FC/IO DIRECT UP UP UP DIRECT
FC/IO REVERSE UP DOWN DOWN REVERSE

where:
FO/IC = Fail open valve/increasing (signal) closes valve
FO/IO = Fail close valve/increasing (signal) opens valve
DIRECT = If PV increases, valve increases (opens) to maintain control
REVERSE = If PV increases, valve decreases (closes) to maintain control

For a FO/IC valve with direct control action and a FC/IO valve with reverse control action,
(reverse / inversion = yes argument selected):

PV = (100 -- signal) * gain factor

For a FO/IC valve with reverse control action and a FC/IO valve with direct control action,
(direct / inversion = no argument selected):

PV = signal * gain factor

These two equations are valid for loops configured to have PV input signals in the range --25%
to 100%. For PVs with elevated input signals (RTDs, Thermocouples, etc.) in the 0% to 125%
range, the loop subroutine will not work properly. Consequently, any signal conditioning must be
performed by the user in code.

Original September 1995 84


UM25.0:SPE311
SIMVOX -- Version 2.3

5.0.5 Pulse Count Inputs


Pulse count input channel values comprise raw counts and a pulse rate which are read by the E/I
card and passed on to the controller. The raw counts are a number in the range of 0 through
65535, while the pulse rate is computed by SIMVOX each time the raw counts change. The
configured rate period for the PCI channel in the controller device definition should be specified
in the SIM20_SETPCI call to compute the pulse rate. Using other rate periods may cause
discrepancies in the result. The units of rate are pulses per period, and this is converted to pulses
per minute by the controller. The following are the pulse count input subroutines for PROVOX
EIC and IDI:

SIM20_GETPCI -- Get Pulse Count Input Channel


SIM20_SETPCI -- Set Pulse Count Input Channel
SIM20_GETPCI_FCC -- Get Pulse Count Input Channel
SIM20_SETPCI_FCC -- Set Pulse Count Input Channel

5.0.6 Time Proportional Outputs


Time proportional output channels are arranged in pairs with a maximum of 8 channels per card.
Numbered from bit 0 to bit 7, all even channels are considered UP, while all odd channels are
DOWN. A base period and a deadband is configured for each channel pair. The deadband is
centered around 50% of output. The UP or DOWN channels in SIMVOX are pulsed by the E/I
card based on the output change. A pulsed channel changes from a 0 to a 1. The next output
from the E/I card resets it back to 0, i.e., TPO duration timing is not implemented. Bear in mind
that the time between two consecutive writes from the E/I card is approximately 500 ms,
minimum. Therefore, SIMVOX does not provide functions to read TPO data. For customers
requiring TPO support, please contact Munger Co., Inc. for solutions.

5.0.7 Miscellaneous
The following are miscellaneous subroutines for PROVOX EIC and IDI used in coding tiebacks
and models on the VAX.

SIM20_ATTACH_DS Attach to dataset


SIM20_ATTACH_MULTI_DS Attach to multiple datasets
SIM20_GETDS Get single dataset number from command line
SIM20_GET_ALL_DS Get multiple dataset numbers from command
line
SIM20_DELAY Wait specified amount of time
SIM20_SLEEP Wait for 1 second

Original September 1995 85


UM25.0:SPE311
SIMVOX -- Version 2.3

SIM20_WAKEUP Schedule periodically (not supported)

PROVOX VIOC, Allen Bradley PLC3, Allen Bradley PLC5, Modicon MODBUS, Modicon
MODBUS+ and TI565 have similar miscellaneous subroutines (Appendices B--E).

Original September 1995 86


UM25.0:SPE311
SIMVOX -- Version 2.3

6.0 Using SIMVOX


In Section 4, a SIMVOX functionality overview from a menu standpoint was presented. The
various commands available to the user were discussed.

Then in Section 5, the SIMVOX library of subroutines facilitating programmatic access to I/O
channels was discussed. The philosophy and functionality of each group of access subroutines
was presented.

In this section, we will present detailed examples for Tiebacks, Tags, Calculations, and Channel
Data Manipulation, using the built--in SIMVOX functionality. Additionally, the creation of
external programs is presented. Lastly, issues surrounding porting existing C or FORTRAN code
into SIMVOX are presented.

Original September 1995 87


UM25.0:SPE311
SIMVOX -- Version 2.3

6.1 Using Built--In SIMVOX Functionality


SIMVOX embodies functionality which does not require the traditional tieback and model
program to be written in a 3GL (3rd Generation Language), compiled, linked, debugged,
compiled, linked, ..., ad infinitum. Much of that functionality is provided in a windowing
environment with data displayed by tag in a spreadsheet lookalike form. Tiebacks, which
incorporate Discrete Control Device and Loop objects are displayed and controlled in the
Tieback Window. Tags, which incorporate Analog I/O, Discrete I/O, etc., objects are displayed
and controlled in the Tags Window. Special calculations comprising mathematical expressions
used in modeling are displayed in the Calculations Window. Together, these three windows (and
their embedded child windows) comprise the simulation environment of SIMVOX.

In addition to the built--in environment, SIMVOX provides a mechanism to seamlessly integrate


external programs using the programming API for the following reasons:

1. Backward compatibility with existing code; and


2. Special handling of process conditions as required.

6.1.1 Generating Simulated I/O Files


Simulated I/O files can be generated directly from the SIMVOX menu system (Tools option) if a
network link exists between the NT workstation and the VAX/HP.

To create an SIO file from the information contained in an ENVOX database the following
parameters must be specified:

(1) sa Password -- This is the Sybase system administrator password.

(2) Database -- The name of the ENVOX database where the device is located. Available
databases are displayed in a dropdown list.

(3) Device -- The name of the ENVOX device where the tags are located. Available devices are
displayed in a dropdown list.

(4) Output Directory -- The name of the output directory for the SIO generation.

After the appropriate selections have been made, press the OK push--button to begin SIO
generation.

To create an SIO file from the information contained in a PROFLEX controller definition file,
specify the file and select an output directory. Press the Browse push--button to browse available
directories.

Original September 1995 88


UM25.0:SPE311
SIMVOX -- Version 2.3

In the case if a network link does not exist between the NT workstation and the VAX/HP,
SIMVOX for Windows NT has 3 companion utilities which reside on the VAX/HP system. One
of these utilities is SIOGEN.EXE. This utility allows you to select the ENVOX database, and the
PROVOX device, from which configuration data is read and written to a target file. The target
file is binary (non printable) for Simulated I/O.

Once created, you must transfer this file to the NT Workstation via Kermit, FTP, or any other file
transfer program. If the Tools option is used, the resulting file is created in the NT workstation.

For example, follow these steps to create the SIO file using the VAX utility. Note that the $ in
the following commands is the VAX/VMS prompt and should not be typed. The bold italics text
is what you have to type, the normal text is computer response.

$ run siogen

NOTE: All user responses are case--sensitive

Enter Sybase sa password: database

The ENVOX databases are:

ENVOXDB
EXAMPLE

Enter ENVOX database: EXAMPLE

The devices in the EXAMPLE ENVOX database are:

IFC1
IFC2
UOC1
UOC2

Select device from ENVOX database EXAMPLE: IFC1

Enter output directory:[user doe]

The SIO file for IFC1 is now generated. It will be called IFC1.SIO and will be located in the
directory [user.doe], ready for transfer to the PC Workstation. If more than one EIC, IDI, or
VIOC exists in the controller multiple SIO files will be generated, e.g., IFC1--1 and IFC1--2. If
no EI or IDI cards are found, an SIO file is not created.

Original September 1995 89


UM25.0:SPE311
SIMVOX -- Version 2.3

6.1.2 Building Tieback Objects

6.1.2.1 Generating Tieback CDV files


Tieback CDV files can be generated directly from the SIMVOX menu system (Tools option) if a
network link exists between the NT workstation and the VAX/HP.

To create a Tieback file from the information contained in an ENVOX database the following
parameters must be specified:

(1) sa Password -- This is the Sybase system administrator password.

(2) Database -- The name of the ENVOX database where the device is located. Available
databases are displayed in a dropdown list.

(3) Device -- The name of the ENVOX device where the tags are located. Available devices are
displayed in a dropdown list.

(4) Output Directory -- The name of the output directory for the Tieback generation.

(5) Output File -- The name of the output file for the Tieback generation. If this field is not
entered the default filename is the device name of the tieback followed by the .tbk extension.

After the appropriate selections have been made, press the OK push--button to begin Tieback
generation.

To create a Tieback file from the information contained in a PROFLEX controller definition file,
specify the file and select an output directory. Press the Browse push--button to browse available
directories.

In the case if a network link does not exist between the NT workstation and the VAX/HP,
SIMVOX for Windows NT has 3 companion utilities which reside on the VAX/HP system. One
of these utilities is TBGEN.EXE. This utility allows you to select the ENVOX database, and the
PROVOX device, from which Discrete Control Device and Loop data is read and written to an
ASCII text file in the form of comma delimited values (CDV).

For example, follow these steps to create the CDV file using the VAX utility. Note that the $ in
the following commands is the VAX/VMS prompt and should not be typed. The bold italics text
is what you have to type, the normal text is computer response.

Original September 1995 90


UM25.0:SPE311
SIMVOX -- Version 2.3

$ run tbgen

NOTE: All user responses are case--sensitive

Enter Sybase sa password: database

The ENVOX databases are:

ENVOXDB
EXAMPLE

Enter ENVOX database: EXAMPLE

The devices in the EXAMPLE ENVOX database are:

IFC1
IFC2
UOC1
UOC2

Select device from ENVOX database EXAMPLE: IFC1

Enter output directory: [user.doe]

Reading tmplts ...


Reading DCDs ...
Reading Loops ...
Writing ...

The tieback CDV file for IFC1 is now generated. It will be called IFC1.TBK and will be located
in the directory [user.doe], ready for transfer to the PC Workstation.

The file created has a specific format. This format is described in the on--line help of Tiebacks.

When first created from ENVOX, this file does not contain any object personality information.
This must be added by you as described in section 6.1.2.4. Once created, you must transfer this
text file to the NT Workstation via Kermit, FTP, or any other file transfer program. If the Tools
option is used, the resulting CDV file is created in the NT workstation.

Original September 1995 91


UM25.0:SPE311
SIMVOX -- Version 2.3

6.1.2.2 Loading Tieback CDV files


With the Tieback window open, as described in Section 4, you can load the created tieback CDV
file, ifc1.tbk, into a child window. The following steps illustrate this:

Step 1.

Click on the File pulldown and then select Open;


OR
Click on the leftmost Toolbar icon (file folder open).

The Load Tieback dialog box will be displayed.

Step 2.

Select the dataset from the dropdown list. The list displayed will comprise all the available
datasets.

Step 3.

Press the Browse push--button to get the File Open dialog. You can browse around in the
directories and select the file, wherever it is located. Double clicking on the file, or single
clicking and then pressing the OK push--button will read the file name and directory into the
Load Tieback dialog box.

Step 4.

With the dataset selected and the tieback file selected, press the OK push--button. SIMVOX will
start reading the file, checking it for syntax errors as it goes along. If no errors are detected, the
Discrete Control Device and Loop child windows will be created.

If any errors are detected in the tieback file, an error message prompt will be displayed showing
the text in error. You can correct the errors by editing the tieback file with any standard text
editor. The Toolbar contains the notepad icon. You can use it to edit. Note that if the file was
created automatically by the VAX/VMS utility, it will not contain any errors.

Step 5.

If communications are already active with the controller, the tieback will start resolving. The
Discrete Control Device SP and PV fields of the spreadsheet display will reflect current
data. The Scan T and Scan fields of the display will show the current Discrete Control
Device resolve frequency and whether the Discrete Control Device is being scanned or not,
respectively. Additionally, if a Discrete Control Device personality has been defined, it will be
reflected in the Flow column of the display.

Original September 1995 92


UM25.0:SPE311
SIMVOX -- Version 2.3

Similarly, the Loop %IVP, %PV, and PV fields will reflect current data.

Step 6.

The tieback file is now loaded. The next step is to assign personalities to Discrete Control
Devices and Loops. This is described below.

6.1.2.3 Discrete Control Device Detail Dialog


In the Discrete Control Device child window, next to the PV column, there is a column of
buttons, one for each row. This button allows you to open a dialog box which contains the details
of the Discrete Control Device in that row.

Step 1.

Single click on this button. This will display a dialog box showing all the known details for the
Discrete Control Device.

Step 2.

The fields in this dialog are:

D Tag -- The tag is a label for the Discrete Control Device. This must be less than 16 characters
long.
D Description/Strategy -- (Optional) description and strategy.
D Template -- The Template defines the I/O patterns for this Discrete Control Device. The
template section contains a header and template data. The information must follow a
specified format.
D Scan time -- The scan time is the interval between updates to the tieback value. It can range
from 1 to 15 seconds.
D Transition Time -- Transition time is the amount of time this Discrete Control Device will
take to transition from one setpoint to another. It can range from 1 to 60 seconds.
D Transition PV -- Transition PV is the PV asserted while the Discrete Control Device is going
from one state to another. Note that the only PVs available are those defined by the
Template used for this Discrete Control Device. Additionally, you can choose to leave the
transition PV as undefined. In this case, SIMVOX will leave the current PV as the transition
PV.
D Online/Offline -- Online returns the Discrete Control Device tag to its original status. Offline
causes the Discrete Control Device to no longer be controlled by SIMVOX. An offline
Discrete Control Device is not resolved.

Original September 1995 93


UM25.0:SPE311
SIMVOX -- Version 2.3

D Input/Output Address -- Addresses are dependent upon the driver that is running on the
current dataset. The addressing scheme for different drivers is given in Appendix H.
D Type -- This specifies the Discrete Control Device type. This is for future expansion of
SIMVOX.
D Discrete Control Device Dynamics -- This is described in section 6.1.2.4.
D Tracking -- This is described in section 6.1.2.4.

Step 3.

After editing, press the OK push--button to save changes in the SIMVOX database (Uneditable
fields will be grey). If no changes were made or to discard changes, press the Cancel
push--button.

Step 4.

For dialog box help, simply press the Help push--button.

6.1.2.4 Assigning Discrete Control Device personality


Two sections in the Discrete Control Device detail dialog box allow you to assign a personality
to the subject Discrete Control Device. These are Discrete Control Device Dynamics and
Tracking sections.

Discrete Control Device Dynamics comprises two fields, Setpoint and Value. The Setpoint field
is a dropdown list of the template specific setpoints for this Discrete Control Device, with an
additional setpoint called UNDEF. The purpose here is to assign an engineering units value for
each setpoint. For example, for Valves and Pumps, this value represents flow characteristics
(gpm). So, for a valve Discrete Control Device wih two setpoints, OPEN and CLOSE,
engineering units value may be 200GPM and 100GPM respectively. Additionally, the CLOSE
setpoint may be defined with a non--zero engineering units value to simulate a leaking valve.
With these values specified, the Discrete Control Device will reflect the value indicated by its
current setpoint when it is referenced by other objects in the environment.

Step 1.

Select a setpoint in the dropdown list. This will enable the value edit field.

Step 2.

Enter a value in the Value field.

Step 3.

Original September 1995 94


UM25.0:SPE311
SIMVOX -- Version 2.3

Repeat Step 1 for the remaining setpoints. As the focus leaves the Value field, its data is read and
saved corresponding to the setpoint in the dropdown list.

The Discrete Control Device personality can further be defined by the Tracking section. You can
use the Tracking section to have the Discrete Control Device track devices upstream from its
location, e.g., other Discrete Control Devices or Loops, or you can use a Calculation to compute
a path based on the conjunction of various devices. In each case, the engineering units value of
the Discrete Control Device, Loop, or Calculation being tracked is used to determine the value of
the subject Discrete Control Device. Note that the minimum is always used. You may not want
to track any devices. In that case, select the Always radio button.

To track another Discrete Control Device:

Step 1.

Select the Track Discrete Control Device radio button.

Step 2.

Select the dataset of the Discrete Control Device to be tracked. The tieback for the dataset
selected must already be loaded. Otherwise, step 3 below will be meaningless.

Step 3.

Select the Discrete Control Device tag from the dropdown list. This list will be specific to the
dataset selected in step 2.

Step 4.

Select the condition operator. For Discrete Control Devices, only = and <> are available. The =
operator checks for equality, while <> checks for inequality.

Step 5.

Select the SP of the Discrete Control Device being tracked. The Discrete Control Device will be
tracked (its value used), if it is in the SP you select (or not in the SP you select based on step 4).
In the case that this condition evaluates to FALSE, the value returned is 0.0.

To track another Loop:

Step 1.

Original September 1995 95


UM25.0:SPE311
SIMVOX -- Version 2.3

Select the Track Loop radio button.

Step 2.

Select the dataset of the Loop to be tracked. The tieback for the dataset selected must already be
loaded. Otherwise, step 3 below will be meaningless.

Step 3.

Select the Loop tag from the dropdown list. This list will be specific to the dataset selected in
step 2.

Step 4.

Select the condition operator. For Loops, all operators are available (=, <, >, <=, >=, <>).

Step 5.

Specify a floating point value in the field below the operators. The Loop will be tracked (its
engineering units value used), if its PV compared to this value results in TRUE. Otherwise the
value returned is 0.0.

To track a Calculation:

Step 1.

Select the Track Calc radio button.

Step 2.

Select the dataset of the Calculation to be tracked. Note that the calculations must be loaded for
this dataset. Otherwise, step 3 will be meaningless.

Step 3.

Select the Calculation tag from the dropdown list. This list is specific to the dataset selected in
step 2.

After specifying the tracking details, simply press the OK button to save the data to the database.
Because of the online nature of SIMVOX, the changes you made will immediately go into effect.
To discard changes, press the Cancel button.

NOTE
The changes you made are held in memory only. To
save changes to disk, use the File--Save pulldown or
press the Toolbar disk icon.

Original September 1995 96


UM25.0:SPE311
SIMVOX -- Version 2.3

6.1.2.5 Loop Detail Dialog


In the Loop child window, next to the Units column, there is a column of buttons, one for each
row. This button allows you to open a dialog box which contains the details of the Loop in that
row.

Step 1.

Single click on this button. This will display a dialog box showing all the known detail for the
Loop.

Step 2.

The fields in this dialog are:

D Tag -- The tag is a label for the Loop. This must be less than 16 characters long.
D Description -- (Optional) description field.
D Scan time -- The scan time is the interval between updates to the tieback value. It can range
from 1 to 15 seconds.
D Online/Offline -- Online returns the Loop tag to its original status. Offline causes the Loop to
no longer be controlled by SIMVOX. An offline Loop is not resolved.
D Input/Output Address -- Addresses are dependent upon the driver that is running on the
current dataset. The addressing scheme for different drivers is given in Appendix H.
D Valve Gain -- This is the float numerical field that is used to multiply the output of the tag.
The default is 1.5.
D Action -- The action of the loop can be changed by selecting the appropriate radio button.
The Action should be based on the following matrix:

VALVE PROVOX PV IVP SIGNAL SIMVOX


SIGNAL CONTROL OPERAND
ACTION ACTION NEEDED
FO/IC DIRECT UP UP DOWN REVERSE
FO/IC REVERSE UP DOWN UP DIRECT
FC/IO DIRECT UP UP UP DIRECT
FC/IO REVERSE UP DOWN DOWN REVERSE
where:

Original September 1995 97


UM25.0:SPE311
SIMVOX -- Version 2.3

FO/IC Fail open valve/Increasing signal closes valve


FO/IO Fail close valve/increasing signal open value
DIRECT If PV increases, valve increases (opens) to maintain control
REVERSE If PV increases, valve decreases (closes) to maintain control

D Loop Evaluation Condition -- This is described in sections 6.1.2.6.


D Loop Dynamics -- This is described in section 6.1.2.7.

Step 3.

After editing, (non editable fields are grey) press the OK push--button to save changes in the
SIMVOX database. If no changes were made or to discard changes, press the Cancel
push--button.

Step 4.

For dialog box help, simply press the Help push--button.

6.1.2.6 Assigning Loop evaluation condition


With the Loop defined, you can control under what conditions it will get evaluated. These
conditions are specified in the Calculate block. If the loop is to execute at all times, check the
Always radio button.

To Calculate If Tag:

Step 1.

Select the If Tag radio button.

Step 2.

Select the dataset of the tag for the condition. The tags for the dataset selected must already be
loaded. Otherwise, step 4 below will be meaningless.

Step 3.

Select the type of the tag for the condition. The tags for the dataset selected must already be
loaded. Otherwise, step 4 below will be meaningless.

Step 4.

Select the tag from the dropdown list. This list will be specific to the dataset selected in step 2.

Original September 1995 98


UM25.0:SPE311
SIMVOX -- Version 2.3

Step 5.

Select the condition operator. For tags, all operators are available (=, <, >, <=, >=, <>).

Step 6.

Specify a floating point value in the field next to the operators. This value will be compared to
the engineering units value of the selected tag. The Loop will be evaluated if this condition
evaluates to TRUE. Otherwise the Loop will not be evaluated and, depending on Loop Type, the
decay specification will take effect.

To Calculate If Discrete Control Device:

Step 1.

Select the If Discrete Control Device radio button.

Step 2.

Select the dataset of the Discrete Control Device for the condition. The tieback for the dataset
selected must already be loaded. Otherwise, step 3 below will be meaningless.

Step 3.

Select the Discrete Control Device tag from the dropdown list. This list will be specific to the
dataset selected in step 2.

Step 4.

Select the condition operator. For Discrete Control Devices, only = and <> are available. The =
operator checks for equality, while <> checks for inequality.

Step 5.

Select the SP of the Discrete Control Device in the condition. The Discrete Control Device PV
will be compared to the selected SP. The Loop will be evaluated if this condition evaluates to
TRUE. Otherwise the Loop will not be evaluated and, depending on Loop Type, the decay
specification will take effect.

To Calculate If Loop:

Step 1.

Original September 1995 99


UM25.0:SPE311
SIMVOX -- Version 2.3

Select the If Loop radio button.

Step 2.

Select the dataset of the Loop for the condition. The tieback for the dataset selected must already
be loaded. Otherwise, step 3 below will be meaningless.

Step 3.

Select the Loop tag from the dropdown list. This list will be specific to the dataset selected in
step 2.

Step 4.

Select the condition operator. For Loops, all operators are available (=, <, >, <=, >=, <>).

Step 5.

Specify a floating point value in the field next to the operators. This value will be compared to
the engineering units value of the selected loop. The Loop will be evaluated if this condition
evaluates to TRUE. Otherwise the Loop will not be evaluated and, depending on Loop Type, the
decay specification will take effect.

To Calculate If Calculation:

Step 1.

Select the If Calc radio button.

Step 2.

Select the dataset of the Calculation for the condition. The Calculations for the dataset selected
must already be loaded. Otherwise, step 3 below will be meaningless.

Step 3.

Select the Calculation tag from the dropdown list. This list will be specific to the dataset selected
in step 2.

Step 4.

Select the condition operator. For Calculations, all operators are available (=, <, >, <=, >=, <>).

Original September 1995 100


UM25.0:SPE311
SIMVOX -- Version 2.3

Step 5.

Specify a floating point value in the field next to the operators. The Loop will be evaluated if
this condition evaluates to TRUE. Otherwise the Loop will not be evaluated and, depending on
Loop Type, the decay specification will take effect.

After specifying the Calculate condition details, specify the Loop personality as described in
section 6.1.2.7.

6.1.2.7 Assigning Loop personality


Loop personality is the heart of how the loop will function. Specifying loop personality
comprises selecting from two sets of radio buttons to specify type, and then pressing the Details
push--button, to specify type specific parameters. At the most basic level, a Loop can be made to
function as a Tieback only, or as a model.

Tieback:

A loop tieback ties the output to the input in software. Both input and output addresses must
physically be available to SIMVOX. If an Input or Output address is not defined in SIMVOX,
the loop cannot be tied back. Such loops are forced to be offline.

In tiebacks, SIMVOX reads the output address (IVP) and calculates the PV to be written to the
input address. You can select one of five (or all five) functions to condition the PV prior to
writing it the input channel. These functions are:

D Dead Time
D 1st Order Filter
D 2nd Order Filter
D Polynomial
D Valve Hysteresis

The details of these functions are presented in Appendix G.

To define a loop tieback, follow these steps:

Step 1.

Select the Tieback radio button.

Step 2.

Select the loop type, i.e., Flow, Level, Temperature, Pressure, Other.

Step 3.

Original September 1995 101


UM25.0:SPE311
SIMVOX -- Version 2.3

Press the Details push--button. The Loop Dynamics dialog box will be displayed. The only
editable fields in this dialog box will be the Modeling functions. You can select one or all of
these functions to perform signal conditioning prior to writing to the PV.

For example, if you choose to add a 1st Order Filter between output and input, simply double
click on Filter1 in the top left corner list. Or select the function and then press the Add
push--button. A dialog box will be displayed where you can specify the filter time and a gain.
Press the OK push--button to add the filter to the tieback.

To edit an already added function, simply double click on the function. A dialog box will be
displayed with the current parameters. Editing the parameters and pressing the OK push--button
will save the new data.

To delete a function, first select it and then press the Delete push--button. To delete all the
selected functions, simply press Clear.

After adding the necessary functions, press the OK push--button to save the tieback signal
conditioning functions and return to the main loop dialog box. Pressing the OK push--button
again saves all definitions in the SIMVOX database. The changes become effective immediately,
and are used in resolving the loop tieback.

Model:

A loop model only controls the input address. Only the input address must physically be
available to SIMVOX. For loops which have only the input address defined, selecting them to be
models allows you to bring them online. While resolving a loop model, the output address or
IVP of the loop may or may not play a significant role. This depends on how you choose to
model the loop.
The different types of loop models are:
Level
Temperature
Pressure
Other

To define a loop model, follow these steps:

Step 1.

Select the Model radio button.

Step 2.

Select the loop type, i.e., Level, Temperature, Pressure, Other. Flow loops are always forced to
be tiebacks.

Original September 1995 102


UM25.0:SPE311
SIMVOX -- Version 2.3

Step 3.

Press the Details push--button. The Loop Dynamics dialog box for the selected loop type will be
displayed. These dialog boxes are discussed in detail as follows:

Level -- Section 6.1.2.7.1


Temperature -- Section 6.1.2.7.2
Pressure -- Section 6.1.2.7.3
Other -- Section 6.1.2.7.4

After adding the loop specific details, press the OK push--button to save all definitions in the
SIMVOX database. The changes become effective immediately, and are used in resolving the
loop model. To discard changes, press the Cancel button.

NOTE

The changes you made are held in memory only. To


save changes to disk, use the File--Save pulldown or
press the Toolbar disk icon.

Initial Value:

You can assign an initial engineering units value to the loop to start the simulation at a specific
place in the process dynamics. For example, if the loop is for Level, the initial value can be used
to set the amount of material in a vessel when the simulation starts.

When the loop starts resolving, the first control action performed by SIMVOX is to write the
specified value into the address representing the level indication (or temperature, pressure, etc.).
Thereafter, the loop dynamics take over and the value changes as dictated by the model.

6.1.2.7.1 Level Loop


The Loop -- Level Dynamics dialog box has the following editable fields:

D Modeling Functions -- This comprises selecting one or more functions from the available list
and adding to the applied functions list. There are two types of functions: (1) Average,
Integrate, Minimum, Maximum, Track, Mass Xfer; (2) Dead Time, Filter1, Filter2. Of the
first type, only one can be selected and applied to the level input signals. Of the second type,
one or more can be applied for final signal conditioning prior to writing the PV (The details
of these functions are presented in Appendix G).

Original September 1995 103


UM25.0:SPE311
SIMVOX -- Version 2.3

D Vessel Type -- Three vessel types are available: Cone, Horizontal, and Vertical.

D Capacity -- the vessel capacity in engineering units. In some cases, the capacity is the same as
the high engineering units. In other cases, the level high engineering units are specified in
percent, i.e., 100%. This capacity field must be actual engineering units.

D Angle -- this field applies only to cone vessels and represents the angle (in degrees) between
the cone and vertical section of the vessel.

D Radius -- this field applies only to cone and horizontal vessels.

D Integration initial -- this field allows you to initialize the starting value for the level
integration. This field is enabled if the Integrate function is applied.

D Integration gain -- This field is enabled if the Integrate function is applied. You can use it to
perform unit conversion. For example, if the input is in gallons, a gain of 7.8 will convert it
to pounds and integrate pounds.

D PV I/O -- PV I/O, Tracking PV and PV Signal are related sections. PV I/O allows you to
specify the level input and output signals. If the PV In radio button is selected, the Tracking
PV and PV Signal represent the signals which increase the level. If PV Out radio button is
selected, then the Tracking PV and PV Signal represent the signals which decrease the level.
If PV In is selected, PV Out will be greyed, and vice versa. To tell SIMVOX that you are
done specifying Input (or Output signals), press the Done push--button.

D Tracking PV -- PV I/O, Tracking PV and PV Signal are related sections. In this section, you
can select the type of signal. Your input signal can be one or upto 10 (any mix) of AI, AO,
Discrete Control Device, Loop, Calculation and Constant. These signals are from devices
with the current dataset. To bring in signals from other datasets, use calculations. When you
select the Track Discrete Control Device radio button, a list of Discrete Control Device tags
will be displayed in the first PV Signal list. If you select the Track Calc radio button, a list of
Calculation tags will be displayed in the first PV Signal list. Note that Calculations must
have been previously loaded for you to be able to get the tags.

D PV Signal -- PV I/O, Tracking PV and PV Signal are related sections. With the selected type
of tags displayed in the list, you can double click on the tag. This will add it to the applied
signals list. Or you can single click and press the Add push--button. SIMVOX allows you to
add more than 10, but only the 1st ten signals in the list are retained. All else are discarded.
The sum of all specified signals is used. To delete a signal from the applied list, simply select
it by single clicking on it, and press the Delete push--button. When you are done adding Input
signals, press the Done push--button. This reads your specifications and saves them, while
enabling you to select the Output signals. You can perform this any number of times to refine
your level loop signals. To discard all selected signals from the applied list, press the Clear
All push--button.

Original September 1995 104


UM25.0:SPE311
SIMVOX -- Version 2.3

Here we present a simple example of a Level loop, LIC--830--1, for tank T--1. This level has two
inputs and one output. One input is specified by a Flow loop, FIC--830--1, and the other by a
Discrete Control Device valve, XV--830--1. The output is also a Discrete Control Device valve,
XV--830--2. Note that more complex examples are presented in the Examples, section 8.

Step 1.

Select level loop and assign model personality to it as described in section 6.1.2.7.

Step 2.

Press the Details push--button. The Level Dynamics dialog box will be displayed.

Step 3.

Choose modeling functions to be applied. Here we elect to Integrate the level and we want to
apply a 1st order filter to smooth out the level rise. To do this, double click on Integrate in the list
on the left hand side. This will add Integrate to the applied functions list. Now double click on
Filter1 in the list on the left hand side. This will display a dialog box for the 1st order filter.
Complete this dialog box, specifying filter time in seconds and a gain of 1.0. Press the OK
push--button to add Filter1 to the applied functions list.

Note that the function will be added and appear as Filter1 (x.y, 1.0) in the list, where x.y is the
filter time in seconds, and 1.0 is the gain. You can edit this by double clicking on the function.

Now you are done adding you modeling functions.

Step 4.

Select the type of vessel we are modeling. Assuming that T--1 is a Vertical tank, use the
dropdown list to select vessel type as Vertical. This will grey the Angle and Radius fields. You
must, however, specify the Capacity. Our tank here can hold 10,000.00 gallons, so we enter
10000.0 in the capacity field.

Step 5.

Original September 1995 105


UM25.0:SPE311
SIMVOX -- Version 2.3

Because we selected Integrate in Step 1, the Integration Parameters section is enabled. Here we
specify an initial value of 0.0 and a gain of 1.0. Note that to integrate a value, the gain should
never be 0.0.

Step 6.

Now we are ready to specify what makes our level rise and what makes it fall. We said that we
had two inputs and one output as follows:

Input 1 -- Flow Loop -- FIC--830--1


Input 2 -- DCD Valve -- XV--830--1

Output 1 -- DCD Valve -- XV--830--2

Assuming these devices are in the current dataset and already loaded into the tieback, we can go
ahead and complete our loop definition. If these signals were Calculations or Tags which were
not loaded, we could simply switch to the Calculations/Tags windows, load the appropriate files,
and then return to our definition.

When we first enter the Level Dynamics dialog box, the PV In radio button will be selected, so
we can add the input signals right away.

To add the Flow loop, click on the Track Loop radio button. This will display all the available
loops in the current dataset. Select FIC--830--1 by double clicking on it. It will get added to the
applied list.

To add the Discrete Control Device valve, click on the Track Discrete Control Device radio
button. This will display all the available Discrete Control Devices in the current dataset. Select
XV--830--1 by double clicking on it. It will get added to the applied list.

Now press the Done push--button. SIMVOX will read the signal list and save the values, while
enabling the PV Out radio button. Click on the PV Out radio button. This will disable the PV In
radio button and show all the Output signals.

To add the output Discrete Control Device valve, click on the Track Discrete Control Device
radio button. This will display all the available Discrete Control Devices in the current dataset.
Select XV--830--2 by double clicking on it. It will get added to the applied list.

Now press the Done push--button. SIMVOX will read the signal list and save it. Press the OK
push--button to return to the main Loop dialog box. Verify that your Calculate If condition is
correct. Press the OK push button. This saves the level loop definition in the SIMVOX database.

Original September 1995 106


UM25.0:SPE311
SIMVOX -- Version 2.3

NOTE
The loop definition becomes effective immediately. If
the Calculate If condition evaluates to TRUE, the level
will start integrating based on the Input/Output signals.
The integrated level will be clamped by capacity at the
high end and 0.0 at the low end.

Analyzing this level loop definition, we can see that the level will integrate, regardless of
available volumes upstream, i.e., an infinite source is assumed. This can be changed by defining
the input Discrete Control Device (XV--830--1) and Flow loop (FIC--830--1) to examine available
volumes prior to returning their values. For the Discrete Control Device, we can define it to track
a calculation which calculates available volume. For the Flow loop, we can have it calculate only
if there is volume available.

To specify simple mass balance for vessels is as rapid as the above exercise. No code was written
at all and the level definition is complete. More complex mass balance examples are presented in
section 8.

6.1.2.7.2 Temperature Loop


The Loop -- Temperature Dynamics dialog box has the following editable fields:

D Modeling Functions -- This comprises selecting one or more functions from the available list
and adding to the applied functions list. There are two types of functions: (1) Average,
Integrate, Minimum, Maximum, Track; (2) Dead Time, Filter1, Filter2, Polynomial. Of the
first type, only one can be selected and applied to the temperature input signals. Of the
second type, one or more can be applied for final signal conditioning prior to writing the PV
(The details of these functions are presented in Appendix G).

D Temperature Decay -- This section describes what happens to the temperature when the loop
condition is FALSE. Loop condition is specified in the Calculate If section.

D Integration initial -- this field allows you to initialize the starting value for the temperature
integration. This field is enabled if the Integrate function is applied.

D Integration gain -- This field is enabled if the Integrate function is applied. You can use it to
perform unit conversion.

D PV I/O -- PV I/O, Tracking PV and PV Signal are related sections. PV I/O allows you to
specify the temperature input and output signals. If the PV In radio button is selected, the
Tracking PV and PV Signal represent the signals which increase the temperature. If PV Out
radio button is selected, then the Tracking PV and PV Signal represent the signals which
decrease the temperature. If PV In is selected, PV Out will be greyed, and vice versa. To tell
SIMVOX that you are done specifying Input (or Output signals), press the Done
push--button.

Original September 1995 107


UM25.0:SPE311
SIMVOX -- Version 2.3

D Tracking PV -- PV I/O, Tracking PV and PV Signal are related sections. In this section, you
can select the type of signal. Your input signal can be one or upto 10 (any mix) of AI, AO,
Discrete Control Device, Loop, Calculation and Constant. These signals are from devices
within the current dataset. To bring in signals from other datasets, use calculations. When
you select the Track Discrete Control Device radio button, a list of Discrete Control Device
tags will be displayed in the first PV Signal list. If you select the Track Calc radio button, a
list of Calculation tags will be displayed in the first PV Signal list. Note that Calculations
must have been previously loaded for you to be able to get the tags.

D PV Signal -- PV I/O, Tracking PV and PV Signal are related sections. With the selected type
of tags displayed in the list, you can double click on the tag. This will add it to the applied
signals list. Or you can single click and press the Add push--button. SIMVOX allows you to
add more than 10, but only the 1st ten signals in the list are retained. All else are discarded.
The sum of all selected signals will be used. To delete a signal from the applied list, simply
select it by single clicking on it, and press the Delete push--button. When you are done
adding Input signals, press the Done push--button. This reads your specifications and saves
them, while enabling you to select the Output signals. You can perform this any number of
times to refine your temperature loop signals. To discard all selected signals from the applied
list, press the Clear All push--button.

Here we present a simple example of a Temperature loop, TIC--810--1. This loop controls the
temperature in a tank based on material present, i.e., more material results in slower temperature
gain. We will use the Level loop, LIC--830--1, defined above to tell us how much material we
have.

To model this temperature, we will use 3 calculations as follows:

1. AvailVol -- This calculation will return the available volume in the tank in percent, i.e., Total
Volume -- Current Volume. It is defined as:
((100.0 -- PV (LIC--830--1)) / 100.0)

2. HeatRise -- This calculation will return the heat rise component of the temperature. It is
defined as:

(PVE(TIC--810--1) + (DCD_EQ (XV--810--1, OPEN) * CALC(AvailVol) * 0.1))

Original September 1995 108


UM25.0:SPE311
SIMVOX -- Version 2.3

3. HeatLoss -- This calculation will return the heat loss component of the temperature. It is
defined as:

(PVE(TIC--810--1) -- (DCD_NEQ (XV--810--1, OPEN) * CALC(AvailVol) * 0.1))

Step 1.

Select temperature loop and assign model personality to it as described in section 6.1.1.7.

Step 2.

Press the Details push--button. The Temperature Dynamics dialog box will be displayed.

Step 3.

Choose modeling functions to be applied. Here we elect to Track the temperature calculation and
we want to apply a 1st order filter to smooth out the temperature rise/decline. To do this, double
click on Track in the list on the left hand side. This will add Track to the applied functions list.
Now double click on Filter1 in the list on the left hand side. This will display a dialog box for the
1st order filter. Complete this dialog box, specifying filter time in seconds and a gain of 1.0.
Press the OK push--button to add Filter1 to the applied functions list.

Note that the function will be added and appear as Filter1 (x.y, 1.0) in the list, where x.y is the
filter time in seconds, and 1.0 is the gain. You can edit this by double clicking on the function.

Now you are done adding your modeling functions.

Step 4.

We want our temperature to decline to an ambient value if the loop evaluation condition is not
met. We use the Temperature decay section for this.

Select the temperature decay checkbox. This will display a dialog box where we can enter the
decay time and ambient value.

Edit the decay time field to specify the amount of time it will take to go from the current
temperature to the ambient. Enter 600 for ten minutes and a gain of 1.0.

Now select the Track Const radio button. We want the temperature to decay to a constant value
of 0.0. Enter 0.0 in the adjacent field. Press OK to save the decay parameters.

Original September 1995 109


UM25.0:SPE311
SIMVOX -- Version 2.3

Step 5.

Now we are ready to specify what makes our temperature rise and what makes it fall. We said
that we had 3 calculations, however, only 2 are needed here. The third is called internally by the
other two. The calculations are HeatRise and HeatLoss.

Assuming these calculations are already loaded in the Calculations window, we can go ahead and
complete our loop definition. When we first enter the Temperature Dynamics dialog box, the PV
In radio button will be selected, so we can add the input signals right away.

First click on the Track Calc radio button. This will display all the available calculations in the
current dataset. Select HeatRise by double clicking on it. It will get added to the applied list.

Now press the Done push--button. SIMVOX will read the signal list and save it. Press the PV
Out radio button. Select HeatLoss by double clicking on it. It will get added to the applied list.

Now press the Done push--button. SIMVOX will read the signal list and save it. Press the OK
push--button to return to the main Loop dialog box. Verify that your Calculate If condition is
correct. Press the OK push button. This saves the temperature loop definition in the SIMVOX
database.

NOTE

The loop definition becomes effective immediately. If


the Calculate If condition evaluates to TRUE, the
temperature loop will resolve based on the
Input/Output signals. The temperature PV will be
clamped by engineering units high and low of the loop.

To specify simple temperature balance is as rapid as the above exercise. No code was written at
all and the temperature definition is complete. More complex temperature balance examples are
presented in section 8.

6.1.2.7.3 Pressure Loop


The Loop -- Pressure Dynamics dialog box has the following editable fields:

D Modeling Functions -- This comprises selecting one or more functions from the available list
and adding to the applied functions list. There are two types of functions: (1) Average,
Integrate, Minimum, Maximum, Track; (2) Dead Time, Filter1, Filter2, Polynomial. Of the
first type, only one can be selected and applied to the pressure input signals. Of the second
type, one or more can be applied for final signal conditioning prior to writing the PV (The
details of these functions are presented in Appendix G).

Original September 1995 110


UM25.0:SPE311
SIMVOX -- Version 2.3

D Pressure Decay -- This section describes what happens to the pressure when the loop
condition is FALSE. Loop condition is specified in the Calculate If section.

D Integration initial -- this field allows you to initialize the starting value for the pressure
integration. This field is enabled if the Integrate function is applied.

D Integration gain -- This field is enabled if the Integrate function is applied. You can use it to
perform unit conversion.

D PV I/O -- PV I/O, Tracking PV and PV Signal are related sections. PV I/O allows you to
specify the pressure input and output signals. If the PV In radio button is selected, the
Tracking PV and PV Signal represent the signals which increase the pressure. If PV Out
radio button is selected, then the Tracking PV and PV Signal represent the signals which
decrease the pressure. If PV In is selected, PV Out will be greyed, and vice versa. To tell
SIMVOX that you are done specifying Input (or Output signals), press the Done
push--button.

D Tracking PV -- PV I/O, Tracking PV and PV Signal are related sections. In this section, you
can select the type of signal. Your input signal can be one or upto 10 (any mix) of AI, AO,
Discrete Control Device, Loop, Calculation and Constant. These signals are from devices
within the current dataset. To bring in signals from other datasets, use calculations. When
you select the Track Discrete Control Device radio button, a list of Discrete Control Device
tags will be displayed in the first PV Signal list. If you select the Track Calc radio button, a
list of Calculation tags will be displayed in the first PV Signal list. Note that Calculations
must have been previously loaded for you to be able to get the tags.

D PV Signal -- PV I/O, Tracking PV and PV Signal are related sections. With the selected type
of tags displayed in the list, you can double click on the tag. This will add it to the applied
signals list. Or you can single click and press the Add push--button. SIMVOX allows you to
add more than 10, but only the 1st ten signals in the list are retained. All else are discarded.
The sum of all selected signals will be used. To delete a signal from the applied list, simply
select it by single clicking on it, and press the Delete push--button. When you are done
adding Input signals, press the Done push--button. This reads your specifications and saves
them, while enabling you to select the Output signals. You can perform this any number of
times to refine your pressure loop signals. To discard all selected signals from the applied
list, press the Clear All push--button.

Original September 1995 111


UM25.0:SPE311
SIMVOX -- Version 2.3

Now press the Done push--button. SIMVOX will read the signal list and save it. Press the OK
push--button to return to the main Loop dialog box. Verify that your Calculate If condition is
correct. Press the OK push button. This saves the pressure loop definition in the SIMVOX
database.

NOTE
The loop definition becomes effective immediately. If
the Calculate If condition evaluates to TRUE, the
pressure loop will resolve based on the Input/Output
signals. The pressure PV will be clamped by
engineering units high and low of the loop.

To specify simple pressure balance is as rapid as the above exercise. No code was written at all
and the pressure definition is complete. More complex pressure balance examples are presented
in section 8.

6.1.2.7.4 Other Loop

The specification of Other loops is identical to temperature and pressure loops.

6.1.2.8 Controlling Tieback Execution

Tieback execution can be controlled on an individual object level. Each Discrete Control Device
and Loop has its own scan time and online/offline status. Furthermore, the entire dataset can be
taken offline.

To control an individual object, follow these steps:

Step 1.

Press the detail button for the object. Each object row has a detail button. This will display a
detail dialog box.

Step 2.

To adjust the scan time, select new time in the scan time dropdown list.

To adjust the online/offline status, select the appropriate radio button.

Step 3.

Press the OK button to save the definition. Your change goes into effect immediately.

Original September 1995 112


UM25.0:SPE311
SIMVOX -- Version 2.3

To control execution of a dataset, follow these steps:

Step 1.

Press the Toolbar Scan On/Off button. This will display a dialog box.

Step 2.

Select the dataset to be controlled from the dropdown list. The select the Online/Offline radio
buttons appropriately.

Step 3.

Press the OK button to save the definition. Your change goes into effect immediately.

6.1.3 Building Tag Objects

6.1.3.1 Generating Tag CDV files


Tag CDV files can be generated using the Tools option of the SIMVOX main menu if a network
link exists between the NT workstation and the VAX/HP.

To create a Tags file from the information contained in an ENVOX database the following
parameters must be specified:

(1) sa Password -- This is the Sybase system administrator password.

(2) Database -- The name of the ENVOX database where the device is located. Available
databases are displayed in a dropdown list.

(3) Device -- The name of the ENVOX device where the tags are located. Available devices are
displayed in a dropdown list.

(4) Output Directory -- The name of the output directory for the Tags generation.

(5) Output File -- The name of the output file for the Tags generation. If this field is not entered
the default filename is the device name of the tieback followed by the .pts extension.

After the appropriate selections have been made, press the OK push--button to begin Tag
generation.

Original September 1995 113


UM25.0:SPE311
SIMVOX -- Version 2.3

To create a Tag file from the information contained in a PROFLEX controller definition file,
specify the file and select an output directory. Press the Browse push--button to browse available
directories.

In the case if a network link does not exist between the NT workstation and the VAX/HP,
SIMVOX for Windows NT has 3 companion utilities which reside on the VAX/HP system. One
of these utilities is PNTGEN.EXE. This utility allows you to select the ENVOX database, and
the PROVOX device, from which Discrete Control Device and Loop data is read and written to
an ASCII text file in the form of comma delimited values (CDV).

For example, the steps to create a tags CDV file using the VAX utility are as follows. Note that
the $ in the following commands is the VAX/VMS prompt and should not be typed. The bold
italics text is what you have to enter, and the normal text is computer generated.

$ run pntgen

NOTE: All user responses are case--sensitive

Enter Sybase sa password: database

The ENVOX databases are:

ENVOXDB
EXAMPLE

Enter ENVOX database: EXAMPLE

The devices in the EXAMPLE ENVOX database are:

IFC1
IFC2
UOC1
UOC2

Select device from ENVOX database EXAMPLE: IFC1

Enter output directory: [user.doe]

Reading AI Objects ...


Reading AO Objects ...
Reading DI Objects ...
Reading DO Objects ...
Reading PCI Objects ...

Original September 1995 114


UM25.0:SPE311
SIMVOX -- Version 2.3

Writing ...

The tags CDV file for IFC1 is now generated. It will be called IFC1.PTS and will be located in
the directory [user.doe], ready for transfer to the PC Workstation.

The file created has a specific format. This format is described in the online help of the Non
Control Tags process.

When first created from ENVOX, this file does not contain any object personality information.
This must be added by you as described in section 6.1.3.4. If the tags CDV file is created by the
VAX utilities, it must be transferred to the NT Workstation via Kermit, FTP, or any other file
transfer program. The Tools option creates the CDV files in the NT workstation itself.

6.1.3.2 Loading Tag CDV files


With the Tags Window open, as described in section 4, you can load the created tags CDV file,
ifc1.pts, into a child window. The following steps illustrate this:

Step 1.

Click on the File pulldown and then select Open;


OR
Click on the second (from left) Toolbar icon (file folder open).

The Load Tags dialog box will be displayed.

Step 2.

Select the dataset from the dropdown list. The list displayed will comprise all the available
datasets.

Step 3.

Press the Browse push--button to get the File Open dialog. You can browse around in the
directories and select the file, wherever it is located. Double clicking on the file, or single
clicking and then pressing the OK push--button will read the file name and directory into the
Load Tags dialog box.

Step 4.

Original September 1995 115


UM25.0:SPE311
SIMVOX -- Version 2.3

With the dataset selected and the tags file selected, press the OK push--button. SIMVOX will
start reading the file, checking it for syntax errors as it goes along. If no errors are detected, the
tags child window will be created.

If any errors are detected in the tag file, an error message prompt will be displayed showing the
text in error. You can correct the errors by editing the tag file with any standard text editor. The
Toolbar contains the notepad icon. You can use it to edit. Note that if the file was created
automatically by the VAX/VMS utility, it will not contain any errors.

Step 5.

If communications are already active with the controller, the tags will start resolving and
displaying their current data. The EUValue fields of the spreadsheet display will reflect current
data. The Scan T and Scan fields of the display will show the current tag resolve frequency
and whether the tag is being scanned or not, respectively.

Step 6.

The tags file is now loaded. The next step is to assign personalities to tag objects. This is
described below.

6.1.3.3 Tag Detail Dialog


In the Tag child window, next to the Units column, there is a column of buttons, one for each
row. This button allows you to open a dialog box which contains the details of the Tag object in
that row.

Step 1.

Single click on this button. This will display a dialog box showing all the known detail for the
tag object.

Step 2.

The fields in this dialog are:

D Tag -- The tag is a label for the data. This must be less than 16 characters long.
D Description -- (Optional) description field.
D Scan time -- The scan time is the interval between updates to the tag value. It can range from
1 to 15 seconds.
D Online/Offline -- Online returns the tag to its original status. Offline causes the tag to no
longer be controlled by SIMVOX. An offline tag is not resolved.
D Address -- Addresses are dependent upon the driver that is running on the current dataset.
The addressing scheme for different drivers is given in Appendix H.

Original September 1995 116


UM25.0:SPE311
SIMVOX -- Version 2.3

D Tag Initial value -- This value is for input tags only and is written to the input address when
the tags file is first loaded.
D Square Root -- The square root calculation of the tag can be enabled or disabled. This is for
Analog Input tags only.
D EU range -- This defines the maximum and minimum value of the engineering unit. This is
for Analog Input, Analog Output and Pulse Count Input tags only.
Calculate If condition -- This is described in section 6.1.3.4.
Tag Dynamics -- This is described in section 6.1.3.5.

Step 3.

After editing, (uneditable fields are grey) press the OK push--button to save changes in the
SIMVOX database. If no changes were made or to discard changes, press the Cancel
push--button.

Step 4.

For dialog box help, simply press the Help push--button.

6.1.3.4 Assigning Tag evaluation condition


With the Tag defined, you can control under what conditions it will get evaluated. These
conditions are specified in the Calculate block. If the tag is to evaluate at all times, check the
Always radio button.

To Calculate If Tag:

Step 1.

Select the If Tag radio button.

Step 2.

Select the dataset of the tag for the condition. The tags for the dataset selected must already be
loaded. Otherwise, step 4 below will be meaningless.

Step 3.

Select the tag type of the tag for the condition. The tags for the dataset selected must already be
loaded. Otherwise, step 4 below will be meaningless.

Step 4.

Select the tag from the dropdown list. This list will be specific to the dataset selected in step 2.

Original September 1995 117


UM25.0:SPE311
SIMVOX -- Version 2.3

Step 5.

Select the condition operator. For tags, all operators are available (=, <, >, <=, >=, <>).

Step 6.

Specify a floating point value in the field next to the operators. This value will be compared to
the engineering units value of the selected tag. The tag will be evaluated if this condition
evaluates to TRUE. Otherwise the tag will not be evaluated and, depending on Tag Dynamics
selected, the decay specification will take effect.

To Calculate If Discrete Control Device:

Step 1.

Select the If Discrete Control Device radio button.

Step 2.

Select the dataset of the Discrete Control Device for the condition. The tieback for the dataset
selected must already be loaded. Otherwise, step 3 below will be meaningless.

Step 3.

Select the Discrete Control Device tag from the dropdown list. This list will be specific to the
dataset selected in step 2.

Step 4.

Select the condition operator. For Discrete Control Devices, only = and <> are available. The =
operator checks for equality, while <> checks for inequality.

Step 5.

Select the SP of the Discrete Control Device in the condition. The Discrete Control Device PV
will be compared to the selected SP. The tag will be evaluated if this condition evaluates to
TRUE. Otherwise the tag will not be evaluated and, depending on tag dynamics selected, the
decay specification will take effect.

To Calculate If Loop:

Step 1.

Original September 1995 118


UM25.0:SPE311
SIMVOX -- Version 2.3

Select the If Loop radio button.

Step 2.

Select the dataset of the Loop for the condition. The tieback for the dataset selected must already
be loaded. Otherwise, step 3 below will be meaningless.

Step 3.

Select the Loop tag from the dropdown list. This list will be specific to the dataset selected in
step 2.

Step 4.

Select the condition operator. For Loops, all operators are available (=, <, >, <=, >=, <>).

Step 5.

Specify a floating point value in the field next to the operators. This value will be compared to
the engineering units value of the selected loop. The tag will be evaluated if this condition
evaluates to TRUE. Otherwise the tag will not be evaluated and, depending on tag dynamics
selected, the decay specification will take effect.

To Calculate If Calculation:

Step 1.

Select the If Calc radio button.

Step 2.

Select the dataset of the Calculation for the condition. The Calculations for the dataset selected
must already be loaded. Otherwise, step 3 below will be meaningless.

Step 3.

Select the Calculation tag from the dropdown list. This list will be specific to the dataset selected
in step 2.

Step 4.

Select the condition operator. For Calculations, all operators are available (=, <, >, <=, >=, <>).

Original September 1995 119


UM25.0:SPE311
SIMVOX -- Version 2.3

Step 5.

Specify a floating point value in the field next to the operators. The tag will be evaluated if this
condition evaluates to TRUE. Otherwise the tag will not be evaluated and, depending on the tag
dynamics selected, the decay specification will take effect.

After specifying the Calculate If condition details, specify the tag personality as described in
section 6.1.3.5 below.

6.1.3.5 Assigning Tag personality


Tag personality, i.e., dynamic modeling characteristics, can only be assigned to input type tags.
Output type tags cannot be controlled from SIMVOX, but are displayed in the spreadsheet
window.

Tag personality is the heart of how an input tag will be modeled. Specifying tag personality
comprises selecting from a set of radio buttons to specify type, and then pressing the Details
push--button, to specify type specific parameters. At the most basic level, a tag can be made to
function as a display only object without any modeling. In this state, the tag dynamically
displays the engineering units value of the input address. Tag Dynamics are select by clicking on
a radio button. Follow these steps:

Step 1.

For Analog Input tags:


Select Undefined, Level, Temperature, Pressure, or Other. Selecting Undefined makes the tag
object display only, i.e., no modeling is performed on it.

For Discrete Input tags:


Select Undefined, Switch, or Other. Selecting Undefined makes the tag object display only, i.e.,
no modeling is performed on it.

For Pulse Count Input tags:


Select Undefined or Meter. Selecting Undefined makes the tag object display only, i.e., no
modeling is performed on it.

Step 2.

Press the Details push--button. The tag dynamic dialog box for the selected tag type will be
displayed. These dialog boxes are discussed in detail as follows:

For Analog Input tags:


Level -- Section 6.1.3.5.1
Temperature -- Section 6.1.3.5.2

Original September 1995 120


UM25.0:SPE311
SIMVOX -- Version 2.3

Pressure -- Section 6.1.3.5.3


Other -- Section 6.1.3.5.4

For Discrete Input tags:


Switch -- Section 6.1.3.5.5
Other -- Section 6.1.3.5.6

For Pulse Count Input tags:


Meter -- Section 6.1.3.5.7

After adding the tag specific details, pressing the OK push--button again saves all definitions in
the SIMVOX database. The changes become effective immediately, and are used in resolving the
tag model. To discard changes, press the Cancel button.

NOTE

The changes you made are held in memory only. To


save changes to disk, use the File--Save pulldown or
press the Toolbar disk icon.

Initial Value:

You can assign an initial engineering units value to the tag to start the simulation at a specific
place in the process dynamics. For example, if the tag is for Temperature, the initial value can be
used to set the temperature of material in a vessel when the simulation starts.

When the tag starts resolving, the first control action performed by SIMVOX is to write the
specified value into the address representing the temperature indication (or level, pressure, etc.).
Thereafter, the tag dynamics take over and the value changes as dictated by the model.

6.1.3.5.1 Analog Input -- Level Tag


The Analog Input -- Level Dynamics dialog box has the following editable fields:

D Modeling Functions -- This comprises selecting one or more functions from the available list
and adding to the applied functions list. There are two types of functions: (1) Average,
Integrate, Minimum, Maximum, Track, Mass Xfer; (2) Dead Time, Filter1, Filter2,
Polynomial. Of the first type, only one can be selected and applied to the level input signals.
Of the second type, one or more can be applied for final signal conditioning prior to writing
the PV (The details of these functions are presented in Appendix G).

Original September 1995 121


UM25.0:SPE311
SIMVOX -- Version 2.3

D Vessel Type -- Three vessel types are available: Cone, Horizontal, and Vertical.

D Capacity -- the vessel capacity in engineering units. In some cases, the capacity is the same as
the high engineering units. In other cases, the level high engineering units are specified in
percent, i.e., 100%. This capacity field must be actual engineering units.

D Angle -- this field applies only to cone vessels and represents the angle (in degrees) between
the cone and vertical section of the vessel.

D Radius -- this field applies only to cone and horizontal vessels.

D Integration initial -- this field allows you to initialize the starting value for the level
integration. This field is enabled if the Integrate function is applied.

D Integration gain -- This field is enabled if the Integrate function is applied. You can use it to
perform unit conversion. For example, if the input is in gallons, a gain of 8.0 will convert it
to pounds and integrate pounds.

D PV I/O -- PV I/O, Tracking PV and PV Signal are related sections. PV I/O allows you to
specify the level input and output signals. If the PV In radio button is selected, the Tracking
PV and PV Signal represent the signals which increase the level. If PV Out radio button is
selected, then the Tracking PV and PV Signal represent the signals which decrease the level.
If PV In is selected, PV Out will be greyed, and vice versa. To tell SIMVOX that you are
done specifying Input (or Output signals), press the Done push--button.

D Tracking PV -- PV I/O, Tracking PV and PV Signal are related sections. In this section, you
can select the type of signal. Your input signal can be one or upto 10 (any mix) of AI, AO,
Discrete Control Device, Loop, Calculation and Constant. These signals are from devices
with the current dataset. To bring in signals from other datasets, use calculations. When you
select the Track Discrete Control Device radio button, a list of Discrete Control Device tags
will be displayed in the first PV Signal list. If you select the Track Calc radio button, a list of
Calculation tags will be displayed in the first PV Signal list. Note that Calculations must
have been previously loaded for you to be able to get the tags.

D PV Signal -- PV I/O, Tracking PV and PV Signal are related sections. With the selected type
of tags displayed in the list, you can double click on the tag. This will add it to the applied
signals list. Or you can single click and press the Add push--button. SIMVOX allows you to
add more than 10, but only the 1st ten signals in the list are retained. All else are discarded.
The sum of all selected signals will be used. To delete a signal from the applied list, simply
select it by single clicking on it, and press the Delete push--button. When you are done
adding Input signals, press the Done push--button. This reads your specifications and saves
them, while enabling you to select the Output signals. You can perform this any number of
times to refine your level tag signals. To discard all selected signals from the applied list,
press the Clear All push--button.

Original September 1995 122


UM25.0:SPE311
SIMVOX -- Version 2.3

Here we present a simple example of a Level tag, LI--831--1, for tank T831. This level has three
inputs and 1 output. Each input is specified by flow through a Discrete Control Device valve, so
we have XV--830--1, XV--831--1, and XV--832--1. The output is also a Discrete Control Device
valve, XV--830--2. Note that more complex examples are presented in the Examples, section 8.

Step 1.

Select level tag and assign model personality to it as described in section 6.1.3.5.

Step 2..

Press the Details push--button. The Level Dynamics dialog box will be displayed.

Step 3.

Choose modeling functions to be applied. Here we elect to Integrate the level and we want to
apply a 1st order filter to smooth out the level rise. To do this, double click on Integrate in the list
on the left hand side. This will add Integrate to the applied functions list. Now double click on
Filter1 in the list on the left hand side. This will display a dialog box for the 1st order filter.
Complete this dialog box, specifying filter time in seconds and a gain of 1.0. Press the OK
push--button to add Filter1 to the applied functions list.

Note that the function will be added and appear as Filter1 (x.y, 1.0) in the list, where x.y is the
filter time in seconds, and 1.0 is the gain. You can edit this by double clicking on the function.

Now you are done adding you modeling functions.

Step 4.

Select the type of vessel we are modeling. Assuming that T831 is a Vertical tank, use the
dropdown list to select vessel type as Vertical. This will grey the Angle and Radius fields. You
must, however, specify the Capacity. Our tank here can hold 5,000.00 gallons, so we enter
5000.0 in the capacity field.

Step 5.

Original September 1995 123


UM25.0:SPE311
SIMVOX -- Version 2.3

Because we selected Integrate in Step 1, the Integration Parameters section is enabled. Here we
specify an initial value of 0.0 and a gain of 1.0. Note that to integrate a value, the gain should
never be 0.0.

Step 6.

Now we are ready to specify what makes our level rise and what makes it fall. We said that we
had 3 inputs and 1 output as follows:

Input 1 -- DCD Valve -- XV--830--1


Input 2 -- DCD Valve -- XV--831--1
Input 3 -- DCD Valve -- XV--832--1

Output 1 -- DCD Valve -- XV--830--2

Assuming these devices are in the current dataset and already loaded into the tieback, we can go
ahead and complete our tag definition. If these signals were Calculations or Tieback objects
which were not loaded, we could simply switch to the Calculations/Tieback windows, load the
appropriate files, and then return to our definition.

When we first enter the Level Dynamics dialog box, the PV In radio button will be selected, so
we can add the input signals right away.

To add the Discrete Control Device valve, click on the Track Discrete Control Device radio
button. This will display all the available Discrete Control Devices in the current dataset. Select
XV--830--1 by double clicking on it. It will get added to the applied list. Similarly, double click
on XV--831--1 and XV--832--1.

Now press the Done push--button. SIMVOX will read the signal list and save the values, while
enabling the PV Out radio button. Click on the PV Out radio button. This will disable the PV In
radio button and show all the Output signals.

To add the output Discrete Control Device valve, click on the Track Discrete Control Device
radio button. This will display all the available Discrete Control Devices in the current dataset.
Select XV--830--2 by double clicking on it. It will get added to the applied list.

Now press the Done push--button. SIMVOX will read the signal list and save it. Press the OK
push--button to return to the main tag dialog box. Verify that your Calculate If condition is
correct. Press the OK push button. This saves the level tag definition in the SIMVOX database.

Original September 1995 124


UM25.0:SPE311
SIMVOX -- Version 2.3

NOTE

The tag definition becomes effective immediately. If the


Calculate If condition evaluates to TRUE, the level will
start integrating based on the Input/Output signals. The
integrated level will be clamped by capacity at the high
end and 0.0 at the low end.

Analyzing this level tag definition, we can see that the level will integrate, regardless of
available volumes upstream, i.e., an infinite source is assumed. This can be changed by defining
the input Discrete Control Device valves to examine available volumes prior to returning their
values. For the Discrete Control Device, we can define it to track a calculation which calculates
available volume.

To specify simple mass balance for vessels is as rapid as the above exercise. No code was written
at all and the level definition is complete. More complex mass balance examples are presented in
section 8.

6.1.3.5.2 Analog Input -- Temperature Tag


The Analog Input -- Temperature Dynamics dialog box has the following editable fields:

D Modeling Functions -- This comprises selecting one or more functions from the available list
and adding to the applied functions list. There are two types of functions: (1) Average,
Integrate, Minimum, Maximum, Track; (2) Dead Time, Filter1, Filter2, Polynomial. Of the
first type, only one can be selected and applied to the temperature input signals. Of the
second type, one or more can be applied for final signal conditioning prior to writing the PV
(The details of these functions are presented in Appendix G).

D Temperature Decay -- This section describes what happens to the temperature when the tag
evaluate condition is FALSE. Tag condition is specified in the Calculate If section.

D Integration initial -- this field allows you to initialize the starting value for the temperature
integration. This field is enabled if the Integrate function is applied.

D Integration gain -- This field is enabled if the Integrate function is applied. You can use it to
perform unit conversion.

D PV I/O -- PV I/O, Tracking PV and PV Signal are related sections. PV I/O allows you to
specify the temperature input and output signals. If the PV In radio button is selected, the
Tracking PV and PV Signal represent the signals which increase the temperature. If PV Out
radio button is selected, then the Tracking PV and PV Signal represent the signals which
decrease the temperature. If PV In is selected, PV Out will be greyed, and vice versa. To tell
SIMVOX that you are done specifying Input (or Output signals), press the Done
push--button.

Original September 1995 125


UM25.0:SPE311
SIMVOX -- Version 2.3

D Tracking PV -- PV I/O, Tracking PV and PV Signal are related sections. In this section, you
can select the type of signal. Your input signal can be one or upto 10 (any mix) of AI, AO,
Loop, Calculation and Constant. These signals are from devices within the current dataset.
To bring in signals from other datasets, use calculations. When you select the Track Loop
radio button, a list of Loop tags will be displayed in the first PV Signal list. If you select the
Track Calc radio button, a list of Calculation tags will be displayed in the first PV Signal list.
Note that Calculations must have been previously loaded for you to be able to get the tags.

D PV Signal -- PV I/O, Tracking PV and PV Signal are related sections. With the selected type
of tags displayed in the list, you can double click on the tag. This will add it to the applied
signals list. Or you can single click and press the Add push--button. SIMVOX allows you to
add more than 10, but only the 1st ten signals in the list are retained. All else are discarded.
The sum of all selected signals will be used. To delete a signal from the applied list, simply
select it by single clicking on it, and press the Delete push--button. When you are done
adding Input signals, press the Done push--button. This reads your specifications and saves
them, while enabling you to select the Output signals. You can perform this any number of
times to refine your temperature tag signals. To discard all selected signals from the applied
list, press the Clear All push--button.

Now press the Done push--button. SIMVOX will read the signal list and save it. Press the OK
push--button to return to the main tag dialog box. Verify that your Calculate If condition is
correct. Press the OK push button. This saves the temperature loop definition in the SIMVOX
database.

NOTE

The tag definition becomes effective immediately. If the


Calculate If condition evaluates to TRUE, the
temperature tag will resolve based on the Input/Output
signals. The temperature PV will be clamped by
engineering units high and low of the tag.

To specify simple temperature balance is as rapid as the above exercise. No code was written at
all and the temperature definition is complete. More complex temperature balance examples are
presented in section 8.

Original September 1995 126


UM25.0:SPE311
SIMVOX -- Version 2.3

6.1.3.5.3 Analog Input -- Pressure Tag


The Analog Input -- Pressure Dynamics dialog box has the following editable fields:

D Modeling Functions -- This comprises selecting one or more functions from the available list
and adding to the applied functions list. There are two types of functions: (1) Average,
Integrate, Minimum, Maximum, Track; (2) Dead Time, Filter1, Filter2, Polynomial. Of the
first type, only one can be selected and applied to the pressure input signals. Of the second
type, one or more can be applied for final signal conditioning prior to writing the PV (The
details of these functions are presented in Appendix G).

D Pressure Decay -- This section describes what happens to the pressure when the tag
evaluation condition is FALSE. Tag condition is specified in the Calculate If section.

D Integration initial -- this field allows you to initialize the starting value for the pressure
integration. This field is enabled if the Integrate function is applied.

D Integration gain -- This field is enabled if the Integrate function is applied. You can use it to
perform unit conversion.

D PV I/O -- PV I/O, Tracking PV and PV Signal are related sections. PV I/O allows you to
specify the pressure input and output signals. If the PV In radio button is selected, the
Tracking PV and PV Signal represent the signals which increase the pressure. If PV Out
radio button is selected, then the Tracking PV and PV Signal represent the signals which
decrease the pressure. If PV In is selected, PV Out will be greyed, and vice versa. To tell
SIMVOX that you are done specifying Input (or Output signals), press the Done
push--button.

D Tracking PV -- PV I/O, Tracking PV and PV Signal are related sections. In this section, you
can select the type of signal. Your input signal can be one or upto 10 (any mix) of AI, AO,
Discrete Control Device, Loop, Calculation and Constant. These signals are from devices
within the current dataset. To bring in signals from other datasets, use calculations. When
you select the Track Discrete Control Device radio button, a list of Discrete Control Device
tags will be displayed in the first PV Signal list. If you select the Track Calc radio button, a
list of Calculation tags will be displayed in the first PV Signal list. Note that Calculations
must have been previously loaded for you to be able to get the tags.

D PV Signal -- PV I/O, Tracking PV and PV Signal are related sections. With the selected type
of tags displayed in the list, you can double click on the tag. This will add it to the applied
signals list. Or you can single click and press the Add push--button. SIMVOX allows you to
add more than 10, but only the 1st ten signals in the list are retained. All else are discarded.
The sum of all selected signals will be used. To delete a signal from the applied list, simply
select it by single clicking on it, and press the Delete push--button. When you are done
adding Input signals, press the Done push--button. This reads your specifications and saves
them, while enabling you to select the Output signals. You can perform this any number of
times to refine your pressure tag signals. To discard all selected signals from the applied list,
press the Clear All push--button.

Original September 1995 127


UM25.0:SPE311
SIMVOX -- Version 2.3

Now press the Done push--button. SIMVOX will read the signal list and save it. Press the OK
push--button to return to the main tag dialog box. Verify that your Calculate If condition is
correct. Press the OK push button. This saves the pressure tag definition in the SIMVOX
database.

NOTE

The tag definition becomes effective immediately. If the


Calculate If condition evaluates to TRUE, the pressure
loop will resolve based on the Input/Output signals. The
pressure PV will be clamped by engineering units high
and low of the tag.

To specify simple pressure balance is as rapid as the above exercise. No code was written at all
and the pressure definition is complete. More complex pressure balance examples are presented
in section 8.

6.1.3.5.4 Analog Input -- Other Tag


The specification of Other tags is identical to temperature and pressure tags.

6.1.3.5.5 Discrete Input -- Switch Tag


The Discrete Input -- Dynamics dialog box has the following editable fields:

D Modeling Functions -- This comprises selecting one or more functions from the available list
and adding to the applied functions list. There are two types of functions: (1) Track, Invert
Track; (2) Dead Time. Of the first type, only one can be selected and applied to the discrete
input signals. In addition, if selected, Dead Time can be applied for final signal conditioning
prior to writing the PV (The details of these functions are presented in Appendix G).

D PV Type -- PV Type and PV Signal are related sections. In this section, you can select the
type of signal. Your input signal can be one of DI, DO, Calculation or Constant. These
signals are from devices within the current dataset. To bring in signals from other datasets,
use calculations. When you select the Track DI radio button, a list of DI tags will be
displayed in the first PV Signal list. If you select the Track Calc radio button, a list of
Calculation tags will be displayed in the first PV Signal list. Note that Calculations must
have been previously loaded for you to be able to get the tags.

Original September 1995 128


UM25.0:SPE311
SIMVOX -- Version 2.3

D PV Signal -- PV Type and PV Signal are related sections. With the selected type of tags
displayed in the list, you can double click on the tag. This will add it to the applied signals
list. Or you can single click and press the Add push--button. SIMVOX allows you to add only
one signal. To delete a signal from the applied list, simply select it by single clicking on it,
and press the Delete push--button. When you are done adding Input signals, press the Done
push--button. This reads your specification and saves it. To discard the selected signal from
the applied list, press the Clear push--button.

Here we present a simple example of a Level Switch tag, LS--810--1.

Step 1.

Select the DI tag LS--810--1. This is done by clicking on the down--arrow button on the
spreadsheet display for the LS--810--1 row. The details of the DI tag will be displayed.

Step 2.

Assign an initial value to the DI by clicking on the 0 or 1 radio buttons. The initial value is
asserted when the tags file is first loaded, when you press the Initialize button and OK out, or
when you do a dataset Reset.

Assign 0 as an initial value for the switch.

Step 3.

In the lower left corner of the dialog, you will find the Calculate If section. Here you can specify
the conditions under which the DI tag dynamics will be modeled. For example, Always, or if
another tag has an engineering units value greater than 50.0.

In our example, select If Tag. Then select Type as AI. All the AI tags will be displayed in the
dropdown list. We want our level switch to be ON when the level LI--810--1 is greater than 80%,
OFF otherwise. To specify this condition, select the > in the condition dropdown list, and type in
80.0 in the value field.

Step 4.

Select Switch in the Point Dynamics section and then click the Details push--button. The
dynamics dialog will be displayed. Select the Track modeling function.

Original September 1995 129


UM25.0:SPE311
SIMVOX -- Version 2.3

Step 5.

For PV Type, select Const and then enter a 1 by clicking on the 1 radio button. The 1 will be
added to the selected PV Signal list.

Now press the Done push--button. SIMVOX will read the signal list and save it. Press the OK
push--button to return to the main tag dialog box. Verify that your Calculate If condition is
correct. Press the OK push button. This saves the switch tag definition in the SIMVOX database.

NOTE

The tag definition becomes effective immediately. If the


Calculate If condition evaluates to TRUE, the switch tag
will resolve based on the Input signal. If the Calculate If
condition evaluates FALSE, the switch status will go to
0.

To specify a level switch is as rapid as the above exercise. No code was written at all and the
switch definition is complete. Whenever, LI--810--1 goes greater then 80.0%, the switch
LS--810--1 will on ON. When the level falls below 80.0%, the switch will be OFF. Note that this
is valid only if the Engineering Units of LI--810--1 were defined as 0--100%. If the Engineering
units had been defined as 0--1000 Gals, for example, then the condition could have been
specified as LI--810--1 > 800.0.

6.1.3.5.6 Discrete Input -- Other Tag


The specification of Other Discrete Input tag is identical to the Switch tag, with the exception
that this tag retains its value regardless of the Calculate If condition.

6.1.3.5.7 Pulse Count Input -- Meter Tag


The Pulse Count Input -- Dynamics dialog box has the following editable fields:

D Modeling Functions -- This comprises selecting one or more functions from the available list
and adding to the applied functions list. There are two types of functions: (1) Track, Sum; (2)
Dead Time. Of the first type, only one can be selected and applied to the pulse count input
signals. In addition, if selected, Dead Time can be applied for final signal conditioning prior
to writing the PV (The details of these functions are presented in Appendix G).

Original September 1995 130


UM25.0:SPE311
SIMVOX -- Version 2.3

D PV Type -- PV Type and PV Signal are related sections. In this section, you can select the
type of signal. Your input signal can be one of Calculation or Constant. These signals are
from devices within the current dataset. To bring in signals from other datasets, use
calculations. When you select the Track Calc radio button, a list of Calculation tags will be
displayed in the first PV Signal list. Note that Calculations must have been previously loaded
for you to be able to get the tags.

D PV Signal -- PV Type and PV Signal are related sections. With the selected type of tags
displayed in the list, you can double click on the tag. This will add it to the applied signals
list. Or you can single click and press the Add push--button. SIMVOX allows you to add only
one signal. To delete a signal from the applied list, simply select it by single clicking on it,
and press the Delete push--button. When you are done adding Input signals, press the Done
push--button. This reads your specification and saves it. To discard the selected signal from
the applied list, press the Clear push--button.

Here we present a simple example of a Meter tag, FQI--810--1.

Step 1.

Select meter tag and assign model personality to it as described in section 6.1.3.5.

Step 2..

Press the Details push--button. The Meter Dynamics dialog box will be displayed.

Step 3.

Choose modeling functions to be applied. Here we elect to Sum the counts to simulate a meter.
To do this, double click on Sum in the list on the left hand side. This will add Sum to the applied
functions list.

Note that the DeadTime function would be added and appear as Deadtime (x.y, S) in the list,
where x.y is the dead time, and S is the unit of time (M/S min/sec). You can edit this by double
clicking on the function.

Now you are done adding your modeling functions.

Step 4.

Now we are ready to specify what makes our counts rise and what makes it fall. We will define
our PV Signal as follows:

Input -- Constant value of 42.0

Original September 1995 131


UM25.0:SPE311
SIMVOX -- Version 2.3

Now press the Done push--button. SIMVOX will read the signal list and save it. Press the OK
push--button to return to the main tag dialog box. Verify that your Calculate If condition is
correct. Press the OK push button. This saves the meter tag definition in the SIMVOX database.

NOTE

The tag definition becomes effective immediately. If the


Calculate If condition evaluates to TRUE, the meter tag
will resolve based on the Input signal. If the Calculate If
condition evaluates FALSE, the meter will retain its last
value.

Specifying a pulse count meter is as rapid as the above exercise. No code was written at all and
the meter definition is complete.

The functionality of applied functions is as follows:

SUM:
Based on the scan time selected for the PCI, the input signal is added and serves as a
pulse increment. The pulse counter counts to 65535 and then rolls over. The resulting pulse
count is written to the SIMVOX database for communication back to the controller.
Additionally, the rate is calculated based on scan time as follows:

rate period * ( (current pulses -- last pulses) / (current time -- last time) ).

The Engineering Units Value displayed for the PCI is the rate * conversion factor.

TRACK:
The input signal is the raw pulse count which the PCI displays. In this case, since the
rate is not changing, the Engineering Units Value is 0.0.

6.1.3.7 Controlling Tag Execution


Tag execution can be controlled on an individual object level. Each tag object has its own scan
time and online/offline status. Furthermore, the entire dataset can be taken offline.

To control an individual object, follow these steps:

Step 1.

Original September 1995 132


UM25.0:SPE311
SIMVOX -- Version 2.3

Press the detail button for the object. Each object row has a detail button. This will display a
detail dialog box.

Step 2.

To adjust the scan time, select new time in the scan time dropdown list.

To adjust the online/offline status, select the appropriate radio button.

Step 3.

Press the OK button to save the definition. Your change goes into effect immediately.

To control execution of a dataset, follow these steps:

Step 1.

Press the Toolbar Scan On/Off button. This will display a dialog box.

Step 2.

Select the dataset to be controlled from the dropdown list. The select the Online/Offline radio
buttons appropriately.

Step 3.

Press the OK button to save the definition. Your change goes into effect immediately.

6.1.4 Building Calculation Objects


Calculations are user defined mathematical expressions which, using the built--in functions
(detailed in section 6.1.4.4), and the full range of relational/arithmetic operators, evaluate into
data which can be seamlessly integrated into the built--in process modeling environment. Indeed,
calculations are part of the modeling environment.

The nature of calculations is such that they provide a bi--directional gateway. Data from external
sources, i.e., 3GL programs or spreadsheets, can be brought in and made available to the
modeling environment via calculations. Additionally, data generated by calculations, can be
accessed by external 3GL programs and spreadsheets. Note that 3GL programs use the
programming API while spreadsheets, e.g., Excel, use DDE, to read/write calculations. This is
described in Section 5 and Section 6.2.3, respectively.

Original September 1995 133


UM25.0:SPE311
SIMVOX -- Version 2.3

6.1.4.1 Creating Calculations


You can create calculations into a new window or open an existing calculations file and add to it.
In both cases, the Add, Modify, and Delete menu options behave identically.

To open a new window, the Calculations main window must already be started. The leftmost
Toolbar icon, blank sheet, is used to open an new child window. Alternatively, the File--New
pulldown menu option can be used.

When selected, a dialog box will be displayed where you must specify the dataset for the new
calculations window. Only the empty and available datasets are presented in the dropdown list.

If a calculations file already exists, and you want to edit it, the second from left Toolbar icon, file
folder, is used to open a child window. Alternatively, the File--Open pulldown menu option can
be used.

When selected, a dialog box will be displayed where you must specify the dataset and the name
of the calculations file to be opened. Only the empty and available datasets are presented in the
dropdown list.

Select a dataset and press OK. This will open a child window as described in Section 4.5.

To save the created calculations to a disk file, use the Toolbar icon (third from left), or select the
File--Save pulldown menu option. To save the file with a new name, use the File--Save As
pulldown menu option.

6.1.4.1.1 Add
Select the Edit--Add pulldown to add new calculations. When selected, the Add Calculation
dialog box will be displayed.

To add the HeatRise calculation we defined for the Temperature loop in Section 6.1.2.7.2, follow
these steps:

Step 1.

Edit the Tag field. Enter HeatRise.

Step 2.

Edit the Desc field. Enter a description (16 characters).

Step 3.

Original September 1995 134


UM25.0:SPE311
SIMVOX -- Version 2.3

Set the calculation to be online by clicking on the online radio button.

Step 4.

Set the calculation to be Internal by clicking on the Internal radio button. External calculations
allow you to bring in information from external 3GL programs or spreadsheets.

Step 5.

Set the evaluation mechanism to be Time Based by clicking on that radio button. On Demand
calculations are evaluated when they are referenced by another object. Now that Time Based has
been specified, the Scan time can be adjusted.

Step 6.

Now we are ready to specify our expression. Single click on the Edit push--button. This will
enable the expression field for data entry. This will grey the OK push--button. Enter the
following:

(PVE(TIC--810--1) + (DCD_EQ (XV--810--1, OPEN) * CALC(AvailVol) * 0.1))

Step 7.

Press the Check push--button. This will perform a syntax check and inform you if there are any
errors. If no errors are found, The OK push button will become ungreyed. You can also test your
expression to see what it evaluates to under the current system values. To do this, press the Test
push--button. This will display the Test dialog box. Press Test again to evaluate the expression.
The expression value will be shown as well as any errors. Press OK or Cancel to go back.

Step 8.

Enter an 80 character comment for this calculation in the comment field.

Step 9.

Press the OK push--button to save the calculation. The calculation will be added to the child
window, and it will start resolving immediately.

6.1.4.1.2 Modify

Original September 1995 135


UM25.0:SPE311
SIMVOX -- Version 2.3

Select the Edit--Modify pulldown to clone the calculation we just added. When selected, the
Modify Calculation dialog box will be displayed.

To create the HeatLoss calculation we defined for the Temperature loop in Section 6.1.2.7.2,
follow these steps:

Step 1.

Select the HeatRise calculation from the dropdown list. This will display the calculation details.

Step 2.

Now we are ready to specify our new expression. Single click on the Edit push--button. This will
enable the expression field for data entry. This will grey the SAVE and SAVE AS pushbuttons.
Enter the following:

(PVE(TIC--810--1) -- (DCD_NEQ (XV--810--1, OPEN) * CALC(AvailVol) * 0.1))

Step 3.

Press the Check pushbutton. This will perform a syntax check and inform you if there are any
errors. If no errors are found, The SAVE and SAVE AS pushbuttons will become ungreyed. You
can also test your expression to see what it evaluates to under the current system values. To do
this, press the Test pushbutton. This will display the Test dialog box. Press Test again to evaluate
the expression. The expression value will be shown as well as any errors. Press OK or Cancel to
go back.

Step 4.

Enter a new 80 character comment for this calculation in the comment field.

Step 5.

Press the SAVE AS pushbutton to save the calculation. The Save As dialog box will be
displayed. Here you must enter a new Tag. Enter HeatLoss, and press enter. SIMVOX will check
for duplicate tags and if none are found, it will add the cloned calculation to the dataset child
window.

6.1.4.1.3 Delete
You cannot delete calculations unless the entire dataset is offline. To take a dataset offline, use
the On/Off Toolbar icon.

Original September 1995 136


UM25.0:SPE311
SIMVOX -- Version 2.3

Select the Edit--Delete pulldown to delete existing calculations. When selected, the Delete
Calculation dialog box will be displayed.

To delete a calculation, follow these steps:

Step 1.

Select the calculation tag from the dropdown list. This will display the calculation details.

Step 2.

Press the OK pushbutton. This will remove the calculation and repaint the display.
Step 3.

Press the Cancel pushbutton to return back to the child window display. A prompt to reload the
dataset will be displayed. Press the YES pushbutton, and the dataset will be reloaded and
brought back online.

6.1.4.2 Loading Calculation CDV files


With the Calculations Window open, as described in section 4, you can load the created
calculations CDV file into a child window. The following steps illustrate this:

Step 1.

Click on the File pulldown and then select Open;


OR
Click on the second (from left) Toolbar icon (file folder open).

The Load Calc File dialog box will be displayed.

Step 2.

Select the dataset from the dropdown list. The list displayed will comprise all the available
datasets.

Step 3.

Press the Browse pushbutton to get the File Open dialog. You can browse around in the
directories and select the file, wherever it is located. Double clicking on the file, or single
clicking and then pressing the OK pushbutton will read the file name and directory into the Load
Calc File dialog box.

Original September 1995 137


UM25.0:SPE311
SIMVOX -- Version 2.3

Step 4.

With the dataset selected and the calculations file selected, press the OK pushbutton. SIMVOX
will start reading the file, checking it for syntax errors as it goes along. If no errors are detected,
the calculations child window will be created.

If any errors are detected in the calculations file, an error message prompt will be displayed
showing the text in error. You can correct the errors by editing the tag file with any standard text
editor. The Toolbar contains the notepad icon. You can use it to edit.

Step 5.

The Calculations file is now loaded.

6.1.4.3 Calculations Detail Dialog


In the Calculations child window, next to the Type column, there is a column of buttons, one
for each row. This button allows you to open a dialog box which contains the details of the
calculation in that row.

Step 1.

Single click on this button. This will display a dialog box showing all the known detail for the
calculation.

Step 2.

The fields in this dialog are:

D Tag -- This is an alpha--numeric label for the data.


D Desc -- (Optional) description field.
D Scan time -- This depends on the Evaluation mechanism. If the calculation is Time Based, the
scan time can be changed. Valid range is 1--15 seconds.
D Online/Offline -- The calculation can be offline or online. An offline calculation is not
resolved. The value of a calculation can be edited by taking it offline. This will become the
new value of the calculation and will be available to all other objects.
D Internal/External -- This defines the source of the calculation value. Internal calculations use
the expression specified in this dialog box to calculate the calculation value. External
calculations receive their values from external sources.
D Time Based/On Demand -- These radiobuttons control the evaluation mechanism of the
calculation. Time--based calculations use the scan time to resolve and produce events. On
Demand calculations are evaluated only when they are called.
D Expression -- This is a user--defined mathematical expression which can be entered by
clicking on the Edit pushbutton. It is limited to a size of 325 characters.

Original September 1995 138


UM25.0:SPE311
SIMVOX -- Version 2.3

D Comment -- The comment field can be edited after pressing the Edit pushbutton.

Step 3.

After editing, (uneditable fields are grey) press the OK pushbutton to save changes in the
SIMVOX database. If no changes were made or to discard changes, press the Cancel pushbutton.

Step 4.

For dialog box help, simply press the Help pushbutton.

6.1.4.4 Calculation Functions


A large number of functions are built into the Calculations subsystem, of SIMVOX. In this
section, the function format, parameter types and returned values are detailed. The functions can
be divided into two types: mathematical functions and Process functions. These are detailed in
Section 6.1.4.4.1 and Section 6.1.4.4.2. Arithmetic and relational expressions can be created
using these functions and constant values. These are detailed in Section 6.1.4.4.3. All results are
floating point numbers.

6.1.4.4.1 Mathematical functions

ABS 1 parameter Absolute value of parameter

Usage:
ABS (--100.0)
ABS (PVE (TIC--810--1))
ABS (CALC (TestCalc))

Return Value:
This function returns the absolute value of its parameter.

EXP 1 parameter Exponential function of parameter

Usage:
EXP (1.0)
EXP (CALC (AnotherCalc))

Return Value:
This function returns the exponentiol function of its parameter.

Original September 1995 139


UM25.0:SPE311
SIMVOX -- Version 2.3

IN 3 parameters Inclusion comparison

Usage:
IN (CALC(MyCalc), FLOW (XV--800--1,OPEN), FLOW (FIC--800--2,))

Return Value:
This function returns 1.0 if the first parameter lies between the second two parameters.
Otherwise, it returns 0.0. If any tag is not found, the returned value is 0.0, and an error message
is displayed in the spreadsheet error column.

LIMIT 3 parameter Bounds comparison

Usage:
LIMIT (CALC(MyCalc), 100.0. 0.0)

Return Value:
This function returns the parameter if it lies between the second two parameters. If
parameter is higher than the second parameter, the second parameter is returned. Otherwise, if it
is lower than the third parameter, the third parameter is returned. If any tag is not found, the
returned value is 0.0, and an error message is displayed in the spreadsheet error column.

LOG 1 parameter Log base 2 of parameter

Usage:
LOG (4.0)
LOG (PVE (TI--810--1))

Return Value:
This function returns the log base 2 of its parameter.

LOG10 1 parameter Log base 10 of parameter

Usage:
LOG10 (100.0)
LOG10 (PVE (TI--810--1))

Return Value:
This function returns the log base 10 of its parameter.

Original September 1995 140


UM25.0:SPE311
SIMVOX -- Version 2.3

MIN 2 parameters Minimum of the 2 parameters

Usage:
MIN (FLOW (XV--800--1,), FLOW (XV--810--1, OPEN))
MIN (FLOW (XV--800--1,),
MIN (FLOW(FIC--810--1,), FLOW (XV--810--1, OPEN)))

Return Value:
This function returns the minimum of its 2 parameter.

MAX 2 parameters Maximum of the 2 parameters

Usage:
MAX (FLOW (XV--800--1,), FLOW (XV--810--1, OPEN))
MAX ((FLOW (XV--800--1,)/2.5),
MAX ((FLOW(FIC--810--1,)*5.0), FLOW (XV--810--1, OPEN)))

Return Value:
This function returns the maximum of its 2 parameter.

POW 2 parameter Power

Usage:
POW (FLOW(FI--100--1), 2)

Return Value:
This function returns the first parameter raised to the second parameter. If any tag is not
found, the returned value is 0.0, and an error message is displayed in the spreadsheet error
column.

SQRT 1 parameter Square Root of parameter

Usage:
SQRT (FLOW (XV--800--1,))
SQRT (CALC (CalcTag)

Return Value:
This function returns the square root of its parameter.

ACOS 1 parameter The arccosine of parameter

Original September 1995 141


UM25.0:SPE311
SIMVOX -- Version 2.3

Usage:
ACOS (X)

Return Value:
This function returns the arccosine of X in the range 0 to pi radians.

COS 1 parameter The cosine of parameter

Usage:
COS (X)

Return Value:
This function returns the cosine of X.

COSH 1 parameter The hyperbolic cosine of parameter

Usage:
COSH (X)

Return Value:
This function returns the hyperbolic cosine of X.

ASIN 1 parameter The arcsine of parameter

Usage:
ASIN (X)

Return Value:
This function returns the arcsine of X in the range --pi/2 to pi/2 radians.

SIN 1 parameter The sine of parameter

Usage:
SIN (X)

Return Value:
This function returns the sine of X.

SINH 1 parameter The hyperbolic sine of parameter

Usage:
SINH (X)

Original September 1995 142


UM25.0:SPE311
SIMVOX -- Version 2.3

Return Value:
This function returns the hyperbolic sine of X.

ATAN 1 parameter The arctangent of parameter

Usage:
ATAN (X)

Return Value:
This function returns the arctangent of X in the range --pi/2 to pi/2 radians.

TAN 1 parameter The tangent of parameter

Usage:
TAN (X)

Return Value:
This function returns the tangent of X.

TANH 1 parameter The hyperbolic tangent of parameter

Usage:
TANH (X)

Return Value:
This function returns the hyperbolic tangent of X.

RAN 2 parameters The random number generator

Usage:
RAN (10.0, 20.0)

Return Value:
This function returns a pseudo random floating point number between the first argument
and the second argument.

6.1.4.4.2 Process functions

AI 1 parameter Percent value of Analog In tag parameter

Usage:
AI (TI--100--1)
AI (PI--810--1)

Original September 1995 143


UM25.0:SPE311
SIMVOX -- Version 2.3

AI (FI--831--1)

Return Value:
This function returns the percent value of the parameter tag. The value is in the range 0.0
to 100.0. If tag is not found, the returned value is 0.0, and an error message is displayed in the
spreadsheet error column.

AIE 1 parameter Engineering units value of Analog In tag pa-


rameter

Usage:
AIE (TI--100--1)
AIE (PI--810--1)
AIE (FI--831--1)

Return Value:
This function returns the engineering units value of the parameter tag. The value is in the
range EUL to EUH, as defined by the object. If tag is not found, the returned value is 0.0, and an
error message is displayed in the spreadsheet error column.

AO 1 parameter Percent value of Analog Out tag pa-


rameter

Usage:
AO (XPO--100--1)

Return Value:
This function returns the percent value of the parameter tag. The value is in the range 0.0
to 100.0. If tag is not found, the returned value is 0.0, and an error message is displayed in the
spreadsheet error column.

AOE 1 parameter Engineering units value of Analog Out tag pa-


rameter

Usage:
AOE (XPO--100--1)

Return Value:
This function returns the engineering units value of the parameter tag. The value is in the
range EUL to EUH, as defined by the object. If tag is not found, the returned value is 0.0, and an
error message is displayed in the spreadsheet error column.

Original September 1995 144


UM25.0:SPE311
SIMVOX -- Version 2.3

CALC 1 parameter Engineering units value of Calculation specified by


tag

Usage:
CALC (MyCalc)

Return Value:
This function returns the engineering units value of the parameter tag. The value is the
evaluated result of the calculation expression. If tag is not found, the returned value is 0.0, and
an error message is displayed in the spreadsheet error column.

You can call other calculations from within a calculation expression. The following rules
must be followed when calling calculations which are On--Demand or Time--Based.

Caller Calculation Type Called Calculation Type Valid?

On Demand Time Based Y


On Demand On Demand N
Time Based Time Based Y
Time Based On Demand N

DCD_EQ 2 parameter DCD status and SP comparison

Usage:
DCD_EQ (XV--800--1, OPEN)
DCD_EQ (XV--100--1, CLOSE)

Return Value:
This function returns the value 1.0 if the Discrete Control Device specified by parameter
tag is in the specified SP. Otherwise, 0.0 is returned. If tag is not found, the returned value is 0.0,
and an error message is displayed in the spreadsheet error column.

DCD_NEQ 2 parameter DCD status and SP comparison

Usage:
DCD_NEQ (XV--800--1, OPEN)

Original September 1995 145


UM25.0:SPE311
SIMVOX -- Version 2.3

DCD_NEQ (XV--100--1, CLOSE)

Return Value:
This function returns the value 1.0 if the Discrete Control Device specified by parameter
tag is not in the specified SP. Otherwise, 0.0 is returned. If tag is not found, the returned value is
0.0, and an error message is displayed in the spreadsheet error column.

DIO 1 parameter Object value of Discrete In/Out tag parameter

Usage:
DIO (LS--100--1)
DIO (TEST--DO)

Return Value:
This function returns the value of the parameter tag. The value is 0.0 or 1.0. If tag is not
found, the returned value is 0.0, and an error message is displayed in the spreadsheet error
column.

FILT 3 parameters value to be filtered, time, gain

Usage:
FILT (AIE(TI--100--1), 10.0, 1.0)
FILT (CALC(TEST--DO), 20.0, 1.0)

Return Value:
This function returns the 1st order filter value of the 1st parameter, based on the 2nd and
3rd parameters (time factor and gain, respectively). If an error occurs in obtaining the value of
the 1st parameter, a 0.0 is returned and an error message is displayed in the spreadsheet error
column.

FLOW 2 parameter Flow for DCD/Loop tag parameter

Usage:
FLOW (FIC--100--1, )
FLOW (XV--800--1, OPEN)
FLOW (XV--800--2, )

Return Value:
This function returns the engineering units flow value of the parameter tag as defined
below:

Original September 1995 146


UM25.0:SPE311
SIMVOX -- Version 2.3

1. If the tag is a loop, the second parameter is ignored and the current PV value is returned.
2. If the tag is a Discrete Control Device, and the second parameter is specified (non blank), then
the current flow is returned only if the Discrete Control Device is in the specified SP. If not, a 0.0
is returned.
3. If the tag is a Discrete Control Device, and the second parameter is blank, then the current
flow is returned regardless of the SP.

If tag is not found, the returned value is 0.0, and an error message is displayed in the spreadsheet
error column.

IVP 1 parameter IVP of the Loop tag parameter

Usage:
IVP (FIC--100--1)

Return Value:
This function returns the IVP of the parameter tag in percent. The value is in the range
0.0 to 100.0. If tag is not found, the returned value is 0.0, and an error message is displayed in
the spreadsheet error column.

POLY 4 parameters Polynomial constants

Usage:
POLY (Arg1, Arg2, Arg3, Arg4)

Return Value:
This function returns the 3rd degree polynomial value of the specified parameters.

PVE 1 parameter Engineering units PV of Loop tag parameter

Usage:
PVE (FIC--100--1)

Return Value:
This function returns the PV of the parameter tag in engineering units. The value is in the
range EUL to EUH, of the specified object. If tag is not found, the returned value is 0.0, and an
error message is displayed in the spreadsheet error column.

Original September 1995 147


UM25.0:SPE311
SIMVOX -- Version 2.3

PV 1 parameter Percent PV of Loop tag parameter

Usage:
PV (FIC--100--1)

Return Value:
This function returns the PV of the parameter tag in percent. The value is in the range 0.0
to 100.0. If tag is not found, the returned value is 0.0, and an error message is displayed in the
spreadsheet error column.

PULSES 1 parameter Raw pulses value of PCI tag parameter

Usage:
PULSES (PCI--TAG)

Return Value:
This function returns the raw pulses value of the parameter tag. The value is in the range
0.0 to 65535.0. If tag is not found, the returned value is 0.0, and an error message is displayed in
the spreadsheet error column.

RATE 1 parameter Last calculated rate value of the PCI tag pa-
rameter

Usage:
RATE (PCI--TAG)

Return Value:
This function returns the rate value of the parameter tag as calculated by SIMVOX. If tag
is not found, the returned value is 0.0, and an error message is displayed in the spreadsheet error
column.

PCIE 1 parameter Engineering units value of Pulse Count Input tag pa-
rameter

Usage:
PCIE (PCI--TAG)

Return Value:
This function returns the engineering units value of the parameter tag. The value is in the
range EUL to EUH, as defined by the object. If tag is not found, the returned value is 0.0, and an
error message is displayed in the spreadsheet error column.

Original September 1995 148


UM25.0:SPE311
SIMVOX -- Version 2.3

6.1.4.4.3 Operators

The following operators are supported:

Operator Symbol Result Description

+ Number Add results of functions or constants


-- Number Subtract results of functions or constants
* Number Multiply results of functions or constants
/ Number Divide results of functions or constants

< 0.0 or 1.0 compare results of functions or constants, a1<a2


<= 0.0 or 1.0 compare results of functions or constants,
a1<=a2
> 0.0 or 1.0 compare results of functions or constants, a1>a2
>= 0.0 or 1.0 compare results of functions or constants,
a1>=a2
= 0.0 or 1.0 compare results of functions or constants, a1=a2
<> 0.0 or 1.0 compare results of functions or constants,
a1<>a2

OR 0.0 or 1.0 0.0 if both arguments are 0.0


1.0 if a1 = 1.0 OR a2 = 1.0
AND 0.0 or 1.0 0.0 if one argument is 0.0
1.0 if both arguments are 1.0
NOT 0.0 or 1.0 0.0 if argument is 1.0
1.0 if argument is 0.0

NOTE

When using a Unary -- or NOT, always enclose the


expression in parentheses. For example,
(FLOW(XV--800--1,)*(--2)) and
(NOT (DIO (LS--810--1)))

Original September 1995 149


UM25.0:SPE311
SIMVOX -- Version 2.3

6.2 Developing Tiebacks/Models as External Program


The development of tiebacks/models is a continuous activity. Once the program has been
written, it is most likely to be revised repeatedly to incorporate ever changing process
conditions and needs. To avoid wasted time and effort, it is recommended that writing code
be among the last things to be done.

6.2.1 Porting existing code to SIMVOX


When porting existing code, there are three issues to address. These are:

1. The name of the main module;


2. The calling sequence; and
3. Unsupported functions.

Main module name.

In existing C code, the name of the main module is main (). It represents the entry point of the
program when it is started. With SIMVOX, the entry point of the program is now a module
which creates a window. After window creation completes, this module starts a second thread
from which the existing code will be called as an external module. Consequently, you must
assign a specific name to the code module. This name is Model. By changing main () to Model
(), the existing code becomes a function which can be called from the window. The existing code
is now compiled as an external module and always linked with mod.obj, as shown in the make
file below.

Existing FORTRAN code follows the same mechanism. The FORTRAN main program has a
statement program xyz. This statement is not needed any more. Instead, the main program is
converted to a subroutine with the name MODEL, compiled as an external module and linked
with fmod.obj. The window creation is handled by fmod.obj.

Calling Sequence Changes.

The VAX/VMS version of SIMVOX provided a programming API which allowed


Tiebacks/Models to access SIMVOX data. The calling sequence was defined, such that, all
function parameters were passed to SIMVOX by reference. This means that the address of the
parameter in the Tieback/Model was passed to SIMVOX. The reason for this was so that C and
FORTRAN could call the same API and get the identical functionality.

In general, FORTRAN passes all parameters by reference. C calls could easily be made to do
the same, even though C, in general, passes all parameters by value. VAX/VMS further allowed
passing constants, eg, file--card--channel addresses, by reference.

Original September 1995 150


UM25.0:SPE311
SIMVOX -- Version 2.3

This is not the case with the compilers available under Windows NT.

C Code.

When porting existing C code, the only code that must change is where a SIMVOX function is
being called with a constant passed by reference. For example:

Existing code: sim20_getaip (&ds, &10101, &value, &error, &errdst);


Ported code: sim20_getaip (&ds, 10101, &value, &error, &errdst);

Existing code: sim20_getdi_fcc (&ds, &12, &11, &13, &value, &error, &errdst);
Ported code: sim20_getdi_fcc (&ds, 12, 11, 13, &value, &error, &errdst);

Existing code: sim20_setpci (&ds, &40703, &value, &rate_p, &error, &errdst, &10);
Ported code: sim20_setpci (&ds, 40703, &value, &rate_p, &error, &errdst, 10);

Please examine the C model provided as an example. This is located in your installed SIMVOX
directory. The subdirectory is called \C.

FORTRAN Code.

When porting existing FORTRAN code, the only code that must change is the SIMVOX
function names. This can be easily accomplished with a search and replace in the editor of your
choice. For example:

Existing code: call sim20_getaip (ds, 10101, value, error, errdst);


Ported code: temp_ai = sim20_getaip (ds, 10101, value, error, errdst);

Existing code: call sim20_getdi_fcc (ds, 12, 11, 13, value, error, errdst);
Ported code: temp_di sim20_getdi_fcc (ds, 12, 11, 13, value, error, errdst);

Where temp_ai and temp_di are temporary Double and long variables, respectively. These are
required because the SIMVOX functions all return a value.

Please examine the FORTRAN model provided as an example. This is located in your installed
SIMVOX directory. The subdirectory is called \FORTRAN.

For a complete description of the current programming API, please refer to Appendices A--E.
The function calling sequence is also detailed under the online SIMVOX main menu help.

Original September 1995 151


UM25.0:SPE311
SIMVOX -- Version 2.3

Unsupported Functions.

The Programming API of SIMVOX supports all functions available in existing VAX/VMS code,
with the exception of the following:

1. sim20_wakeup; and
2. sim20_sleep.

At the VAX/VMS level, the wakeup/sleep combination scheduled the tieback/model to be


executed on specific time intervals. Such a mechanism is not available under Windows NT.
Consequently, these functions are merely placeholders. The sim20_wakeup function simply
returns TRUE, while the sim20_sleep funtion delays for 1 second before resuming execution.

6.2.2 Compiling/Linking your Tieback/Model


SIMVOX provides you with make files to compile and link your C or FORTRAN
tiebacks/models with SIMVOX. These make files are invoked from the command prompt of
Windows NT. One make file creates programs which run as windows. The second produces a
program which can be invoked from the DOS prompt.

The following is text of the make files, followed by it being invoked.

C Make File:

!include <ntwin32.mak>

# If xyz is the name of the source file, then specify it as follows


proj = xyz

all : $(proj).exe

# Update the object file if necessary


$(proj).obj : $(proj).c
$(cc) $(cflags) $(cvarsdll) $(proj).c

$(proj).exe : $(proj).obj mod.obj c:\simvox\simapi.lib c:\simvox\simlib.lib c:\simvox\dblib.dll mod.res


$(link) $(guiflags) $(proj).obj mod.obj mod.res \
$(guilibsdll) c:\simvox\simapi.lib c:\simvox\simlib.lib c:\simvox\dblib.dll

You can copy this file as xyz.mak. To invoke this make file, open the command prompt window.
Set your default directory where your source files are located. Then from the prompt, enter the
following command:

nmake /f xyz.mak

Original September 1995 152


UM25.0:SPE311
SIMVOX -- Version 2.3

The make file will compile and link xyz if a change was made to the source program since the
last compile/link. If compile errors are detected in the source program, the error messages are
sent to the users terminal. You must correct these errors and repeat the compilation process.

FORTRAN Make File:

# If xyz is the name of the source file, then specify it as follows


proj = xyz

all : $(proj).exe

# Update the object file if necessary


$(proj).obj : $(proj).for
fl32/c $(proj).for

$(proj).exe: $(proj).obj fmod.obj c:\simvox\simapi.lib \


c:\simvox\simlib.lib c:\simvox\dblib.lib fmod.res
link --debug:full --debugtype:cv --align:0x1000 --subsystem:windows \
--entry:WinMainCRTStartup libcmt.lib kernel32.lib user32.lib \
gdi32.lib comdlg32.lib winspool.lib $(proj).obj fmod.obj fmod.res \
c:\fpsnt\lib\msvcrt.lib c:\fpsnt\lib\msfrt.lib c:\simvox\simapi.lib \
c:\simvox\dblib.lib c:\simvox\simlib.lib --out:$(proj).exe

You can copy this file as xyz.mak. To invoke this make file, open the command prompt window.
Set your default directory where your source files are located. Then from the prompt, enter the
following command:

nmake /f xyz.fmk

The make file will compile and link xyz if a change was made to the source program since the
last compile/link. If compile errors are detected in the source program, the error messages are
sent to the users terminal. You must correct these errors and repeat the compilation process.

For a complete description of the compilation process, the user is referred to the compiler
manufacturers language reference and users manual.

6.2.3 Spreadsheet access to SIMVOX via DDE


SIMVOX data can be accessed from spreadsheets and other applications outside the SIMVOX
environment via Dynamic Data Exchange (DDE). In this case, SIMVOX acts as the Server and
the external application is the Client. Only DDE hot links are supported, i.e., the Client requests
for SIMVOX data once and, thereafter, the SIMVOX server continuously updates the Client with
new data values as they change.

SIMVOX data access is supported in the following formats:

Original September 1995 153


UM25.0:SPE311
SIMVOX -- Version 2.3

a. by Address (e.g., File--Card--Channel); and


b. by Tag.

Access by address currently supports the PROVOX addressing methodology of File, Card, and
Channel only. As Allen Bradley PLC, Modicon PLC, and RS3 controllers are added, their
respective addressing mechanisms will also be supported.

Access by Tag allows external applications to request data by tag (e.g., Discrete Control Device,
Loop, Analog Input, Analog Out, e.t.c.), or by Calculation tag (i.e., User calculations).

Each DDE link specification contains three parts: the application specification, the topic
specification, and the item label. E.g.

SIMVOX|AIDS1!WT--803--1

In the above example SIMVOX is the application, AIDS1 is the topic and WT--803--1 is the item
label. Note the seperators between the three parts: the | and the !.

6.2.3.1 Reading from SIMVOX via DDE

To read SIMVOX data into a spreadsheet, follow these steps:

Step1.

Select a spreadsheet cell.

Step2.

Specify one of following DDE hot link command:

a. Address access: =SIMVOX|FCCDSn!FICACH


b. AI Tag access: =SIMVOX|AIDSn!MyTag
c. AO Tag access: =SIMVOX|AODSn!MyTag
d. DI Tag access: =SIMVOX|DIDSn!MyTag
e. DO Tag access: =SIMVOX|DODSn!MyTag
f. PCI Tag access: =SIMVOX|PCIDSn!MyTag
g. Loop Tag Flow access: =SIMVOX|LPVDSn!MyTag
h. Loop Tag Output access: =SIMVOX|LVODSn!MyTag
i. DCD Tag Setpoint access: =SIMVOX|DCDDSn!MyTag
j. DCD Tag Flow access: =SIMVOX|DPVDSn!MyTag
k. Calculation Tag access: =SIMVOX|CALCDSn!CalcTag
l. Scenario Tag access: =SIMVOX|SCNDSn!Scenario

Original September 1995 154


UM25.0:SPE311
SIMVOX -- Version 2.3

where
n = dataset number, 1 to 8 maximum.

FICACH is the file--card--channel address, including leading zeros. For example, to read
file 1, card 1, and channel 1, specify 010101. For file 16, card 14, channel 16, specify
161416.

MyTag is the tag for the selected data item in the selected dataset.

CalcTag is a Calculation tag in the selected dataset.

Step3.

The SIMVOX data will appear in the spreadsheet cell.

6.2.3.2 Writing to SIMVOX via DDE

To write data to SIMVOX from a spreadsheet, follow these steps:

Step1.

You can write data into SIMVOX by using the DDE write capability of spreadsheets and other
DDE compliant applications. For example, in Excel, the following macro can be used to open a
channel and then write to a specific data item.

a. Address write:

=INITIATE(SIMVOX,FCCDSn)
=POKE(Chan1,FICACH,C1)
=TERMINATE(Chan1)
=RETURN()

b. Tag write:

=INITIATE(SIMVOX,AIDSn)
=POKE(Chan2,MyTag,D5)
=TERMINATE(Chan2)
=RETURN()

NOTE

Tag writes are only allowed for Analog Inputs, Discrete


Inputs and Pulse Count Inputs.

Original September 1995 155


UM25.0:SPE311
SIMVOX -- Version 2.3

c. Calculation write:

=INITIATE(SIMVOX,CALDSn)
=POKE(Chan3,CalcTag,A10)
=TERMINATE(Chan3)
=RETURN()

where
n = dataset number, 1 to 4 maximum.

FICACH is the file--card--channel address, including leading zeros. For example, to read
file 1, card 1, and channel 1, specify 010101. For file 16, card 14, channel 16, specify
161416.

MyTag is an Analog Input tag in the selected dataset.

CalcTag is a Calculation tag in the selected dataset.

Chan1, Chan2, Chan3 are the names defined for each respective INITIATE command
using Excels Formula Name Define option.

C1, D5, A10, e.t.c., are cells in the spreadsheet.

Original September 1995 156


UM25.0:SPE311
SIMVOX -- Version 2.3

7.0 Problems and Solutions


Problems can be commonly categorized as follows:

(1) Cable/connection problems;


(2) E/I card problems;
(3) Configuration problems; and
(4) Tieback/model problems.

In the following paragraphs, we discuss these categories.

(1) CABLE/CONNECTION PROBLEMS

The first step in checking communications is to verify that the line status is correct. A
Communication Line Monitor is an invaluable tool for this purpose. The line status
depicted in Figure 3.5 assumes the male connector of the line monitor connected directly
to the E/I card. The female side of the line monitor is connected to the cable going to the
PC Workstation. With the cables connected in this way and communications active, the
line monitor should have the status depicted in Figure 3.5.

Figure 3.5 also depicts the line monitor status when only parts of the cable are connected.
For example, with only the PC side connected, only yellow LED number 3 is on.

Alternatively, with the line monitor connected to the E/I card only, yellow LED number
2, red LEDs number 4 and 20 should be on. In addition, the red LED number 2 should
flash periodically.

With both sides connected, yellow LEDs 2 and 3 should be on and red LEDs 4, 5, 6, and
20 should be on. Then with communications active, LEDs 2 and 3 on both sides flash
periodically. If the user does not see this, the cable has a problem which should be
corrected.

(2) E/I CARD PROBLEMS

The E/I card should be in the correct state for communications to work. The green LED
on the E/I card should be blinking on a 1 second interval with no communications. When
communications are initiated and are valid, the LED does not blink.

If the LED blinks on a half second interval or is off, the E/I card is in an invalid state. To
correct this, remove the E/I card from the I/O card file and disconnect the RS--232 cable
going to the PC Workstation. Reinstall the E/I card first and wait for the green LED to
blink on a 1 second interval. Now reconnect the cable between the E/I card and the PC
Workstation.

As mentioned above in cable/connection problems, the line monitor should display a


certain status with only the E/I card connected to it. If that is not the case, the E/I card
may be bad, and hence should be replaced.

Original September 1995 157


UM25.0:SPE311
SIMVOX -- Version 2.3

(3) CONFIGURATION PROBLEMS

In this category, the user will see symptoms like no communications at all or
communications with invalid data values. This may be caused by a configuration
mismatch between the controller and SIMVOX.

In the first case, the E/I card may be configured in the wrong I/O card file. Or the
physical address on the I/O card file may be wrong. Please refer to Figure 3.3 for
information on I/O card file addressing. Additionally, the E/I card may have been placed
in the wrong slot in the I/O card file.

In the second case, the E/I card does not get its configuration from SIMVOX, but rather
from the controller. SIMVOX sets the I/O configuration from the user supplied SIO file.
The File_card_channels specified in the SIO file should match the card list of the E/I card
in the controller definition. Since the E/I card reads and writes data values from specific
parts of the SIMVOX database, a discrepancy arises with configuration mismatches. The
user should terminate communications, correct the mismatches and reinitiate the entire
process.

Another reason for bad data values is when physical I/O cards, (which are also being
simulated through the E/I card), are placed in the I/O card file along with the E/I card.
The user should remove simulated cards and leave only the E/I card and unsimulated
cards installed in the card file.

(4) TIEBACK/MODEL PROBLEMS

Problems in tiebacks/models may be incorrect data values being passed to SIMVOX


subroutines. Appendices A--E has the correct formats and declarations for parameters
used in each subroutine.

A list of errors returned by SIMVOX along with the descriptions is attached in


Appendix F.

Original September 1995 158


UM25.0:SPE311
SIMVOX -- Version 2.3

8.0 Examples
This section will define more complex modeling examples. A more detailed description of a
level and temperature model will follow. The definition of the process to be modeled precedes
the steps needed to model through SIMVOX.

8.1 Level Model Definition

LEVEL MODEL FOR T2


15 gpm FV-- 022
B-- 100 STRAINER
50000 gal LY-- 021
15 gpm
P-- 100A FC

T2 TT TIC
023 023

LIC FO
2000 gal
021
P-- 100B TY-- 023
15 gpm
FV-- 025
LIT
B-- 201 15 gpm
15 gpm 021
20000 gal P-- 02A
P-- 201A
FT FT
FY-- 024
024A 024B

FI FI
0024A 024B
P-- 02B
FIC
P-- 201B 15 gpm
15 gpm 024

SUMMARY:

For simulation purposes, the modeled process liquid is water.

All Supply DCDs (e.g. Pumps P--100A & P--100B) have flow set to 15 gpm.

All Pathing DCDs (e.g. FV--022) have flow set to the path capacity.

FI024A and FI024B are a redundant transmitters.

LIC021 is selected to be a vertical tank with 2000 gallon capacity.

CALCULATIONS:

Original September 1995 159


UM25.0:SPE311
SIMVOX -- Version 2.3

T2_PMP1
(DCD_EQ(P_02A,START) OR DCD_EQ(P_02B,START)) AND (PV(LIC021) > 1)
AND (DCD_NEQ(FV025,CLOSE))

B100_PMP1
(DCD_EQ(P_100A,START) OR DCD_EQ(P_100B,START)) AND
(DCD_NEQ(FV022,CLOSE))

B201_PMP1
(DCD_EQ(P_201A,START) OR DCD_EQ(P_201B,START)) AND
(DCD_NEQ(FV022,CLOSE))

T2_IN
(CALC(B100_PMP1) OR CALC(B201_PMP1) * FLOW(FV022,) * (IVP(LIC021) /
100)

T2_OUT
CALC(T2_PMP1) * DCD_EQ(FV025,FEED) * (IVP(FIC024) / 100) * 15gpm

FLOW_OUT
(IVP(LIC021)/100) * 120 #/m

ASSIGNMENT:

LIC021
a. Calc If: ALWAYS
b. Function: INTEGRATE
c. PV(in): Track Calc: T2_IN
d. PV(out): Track Calc: T2_OUT

FI024A,B
a. Calc If: If Calc T2_PMP1
b. Function: FILTER1
c. Track Calc:FLOW_OUT

8.1.1 Level Model Steps

Step 1.

Select the Discrete Control Device window of the Tieback program. Depress the detail
button of the P--100A Discrete Control Device on the spreadsheet. In the Discrete
Control Device Dynamics Group box select the START setpoint and enter in 15.0 in the
Value field. Press OK and repeat for P--100B, P--201A, and P--201B. Similarly set the
flow value for each of the path Discrete Control Devices, such as FV--022 and FV--025.

Original September 1995 160


UM25.0:SPE311
SIMVOX -- Version 2.3

Step 2.

Bring up the Calculation program and create a new calculation file. (See Section 4.5)
Click on the Edit Add option and add calculation T2_PMP1.
Press the Edit pushbutton and enter in the expression for this calculation.
For this calculation, we wish to confirm that either pump P_02A or P_02B is running and
that there is something in tank T2 and that the outlet valve FV025 is not closed. The
equation for this is:
(DCD_EQ(P_02A,START) OR DCD_EQ(P_02B,START)) AND (PV(LIC021) > 1)
AND (DCD_NEQ(FV025, CLOSE))

Add the following calculations to the calculation file in the same manner.
B100_PMP1
B201_PMP1
T2_IN
T2_OUT
FLOW_OUT

Step 3.

Now we must assign the constraints for our redundant transmitters FI024A and FI024B.
First bring up the Tags application and click on the detail pushbutton found on the
spreadsheet for the AI tag FI024A. We want this flow indicator to follow the output of
the level of tank T2. In order to do this we will need to track that output. The tracking
must occur only when either of the pumps before this transmitter is running, the tank is
not empty and exit valve FV025 is not closed.

In order to simulate this we must select the If Calc radiobutton in the Calculate Group
box. Clicking on this radiobutton will list all of the available calculations for this dataset.
For this tag select the T2_PMP1 calculation. Next select the conditional operator that we
will need which is the > symbol. The condition value should be 0. (The = symbol
could also be used with a condition value of 1.)

Now we are ready to define the dynamics for this transmitter. Click on the Other
radiobutton of the Tag Dynamics and press the Details button. In the Analog Input
Dynamics dialog, we will define the tracking conditions for this tag and control the
behavior of this tag through modeling functions.

Original September 1995 161


UM25.0:SPE311
SIMVOX -- Version 2.3

We will need to add the Filter1 as well as the Integrate function. Add the appropriate
parameters to the Filter1 function dialog to smooth out the rise for this tag. The tracking
for this tag is based upon the level in the tank. For this we need to click on the Track
Calc radiobutton and double click on the FLOW_OUT calculation from the calculation
list provided. Press OK to finish the dynamics of this tag. Press OK on the detail dialog
of this tag to save the changes to the SIMVOX database.

Repeat above for AI tag FI024B.

Step 4.

Select the Loop window of the Tieback application. Depress the detail pushbutton found
on the spreadsheet for loop LIC021. Press the Model and Level radiobuttons for this
loop. Click on the Details pushbutton to open the Loop Level Dynamics dialog.

Choose modeling functions to be applied. Here we elect to Integrate the level. To do this,
double click on Integrate in the list on the left hand side. This will add Integrate to the
applied functions list.

Now you are done adding your modeling functions.

Select the type of vessel we are modeling. Assuming that T2 is a Vertical tank, use the
dropdown list to select vessel type as Vertical. This will grey the Angle and Radius fields.
You must, however, specify the Capacity. Our tank here can hold 2,000.00 gallons, so we
enter 2000.0 in the capacity field.

Step 5.

Because we selected Integrate in Step 1, the Integration Parameters section is enabled.


Here we specify an initial value of 0.0 and a gain of 1.0. Note that to integrate a value,
the gain should never be 0.0.

Step 6.

Now we are ready to specify what makes our level rise and what makes it fall. The input
and output are assigned as follows:

Input 1 -- Calculation -- T2_IN

Output 1 -- Calculation -- T2_OUT

Original September 1995 162


UM25.0:SPE311
SIMVOX -- Version 2.3

When we first enter the Level Dynamics dialog box, the PV In radiobutton will be
selected, so we can add the input signals right away.

To add the input calculation, click on the Track Calc radiobutton. This will display all the
available calculations in the current dataset. Select T2_IN by double clicking on it. It will
get added to the applied list.

Now press the Done pushbutton. SIMVOX will read the signal list and save the values,
while enabling the PV Out radiobutton. Click on the PV Out radiobutton. This will
disable the PV In radiobutton and show all the Output signals.

To add the output calculation, select T2_OUT by double clicking on it. It will get added
to the applied list.

Now press the Done pushbutton. SIMVOX will read the signal list and save it. Press the
OK pushbutton to return to the main Loop dialog box. Verify that your Calculate If
condition is correct. It should be the Always radiobutton. Press the OK push button. This
saves the level loop definition in the SIMVOX database.

The Level modeling as defined in Section 8.1 is now complete.

Original September 1995 163


UM25.0:SPE311
SIMVOX -- Version 2.3

8.2 Temperature Model Definition

TEMPERATURE MODEL FOR T2


15 gpm FV-- 022
B-- 100 LY-- 021
STRAINER
50000 gal 15 gpm
P-- 100A
FC

T2 TT TIC
023 023

2000 gal
LIC FO

021
P-- 100B
TY-- 023
15 gpm

LIT FV-- 025


B-- 201 15 gpm
021
P-- 02A
20000 gal 15 gpm
P-- 201A FT FT FY-- 024
024A 024B

FI FI
0024A 024B
P-- 02B
P-- 201B 15 gpm FIC
15 gpm
024

SUMMARY:

For simulation purposes, the modeled process liquid is water.

All Supply DCDs (e.g. Pumps P--100A & P--100B) have flow set to 15 gpm.

All Pathing DCDs (e.g. FV--022) have flow set to the path capacity.

FI024A and FI024B are a redundant transmitters.

LIC021 is selected to be a vertical tank with 2000 gallon capacity.

CALCULATIONS:

T2_IN
(CALC(B100_PMP1) OR CALC(B201_PMP1) * FLOW(FV022,) * (IVP(LIC021) /
100)

T2_OUT
CALC(T2_PMP1) * DCD_EQ(FV025,FEED) * (IVP(FIC024) / 100) * 15gpm

Original September 1995 164


UM25.0:SPE311
SIMVOX -- Version 2.3

T2_IBTU
(CALC(T2_IN) * 8.34 #/gal) * (150C * 1.8 + 32)

T2_HBTU
(25000 btu/hr / 60) * (IVP(TIC023) / 100)

T2_LOSS
600 btu/min * PV(LIC021)

T2_OBTU
(CALC(T2_OUT) * 8.34 #/gal) * (PV(TIC023) * 1.8 + 32)

T2_TMP
(((CALC(T2_IBTU) + CALC(T2_HBTU) -- CALC(T2_OBTU) -- CALC(T2_LOSS)) /
((2000gal * 8.34 #/gal) * (PV(LIC021) / 100)) --32) / 1.8

ASSIGNMENT:

TIC023
a. Calc If: ALWAYS
b. Function: FILTER1
c. PV(in): Track Calc: T2_TMP
d. PV(out): Track: none

8.2.1 Temperature Model Steps


We will need the use of 7 calculations for this modeling. Two of the calculations (and
their dependent calculations) have been defined in section 8.1. It is presumed that these
calculations have already been added. The list of new calculations is as follows:

1) T2_IBTU -- This calculation will take the flow value given by calculation T2_IN and
convert this to an input BTU value.

T2_IBTU = (CALC(T2_IN) * 8.34 #/gal) * (150C * 1.8 + 32)

2) T2_HBTU -- This calculation will take the current output (IVP) for the temperature
control loop TIC023 and returns the current heat value.

T2_HBTU = (25000 btu/hr / 60) * (IVP(TIC023) / 100)

Original September 1995 165


UM25.0:SPE311
SIMVOX -- Version 2.3

3) T2_LOSS -- This calculation will determine the loss of heat by multiplying a constant
loss value by the level in the tank. The equation for this is:

T2_LOSS = 600 btu/min * PV(LIC021)

4) T2_OBTU -- This calculation will take the flow value given by the calculation
T2_OUT and convert this to an output BTU value multiplied by the PV value of the
temperature control loop TIC023.

T2_OBTU = (CALC(T2_OUT) * 8.34 #/gal) * (PV(TIC023) * 1.8 + 32)

5) T2_TMP -- This calculation will use the results of the above equations and return the
final temperature for the model. The equation for this is:

T2_TMP = (((CALC(T2_IBTU) + CALC(T2_HBTU) -- CALC(T2_OBTU) --


CALC(T2_LOSS)) / ((2000gal * 8.34 #/gal) * (PV(LIC021) / 100)) --32) / 1.8

Step 1.

Select the Discrete Control Device window of the Tieback program. Depress the detail
button of the P--100A Discrete Control Device on the spreadsheet. In the Discrete
Control Device Dynamics Group box select the START setpoint and enter in 15.0 in the
Value field. Press OK and repeat for P--100B, P--201A, and P--201B. Similarly set the
flow value for each of the path Discrete Control Devices, such as FV--022 and FV--025.

Step 2.

Bring up the Calculation program using the calculations created in section 8.1. Click on
the Edit Add menu option and add calculation T2_IBTU.
Press the Edit pushbutton and enter in the expression for this calculation.

For this calculation, we wish to determine the input BTUs. This equation uses the results
of equations already defined. The equation for T2_IBTU is:
(CALC(T2_IN) * 8.34 #/gal) * (150C * 1.8 + 32)

where the T2_IN calculation is defined in section 8.1.

Add the following calculations to the calculation file in the same manner.
T2_HBTU
T2_LOSS

Original September 1995 166


UM25.0:SPE311
SIMVOX -- Version 2.3

T2_OBTU
T2_TMP

Step 3.

Check the detail dialogs for the tags FI024A and FI024B. The Tag Dynamics group box
should have the Other radiobutton selected. The Calculate Group box should indicate
that the modeling functions are calculated if the calculation T2_PMP1 is > 0.

The Details button will call up the Dynamics dialog which should show a modeling
function of Integrate and Filter1 with parameters 10.0 and 1 for the filter. These should
also be tracking the previously defined calculation FLOW_OUT. (If any of the items are
not set, see section 8.1.1 step 3 for more information)

Step 4.

Select the Loop window of the Tieback application. Check the detail of the LIC021 loop
tag by pressing the pushbutton on the spreadsheet. The vessel type (accessed from the
Details pushbutton on the detail dialog) should be vertical with a capacity of 2000.0 gal.,
if not see section 8.11 for information.

Now depress the detail pushbutton found on the spreadsheet for loop TIC023. Press the
Model and Temperature radiobuttons for this loop. Click on the Details pushbutton to
open the Temperature Dynamics dialog.

Choose modeling functions to be applied. Here we elect to Track the temperature


calculation and we want to apply a 1st order filter to smooth out the temperature
rise/decline. To do this, double click on Track in the list on the left hand side. This will
add Track to the applied functions list. Now double click on Filter1 in the list on the left
hand side. This will display a dialog box for the 1st order filter. Complete this dialog box,
specifying filter time in seconds and a gain of 1.0. Press the OK pushbutton to add Filter1
to the applied functions list.

Note that the function will be added and appear as Filter1 (x.y, 1.0) in the list, where x.y
is the filter time in seconds, and 1.0 is the gain. You can edit this by double clicking on
the function.

Now you are done adding your modeling functions.

Now we are ready to specify what makes our temperature rise and what makes it fall. We
will use the calculations defined above for this information.

Original September 1995 167


UM25.0:SPE311
SIMVOX -- Version 2.3

Assuming these calculations are already loaded in the Calculations window, we can go
ahead and complete our loop definition. When we first enter the Temperature Dynamics
dialog box, the PV In radiobutton will be selected, so we can add the input signals right
away.

First click on the Track Calc radiobutton. This will display all the available calculations
in the current dataset. Select T2_TMP by double clicking on it. It will get added to the
applied list. T2_TMP as shown in section 8.2 will internally call the other calculations.

Now press the Done pushbutton. SIMVOX will read the signal list and save it. Press the
OK pushbutton to return to the main Loop dialog box. Verify that your Calculate If
condition is correct. It should be the Always radiobutton. Press the OK push button. This
saves the temperature loop definition in the SIMVOX database.

The Temperature modeling as defined in Section 8.2 is now complete.

Note that this example does not take into account the Enthalpy already in the tank.

Original September 1995 168


UM25.0:SPE311
Appendix A

SIMVOX Library Subroutines


PROVOX EIC and IDI
This page intentionally blank
SIMVOX -- Version 2.3 Appendix A

LIBRARY INDEX
sim20_attach_ds (ds, error, errdst)
sim20_attach_multi_ds(ds, error, errdst)

sim20_dcd (ds, template, output, input, dcdnum, error, errdst, trantime, tranpv)

sim20_delay (sec)

sim20_getaic (ds, ficach, value, error, errdst)


sim20_getaic_fcc (ds, file, card, chan, value, error, errdst)
sim20_getaic_ab (ds, table, word, value, error, errdst)
sim20_getaic_mod (ds, reg, value, error, errdst)

sim20_getaie (ds, ficach, value, euhigh, eulow, error, errdst)


sim20_getaie_fcc (ds, file, card, chan, value, euhigh, eulow, error, errdst)
sim20_getaie_ab (ds, table, word, value, error, errdst)
sim20_getaie_mod (ds, reg, value, error, errdst)

sim20_getaip (ds, ficach, value, error, errdst)


sim20_getaip_fcc (ds, file, card, chan, value, error, errdst)
sim20_getaip_ab (ds, table, word, value, error, errdst)
sim20_getaip_mod (ds, reg, value, error, errdst)

sim20_getaoc (ds, ficach, value, error, errdst)


sim20_getaoc_fcc (ds, file, card, chan, value, error, errdst)
sim20_getaoc_ab (ds, table, word, value, error, errdst)
sim20_getaoc_mod (ds, reg, value, error, errdst)

sim20_getaop (ds, ficach, value, error, errdst)


sim20_getaop_fcc (ds, file, card, chan, value, error, errdst)
sim20_getaoc_ab (ds, table, word, value, error, errdst)
sim20_getaoc_mod (ds, reg, value, error, errdst)

sim20_getcalcindex (ds, tag, index, error, errdst)

sim20_getcalcvalue (ds, index, value, error, errdst)

sim20_getdi (ds, ficach, value, error, errdst)


sim20_getdi_fcc (ds, file, card, chan, value, error, errdst)
sim20_getdi_ab (ds, table, word, value, error, errdst)
sim20_getdi_mod (ds, reg, value, error, errdst)

sim20_getdiw (ds, ficach, value, error, errdst)


sim20_getdiw_fcc (ds, file, card, chan, value, error, errdst)

sim20_getds ()

Original September 1995 1


UM25.0:SPE311
SIMVOX -- Version 2.3 Appendix A

sim20_get_all_ds (flag)

sim20_getdo (ds, ficach, value, error, errdst)


sim20_getdo_fcc (ds, file, card, chan, value, error, errdst)
sim20_getdo_ab (ds, table, word, value, error, errdst)
sim20_getdo_mod (ds, reg, value, error, errdst)

sim20_getdow (ds, ficach, value, error, errdst)


sim20_getdow_fcc (ds, file, card, chan, value, error, errdst)

sim20_getpci (ds, ficach, value, rate, error, errdst)


sim20_getpci_fcc (ds, file, card, chan, value, rate, error, errdst)

sim20_getsi (ds, ficach, value, error, errdst)


sim20_getsi_fcc (ds, file, card, chan, value, error, errdst)

sim20_getso (ds, ficach, value, error, errdst)


sim20_getso_fcc (ds, file, card, chan, value, error, errdst)

sim20_lagloop (ds, pv, vo, gain, time, exec, revact, errdst)


sim20_loop (ds, pv, vo, gain, revact, errdst)

sim20_note (note)

sim20_setaic (ds, ficach, value, error, errdst)


sim20_setaic_fcc (ds, file, card, chan, value, error, errdst)
sim20_setaic_ab (ds, table, word, value, error, errdst)
sim20_setaic_mod (ds, reg, value, error, errdst)

sim20_setaie (ds, ficach, value, euhigh, eulow, error, errdst)


sim20_setaie_fcc (ds, file, card, chan, value, euhigh, eulow, error, errdst)
sim20_setaie_ab (ds, table, word, value, error, errdst)
sim20_setaie_mod (ds, reg, value, error, errdst)

sim20_setaip (ds, ficach, value, error, errdst)


sim20_setaip_fcc (ds, file, card, chan, value, error, errdst)
sim20_setaip_ab (ds, table, word, value, error, errdst)
sim20_setaip_mod (ds, reg, value, error, errdst)

sim20_setcalcvalue (ds, index, value, error, errdst)

sim20_setdi (ds, ficach, value, error, errdst)


sim20_setdi_fcc (ds, file, card, chan , value, error, errdst)
sim20_setdi_ab (ds, table, word, value, error, errdst)
sim20_setdi_mod (ds, reg, value, error, errdst)

sim20_setdiw (ds, ficach, value, error, errdst)


sim20_setdiw_fcc (ds, file, card, chan, value, error, errdst)

Original September 1995 2


UM25.0:SPE311
SIMVOX -- Version 2.3 Appendix A

sim20_setpci (ds, ficach, value, rate_p, error, errdst, index)


sim20_setpci_fcc (ds, file, card, chan, value, rate_p, error, errdst, index)

sim20_setsi (ds, ficach, value, error, errdst)


sim20_setsi_fcc (ds, file, card, chan, value, error, errdst)

sim20_sleep ()

sim20_wakeup (number, units, error)

Original September 1995 3


UM25.0:SPE311
SIMVOX -- Version 2.3 Appendix A

This page intentionally blank

Original September 1995 4


UM25.0:SPE311
SIMVOX -- Version 2.3 Appendix A

SIM20_ATTACH_DS
Attach to a dataset. All programs must use this function to attach to a dataset. SIMVOX
calls do not work correctly without it. Attaching is done prior to all other SIMVOX calls
except sim20_getds and sim20_get_all_ds.

Format
FORTRAN calling sequence and parameter description:
CALL SIM20_ATTACH_DS (DS, ERROR, ERRDST)

where:
DS INTEGER*4 Dataset number (1--4)
ERROR INTEGER*4 Error return value
ERRDST INTEGER*4 Destination of error messages

C calling sequence and parameter description:


sim20_attach_ds (&ds, &error, &errdst);

where:
ds long Dataset number (1--4)
error long Error return value
errdst long Destination of error messages

Original September 1995 1


UM25.0:SPE311
SIMVOX -- Version 2.3 Appendix A

Examples
FORTRAN:
integer*4 ds /1/
integer*4 error
integer*4 errdst /1/

...
call sim20_attach_ds (ds, error, errdst)
...

Original September 1995 2


UM25.0:SPE311
SIMVOX -- Version 2.3 Appendix A

C:
long ds = 1;
long error;
long errdst = 1;

...
sim20_attach_ds (&ds, &error, &errdst);
...

Original September 1995 3


UM25.0:SPE311
SIMVOX -- Version 2.3 Appendix A

SIM20_ATTACH_MULTI_DS
Attach to multiple datasets. Gets all the datasets on the command line and attaches to
those datasets. Stores the attached datasets in the dataset array provided as the first
parameter.

Format
FORTRAN calling sequence and parameter description:
CALL SIM20_ATTACH_MULTI_DS (DS, ERROR, ERRDST)

where:
DS(4) INTEGER*4 Dataset array
ERROR INTEGER*4 Error return value
ERRDST INTEGER*4 Destination of error messages

C calling sequence and parameter description:


sim20_attach_multi_ds (ds, &error, &errdst);

where:
ds[4] long Dataset array
error long Error return value
errdst long Destination of error messages

Original September 1995 4


UM25.0:SPE311
SIMVOX -- Version 2.3 Appendix A

Examples
FORTRAN:
integer*4 ds(4)
integer*4 error
integer*4 errdst /1/
...
call sim20_attach_multi_ds (ds, error, errdst)
...

Original September 1995 5


UM25.0:SPE311
SIMVOX -- Version 2.3 Appendix A

C:
long ds [4];
long error;
long errdst = 1;

...
sim20_attach_multi_ds (ds, &error, &errdst);
...

Original September 1995 6


UM25.0:SPE311
SIMVOX -- Version 2.3 Appendix A

SIM20_DCD
Tieback DCD output patterns to input patterns. This function is called once for each
DCD to be resolved by the tieback program. SIMVOX Tools option allows automatic
creation of tieback programs.

Format
FORTRAN calling sequence and parameter description:
CALL SIM20_DCD (DS, TEMPLATE, OUTPUT, INPUT, DCDNUM, ERROR, ERRDST, TRANTIME,
TRANPV)

where:
DS INTEGER*4 Dataset number (1--4)
TEMPLATE(35) INTEGER*4 Thirty--five element array containing the
DCD template
OUTPUT (8) INTEGER*4 Eight element array containing the
File--Card--Channel addresses of the
outputs
INPUT (16) INTEGER*4 Sixteen element array containing the
File--Card--Channel addresses of the inputs
DCDNUM INTEGER*4 Sequence number of the DCD (1--255)
ERROR INTEGER*4 Error return code
ERRDST INTEGER*4 Destination of error messages
TRANTIME INTEGER*4 Number of seconds to wait before setting
up the new PV on the inputs after a new
SP appears on the outputs
TRANPV INTEGER*4 PV to set up on the inputs during the
transition time (--32768 to +32767)

Original September 1995 7


UM25.0:SPE311
SIMVOX -- Version 2.3 Appendix A

C calling sequence and parameter description:


sim20_dcd (&ds, template, output, input, dcdnum, &error, &errdst, trantime, tranpv)

where:
ds long Dataset number (1--4)
template long[35] Thirty--five element array containing the
DCD template
output long[8] Eight element array containing the
File--Card--Channel addresses of the
outputs
input long[16] Sixteen element array containing the
File--Card--Channel addresses of the inputs
dcdnum long Sequence number of the DCD (1--255)
error long Error return code
errdst long Destination of error messages
trantime long Number of seconds to wait before setting
up the new PV on the inputs after a new
SP appears on the outputs
tranpv long PV to set up on the inputs during the
transition time (--32768 to +32767)

The template used is defined as follows:

TEMPLATE (1) Number of setpoints (1--16)


(2) Number of outputs (1--8)
(3) Number of inputs (1--16)
(4--19) Discrete output patterns for each of the
16 possible setpoints (0--255)
(20--35) Discrete input patterns for each of the
16 possible setpoints (--32768 to +32767)

Original September 1995 8


UM25.0:SPE311
SIMVOX -- Version 2.3 Appendix A

Examples
FORTRAN:
integer*4 ds /1/
integer*4 error
integer*4 errdst /1/
integer*4 dcdnum
integer*4 trantime
integer*4 tranpv

integer*4 dcd_output (8 )
integer*4 dcd_input (16)
integer*4 template (35)

data dcd_output /20713,0,0,0,0,0,0,0/


data dcd_input /20413,20513,0,0,0,0,0,0,8*0/

data template /2,1,2,


1,0,14*0,
1,2,14*0/

...

trantime = 0
tranpv = 0
while (.TRUE.)
call sim20_dcd (ds, template, dcd_output, dcd_input, 1, error, errdst, trantime, tranpv)

...

endwhile

Original September 1995 9


UM25.0:SPE311
SIMVOX -- Version 2.3 Appendix A

C:
long ds = 1;
long error;
long errdst = 1;
long dcdnum;
long trantime;
long tranpv;

long dcd_output [8] = {20713, 0, 0, 0, 0, 0, 0, 0 };


long dcd_input [16] = {20413, 20513, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0};

long template [35] = {2, 1, 2,


1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};

...

trantime = 0;
tranpv = 0;
while (TRUE)
{
sim20_dcd(&ds, template, dcd_output, dcd_input, 1, &error, &errdst, trantime, tranpv);

...

Original September 1995 10


UM25.0:SPE311
SIMVOX -- Version 2.3 Appendix A

SIM20_DELAY
Put calling process to sleep for the specified amount of time. The time is specified in
seconds.

Format
FORTRAN calling sequence and parameter description:
CALL SIM20_DELAY (SEC)

where:
SEC REAL Number of seconds to delay

C calling sequence and parameter description:


sim20_delay (&sec)

where:
sec double Real Number of seconds to delay

Original September 1995 11


UM25.0:SPE311
SIMVOX -- Version 2.3 Appendix A

Examples
FORTRAN:

real*8 delay /5.0/

...

while (.TRUE.)
...

...

call sim20_delay (delay)


endwhile

Original September 1995 12


UM25.0:SPE311
SIMVOX -- Version 2.3 Appendix A

C:

double delay = 5.0;

...

while (TRUE)
{
...

sim20_delay (&delay);
}

Original September 1995 13


UM25.0:SPE311
SIMVOX -- Version 2.3 Appendix A

SIM20_GETAIC
SIM20_GETAIC_FCC
Get an analog input in counts. SIM20_GETAIC_FCC uses less CPU as compared to
SIM20_GETAIC.

Format
FORTRAN calling sequence and parameter description:
TEMPINT = SIM20_GETAIC (DS, FICACH, VALUE, ERROR, ERRDST)
TEMPINT = SIM20_GETAIC_FCC (DS, FILE, CARD, CHAN, VALUE, ERROR, ERRDST)

where:
DS INTEGER*4 dataset number (1--4)
FICACH INTEGER*4 File--Card--Channel address of analog input
(10101--161416)
FILE INTEGER*4 File address of analog input (1 -- 16)
CARD INTEGER*4 Card address of analog input (1 -- 14)
CHAN INTEGER*4 Channel address of analog input (1 -- 16)
VALUE INTEGER*4 Number of counts (0--4095)
ERROR INTEGER*4 Error return code
ERRDST INTEGER*4 Destination of error messages
TEMPINT INTEGER*4 Integer to store return of function

C calling sequence and parameter description:


long sim20_getaic (&ds, ficach, &value, &error, &errdst)
long sim20_getaic_fcc (&ds, file, card, chan, &value, &error, &errdst)

where:
ds long dataset number (1--4)
ficach long File--Card--Channel address of analog input
(10101--161416)
file long File address of analog input (1 -- 16)
card long Card address of analog input (1 -- 14)
chan long Channel address of analog input (1 -- 16)
value long Number of counts (0--4095)
error long Error return code
errdst long Destination of error messages

Original September 1995 14


UM25.0:SPE311
SIMVOX -- Version 2.3 Appendix A

Examples
FORTRAN:
integer*4 ds /1/
integer*4 error
integer*4 errdst /1/
integer*4 ficach
integer*4 file
integer*4 card
integer*4 chan
integer*4 value
integer*4 tempint

...
ficach = 80501
tempint = sim20_getaic (ds, ficach, value, error, errdst)
...
tempint = sim20_getaic (ds, 80506, value, error, errdst)
...

...
file = 8
card = 5
chan = 1
tempint = sim20_getaic_fcc (ds, file, card, chan, value, error, errdst)
...
tempint = sim20_getaic_fcc (ds, 1, 1, 1, value, error, errdst)
...

Original September 1995 15


UM25.0:SPE311
SIMVOX -- Version 2.3 Appendix A

C:
long ds = 1;
long error;
long errdst = 1;
long ficach;
long file;
long card;
long chan;
long value;

...
ficach = 80501;
sim20_getaic (&ds, ficach, &value, &error, &errdst);
...
sim20_getaic (&ds, 80506, &value, &error, &errdst);
...

...
file = 8;
card = 5;
chan = 1;
sim20_getaic_fcc (&ds, file, card, chan, &value, &error, &errdst);
...
sim20_getaic_fcc (&ds, 1, 1, 1, &value, &error, &errdst);
...

Original September 1995 16


UM25.0:SPE311
SIMVOX -- Version 2.3 Appendix A

SIM20_GETAIE
SIM20_GETAIE_FCC
Get the engineering unit value of the AI point specified by the file--card--channel.

Format
FORTRAN calling sequence and parameter description:
TEMPREAL = SIM20_GETAIE (DS, FICACH, VALUE, EUHIGH, EUHIGH, EULOW, ERRDST)
TEMPREAL = SIM20_GETAIE_FCC (DS, FILE, CARD, CHAN, VALUE, EUHIGH, EULOW, ERROR,
ERRDST)

where:
DS INTEGER*4 dataset number (1--4)
FICACH INTEGER*4 File--Card--Channel address of analog input
(10101--161416)
FILE INTEGER*4 File address of analog input (1 -- 16)
CARD INTEGER*4 Card address of analog input (1 -- 14)
CHAN INTEGER*4 Channel address of analog input (1 -- 16)
VALUE REAL*8 Value read in engineering units of the AI
point
EUHIGH REAL*8 High engineering units of the point
EULOW REAL*8 Low engineering units of the point
ERROR INTEGER*4 Error return code
ERRDST INTEGER*4 Destination of error messages
TEMPREAL REAL*8 Real to store return of function

C calling sequence and parameter description:


double sim20_getaie (&ds, ficach, &value, euhigh, eulow, &error, &errdst)
double sim20_getaie_fcc (&ds, file, card, chan, &value, euhigh, eulow, &error, &errdst)

where:
ds long dataset number (1--4)
ficach long File--Card--Channel address of analog
input (channels 1 to 8 of card only)
file long File address of pulse count input (1 -- 16)
card long Card address of pulse count input (1 -- 14)
chan long Channel address of pulse count input (1 -- 8)
value double Value read in engineering units of the AI point
euhigh double High engineering units of the point
eulow double Low engineering units of the point
error long Error return code
errdst long Destination of error messages

Original September 1995 17


UM25.0:SPE311
SIMVOX -- Version 2.3 Appendix A

Examples
FORTRAN:
integer*4 ds /1/
integer*4 error
integer*4 errdst /1/
integer*4 ficach
integer*4 file
integer*4 card
integer*4 chan
real*8 value
real*8 euhigh
real*8 eulow
real*8 tempreal
...
ficach = 51309
value = 0
euhigh = 0
eulow = 0
tempreal = sim20_getaie (ds, ficach, value, euhigh, eulow, error, errdst)
...
tempreal = sim20_getaie (ds, 51208, value, euhigh, eulow, error, errdst)
...
...
file = 5
card = 13
chan = 9
value = 0
tempreal = sim20_getaie_fcc (ds, file, card, chan, value, euhigh, eulow, error, errdst)
...
tempreal = sim20_getaie_fcc (ds, 4, 7, 6, value, euhigh, eulow, error, errdst)
...

Original September 1995 18


UM25.0:SPE311
SIMVOX -- Version 2.3 Appendix A

C:
long ds = 1;
long error;
long errdst = 1;
long ficach;
long file;
long card;
long chan;
double value;
double euhigh;
double eulow;

...
ficach = 121202;
value = 55.0;
euhigh = 100.0;
eulow = 0.0;
sim20_getaie (&ds, ficach, &value, &error, &euhigh, &eulow, &errdst);
...
sim20_getaie (&ds, 121102, &value, &error, &euhigh, &eulow, &errdst);
...

...
file = 12;
card = 12;
chan = 2;
value = 20.25;
sim20_getaie_fcc (&ds, file, card, chan, &value, &euhigh, &eulow, &error, &errdst);
...
sim20_getaie_fcc (&ds, 11, 8, 1, &value, &euhigh, &eulow, &error, &errdst);
...

Original September 1995 19


UM25.0:SPE311
SIMVOX -- Version 2.3 Appendix A

SIM20_GETAIP
SIM20_GETAIP_FCC
Get an analog input in percent. SIM20_GETAIP_FCC uses less CPU as compared to
SIM20_GETAIP.

Format
FORTRAN calling sequence and parameter description:
TEMPREAL = SIM20_GETAIP (DS, FICACH, VALUE, ERROR, ERRDST)
TEMPREAL = SIM20_GETAIP_FCC (DS, FILE, CARD, CHAN, VALUE, ERROR, ERRDST)

where:
DS INTEGER*4 dataset number (1--4)
FICACH INTEGER*4 File--Card--Channel address of analog input
(10101--161416)
FILE INTEGER*4 File address of analog input (1 -- 16)
CARD INTEGER*4 Card address of analog input (1 -- 14)
CHAN INTEGER*4 Channel address of analog input (1 -- 16)
VALUE REAL*8 Percent (--25.0 to +100.0) or (0.0 to
+125.0) depending on card type
ERROR INTEGER*4 Error return code
ERRDST INTEGER*4 Destination of error messages
TEMPREAL REAL*8 Real to store return of function

C calling sequence and parameter description:


double sim20_getaip (&ds, ficach, &value, &error, &errdst)
double sim20_getaip_fcc (&ds, file, card, chan, &value, &error, &errdst)

where:
ds long dataset number (1--4)
ficach long File--Card--Channel address of analog input
(10101--161416)
file long File address of analog input (1 -- 16)
card long Card address of analog input (1 -- 14)
chan long Channel address of analog input (1 -- 16)
value double Percent (--25.0 to +100.0) or (0.0 to
+125.0) depending on card type
error long Error return code
errdst long Destination of error messages

Original September 1995 20


UM25.0:SPE311
SIMVOX -- Version 2.3 Appendix A

Examples
FORTRAN:
integer*4 ds /1/
integer*4 error
integer*4 errdst /1/
integer*4 ficach
integer*4 file
integer*4 card
integer*4 chan
real*8 value
real*8 tempreal

...
ficach = 100904
tempreal = sim20_getaip (ds, ficach, value, error, errdst)
...
tempreal = sim20_getaip (ds, 100902, value, error, errdst)
...

...
file = 10
card = 9
chan = 4
tempreal = sim20_getaip_fcc (ds, file, card, chan, value, error, errdst)
...
tempreal = sim20_getaip_fcc (ds, 2, 5, 3, value, error, errdst)
...

Original September 1995 21


UM25.0:SPE311
SIMVOX -- Version 2.3 Appendix A

C:
long ds = 1;
long error;
long errdst = 1;
long ficach;
long file;
long card;
long chan;
double value;

...
ficach = 100904;
sim20_getaip (&ds, ficach, &value, &error, &errdst);
...
sim20_getaip (&ds, 100902, &value, &error, &errdst);
...

...
file = 10;
card = 9;
chan = 4;
sim20_getaip_fcc (&ds, file, card, chan, &value, &error, &errdst);
...
sim20_getaip_fcc (&ds, 2, 5, 3, &value, &error, &errdst);
...

Original September 1995 22


UM25.0:SPE311
SIMVOX -- Version 2.3 Appendix A

SIM20_GETAOC
SIM20_GETAOC_FCC
Get an analog output in counts. SIM20_GETAOC_FCC uses less CPU as compared to
SIM20_GETAOC.

Format
FORTRAN calling sequence and parameter description:
TEMPINT = SIM20_GETAOC (DS, FICACH, VALUE, ERROR, ERRDST)
TEMPINT = SIM20_GETAOC_FCC (DS, FILE, CARD, CHAN, VALUE, ERROR, ERRDST)

where:
DS INTEGER*4 dataset number (1--4)
FICACH INTEGER*4 File--Card--Channel address of analog
output (channels 1--8 of card only)
FILE INTEGER*4 File address of analog input (1 -- 16)
CARD INTEGER*4 Card address of analog input (1 -- 14)
CHAN INTEGER*4 Channel address of analog input (1 -- 8)
VALUE INTEGER*4 Number of counts (0--4095)
ERROR INTEGER*4 Error return code
ERRDST INTEGER*4 Destination of error messages
TEMPINT INTEGER*4 Integer to store return of function

C calling sequence and parameter description:


long sim20_getaoc (&ds, ficach, &value, &error, &errdst)
long sim20_getaoc_fcc (&ds, file, card, chan, &value, &error, &errdst)

where:
ds long dataset number (1--4)
ficach long File--Card--Channel address of analog
output (channels 1--8 of card only)
file long File address of analog input (1 -- 16)
card long Card address of analog input (1 -- 14)
chan long Channel address of analog input (1 -- 8)
value long Number of counts (0--4095)
error long Error return code
errdst long Destination of error messages

Original September 1995 23


UM25.0:SPE311
SIMVOX -- Version 2.3 Appendix A

Examples
FORTRAN:
integer*4 ds /1/
integer*4 error
integer*4 errdst /1/
integer*4 ficach
integer*4 file
integer*4 card
integer*4 chan
integer*4 value
integer*4 tempint

...
ficach = 20205
tempint = sim20_getaoc (ds, ficach, value, error, errdst)
...
tempint = sim20_getaoc (ds, 20209, value, error, errdst)
...

...
file = 2
card = 2
chan = 5
tempint = sim20_getaoc_fcc (ds, file, card, chan, value, error, errdst)
...
tempint = sim20_getaoc_fcc (ds, 7, 8, 4, value, error, errdst)
...

Original September 1995 24


UM25.0:SPE311
SIMVOX -- Version 2.3 Appendix A

C:
long ds = 1;
long error;
long errdst = 1;
long ficach;
long file;
long card;
long chan;
long value;

...
ficach = 20205;
sim20_getaoc (&ds, ficach, &value, &error, &errdst);
...
sim20_getaoc (&ds, 20209, &value, &error, &errdst);
...

...
file = 2;
card = 2;
chan = 5;
sim20_getaoc_fcc (&ds, file, card, chan, &value, &error, &errdst);
...
sim20_getaoc_fcc (&ds, 7, 8, 4, &value, &error, &errdst);
...

Original September 1995 25


UM25.0:SPE311
SIMVOX -- Version 2.3 Appendix A

SIM20_GETAOP
SIM20_GETAOP_FCC
Get an analog output in percent. SIM20_GETAOP_FCC uses less CPU as compared to
SIM20_GETAOP.

Format
FORTRAN calling sequence and parameter description:
TEMPREAL = SIM20_GETAOP (DS, FICACH, VALUE, ERROR, ERRDST)
TEMPREAL = SIM20_GETAOP_FCC (DS, FILE, CARD, CHAN, VALUE, ERROR, ERRDST)

where:
DS INTEGER*4 dataset number (1--4)
FICACH INTEGER*4 File--Card--Channel address of analog
output (channels 1--8 or card only)
FILE INTEGER*4 File address of analog output (1 -- 16)
CARD INTEGER*4 Card address of analog output (1 -- 14)
CHAN INTEGER*4 Channel address of analog output (1 -- 8)
VALUE REAL*8 Percent (--25.0 to +100.0)
ERROR INTEGER*4 Error return code
ERRDST INTEGER*4 Destination of error messages
TEMPREAL REAL*8 Real to store return of function

C calling sequence and parameter description:


double sim20_getaop (&ds, ficach, &value, &error, &errdst)
double sim20_getaop_fcc (&ds, file, card, chan, &value, &error, &errdst)

where:
ds long dataset number (1--4)
ficach long File--Card--Channel address of analog
output (channels 1--8 or card only)
file long File address of analog output (1 -- 16)
card long Card address of analog output (1 -- 14)
chan long Channel address of analog output (1 -- 8)
value double Percent (--25.0 to +100.0)
error long Error return code
errdst long Destination of error messages

Original September 1995 26


UM25.0:SPE311
SIMVOX -- Version 2.3 Appendix A

Examples
FORTRAN:
integer*4 ds /1/
integer*4 error
integer*4 errdst /1/
integer*4 ficach
integer*4 file
integer*4 card
integer*4 chan
real*8 value
real*8 tempreal

...
ficach = 31102
tempreal = sim20_getaop (ds, ficach, value, error, errdst)
...
tempreal = sim20_getaop (ds, 31106, value, error, errdst)
...

...
file = 3
card = 11
chan = 2
tempreal = sim20_getaop_fcc (ds, file, card, chan, value, error, errdst)
...
tempreal = sim20_getaop_fcc (ds, 7, 5, 4, value, error, errdst)
...

Original September 1995 27


UM25.0:SPE311
SIMVOX -- Version 2.3 Appendix A

C:
long ds = 1;
long error;
long errdst = 1;
long ficach;
long file;
long card;
long chan;
double value;

...
ficach = 31102;
sim20_getaop (&ds, ficach, &value, &error, &errdst);
...
sim20_getaop (&ds, 31106, &value, &error, &errdst);
...

...
file = 3;
card = 11;
chan = 2;
sim20_getaop_fcc (&ds, file, card, chan, &value, &error, &errdst);
...
sim20_getaop_fcc (&ds, 7, 5, 4, &value, &error, &errdst);
...

Original September 1995 28


UM25.0:SPE311
SIMVOX -- Version 2.3 Appendix A

SIM20_GETCALCINDEX
Get the index of a calculation given its tag and dataset.

Format
FORTRAN calling sequence and parameter description:
TEMPINT = SIM20_GETCALCINDEX (DS, TAG, INDEX, ERROR, ERRDST)

where:
DS INTEGER*4 dataset number (1--4)
TAG CHARACTER*16 Tag of the calculation
INDEX INTEGER*4 Index of the calculation within the DLL
ERROR INTEGER*4 Error return code
ERRDST INTEGER*4 Destination of error messages
TEMPINT INTEGER*4 Intger to store return of function

C calling sequence and parameter description:


long sim20_getcalcindex (&ds, tag, &index, &error, &errdst)

where:
ds long dataset number (1--4)
tag[16] char Tag of the calculation
index long Index of the calculation within the DLL
error long Error return code
errdst long Destination of error messages

Original September 1995 29


UM25.0:SPE311
SIMVOX -- Version 2.3 Appendix A

Examples
FORTRAN:
integer*4 ds
character*16 tag
integer*4 index
integer*4 error
integer*4 errdst
integer*4 tempint

ds = 1
tag = testcalc
index = 0

tempint = sim20_getcalcindex (ds, tag, index, error, errdst)

Original September 1995 30


UM25.0:SPE311
SIMVOX -- Version 2.3 Appendix A

C:
long ds;
char tag[16];
long index;
long error;
long errdst;
long temp;

ds = 1;
strcpy(tag, testcalc);
index = 0;

sim20_getcalcindex (&ds, tag, &index, &error, &errdst);


/* OR */
temp = sim20_getcalcindex (&ds, tag, &index, &error, &errdst);

Original September 1995 31


UM25.0:SPE311
SIMVOX -- Version 2.3 Appendix A

SIM20_GETCALCVALUE
Get the value of a calculation given its index and dataset.

Format
FORTRAN calling sequence and parameter description:
TEMPREAL = SIM20_GETCALCVALUE (DS, INDEX, VALUE, ERROR, ERRDST)

where:
DS INTEGER*4 dataset number (1--4)
INDEX INTEGER*4 Index of the calculation within the DLL
VALUE REAL*8 Value of the calculation
ERROR INTEGER*4 Error return code
ERRDST INTEGER*4 Destination of error messages
TEMPREAL REAL*8 Real to store return of function

C calling sequence and parameter description:


double sim20_getcalcvalue (&ds, index, &value, &error, &errdst)

where:
ds long dataset number (1--4)
index long Index of the calculation within the DLL
value double Value of the calculation
error long Error return code
errdst long Destination of error messages

Original September 1995 32


UM25.0:SPE311
SIMVOX -- Version 2.3 Appendix A

Examples
FORTRAN:
integer*4 ds
integer*4 index
real*8 value
integer*4 error
integer*4 errdst
integer*4 tempint
real*8 tempreal

ds = 1
value = 0
tag = testcalc
tempint = sim20_getcalcindex (ds, tag, index, error, errdst)
tempreal = sim20_getcalcvalue (ds, index, value, error, errdst)

Original September 1995 33


UM25.0:SPE311
SIMVOX -- Version 2.3 Appendix A

C:
long ds;
long index;
double value;
long error;
long errdst;
double temp;

ds = 1;

strcpy(tag, testcalc);
sim20_getcalcindex (&ds, tag, &index, &error, &errdst);
sim20_getcalcvalue (&ds, index, &value, &error, &errdst);

Original September 1995 34


UM25.0:SPE311
SIMVOX -- Version 2.3 Appendix A

SIM20_GETDI
SIM20_GETDI_FCC
Get a discrete input channel. SIM20_GETDI_FCC uses less CPU as compared to
SIM20_GETDI.

Format
FORTRAN calling sequence and parameter description:
TEMPINT = SIM20_GETDI (DS, FICACH, VALUE, ERROR, ERRDST)
TEMPINT = SIM20_GETDI_FCC (DS, FILE, CARD, CHAN, VALUE, ERROR, ERRDST)

where:
DS INTEGER*4 dataset number (1--4)
FICACH INTEGER*4 File--Card--Channel address of discrete
input (10101--161416)
FILE INTEGER*4 File address of discrete input (1 -- 16)
CARD INTEGER*4 Card address of discrete input (1 -- 14)
CHAN INTEGER*4 Channel address of discrete input
(1 -- 16)
VALUE INTEGER*4 (0 -- 1)
ERROR INTEGER*4 Error return code
ERRDST INTEGER*4 Destination of error messages
TEMPINT INTEGER*4 Integer to store return of function

C calling sequence and parameter description:


long sim20_getdi (&ds, ficach, &value, &error, &errdst)
long sim20_getdi_fcc (&ds, file, card, chan, &value, &error, &errdst)

where:
ds long dataset number (1--4)
ficach long File--Card--Channel address of discrete
input (10101--161416)
file long File address of discrete input (1 -- 16)
card long Card address of discrete input (1 -- 14)
chan long Channel address of discrete input
(1 -- 16)
value long (0 -- 1)
error long Error return code
errdst long Destination of error messages

Original September 1995 35


UM25.0:SPE311
SIMVOX -- Version 2.3 Appendix A

Examples
FORTRAN:
integer*4 ds /1/
integer*4 error
integer*4 errdst /1/
integer*4 ficach
integer*4 file
integer*4 card
integer*4 chan
integer*4 value
integer*4 tempint

...
ficach = 151016
tempint = sim20_getdi (ds, ficach, value, error, errdst)
...
tempint = sim20_getdi (ds, 151012, value, error, errdst)
...

...
file = 15
card = 10
chan = 16
tempint = sim20_getdi_fcc (ds, file, card, chan, value, error, errdst)
...
tempint = sim20_getdi_fcc (ds, 12, 11, 13, value, error, errdst)
...

Original September 1995 36


UM25.0:SPE311
SIMVOX -- Version 2.3 Appendix A

C:
long ds = 1;
long error;
long errdst = 1;
long ficach;
long file;
long card;
long chan;
long value;

...
ficach = 151016;
sim20_getdi (&ds, ficach, &value, &error, &errdst);
...
sim20_getdi (&ds, 151012, &value, &error, &errdst);
...

...
file = 15;
card = 10;
chan = 16;
sim20_getdi_fcc (&ds, file, card, chan, &value, &error, &errdst);
...
sim20_getdi_fcc (&ds, 12, 11, 13, &value, &error, &errdst);
...

Original September 1995 37


UM25.0:SPE311
SIMVOX -- Version 2.3 Appendix A

SIM20_GETDIW
SIM20_GETDIW_FCC
Get a group of 16 discrete inputs on a single card. SIM20_GETDIW_FCC uses less CPU
as compared to SIM20_GETDIW.

Format
FORTRAN calling sequence and parameter description:
TEMPINT = SIM20_GETDIW (DS, FFCx, VALUE, ERROR, ERRDST)
TEMPINT = SIM20_GETDIW_FCC (DS, FILE, CARD, CHAN, VALUE, ERROR, ERRDST)

where:
DS INTEGER*4 dataset number (1--4)
FFCx INTEGER*4 File--Card--Channel address of ANY channel
on a discrete input card (10101--161416)
FILE INTEGER*4 File address of discrete input (1 -- 16)
CARD INTEGER*4 Card address of discrete input (1 -- 14)
CHAN INTEGER*4 Channel address of ANY discrete input
(1 -- 16)
VALUE INTEGER*4 (0 -- 65535) (channel 1 = bit 0 = lsb)
ERROR INTEGER*4 Error return code
ERRDST INTEGER*4 Destination of error messages
TEMPINT INTEGER*4 Integer to store return of function

C calling sequence and parameter description:


long sim20_getdiw (&ds, ffcx, &value, &error, &errdst)
long sim20_getdiw_fcc (&ds, file, card, chan, &value, &error, &errdst)

where:
ds long dataset number (1--4)
ffcx long File--Card--Channel address of ANY channel
on a discrete input card (10101--161416)
file long File address of discrete input (1 -- 16)
card long Card address of discrete input (1 -- 14)
chan long Channel address of ANY discrete input
(1 -- 16)
value long (0 -- 65535) (channel 1 = bit 0 = lsb)
error long Error return code
errdst long Destination of error messages

Original September 1995 38


UM25.0:SPE311
SIMVOX -- Version 2.3 Appendix A

Examples
FORTRAN:
integer*4 ds /1/
integer*4 error
integer*4 errdst /1/
integer*4 ficach
integer*4 file
integer*4 card
integer*4 chan
integer*4 value
integer*4 tempint

...
ficach = 31409
tempint = sim20_getdiw (ds, ficach, value, error, errdst)
...
tempint = sim20_getdiw (ds, 31403, value, error, errdst)
...

...
file = 3
card = 14
chan = 9
tempint = sim20_getdiw_fcc (ds, file, card, chan, value, error, errdst)
...
tempint = sim20_getdiw_fcc (ds, 5, 13, 7, value, error, errdst)
...

Original September 1995 39


UM25.0:SPE311
SIMVOX -- Version 2.3 Appendix A

C:
long ds = 1;
long error;
long errdst = 1;
long ficach;
long file;
long card;
long chan;
long value;

...
ficach = 31409;
sim20_getdiw (&ds, ficach, &value, &error, &errdst);
...
sim20_getdiw (&ds, 31403, &value, &error, &errdst);
...

...
file = 3;
card = 14;
chan = 9;
sim20_getdiw_fcc (&ds, file, card, chan, &value, &error, &errdst);
...
sim20_getdiw_fcc (&ds, 5, 13, 7, &value, &error, &errdst);
...

Original September 1995 40


UM25.0:SPE311
SIMVOX -- Version 2.3 Appendix A

SIM20_GETDO
SIM20_GETDO_FCC
Get a discrete output channel. SIM20_GETDO_FCC uses less CPU as compared to
SIM20_GETDO.

Format
FORTRAN calling sequence and parameter description:
TEMPINT = SIM20_GETDO (DS, FICACH, VALUE, ERROR, ERRDST)
TEMPINT = SIM20_GETDO_FCC (DS, FILE, CARD, CHAN, VALUE, ERROR, ERRDST)

where:
DS INTEGER*4 dataset number (1--4)
FICACH INTEGER*4 File--Card--Channel address of discrete
output (10101--161416)
FILE INTEGER*4 File address of discrete output (1 -- 16)
CARD INTEGER*4 Card address of discrete output (1 -- 14)
CHAN INTEGER*4 Channel address of discrete output
(1 -- 16)
VALUE INTEGER*4 (0 -- 1)
ERROR INTEGER*4 Error return code
ERRDST INTEGER*4 Destination of error messages
TEMPINT INTEGER*4 Integer to store return of function

C calling sequence and parameter description:


long sim20_getdo (&ds, ficach, &value, &error, &errdst)
long sim20_getdo_fcc (&ds, file, card, chan, &value, &error, &errdst)

where:
ds long dataset number (1--4)
ficach long File--Card--Channel address of discrete
output (10101--161416)
file long File address of discrete output (1 -- 16)
card long Card address of discrete output (1 -- 14)
chan long Channel address of discrete output
(1 -- 16)
value long (0 -- 1)
error long Error return code
errdst long Destination of error messages

Original September 1995 41


UM25.0:SPE311
SIMVOX -- Version 2.3 Appendix A

Examples
FORTRAN:
integer*4 ds /1/
integer*4 error
integer*4 errdst /1/
integer*4 ficach
integer*4 file
integer*4 card
integer*4 chan
integer*4 value
integer*4 tempint

...
ficach = 140102
tempint = sim20_getdo (ds, ficach, value, error, errdst)
...
tempint = sim20_getdo (ds, 140109, value, error, errdst)
...

...
file = 14
card = 1
chan = 2
tempint = sim20_getdo_fcc (ds, file, card, chan, value, error, errdst)
...
tempint = sim20_getdo_fcc (ds, 10, 3, 3, value, error, errdst)
...

Original September 1995 42


UM25.0:SPE311
SIMVOX -- Version 2.3 Appendix A

C:
long ds = 1;
long error;
long errdst = 1;
long ficach;
long file;
long card;
long chan;
long value;

...
ficach = 140102;
sim20_getdo (&ds, ficach, &value, &value, &error, &errdst);
...
sim20_getdo (&ds, 140109, &value, &value, &error, &errdst);
...

...
file = 14;
card = 1;
chan = 2;
sim20_getdo_fcc (&ds, file, card, chan, &value, &error, &errdst);
...
sim20_getdo_fcc (&ds, 10, 3, 3, &value, &error, &errdst);
...

Original September 1995 43


UM25.0:SPE311
SIMVOX -- Version 2.3 Appendix A

SIM20_GETDOW
SIM20_GETDOW_FCC
Get a group of 16 discrete outputs on a single card. SIM20_GETDOW_FCC uses less
CPU as compared to SIM20_GET_DOW.

Format
FORTRAN calling sequence and parameter description:
TEMPINT = SIM20_GETDOW (DS, FFCx, VALUE, ERROR, ERRDST)
TEMPINT = SIM20_GETDOW_FCC (DS, FILE, CARD, CHAN, VALUE, ERROR, ERRDST)

where:
DS INTEGER*4 dataset number (1--4)
FFCx INTEGER*4 File--Card--Channel address of ANY channel
on a discrete output card (10101--161416)
FILE INTEGER*4 File address of discrete output (1 -- 16)
CARD INTEGER*4 Card address of discrete output (1 -- 14)
CHAN INTEGER*4 Channel address of ANY discrete output
(1 -- 16)
VALUE INTEGER*4 (0 -- 65535) (channel 1 = bit 0 = lsb)
ERROR INTEGER*4 Error return code
ERRDST INTEGER*4 Destination of error messages
TEMPINT INTEGER*4 Integer to store return of function

C calling sequence and parameter description:


long sim20_getdow (&ds, ffcx, &value, &error, &errdst)
long sim20_getdow_fcc (&ds, file, card, chan, &value, &error, &errdst)

where:
ds long dataset number (1--4)
ffcx long File--Card--Channel address of ANY channel
on a discrete output card (10101--161416)
file long File address of discrete output (1 -- 16)
card long Card address of discrete output (1 -- 14)
chan long Channel address of ANY discrete output
(1 -- 16)
value long (0 -- 65535) (channel 1 = bit 0 = lsb)
error long Error return code
errdst long Destination of error messages

Original September 1995 44


UM25.0:SPE311
SIMVOX -- Version 2.3 Appendix A

Examples
FORTRAN:
integer*4 ds /1/
integer*4 error
integer*4 errdst /1/
integer*4 ficach
integer*4 file
integer*4 card
integer*4 chan
integer*4 value
integer*4 tempint

...
ficach = 40506
tempint = sim20_getdow (ds, ficach, value, error, errdst)
...
tempint = sim20_getdow (ds, 40508, value, error, errdst)
...

...
file = 4
card = 5
chan = 6
tempint = sim20_getdow_fcc (ds, file, card, chan, value, error, errdst)
...
tempint = sim20_getdow_fcc (ds, 3, 3, 4, value, error, errdst)
...

Original September 1995 45


UM25.0:SPE311
SIMVOX -- Version 2.3 Appendix A

C:
long ds = 1;
long error;
long errdst = 1;
long ficach;
long file;
long card;
long chan;
long value;

...
ficach = 40506;
sim20_getdow (&ds, ficach, &value, &error, &errdst);
...
sim20_getdow (&ds, 40508, &value, &error, &errdst);
...

...
file = 4;
card = 5;
chan = 6;
sim20_getdow_fcc (&ds, file, card, chan, &value, &error, &errdst);
...
sim20_getdow_fcc (&ds, 3, 3, 4, &value, &error, &errdst);
...

Original September 1995 46


UM25.0:SPE311
SIMVOX -- Version 2.3 Appendix A

SIM20_GETDS
Get the dataset entered on the command line.

Format
FORTRAN calling sequence and parameter description:
TEMPINT = SIM20_GETDS ()

where:
TEMPINT INTEGER*4 Integer to store return of function

C calling sequence and parameter description:


long sim20_getds ()

Original September 1995 47


UM25.0:SPE311
SIMVOX -- Version 2.3 Appendix A

Examples
FORTRAN:
integer*4 ds
integer*4 error
integer*4 errdst

...

ds = sim20_getds ()
call sim20_attach_ds (ds, error, errdst)

...

Original September 1995 48


UM25.0:SPE311
SIMVOX -- Version 2.3 Appendix A

C:

long ds;
long error
long errdst

...

ds = sim20_getds ();
sim20_attach_ds (&ds, &error, &errdst);

...

Original September 1995 49


UM25.0:SPE311
SIMVOX -- Version 2.3 Appendix A

SIM20_GET_ALL_DS
Reads the command line into an internal string if the flag argument is TRUE and returns
the first dataset. On subsequent calls, the flag argument should be FALSE. This will
return any additional datasets. If the dataset returned is zero, there are no more datasets.

Format
FORTRAN calling sequence and parameter description:
TEMPINT = SIM20_GET_ALL_DS (FLAG)

where:
FLAG INTEGER*4 Flag indicating input from command line
TEMPINT INTEGER*4 Integer to store return of function

C calling sequence and parameter description:


long sim20_get_all_ds (flag)

where:
flag long Flag indicating input from command line

Original September 1995 50


UM25.0:SPE311
SIMVOX -- Version 2.3 Appendix A

Examples
FORTRAN:
integer*4 ds1, ds2
...
ds1 = sim20_get_all_ds (.TRUE.)
ds2 = sim20_get_all_ds (.FALSE.)

Original September 1995 51


UM25.0:SPE311
SIMVOX -- Version 2.3 Appendix A

C:

long flag;
long ds1, ds2;
{
...
flag = TRUE;
/* get the command line */
/* ds1 contains the first dataset in the command line */
ds1 = sim20_get_all_ds (flag);
flag = FALSE;
/* ds2 contains the next dataset in the command line */
ds2 = sim20_get_all_ds (flag);
}

Original September 1995 52


UM25.0:SPE311
SIMVOX -- Version 2.3 Appendix A

SIM20_GETPCI
SIM20_GETPCI_FCC
Get a pulse count input. SIM20_GETPCI_FCC uses less CPU as compared to
SIM20_GETPCI.

Format
FORTRAN calling sequence and parameter description:
CALL SIM20_GETPCI (DS, FICACH, VALUE, RATE, ERROR, ERRDST)
CALL SIM20_GETPCI_FCC (DS, FILE, CARD, CHAN, VALUE, RATE, ERROR, ERRDST)

where:
DS INTEGER*4 dataset number (1--4)
FICACH INTEGER*4 File--Card--Channel address of pulse count
input (channels 1 to 8 of card only)
FILE INTEGER*4 File address of pulse count input
(1 -- 16)
CARD INTEGER*4 Card address of pulse count input
(1 -- 14)
CHAN INTEGER*4 Channel address of pulse count input
(1 -- 8)
VALUE INTEGER*4 Number of raw pulses (0 -- 65,535)
RATE REAL*8 Pulses per rate period. Rate period is
declared in the UOC definition from 0.1
to 5.0
ERROR INTEGER*4 Error return code
ERRDST INTEGER*4 Destination of error messages

C calling sequence and parameter description:


sim20_getpci (&ds, ficach, &value, &rate, &error, &errdst)
sim20_getpci_fcc (&ds, file, card, chan, &value, &rate, &error, &errdst)

where:
ds long dataset number (1--4)
ficach long File--Card--Channel address of pulse count
input (channels 1 to 8 of card only)
file long File address of pulse count input
(1 -- 16)
card long Card address of pulse count input
(1 -- 14)
chan long Channel address of pulse count input
(1 -- 8)
value long Number of raw pulses (0 -- 65,535)
rate double Pulses per rate period. Rate period is
declared in the UOC definition from 0.1
to 5.0
error long Error return code
errdst long Destination of error messages

Original September 1995 53


UM25.0:SPE311
SIMVOX -- Version 2.3 Appendix A

Examples
FORTRAN:
integer*4 ds /1/
integer*4 error
integer*4 errdst /1/
integer*4 ficach
integer*4 file
integer*4 card
integer*4 chan
integer*4 value
real*8 rate

...
ficach = 60901
call sim20_getpci (ds, ficach, value, rate, error, errdst)
...
call sim20_getpci (ds, 60908, value, rate, error, errdst)
...

...
file = 6
card = 9
chan = 1
call sim20_getpci_fcc (ds, file, card, chan, value, rate, error, errdst)
...
call sim20_getpci_fcc (ds, 1, 1, 1, value, rate, error, errdst)
...

Original September 1995 54


UM25.0:SPE311
SIMVOX -- Version 2.3 Appendix A

C:
long ds = 1;
long error;
long errdst = 1;
long ficach;
long file;
long card;
long chan;
long value;
double rate;

...
ficach = 60901;
sim20_getpci (&ds, ficach, &value, &rate, &error, &errdst);
...
sim20_getpci (&ds, 60908, &value, &rate, &error, &errdst);
...

...
file = 6;
card = 9;
chan = 1;
sim20_getpci_fcc (&ds, file, card, chan, &value, &rate, &error, &errdst);
...
sim20_getpci_fcc (&ds, 1, 1, 1, &value, &rate, &error, &errdst);
...

Original September 1995 55


UM25.0:SPE311
SIMVOX -- Version 2.3 Appendix A

SIM20_GETSI
SIM20_GETSI_FCC
Get an smart input as a floating point number. SIM20_GETSI_FCC uses less CPU as
compared to SIM20_GETSI.

Format
FORTRAN calling sequence and parameter description:
TEMPREAL = SIM20_GETSI (DS, FICACH, VALUE, ERROR, ERRDST)
TEMPREAL = SIM20_GETSI_FCC (DS, FILE, CARD, CHAN, VALUE, ERROR, ERRDST)

where:
DS INTEGER*4 dataset number (1--4)
FICACH INTEGER*4 File--Card--Channel address of smart input
(10101--161416)
FILE INTEGER*4 File address of analog input (1 -- 16)
CARD INTEGER*4 Card address of analog input (1 -- 14)
CHAN INTEGER*4 Channel address of analog input (1 -- 16)
VALUE REAL*8 Floating point number
ERROR INTEGER*4 Error return code
ERRDST INTEGER*4 Destination of error messages
TEMPREAL REAL*8 Real to store return of function

C calling sequence and parameter description:


double sim20_getsi (&ds, ficach, &value, &error, &errdst)
double sim20_getsi_fcc (&ds, file, card, chan, &value, &error, &errdst)

where:
ds long dataset number (1--4)
ficach long File--Card--Channel address of smart input
(10101--161416)
file long File address of analog input (1 -- 16)
card long Card address of analog input (1 -- 14)
chan long Channel address of analog input (1 -- 16)
value double Floating point number
error long Error return code
errdst long Destination of error messages

Original September 1995 56


UM25.0:SPE311
SIMVOX -- Version 2.3 Appendix A

Examples
FORTRAN:
integer*4 ds /1/
integer*4 error
integer*4 errdst /1/
integer*4 ficach
integer*4 file
integer*4 card
integer*4 chan
real*8 value
real*8 tempreal

...
ficach = 100904
tempreal = sim20_getsi (ds, ficach, value, error, errdst)
...
tempreal = sim20_getsi (ds, 100902, value, error, errdst)
...

...
file = 10
card = 9
chan = 4
tempreal = sim20_getsi_fcc (ds, file, card, chan, value, error, errdst)
...
tempreal = sim20_getsi_fcc (ds, 2, 5, 3, value, error, errdst)
...

Original September 1995 57


UM25.0:SPE311
SIMVOX -- Version 2.3 Appendix A

C:
long ds = 1;
long error;
long errdst = 1;
long ficach;
long file;
long card;
long chan;
double value;

...
ficach = 100904;
sim20_getsi (&ds, ficach, &value, &error, &errdst);
...
sim20_getsi (&ds, 100902, &value, &error, &errdst);
...

...
file = 10;
card = 9;
chan = 4;
sim20_getsi_fcc (&ds, file, card, chan, &value, &error, &errdst);
...
sim20_getsi_fcc (&ds, 2, 5, 3, &value, &error, &errdst);
...

Original September 1995 58


UM25.0:SPE311
SIMVOX -- Version 2.3 Appendix A

SIM20_GETSO
SIM20_GETSO_FCC
Get a smart output as a floating point number. SIM20_GETSO_FCC uses less CPU as
compared to SIM20_GETSO.

Format
FORTRAN calling sequence and parameter description:
TEMPREAL = SIM20_GETSO (DS, FICACH, VALUE, ERROR, ERRDST)
TEMPREAL = SIM20_GETSO_FCC (DS, FILE, CARD, CHAN, VALUE, ERROR, ERRDST)

where:
DS INTEGER*4 dataset number (1--4)
FICACH INTEGER*4 File--Card--Channel address of smart output
(10101--161416)
FILE INTEGER*4 File address of analog input (1 -- 16)
CARD INTEGER*4 Card address of analog input (1 -- 14)
CHAN INTEGER*4 Channel address of analog input (1 -- 16)
VALUE REAL*8 Floating point number
ERROR INTEGER*4 Error return code
ERRDST INTEGER*4 Destination of error messages
TEMPREAL REAL*8 Real to store return of function

C calling sequence and parameter description:


double sim20_getso (&ds, ficach, &value, &error, &errdst)
double sim20_getso_fcc (&ds, file, card, chan, &value, &error, &errdst)

where:
ds long dataset number (1--4)
ficach long File--Card--Channel address of smart output
(10101--161416)
file long File address of analog input (1 -- 16)
card long Card address of analog input (1 -- 14)
chan long Channel address of analog input (1 -- 16)
value double Floating point number
error long Error return code
errdst long Destination of error messages

Original September 1995 59


UM25.0:SPE311
SIMVOX -- Version 2.3 Appendix A

Examples
FORTRAN:
integer*4 ds /1/
integer*4 error
integer*4 errdst /1/
integer*4 ficach
integer*4 file
integer*4 card
integer*4 chan
real*8 value
real*8 tempreal

...
ficach = 100904
tempreal = sim20_getso (ds, ficach, value, error, errdst)
...
tempreal = sim20_getso (ds, 100902, value, error, errdst)
...

...
file = 10
card = 9
chan = 4
tempreal = sim20_getso_fcc (ds, file, card, chan, value, error, errdst)
...
tempreal = sim20_getso_fcc (ds, 2, 5, 3, value, error, errdst)
...

Original September 1995 60


UM25.0:SPE311
SIMVOX -- Version 2.3 Appendix A

C:
long ds = 1;
long error;
long errdst = 1;
long ficach;
long file;
long card;
long chan;
double value;

...
ficach = 100904;
sim20_getso (&ds, ficach, &value, &error, &errdst);
...
sim20_getso (&ds, 100902, &value, &error, &errdst);
...

...
file = 10;
card = 9;
chan = 4;
sim20_getso_fcc (&ds, file, card, chan, &value, &error, &errdst);
...
sim20_getso_fcc (&ds, 2, 5, 3, &value, &error, &errdst);
...

Original September 1995 61


UM25.0:SPE311
SIMVOX -- Version 2.3 Appendix A

SIM20_LAGLOOP
Tieback a loop analog output to analog input. This function provides first order lag.

Format
FORTRAN calling sequence and parameter description:
CALL SIM20_LAGLOOP (DS, PV, VO, GAIN, TIME, EXEC, REVACT, ERRDST)

where:
DS INTEGER*4 Dataset number (1--4)
PV INTEGER*4 File--Card--Channel address of process
variable or analog input (10101--161416)
VO INTEGER*4 File--Card--Channel address of the valve
output or analog output (10101--161408)
Channels 1 -- 8 of card only.
GAIN REAL*8 Loop sensitivity (average = 1.0)
TIME REAL*8 Loop lag time in seconds
EXEC REAL*8 Tieback execution interval in seconds
REVACT INTEGER*4 0 for a direct--acting loop; 1 for a
reverse--acting loop
ERRDST INTEGER*4 Destination of error messages

C calling sequence and parameter description:


sim20_lagloop (&ds, pv, vo, gain, time, exec, revact, &errdst)

where:
ds long Dataset number (1--4)
pv long File--Card--Channel address of process
variable or analog input (10101--161416)
vo long File--Card--Channel address of the valve
output or analog output (10101--161408)
Channels 1 -- 8 of card only.
gain double Loop sensitivity (average = 1.0)
time double Loop lag time in seconds
exec double Loop execution interval in seconds
revact long 0 for a direct--acting loop; 1 for a
reverse--acting loop
errdst long Destination of error messages

Original September 1995 62


UM25.0:SPE311
SIMVOX -- Version 2.3 Appendix A

Examples
FORTRAN:
integer*4 ds /1/
integer*4 errdst /1/
integer*4 pv
integer*4 vo
real*8 gain
real*8 time
real*8 exec
integer*4 revact

...
pv = 70210
vo = 70202
gain = 1.0
time = 10.0
exec = 3.0
revact = 0
call sim20_lagloop (ds, pv, vo, gain, time, exec, revact, errdst)
...
call sim20_lagloop (ds, 60102, 60202, 1.0, 10.0, 3.0, 0, errdst)
...

Original September 1995 63


UM25.0:SPE311
SIMVOX -- Version 2.3 Appendix A

C:
long ds = 1;
long errdst = 1;
long pv;
long vo;
double gain;
double time;
double exec;
long revact;

...
pv = 70210;
vo = 70202;
gain = 1.0;
time = 10.0;
exec = 3.0;
revact = 0;
sim20_lagloop (&ds, pv, vo, gain, time, exec, revact, &errdst);
...
sim20_lagloop (&ds, 60102, 60202, 1.0, 10.0, 3.0, 0, &errdst);
...

Original September 1995 64


UM25.0:SPE311
SIMVOX -- Version 2.3 Appendix A

SIM20_LOOP
Tieback a loop analog output to analog input without any lag.

Format
FORTRAN calling sequence and parameter description:
CALL SIM20_LOOP (DS, PV, VO, GAIN, REVACT, ERRDST)

where:
DS INTEGER*4 Dataset number (1--4)
PV INTEGER*4 File--Card--Channel address of process
variable or analog input (10101--161416)
VO INTEGER*4 File--Card--Channel address of the valve
output or analog output (10101--161408)
Channels 1 -- 8 of card only.
GAIN REAL*8 Loop sensitivity (average = 1.0)
REVACT INTEGER*4 0 for a direct--acting loop; 1 for a
reverse--acting loop
ERRDST INTEGER*4 Destination of error messages

C calling sequence and parameter description:


sim20_loop (&ds, pv, vo, gain, revact, &errdst)

where:
ds long Dataset number (1--4)
pv long File--Card--Channel address of process
variable or analog input (10101--161416)
vo long File--Card--Channel address of the valve
output or analog output (10101--161408)
Channels 1 -- 8 of card only.
gain double Loop sensitivity (average = 1.0)
revact long 0 for a direct--acting loop; 1 for a
reverse--acting loop
errdst long Destination of error messages

Original September 1995 65


UM25.0:SPE311
SIMVOX -- Version 2.3 Appendix A

Examples
FORTRAN:
integer*4 ds /1/
integer*4 errdst /1/
integer*4 pv
integer*4 vo
real*8 gain
integer*4 revact

...
pv = 70210
vo = 70202
gain = 1.0
revact = 0
call sim20_loop (ds, pv, vo, gain, revact, errdst)
...

Original September 1995 66


UM25.0:SPE311
SIMVOX -- Version 2.3 Appendix A

C:
long ds = 1;
long errdst = 1;
long pv;
long vo;
double gain;
long revact;

...
pv = 70210;
vo = 70202;
gain = 1.0;
revact = 0;
sim20_loop (&ds, pv, vo, gain, revact, &errdst);
...

Original September 1995 67


UM25.0:SPE311
SIMVOX -- Version 2.3 Appendix A

SIM20_NOTE
Post a note to the message box.

Format
FORTRAN calling sequence and parameter description:
CALL SIM20_NOTE (NOTE)

where:
NOTE CHARACTER*(*) Note to be displayed

C calling sequence and parameter description:


sim20_note (note)

where:
note char[] Note to be displayed

Original September 1995 68


UM25.0:SPE311
SIMVOX -- Version 2.3 Appendix A

Examples
FORTRAN:

call sim20_note(Point found)

Original September 1995 69


UM25.0:SPE311
SIMVOX -- Version 2.3 Appendix A

C:
sim20_note(Point found);

Original September 1995 70


UM25.0:SPE311
SIMVOX -- Version 2.3 Appendix A

SIM20_SETAIC
SIM20_SETAIC_FCC
Set an analog input in counts. SIM20_SETAIC_FCC uses less CPU as compared to
SIM20_SETAIC.

Format
FORTRAN calling sequence and parameter description:
TEMPINT = SIM20_SETAIC (DS, FICACH, VALUE, ERROR, ERRDST)
TEMPINT = SIM20_SETAIC_FCC (DS, FILE, CARD, CHAN, VALUE, ERROR, ERRDST)

where:
DS INTEGER*4 dataset number (1--4)
FICACH INTEGER*4 File--Card--Channel address of analog input
(10101--161416)
FILE INTEGER*4 File address of analog input (1 -- 16)
CARD INTEGER*4 Card address of analog input (1 -- 14)
CHAN INTEGER*4 Channel address of analog input (1 -- 16)
VALUE INTEGER*4 Number of counts (0--4095)
ERROR INTEGER*4 Error return code
ERRDST INTEGER*4 Destination of error messages
TEMPINT INTEGER*4 Integer to store return of function

C calling sequence and parameter description:


long sim20_setaic (&ds, ficach, &value, &error, &errdst)
long sim20_setaic_fcc (&ds, file, card, chan, &value, &error, &errdst)

where:
ds long dataset number (1--4)
ficach long File--Card--Channel address of analog input
(10101--161416)
file long File address of analog input (1 -- 16)
card long Card address of analog input (1 -- 14)
chan long Channel address of analog input (1 -- 16)
value long Number of counts (0--4095)
error long Error return code
errdst long Destination of error messages

Original September 1995 71


UM25.0:SPE311
SIMVOX -- Version 2.3 Appendix A

Examples
FORTRAN:
integer*4 ds /1/
integer*4 error
integer*4 errdst /1/
integer*4 ficach
integer*4 file
integer*4 card
integer*4 chan
integer*4 value
integer*4 tempint

...
ficach = 121202
value = 520
tempint = sim20_setaic (ds, ficach, value, error, errdst)
...
tempint = sim20_setaic (ds, 121102, value, error, errdst)
...

...
file = 12
card = 12
chan = 2
value = 520
tempint = sim20_setaic_fcc (ds, file, card, chan, value, error, errdst)
...
tempint = sim20_setaic_fcc (ds, 11, 8, 1, value, error, errdst)
...

Original September 1995 72


UM25.0:SPE311
SIMVOX -- Version 2.3 Appendix A

C:
long ds = 1;
long error;
long errdst = 1;
long ficach;
long file;
long card;
long chan;
long value;

...
ficach = 121202;
value = 520;
sim20_setaic (&ds, ficach, &value, &error, &errdst);
...
sim20_setaic (&ds, 121102, &value, &error, &errdst);
...

...
file = 12;
card = 12;
chan = 2;
value = 520;
sim20_setaic_fcc (&ds, file, card, chan, &value, &error, &errdst);
...
sim20_setaic_fcc (&ds, 11, 8, 1, &value, &error, &errdst);
...

Original September 1995 73


UM25.0:SPE311
SIMVOX -- Version 2.3 Appendix A

SIM20_SETAIE
SIM20_SETAIE_FCC
Set the engineering unit value of the AI point specified by the file--card--channel.

Format

FORTRAN calling sequence and parameter description:

TEMPREAL = SIM20_SETAIE (DS, FICACH, VALUE, EUHIGH, EUHIGH, EULOW, ERRDST)


TEMPREAL = SIM20_SETAIE_FCC (DS, FILE, CARD, CHAN, VALUE, EUHIGH, EULOW, ERROR,
ERRDST)

where:

DS INTEGER*4 dataset number (1--4)


FICACH INTEGER*4 File--Card--Channel address of analog input
(10101--161416)
FILE INTEGER*4 File address of analog input (1 -- 16)
CARD INTEGER*4 Card address of analog input (1 -- 14)
CHAN INTEGER*4 Channel address of analog input (1 -- 16)
VALUE REAL*8 Value read in engineering units of the AI
point
EUHIGH REAL*8 High engineering units of the point
EULOW REAL*8 Low engineering units of the point
ERROR INTEGER*4 Error return code
ERRDST INTEGER*4 Destination of error messages
TEMPREAL REAL*8 Real to store return of function

C calling sequence and parameter description:

double sim20_setaie (&ds, fcc, &value, euhigh, eulow, &error, &errdst)


double sim20_setaie_fcc (&ds, file, card, chan, &value, euhigh, eulow, &error,
&errdst)

where:

ds long dataset number (1--4)


fcc long File--Card--Channel address of analog
input (channels 1 to 8 of card only)
file long File address of pulse count input
(1 -- 16)
card long Card address of pulse count input
(1 -- 14)
chan long Channel address of pulse count input
(1 -- 8)
value double Value read in engineering units of the AI
point
euhigh double High engineering units of the point
eulow double Low engineering units of the point
error long Error return code
errdst long Destination of error messages

Original September 1995 74


UM25.0:SPE311
SIMVOX -- Version 2.3 Appendix A

Examples
FORTRAN:
integer*4 ds /1/
integer*4 error
integer*4 errdst /1/
integer*4 ficach
integer*4 file
integer*4 card
integer*4 chan
real*8 value
real*8 euhigh
real*8 eulow
real*8 tempreal
...
ficach = 51309
value = 30.0
euhigh = 0
eulow = 0
tempreal = sim20_setaie (ds, ficach, value, euhigh, eulow, error, errdst)
...
tempreal = sim20_setaie (ds, 51208, value, euhigh, eulow, error, errdst)
...
...
file = 5
card = 13
chan = 9
value = 25.0
tempreal = sim20_setaie_fcc (ds, file, card, chan, value, euhigh, eulow, error, errdst)
...
tempreal = sim20_setaie_fcc (ds, 4, 7, 6, value, euhigh, eulow, error, errdst)
...

Original September 1995 75


UM25.0:SPE311
SIMVOX -- Version 2.3 Appendix A

C:
long ds = 1;
long error;
long errdst = 1;
long ficach;
long file;
long card;
long chan;
double value;
double euhigh;
double eulow;

...
ficach = 121202;
value = 55.0;
euhigh = 100.0;
eulow = 0.0;
sim20_setaie (&ds, ficach, &value, &error, &euhigh, &eulow, &errdst);
...
sim20_setaie (&ds, 121102, &value, &error, &euhigh, &eulow, &errdst);
...

...
file = 12;
card = 12;
chan = 2;
value = 20.25;
sim20_setaie_fcc (&ds, file, card, chan, &value, &euhigh, &eulow, &error, &errdst);
...
sim20_setaie_fcc (&ds, 11, 8, 1, &value, &euhigh, &eulow, &error, &errdst);
...

Original September 1995 76


UM25.0:SPE311
SIMVOX -- Version 2.3 Appendix A

SIM20_SETAIP
SIM20_SETAIP_FCC
Set an analog input in percent. SIM20_SETAIP_FCC uses less CPU as compared to
SIM20_SETAIP.

Format
FORTRAN calling sequence and parameter description:
TEMPREAL = SIM20_SETAIP (DS, FICACH, VALUE, ERROR, ERRDST)
TEMPREAL = SIM20_SETAIP_FCC (DS, FILE, CARD, CHAN, VALUE, ERROR, ERRDST)

where:
DS INTEGER*4 dataset number (1--4)
FICACH INTEGER*4 File--Card--Channel address of analog input
(10101--161416)
FILE INTEGER*4 File address of analog input (1 -- 16)
CARD INTEGER*4 Card address of analog input (1 -- 14)
CHAN INTEGER*4 Channel address of analog input (1 -- 16)
VALUE REAL*8 Percent (--25.0 to +100.0) or (0.0 to
+125.0) depending on card type
ERROR INTEGER*4 Error return code
ERRDST INTEGER*4 Destination of error messages
TEMPREAL REAL*8 Real to store return of function

C calling sequence and parameter description:


double sim20_setaip (&ds, ficach, &value, &error, &errdst)
double sim20_setaip_fcc (&ds, file, card, chan, &value, &error, &errdst)

where:
ds long dataset number (1--4)
ficach long File--Card--Channel address of analog input
(10101--161416)
file long File address of analog input (1 -- 16)
card long Card address of analog input (1 -- 14)
chan long Channel address of analog input (1 -- 16)
value double Percent (--25.0 to +100.0) or (0.0 to
+125.0) depending on card type
error long Error return code
errdst long Destination of error messages

Original September 1995 77


UM25.0:SPE311
SIMVOX -- Version 2.3 Appendix A

Examples
FORTRAN:
integer*4 ds /1/
integer*4 error
integer*4 errdst /1/
integer*4 ficach
integer*4 file
integer*4 card
integer*4 chan
real*8 value
real*8 tempreal

...
ficach = 51309
value = 30.0
tempreal = sim20_setaip (ds, ficach, value, error, errdst)
...
tempreal = sim20_setaip (ds, 51208, value, error, errdst)
...

...
file = 5
card = 13
chan = 9
value = 30.0
tempreal = sim20_setaip_fcc (ds, file, card, chan, value, error, errdst)
...
tempreal = sim20_setaip_fcc (ds, 4, 7, 6, value, error, errdst)
...

Original September 1995 78


UM25.0:SPE311
SIMVOX -- Version 2.3 Appendix A

C:
long ds = 1;
long error;
long errdst = 1;
long ficach;
long file;
long card;
long chan;
double value;

...
ficach = 51309;
value = 30.0;
sim20_setaip (&ds, ficach, &value, &error, &errdst);
...
sim20_setaip (&ds, 51208, &value, &error, &errdst);
...

...
file = 5;
card = 13;
chan = 9;
value = 30.0;
sim20_setaip_fcc (&ds, file, card, chan, &value, &error, &errdst);
...
sim20_setaip_fcc (&ds, 4, 7, 6, &value, &error, &errdst)
...

Original September 1995 79


UM25.0:SPE311
SIMVOX -- Version 2.3 Appendix A

SIM20_SETCALCVALUE
Set the value of a calculation given its index and dataset.

Format
FORTRAN calling sequence and parameter description:
TEMPREAL = SIM20_SETCALCVALUE (DS, INDEX, VALUE, ERROR, ERRDST)

where:
DS INTEGER*4 dataset number (1--4)
INDEX INTEGER*4 Index of the calculation within the DLL
VALUE REAL*8 Value of the calculation
ERROR INTEGER*4 Error return code
ERRDST INTEGER*4 Destination of error messages
TEMPREAL REAL*8 Real to store return of function

C calling sequence and parameter description:


double sim20_setcalcvalue (&ds, index, &value, &error, &errdst)

where:
ds long dataset number (1--4)
index long Index of the calculation within the DLL
value double Value of the calculation
error long Error return code
errdst long Destination of error messages

Original September 1995 80


UM25.0:SPE311
SIMVOX -- Version 2.3 Appendix A

Examples
FORTRAN:
integer*4 ds
integer*4 index
real*8 value
integer*4 error
integer*4 errdst
real*8 tempreal

ds = 1
value = 9.87

tag = testcalc
tempint = sim20_getcalcindex (ds, tag, index, error, errdst)
teampreal = sim20_setcalcvalue (ds, index, value, error, errdst)

Original September 1995 81


UM25.0:SPE311
SIMVOX -- Version 2.3 Appendix A

C:
long ds;
long index;
double value;
long error;
long errdst;
double temp;

ds = 1;
value = 9.87;

strcpy(tag, testcalc);
sim20_getcalcindex (&ds, tag, &index, &error, &errdst);
sim20_setcalcvalue (&ds, index, &value, &error, &errdst);

Original September 1995 82


UM25.0:SPE311
SIMVOX -- Version 2.3 Appendix A

SIM20_SETDI
SIM20_SETDI_FCC
Set a discrete input channel. SIM20_SETDI_FCC uses CPU as compared to
SIM20_SETDI.

Format
FORTRAN calling sequence and parameter description:
TEMPINT = SIM20_SETDI (DS, FICACH, VALUE, ERROR, ERRDST)
TEMPINT = SIM20_SETDI_FCC (DS, FILE, CARD, CHAN, VALUE, ERROR, ERRDST)

where:
DS INTEGER*4 dataset number (1--4)
FICACH INTEGER*4 File--Card--Channel address of discrete
input (10101--161416)
FILE INTEGER*4 File address of discrete input (1 -- 16)
CARD INTEGER*4 Card address of discrete input (1 -- 14)
CHAN INTEGER*4 Channel address of discrete input
(1 -- 16)
VALUE INTEGER*4 (0 -- 1)
ERROR INTEGER*4 Error return code
ERRDST INTEGER*4 Destination of error messages
TEMPINT INTEGER*4 Integer to store return of function

C calling sequence and parameter description:


long sim20_setdi (&ds, ficach, &value, &error, &errdst)
long sim20_setdi_fcc (&ds, file, card, chan, &value, &error, &errdst)

where:
ds long dataset number (1--4)
ficach long File--Card--Channel address of discrete
input (10101--161416)
file long File address of discrete input (1 -- 16)
card long Card address of discrete input (1 -- 14)
chan long Channel address of discrete input
(1 -- 16)
value long (0 -- 1)
error long Error return code
errdst long Destination of error messages

Original September 1995 83


UM25.0:SPE311
SIMVOX -- Version 2.3 Appendix A

Examples
FORTRAN:
integer*4 ds /1/
integer*4 error
integer*4 errdst /1/
integer*4 ficach
integer*4 file
integer*4 card
integer*4 chan
integer*4 value
integer*4 tempint

...
ficach = 20901
value = 1
tempint = sim20_setdi (ds, ficach, value, error, errdst)
...
tempint = sim20_setdi (ds, 20915, value, error, errdst)
...

...
file = 2
card = 9
chan = 1
value = 1
tempint = sim20_setdi_fcc (ds, file, card, chan, value, error, errdst)
...
tempint = sim20_setdi_fcc (ds, 4, 6, 2, value, error, errdst)
...

Original September 1995 84


UM25.0:SPE311
SIMVOX -- Version 2.3 Appendix A

C:
long ds = 1;
long error;
long errdst = 1;
long ficach;
long file;
long card;
long chan;
long value;

...
ficach = 20901;
value = 1;
sim20_setdi (&ds, ficach, &value, &error, &errdst);
...
sim20_setdi (&ds, 20915, &value, &error, &errdst);
...

...
file = 2;
card = 9;
chan = 1;
value = 1;
sim20_setdi_fcc (&ds, file, card, chan, &value, &error, &errdst);
...
sim20_setdi_fcc (&ds, 4, 6, 2, &value, &error, &errdst);
...

Original September 1995 85


UM25.0:SPE311
SIMVOX -- Version 2.3 Appendix A

SIM20_SETDIW
SIM20_SETDIW_FCC
Set a group of 16 discrete inputs on a single card. SIM20_SETDIW_FCC uses less CPU
as compared to SIM20_SETDIW.

Format
FORTRAN calling sequence and parameter description:
TEMPINT = SIM20_SETDIW (DS, FFCx, VALUE, ERROR, ERRDST)
TEMPINT = SIM20_SETDIW_FCC (DS, FILE, CARD, CHAN, VALUE, ERROR, ERRDST)

where:
DS INTEGER*4 dataset number (1--4)
FFCx INTEGER*4 File--Card--Channel address of ANY channel
on a discrete input card (10101--161416)
FILE INTEGER*4 File address of discrete input (1 -- 16)
CARD INTEGER*4 Card address of discrete input (1 -- 14)
CHAN INTEGER*4 Channel address of ANY discrete input
(1 -- 16)
VALUE INTEGER*4 (0 -- 65535) (channel 1 = bit 0 = lsb)
ERROR INTEGER*4 Error return code
ERRDST INTEGER*4 Destination of error messages
TEMPINT INTEGER*4 Integer to store return of function

C calling sequence and parameter description:


long sim20_setdiw (&ds, ffcx, &value, &error, &errdst)
long sim20_setdiw_fcc (&ds, file, card, chan, &value, &error, &errdst)

where:
ds long dataset number (1--4)
ffcx long File--Card--Channel address of ANY channel
on a discrete input card (10101--161416)
file long File address of discrete input (1 -- 16)
card long Card address of discrete input (1 -- 14)
chan long Channel address of ANY discrete input
(1 -- 16)
value long (0 -- 65535) (channel 1 = bit 0 = lsb)
error long Error return code
errdst long Destination of error messages

Original September 1995 86


UM25.0:SPE311
SIMVOX -- Version 2.3 Appendix A

Examples
FORTRAN:
integer*4 ds /1/
integer*4 error
integer*4 errdst /1/
integer*4 ficach
integer*4 file
integer*4 card
integer*4 chan
integer*4 value
integer*4 tempint

...
ficach = 110204
value = 9507
tempint = sim20_setdiw (ds, ficach, value, error, errdst)
...
tempint = sim20_setdiw (ds, 110209, value, error, errdst)
...

...
file = 11
card = 2
chan = 4
value = 9507
tempint = sim20_setdiw_fcc (ds, file, card, chan, value, error, errdst)
...
tempint = sim20_setdiw_fcc (ds, 3, 1, 7, value, error, errdst)
...

Original September 1995 87


UM25.0:SPE311
SIMVOX -- Version 2.3 Appendix A

C:
long ds = 1;
long error;
long errdst = 1;
long ficach;
long file;
long card;
long chan;
long value;

...
ficach = 110204;
value = 9507;
sim20_setdiw (&ds, ficach, &value, &error, &errdst);
...
sim20_setdiw (&ds, 110209, &value, &error, &errdst);
...

...
file = 11;
card = 2;
chan = 4;
value = 9507;
sim20_setdiw_fcc (&ds, file, card, chan, &value, &error, &errdst);
...
sim20_setdiw_fcc (&ds, 3, 1, 7, &value, &error, &errdst);
...

Original September 1995 88


UM25.0:SPE311
SIMVOX -- Version 2.3 Appendix A

SIM20_SETPCI
SIM20_SETPCI_FCC
Set a pulse count input. SIM20_SETPCI_FCC uses less CPU as compared to
SIM20_SETPCI.

Format

FORTRAN calling sequence and parameter description:

CALL SIM20_SETPCI (DS, FICACH, VALUE, RATE_P, ERROR, ERRDST, INDEX)


CALL SIM20_SETPCI_FCC (DS, FILE, CARD, CHAN, VALUE, RATE_P, ERROR, ERRDST, INDEX)

where:

DS INTEGER*4 dataset number (1--4)


FICACH INTEGER*4 File--Card--Channel address of pulse count
input (channels 1 to 8 of card only)
FILE INTEGER*4 File address of pulse count input
(1 -- 16)
CARD INTEGER*4 Card address of pulse count input
(1 -- 14)
CHAN INTEGER*4 Channel address of pulse count input
(1 -- 8)
VALUE INTEGER*4 Number of raw pulses (0 -- 65,535)
RATE_P REAL*8 PCI rate period as declared in the
UOC/IFC definition from 0.1 to 5.0
ERROR INTEGER*4 Error return code
ERRDST INTEGER*4 Destination of error messages
INDEX INTEGER*4 A unique number between 1 and 255

C calling sequence and parameter description:

sim20_setpci (&ds, ficach, &value, &rate, &error, &errdst, index)


sim20_setpci_fcc (&ds, file, card, chan, &value, &rate, &error, &errdst, index)

where:

ds long dataset number (1--4)


ficach long File--Card--Channel address of pulse count
input (channels 1 to 8 of card only)
file long File address of pulse count input
(1 -- 16)
card long Card address of pulse count input
(1 -- 14)
chan long Channel address of pulse count input
(1 -- 8)
value long Number of raw pulses (0 -- 65,535)
rate_p double PCI rate period as declared in the
UOC/IFC definition from 0.1 to 5.0
error long Error return code
errdst long Destination of error messages
index long A unique number between 1 and 255

Original September 1995 89


UM25.0:SPE311
SIMVOX -- Version 2.3 Appendix A

Examples
FORTRAN:
integer*4 ds /1/
integer*4 error
integer*4 errdst /1/
integer*4 file
integer*4 card
integer*4 chan
integer*4 value
integer*4 inc
real*8 rate_p

...
inc = 55
rate_p = 1.0
value = 0

WHILE (.TRUE.)
...
value = value + inc
call sim20_setpci (ds, 30703, value, rate_p, error, errdst, 72)

...

...
file = 3
card = 7
chan = 5
call sim20_setpci_fcc (ds, file, card, chan, value, rate_p, error, errdst, 72)
...
ENDWHILE

Original September 1995 90


UM25.0:SPE311
SIMVOX -- Version 2.3 Appendix A

C:
long ds = 1;
long error;
long errdst = 1;
long file;
long card;
long chan;
long value;
double rate_p;
long inc;

...
value = 0;
rate_p = 1.0;
...

while (TRUE) {

...
value += inc;
sim20_setpci (&ds, 40703, &value, &rate_p, &error, &errdst, 10);
...
file = 3;
card = 7;
chan = 3;
sim20_setpci_fcc (&ds, file, card, chan, &value, &rate_p, &error,
&errdst, 10);
}

Original September 1995 91


UM25.0:SPE311
SIMVOX -- Version 2.3 Appendix A

SIM20_SETSI
SIM20_SETSI_FCC
Set a smart input in channel. SIM20_SETSI_FCC uses less CPU as compared to
SIM20_SETSI.

Format
FORTRAN calling sequence and parameter description:
TEMPREAL = SIM20_SETSI (DS, FICACH, VALUE, ERROR, ERRDST)
TEMPREAL = SIM20_SETSI_FCC (DS, FILE, CARD, CHAN, VALUE, ERROR, ERRDST)

where:
DS INTEGER*4 dataset number (1--4)
FICACH INTEGER*4 File--Card--Channel address of smart input
(10101--161416)
FILE INTEGER*4 File address of analog input (1 -- 16)
CARD INTEGER*4 Card address of analog input (1 -- 14)
CHAN INTEGER*4 Channel address of analog input (1 -- 16)
VALUE REAL*8 Percent (--25.0 to +100.0) or (0.0 to
+125.0) depending on card type
ERROR INTEGER*4 Error return code
ERRDST INTEGER*4 Destination of error messages
TEMPREAL REAL*8 Real to store return of function

C calling sequence and parameter description:


double sim20_setsi (&ds, ficach, &value, &error, &errdst)
double sim20_setsi_fcc (&ds, file, card, chan, &value, &error, &errdst)

where:
ds long dataset number (1--4)
ficach long File--Card--Channel address of smart input
(10101--161416)
file long File address of analog input (1 -- 16)
card long Card address of analog input (1 -- 14)
chan long Channel address of analog input (1 -- 16)
value double Percent (--25.0 to +100.0) or (0.0 to
+125.0) depending on card type
error long Error return code
errdst long Destination of error messages

Original September 1995 92


UM25.0:SPE311
SIMVOX -- Version 2.3 Appendix A

Examples
FORTRAN:
integer*4 ds /1/
integer*4 error
integer*4 errdst /1/
integer*4 ficach
integer*4 file
integer*4 card
integer*4 chan
real*8 value
real*8 tempreal

...
ficach = 51309
value = 30.0
tempreal = sim20_setsi (ds, ficach, value, error, errdst)
...
tempreal = sim20_setsi (ds, 51208, value, error, errdst)
...

...
file = 5
card = 13
chan = 9
value = 30.0
tempreal = sim20_setsi_fcc (ds, file, card, chan, value, error, errdst)
...
tempreal = sim20_setsi_fcc (ds, 4, 7, 6, value, error, errdst)
...

Original September 1995 93


UM25.0:SPE311
SIMVOX -- Version 2.3 Appendix A

C:
long ds = 1;
long error;
long errdst = 1;
long ficach;
long file;
long card;
long chan;
double value;

...
ficach = 51309;
value = 30.0;
sim20_setsi (&ds, ficach, &value, &error, &errdst);
...
sim20_setsi (&ds, 51208, &value, &error, &errdst);
...

...
file = 5;
card = 13;
chan = 9;
value = 30.0;
sim20_setsi_fcc (&ds, file, card, chan, &value, &error, &errdst);
...
sim20_setsi_fcc (&ds, 4, 7, 6, &value, &error, &errdst)
...

Original September 1995 94


UM25.0:SPE311
SIMVOX -- Version 2.3 Appendix A

SIM20_SLEEP
This function is not supported in SIMVOX for Windows NT. It is provided for
compatability with existing code. It simply delays for 1 second before returning.

Format
FORTRAN calling sequence and parameter description:
CALL SIM20_SLEEP ()

C calling sequence and parameter description:


sim20_sleep ()

Original September 1995 95


UM25.0:SPE311
SIMVOX -- Version 2.3 Appendix A

Examples
FORTRAN:

while (.TRUE.)
...

call sim20_sleep ()
endwhile

Original September 1995 96


UM25.0:SPE311
SIMVOX -- Version 2.3 Appendix A

C:

call sim20_wakeup ( ... )


while (TRUE)
{
...

sim20_sleep ();
}

Original September 1995 97


UM25.0:SPE311
SIMVOX -- Version 2.3 Appendix A

SIM20_WAKEUP
This function is not supported in SIMVOX for Windows NT. It is provided for
compatability with existing code.

Original September 1995 98


UM25.0:SPE311
Appendix B

SIMVOX Library Subroutines


PROVOX VIOC (DM6004)
This page intentionally blank
SIMVOX -- Version 2.3 Appendix B

LIBRARY INDEX
sim10_attach_ds (ds, error, errdst)
sim10_attach_multi_ds(ds, error, errdst)
sim10_dcd (ds, template, output, input, dcdnum, error, errdst, trantime, tranpv)
sim10_delay (sec)
sim10_getaic (ds, ffcc, value, error, errdst)
sim10_getaie (ds, ffcc, value, euhigh, eulow, error, errdst)
sim10_getaip (ds, ffcc, value, error, errdst)
sim10_getaoc (ds, ffcc, value, error, errdst)
sim10_getaop (ds, ffcc, value, error, errdst)
sim10_getdi (ds, ffcc, value, error, errdst)
sim10_getdib (ds, ffcc, value, error, errdst)
sim10_getdo (ds, ffcc, value, error, errdst)
sim10_getdob (ds, ffcc, value, error, errdst)
sim10_getds ()
sim10_get_all_ds (flag)
sim10_getpci (ds, ffcc, value, rate, error, errdst)
sim10_loop (ds, pv, vo, gain, revact, errdst)
sim10_note (note)
sim10_setaic (ds, ffcc, value, error, errdst)
sim10_setaie (ds, ffcc, value, euhigh, eulow, error, errdst)
sim10_setaip (ds, ffcc, value, error, errdst)
sim10_setdi (ds, ffcc, value, error, errdst)
sim10_setdib (ds, ffcc, value, error, errdst)
sim10_setpci (ds, ffcc, value, rate_p, error, errdst, index)
sim10_sleep ()
sim10_wakeup (number, units, error)

Original September 1995 1


UM25.0:SPE311
SIMVOX -- Version 2.3 Appendix B

This page intentionally blank

Original September 1995 2


UM25.0:SPE311
SIMVOX -- Version 2.3 Appendix B

SIM10_ATTACH_DS
Attach to a dataset. All programs must use this function to attach to a dataset. SIMVOX
calls do not work correctly without it. Attaching is done prior to all other SIMVOX calls
except sim10_getds and sim10_get_all_ds.

Format
FORTRAN calling sequence and parameter description:
CALL SIM10_ATTACH_DS (DS, ERROR, ERRDST)

where:
DS INTEGER*2 Dataset number (1--4)
ERROR INTEGER*2 Error return value
ERRDST INTEGER*2 Destination of error messages

C calling sequence and parameter description:


sim10_attach_ds (&ds, &error, &errdst);

where:
ds short Dataset number (1--4)
error short Error return value
errdst short Destination of error messages

Original September 1995 1


UM25.0:SPE311
SIMVOX -- Version 2.3 Appendix B

This page intentionally blank

Original September 1995 2


UM25.0:SPE311
SIMVOX -- Version 2.3 Appendix B

Examples
FORTRAN:
integer*2 ds /1/
integer*2 error
integer*2 errdst /1/

...
call sim10_attach_ds (ds, error, errdst)
...

Original September 1995 3


UM25.0:SPE311
SIMVOX -- Version 2.3 Appendix B

C:
short ds = 1;
short error;
short errdst = 1;

...
sim10_attach_ds (&ds, &error, &errdst);
...

Original September 1995 4


UM25.0:SPE311
SIMVOX -- Version 2.3 Appendix B

SIM10_ATTACH_MULTI_DS
Attach to multiple datasets. Gets all the datasets on the command line and attaches to
those datasets. Stores the attached datasets in the dataset array provided as the first
parameter.

Format
FORTRAN calling sequence and parameter description:
CALL SIM10_ATTACH_MULTI_DS (DS, ERROR, ERRDST)

where:
DS(4) INTEGER*2 Dataset array
ERROR INTEGER*2 Error return value
ERRDST INTEGER*2 Destination of error messages

C calling sequence and parameter description:


sim10_attach_multi_ds (ds, &error, &errdst);

where:
ds[4] short Dataset array
error short Error return value
errdst short Destination of error messages

Original September 1995 5


UM25.0:SPE311
SIMVOX -- Version 2.3 Appendix B

Examples
FORTRAN:
integer*2 ds(4)
integer*2 error
integer*2 errdst /1/
...
call sim10_attach_multi_ds (ds, error, errdst)
...

Original September 1995 6


UM25.0:SPE311
SIMVOX -- Version 2.3 Appendix B

C:
short ds [4];
short error;
short errdst = 1;

...
sim10_attach_multi_ds (ds, &error, &errdst);
...

Original September 1995 7


UM25.0:SPE311
SIMVOX -- Version 2.3 Appendix B

SIM10_DCD
Tieback DCD output patterns to input patterns. This function is called once for each
DCD to be resolved by the tieback program. SIMVOX Tools option allows automatic
creation of tieback programs.

Format
FORTRAN calling sequence and parameter description:
CALL SIM10_DCD (DS, TEMPLATE, OUTPUT, INPUT, DCDNUM, ERROR, ERRDST, TRANTIME,
TRANPV)

where:
DS INTEGER*2 Dataset number (1--4)
TEMPLATE(35) INTEGER*2 Thirty--five element array containing the
DCD template
OUTPUT (8) INTEGER*2 Eight element array containing the
File--Card--Channel addresses of the
outputs
INPUT (16) INTEGER*2 Sixteen element array containing the
File--Card--Channel addresses of the inputs
DCDNUM INTEGER*2 Sequence number of the DCD (1--128)
ERROR INTEGER*2 Error return code
ERRDST INTEGER*2 Destination of error messages
TRANTIME INTEGER*2 Number of seconds to wait before setting
up the new PV on the inputs after a new
SP appears on the outputs
TRANPV INTEGER*2 PV to set up on the inputs during the
transition time (--32768 to +32767)

Original September 1995 8


UM25.0:SPE311
SIMVOX -- Version 2.3 Appendix B

C calling sequence and parameter description:


sim10_dcd (&ds, template, output, input, dcdnum, &error, &errdst, trantime, tranpv)

where:
ds short Dataset number (1--4)
template short[35] Thirty--five element array containing the
DCD template
output short[8] Eight element array containing the
File--Card--Channel addresses of the
outputs
input short[16] Sixteen element array containing the
File--Card--Channel addresses of the inputs
dcdnum short Sequence number of the DCD (1--128)
error short Error return code
errdst short Destination of error messages
trantime short Number of seconds to wait before setting
up the new PV on the inputs after a new
SP appears on the outputs
tranpv short PV to set up on the inputs during the
transition time (--32768 to +32767)

The template used is defined as follows:

TEMPLATE (1) Number of setpoints (1--16)


(2) Number of outputs (1--8)
(3) Number of inputs (1--16)
(4--19) Discrete output patterns for each of the
16 possible setpoints (0--255)
(20--35) Discrete input patterns for each of the
16 possible setpoints (--32768 to +32767)

Original September 1995 9


UM25.0:SPE311
SIMVOX -- Version 2.3 Appendix B

Examples
FORTRAN:
integer*2 ds /1/
integer*2 error
integer*2 errdst /1/
integer*2 dcdnum
integer*2 trantime
integer*2 tranpv

integer*2 dcd_output (8 )
integer*2 dcd_input (16)
integer*2 template (35)

data dcd_output /273,0,0,0,0,0,0,0/


data dcd_input /243,253,0,0,0,0,0,0,8*0/

data template /2,1,2,


1,0,14*0,
1,2,14*0/

...

trantime = 0
tranpv = 0
while (.TRUE.)
call sim10_dcd (ds, template, dcd_output, dcd_input, 1, error, errdst, trantime,
tranpv)

...

endwhile

Original September 1995 10


UM25.0:SPE311
SIMVOX -- Version 2.3 Appendix B

C:
short ds = 1;
short error;
short errdst = 1;
short dcdnum;
short trantime;
short tranpv;

short dcd_output [8] = {273, 0, 0, 0, 0, 0, 0, 0 };


short dcd_input [16] = {243, 253, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0};

short template [35] = {2, 1, 2,


1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};

...

trantime = 0;
tranpv = 0;
while (TRUE)
{
sim10_dcd(&ds, template, dcd_output, dcd_input, 1, &error, &errdst, trantime,
tranpv);

...

Original September 1995 11


UM25.0:SPE311
SIMVOX -- Version 2.3 Appendix B

SIM10_DELAY
Put calling process to sleep for the specified amount of time. The time is specified in
seconds.

Format
FORTRAN calling sequence and parameter description:
CALL SIM10_DELAY (SEC)

where:
SEC REAL Number of seconds to delay

C calling sequence and parameter description:


sim10_delay (&sec)

where:
sec double Real Number of seconds to delay

Original September 1995 12


UM25.0:SPE311
SIMVOX -- Version 2.3 Appendix B

Examples
FORTRAN:

real*8 delay /5.0/

...

while (.TRUE.)
...

...

call sim10_delay (delay)


endwhile

Original September 1995 13


UM25.0:SPE311
SIMVOX -- Version 2.3 Appendix B

C:

double delay = 5.0;

...

while (TRUE)
{
...

sim10_delay (&delay);
}

Original September 1995 14


UM25.0:SPE311
SIMVOX -- Version 2.3 Appendix B

SIM10_GETAIC
Get an analog input in counts.

Format
FORTRAN calling sequence and parameter description:
TEMPINT = SIM10_GETAIC (DS, FFCC, VALUE, ERROR, ERRDST)

where:
DS INTEGER*2 dataset number (1--4)
FFCC INTEGER*2 File--Card--Channel address of analog input
(111--1668)
VALUE INTEGER*2 Number of counts (0--4095, or --32768 to
+32767 for WSI)
ERROR INTEGER*2 Error return code
ERRDST INTEGER*2 Destination of error messages
TEMPINT INTEGER*2 Integer to store return of function

C calling sequence and parameter description:


short sim10_getaic (&ds, ffcc, &value, &error, &errdst)

where:
ds short dataset number (1--4)
ffcc short File--Card--Channel address of analog input
(111--1668)
value short Number of counts (0--4095, or --32768 to
+32767 for WSI)
error short Error return code
errdst short Destination of error messages

Original September 1995 15


UM25.0:SPE311
SIMVOX -- Version 2.3 Appendix B

Examples
FORTRAN:
integer*2 ds /1/
integer*2 error
integer*2 errdst /1/
integer*2 ffcc
integer*2 value
integer*2 tempint

...
ffcc = 851
tempint = sim10_getaic (ds, ffcc, value, error, errdst)
...
tempint = sim10_getaic (ds, 856, value, error, errdst)
...

Original September 1995 16


UM25.0:SPE311
SIMVOX -- Version 2.3 Appendix B

C:
short ds = 1;
short error;
short errdst = 1;
short ffcc;
short value;

...
ffcc = 851;
sim10_getaic (&ds, ffcc, &value, &error, &errdst);
...
sim10_getaic (&ds, 856, &value, &error, &errdst);
...

Original September 1995 17


UM25.0:SPE311
SIMVOX -- Version 2.3 Appendix B

SIM10_GETAIE
Get the engineering unit value of the AI point specified by the file--card--channel.

Format
FORTRAN calling sequence and parameter description:
TEMPREAL = SIM10_GETAIE (DS, FFCC, VALUE, EUHIGH, EUHIGH, EULOW, ERRDST)

where:
DS INTEGER*2 dataset number (1--4)
FFCC INTEGER*2 File--Card--Channel address of analog input
(111--1668)
VALUE REAL*8 Value read in engineering units of the AI
point
EUHIGH REAL*8 High engineering units of the point
EULOW REAL*8 Low engineering units of the point
ERROR INTEGER*2 Error return code
ERRDST INTEGER*2 Destination of error messages
TEMPREAL REAL*8 Real to store return of function

C calling sequence and parameter description:


double sim10_getaie (&ds, ffcc, &value, euhigh, eulow, &error, &errdst)

where:
ds short dataset number (1--4)
ffcc short File--Card--Channel address of analog
input (111--1668)
value double Value read in engineering units of the AI point
euhigh double High engineering units of the point
eulow double Low engineering units of the point
error short Error return code
errdst short Destination of error messages

Original September 1995 18


UM25.0:SPE311
SIMVOX -- Version 2.3 Appendix B

Examples
FORTRAN:
integer*2 ds /1/
integer*2 error
integer*2 errdst /1/
integer*2 ffcc
real*8 value
real*8 euhigh
real*8 eulow
real*8 tempreal
...
ffcc = 538
value = 0
euhigh = 0
eulow = 0
tempreal = sim10_getaie (ds, ffcc, value, euhigh, eulow, error, errdst)
...
tempreal = sim10_getaie (ds, 528, value, euhigh, eulow, error, errdst)
...

Original September 1995 19


UM25.0:SPE311
SIMVOX -- Version 2.3 Appendix B

C:
short ds = 1;
short error;
short errdst = 1;
short ffcc;
double value;
double euhigh;
double eulow;

...
ffcc = 1222;
value = 55.0;
euhigh = 100.0;
eulow = 0.0;
sim10_getaie (&ds, ffcc, &value, &error, &euhigh, &eulow, &errdst);
...
sim10_getaie (&ds, 1212, &value, &error, &euhigh, &eulow, &errdst);
...

Original September 1995 20


UM25.0:SPE311
SIMVOX -- Version 2.3 Appendix B

SIM10_GETAIP
Get an analog input in percent.

Format
FORTRAN calling sequence and parameter description:
TEMPREAL = SIM10_GETAIP (DS, FFCC, VALUE, ERROR, ERRDST)

where:
DS INTEGER*2 dataset number (1--4)
FFCC INTEGER*2 File--Card--Channel address of analog input
(111--1668)
VALUE REAL*8 Percent (--25.0 to +100.0 or 0.0 to
+125.0 or --128.0 to +127.996) depending
on card type
ERROR INTEGER*2 Error return code
ERRDST INTEGER*2 Destination of error messages
TEMPREAL REAL*8 Real to store return of function

C calling sequence and parameter description:


double sim10_getaip (&ds, ffcc, &value, &error, &errdst)

where:
ds short dataset number (1--4)
ffcc short File--Card--Channel address of analog input
(111--1668)
value double Percent (--25.0 to +100.0 or 0.0 to
+125.0 or --128.0 to +127.996) depending
on card type
error short Error return code
errdst short Destination of error messages

Original September 1995 21


UM25.0:SPE311
SIMVOX -- Version 2.3 Appendix B

Examples
FORTRAN:
integer*2 ds /1/
integer*2 error
integer*2 errdst /1/
integer*2 ffcc
real*8 value
real*8 tempreal

...
ffcc = 1064
tempreal = sim10_getaip (ds, ffcc, value, error, errdst)
...
tempreal = sim10_getaip (ds, 1062, value, error, errdst)
...

Original September 1995 22


UM25.0:SPE311
SIMVOX -- Version 2.3 Appendix B

C:
short ds = 1;
short error;
short errdst = 1;
short ffcc;
double value;

...
ffcc = 144;
sim10_getaip (&ds, ffcc, &value, &error, &errdst);
...
sim10_getaip (&ds, 1062, &value, &error, &errdst);
...

Original September 1995 23


UM25.0:SPE311
SIMVOX -- Version 2.3 Appendix B

SIM10_GETAOC
Get an analog output in counts.

Format
FORTRAN calling sequence and parameter description:
TEMPINT = SIM10_GETAOC (DS, FFCC, VALUE, ERROR, ERRDST)

where:
DS INTEGER*2 dataset number (1--4)
FFCC INTEGER*2 File--Card--Channel address of analog
output (111--1668)
VALUE INTEGER*2 Number of counts (0--4095)
ERROR INTEGER*2 Error return code
ERRDST INTEGER*2 Destination of error messages
TEMPINT INTEGER*2 Integer to store return of function

C calling sequence and parameter description:


short sim10_getaoc (&ds, ffcc, &value, &error, &errdst)

where:
ds short dataset number (1--4)
ffcc short File--Card--Channel address of analog
output (111--1668)
value short Number of counts (0--4095)
error short Error return code
errdst short Destination of error messages

Original September 1995 24


UM25.0:SPE311
SIMVOX -- Version 2.3 Appendix B

Examples
FORTRAN:
integer*2 ds /1/
integer*2 error
integer*2 errdst /1/
integer*2 ffcc
integer*2 value
integer*2 tempint

...
ffcc = 225
tempint = sim10_getaoc (ds, ffcc, value, error, errdst)
...
tempint = sim10_getaoc (ds, 228, value, error, errdst)
...

Original September 1995 25


UM25.0:SPE311
SIMVOX -- Version 2.3 Appendix B

C:
short ds = 1;
short error;
short errdst = 1;
short ffcc;
short value;

...
ffcc = 228;
sim10_getaoc (&ds, ffcc, &value, &error, &errdst);
...
sim10_getaoc (&ds, 224, &value, &error, &errdst);
...

Original September 1995 26


UM25.0:SPE311
SIMVOX -- Version 2.3 Appendix B

SIM10_GETAOP
Get an analog output in percent.

Format
FORTRAN calling sequence and parameter description:
TEMPREAL = SIM10_GETAOP (DS, FFCC, VALUE, ERROR, ERRDST)

where:
DS INTEGER*2 dataset number (1--4)
FFCC INTEGER*2 File--Card--Channel address of analog
output (111--1668)
VALUE REAL*8 Percent (--25.0 to +100.0)
ERROR INTEGER*2 Error return code
ERRDST INTEGER*2 Destination of error messages
TEMPREAL REAL*8 Real to store return of function

C calling sequence and parameter description:


double sim10_getaop (&ds, ffcc, &value, &error, &errdst)

where:
ds short dataset number (1--4)
ffcc short File--Card--Channel address of analog
output (111--1668)
value double Percent (--25.0 to +100.0)
error short Error return code
errdst short Destination of error messages

Original September 1995 27


UM25.0:SPE311
SIMVOX -- Version 2.3 Appendix B

Examples
FORTRAN:
integer*2 ds /1/
integer*2 error
integer*2 errdst /1/
integer*2 ffcc
real*8 value
real*8 tempreal

...
ffcc = 312
tempreal = sim10_getaop (ds, ffcc, value, error, errdst)
...
tempreal = sim10_getaop (ds, 316, value, error, errdst)
...

Original September 1995 28


UM25.0:SPE311
SIMVOX -- Version 2.3 Appendix B

C:
short ds = 1;
short error;
short errdst = 1;
short ffcc;
double value;

...
ffcc = 312;
sim10_getaop (&ds, ffcc, &value, &error, &errdst);
...
sim10_getaop (&ds, 316, &value, &error, &errdst);
...

Original September 1995 29


UM25.0:SPE311
SIMVOX -- Version 2.3 Appendix B

SIM10_GETDI
Get a discrete input channel.

Format
FORTRAN calling sequence and parameter description:
TEMPINT = SIM10_GETDI (DS, FFCC, VALUE, ERROR, ERRDST)

where:
DS INTEGER*2 dataset number (1--4)
FFCC INTEGER*2 File--Card--Channel address of discrete
input (111--1668)
VALUE INTEGER*2 (0 -- 1)
ERROR INTEGER*2 Error return code
ERRDST INTEGER*2 Destination of error messages
TEMPINT INTEGER*2 Integer to store return of function

C calling sequence and parameter description:


short sim10_getdi (&ds, ffcc, &value, &error, &errdst)

where:
ds short dataset number (1--4)
ffcc short File--Card--Channel address of discrete
input (111--1668)
value short (0 -- 1)
error short Error return code
errdst short Destination of error messages

Original September 1995 30


UM25.0:SPE311
SIMVOX -- Version 2.3 Appendix B

Examples
FORTRAN:
integer*2 ds /1/
integer*2 error
integer*2 errdst /1/
integer*2 ffcc
integer*2 value
integer*2 tempint

...
ffcc = 1516
tempint = sim10_getdi (ds, ffcc, value, error, errdst)
...
tempint = sim10_getdi (ds, 1512, value, error, errdst)
...

Original September 1995 31


UM25.0:SPE311
SIMVOX -- Version 2.3 Appendix B

C:
short ds = 1;
short error;
short errdst = 1;
short ffcc;
short value;

...
ffcc = 1516;
sim10_getdi (&ds, ffcc, &value, &error, &errdst);
...
sim10_getdi (&ds, 1512, &value, &error, &errdst);
...

Original September 1995 32


UM25.0:SPE311
SIMVOX -- Version 2.3 Appendix B

SIM10_GETDIB
Get a group of 8 discrete inputs on a single card.

Format
FORTRAN calling sequence and parameter description:
TEMPINT = SIM10_GETDIB (DS, FFCx, VALUE, ERROR, ERRDST)

where:
DS INTEGER*2 dataset number (1--4)
FFCx INTEGER*2 File--Card--Channel address of ANY channel
on a discrete input card (111--1668)
VALUE INTEGER*2 (0 -- 255) (channel 1 = bit 0 = lsb)
ERROR INTEGER*2 Error return code
ERRDST INTEGER*2 Destination of error messages
TEMPINT INTEGER*2 Integer to store return of function

C calling sequence and parameter description:


short sim10_getdib (&ds, ffcx, &value, &error, &errdst)

where:
ds short dataset number (1--4)
ffcx short File--Card--Channel address of ANY channel
on a discrete input card (111--1668)
value short (0 -- 255) (channel 1 = bit 0 = lsb)
error short Error return code
errdst short Destination of error messages

Original September 1995 33


UM25.0:SPE311
SIMVOX -- Version 2.3 Appendix B

Examples
FORTRAN:
integer*2 ds /1/
integer*2 error
integer*2 errdst /1/
integer*2 ffcc
integer*2 value
integer*2 tempint

...
ffcc = 319
tempint = sim10_getdib (ds, ffcc, value, error, errdst)
...
tempint = sim10_getdib (ds, 313, value, error, errdst)
...

Original September 1995 34


UM25.0:SPE311
SIMVOX -- Version 2.3 Appendix B

C:
short ds = 1;
short error;
short errdst = 1;
short ffcc;
short value;

...
ffcc = 319;
sim10_getdib (&ds, ffcc, &value, &error, &errdst);
...
sim10_getdib (&ds, 343, &value, &error, &errdst);
...

Original September 1995 35


UM25.0:SPE311
SIMVOX -- Version 2.3 Appendix B

SIM10_GETDO
Get a discrete output channel.

Format
FORTRAN calling sequence and parameter description:
TEMPINT = SIM10_GETDO (DS, FFCC, VALUE, ERROR, ERRDST)

where:
DS INTEGER*2 dataset number (1--4)
FFCC INTEGER*2 File--Card--Channel address of discrete
output (111--1668)
VALUE INTEGER*2 (0 -- 1)
ERROR INTEGER*2 Error return code
ERRDST INTEGER*2 Destination of error messages
TEMPINT INTEGER*2 Integer to store return of function

C calling sequence and parameter description:


short sim10_getdo (&ds, ffcc, &value, &error, &errdst)

where:
ds short dataset number (1--4)
ffcc short File--Card--Channel address of discrete
output (111--1668)
value short (0 -- 1)
error short Error return code
errdst short Destination of error messages

Original September 1995 36


UM25.0:SPE311
SIMVOX -- Version 2.3 Appendix B

Examples
FORTRAN:
integer*2 ds /1/
integer*2 error
integer*2 errdst /1/
integer*2 ffcc
integer*2 value
integer*2 tempint

...
ffcc = 1412
tempint = sim10_getdo (ds, ffcc, value, error, errdst)
...
tempint = sim10_getdo (ds, 1419, value, error, errdst)
...

Original September 1995 37


UM25.0:SPE311
SIMVOX -- Version 2.3 Appendix B

C:
short ds = 1;
short error;
short errdst = 1;
short ffcc;
short value;

...
ffcc = 1412;
sim10_getdo (&ds, ffcc, &value, &value, &error, &errdst);
...
sim10_getdo (&ds, 1418, &value, &value, &error, &errdst);
...

Original September 1995 38


UM25.0:SPE311
SIMVOX -- Version 2.3 Appendix B

SIM10_GETDOB
Get a group of 8 discrete outputs on a single card.

Format
FORTRAN calling sequence and parameter description:
TEMPINT = SIM10_GETDOB (DS, FFCx, VALUE, ERROR, ERRDST)

where:
DS INTEGER*2 dataset number (1--4)
FFCx INTEGER*2 File--Card--Channel address of ANY channel
on a discrete output card (111--1668)
VALUE INTEGER*2 (0 -- 255) (channel 1 = bit 0 = lsb)
ERROR INTEGER*2 Error return code
ERRDST INTEGER*2 Destination of error messages
TEMPINT INTEGER*2 Integer to store return of function

C calling sequence and parameter description:


short sim10_getdob (&ds, ffcx, &value, &error, &errdst)

where:
ds short dataset number (1--4)
ffcx short File--Card--Channel address of ANY channel
on a discrete output card (111--1668)
value short (0 -- 255) (channel 1 = bit 0 = lsb)
error short Error return code
errdst short Destination of error messages

Original September 1995 39


UM25.0:SPE311
SIMVOX -- Version 2.3 Appendix B

Examples
FORTRAN:
integer*2 ds /1/
integer*2 error
integer*2 errdst /1/
integer*2 ffcc
integer*2 value
integer*2 tempint

...
ffcc = 456
tempint = sim10_getdob (ds, ffcc, value, error, errdst)
...
tempint = sim10_getdob (ds, 458, value, error, errdst)
...

Original September 1995 40


UM25.0:SPE311
SIMVOX -- Version 2.3 Appendix B

C:
short ds = 1;
short error;
short errdst = 1;
short ffcc;
short value;

...
ffcc = 456;
sim10_getdob (&ds, ffcc, &value, &error, &errdst);
...
sim10_getdob (&ds, 458, &value, &error, &errdst);
...

Original September 1995 41


UM25.0:SPE311
SIMVOX -- Version 2.3 Appendix B

SIM10_GETDS
Get the dataset entered on the command line.

Format
FORTRAN calling sequence and parameter description:
TEMPINT = SIM10_GETDS ()

where:
TEMPINT INTEGER*2 Integer to store return of function

C calling sequence and parameter description:


short sim10_getds ()

Original September 1995 42


UM25.0:SPE311
SIMVOX -- Version 2.3 Appendix B

Examples
FORTRAN:
integer*2 ds
integer*2 error
integer*2 errdst

...

ds = sim10_getds ()
call sim10_attach_ds (ds, error, errdst)

...

Original September 1995 43


UM25.0:SPE311
SIMVOX -- Version 2.3 Appendix B

C:

short ds;
short error
short errdst

...

ds = sim10_getds ();
sim10_attach_ds (&ds, &error, &errdst);

...

Original September 1995 44


UM25.0:SPE311
SIMVOX -- Version 2.3 Appendix B

SIM10_GET_ALL_DS
Reads the command line into an internal string if the flag argument is TRUE and returns
the first dataset. On subsequent calls, the flag argument should be FALSE. This will
return any additional datasets. If the dataset returned is zero, there are no more datasets.

Format
FORTRAN calling sequence and parameter description:
TEMPINT = SIM10_GET_ALL_DS (FLAG)

where:
FLAG INTEGER*2 Flag indicating input from command line
TEMPINT INTEGER*2 Integer to store return of function

C calling sequence and parameter description:


short sim10_get_all_ds (flag)

where:
flag short Flag indicating input from command line

Original September 1995 45


UM25.0:SPE311
SIMVOX -- Version 2.3 Appendix B

Examples
FORTRAN:
integer*2 ds1, ds2
...
ds1 = sim10_get_all_ds (.TRUE.)
ds2 = sim10_get_all_ds (.FALSE.)

Original September 1995 46


UM25.0:SPE311
SIMVOX -- Version 2.3 Appendix B

C:

short flag;
short ds1, ds2;
{
...
flag = TRUE;
/* get the command line */
/* ds1 contains the first dataset in the command line */
ds1 = sim10_get_all_ds (flag);
flag = FALSE;
/* ds2 contains the next dataset in the command line */
ds2 = sim10_get_all_ds (flag);
}

Original September 1995 47


UM25.0:SPE311
SIMVOX -- Version 2.3 Appendix B

SIM10_GETPCI
Get a pulse count input.

Format
FORTRAN calling sequence and parameter description:
CALL SIM10_GETPCI (DS, FFCC, VALUE, RATE, ERROR, ERRDST)

where:
DS INTEGER*2 dataset number (1--4)
FFCC INTEGER*2 File--Card--Channel address of pulse count
input (111--1668)
VALUE INTEGER*2 Number of raw pulses (0 -- 65,535)
RATE REAL*8 Pulses per rate period. Rate period is
declared in the UOC definition from 0.1
to 5.0
ERROR INTEGER*2 Error return code
ERRDST INTEGER*2 Destination of error messages

C calling sequence and parameter description:


sim10_getpci (&ds, ffcc, &value, &rate, &error, &errdst)

where:
ds short dataset number (1--4)
ffcc short File--Card--Channel address of pulse count
input (111--1668)
value short Number of raw pulses (0 -- 65,535)
rate double Pulses per rate period. Rate period is
declared in the UOC definition from 0.1
to 5.0
error short Error return code
errdst short Destination of error messages

Original September 1995 48


UM25.0:SPE311
SIMVOX -- Version 2.3 Appendix B

Examples
FORTRAN:
integer*2 ds /1/
integer*2 error
integer*2 errdst /1/
integer*2 ffcc
integer*2 value
real*8 rate

...
ffcc = 661
call sim10_getpci (ds, ffcc, value, rate, error, errdst)
...
call sim10_getpci (ds, 668, value, rate, error, errdst)
...

Original September 1995 49


UM25.0:SPE311
SIMVOX -- Version 2.3 Appendix B

C:
short ds = 1;
short error;
short errdst = 1;
short ffcc;
short value;
double rate;

...
ffcc = 641;
sim10_getpci (&ds, ffcc, &value, &rate, &error, &errdst);
...
sim10_getpci (&ds, 648, &value, &rate, &error, &errdst);
...

Original September 1995 50


UM25.0:SPE311
SIMVOX -- Version 2.3 Appendix B

SIM10_LOOP
Tieback a loop analog output to analog input without any lag.

Format
FORTRAN calling sequence and parameter description:
CALL SIM10_LOOP (DS, PV, VO, GAIN, REVACT, ERRDST)

where:
DS INTEGER*2 Dataset number (1--4)
PV INTEGER*2 File--Card--Channel address of process
variable or analog input (111--1668)
VO INTEGER*2 File--Card--Channel address of the valve
output or analog output (111--1668)
GAIN REAL*8 Loop sensitivity (average = 1.0)
REVACT INTEGER*2 0 for a direct--acting loop; 1 for a
reverse--acting loop
ERRDST INTEGER*2 Destination of error messages

C calling sequence and parameter description:


sim10_loop (&ds, pv, vo, gain, revact, &errdst)

where:
ds short Dataset number (1--4)
pv short File--Card--Channel address of process
variable or analog input (111--1668)
vo short File--Card--Channel address of the valve
output or analog output (111--1668)
gain double Loop sensitivity (average = 1.0)
revact short 0 for a direct--acting loop; 1 for a
reverse--acting loop
errdst short Destination of error messages

Original September 1995 51


UM25.0:SPE311
SIMVOX -- Version 2.3 Appendix B

Examples
FORTRAN:
integer*2 ds /1/
integer*2 errdst /1/
integer*2 pv
integer*2 vo
real*8 gain
integer*2 revact

...
pv = 721
vo = 722
gain = 1.0
revact = 0
call sim10_loop (ds, pv, vo, gain, revact, errdst)
...

Original September 1995 52


UM25.0:SPE311
SIMVOX -- Version 2.3 Appendix B

C:
short ds = 1;
short errdst = 1;
short pv;
short vo;
double gain;
short revact;

...
pv = 721;
vo = 722;
gain = 1.0;
revact = 0;
sim10_loop (&ds, pv, vo, gain, revact, &errdst);
...

Original September 1995 53


UM25.0:SPE311
SIMVOX -- Version 2.3 Appendix B

SIM10_NOTE
Post a note to the message box.

Format
FORTRAN calling sequence and parameter description:
CALL SIM10_NOTE (NOTE)

where:
NOTE CHARACTER*(*) Note to be displayed

C calling sequence and parameter description:


sim10_note (note)

where:
note char[] Note to be displayed

Original September 1995 54


UM25.0:SPE311
SIMVOX -- Version 2.3 Appendix B

Examples
FORTRAN:

call sim10_note(Point found)

Original September 1995 55


UM25.0:SPE311
SIMVOX -- Version 2.3 Appendix B

C:
sim10_note(Point found);

Original September 1995 56


UM25.0:SPE311
SIMVOX -- Version 2.3 Appendix B

SIM10_SETAIC
Set an analog input in counts.

Format
FORTRAN calling sequence and parameter description:
TEMPINT = SIM10_SETAIC (DS, FFCC, VALUE, ERROR, ERRDST)

where:
DS INTEGER*2 dataset number (1--4)
FFCC INTEGER*2 File--Card--Channel address of analog input
(111--1668)
VALUE INTEGER*2 Number of counts (0--4095, or --32768 to
+32767 for WSI)
ERROR INTEGER*2 Error return code
ERRDST INTEGER*2 Destination of error messages
TEMPINT INTEGER*2 Integer to store return of function

C calling sequence and parameter description:


short sim10_setaic (&ds, ffcc, &value, &error, &errdst)

where:
ds short dataset number (1--4)
ffcc short File--Card--Channel address of analog input
(111--1668)
value short Number of counts (0--4095, or --32768 to
+32767 for WSI)
error short Error return code
errdst short Destination of error messages

Original September 1995 57


UM25.0:SPE311
SIMVOX -- Version 2.3 Appendix B

Examples
FORTRAN:
integer*2 ds /1/
integer*2 error
integer*2 errdst /1/
integer*2 ffcc
integer*2 value
integer*2 tempint

...
ffcc = 1222
value = 520
tempint = sim10_setaic (ds, ffcc, value, error, errdst)
...
tempint = sim10_setaic (ds, 1212, value, error, errdst)
...

Original September 1995 58


UM25.0:SPE311
SIMVOX -- Version 2.3 Appendix B

C:
short ds = 1;
short error;
short errdst = 1;
short ffcc;
short value;

...
ffcc = 1222;
value = 520;
sim10_setaic (&ds, ffcc, &value, &error, &errdst);
...
sim10_setaic (&ds, 1212, &value, &error, &errdst);
...

Original September 1995 59


UM25.0:SPE311
SIMVOX -- Version 2.3 Appendix B

SIM10_SETAIE
Set the engineering unit value of the AI point specified by the file--card--channel.

Format
FORTRAN calling sequence and parameter description:
TEMPREAL = SIM10_SETAIE (DS, FFCC, VALUE, EUHIGH, EUHIGH, EULOW, ERRDST)

where:
DS INTEGER*2 dataset number (1--4)
FFCC INTEGER*2 File--Card--Channel address of analog input
(111--1668)
VALUE REAL*8 Value read in engineering units of the AI
point
EUHIGH REAL*8 High engineering units of the point
EULOW REAL*8 Low engineering units of the point
ERROR INTEGER*2 Error return code
ERRDST INTEGER*2 Destination of error messages
TEMPREAL REAL*8 Real to store return of function

C calling sequence and parameter description:


double sim10_setaie (&ds, fcc, &value, euhigh, eulow, &error, &errdst)

where:
ds short dataset number (1--4)
fcc short File--Card--Channel address of analog
input (111--1668)
value double Value read in engineering units of the AI
point
euhigh double High engineering units of the point
eulow double Low engineering units of the point
error short Error return code
errdst short Destination of error messages

Original September 1995 60


UM25.0:SPE311
SIMVOX -- Version 2.3 Appendix B

Examples
FORTRAN:
integer*2 ds /1/
integer*2 error
integer*2 errdst /1/
integer*2 ffcc
real*8 value
real*8 euhigh
real*8 eulow
real*8 tempreal
...
ffcc = 538
value = 30.0
euhigh = 0
eulow = 0
tempreal = sim10_setaie (ds, ffcc, value, euhigh, eulow, error, errdst)
...
tempreal = sim10_setaie (ds, 512, value, euhigh, eulow, error, errdst)
...

Original September 1995 61


UM25.0:SPE311
SIMVOX -- Version 2.3 Appendix B

C:
short ds = 1;
short error;
short errdst = 1;
short ffcc;
double value;
double euhigh;
double eulow;

...
ffcc = 1212;
value = 55.0;
euhigh = 100.0;
eulow = 0.0;
sim10_setaie (&ds, ffcc, &value, &error, &euhigh, &eulow, &errdst);
...
sim10_setaie (&ds, 1212, &value, &error, &euhigh, &eulow, &errdst);
...

Original September 1995 62


UM25.0:SPE311
SIMVOX -- Version 2.3 Appendix B

SIM10_SETAIP
Set an analog input in percent.

Format
FORTRAN calling sequence and parameter description:
TEMPREAL = SIM10_SETAIP (DS, FFCC, VALUE, ERROR, ERRDST)

where:
DS INTEGER*2 dataset number (1--4)
FFCC INTEGER*2 File--Card--Channel address of analog input
(111--1668)
VALUE REAL*8 Percent (--25.0 to +100.0 or 0.0 to
+125.0 or --128.0 to +127.996) depending
on card type
ERROR INTEGER*2 Error return code
ERRDST INTEGER*2 Destination of error messages
TEMPREAL REAL*8 Real to store return of function

C calling sequence and parameter description:


double sim10_setaip (&ds, ffcc, &value, &error, &errdst)

where:
ds short dataset number (1--4)
ffcc short File--Card--Channel address of analog input
(111--1668)
value double Percent (--25.0 to +100.0 or 0.0 to
+125.0 or --128.0 to +127.996) depending
on card type
error short Error return code
errdst short Destination of error messages

Original September 1995 63


UM25.0:SPE311
SIMVOX -- Version 2.3 Appendix B

Examples
FORTRAN:
integer*2 ds /1/
integer*2 error
integer*2 errdst /1/
integer*2 ffcc
real*8 value
real*8 tempreal

...
ffcc = 513
value = 30.0
tempreal = sim10_setaip (ds, ffcc, value, error, errdst)
...
tempreal = sim10_setaip (ds, 512, value, error, errdst)
...

Original September 1995 64


UM25.0:SPE311
SIMVOX -- Version 2.3 Appendix B

C:
short ds = 1;
short error;
short errdst = 1;
short ffcc;
double value;

...
ffcc = 513;
value = 30.0;
sim10_setaip (&ds, ffcc, &value, &error, &errdst);
...
sim10_setaip (&ds, 518, &value, &error, &errdst);
...

Original September 1995 65


UM25.0:SPE311
SIMVOX -- Version 2.3 Appendix B

SIM10_SETDI
Set a discrete input channel.

Format
FORTRAN calling sequence and parameter description:
TEMPINT = SIM10_SETDI (DS, FFCC, VALUE, ERROR, ERRDST)

where:
DS INTEGER*2 dataset number (1--4)
FFCC INTEGER*2 File--Card--Channel address of discrete
input (111--1668)
VALUE INTEGER*2 (0 -- 1)
ERROR INTEGER*2 Error return code
ERRDST INTEGER*2 Destination of error messages
TEMPINT INTEGER*2 Integer to store return of function

C calling sequence and parameter description:


short sim10_setdi (&ds, ffcc, &value, &error, &errdst)

where:
ds short dataset number (1--4)
ffcc short File--Card--Channel address of discrete
input (111--1668)
value short (0 -- 1)
error short Error return code
errdst short Destination of error messages

Original September 1995 66


UM25.0:SPE311
SIMVOX -- Version 2.3 Appendix B

Examples
FORTRAN:
integer*2 ds /1/
integer*2 error
integer*2 errdst /1/
integer*2 ffcc
integer*2 value
integer*2 tempint

...
ffcc = 241
value = 1
tempint = sim10_setdi (ds, ffcc, value, error, errdst)
...
tempint = sim10_setdi (ds, 215, value, error, errdst)
...

Original September 1995 67


UM25.0:SPE311
SIMVOX -- Version 2.3 Appendix B

C:
short ds = 1;
short error;
short errdst = 1;
short ffcc;
short value;

...
ffcc = 261;
value = 1;
sim10_setdi (&ds, ffcc, &value, &error, &errdst);
...
sim10_setdi (&ds, 265, &value, &error, &errdst);
...

Original September 1995 68


UM25.0:SPE311
SIMVOX -- Version 2.3 Appendix B

SIM10_SETDIB
Set a group of 8 discrete inputs on a single card.

Format
FORTRAN calling sequence and parameter description:
TEMPINT = SIM10_SETDIB (DS, FFCx, VALUE, ERROR, ERRDST)

where:
DS INTEGER*2 dataset number (1--4)
FFCx INTEGER*2 File--Card--Channel address of ANY channel
on a discrete input card (111--1668)
VALUE INTEGER*2 (0 -- 255) (channel 1 = bit 0 = lsb)
ERROR INTEGER*2 Error return code
ERRDST INTEGER*2 Destination of error messages
TEMPINT INTEGER*2 Integer to store return of function

C calling sequence and parameter description:


short sim10_setdib (&ds, ffcx, &value, &error, &errdst)

where:
ds short dataset number (1--4)
ffcx short File--Card--Channel address of ANY channel
on a discrete input card (111--1668)
value short (0 -- 255) (channel 1 = bit 0 = lsb)
error short Error return code
errdst short Destination of error messages

Original September 1995 69


UM25.0:SPE311
SIMVOX -- Version 2.3 Appendix B

Examples
FORTRAN:
integer*2 ds /1/
integer*2 error
integer*2 errdst /1/
integer*2 ffcc
integer*2 value
integer*2 tempint

...
ffcc = 1124
value = 9507
tempint = sim10_setdib (ds, ffcc, value, error, errdst)
...
tempint = sim10_setdib (ds, 1125, value, error, errdst)
...

Original September 1995 70


UM25.0:SPE311
SIMVOX -- Version 2.3 Appendix B

C:
short ds = 1;
short error;
short errdst = 1;
short ffcc;
short value;

...
ffcc = 1144;
value = 9507;
sim10_setdib (&ds, ffcc, &value, &error, &errdst);
...
sim10_setdib (&ds, 1134, &value, &error, &errdst);
...

Original September 1995 71


UM25.0:SPE311
SIMVOX -- Version 2.3 Appendix B

SIM10_SETPCI
Set a pulse count input.

Format
FORTRAN calling sequence and parameter description:
CALL SIM10_SETPCI (DS, FFCC, VALUE, RATE_P, ERROR, ERRDST, INDEX)

where:
DS INTEGER*2 dataset number (1--4)
FFCC INTEGER*2 File--Card--Channel address of pulse count
input (111--1668)
VALUE INTEGER*2 Number of raw pulses (0 -- 65,535)
RATE_P REAL*8 PCI rate period as declared in the
UOC/IFC definition from 0.1 to 5.0
ERROR INTEGER*2 Error return code
ERRDST INTEGER*2 Destination of error messages
INDEX INTEGER*2 A unique number between 1 and 255

C calling sequence and parameter description:


sim10_setpci (&ds, ffcc, &value, &rate, &error, &errdst, index)

where:
ds short dataset number (1--4)
ffcc short File--Card--Channel address of pulse count
input (1668)
value short Number of raw pulses (0 -- 65,535)
rate_p double PCI rate period as declared in the
UOC/IFC definition from 0.1 to 5.0
error short Error return code
errdst short Destination of error messages
index short A unique number between 1 and 255

Original September 1995 72


UM25.0:SPE311
SIMVOX -- Version 2.3 Appendix B

Examples
FORTRAN:
integer*2 ds /1/
integer*2 error
integer*2 errdst /1/
integer*2 value
integer*2 inc
real*8 rate_p

...
inc = 55
rate_p = 1.0
value = 0

WHILE (.TRUE.)
...
value = value + inc
call sim10_setpci (ds, 363, value, rate_p, error, errdst, 72)

...
ENDWHILE

Original September 1995 73


UM25.0:SPE311
SIMVOX -- Version 2.3 Appendix B

C:
short ds = 1;
short error;
short errdst = 1;
short value;
double rate_p;
short inc;

...
value = 0;
rate_p = 1.0;
...

while (TRUE) {

...
value += inc;
sim10_setpci (&ds, 443, &value, &rate_p, &error, &errdst, 10);
...
}

Original September 1995 74


UM25.0:SPE311
SIMVOX -- Version 2.3 Appendix B

SIM10_SLEEP
This function is not supported in SIMVOX for Windows NT. It is provided for
compatability with existing code. It simply delays for 1 second before returning.

Format
FORTRAN calling sequence and parameter description:
CALL SIM10_SLEEP ()

C calling sequence and parameter description:


sim10_sleep ()

Original September 1995 75


UM25.0:SPE311
SIMVOX -- Version 2.3 Appendix B

Examples
FORTRAN:

while (.TRUE.)
...

call sim10_sleep ()
endwhile

Original September 1995 76


UM25.0:SPE311
SIMVOX -- Version 2.3 Appendix B

C:

call sim10_wakeup ( ... )


while (TRUE)
{
...

sim10_sleep ();
}

Original September 1995 77


UM25.0:SPE311
SIMVOX -- Version 2.3 Appendix B

SIM10_WAKEUP
This function is not supported in SIMVOX for Windows NT. It is provided for
compatability with existing code.

Original September 1995 78


UM25.0:SPE311
Appendix C

SIMVOX Library Subroutines


ALLEN BRADLEY
PLC--3 & PLC--5
This page intentionally blank
SIMVOX -- Version 2.3 Appendix C

LIBRARY INDEX
sim_ab_attach_ds (ds, error, errdst)
sim_ab_attach_multi_ds (ds, error, errdst)

sim_ab_dcd (ds, template, output, input, dcdnum, error, errdst, trantime,


tranpv)

sim_ab_delay (sec)

sim_ab_getaic (ds, addr, value, error, errdst)

sim_ab_getaie (ds, addr, value, euhigh, eulow, error, errdst)

sim_ab_getaip (ds, addr, value, error, errdst)

sim_ab_getaoc (ds, addr, value, error, errdst)

sim_ab_getaop (ds, addr, value, error, errdst)

sim_ab_getdi (ds, addr, value, error, errdst)

sim_ab_getdib (ds, addr, value, error, errdst)

sim_ab_getdo (ds, addr, value, error, errdst)

sim_ab_getdob (ds, addr, value, error, errdst)

sim_ab_getds ()
sim_ab_get_all_ds (flag)

sim_ab_loop (ds, pv, vo, gain, revact, errdst)

sim_ab_note (note)

sim_ab_setaic (ds, addr, value, error, errdst)

sim_ab_setaie (ds, addr, value, euhigh, eulow, error, errdst)

sim_ab_setaip (ds, addr, value, error, errdst)

sim_ab_setdi (ds, addr, value, error, errdst)

sim_ab_setdib (ds, addr, value, error, errdst)

sim_ab_sleep ()

sim_ab_wakeup (number, units, error)

Original September 1995 1


UM25.0:SPE311
SIMVOX -- Version 2.3 Appendix C

This page intentionally blank

Original September 1995 2


UM25.0:SPE311
SIMVOX -- Version 2.3 Appendix C

SIM_AB_ATTACH_DS
Attach to a dataset. All programs must use this function to attach to a dataset. SIMVOX
calls do not work correctly without it. Attaching is done prior to all other SIMVOX calls
except sim_ab_getds and sim_ab_get_all_ds.

Format
FORTRAN calling sequence and parameter description:
CALL SIM_AB_ATTACH_DS (DS, ERROR, ERRDST)

where:
DS INTEGER*4 Dataset number (1--4)
ERROR INTEGER*4 Error return value
ERRDST INTEGER*4 Destination of error messages

C calling sequence and parameter description:


sim_ab_attach_ds (&ds, &error, &errdst);

where:
ds long Dataset number (1--4)
error long Error return value
errdst long Destination of error messages

Original September 1995 1


UM25.0:SPE311
SIMVOX -- Version 2.3 Appendix C

Examples
FORTRAN:
integer*4 ds /1/
integer*4 error
integer*4 errdst /1/

...
call sim_ab_attach_ds (ds, error, errdst)
...

Original September 1995 2


UM25.0:SPE311
SIMVOX -- Version 2.3 Appendix C

C:
long ds = 1;
long error;
long errdst = 1;

...
sim_ab_attach_ds (&ds, &error, &errdst);
...

Original September 1995 3


UM25.0:SPE311
SIMVOX -- Version 2.3 Appendix C

SIM_AB_ATTACH_MULTI_DS
Attach to multiple datasets. Gets all the datasets on the command line and attaches to
those datasets. Stores the attached datasets in the dataset array provided as the first
parameter.

Format
FORTRAN calling sequence and parameter description:
CALL SIM_AB_ATTACH_MULTI_DS (DS, ERROR, ERRDST)

where:
DS(4) INTEGER*4 Dataset array
ERROR INTEGER*4 Error return value
ERRDST INTEGER*4 Destination of error messages

C calling sequence and parameter description:


sim_ab_attach_multi_ds (ds, &error, &errdst);

where:
ds[4] long Dataset array
error long Error return value
errdst long Destination of error messages

Original September 1995 4


UM25.0:SPE311
SIMVOX -- Version 2.3 Appendix C

Examples
FORTRAN:
integer*4 ds(4)
integer*4 error
integer*4 errdst /1/
...
call sim_ab_attach_multi_ds (ds, error, errdst)
...

Original September 1995 5


UM25.0:SPE311
SIMVOX -- Version 2.3 Appendix C

C:
long ds [4];
long error;
long errdst = 1;

...
sim_ab_attach_multi_ds (ds, &error, &errdst);
...

Original September 1995 6


UM25.0:SPE311
SIMVOX -- Version 2.3 Appendix C

SIM_AB_DCD
Tieback DCD output patterns to input patterns. This function is called once for each
DCD to be resolved by the tieback program. SIMVOX Tools option allows automatic
creation of tieback programs.

Format
FORTRAN calling sequence and parameter description:
CALL SIM_AB_DCD (DS, TEMPLATE, OUTPUT, INPUT, DCDNUM, ERROR, ERRDST, TRANTIME,
TRANPV)

where:
DS INTEGER*4 Dataset number (1--4)
TEMPLATE(35) INTEGER*4 Thirty--five element array containing the
DCD template
OUTPUT (8) CHARACTER*10 Eight element array containing the
Addresses of the outputs
INPUT (16) CHARACTER*10 Sixteen element array containing the
Addresses of the inputs
DCDNUM INTEGER*4 Sequence number of the DCD (1--128)
ERROR INTEGER*4 Error return code
ERRDST INTEGER*4 Destination of error messages
TRANTIME INTEGER*4 Number of seconds to wait before setting
up the new PV on the inputs after a new
SP appears on the outputs
TRANPV INTEGER*4 PV to set up on the inputs during the
transition time (--32768 to +32767)

Original September 1995 7


UM25.0:SPE311
SIMVOX -- Version 2.3 Appendix C

C calling sequence and parameter description:


sim_ab_dcd (&ds, template, output, input, dcdnum, &error, &errdst, trantime, tranpv)

where:
ds long Dataset number (1--4)
template long[35] Thirty--five element array containing the
DCD template
output char[10][8] Eight element array containing the
Addresses of the outputs
input char[10][16] Sixteen element array containing the
Addresses of the inputs
dcdnum long Sequence number of the DCD (1--128)
error long Error return code
errdst long Destination of error messages
trantime long Number of seconds to wait before setting
up the new PV on the inputs after a new
SP appears on the outputs
tranpv long PV to set up on the inputs during the
transition time (--32768 to +32767)

The template used is defined as follows:

TEMPLATE (1) Number of setpoints (1--16)


(2) Number of outputs (1--8)
(3) Number of inputs (1--16)
(4--19) Discrete output patterns for each of the
16 possible setpoints (0--255)
(20--35) Discrete input patterns for each of the
16 possible setpoints (--32768 to +32767)

Original September 1995 8


UM25.0:SPE311
SIMVOX -- Version 2.3 Appendix C

Examples
FORTRAN:
integer*4 ds /1/
integer*4 error
integer*4 errdst /1/
integer*4 dcdnum
integer*4 trantime
integer*4 tranpv

character*10 dcd_output (8 )
character*10 dcd_input (16)
integer*4 template (35)

data dcd_output /O:16/15,0,0,0,0,0,0,0/


data dcd_input /I:16/15,I:16/14,0,0,0,0,0,0,8*0/

data template /2,1,2,


1,0,14*0,
1,2,14*0/

...

trantime = 0
tranpv = 0
while (.TRUE.)
call sim_ab_dcd (ds, template, dcd_output, dcd_input, 1, error, errdst, trantime,
tranpv)

...

endwhile

Original September 1995 9


UM25.0:SPE311
SIMVOX -- Version 2.3 Appendix C

C:
long ds = 1;
long error;
long errdst = 1;
long dcdnum;
long trantime;
long tranpv;

char *dcd_output [] = {O:23/2, 0, 0, 0, 0, 0, 0,


0 };
char *dcd_input [] = {I22/1, I:22/2, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0};

long template [35] = {2, 1, 2,


1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};

...

trantime = 0;
tranpv = 0;
while (TRUE)
{
sim_ab_dcd(&ds, template, dcd_output, dcd_input, 1, &error, &errdst, trantime,
tranpv);

...

Original September 1995 10


UM25.0:SPE311
SIMVOX -- Version 2.3 Appendix C

SIM_AB_DELAY
Put calling process to sleep for the specified amount of time. The time is specified in
seconds.

Format
FORTRAN calling sequence and parameter description:
CALL SIM_AB_DELAY (SEC)

where:
SEC REAL Number of seconds to delay

C calling sequence and parameter description:


sim_ab_delay (&sec)

where:
sec double Real Number of seconds to delay

Original September 1995 11


UM25.0:SPE311
SIMVOX -- Version 2.3 Appendix C

Examples
FORTRAN:

real*8 delay /5.0/

...

while (.TRUE.)
...

...

call sim_ab_delay (delay)


endwhile

Original September 1995 12


UM25.0:SPE311
SIMVOX -- Version 2.3 Appendix C

C:

double delay = 5.0;

...

while (TRUE)
{
...

sim_ab_delay (&delay);
}

Original September 1995 13


UM25.0:SPE311
SIMVOX -- Version 2.3 Appendix C

SIM_AB_GETAIC
Get an analog input in counts.

Format
FORTRAN calling sequence and parameter description:
TEMPINT = SIM_AB_GETAIC (DS, ADDR, VALUE, ERROR, ERRDST)

where:
DS INTEGER*4 dataset number (1--4)
ADDR CHARACTER*(*) Address of analog input
VALUE INTEGER*4 Number of counts (0--4095, or --32768 to
+32767 for WSI)
ERROR INTEGER*4 Error return code
ERRDST INTEGER*4 Destination of error messages
TEMPINT INTEGER*4 Integer to store return of function

C calling sequence and parameter description:


long sim_ab_getaic (&ds, addr, &value, &error, &errdst)

where:
ds long dataset number (1--4)
addr char[] Address of analog input
value long Number of counts (0--4095, or --32768 to
+32767 for WSI)
error long Error return code
errdst long Destination of error messages

Original September 1995 14


UM25.0:SPE311
SIMVOX -- Version 2.3 Appendix C

Examples
FORTRAN:
integer*4 ds /1/
integer*4 error
integer*4 errdst /1/
integer*4 value
integer*4 tempint

...
tempint = sim_ab_getaic (ds, N13:890, value, error, errdst)
...

Original September 1995 15


UM25.0:SPE311
SIMVOX -- Version 2.3 Appendix C

C:
long ds = 1;
long error;
long errdst = 1;
long value;

...
sim_ab_getaic (&ds, N14:5, &value, &error, &errdst);
...

Original September 1995 16


UM25.0:SPE311
SIMVOX -- Version 2.3 Appendix C

SIM_AB_GETAIE
Get the engineering unit value of the AI point specified.

Format
FORTRAN calling sequence and parameter description:
TEMPREAL = SIM_AB_GETAIE (DS, ADDR, VALUE, EUHIGH, EUHIGH, EULOW, ERRDST)

where:
DS INTEGER*4 dataset number (1--4)
ADDR CHARACTER*(*) Address of analog input
VALUE REAL*8 Value read in engineering units of the AI
point
EUHIGH REAL*8 High engineering units of the point
EULOW REAL*8 Low engineering units of the point
ERROR INTEGER*4 Error return code
ERRDST INTEGER*4 Destination of error messages
TEMPREAL REAL*8 Real to store return of function

C calling sequence and parameter description:


double sim_ab_getaie (&ds, addr, &value, euhigh, eulow, &error, &errdst)

where:
ds long dataset number (1--4)
addr char[] Address of analog input
value double Value read in engineering units of the AI point
euhigh double High engineering units of the point
eulow double Low engineering units of the point
error long Error return code
errdst long Destination of error messages

Original September 1995 17


UM25.0:SPE311
SIMVOX -- Version 2.3 Appendix C

Examples
FORTRAN:
integer*4 ds /1/
integer*4 error
integer*4 errdst /1/
real*8 value
real*8 euhigh
real*8 eulow
real*8 tempreal
...
value = 0
euhigh = 0
eulow = 0
...
tempreal = sim_ab_getaie (ds, N89:67, value, euhigh, eulow, error, errdst)
...

Original September 1995 18


UM25.0:SPE311
SIMVOX -- Version 2.3 Appendix C

C:
long ds = 1;
long error;
long errdst = 1;
char addr[80];
double value;
double euhigh;
double eulow;

...
strcpy (addr, N16:64);
value = 55.0;
euhigh = 100.0;
eulow = 0.0;
sim_ab_getaie (&ds, addr, &value, &error, &euhigh, &eulow, &errdst);
...
sim_ab_getaie (&ds, N15:65, &value, &error, &euhigh, &eulow, &errdst);
...

Original September 1995 19


UM25.0:SPE311
SIMVOX -- Version 2.3 Appendix C

SIM_AB_GETAIP
Get an analog input in percent.

Format
FORTRAN calling sequence and parameter description:
TEMPREAL = SIM_AB_GETAIP (DS, ADDR, VALUE, ERROR, ERRDST)

where:
DS INTEGER*4 dataset number (1--4)
ADDR CHARACTER*(*) Address of analog input
VALUE REAL*8 Percent (--25.0 to +100.0 or 0.0 to
+125.0 or --128.0 to +127.996) depending
on card type
ERROR INTEGER*4 Error return code
ERRDST INTEGER*4 Destination of error messages
TEMPREAL REAL*8 Real to store return of function

C calling sequence and parameter description:


double sim_ab_getaip (&ds, addr, &value, &error, &errdst)

where:
ds long dataset number (1--4)
addr char[] Address of analog input
value double Percent (--25.0 to +100.0 or 0.0 to
+125.0 or --128.0 to +127.996) depending
on card type
error long Error return code
errdst long Destination of error messages

Original September 1995 20


UM25.0:SPE311
SIMVOX -- Version 2.3 Appendix C

Examples
FORTRAN:
integer*4 ds /1/
integer*4 error
integer*4 errdst /1/
character*80 addr
real*8 value
real*8 tempreal

...
write (addr, (1X, A)) N64:13
tempreal = sim_ab_getaip (ds, addr, value, error, errdst)
...
tempreal = sim_ab_getaip (ds, N65:12, value, error, errdst)
...

Original September 1995 21


UM25.0:SPE311
SIMVOX -- Version 2.3 Appendix C

C:
long ds = 1;
long error;
long errdst = 1;
char addr[80];
double value;

...
strcpy (addr, N9:144);
sim_ab_getaip (&ds, addr, &value, &error, &errdst);
...
sim_ab_getaip (&ds, N12:54, &value, &error, &errdst);
...

Original September 1995 22


UM25.0:SPE311
SIMVOX -- Version 2.3 Appendix C

SIM_AB_GETAOC
Get an analog output in counts.

Format
FORTRAN calling sequence and parameter description:
TEMPINT = SIM_AB_GETAOC (DS, ADDR, VALUE, ERROR, ERRDST)

where:
DS INTEGER*4 dataset number (1--4)
ADDR CHARACTER*(*) Address of analog output
VALUE INTEGER*4 Number of counts (0--4095)
ERROR INTEGER*4 Error return code
ERRDST INTEGER*4 Destination of error messages
TEMPINT INTEGER*4 Integer to store return of function

C calling sequence and parameter description:


long sim_ab_getaoc (&ds, addr, &value, &error, &errdst)

where:
ds long dataset number (1--4)
addr char[] Address of analog output
value long Number of counts (0--4095)
error long Error return code
errdst long Destination of error messages

Original September 1995 23


UM25.0:SPE311
SIMVOX -- Version 2.3 Appendix C

Examples
FORTRAN:
integer*4 ds /1/
integer*4 error
integer*4 errdst /1/
character*80 addr
integer*4 value
integer*4 tempint

...
write (addr, (1X, A)) N24:13
tempint = sim_ab_getaoc (ds, addr, value, error, errdst)
...
tempint = sim_ab_getaoc (ds, N98:998, value, error, errdst)
...

Original September 1995 24


UM25.0:SPE311
SIMVOX -- Version 2.3 Appendix C

C:
long ds = 1;
long error;
long errdst = 1;
char addr[80];
long value;

...
strcpy (addr, N23:228);
sim_ab_getaoc (&ds, addr, &value, &error, &errdst);
...
sim_ab_getaoc (&ds, N43:54, &value, &error, &errdst);
...

Original September 1995 25


UM25.0:SPE311
SIMVOX -- Version 2.3 Appendix C

SIM_AB_GETAOP
Get an analog output in percent.

Format
FORTRAN calling sequence and parameter description:
TEMPREAL = SIM_AB_GETAOP (DS, ADDR, VALUE, ERROR, ERRDST)

where:
DS INTEGER*4 dataset number (1--4)
ADDR CHARACTER*(*) Address of analog output
VALUE REAL*8 Percent (--25.0 to +100.0)
ERROR INTEGER*4 Error return code
ERRDST INTEGER*4 Destination of error messages
TEMPREAL REAL*8 Real to store return of function

C calling sequence and parameter description:


double sim_ab_getaop (&ds, addr, &value, &error, &errdst)

where:
ds long dataset number (1--4)
addr char[] Address of analog output
value double Percent (--25.0 to +100.0)
error long Error return code
errdst long Destination of error messages

Original September 1995 26


UM25.0:SPE311
SIMVOX -- Version 2.3 Appendix C

Examples
FORTRAN:
integer*4 ds /1/
integer*4 error
integer*4 errdst /1/
character*80 addr
real*8 value
real*8 tempreal

...
write (addr, (1X, A)) N68:65
tempreal = sim_ab_getaop (ds, addr, value, error, errdst)
...
tempreal = sim_ab_getaop (ds, N10:10, value, error, errdst)
...

Original September 1995 27


UM25.0:SPE311
SIMVOX -- Version 2.3 Appendix C

C:
long ds = 1;
long error;
long errdst = 1;
char addr[80];
double value;

...
strcpy (addr, N12:312);
sim_ab_getaop (&ds, addr, &value, &error, &errdst);
...
sim_ab_getaop (&ds, N32:316, &value, &error, &errdst);
...

Original September 1995 28


UM25.0:SPE311
SIMVOX -- Version 2.3 Appendix C

SIM_AB_GETDI
Get a discrete input.

Format
FORTRAN calling sequence and parameter description:
TEMPINT = SIM_AB_GETDI (DS, ADDR, VALUE, ERROR, ERRDST)

where:
DS INTEGER*4 dataset number (1--4)
ADDR CHARACTER*(*) Address of discrete input
VALUE INTEGER*4 (0 -- 1)
ERROR INTEGER*4 Error return code
ERRDST INTEGER*4 Destination of error messages
TEMPINT INTEGER*4 Integer to store return of function

C calling sequence and parameter description:


long sim_ab_getdi (&ds, addr, &value, &error, &errdst)

where:
ds long dataset number (1--4)
addr char[] Address of discrete input
value long (0 -- 1)
error long Error return code
errdst long Destination of error messages

Original September 1995 29


UM25.0:SPE311
SIMVOX -- Version 2.3 Appendix C

Examples
FORTRAN:
integer*4 ds /1/
integer*4 error
integer*4 errdst /1/
character*80 addr
integer*4 value
integer*4 tempint

...
write (addr, (1X, A)) I:10/2
tempint = sim_ab_getdi (ds, addr, value, error, errdst)
...
tempint = sim_ab_getdi (ds, I:10/3, value, error, errdst)
...

Original September 1995 30


UM25.0:SPE311
SIMVOX -- Version 2.3 Appendix C

C:
long ds = 1;
long error;
long errdst = 1;
char addr[80];
long value;

...
strcpy (addr, I:11/4);
sim_ab_getdi (&ds, addr, &value, &error, &errdst);
...
sim_ab_getdi (&ds, I:8/5, &value, &error, &errdst);
...

Original September 1995 31


UM25.0:SPE311
SIMVOX -- Version 2.3 Appendix C

SIM_AB_GETDIB
Get a group of 8 discrete inputs on a single card.

Format
FORTRAN calling sequence and parameter description:
TEMPINT = SIM_AB_GETDIB (DS, ADDR, VALUE, ERROR, ERRDST)

where:
DS INTEGER*4 dataset number (1--4)
ADDR CHARACTER*(*) Address of ANY channel
on a discrete input card
VALUE INTEGER*4 (0 -- 255) (channel 1 = bit 0 = lsb)
ERROR INTEGER*4 Error return code
ERRDST INTEGER*4 Destination of error messages
TEMPINT INTEGER*4 Integer to store return of function

C calling sequence and parameter description:


long sim_ab_getdib (&ds, addr, &value, &error, &errdst)

where:
ds long dataset number (1--4)
addr char[] Address of ANY channel
on a discrete input card
value long (0 -- 255) (channel 1 = bit 0 = lsb)
error long Error return code
errdst long Destination of error messages

Original September 1995 32


UM25.0:SPE311
SIMVOX -- Version 2.3 Appendix C

Examples
FORTRAN:
integer*4 ds /1/
integer*4 error
integer*4 errdst /1/
character*80 addr
integer*4 value
integer*4 tempint

...
write (addr, (1X, A)) I:10/2
tempint = sim_ab_getdib (ds, addr, value, error, errdst)
...
tempint = sim_ab_getdib (ds, I:12/2, value, error, errdst)
...

Original September 1995 33


UM25.0:SPE311
SIMVOX -- Version 2.3 Appendix C

C:
long ds = 1;
long error;
long errdst = 1;
char addr[80];
long value;

...
strcpy (addr, I:3/1);
sim_ab_getdib (&ds, addr, &value, &error, &errdst);
...
sim_ab_getdib (&ds, I:4/2, &value, &error, &errdst);
...

Original September 1995 34


UM25.0:SPE311
SIMVOX -- Version 2.3 Appendix C

SIM_AB_GETDO
Get a discrete output.

Format
FORTRAN calling sequence and parameter description:
TEMPINT = SIM_AB_GETDO (DS, ADDR, VALUE, ERROR, ERRDST)

where:
DS INTEGER*4 dataset number (1--4)
ADDR CHARACTER*(*) Address of discrete output
VALUE INTEGER*4 (0 -- 1)
ERROR INTEGER*4 Error return code
ERRDST INTEGER*4 Destination of error messages
TEMPINT INTEGER*4 Integer to store return of function

C calling sequence and parameter description:


long sim_ab_getdo (&ds, addr, &value, &error, &errdst)

where:
ds long dataset number (1--4)
addr char[] Address of discrete output
value long (0 -- 1)
error long Error return code
errdst long Destination of error messages

Original September 1995 35


UM25.0:SPE311
SIMVOX -- Version 2.3 Appendix C

Examples
FORTRAN:
integer*4 ds /1/
integer*4 error
integer*4 errdst /1/
character*80 addr
integer*4 value
integer*4 tempint

...
write (addr, (1X, A)) O:10/2
tempint = sim_ab_getdo (ds, addr, value, error, errdst)
...
tempint = sim_ab_getdo (ds, O:12/4, value, error, errdst)
...

Original September 1995 36


UM25.0:SPE311
SIMVOX -- Version 2.3 Appendix C

C:
long ds = 1;
long error;
long errdst = 1;
char addr[80];
long value;

...
strcpy (addr, O:14/2);
sim_ab_getdo (&ds, addr, &value, &value, &error, &errdst);
...
sim_ab_getdo (&ds, O:14/1, &value, &value, &error, &errdst);
...

Original September 1995 37


UM25.0:SPE311
SIMVOX -- Version 2.3 Appendix C

SIM_AB_GETDOB
Get a group of 8 discrete outputs on a single card.

Format
FORTRAN calling sequence and parameter description:
TEMPINT = SIM_AB_GETDOB (DS, ADDR, VALUE, ERROR, ERRDST)

where:
DS INTEGER*4 dataset number (1--4)
ADDR CHARACTER*(*) Address of ANY channel
on a discrete output card
VALUE INTEGER*4 (0 -- 255) (channel 1 = bit 0 = lsb)
ERROR INTEGER*4 Error return code
ERRDST INTEGER*4 Destination of error messages
TEMPINT INTEGER*4 Integer to store return of function

C calling sequence and parameter description:


long sim_ab_getdob (&ds, addr, &value, &error, &errdst)

where:
ds long dataset number (1--4)
addr char[] Address of ANY channel
on a discrete output card
value long (0 -- 255) (channel 1 = bit 0 = lsb)
error long Error return code
errdst long Destination of error messages

Original September 1995 38


UM25.0:SPE311
SIMVOX -- Version 2.3 Appendix C

Examples
FORTRAN:
integer*4 ds /1/
integer*4 error
integer*4 errdst /1/
character*80 addr
integer*4 value
integer*4 tempint

...
write (addr, (1X, A)) O:10/2
tempint = sim_ab_getdob (ds, addr, value, error, errdst)
...
tempint = sim_ab_getdob (ds, O:15/5, value, error, errdst)
...

Original September 1995 39


UM25.0:SPE311
SIMVOX -- Version 2.3 Appendix C

C:
long ds = 1;
long error;
long errdst = 1;
char addr[80];
long value;

...
strcpy (addr, O:45/6);
sim_ab_getdob (&ds, addr, &value, &error, &errdst);
...
sim_ab_getdob (&ds, O:45/8, &value, &error, &errdst);
...

Original September 1995 40


UM25.0:SPE311
SIMVOX -- Version 2.3 Appendix C

SIM_AB_GETDS
Get the dataset entered on the command line.

Format
FORTRAN calling sequence and parameter description:
TEMPINT = SIM_AB_GETDS ()

where:
TEMPINT INTEGER*4 Integer to store return of function

C calling sequence and parameter description:


long sim_ab_getds ()

Original September 1995 41


UM25.0:SPE311
SIMVOX -- Version 2.3 Appendix C

Examples
FORTRAN:
integer*4 ds
integer*4 error
integer*4 errdst

...

ds = sim_ab_getds ()
call sim_ab_attach_ds (ds, error, errdst)

...

Original September 1995 42


UM25.0:SPE311
SIMVOX -- Version 2.3 Appendix C

C:

long ds;
long error
long errdst

...

ds = sim_ab_getds ();
sim_ab_attach_ds (&ds, &error, &errdst);

...

Original September 1995 43


UM25.0:SPE311
SIMVOX -- Version 2.3 Appendix C

SIM_AB_GET_ALL_DS
Reads the command line into an internal string if the flag argument is TRUE and returns
the first dataset. On subsequent calls, the flag argument should be FALSE. This will
return any additional datasets. If the dataset returned is zero, there are no more datasets.

Format
FORTRAN calling sequence and parameter description:
TEMPINT = SIM_AB_GET_ALL_DS (FLAG)

where:
FLAG INTEGER*4 Flag indicating input from command line
TEMPINT INTEGER*4 Integer to store return of function

C calling sequence and parameter description:


long sim_ab_get_all_ds (flag)

where:
flag long Flag indicating input from command line

Original September 1995 44


UM25.0:SPE311
SIMVOX -- Version 2.3 Appendix C

Examples
FORTRAN:
integer*4 ds1, ds2
...
ds1 = sim_ab_get_all_ds (.TRUE.)
ds2 = sim_ab_get_all_ds (.FALSE.)

Original September 1995 45


UM25.0:SPE311
SIMVOX -- Version 2.3 Appendix C

C:

long flag;
long ds1, ds2;
{
...
flag = TRUE;
/* get the command line */
/* ds1 contains the first dataset in the command line */
ds1 = sim_ab_get_all_ds (flag);
flag = FALSE;
/* ds2 contains the next dataset in the command line */
ds2 = sim_ab_get_all_ds (flag);
}

Original September 1995 46


UM25.0:SPE311
SIMVOX -- Version 2.3 Appendix C

SIM_AB_LOOP
Tieback a loop analog output to analog input without any lag.

Format
FORTRAN calling sequence and parameter description:
CALL SIM_AB_LOOP (DS, PV, VO, GAIN, REVACT, ERRDST)

where:
DS INTEGER*4 Dataset number (1--4)
PV CHARACTER*(*) Address of process
variable or analog input
VO CHARACTER*(*) Address of the valve
output or analog output
GAIN REAL*8 Loop sensitivity (average = 1.0)
REVACT INTEGER*4 0 for a direct--acting loop; 1 for a
reverse--acting loop
ERRDST INTEGER*4 Destination of error messages

C calling sequence and parameter description:


sim_ab_loop (&ds, pv, vo, gain, revact, &errdst)

where:
ds long Dataset number (1--4)
pv char[] Address of process
variable or analog input
vo char[] Address of the valve
output or analog output
gain double Loop sensitivity (average = 1.0)
revact long 0 for a direct--acting loop; 1 for a
reverse--acting loop
errdst long Destination of error messages

Original September 1995 47


UM25.0:SPE311
SIMVOX -- Version 2.3 Appendix C

Examples
FORTRAN:
integer*4 ds /1/
integer*4 errdst /1/
character*80 pv
character*80 vo
real*8 gain
integer*4 revact

...
write (pv, (1X, A)) N11:10
write (vo, (1X, A)) N10:10
gain = 1.0
revact = 0
call sim_ab_loop (ds, pv, vo, gain, revact, errdst)
...

Original September 1995 48


UM25.0:SPE311
SIMVOX -- Version 2.3 Appendix C

C:
long ds = 1;
long errdst = 1;
char pv[80];
char vo[80];
double gain;
long revact;

...
strcpy (pv, N7:21);
strcpy (vo, N7:22);
gain = 1.0;
revact = 0;
sim_ab_loop (&ds, pv, vo, gain, revact, &errdst);
...

Original September 1995 49


UM25.0:SPE311
SIMVOX -- Version 2.3 Appendix C

SIM_AB_NOTE
Post a note to the message box.

Format
FORTRAN calling sequence and parameter description:
CALL SIM_AB_NOTE (NOTE)

where:
NOTE CHARACTER*(*) Note to be displayed

C calling sequence and parameter description:


sim_ab_note (note)

where:
note char[] Note to be displayed

Original September 1995 50


UM25.0:SPE311
SIMVOX -- Version 2.3 Appendix C

Examples
FORTRAN:

call sim_ab_note(Point found)

Original September 1995 51


UM25.0:SPE311
SIMVOX -- Version 2.3 Appendix C

C:
sim_ab_note(Point found);

Original September 1995 52


UM25.0:SPE311
SIMVOX -- Version 2.3 Appendix C

SIM_AB_SETAIC
Set an analog input in counts.

Format
FORTRAN calling sequence and parameter description:
TEMPINT = SIM_AB_SETAIC (DS, ADDR, VALUE, ERROR, ERRDST)

where:
DS INTEGER*4 dataset number (1--4)
ADDR CHARACTER*(*) Address of analog input
VALUE INTEGER*4 Number of counts (0--4095, or --32768 to
+32767 for WSI)
ERROR INTEGER*4 Error return code
ERRDST INTEGER*4 Destination of error messages
TEMPINT INTEGER*4 Integer to store return of function

C calling sequence and parameter description:


long sim_ab_setaic (&ds, addr, &value, &error, &errdst)

where:
ds long dataset number (1--4)
addr char[] Address of analog input
value long Number of counts (0--4095, or --32768 to
+32767 for WSI)
error long Error return code
errdst long Destination of error messages

Original September 1995 53


UM25.0:SPE311
SIMVOX -- Version 2.3 Appendix C

Examples
FORTRAN:
integer*4 ds /1/
integer*4 error
integer*4 errdst /1/
character*80 addr
integer*4 value
integer*4 tempint

...
write (addr, (1X, A)) N10:10
value = 520
tempint = sim_ab_setaic (ds, addr, value, error, errdst)
...
tempint = sim_ab_setaic (ds, N11:11, value, error, errdst)
...

Original September 1995 54


UM25.0:SPE311
SIMVOX -- Version 2.3 Appendix C

C:
long ds = 1;
long error;
long errdst = 1;
char addr[80];
long value;

...
strcpy (addr, N12:22);
value = 520;
sim_ab_setaic (&ds, addr, &value, &error, &errdst);
...
sim_ab_setaic (&ds, N12:12, &value, &error, &errdst);
...

Original September 1995 55


UM25.0:SPE311
SIMVOX -- Version 2.3 Appendix C

SIM_AB_SETAIE
Set the engineering unit value of the AI point specified.

Format
FORTRAN calling sequence and parameter description:
TEMPREAL = SIM_AB_SETAIE (DS, ADDR, VALUE, EUHIGH, EUHIGH, EULOW, ERRDST)

where:
DS INTEGER*4 dataset number (1--4)
ADDR CAHRACTER*(*) Address of analog input
VALUE REAL*8 Value read in engineering units of the AI
point
EUHIGH REAL*8 High engineering units of the point
EULOW REAL*8 Low engineering units of the point
ERROR INTEGER*4 Error return code
ERRDST INTEGER*4 Destination of error messages
TEMPREAL REAL*8 Real to store return of function

C calling sequence and parameter description:


double sim_ab_setaie (&ds, addr, &value, euhigh, eulow, &error, &errdst)

where:
ds long dataset number (1--4)
addr char[] Address of analog input
value double Value read in engineering units of the AI
point
euhigh double High engineering units of the point
eulow double Low engineering units of the point
error long Error return code
errdst long Destination of error messages

Original September 1995 56


UM25.0:SPE311
SIMVOX -- Version 2.3 Appendix C

Examples
FORTRAN:
integer*4 ds /1/
integer*4 error
integer*4 errdst /1/
character*80 addr
real*8 value
real*8 euhigh
real*8 eulow
real*8 tempreal
...
write (addr, (1X, A)) N22:10
value = 30.0
euhigh = 0
eulow = 0
tempreal = sim_ab_setaie (ds, addr, value, euhigh, eulow, error, errdst)
...
tempreal = sim_ab_setaie (ds, N51:51, value, euhigh, eulow, error, errdst)
...

Original September 1995 57


UM25.0:SPE311
SIMVOX -- Version 2.3 Appendix C

C:
long ds = 1;
long error;
long errdst = 1;
char addr[80];
double value;
double euhigh;
double eulow;

...
strcpy (addr, N12:12);
value = 55.0;
euhigh = 100.0;
eulow = 0.0;
sim_ab_setaie (&ds, addr, &value, &error, &euhigh, &eulow, &errdst);
...
sim_ab_setaie (&ds, N12:12, &value, &error, &euhigh, &eulow, &errdst);
...

Original September 1995 58


UM25.0:SPE311
SIMVOX -- Version 2.3 Appendix C

SIM_AB_SETAIP
Set an analog input in percent.

Format
FORTRAN calling sequence and parameter description:
TEMPREAL = SIM_AB_SETAIP (DS, ADDR, VALUE, ERROR, ERRDST)

where:
DS INTEGER*4 dataset number (1--4)
ADDR INTEGER*4 Address of analog input
VALUE REAL*8 Percent (--25.0 to +100.0 or 0.0 to
+125.0 or --128.0 to +127.996) depending
on card type
ERROR INTEGER*4 Error return code
ERRDST INTEGER*4 Destination of error messages
TEMPREAL REAL*8 Real to store return of function

C calling sequence and parameter description:


double sim_ab_setaip (&ds, addr, &value, &error, &errdst)

where:
ds long dataset number (1--4)
addr char[] Address of analog input
value double Percent (--25.0 to +100.0 or 0.0 to
+125.0 or --128.0 to +127.996) depending
on card type
error long Error return code
errdst long Destination of error messages

Original September 1995 59


UM25.0:SPE311
SIMVOX -- Version 2.3 Appendix C

Examples
FORTRAN:
integer*4 ds /1/
integer*4 error
integer*4 errdst /1/
character*80 addr
real*8 value
real*8 tempreal

...
write (addr, (1X, A)) N50:2
value = 30.0
tempreal = sim_ab_setaip (ds, addr, value, error, errdst)
...
tempreal = sim_ab_setaip (ds, N51:3, value, error, errdst)
...

Original September 1995 60


UM25.0:SPE311
SIMVOX -- Version 2.3 Appendix C

C:
long ds = 1;
long error;
long errdst = 1;
char addr[80];
double value;

...
strcpy (addr, N13:50);
value = 30.0;
sim_ab_setaip (&ds, addr, &value, &error, &errdst);
...
sim_ab_setaip (&ds, N12:12, &value, &error, &errdst);
...

Original September 1995 61


UM25.0:SPE311
SIMVOX -- Version 2.3 Appendix C

SIM_AB_SETDI
Set a discrete input.

Format
FORTRAN calling sequence and parameter description:
TEMPINT = SIM_AB_SETDI (DS, ADDR, VALUE, ERROR, ERRDST)

where:
DS INTEGER*4 dataset number (1--4)
ADDR CHARACTER*(*) Address of discrete input
VALUE INTEGER*4 (0 -- 1)
ERROR INTEGER*4 Error return code
ERRDST INTEGER*4 Destination of error messages
TEMPINT INTEGER*4 Integer to store return of function

C calling sequence and parameter description:


long sim_ab_setdi (&ds, addr, &value, &error, &errdst)

where:
ds long dataset number (1--4)
addr char[] Address of discrete input
value long (0 -- 1)
error long Error return code
errdst long Destination of error messages

Original September 1995 62


UM25.0:SPE311
SIMVOX -- Version 2.3 Appendix C

Examples
FORTRAN:
integer*4 ds /1/
integer*4 error
integer*4 errdst /1/
character*80 addr
integer*4 value
integer*4 tempint

...
write (addr, (1X, A)) I:10/2
value = 1
tempint = sim_ab_setdi (ds, addr, value, error, errdst)
...
tempint = sim_ab_setdi (ds, I:12/3, value, error, errdst)
...

Original September 1995 63


UM25.0:SPE311
SIMVOX -- Version 2.3 Appendix C

C:
long ds = 1;
long error;
long errdst = 1;
char addr[80];
long value;

...
strcpy (addr, I:26/1);
value = 1;
sim_ab_setdi (&ds, addr, &value, &error, &errdst);
...
sim_ab_setdi (&ds, I:26/5, &value, &error, &errdst);
...

Original September 1995 64


UM25.0:SPE311
SIMVOX -- Version 2.3 Appendix C

SIM_AB_SETDIB
Set a group of 8 discrete inputs on a single card.

Format
FORTRAN calling sequence and parameter description:
TEMPINT = SIM_AB_SETDIB (DS, ADDR, VALUE, ERROR, ERRDST)

where:
DS INTEGER*4 dataset number (1--4)
ADDR CHARACTER*(*) Address of ANY channel
on a discrete input card
VALUE INTEGER*4 (0 -- 255) (channel 1 = bit 0 = lsb)
ERROR INTEGER*4 Error return code
ERRDST INTEGER*4 Destination of error messages
TEMPINT INTEGER*4 Integer to store return of function

C calling sequence and parameter description:


long sim_ab_setdib (&ds, addr, &value, &error, &errdst)

where:
ds long dataset number (1--4)
addr char[] Address of ANY channel
on a discrete input card
value long (0 -- 255) (channel 1 = bit 0 = lsb)
error long Error return code
errdst long Destination of error messages

Original September 1995 65


UM25.0:SPE311
SIMVOX -- Version 2.3 Appendix C

Examples
FORTRAN:
integer*4 ds /1/
integer*4 error
integer*4 errdst /1/
character*80 addr
integer*4 value
integer*4 tempint

...
write (addr, (1X, A)) I:10/2
value = 9507
tempint = sim_ab_setdib (ds, addr, value, error, errdst)
...
tempint = sim_ab_setdib (ds, I:11/2, value, error, errdst)
...

Original September 1995 66


UM25.0:SPE311
SIMVOX -- Version 2.3 Appendix C

C:
long ds = 1;
long error;
long errdst = 1;
char addr[80];
long value;

...
strcpy (addr, I:11/4);
value = 9507;
sim_ab_setdib (&ds, addr, &value, &error, &errdst);
...
sim_ab_setdib (&ds, I:11/3, &value, &error, &errdst);
...

Original September 1995 67


UM25.0:SPE311
SIMVOX -- Version 2.3 Appendix C

SIM_AB_SLEEP
This function is not supported in SIMVOX for Windows NT. It is provided for
compatability with existing code. It simply delays for 1 second before returning.

Format
FORTRAN calling sequence and parameter description:
CALL SIM_AB_SLEEP ()

C calling sequence and parameter description:


sim_ab_sleep ()

Original September 1995 68


UM25.0:SPE311
SIMVOX -- Version 2.3 Appendix C

Examples
FORTRAN:

while (.TRUE.)
...

call sim_ab_sleep ()
endwhile

Original September 1995 69


UM25.0:SPE311
SIMVOX -- Version 2.3 Appendix C

C:

call sim_ab_wakeup ( ... )


while (TRUE)
{
...

sim_ab_sleep ();
}

SIM_AB_WAKEUP
This function is not supported in SIMVOX for Windows NT. It is provided for
compatability with existing code.

Original September 1995 70


UM25.0:SPE311
Appendix D

SIMVOX Library Subroutines


MODICON
Modbus & Modbus+
This page intentionally blank
SIMVOX -- Version 2.3 Appendix D

LIBRARY INDEX
sim_mod_attach_ds (ds, error, errdst)
sim_mod_attach_multi_ds (ds, error, errdst)

sim_mod_dcd (ds, template, output, input, dcdnum, error, errdst,


trantime, tranpv)

sim_mod_delay (sec)

sim_mod_getaic (ds, addr, value, error, errdst)

sim_mod_getaie (ds, addr, value, euhigh, eulow, error, errdst)

sim_mod_getaip (ds, addr, value, error, errdst)

sim_mod_getaoc (ds, addr, value, error, errdst)

sim_mod_getaop (ds, addr, value, error, errdst)

sim_mod_getdi (ds, addr, value, error, errdst)

sim_mod_getdo (ds, addr, value, error, errdst)

sim_mod_getds ()
sim_mod_get_all_ds (flag)

sim_mod_loop (ds, pv, vo, gain, revact, errdst)

sim_mod_note (note)

sim_mod_setaic (ds, addr, value, error, errdst)

sim_mod_setaie (ds, addr, value, euhigh, eulow, error, errdst)

sim_mod_setaip (ds, addr, value, error, errdst)

sim_mod_setdi (ds, addr, value, error, errdst)

sim_mod_sleep ()

sim_mod_wakeup (number, units, error)

Original September 1995 1


UM25.0:SPE311
SIMVOX -- Version 2.3 Appendix D

This page intentionally blank

Original September 1995 2


UM25.0:SPE311
SIMVOX -- Version 2.3 Appendix D

SIM_MOD_ATTACH_DS
Attach to a dataset. All programs must use this function to attach to a dataset. SIMVOX
calls do not work correctly without it. Attaching is done prior to all other SIMVOX calls
except sim_mod_getds and sim_mod_get_all_ds.

Format
FORTRAN calling sequence and parameter description:
CALL SIM_MOD_ATTACH_DS (DS, ERROR, ERRDST)

where:
DS INTEGER*4 Dataset number (1--4)
ERROR INTEGER*4 Error return value
ERRDST INTEGER*4 Destination of error messages

C calling sequence and parameter description:


sim_mod_attach_ds (&ds, &error, &errdst);

where:
ds long Dataset number (1--4)
error long Error return value
errdst long Destination of error messages

Original September 1995 1


UM25.0:SPE311
SIMVOX -- Version 2.3 Appendix D

Examples
FORTRAN:
integer*4 ds /1/
integer*4 error
integer*4 errdst /1/

...
call sim_mod_attach_ds (ds, error, errdst)
...

Original September 1995 2


UM25.0:SPE311
SIMVOX -- Version 2.3 Appendix D

C:
long ds = 1;
long error;
long errdst = 1;

...
sim_mod_attach_ds (&ds, &error, &errdst);
...

Original September 1995 3


UM25.0:SPE311
SIMVOX -- Version 2.3 Appendix D

SIM_MOD_ATTACH_MULTI_DS
Attach to multiple datasets. Gets all the datasets on the command line and attaches to
those datasets. Stores the attached datasets in the dataset array provided as the first
parameter.

Format
FORTRAN calling sequence and parameter description:
CALL SIM_MOD_ATTACH_MULTI_DS (DS, ERROR, ERRDST)

where:
DS(4) INTEGER*4 Dataset array
ERROR INTEGER*4 Error return value
ERRDST INTEGER*4 Destination of error messages

C calling sequence and parameter description:


sim_mod_attach_multi_ds (ds, &error, &errdst);

where:
ds[4] long Dataset array
error long Error return value
errdst long Destination of error messages

Original September 1995 4


UM25.0:SPE311
SIMVOX -- Version 2.3 Appendix D

Examples
FORTRAN:
integer*4 ds(4)
integer*4 error
integer*4 errdst /1/
...
call sim_mod_attach_multi_ds (ds, error, errdst)
...

Original September 1995 5


UM25.0:SPE311
SIMVOX -- Version 2.3 Appendix D

C:
long ds [4];
long error;
long errdst = 1;

...
sim_mod_attach_multi_ds (ds, &error, &errdst);
...

Original September 1995 6


UM25.0:SPE311
SIMVOX -- Version 2.3 Appendix D

SIM_MOD_DCD
Tieback DCD output patterns to input patterns. This function is called once for each
DCD to be resolved by the tieback program. SIMVOX Tools option allows automatic
creation of tieback programs.

Format
FORTRAN calling sequence and parameter description:
CALL SIM_MOD_DCD (DS, TEMPLATE, OUTPUT, INPUT, DCDNUM, ERROR, ERRDST, TRANTIME,
TRANPV)

where:
DS INTEGER*4 Dataset number (1--4)
TEMPLATE(35) INTEGER*4 Thirty--five element array containing the
DCD template
OUTPUT (8) INTEGER*4 Eight element array containing the
addresses of the outputs
INPUT (16) INTEGER*4 Sixteen element array containing the
addresses of the inputs
DCDNUM INTEGER*4 Sequence number of the DCD (1--128)
ERROR INTEGER*4 Error return code
ERRDST INTEGER*4 Destination of error messages
TRANTIME INTEGER*4 Number of seconds to wait before setting
up the new PV on the inputs after a new
SP appears on the outputs
TRANPV INTEGER*4 PV to set up on the inputs during the
transition time (--32768 to +32767)

Original September 1995 7


UM25.0:SPE311
SIMVOX -- Version 2.3 Appendix D

C calling sequence and parameter description:


sim_mod_dcd (&ds, template, output, input, dcdnum, &error, &errdst, trantime, tranpv)

where:
ds long Dataset number (1--4)
template long[35] Thirty--five element array containing the
DCD template
output long[8] Eight element array containing the
addresses of the outputs
input long[16] Sixteen element array containing the
addresses of the inputs
dcdnum long Sequence number of the DCD (1--128)
error long Error return code
errdst long Destination of error messages
trantime long Number of seconds to wait before setting
up the new PV on the inputs after a new
SP appears on the outputs
tranpv long PV to set up on the inputs during the
transition time (--32768 to +32767)

The template used is defined as follows:

TEMPLATE (1) Number of setpoints (1--16)


(2) Number of outputs (1--8)
(3) Number of inputs (1--16)
(4--19) Discrete output patterns for each of the
16 possible setpoints (0--255)
(20--35) Discrete input patterns for each of the
16 possible setpoints (--32768 to +32767)

Original September 1995 8


UM25.0:SPE311
SIMVOX -- Version 2.3 Appendix D

Examples
FORTRAN:
integer*4 ds /1/
integer*4 error
integer*4 errdst /1/
integer*4 dcdnum
integer*4 trantime
integer*4 tranpv

integer*4 dcd_output (8 )
integer*4 dcd_input (16)
integer*4 template (35)

data dcd_output /4000,0,0,0,0,0,0,0/


data dcd_input /10005,11005,0,0,0,0,0,0,8*0/

data template /2,1,2,


1,0,14*0,
1,2,14*0/

...

trantime = 0
tranpv = 0
while (.TRUE.)
call sim_mod_dcd (ds, template, dcd_output, dcd_input, 1, error, errdst, trantime,
tranpv)

...

endwhile

Original September 1995 9


UM25.0:SPE311
SIMVOX -- Version 2.3 Appendix D

C:
long ds = 1;
long error;
long errdst = 1;
long dcdnum;
long trantime;
long tranpv;

long dcd_output [8] = {4000, 0, 0, 0, 0, 0, 0, 0 };


long dcd_input [16] = {10005, 11005, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0};

long template [35] = {2, 1, 2,


1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};

...

trantime = 0;
tranpv = 0;
while (TRUE)
{
sim_mod_dcd(&ds, template, dcd_output, dcd_input, 1, &error, &errdst, trantime,
tranpv);

...

Original September 1995 10


UM25.0:SPE311
SIMVOX -- Version 2.3 Appendix D

SIM_MOD_DELAY
Put calling process to sleep for the specified amount of time. The time is specified in
seconds.

Format
FORTRAN calling sequence and parameter description:
CALL SIM_MOD_DELAY (SEC)

where:
SEC REAL Number of seconds to delay

C calling sequence and parameter description:


sim_mod_delay (&sec)

where:
sec double Real Number of seconds to delay

Original September 1995 11


UM25.0:SPE311
SIMVOX -- Version 2.3 Appendix D

Examples
FORTRAN:

real*8 delay /5.0/

...

while (.TRUE.)
...

...

call sim_mod_delay (delay)


endwhile

Original September 1995 12


UM25.0:SPE311
SIMVOX -- Version 2.3 Appendix D

C:

double delay = 5.0;

...

while (TRUE)
{
...

sim_mod_delay (&delay);
}

Original September 1995 13


UM25.0:SPE311
SIMVOX -- Version 2.3 Appendix D

SIM_MOD_GETAIC
Get an analog input in counts.

Format
FORTRAN calling sequence and parameter description:
TEMPINT = SIM_MOD_GETAIC (DS, ADDR, VALUE, ERROR, ERRDST)

where:
DS INTEGER*4 dataset number (1--4)
ADDR INTEGER*4 Address of analog input
VALUE INTEGER*4 Number of counts (0--4095, or --32768 to
+32767 for WSI)
ERROR INTEGER*4 Error return code
ERRDST INTEGER*4 Destination of error messages
TEMPINT INTEGER*4 Integer to store return of function

C calling sequence and parameter description:


long sim_mod_getaic (&ds, addr, &value, &error, &errdst)

where:
ds long dataset number (1--4)
addr long Address of analog input
value long Number of counts (0--4095, or --32768 to
+32767 for WSI)
error long Error return code
errdst long Destination of error messages

Original September 1995 14


UM25.0:SPE311
SIMVOX -- Version 2.3 Appendix D

Examples
FORTRAN:
integer*4 ds /1/
integer*4 error
integer*4 errdst /1/
integer*4 addr
integer*4 value
integer*4 tempint

...
addr = 30567
tempint = sim_mod_getaic (ds, addr, value, error, errdst)
...
tempint = sim_mod_getaic (ds, 30856, value, error, errdst)
...

Original September 1995 15


UM25.0:SPE311
SIMVOX -- Version 2.3 Appendix D

C:
long ds = 1;
long error;
long errdst = 1;
long addr;
long value;

...
addr = 30851;
sim_mod_getaic (&ds, addr, &value, &error, &errdst);
...
sim_mod_getaic (&ds, 30856, &value, &error, &errdst);
...

Original September 1995 16


UM25.0:SPE311
SIMVOX -- Version 2.3 Appendix D

SIM_MOD_GETAIE
Get the engineering unit value of the AI point specified.

Format
FORTRAN calling sequence and parameter description:
TEMPREAL = SIM_MOD_GETAIE (DS, ADDR, VALUE, EUHIGH, EUHIGH, EULOW, ERRDST)

where:
DS INTEGER*4 dataset number (1--4)
ADDR INTEGER*4 Address of analog input
VALUE REAL*8 Value read in engineering units of the AI
point
EUHIGH REAL*8 High engineering units of the point
EULOW REAL*8 Low engineering units of the point
ERROR INTEGER*4 Error return code
ERRDST INTEGER*4 Destination of error messages
TEMPREAL REAL*8 Real to store return of function

C calling sequence and parameter description:


double sim_mod_getaie (&ds, addr, &value, euhigh, eulow, &error, &errdst)

where:
ds long dataset number (1--4)
addr long Address of analog input
value double Value read in engineering units of the AI point
euhigh double High engineering units of the point
eulow double Low engineering units of the point
error long Error return code
errdst long Destination of error messages

Original September 1995 17


UM25.0:SPE311
SIMVOX -- Version 2.3 Appendix D

Examples
FORTRAN:
integer*4 ds /1/
integer*4 error
integer*4 errdst /1/
integer*4 addr
real*8 value
real*8 euhigh
real*8 eulow
real*8 tempreal
...
addr = 30538
value = 0
euhigh = 0
eulow = 0
tempreal = sim_mod_getaie (ds, addr, value, euhigh, eulow, error, errdst)
...
tempreal = sim_mod_getaie (ds, 30528, value, euhigh, eulow, error, errdst)
...

Original September 1995 18


UM25.0:SPE311
SIMVOX -- Version 2.3 Appendix D

C:
long ds = 1;
long error;
long errdst = 1;
long addr;
double value;
double euhigh;
double eulow;

...
addr = 31222;
value = 55.0;
euhigh = 100.0;
eulow = 0.0;
sim_mod_getaie (&ds, addr, &value, &error, &euhigh, &eulow, &errdst);
...
sim_mod_getaie (&ds, 31212, &value, &error, &euhigh, &eulow, &errdst);
...

Original September 1995 19


UM25.0:SPE311
SIMVOX -- Version 2.3 Appendix D

SIM_MOD_GETAIP
Get an analog input in percent.

Format
FORTRAN calling sequence and parameter description:
TEMPREAL = SIM_MOD_GETAIP (DS, ADDR, VALUE, ERROR, ERRDST)

where:
DS INTEGER*4 dataset number (1--4)
ADDR INTEGER*4 Address of analog input
VALUE REAL*8 Percent (--25.0 to +100.0 or 0.0 to
+125.0 or --128.0 to +127.996) depending
on card type
ERROR INTEGER*4 Error return code
ERRDST INTEGER*4 Destination of error messages
TEMPREAL REAL*8 Real to store return of function

C calling sequence and parameter description:


double sim_mod_getaip (&ds, addr, &value, &error, &errdst)

where:
ds long dataset number (1--4)
addr long Address of analog input
value double Percent (--25.0 to +100.0 or 0.0 to
+125.0 or --128.0 to +127.996) depending
on card type
error long Error return code
errdst long Destination of error messages

Original September 1995 20


UM25.0:SPE311
SIMVOX -- Version 2.3 Appendix D

Examples
FORTRAN:
integer*4 ds /1/
integer*4 error
integer*4 errdst /1/
integer*4 addr
real*8 value
real*8 tempreal

...
addr = 31064
tempreal = sim_mod_getaip (ds, addr, value, error, errdst)
...
tempreal = sim_mod_getaip (ds, 31062, value, error, errdst)
...

Original September 1995 21


UM25.0:SPE311
SIMVOX -- Version 2.3 Appendix D

C:
long ds = 1;
long error;
long errdst = 1;
long addr;
double value;

...
addr = 33144;
sim_mod_getaip (&ds, addr, &value, &error, &errdst);
...
sim_mod_getaip (&ds, 31062, &value, &error, &errdst);
...

Original September 1995 22


UM25.0:SPE311
SIMVOX -- Version 2.3 Appendix D

SIM_MOD_GETAOC
Get an analog output in counts.

Format
FORTRAN calling sequence and parameter description:
TEMPINT = SIM_MOD_GETAOC (DS, ADDR, VALUE, ERROR, ERRDST)

where:
DS INTEGER*4 dataset number (1--4)
ADDR INTEGER*4 Address of analog output
VALUE INTEGER*4 Number of counts (0--4095)
ERROR INTEGER*4 Error return code
ERRDST INTEGER*4 Destination of error messages
TEMPINT INTEGER*4 Integer to store return of function

C calling sequence and parameter description:


long sim_mod_getaoc (&ds, addr, &value, &error, &errdst)

where:
ds long dataset number (1--4)
addr long Address of analog output
value long Number of counts (0--4095)
error long Error return code
errdst long Destination of error messages

Original September 1995 23


UM25.0:SPE311
SIMVOX -- Version 2.3 Appendix D

Examples
FORTRAN:
integer*4 ds /1/
integer*4 error
integer*4 errdst /1/
integer*4 addr
integer*4 value
integer*4 tempint

...
addr = 40225
tempint = sim_mod_getaoc (ds, addr, value, error, errdst)
...
tempint = sim_mod_getaoc (ds, 50228, value, error, errdst)
...

Original September 1995 24


UM25.0:SPE311
SIMVOX -- Version 2.3 Appendix D

C:
long ds = 1;
long error;
long errdst = 1;
long addr;
long value;

...
addr = 55228;
sim_mod_getaoc (&ds, addr, &value, &error, &errdst);
...
sim_mod_getaoc (&ds, 62224, &value, &error, &errdst);
...

Original September 1995 25


UM25.0:SPE311
SIMVOX -- Version 2.3 Appendix D

SIM_MOD_GETAOP
Get an analog output in percent.

Format
FORTRAN calling sequence and parameter description:
TEMPREAL = SIM_MOD_GETAOP (DS, ADDR, VALUE, ERROR, ERRDST)

where:
DS INTEGER*4 dataset number (1--4)
ADDR INTEGER*4 Address of analog output
VALUE REAL*8 Percent (--25.0 to +100.0)
ERROR INTEGER*4 Error return code
ERRDST INTEGER*4 Destination of error messages
TEMPREAL REAL*8 Real to store return of function

C calling sequence and parameter description:


double sim_mod_getaop (&ds, addr, &value, &error, &errdst)

where:
ds long dataset number (1--4)
addr long Address of analog output
value double Percent (--25.0 to +100.0)
error long Error return code
errdst long Destination of error messages

Original September 1995 26


UM25.0:SPE311
SIMVOX -- Version 2.3 Appendix D

Examples
FORTRAN:
integer*4 ds /1/
integer*4 error
integer*4 errdst /1/
integer*4 addr
real*8 value
real*8 tempreal

...
addr = 46312
tempreal = sim_mod_getaop (ds, addr, value, error, errdst)
...
tempreal = sim_mod_getaop (ds, 64316, value, error, errdst)
...

Original September 1995 27


UM25.0:SPE311
SIMVOX -- Version 2.3 Appendix D

C:
long ds = 1;
long error;
long errdst = 1;
long addr;
double value;

...
addr = 40312;
sim_mod_getaop (&ds, addr, &value, &error, &errdst);
...
sim_mod_getaop (&ds, 54316, &value, &error, &errdst);
...

Original September 1995 28


UM25.0:SPE311
SIMVOX -- Version 2.3 Appendix D

SIM_MOD_GETDI
Get a discrete input.

Format
FORTRAN calling sequence and parameter description:
TEMPINT = SIM_MOD_GETDI (DS, ADDR, VALUE, ERROR, ERRDST)

where:
DS INTEGER*4 dataset number (1--4)
ADDR INTEGER*4 Address of discrete input
VALUE INTEGER*4 (0 -- 1)
ERROR INTEGER*4 Error return code
ERRDST INTEGER*4 Destination of error messages
TEMPINT INTEGER*4 Integer to store return of function

C calling sequence and parameter description:


long sim_mod_getdi (&ds, addr, &value, &error, &errdst)

where:
ds long dataset number (1--4)
addr long Address of discrete input
value long (0 -- 1)
error long Error return code
errdst long Destination of error messages

Original September 1995 29


UM25.0:SPE311
SIMVOX -- Version 2.3 Appendix D

Examples
FORTRAN:
integer*4 ds /1/
integer*4 error
integer*4 errdst /1/
integer*4 addr
integer*4 value
integer*4 tempint

...
addr = 11516
tempint = sim_mod_getdi (ds, addr, value, error, errdst)
...
tempint = sim_mod_getdi (ds, 11512, value, error, errdst)
...

Original September 1995 30


UM25.0:SPE311
SIMVOX -- Version 2.3 Appendix D

C:
long ds = 1;
long error;
long errdst = 1;
long addr;
long value;

...
addr = 11516;
sim_mod_getdi (&ds, addr, &value, &error, &errdst);
...
sim_mod_getdi (&ds, 11512, &value, &error, &errdst);
...

Original September 1995 31


UM25.0:SPE311
SIMVOX -- Version 2.3 Appendix D

SIM_MOD_GETDO
Get a discrete output.

Format
FORTRAN calling sequence and parameter description:
TEMPINT = SIM_MOD_GETDO (DS, ADDR, VALUE, ERROR, ERRDST)

where:
DS INTEGER*4 dataset number (1--4)
ADDR INTEGER*4 Address of discrete output
VALUE INTEGER*4 (0 -- 1)
ERROR INTEGER*4 Error return code
ERRDST INTEGER*4 Destination of error messages
TEMPINT INTEGER*4 Integer to store return of function

C calling sequence and parameter description:


long sim_mod_getdo (&ds, addr, &value, &error, &errdst)

where:
ds long dataset number (1--4)
addr long Address of discrete output
value long (0 -- 1)
error long Error return code
errdst long Destination of error messages

Original September 1995 32


UM25.0:SPE311
SIMVOX -- Version 2.3 Appendix D

Examples
FORTRAN:
integer*4 ds /1/
integer*4 error
integer*4 errdst /1/
integer*4 addr
integer*4 value
integer*4 tempint

...
addr = 1412
tempint = sim_mod_getdo (ds, addr, value, error, errdst)
...
tempint = sim_mod_getdo (ds, 1419, value, error, errdst)
...

Original September 1995 33


UM25.0:SPE311
SIMVOX -- Version 2.3 Appendix D

C:
long ds = 1;
long error;
long errdst = 1;
long addr;
long value;

...
addr = 1412;
sim_mod_getdo (&ds, addr, &value, &value, &error, &errdst);
...
sim_mod_getdo (&ds, 1418, &value, &value, &error, &errdst);
...

Original September 1995 34


UM25.0:SPE311
SIMVOX -- Version 2.3 Appendix D

SIM_MOD_GETDS
Get the dataset entered on the command line.

Format
FORTRAN calling sequence and parameter description:
TEMPINT = SIM_MOD_GETDS ()

where:
TEMPINT INTEGER*4 Integer to store return of function

C calling sequence and parameter description:


long sim_mod_getds ()

Original September 1995 35


UM25.0:SPE311
SIMVOX -- Version 2.3 Appendix D

Examples
FORTRAN:
integer*4 ds
integer*4 error
integer*4 errdst

...

ds = sim_mod_getds ()
call sim_mod_attach_ds (ds, error, errdst)

...

Original September 1995 36


UM25.0:SPE311
SIMVOX -- Version 2.3 Appendix D

C:

long ds;
long error
long errdst

...

ds = sim_mod_getds ();
sim_mod_attach_ds (&ds, &error, &errdst);

...

Original September 1995 37


UM25.0:SPE311
SIMVOX -- Version 2.3 Appendix D

SIM_MOD_GET_ALL_DS
Reads the command line into an internal string if the flag argument is TRUE and returns
the first dataset. On subsequent calls, the flag argument should be FALSE. This will
return any additional datasets. If the dataset returned is zero, there are no more datasets.

Format
FORTRAN calling sequence and parameter description:
TEMPINT = SIM_MOD_GET_ALL_DS (FLAG)

where:
FLAG INTEGER*4 Flag indicating input from command line
TEMPINT INTEGER*4 Integer to store return of function

C calling sequence and parameter description:


long sim_mod_get_all_ds (flag)

where:
flag long Flag indicating input from command line

Original September 1995 38


UM25.0:SPE311
SIMVOX -- Version 2.3 Appendix D

Examples
FORTRAN:
integer*4 ds1, ds2
...
ds1 = sim_mod_get_all_ds (.TRUE.)
ds2 = sim_mod_get_all_ds (.FALSE.)

Original September 1995 39


UM25.0:SPE311
SIMVOX -- Version 2.3 Appendix D

C:

long flag;
long ds1, ds2;
{
...
flag = TRUE;
/* get the command line */
/* ds1 contains the first dataset in the command line */
ds1 = sim_mod_get_all_ds (flag);
flag = FALSE;
/* ds2 contains the next dataset in the command line */
ds2 = sim_mod_get_all_ds (flag);
}

Original September 1995 40


UM25.0:SPE311
SIMVOX -- Version 2.3 Appendix D

SIM_MOD_LOOP
Tieback a loop analog output to analog input without any lag.

Format
FORTRAN calling sequence and parameter description:
CALL SIM_MOD_LOOP (DS, PV, VO, GAIN, REVACT, ERRDST)

where:
DS INTEGER*4 Dataset number (1--4)
PV INTEGER*4 Address of process varimodle or
analog input
VO INTEGER*4 Address of the valve
output or analog output
GAIN REAL*8 Loop sensitivity (average = 1.0)
REVACT INTEGER*4 0 for a direct--acting loop; 1 for a
reverse--acting loop
ERRDST INTEGER*4 Destination of error messages

C calling sequence and parameter description:


sim_mod_loop (&ds, pv, vo, gain, revact, &errdst)

where:
ds long Dataset number (1--4)
pv long Address of process
varimodle or analog input
vo long Address of the valve
output or analog output
gain double Loop sensitivity (average = 1.0)
revact long 0 for a direct--acting loop; 1 for a
reverse--acting loop
errdst long Destination of error messages

Original September 1995 41


UM25.0:SPE311
SIMVOX -- Version 2.3 Appendix D

Examples
FORTRAN:
integer*4 ds /1/
integer*4 errdst /1/
integer*4 pv
integer*4 vo
real*8 gain
integer*4 revact

...
pv = 30721
vo = 40722
gain = 1.0
revact = 0
call sim_mod_loop (ds, pv, vo, gain, revact, errdst)
...

Original September 1995 42


UM25.0:SPE311
SIMVOX -- Version 2.3 Appendix D

C:
long ds = 1;
long errdst = 1;
long pv;
long vo;
double gain;
long revact;

...
pv = 33721;
vo = 43722;
gain = 1.0;
revact = 0;
sim_mod_loop (&ds, pv, vo, gain, revact, &errdst);
...

Original September 1995 43


UM25.0:SPE311
SIMVOX -- Version 2.3 Appendix D

SIM_MOD_NOTE
Post a note to the message box.

Format
FORTRAN calling sequence and parameter description:
CALL SIM_MOD_NOTE (NOTE)

where:
NOTE CHARACTER*(*) Note to be displayed

C calling sequence and parameter description:


sim_mod_note (note)

where:
note char[] Note to be displayed

Original September 1995 44


UM25.0:SPE311
SIMVOX -- Version 2.3 Appendix D

Examples
FORTRAN:

call sim_mod_note(Point found)

Original September 1995 45


UM25.0:SPE311
SIMVOX -- Version 2.3 Appendix D

C:
sim_mod_note(Point found);

Original September 1995 46


UM25.0:SPE311
SIMVOX -- Version 2.3 Appendix D

SIM_MOD_SETAIC
Set an analog input in counts.

Format
FORTRAN calling sequence and parameter description:
TEMPINT = SIM_MOD_SETAIC (DS, ADDR, VALUE, ERROR, ERRDST)

where:
DS INTEGER*4 dataset number (1--4)
ADDR INTEGER*4 Address of analog input
VALUE INTEGER*4 Number of counts (0--4095, or --32768 to
+32767 for WSI)
ERROR INTEGER*4 Error return code
ERRDST INTEGER*4 Destination of error messages
TEMPINT INTEGER*4 Integer to store return of function

C calling sequence and parameter description:


long sim_mod_setaic (&ds, addr, &value, &error, &errdst)

where:
ds long dataset number (1--4)
addr long Address of analog input
value long Number of counts (0--4095, or --32768 to
+32767 for WSI)
error long Error return code
errdst long Destination of error messages

Original September 1995 47


UM25.0:SPE311
SIMVOX -- Version 2.3 Appendix D

Examples
FORTRAN:
integer*4 ds /1/
integer*4 error
integer*4 errdst /1/
integer*4 addr
integer*4 value
integer*4 tempint

...
addr = 31222
value = 520
tempint = sim_mod_setaic (ds, addr, value, error, errdst)
...
tempint = sim_mod_setaic (ds, 31212, value, error, errdst)
...

Original September 1995 48


UM25.0:SPE311
SIMVOX -- Version 2.3 Appendix D

C:
long ds = 1;
long error;
long errdst = 1;
long addr;
long value;

...
addr = 31222;
value = 520;
sim_mod_setaic (&ds, addr, &value, &error, &errdst);
...
sim_mod_setaic (&ds, 31212, &value, &error, &errdst);
...

Original September 1995 49


UM25.0:SPE311
SIMVOX -- Version 2.3 Appendix D

SIM_MOD_SETAIE
Set the engineering unit value of the AI point specified.

Format
FORTRAN calling sequence and parameter description:
TEMPREAL = SIM_MOD_SETAIE (DS, ADDR, VALUE, EUHIGH, EUHIGH, EULOW, ERRDST)

where:
DS INTEGER*4 dataset number (1--4)
ADDR INTEGER*4 Address of analog input
VALUE REAL*8 Value read in engineering units of the AI
point
EUHIGH REAL*8 High engineering units of the point
EULOW REAL*8 Low engineering units of the point
ERROR INTEGER*4 Error return code
ERRDST INTEGER*4 Destination of error messages
TEMPREAL REAL*8 Real to store return of function

C calling sequence and parameter description:


double sim_mod_setaie (&ds, fcc, &value, euhigh, eulow, &error, &errdst)

where:
ds long dataset number (1--4)
fcc long Address of analog input
value double Value read in engineering units of the AI
point
euhigh double High engineering units of the point
eulow double Low engineering units of the point
error long Error return code
errdst long Destination of error messages

Original September 1995 50


UM25.0:SPE311
SIMVOX -- Version 2.3 Appendix D

Examples
FORTRAN:
integer*4 ds /1/
integer*4 error
integer*4 errdst /1/
integer*4 addr
real*8 value
real*8 euhigh
real*8 eulow
real*8 tempreal
...
addr = 31538
value = 30.0
euhigh = 0
eulow = 0
tempreal = sim_mod_setaie (ds, addr, value, euhigh, eulow, error, errdst)
...
tempreal = sim_mod_setaie (ds, 32512, value, euhigh, eulow, error, errdst)
...

Original September 1995 51


UM25.0:SPE311
SIMVOX -- Version 2.3 Appendix D

C:
long ds = 1;
long error;
long errdst = 1;
long addr;
double value;
double euhigh;
double eulow;

...
addr = 31212;
value = 55.0;
euhigh = 100.0;
eulow = 0.0;
sim_mod_setaie (&ds, addr, &value, &error, &euhigh, &eulow, &errdst);
...
sim_mod_setaie (&ds, 31212, &value, &error, &euhigh, &eulow, &errdst);
...

Original September 1995 52


UM25.0:SPE311
SIMVOX -- Version 2.3 Appendix D

SIM_MOD_SETAIP
Set an analog input in percent.

Format
FORTRAN calling sequence and parameter description:
TEMPREAL = SIM_MOD_SETAIP (DS, ADDR, VALUE, ERROR, ERRDST)

where:
DS INTEGER*4 dataset number (1--4)
ADDR INTEGER*4 Address of analog input
VALUE REAL*8 Percent (--25.0 to +100.0 or 0.0 to
+125.0 or --128.0 to +127.996) depending
on card type
ERROR INTEGER*4 Error return code
ERRDST INTEGER*4 Destination of error messages
TEMPREAL REAL*8 Real to store return of function

C calling sequence and parameter description:


double sim_mod_setaip (&ds, addr, &value, &error, &errdst)

where:
ds long dataset number (1--4)
addr long Address of analog input
value double Percent (--25.0 to +100.0 or 0.0 to
+125.0 or --128.0 to +127.996) depending
on card type
error long Error return code
errdst long Destination of error messages

Original September 1995 53


UM25.0:SPE311
SIMVOX -- Version 2.3 Appendix D

Examples
FORTRAN:
integer*4 ds /1/
integer*4 error
integer*4 errdst /1/
integer*4 addr
real*8 value
real*8 tempreal

...
addr = 34513
value = 30.0
tempreal = sim_mod_setaip (ds, addr, value, error, errdst)
...
tempreal = sim_mod_setaip (ds, 36512, value, error, errdst)
...

Original September 1995 54


UM25.0:SPE311
SIMVOX -- Version 2.3 Appendix D

C:
long ds = 1;
long error;
long errdst = 1;
long addr;
double value;

...
addr = 38513;
value = 30.0;
sim_mod_setaip (&ds, addr, &value, &error, &errdst);
...
sim_mod_setaip (&ds, 39518, &value, &error, &errdst);
...

Original September 1995 55


UM25.0:SPE311
SIMVOX -- Version 2.3 Appendix D

SIM_MOD_SETDI
Set a discrete input.

Format
FORTRAN calling sequence and parameter description:
TEMPINT = SIM_MOD_SETDI (DS, ADDR, VALUE, ERROR, ERRDST)

where:
DS INTEGER*4 dataset number (1--4)
ADDR INTEGER*4 Address of discrete input
VALUE INTEGER*4 (0 -- 1)
ERROR INTEGER*4 Error return code
ERRDST INTEGER*4 Destination of error messages
TEMPINT INTEGER*4 Integer to store return of function

C calling sequence and parameter description:


long sim_mod_setdi (&ds, addr, &value, &error, &errdst)

where:
ds long dataset number (1--4)
addr long Address of discrete input
value long (0 -- 1)
error long Error return code
errdst long Destination of error messages

Original September 1995 56


UM25.0:SPE311
SIMVOX -- Version 2.3 Appendix D

Examples
FORTRAN:
integer*4 ds /1/
integer*4 error
integer*4 errdst /1/
integer*4 addr
integer*4 value
integer*4 tempint

...
addr = 12241
value = 1
tempint = sim_mod_setdi (ds, addr, value, error, errdst)
...
tempint = sim_mod_setdi (ds, 12215, value, error, errdst)
...

Original September 1995 57


UM25.0:SPE311
SIMVOX -- Version 2.3 Appendix D

C:
long ds = 1;
long error;
long errdst = 1;
long addr;
long value;

...
addr = 11261;
value = 1;
sim_mod_setdi (&ds, addr, &value, &error, &errdst);
...
sim_mod_setdi (&ds, 11265, &value, &error, &errdst);
...

Original September 1995 58


UM25.0:SPE311
SIMVOX -- Version 2.3 Appendix D

SIM_MOD_SLEEP
This function is not supported in SIMVOX for Windows NT. It is provided for
compatmodility with existing code. It simply delays for 1 second before returning.

Format
FORTRAN calling sequence and parameter description:
CALL SIM_MOD_SLEEP ()

C calling sequence and parameter description:


sim_mod_sleep ()

Original September 1995 59


UM25.0:SPE311
SIMVOX -- Version 2.3 Appendix D

Examples
FORTRAN:

while (.TRUE.)
...

call sim_mod_sleep ()
endwhile

Original September 1995 60


UM25.0:SPE311
SIMVOX -- Version 2.3 Appendix D

C:

call sim_mod_wakeup ( ... )


while (TRUE)
{
...

sim_mod_sleep ();
}

Original September 1995 61


UM25.0:SPE311
SIMVOX -- Version 2.3 Appendix D

SIM_MOD_WAKEUP
This function is not supported in SIMVOX for Windows NT. It is provided for
compatmodility with existing code.

Original September 1995 62


UM25.0:SPE311
Appendix E

SIMVOX Library Subroutines


TI Siemens
This page intentionally blank
SIMVOX -- Version 2.3 Appendix E

LIBRARY INDEX
sim_ti_attach_ds (ds, error, errdst)
sim_ti_attach_multi_ds (ds, error, errdst)

sim_ti_dcd (ds, template, output, input, dcdnum, error, errdst,


trantime, tranpv)

sim_ti_delay (sec)

sim_ti_getaic (ds, addr, value, error, errdst)

sim_ti_getaie (ds, addr, value, euhigh, eulow, error, errdst)

sim_ti_getaip (ds, addr, value, error, errdst)

sim_ti_getaoc (ds, addr, value, error, errdst)

sim_ti_getaop (ds, addr, value, error, errdst)

sim_ti_getdi (ds, addr, value, error, errdst)

sim_ti_getdo (ds, addr, value, error, errdst)

sim_ti_getds ()
sim_ti_get_all_ds (flag)

sim_ti_loop (ds, pv, vo, gain, revact, errdst)

sim_ti_note (note)

sim_ti_setaic (ds, addr, value, error, errdst)

sim_ti_setaie (ds, addr, value, euhigh, eulow, error, errdst)

sim_ti_setaip (ds, addr, value, error, errdst)

sim_ti_setdi (ds, addr, value, error, errdst)

sim_ti_sleep ()

sim_ti_wakeup (number, units, error)

Original September 1995 1


UM25.0:SPE311
SIMVOX -- Version 2.3 Appendix E

This page intentionally blank

Original September 1995 2


UM25.0:SPE311
SIMVOX -- Version 2.3 Appendix E

SIM_TI_ATTACH_DS
Attach to a dataset. All programs must use this function to attach to a dataset. SIMVOX
calls do not work correctly without it. Attaching is done prior to all other SIMVOX calls
except sim_ti_getds and sim_ti_get_all_ds.

Format
FORTRAN calling sequence and parameter description:
CALL SIM_TI_ATTACH_DS (DS, ERROR, ERRDST)

where:
DS INTEGER*4 Dataset number (1--4)
ERROR INTEGER*4 Error return value
ERRDST INTEGER*4 Destination of error messages

C calling sequence and parameter description:


sim_ti_attach_ds (&ds, &error, &errdst);

where:
ds long Dataset number (1--4)
error long Error return value
errdst long Destination of error messages

Original September 1995 1


UM25.0:SPE311
SIMVOX -- Version 2.3 Appendix E

Examples
FORTRAN:
integer*4 ds /1/
integer*4 error
integer*4 errdst /1/

...
call sim_ti_attach_ds (ds, error, errdst)
...

Original September 1995 2


UM25.0:SPE311
SIMVOX -- Version 2.3 Appendix E

C:
long ds = 1;
long error;
long errdst = 1;

...
sim_ti_attach_ds (&ds, &error, &errdst);
...

Original September 1995 3


UM25.0:SPE311
SIMVOX -- Version 2.3 Appendix E

SIM_TI_ATTACH_MULTI_DS
Attach to multiple datasets. Gets all the datasets on the command line and attaches to
those datasets. Stores the attached datasets in the dataset array provided as the first
parameter.

Format
FORTRAN calling sequence and parameter description:
CALL SIM_TI_ATTACH_MULTI_DS (DS, ERROR, ERRDST)

where:
DS(4) INTEGER*4 Dataset array
ERROR INTEGER*4 Error return value
ERRDST INTEGER*4 Destination of error messages

C calling sequence and parameter description:


sim_ti_attach_multi_ds (ds, &error, &errdst);

where:
ds[4] long Dataset array
error long Error return value
errdst long Destination of error messages

Original September 1995 4


UM25.0:SPE311
SIMVOX -- Version 2.3 Appendix E

Examples
FORTRAN:
integer*4 ds(4)
integer*4 error
integer*4 errdst /1/
...
call sim_ti_attach_multi_ds (ds, error, errdst)
...

Original September 1995 5


UM25.0:SPE311
SIMVOX -- Version 2.3 Appendix E

C:
long ds [4];
long error;
long errdst = 1;

...
sim_ti_attach_multi_ds (ds, &error, &errdst);
...

Original September 1995 6


UM25.0:SPE311
SIMVOX -- Version 2.3 Appendix E

SIM_TI_DCD
Tieback DCD output patterns to input patterns. This function is called once for each
DCD to be resolved by the tieback program. SIMVOX Tools option allows automatic
creation of tieback programs.

Format
FORTRAN calling sequence and parameter description:
CALL SIM_TI_DCD (DS, TEMPLATE, OUTPUT, INPUT, DCDNUM, ERROR, ERRDST, TRANTIME,
TRANPV)

where:
DS INTEGER*4 Dataset number (1--4)
TEMPLATE(35) INTEGER*4 Thirty--five element array containing the
DCD template
OUTPUT (8) INTEGER*4 Eight element array containing the
addresses of the outputs
INPUT (16) INTEGER*4 Sixteen element array containing the
addresses of the inputs
DCDNUM INTEGER*4 Sequence number of the DCD (1--128)
ERROR INTEGER*4 Error return code
ERRDST INTEGER*4 Destination of error messages
TRANTIME INTEGER*4 Number of seconds to wait before setting
up the new PV on the inputs after a new
SP appears on the outputs
TRANPV INTEGER*4 PV to set up on the inputs during the
transition time (--32768 to +32767)

Original September 1995 7


UM25.0:SPE311
SIMVOX -- Version 2.3 Appendix E

C calling sequence and parameter description:


sim_ti_dcd (&ds, template, output, input, dcdnum, &error, &errdst, trantime, tranpv)

where:
ds long Dataset number (1--4)
template long[35] Thirty--five element array containing the
DCD template
output long[8] Eight element array containing the
addresses of the outputs
input long[16] Sixteen element array containing the
addresses of the inputs
dcdnum long Sequence number of the DCD (1--128)
error long Error return code
errdst long Destination of error messages
trantime long Number of seconds to wait before setting
up the new PV on the inputs after a new
SP appears on the outputs
tranpv long PV to set up on the inputs during the
transition time (--32768 to +32767)

The template used is defined as follows:

TEMPLATE (1) Number of setpoints (1--16)


(2) Number of outputs (1--8)
(3) Number of inputs (1--16)
(4--19) Discrete output patterns for each of the
16 possible setpoints (0--255)
(20--35) Discrete input patterns for each of the
16 possible setpoints (--32768 to +32767)

Original September 1995 8


UM25.0:SPE311
SIMVOX -- Version 2.3 Appendix E

Examples
FORTRAN:
integer*4 ds /1/
integer*4 error
integer*4 errdst /1/
integer*4 dcdnum
integer*4 trantime
integer*4 tranpv

integer*4 dcd_output (8 )
integer*4 dcd_input (16)
integer*4 template (35)

data dcd_output /4000,0,0,0,0,0,0,0/


data dcd_input /1005,1105,0,0,0,0,0,0,8*0/

data template /2,1,2,


1,0,14*0,
1,2,14*0/

...

trantime = 0
tranpv = 0
while (.TRUE.)
call sim_ti_dcd (ds, template, dcd_output, dcd_input, 1, error, errdst, trantime,
tranpv)

...

endwhile

Original September 1995 9


UM25.0:SPE311
SIMVOX -- Version 2.3 Appendix E

C:
long ds = 1;
long error;
long errdst = 1;
long dcdnum;
long trantime;
long tranpv;

long dcd_output [8] = {4000, 0, 0, 0, 0, 0, 0, 0 };


long dcd_input [16] = {1005, 1105, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0};

long template [35] = {2, 1, 2,


1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};

...

trantime = 0;
tranpv = 0;
while (TRUE)
{
sim_ti_dcd(&ds, template, dcd_output, dcd_input, 1, &error, &errdst, trantime,
tranpv);

...

Original September 1995 10


UM25.0:SPE311
SIMVOX -- Version 2.3 Appendix E

SIM_TI_DELAY
Put calling process to sleep for the specified amount of time. The time is specified in
seconds.

Format
FORTRAN calling sequence and parameter description:
CALL SIM_TI_DELAY (SEC)

where:
SEC REAL Number of seconds to delay

C calling sequence and parameter description:


sim_ti_delay (&sec)

where:
sec double Real Number of seconds to delay

Original September 1995 11


UM25.0:SPE311
SIMVOX -- Version 2.3 Appendix E

Examples
FORTRAN:

real*8 delay /5.0/

...

while (.TRUE.)
...

...

call sim_ti_delay (delay)


endwhile

Original September 1995 12


UM25.0:SPE311
SIMVOX -- Version 2.3 Appendix E

C:

double delay = 5.0;

...

while (TRUE)
{
...

sim_ti_delay (&delay);
}

Original September 1995 13


UM25.0:SPE311
SIMVOX -- Version 2.3 Appendix E

SIM_TI_GETAIC
Get an analog input in counts.

Format
FORTRAN calling sequence and parameter description:
TEMPINT = SIM_TI_GETAIC (DS, ADDR, VALUE, ERROR, ERRDST)

where:
DS INTEGER*4 dataset number (1--4)
ADDR INTEGER*4 Address of analog input
VALUE INTEGER*4 Number of counts (0--4095, or --32768 to
+32767 for WSI)
ERROR INTEGER*4 Error return code
ERRDST INTEGER*4 Destination of error messages
TEMPINT INTEGER*4 Integer to store return of function

C calling sequence and parameter description:


long sim_ti_getaic (&ds, addr, &value, &error, &errdst)

where:
ds long dataset number (1--4)
addr long Address of analog input
value long Number of counts (0--4095, or --32768 to
+32767 for WSI)
error long Error return code
errdst long Destination of error messages

Original September 1995 14


UM25.0:SPE311
SIMVOX -- Version 2.3 Appendix E

Examples
FORTRAN:
integer*4 ds /1/
integer*4 error
integer*4 errdst /1/
integer*4 addr
integer*4 value
integer*4 tempint

...
addr = 3567
tempint = sim_ti_getaic (ds, addr, value, error, errdst)
...
tempint = sim_ti_getaic (ds, 3856, value, error, errdst)
...

Original September 1995 15


UM25.0:SPE311
SIMVOX -- Version 2.3 Appendix E

C:
long ds = 1;
long error;
long errdst = 1;
long addr;
long value;

...
addr = 3851;
sim_ti_getaic (&ds, addr, &value, &error, &errdst);
...
sim_ti_getaic (&ds, 3856, &value, &error, &errdst);
...

Original September 1995 16


UM25.0:SPE311
SIMVOX -- Version 2.3 Appendix E

SIM_TI_GETAIE
Get the engineering unit value of the AI point specified.

Format
FORTRAN calling sequence and parameter description:
TEMPREAL = SIM_TI_GETAIE (DS, ADDR, VALUE, EUHIGH, EUHIGH, EULOW, ERRDST)

where:
DS INTEGER*4 dataset number (1--4)
ADDR INTEGER*4 Address of analog input
VALUE REAL*8 Value read in engineering units of the AI
point
EUHIGH REAL*8 High engineering units of the point
EULOW REAL*8 Low engineering units of the point
ERROR INTEGER*4 Error return code
ERRDST INTEGER*4 Destination of error messages
TEMPREAL REAL*8 Real to store return of function

C calling sequence and parameter description:


double sim_ti_getaie (&ds, addr, &value, euhigh, eulow, &error, &errdst)

where:
ds long dataset number (1--4)
addr long Address of analog input
value double Value read in engineering units of the AI point
euhigh double High engineering units of the point
eulow double Low engineering units of the point
error long Error return code
errdst long Destination of error messages

Original September 1995 17


UM25.0:SPE311
SIMVOX -- Version 2.3 Appendix E

Examples
FORTRAN:
integer*4 ds /1/
integer*4 error
integer*4 errdst /1/
integer*4 addr
real*8 value
real*8 euhigh
real*8 eulow
real*8 tempreal
...
addr = 3538
value = 0
euhigh = 0
eulow = 0
tempreal = sim_ti_getaie (ds, addr, value, euhigh, eulow, error, errdst)
...
tempreal = sim_ti_getaie (ds, 4528, value, euhigh, eulow, error, errdst)
...

Original September 1995 18


UM25.0:SPE311
SIMVOX -- Version 2.3 Appendix E

C:
long ds = 1;
long error;
long errdst = 1;
long addr;
double value;
double euhigh;
double eulow;

...
addr = 1222;
value = 55.0;
euhigh = 100.0;
eulow = 0.0;
sim_ti_getaie (&ds, addr, &value, &error, &euhigh, &eulow, &errdst);
...
sim_ti_getaie (&ds, 1212, &value, &error, &euhigh, &eulow, &errdst);
...

Original September 1995 19


UM25.0:SPE311
SIMVOX -- Version 2.3 Appendix E

SIM_TI_GETAIP
Get an analog input in percent.

Format
FORTRAN calling sequence and parameter description:
TEMPREAL = SIM_TI_GETAIP (DS, ADDR, VALUE, ERROR, ERRDST)

where:
DS INTEGER*4 dataset number (1--4)
ADDR INTEGER*4 Address of analog input
VALUE REAL*8 Percent (--25.0 to +100.0 or 0.0 to
+125.0 or --128.0 to +127.996) depending
on card type
ERROR INTEGER*4 Error return code
ERRDST INTEGER*4 Destination of error messages
TEMPREAL REAL*8 Real to store return of function

C calling sequence and parameter description:


double sim_ti_getaip (&ds, addr, &value, &error, &errdst)

where:
ds long dataset number (1--4)
addr long Address of analog input
value double Percent (--25.0 to +100.0 or 0.0 to
+125.0 or --128.0 to +127.996) depending
on card type
error long Error return code
errdst long Destination of error messages

Original September 1995 20


UM25.0:SPE311
SIMVOX -- Version 2.3 Appendix E

Examples
FORTRAN:
integer*4 ds /1/
integer*4 error
integer*4 errdst /1/
integer*4 addr
real*8 value
real*8 tempreal

...
addr = 3164
tempreal = sim_ti_getaip (ds, addr, value, error, errdst)
...
tempreal = sim_ti_getaip (ds, 3062, value, error, errdst)
...

Original September 1995 21


UM25.0:SPE311
SIMVOX -- Version 2.3 Appendix E

C:
long ds = 1;
long error;
long errdst = 1;
long addr;
double value;

...
addr = 3344;
sim_ti_getaip (&ds, addr, &value, &error, &errdst);
...
sim_ti_getaip (&ds, 3102, &value, &error, &errdst);
...

Original September 1995 22


UM25.0:SPE311
SIMVOX -- Version 2.3 Appendix E

SIM_TI_GETAOC
Get an analog output in counts.

Format
FORTRAN calling sequence and parameter description:
TEMPINT = SIM_TI_GETAOC (DS, ADDR, VALUE, ERROR, ERRDST)

where:
DS INTEGER*4 dataset number (1--4)
ADDR INTEGER*4 Address of analog output
VALUE INTEGER*4 Number of counts (0--4095)
ERROR INTEGER*4 Error return code
ERRDST INTEGER*4 Destination of error messages
TEMPINT INTEGER*4 Integer to store return of function

C calling sequence and parameter description:


long sim_ti_getaoc (&ds, addr, &value, &error, &errdst)

where:
ds long dataset number (1--4)
addr long Address of analog output
value long Number of counts (0--4095)
error long Error return code
errdst long Destination of error messages

Original September 1995 23


UM25.0:SPE311
SIMVOX -- Version 2.3 Appendix E

Examples
FORTRAN:
integer*4 ds /1/
integer*4 error
integer*4 errdst /1/
integer*4 addr
integer*4 value
integer*4 tempint

...
addr = 4025
tempint = sim_ti_getaoc (ds, addr, value, error, errdst)
...
tempint = sim_ti_getaoc (ds, 5028, value, error, errdst)
...

Original September 1995 24


UM25.0:SPE311
SIMVOX -- Version 2.3 Appendix E

C:
long ds = 1;
long error;
long errdst = 1;
long addr;
long value;

...
addr = 5228;
sim_ti_getaoc (&ds, addr, &value, &error, &errdst);
...
sim_ti_getaoc (&ds, 6224, &value, &error, &errdst);
...

Original September 1995 25


UM25.0:SPE311
SIMVOX -- Version 2.3 Appendix E

SIM_TI_GETAOP
Get an analog output in percent.

Format
FORTRAN calling sequence and parameter description:
TEMPREAL = SIM_TI_GETAOP (DS, ADDR, VALUE, ERROR, ERRDST)

where:
DS INTEGER*4 dataset number (1--4)
ADDR INTEGER*4 Address of analog output
VALUE REAL*8 Percent (--25.0 to +100.0)
ERROR INTEGER*4 Error return code
ERRDST INTEGER*4 Destination of error messages
TEMPREAL REAL*8 Real to store return of function

C calling sequence and parameter description:


double sim_ti_getaop (&ds, addr, &value, &error, &errdst)

where:
ds long dataset number (1--4)
addr long Address of analog output
value double Percent (--25.0 to +100.0)
error long Error return code
errdst long Destination of error messages

Original September 1995 26


UM25.0:SPE311
SIMVOX -- Version 2.3 Appendix E

Examples
FORTRAN:
integer*4 ds /1/
integer*4 error
integer*4 errdst /1/
integer*4 addr
real*8 value
real*8 tempreal

...
addr = 4312
tempreal = sim_ti_getaop (ds, addr, value, error, errdst)
...
tempreal = sim_ti_getaop (ds, 6416, value, error, errdst)
...

Original September 1995 27


UM25.0:SPE311
SIMVOX -- Version 2.3 Appendix E

C:
long ds = 1;
long error;
long errdst = 1;
long addr;
double value;

...
addr = 4012;
sim_ti_getaop (&ds, addr, &value, &error, &errdst);
...
sim_ti_getaop (&ds, 5436, &value, &error, &errdst);
...

Original September 1995 28


UM25.0:SPE311
SIMVOX -- Version 2.3 Appendix E

SIM_TI_GETDI
Get a discrete input.

Format
FORTRAN calling sequence and parameter description:
TEMPINT = SIM_TI_GETDI (DS, ADDR, VALUE, ERROR, ERRDST)

where:
DS INTEGER*4 dataset number (1--4)
ADDR INTEGER*4 Address of discrete input
VALUE INTEGER*4 (0 -- 1)
ERROR INTEGER*4 Error return code
ERRDST INTEGER*4 Destination of error messages
TEMPINT INTEGER*4 Integer to store return of function

C calling sequence and parameter description:


long sim_ti_getdi (&ds, addr, &value, &error, &errdst)

where:
ds long dataset number (1--4)
addr long Address of discrete input
value long (0 -- 1)
error long Error return code
errdst long Destination of error messages

Original September 1995 29


UM25.0:SPE311
SIMVOX -- Version 2.3 Appendix E

Examples
FORTRAN:
integer*4 ds /1/
integer*4 error
integer*4 errdst /1/
integer*4 addr
integer*4 value
integer*4 tempint

...
addr = 1116
tempint = sim_ti_getdi (ds, addr, value, error, errdst)
...
tempint = sim_ti_getdi (ds, 1152, value, error, errdst)
...

Original September 1995 30


UM25.0:SPE311
SIMVOX -- Version 2.3 Appendix E

C:
long ds = 1;
long error;
long errdst = 1;
long addr;
long value;

...
addr = 1151;
sim_ti_getdi (&ds, addr, &value, &error, &errdst);
...
sim_ti_getdi (&ds, 1152, &value, &error, &errdst);
...

Original September 1995 31


UM25.0:SPE311
SIMVOX -- Version 2.3 Appendix E

SIM_TI_GETDO
Get a discrete output.

Format
FORTRAN calling sequence and parameter description:
TEMPINT = SIM_TI_GETDO (DS, ADDR, VALUE, ERROR, ERRDST)

where:
DS INTEGER*4 dataset number (1--4)
ADDR INTEGER*4 Address of discrete output
VALUE INTEGER*4 (0 -- 1)
ERROR INTEGER*4 Error return code
ERRDST INTEGER*4 Destination of error messages
TEMPINT INTEGER*4 Integer to store return of function

C calling sequence and parameter description:


long sim_ti_getdo (&ds, addr, &value, &error, &errdst)

where:
ds long dataset number (1--4)
addr long Address of discrete output
value long (0 -- 1)
error long Error return code
errdst long Destination of error messages

Original September 1995 32


UM25.0:SPE311
SIMVOX -- Version 2.3 Appendix E

Examples
FORTRAN:
integer*4 ds /1/
integer*4 error
integer*4 errdst /1/
integer*4 addr
integer*4 value
integer*4 tempint

...
addr = 1412
tempint = sim_ti_getdo (ds, addr, value, error, errdst)
...
tempint = sim_ti_getdo (ds, 1419, value, error, errdst)
...

Original September 1995 33


UM25.0:SPE311
SIMVOX -- Version 2.3 Appendix E

C:
long ds = 1;
long error;
long errdst = 1;
long addr;
long value;

...
addr = 1412;
sim_ti_getdo (&ds, addr, &value, &value, &error, &errdst);
...
sim_ti_getdo (&ds, 1418, &value, &value, &error, &errdst);
...

Original September 1995 34


UM25.0:SPE311
SIMVOX -- Version 2.3 Appendix E

SIM_TI_GETDS
Get the dataset entered on the command line.

Format
FORTRAN calling sequence and parameter description:
TEMPINT = SIM_TI_GETDS ()

where:
TEMPINT INTEGER*4 Integer to store return of function

C calling sequence and parameter description:


long sim_ti_getds ()

Original September 1995 35


UM25.0:SPE311
SIMVOX -- Version 2.3 Appendix E

Examples
FORTRAN:
integer*4 ds
integer*4 error
integer*4 errdst

...

ds = sim_ti_getds ()
call sim_ti_attach_ds (ds, error, errdst)

...

Original September 1995 36


UM25.0:SPE311
SIMVOX -- Version 2.3 Appendix E

C:

long ds;
long error
long errdst

...

ds = sim_ti_getds ();
sim_ti_attach_ds (&ds, &error, &errdst);

...

Original September 1995 37


UM25.0:SPE311
SIMVOX -- Version 2.3 Appendix E

SIM_TI_GET_ALL_DS
Reads the command line into an internal string if the flag argument is TRUE and returns
the first dataset. On subsequent calls, the flag argument should be FALSE. This will
return any additional datasets. If the dataset returned is zero, there are no more datasets.

Format
FORTRAN calling sequence and parameter description:
TEMPINT = SIM_TI_GET_ALL_DS (FLAG)

where:
FLAG INTEGER*4 Flag indicating input from command line
TEMPINT INTEGER*4 Integer to store return of function

C calling sequence and parameter description:


long sim_ti_get_all_ds (flag)

where:
flag long Flag indicating input from command line

Original September 1995 38


UM25.0:SPE311
SIMVOX -- Version 2.3 Appendix E

Examples
FORTRAN:
integer*4 ds1, ds2
...
ds1 = sim_ti_get_all_ds (.TRUE.)
ds2 = sim_ti_get_all_ds (.FALSE.)

Original September 1995 39


UM25.0:SPE311
SIMVOX -- Version 2.3 Appendix E

C:

long flag;
long ds1, ds2;
{
...
flag = TRUE;
/* get the command line */
/* ds1 contains the first dataset in the command line */
ds1 = sim_ti_get_all_ds (flag);
flag = FALSE;
/* ds2 contains the next dataset in the command line */
ds2 = sim_ti_get_all_ds (flag);
}

Original September 1995 40


UM25.0:SPE311
SIMVOX -- Version 2.3 Appendix E

SIM_TI_LOOP
Tieback a loop analog output to analog input without any lag.

Format
FORTRAN calling sequence and parameter description:
CALL SIM_TI_LOOP (DS, PV, VO, GAIN, REVACT, ERRDST)

where:
DS INTEGER*4 Dataset number (1--4)
PV INTEGER*4 Address of process varitile or
analog input
VO INTEGER*4 Address of the valve
output or analog output
GAIN REAL*8 Loop sensitivity (average = 1.0)
REVACT INTEGER*4 0 for a direct--acting loop; 1 for a
reverse--acting loop
ERRDST INTEGER*4 Destination of error messages

C calling sequence and parameter description:


sim_ti_loop (&ds, pv, vo, gain, revact, &errdst)

where:
ds long Dataset number (1--4)
pv long Address of process
varitile or analog input
vo long Address of the valve
output or analog output
gain double Loop sensitivity (average = 1.0)
revact long 0 for a direct--acting loop; 1 for a
reverse--acting loop
errdst long Destination of error messages

Original September 1995 41


UM25.0:SPE311
SIMVOX -- Version 2.3 Appendix E

Examples
FORTRAN:
integer*4 ds /1/
integer*4 errdst /1/
integer*4 pv
integer*4 vo
real*8 gain
integer*4 revact

...
pv = 3721
vo = 4722
gain = 1.0
revact = 0
call sim_ti_loop (ds, pv, vo, gain, revact, errdst)
...

Original September 1995 42


UM25.0:SPE311
SIMVOX -- Version 2.3 Appendix E

C:
long ds = 1;
long errdst = 1;
long pv;
long vo;
double gain;
long revact;

...
pv = 3371;
vo = 4372;
gain = 1.0;
revact = 0;
sim_ti_loop (&ds, pv, vo, gain, revact, &errdst);
...

Original September 1995 43


UM25.0:SPE311
SIMVOX -- Version 2.3 Appendix E

SIM_TI_NOTE
Post a note to the message box.

Format
FORTRAN calling sequence and parameter description:
CALL SIM_TI_NOTE (NOTE)

where:
NOTE CHARACTER*(*) Note to be displayed

C calling sequence and parameter description:


sim_ti_note (note)

where:
note char[] Note to be displayed

Original September 1995 44


UM25.0:SPE311
SIMVOX -- Version 2.3 Appendix E

Examples
FORTRAN:

call sim_ti_note(Point found)

Original September 1995 45


UM25.0:SPE311
SIMVOX -- Version 2.3 Appendix E

C:
sim_ti_note(Point found);

Original September 1995 46


UM25.0:SPE311
SIMVOX -- Version 2.3 Appendix E

SIM_TI_SETAIC
Set an analog input in counts.

Format
FORTRAN calling sequence and parameter description:
TEMPINT = SIM_TI_SETAIC (DS, ADDR, VALUE, ERROR, ERRDST)

where:
DS INTEGER*4 dataset number (1--4)
ADDR INTEGER*4 Address of analog input
VALUE INTEGER*4 Number of counts (0--4095, or --32768 to
+32767 for WSI)
ERROR INTEGER*4 Error return code
ERRDST INTEGER*4 Destination of error messages
TEMPINT INTEGER*4 Integer to store return of function

C calling sequence and parameter description:


long sim_ti_setaic (&ds, addr, &value, &error, &errdst)

where:
ds long dataset number (1--4)
addr long Address of analog input
value long Number of counts (0--4095, or --32768 to
+32767 for WSI)
error long Error return code
errdst long Destination of error messages

Original September 1995 47


UM25.0:SPE311
SIMVOX -- Version 2.3 Appendix E

Examples
FORTRAN:
integer*4 ds /1/
integer*4 error
integer*4 errdst /1/
integer*4 addr
integer*4 value
integer*4 tempint

...
addr = 3122
value = 520
tempint = sim_ti_setaic (ds, addr, value, error, errdst)
...
tempint = sim_ti_setaic (ds, 212, value, error, errdst)
...

Original September 1995 48


UM25.0:SPE311
SIMVOX -- Version 2.3 Appendix E

C:
long ds = 1;
long error;
long errdst = 1;
long addr;
long value;

...
addr = 322;
value = 520;
sim_ti_setaic (&ds, addr, &value, &error, &errdst);
...
sim_ti_setaic (&ds, 3122, &value, &error, &errdst);
...

Original September 1995 49


UM25.0:SPE311
SIMVOX -- Version 2.3 Appendix E

SIM_TI_SETAIE
Set the engineering unit value of the AI point specified.

Format
FORTRAN calling sequence and parameter description:
TEMPREAL = SIM_TI_SETAIE (DS, ADDR, VALUE, EUHIGH, EUHIGH, EULOW, ERRDST)

where:
DS INTEGER*4 dataset number (1--4)
ADDR INTEGER*4 Address of analog input
VALUE REAL*8 Value read in engineering units of the AI
point
EUHIGH REAL*8 High engineering units of the point
EULOW REAL*8 Low engineering units of the point
ERROR INTEGER*4 Error return code
ERRDST INTEGER*4 Destination of error messages
TEMPREAL REAL*8 Real to store return of function

C calling sequence and parameter description:


double sim_ti_setaie (&ds, fcc, &value, euhigh, eulow, &error, &errdst)

where:
ds long dataset number (1--4)
fcc long Address of analog input
value double Value read in engineering units of the AI
point
euhigh double High engineering units of the point
eulow double Low engineering units of the point
error long Error return code
errdst long Destination of error messages

Original September 1995 50


UM25.0:SPE311
SIMVOX -- Version 2.3 Appendix E

Examples
FORTRAN:
integer*4 ds /1/
integer*4 error
integer*4 errdst /1/
integer*4 addr
real*8 value
real*8 euhigh
real*8 eulow
real*8 tempreal
...
addr = 338
value = 30.0
euhigh = 0
eulow = 0
tempreal = sim_ti_setaie (ds, addr, value, euhigh, eulow, error, errdst)
...
tempreal = sim_ti_setaie (ds, 3512, value, euhigh, eulow, error, errdst)
...

Original September 1995 51


UM25.0:SPE311
SIMVOX -- Version 2.3 Appendix E

C:
long ds = 1;
long error;
long errdst = 1;
long addr;
double value;
double euhigh;
double eulow;

...
addr = 3112;
value = 55.0;
euhigh = 100.0;
eulow = 0.0;
sim_ti_setaie (&ds, addr, &value, &error, &euhigh, &eulow, &errdst);
...
sim_ti_setaie (&ds, 312, &value, &error, &euhigh, &eulow, &errdst);
...

Original September 1995 52


UM25.0:SPE311
SIMVOX -- Version 2.3 Appendix E

SIM_TI_SETAIP
Set an analog input in percent.

Format
FORTRAN calling sequence and parameter description:
TEMPREAL = SIM_TI_SETAIP (DS, ADDR, VALUE, ERROR, ERRDST)

where:
DS INTEGER*4 dataset number (1--4)
ADDR INTEGER*4 Address of analog input
VALUE REAL*8 Percent (--25.0 to +100.0 or 0.0 to
+125.0 or --128.0 to +127.996) depending
on card type
ERROR INTEGER*4 Error return code
ERRDST INTEGER*4 Destination of error messages
TEMPREAL REAL*8 Real to store return of function

C calling sequence and parameter description:


double sim_ti_setaip (&ds, addr, &value, &error, &errdst)

where:
ds long dataset number (1--4)
addr long Address of analog input
value double Percent (--25.0 to +100.0 or 0.0 to
+125.0 or --128.0 to +127.996) depending
on card type
error long Error return code
errdst long Destination of error messages

Original September 1995 53


UM25.0:SPE311
SIMVOX -- Version 2.3 Appendix E

Examples
FORTRAN:
integer*4 ds /1/
integer*4 error
integer*4 errdst /1/
integer*4 addr
real*8 value
real*8 tempreal

...
addr = 3451
value = 30.0
tempreal = sim_ti_setaip (ds, addr, value, error, errdst)
...
tempreal = sim_ti_setaip (ds, 3651, value, error, errdst)
...

Original September 1995 54


UM25.0:SPE311
SIMVOX -- Version 2.3 Appendix E

C:
long ds = 1;
long error;
long errdst = 1;
long addr;
double value;

...
addr = 513;
value = 30.0;
sim_ti_setaip (&ds, addr, &value, &error, &errdst);
...
sim_ti_setaip (&ds, 3518, &value, &error, &errdst);
...

Original September 1995 55


UM25.0:SPE311
SIMVOX -- Version 2.3 Appendix E

SIM_TI_SETDI
Set a discrete input.

Format
FORTRAN calling sequence and parameter description:
TEMPINT = SIM_TI_SETDI (DS, ADDR, VALUE, ERROR, ERRDST)

where:
DS INTEGER*4 dataset number (1--4)
ADDR INTEGER*4 Address of discrete input
VALUE INTEGER*4 (0 -- 1)
ERROR INTEGER*4 Error return code
ERRDST INTEGER*4 Destination of error messages
TEMPINT INTEGER*4 Integer to store return of function

C calling sequence and parameter description:


long sim_ti_setdi (&ds, addr, &value, &error, &errdst)

where:
ds long dataset number (1--4)
addr long Address of discrete input
value long (0 -- 1)
error long Error return code
errdst long Destination of error messages

Original September 1995 56


UM25.0:SPE311
SIMVOX -- Version 2.3 Appendix E

Examples
FORTRAN:
integer*4 ds /1/
integer*4 error
integer*4 errdst /1/
integer*4 addr
integer*4 value
integer*4 tempint

...
addr = 122
value = 1
tempint = sim_ti_setdi (ds, addr, value, error, errdst)
...
tempint = sim_ti_setdi (ds, 1221, value, error, errdst)
...

Original September 1995 57


UM25.0:SPE311
SIMVOX -- Version 2.3 Appendix E

C:
long ds = 1;
long error;
long errdst = 1;
long addr;
long value;

...
addr = 161;
value = 1;
sim_ti_setdi (&ds, addr, &value, &error, &errdst);
...
sim_ti_setdi (&ds, 115, &value, &error, &errdst);
...

Original September 1995 58


UM25.0:SPE311
SIMVOX -- Version 2.3 Appendix E

SIM_TI_SLEEP
This function is not supported in SIMVOX for Windows NT. It is provided for
compattiility with existing code. It simply delays for 1 second before returning.

Format
FORTRAN calling sequence and parameter description:
CALL SIM_TI_SLEEP ()

C calling sequence and parameter description:


sim_ti_sleep ()

Original September 1995 59


UM25.0:SPE311
SIMVOX -- Version 2.3 Appendix E

Examples
FORTRAN:

while (.TRUE.)
...

call sim_ti_sleep ()
endwhile

Original September 1995 60


UM25.0:SPE311
SIMVOX -- Version 2.3 Appendix E

C:

call sim_ti_wakeup ( ... )


while (TRUE)
{
...

sim_ti_sleep ();
}

Original September 1995 61


UM25.0:SPE311
SIMVOX -- Version 2.3 Appendix E

SIM_TI_WAKEUP
This function is not supported in SIMVOX for Windows NT. It is provided for
compattiility with existing code.

Original September 1995 62


UM25.0:SPE311
Appendix F

SIMVOX ERROR MESSAGES


This page intentionally blank

10/03/95 64
SIMVOX -- Version 2.3 Appendix F

The following errors are generated by the SIMVOX library functions. In user programs, the error
destination argument in function calls determines where the error message goes. Currently, the
argument considers only two values: 0 or 1.

If the argument is 0, errors are not displayed at all. If the argument is 1 and the tieback/model is
attached to the terminal, error messages are displayed on the users terminal. It is recommended
practice to check tiebacks/models for errors before starting them from the menu system as
detached processes. The benefits are two fold. Firstly, SIMVOX functions cause a higher CPU
load when there are errors. And stating the obvious, secondly, the simulation does not function
correctly.

In section 6.4 of the manual, we presented the various errors and why they were caused. Why an
error is caused should inform the user of what action to take to correct the problem. Here the
error messages examples are presented to familiarize users with what to expect.

Error --1: Improperly Defined FCC

This error code informs the users that a F--C--C being referenced is not the correct type for the
calling function. The name of the calling function, the data set number, and the F--C--C in
question are displayed. For example, this error is generated if an AI is referenced as a DI. The
following are some examples:
GETAIP ERROR: data set 1, 10101 is not defined as AI
SETDI ERROR: data set 2, 120110 is not defined as DI
DCD ERROR: DCD #5, DO, data set 4, 71112 is not defined as DO

Error --2: FCC is out of range

This error code informs users that the referenced F--C--C is invalid. The name of the calling
function, the data set number, and the F--C--C in question are displayed. For example, this error
is generated if any of the F--C--C components are out of range. Valid ranges are 1--16 for files,
1--14 for cards, and 1--8 or 1--16 for channels (type dependent). When specifying F--C--C in
SIMVOX calls, two digits are used for each component. For example, file 1, card 1, and channel
1 will be represented as 10101 without the leading zero. File 16, card 14, and channel 16 will be
represented as 161416. The following are some examples of this error:
GETAIP ERROR: data set 2, 100217 is an invalid FCC
SETPCI ERROR: SETPCI #10, PCI, data set 6, 81010 is an invalid FCC
GETAOP ERROR: data set 2, 100916 is an invalid FCC

Original September 1995 1


UM25.0:SPE311
SIMVOX -- Version 2.3 Appendix F

Error --3: FCC is undefined

This error is generated if the referenced F--C--C is not defined in the specified simulated I/O file.
The name of the calling function, the data set number, and the F--C--C in question are displayed.
Here are some examples:
GETAIP ERROR: data set 2, 100216 is undefined
GETAOP ERROR: data set 2, 100908 is undefined
SETPCI ERROR: SETPCI #10, PCI, data set 6, 81008 is undefined

Error --4: Value is out of range for point type

This error is generated while setting values of input channels and the value is out of range. For
example, while setting a DI channel, a value other than 0 or 1 is specified. Similarly, while
setting an AI channel, a value outside of --25.0 to 100% or 0.0 to 125% is specified. The name
of the calling function, the data set number, the F--C--C in question is displayed. The following
are two examples:
SETAIP ERROR: data set 2, 100201 value 150.5 is out of range for type AI
SETDI ERROR: data set 1, 10101 value 8 is out of range for type DI

Error --5: DCD or PCI number is out of range

This error is generated specifically for DCD and PCI functions. Both of these functions have an
index number. Valid range for this index number is 1--255. If a call has a number outside this
range, this error is generated. The name of the calling function, the data set number, and the
index number in question is displayed. The following are two examples:
DCD ERROR: DCD #256, data set 4, number 256 is out of range
SETPCI ERROR: SETPCI #300, data set 6, number 300 is out of range

Error --6: Program is not attached to data set

If a program is not attached to a data set, it cannot reference any F--C--C in that data set. This
error is generated in those cases.
GETAOP ERROR: Program is not attached to data set 1
SETAIP ERROR: Program is not attached to data set 5
SETDI ERROR: Program is not attached to data set 6

Original September 1995 2


UM25.0:SPE311
SIMVOX -- Version 2.3 Appendix F

Error --7: data set number is out of range

If a specified data set number is outside the range of purchased data sets, this error is generated.
The program cannot access any F--C--C data in data sets in the system.
DCD ERROR: Data set 5 is out of range.
Valid range is 1 to 4.

SETAIP ERROR: Data set is out of range.


Valid range is 1 to 2.

This message is based on the number of data sets purchased by the user for this license of
SIMVOX.

Error --8: Insufficient Privilege to attach

If the user starting a program does not have WORLD privilege, the program will not be allowed
to attach to data sets. This error message is generated in those cases. Please see your VMS
System Manager to correct this problem.
DCD ERROR: Insufficient privilege. WORLD privilege is required
SETPCI ERROR: Insufficient privilege. WORLD privilege is required
GETDI ERROR: Insufficient privilege. WORLD privilege is required

Error --9: Unable to attach to data set

SIMVOX allows a maximum of 8 tiebacks and models active on each data set at any time. If the
user tries to exceed this by starting another program, SIMVOX will generate this error message.
ATTACH_DS ERROR: Unable to attach to data set 1.
Maximum of 8 Tiebacks/Models are already attached

Error --10: Invalid DCD Template

SIMVOX allows a maximum of 16 setpoints, 8 outputs, and 16 inputs to be specified in DCD


templates. If these ranges are exceeded, SIMVOX will generate this error message. The name of
the calling function, the data set number, and the DCD number in question is displayed.
DCD ERROR: DCD #123, data set 3, invalid number of SETPOINTS in Template
DCD ERROR: DCD #135, data set 3, invalid number of OUTPUTS in Template
DCD ERROR: DCD #160, data set 3, invalid number of INPUTS in Template

Original September 1995 3


UM25.0:SPE311
SIMVOX -- Version 2.3 Appendix F

This page intentionally blank

Original September 1995 4


UM25.0:SPE311
Appendix G

SIMVOX Functions
This page intentionally blank
SIMVOX -- Version 2.3 Appendix G

Average

Description:
The function will average all of the signals listed in the PV In tag list and the PV Out tag
list.

Usage:
Select the function by either clicking once on the function name to select it and press the
Add button or double click the Average function name in the list box to include this
function. Average is the default modeling function that is applied.

Deadtime

Description:
The Deadtime function performs a time based deadtime. The input to the Deadtime
object is stored and used as the function output after the specified time has passed.

Usage:
Select the function by either clicking once on the function name to select it and press the
Add button or double click the Deadtime function name in the list box to include this
function. A dialog will appear which will enable you to set the parameter values of this
function.

Parameters:

Time Value: The integer deadtime time value. It can


be any integer from 0 to 60 for minutes
and 0 to 3600 for seconds.
Units: The time value units designator. Select the M or S
radio button for minutes or seconds respectively.

Decay

Description:
The function simulates the decay of a physical quantity like temperature, pressure etc.
based on the input signal.

Usage:
Select the function by either clicking once on the function name to select it and press the
Add button or double click the Decay function name in the list box to include this
function. A dialog will appear which will enable you to set the parameter values of this
function.

Parameters:

Decay Time: The first order time filter for the decay.

Original September 1995 1


UM25.0:SPE311
SIMVOX -- Version 2.3 Appendix G

Decay Gain: The conversion factor for the decay.


Decay Ambient: The target value for the decay.

Filter1

Description:
This function performs first order filter lag between the last output and the current input to
determine current output. The returned value is the current output multiplied by the gain.

Usage:
Select the function by either clicking once on the function name to select it and press the
Add button or double click the Filter1 function name in the list box to include this
function. A dialog will appear which will enable you to set the parameter values of this
function.

Parameters:

Filter: The first order filter rate in seconds.


Gain: The unit conversion factor which converts the input
units to output units.
For example, to convert cfm input to gpm output
use a gain of 7.48 gal/cf.

Filter2

Description:
This function performs second order filter lag between the last output and the current
input to determine current output. The returned value is the current output multiplied by
the gain.

Usage:
Select the function by either clicking once on the function name to select it and press the
Add button or double click the Filter2 function name in the list box to include this
function. A dialog will appear which will enable you to set the parameter values of this
function.

Parameters:

Time Constant: The time constant in seconds.


Damping Factor: The damping factor for the input.
Gain: The unit conversion factor which converts the
input units to output units. For example, to
convert cfm input to gpm output use a gain of
7.48 gal/cf.

Integrate

Original September 1995 2


UM25.0:SPE311
SIMVOX -- Version 2.3 Appendix G

Description:
The function performs time based linear integration between the last output and the
current input and increments the total. The returned value is the current total. The
function is limited by the Engineering Units Low Value and the Capacity of the Vessel
that is defined.

Usage:
Select the function by either clicking once on the function name to select it and press the
Add button or double click the Integrate function name in the list box to include this
function. The Integrate function will use the Vessel Capacity for the upper limit for the
integration.

Invert Track

Description:
Invert Track inverts the input signal value from 0 to 1 or 1 to 0.

Usage:
Select the function by either clicking once on the function name to select it and press the
Add button or double clicking the Invert Track function name in the list box to include
this function.

Mass Xfer

Description:
The function performs time based mass transfer between the last output and the current
input and increments the total. The returned value is the current total. The function is
limited by the Engineering Units Low Value and the Capacity of the Vessel that is
defined.

Usage:
Select the function by either clicking once on the function name to select it and press the
Add button or double click the Mass Xfer function name in the list box to include this
function. The Mass Xfer function will use the Vessel Capacity for the upper limit for the
integration.

Maximum

Description:
The function will subtract the PV Out value (the value associated with the tag) from the
largest value in the PV In tag list.

Usage:
Select the function by either clicking once on the function name to select it and press the
Add button or double click the Maximum function name in the list box to include this
function.

Original September 1995 3


UM25.0:SPE311
SIMVOX -- Version 2.3 Appendix G

Minimum

Description:
The function will subtract the PV Out value (the value associated with the tag) from the
smallest value in the PV In tag list.

Usage:
Select the function by either clicking once on the function name to select it and press the
Add button or double click the Minimum function name in the list box to include this
function.

Polynomial

Description:
This function performs this third degree polynomial function on the input. The function uses the
following basic equation:

output = Const1 + Const2(input) +


Const3(input)2 + Const4(input)3

Usage:
Select the function by either clicking once on the function name to select it and press the
Add button or double click the Polynomial function name in the list box to include this
function. A dialog will appear which will enable you to set the parameter values of this
function.

Parameters:

Const1: The zero degree polynomial


floating point constant.
Const2: The first degree polynomial
floating point constant.
Const3: The second degree polynomial
floating point constant.
Const4: The third degree polynomial
floating point constant.

Track

Description:
Track is equivalent to Equate. The input signal value is assigned to the modeled object.

Usage:
Select the function by either clicking once on the function name to select it and press the
Add button or double click the Track function name in the list box to include this
function.

Original September 1995 4


UM25.0:SPE311
SIMVOX -- Version 2.3 Appendix G

Sum

Description:
Sum adds up all the pulse signals

Usage:
Select the function by either clicking once on the function name to select it and press the
Add button or double click the Sum function name in the list box to include this function.

Valve Hysteresis

Description:
The function simulates the action of a modulating valve based on the input signal. The
function limits the stroke between 0 and 100%. Therefore the output is limited to
between 0 and 100 times the gain.

Usage:
Select the function by either clicking once on the function name to select it and press the
Add button or double click the Hysteresis function name in the list box to include this
function. A dialog will appear which will enable you to set the parameter values of this
function.

Parameters:

Deadband: The valve hysteresis deadband


in percent.
Velocity Limit: The maximum valve speed in
percent per second.
Gain: The output unit conversion factor in
engineering units per percent.
This factor converts the percent valve
stroke into engineering units if required.
Stroke: The initial valve stroke position in percent.
The function limits the stroke to between 0
and 100%.

Original September 1995 5


UM25.0:SPE311
SIMVOX -- Version 2.3 Appendix G

This page intentionally blank

Original September 1995 6


UM25.0:SPE311
Appendix H

Addressing Schemes

-- 7 --
This page intentionally blank

-- 8 --
SIMVOX -- Version 2.3 Appendix H

Provox EIC
The address is a number representing the input or output of the tag in question. The file and
channel numbers may not exceed 16, while the card number may not exceed 14. The file, card,
and channel numbers are specified together to make up one number as follows:
FFCACH

Example 1 : An output at file 4, card 8, channel 1 would


look like:
40801 (Place holders must be
used on card and channel numbers less
than 10)

Example 2 : An output at file 1, card 14, channel 16 would


look like:
11416

Provox IDI
The address is a number representing the input or output of the tag in question. The file and
channel numbers may not exceed 16, while the card number may not exceed 14. The file, card,
and channel numbers are specified together to make up one number as follows:
FFCACH

Example 1 : An output at file 4, card 8, channel 1 would


look like:
40801. (Place holders must be
used on card and channel numbers less
than 10)

Example 2 : An output at file 1, card 14, channel 16 would


look like:
11416

Provox DM6004 VIOC


The address is a number representing the input or output of the tag in question. The file may not
exceed 16, the channel may not exceed 8, and the card number may not exceed 6. The file, card,
and channel numbers are specified together to make up one number as follows:
FFCACH

Example 1: An output at file 4, card 6, channel 1 would


look like:
40601. (Place holders must be
used on card and channel numbers)
Example 2: An output at file 11, card 6, channel 7 would
look like:
110607

Original September 1995 1


UM25.0:SPE311
SIMVOX -- Version 2.3 Appendix H

Allen Bradley PLC3/PLC5


The address is a string of alpha numeric values representing an input or output for the tag in
question. The first character of the PLC3 and PLC5 addresses is a type indicator. Discrete
outputs begin with the letter O, discrete inputs use the letter I. Immediately following the
type indicator is a colon and then the input word and bit (which are separated by a backslash) are
added.
The analog input and output types have the type indicator N followed by the file
number (0--64 for PLC3 and 7, 9--64 for PLC5). Immediately following the file number is a
colon followed by the integer word number. Analog output types must be defined as output in
the Simulated IO file.

Input and output addresses are specified in Octal. N table addresses are specified in
decimal

For example:
I : 0/0 ------ Input table, word 0, bit 0
I : 10/17 ------ Input table, word 8, bit 15
OR word 10, bit 17 (Octal)
I: 20/15 ------ Input table, word 16, bit 13
OR word 20, word 15 (Octal)

O : 0/0 ------ Output table, word 0, bit 0


O : 7/3 ------ Output table, word 7, bit 3
OR word 7, bit 3 (Octal)
O: 11/17 ------ Output table, word 9, bit 15
OR word 11, word 17 (Octal)

PLC3:
N: 0:10 N table 0, word 10
N: 7:56 N table 7, word 56

PLC5:
N: 6:5 Illegal!
N: 7:10 N table 7, word 10

So, a discrete output at Word 3, bit 9; a discrete input at Word 23, bit 0 and an analog input at file
16, Word 38 would appear as follows:
O:3/11 (discrete output)
I:23/0 (discrete input)
N16:38 (analog output/input).

Modicon MODBUS/MODBUS+
The address is a number representing the input or output of the tag in question. The size of the
number determines the type.

The types and the corresponding ranges are as follows:

Original September 1995 2


UM25.0:SPE311
SIMVOX -- Version 2.3 Appendix H

For Standard Addressing :


Discrete Output 1 to 4096.
Discrete Input 10001 to 14096.
Analog Input 30001 to 39999.
Analog Output 40001 to 64999.

For Extended Addressing :


Discrete Output 1 to 40960.
Discrete Input 100001 to 140960.
Analog Input 300001 to 399999.
Analog Output 400001 to 649999.

TI565 (NITP)
The address is an alpha numeric value representing the input or output in question. It is a
combination of an alphabet (or alphabets) and a number.

Discrete Input (X) 1 to 8192


Discrete Output (Y) 1 to 8192
Analog Input (WX) 1 to 8192
Analog Output (WY) 1 to 8192

Examples :
Y4765 is a discrete output address, WX256 is an analog input address, X11 is a discrete
input address, and WY7898 is an analog output address.

GE
The address is a number representing the input or output of the tag in question. The size of the
number determines the type.

The types and the corresponding ranges are as follows:

Discrete Output 1 to 4096.


Discrete Input 10001 to 14096.
Analog Input 30001 to 39999.
Analog Output 40001 to 64999.

Rosemount RS3

The address is an alpha numeric value representing the input or output in question. At the
address level, there is no distinction between an Analog vs. a Discrete address. The following
format is used:

CCLA

where C is the Controller designated by A--H (8 Controllers per File).

Original September 1995 3


UM25.0:SPE311
SIMVOX -- Version 2.3 Appendix H

C is the Cage designated by A--D (4 Cages per Line).


L is the Line number designated by 1--8 (8 Lines per Controller).
A is the address of the I/O, designated as follows:

For Old I/O, A = 1, 2, or 3.


For New I/O, A = 1 -- 16 (for MAO)
A = 1 -- 32 (for MDI)

Original September 1995 4


UM25.0:SPE311
Notes

Notes

Original September 1995 UM25.0:SPE311


Notes

Notes

UM25.0:SPE311 Original September 1995


This page intentionally left blank.
For more information, FAX (612) 895-2244

UM25.0:SPE311

Potrebbero piacerti anche