IMR3 - Programmer Guide
-
Upload
akukerenbgt -
Category
Documents
-
view
297 -
download
16
Transcript of IMR3 - Programmer Guide
8/10/2019 IMR3 - Programmer Guide
http://slidepdf.com/reader/full/imr3-programmer-guide 1/62
LK- ML -1003E
1All Rights Reserved. Copyright 2000, Omega Simulation Co.,Ltd
Instruction ManualLK-PP-1003E
Exatif DCS Interfacefor Training Simulator
(CENTUM CS 3000 Version)
Trademarks
• CENTUM is a registered trademark of Yokogawa Electric Corporation.
• Windows NT and Microsoft Visual C++ is registered trademark of Microsoft Corporation.
• Ethernet is a registered trademark of XEROX Corporation.
• Other brand names and product names are registered trademarks of the respective holders.
Table of Contents
INTRODUCTION................................................................ .......................................................... ...............3
1 EXATIF CS3000 FUNDAMENTALS ...................................................... .............................................4
1.1 Exatif CS3000 OVER VIEW .......................................................... ................................................ 4
1.2 Over View of Exatif CS3000 Functions......................... ............................................................... ..5
1.3 System Requirement .................................................... ................................................................ ...6
1.4 Restrictions......................................................................................................................................6
2 EXATIF CS3000 SPECIFICATIONS.............................................................. ...................................7
2.1 General design of LINK SOTWARE....... ................................................................ .......................7
2.1.1 Marshalling point determination .......................................................... ....................................7
2.1.2 The Typical LINK SOFTWARE configuration ........................................................... ............8
2.2 Data Transferring Functions.................................. ........................................................... ...............9
2.2.1 Tag-based access......... ................................................................ ........................................... 9
2.2.2 Marshalling ....................................................... ................................................................. ....9
2.3 RUN/FREEZE Function...................................................... .......................................................... 11
2.4 SNAPSHOT/STEPBACK Function............................. ................................................................ .11
2.5 Time Scale Change Function ............................................................. ........................................... 12
2.6 CENTUM CS 3000 Messages Acquiring Function................................................... ....................12
2.7 Capabilities....................................................................................................................................12
3 EXATIF CS3000 INTERFACE ........................................................ ................................................... 13
3.1 Guide Line for LINK SOFTWARE Development..................................................... .................13
3.2 Frame Header ...................................................... ............................................................. ...........13
8/10/2019 IMR3 - Programmer Guide
http://slidepdf.com/reader/full/imr3-programmer-guide 2/62
LK- ML -1003E
2All Rights Reserved. Copyright 2000, Omega Simulation Co.,Ltd
3.3 Individual Commands ........................................................ ......................................................... 14
3.3.1 RUN / FREEZE......................................... ................................................................ ...........14
3.3.2 FCS status Acquisition.......................................................... ............................................... 153.3.3 Tag Data Read....................... ................................................................ ...............................16
3.3.4 Tag Data Write ...................................................... ............................................................. ..23
3.3.5 Read Marshalling Area....................................................... .................................................. 26
3.3.6 Write Marshalling Area.................................. ............................................................... .......28
3.3.7 Marshalling Address Generation............ ..................................................................... .........30
3.3.8 Snapshot (Initial Condition Save) .................................................. ...................................... 31
3.3.9 Stepback (Initial Condition Load)........................................................... .............................32
3.3.10 Snapshot File Deletion ................................................................... ....................................33
3.3.11 Snapshot File Path Name Acquisition........ ................................................................ ........34
3.3.12 Time Scale Change ............................................................ ................................................ 35
3.3.13 DCS Messages Acquisition (Enable/Disable) ................................................................... .36
3.3.14 DCS Messages Acquisition........................................................... .....................................37
APPENDIX A – INSTALLATION PROCEDURE..................................................................................38
APPENDIX B–TIFH.H...............................................................................................................................44
APPENDIX C – FCZTIFSHM.H...............................................................................................................47
APPENDIX D –TIFRUN.C ........................................................................................................................49
APPENDIX E –TIFGETSTAT.C ..............................................................................................................51
APPENDIX F –MARSHALLING AREA DETAIL..................... ............................................................53
APPENDIX G – MARSHALLING AREA ACCESS...............................................................................57
8/10/2019 IMR3 - Programmer Guide
http://slidepdf.com/reader/full/imr3-programmer-guide 3/62
LK- ML -1003E
3All Rights Reserved. Copyright 2000, Omega Simulation Co.,Ltd
Introduction
As the demand for advanced production in a plant increases, the necessity for operator’s training system
still more increases. Exatif, DCS Interface for Training Simulator (CENTUM CS 3000 Version), is a
software package that enables to communicate to *1)CENTUM CS 3000 system for training simulator.
*1)CENTUM CS 3000 is a product of Yokogawa Electric Corporation (“Yokogawa”).
This manual is intended for operators of Exatif who are;
- Graduates of the CENTUM CS 3000 Engineer Training Course, or have equivalent knowledge.
- Familiar with the MS Windows NT.
- Familiar with the MS Visual C++.
Related Manuals
Refer to the following Yokogawa manuals for information on related topics.
- IM 33Q1C10-01E “CS 3000 Installation Manual ”
- IM 33S4N10-01E “CS 1000/CS 3000 Test Function Manual”
- IM 33S2H10-01E “CS 1000/CS 3000 Operation and Monitoring Function Message Manual”
- IM 33S1B30-01E “CS 1000/CS 3000 Reference Manual Field Control Station Basics (Part A - C)”
“CS 1000/CS 3000 Reference Manual Function Block Details (Part D)”
8/10/2019 IMR3 - Programmer Guide
http://slidepdf.com/reader/full/imr3-programmer-guide 4/62
LK- ML -1003E
4All Rights Reserved. Copyright 2000, Omega Simulation Co.,Ltd
1 Exatif CS3000 Fundamentals
1.1 Exati f CS3000 OVER VIEW
Exatif, DCS Interface for Training Simulator (CENTUM CS 3000 Version), is a software package that
enables to communicate to *1)CENTUM CS 3000 system for training simulator.
*1)CENTUM CS 3000 is a product of Yokogawa Electric Corporation (“Yokogawa”).
Fig.1 Configuration of Training Simulator
Fig.1 shows the typical configuration of Training Simulator. CENTUM CS 3000 System must be
composed of FCS simulators and HIS simulators, and will be provided by Yokogawa. Link-software
installed on PC1 connects Model computer to CENTUM CS 3000 system. 3rd party of simulator supplier
will provide the model computer.
This package comprises two interface functions (FCS I/F and HIS I/F shown in Fig.1), which are used to
access and control CENTUM CS 3000, and Microsoft Visual C++ libraries for link-software use.
The training simulator will give a feeling of being at the operator’s room, if link-software is developed bythis package in order to connect the dynamic simulator with CENTUM CS 30000 system.
PC3PC1
Model Computer
Windows NT 4.0
FCS simulator FCS simulator FCS simulator
100M Ethernet
PC2
Windows NT 4.0
HIS Simulator
Windows NT 4.0
Link software
Manager Dynamic
simulator
HIS I/F FCS I/F
ProjectDatabase
CS3000
Engineering function
Libraries
CENTUM CS 3000 system
8/10/2019 IMR3 - Programmer Guide
http://slidepdf.com/reader/full/imr3-programmer-guide 5/62
LK- ML -1003E
5All Rights Reserved. Copyright 2000, Omega Simulation Co.,Ltd
1.2 Over View of Exatif CS3000 Fun ctio ns
The following Table 1 shows the functions provided by FCS-I/F and HIS I/F.
Table 1. Function Table of Interface Software
No. FCS/HIS Function Exatif CS3000
Command
Description
1.1 Run/Freeze
command
Change status of function blocks in FCS
simulators. (Status: Run/Freeze)
1.2
Run /Freeze
FCS Status
Acquisition
Read status.
(Status: Run/Freeze)
Tag Data Read One-shot read FCS tag data.1.3 Data transfer
(Tag-basedone-shot
access)
Tag Data Write One-shot write FCS tag data.
Read Marshalling
Area
Read Marshalling area in FCS simulators
in order to read marshalling data quickly.
Write Marshalling
Area
Write Marshalling area in order to write
marshalling data, and marshalling
information.
1.4 Data transfer
(Marshaling)
Marshalling
Address Generation
Command FCS simulators to generate
marshalling address from marshalling
information.
Snapshot Save snapshot files from FCS to keep
situation.Stepback Load saved snapshot files for FCS to set up
situation.
Snapshot File
Deletion
Delete all of snapshot files.
1.5 Snapshot/
Stepback
Snapshot File Path
Name Acquisition
Get the path name, where snapshot files
are stored.
1.6
FCS-I/F
Time Scale
Change
Time Scale Change Change time scale of function blocks in
FCS simulators.
DCS Message
Acquisition
(Enable/Disable)
Enable and disable DCS message
acquisition.
2.1 HIS-I/F DCS Message
Acquisition
DCS Message Acquisition
Get operation messages and FCSmessages.
8/10/2019 IMR3 - Programmer Guide
http://slidepdf.com/reader/full/imr3-programmer-guide 6/62
LK- ML -1003E
6All Rights Reserved. Copyright 2000, Omega Simulation Co.,Ltd
1.3 System Requirement
Software:
“CENTUM CS 3000 LHS5425 Expanded Test Functions” is required.
For more detail please refer to the following manuals issued by Yokogawa.
- IM 33S4N10-01E “CS 1000/CS 3000 Test Function Manual”
And Microsoft Visual C++ 6.0 is required to develop link-software with the libraries provided by this
package.
Hardware:
Please refer to the following manuals issued by Yokogawa.
- IM 33S4N10-01E “CS 1000/CS 3000 Test Function Manual” and IM 33Q1C10-01E “CS 3000
Installation Manual ”.
1.4 Restr ict ion s
A. Optional Packages and Customized Software of CENTUM CS 3000
In the case that optional package(s) or customized software of CENTUM CS 3000 system, this package
may not support those portions.
B. CENTUM CS 3000 system for Training Simulator
CENTUM CS 3000 must be composed of FCS simulator(s) and HIS simulator(s). And they may differ
from actual ones. For more information, please contact with DCS supplier, Yokogawa Electric
Corporation.
D. Attention for DCS engineering
Please note that it would take some cost to convert from the actual DCS configuration to the training
simulator.
E. Others
The CENTUM CS 3000 function blocks, which have SEBOL function, are not saved in snapshot files.
8/10/2019 IMR3 - Programmer Guide
http://slidepdf.com/reader/full/imr3-programmer-guide 7/62
LK- ML -1003E
7All Rights Reserved. Copyright 2000, Omega Simulation Co.,Ltd
2 Exatif CS3000 Specifications
2.1 General design of LINK SOTWARE
2.1.1 Marshalling point determination
First of all, it is important to determine the points (called “Marshalling Points”) to transfer data between
Model Computer and CS3000 FCS simulator. Basically, the input/output terminals defined in FCS
simulators are determined as marshalling points.
For more detail about function blocks in CS3000 FCS simulators, please see IM 33S1B30-01E “CS
1000/CS 3000 Reference Manual “Field Control Station Basics (Part A - C)” and “Function Block Details
(Part D)” issued by Yokogawa.
Fig.2.1 Example of Analog Input/Output
The analog marshalling points are determined as below for the above example.
<<PUT>> <<GET>>PI100.RAW FIC100.MVFIC100.RAW FIC200.MVTIC200.RAWFIC200.RAW
NOTE
“Input processing” definition of each function block must be defined as “LINEAR” in order to PUT data
to RAW item as it is.
Example; Digital Input/Output
The digital marshalling points are determined as below, in case that %Z012101is defined as digital input
terminal, and %Z013101 is defined as digital output terminal.
<<PUT>> <<GET>>%Z011201.PV %Z011301.PV
FIC100
PID
TIC200
PID
PI100
PVI
FIC200
PID
%Z011101 %Z011102 %Z011103 %Z011104 %Z011110%Z011109
%Z****** is CS3000 FCS Input/Output terminal.
Example; Analog Input/Output
8/10/2019 IMR3 - Programmer Guide
http://slidepdf.com/reader/full/imr3-programmer-guide 8/62
LK- ML -1003E
8All Rights Reserved. Copyright 2000, Omega Simulation Co.,Ltd
2.1.2 The Typical LINK SOFTWARE configuration
Fig.2.2 The typical LINK SOFTWARE configuration
The typical LINK SOFTWARE configuration is shown in Fig.2.2.
As shown in Fig.2.1, LINK SOFTWARE is composed of three (3) processes.
(1) Manager Part
This part manages “Data Transferring” part and “DCS Messages Acquisition” part, and performs
“Control commands” to CS3000 system. “Control commands” are shown below.
- Run/Freeze
- Snapshot/Stepback
- Time Scale Change
(2) Data Transferring Part
This part transfers data between LINK SOFTWARE data buffer and CS3000 system.
(3) DCS Message Acquisition Part
This part acquires DCS Messages from CS3000 system.
LINK SOFTWARE
Manager
Data
Transferring
DCS Message
Acquisition
CS3000
Control commands
DCS Message Acquisition
Data Transferring
8/10/2019 IMR3 - Programmer Guide
http://slidepdf.com/reader/full/imr3-programmer-guide 9/62
LK- ML -1003E
9All Rights Reserved. Copyright 2000, Omega Simulation Co.,Ltd
2.2 Data Transferr ing Func t ions
This function allows link software to transfer data between Model Computer and FCS simulator(s) of
CENTUM CS 3000 system. And this provides the two data transferring schemes. One is tag-based access,
which is simple but slow. The other is marshalling method, which is intended to transfer bulk data
quickly.
NOTE
- All of function blocks in FCS simulators work every one-second. Therefore data transferring cycle
should be one-second, or longer.
2.2.1 Tag-based access
Exatif CS3000 provides the following two (2) commands to access the specified tag data on one-shot.
(1) Tag data read
Send read command with “tag name + data item” through Exatif CS3000 then, FCS returns current data.
(2) Tag data write
Send write command with “tag name + data item + data” through Exatif CS3000 then, FCS receives data.
These commands allow transferring 64 data per one (1) FCS at one-time.
2.2.2 Marshalling
Exatif CS3000 FCS I/F provides the function transferring bulk data quickly, called marshalling. The
procedure to use marshalling method is shown below.
1. First of all, marshalling information should be written into the specified area, called “Marshalling
Information”, in FCS simulators.
“Marshalling information” requires tag name (for example “FIC100”), item name (for example
“RAW”) and data type (for example Floating 32 bits). Please note that this “data type” presents data
type you have, not the data type in tag-items. Therefore users do not need to consider the actual data
type of tag-item. (Please refer to Appendix-F for detail about Marshalling information)
Marshalling information is written by “write marshalling Area” command.
2. After written Marshalling information into FCS simulator, “Marshalling Address Generation”
command is performed. Then FCS I/F function creates internal marshalling information.
8/10/2019 IMR3 - Programmer Guide
http://slidepdf.com/reader/full/imr3-programmer-guide 10/62
LK- ML -1003E
10All Rights Reserved. Copyright 2000, Omega Simulation Co.,Ltd
3. During “RUN” mode, FCS I/F function transfers data between FCS tag database and “Marshalling data
area” in accordance with the “Marshalling information”, shown in Fig.2.3.This data transferring cycle is synchronized with FCS execution cycle, and always one-second.
Fig.2.3 Marshalling Function
4. Therefore, LINK SOFTWARE reads “Marshalling data area (GET)”, and writes PUT area every
one-second in order to transfer data between Model Computer and specified tag-items in CS3000. And
“Marshalling data area” can be read/written by “write marshalling Area” command.
NOTE
- There is no way to synchronize LINK SOFTWARE with FCS execution cycle.
- The character data can not be selected as marshalling points.
FCS simulator
Marshalling Information 1(PUT)
Marshalling Information 2(PUT)
….
Marshalling Information 2048(PUT)
Marshalling Information 1(GET)
Marshalling Information 2(GET)
….
Marshalling Information 2048(GET)
Marshalling data 1 (PUT)
Marshalling data 2 (PUT)
….
Marshalling data 2048(PUT)
Marshalling data 1(GET)Marshalling data 2(GET)
….
Marshalling data 2048(GET)
FCS I/F
function
Marshalling Information Table
FCS Tag
database
8/10/2019 IMR3 - Programmer Guide
http://slidepdf.com/reader/full/imr3-programmer-guide 11/62
LK- ML -1003E
11All Rights Reserved. Copyright 2000, Omega Simulation Co.,Ltd
2.3 RUN/FREEZE Fun ctio n
This function allows link software to change status of all of the function blocks in FCS simulators at
anytime. Run command makes all of function blocks to work, and Freeze command makes all of function
blocks to suspend.
And Exatif CS3000 provides the command to read the status.
NOTE
- When FCS simulators start, they are in FREEZE mode.
- When these commands are sent to I/F, it is better to set destination station “broadcast address
(0xffff)”.
2.4 SNAPSHOT/STEPBACK Fun ctio n
This function allows link software to save snapshot files to keep the situation relating FCS simulators.
And they can be loaded in order to setup the saved situation.
NOTE
- When these commands are sent to I/F, it is better to set destination station “broadcast address
(0xffff)”
- Time scale must be set as one (1) immediately after stepback command is performed.
- These snapshot files are temporary, and if some of them are needed to store as initial condition files,
they can be copied. The path name in PC can be acquired by “path name acquisition command”.
And it answers the path name in two (2) ways, in shot an absolute path name and a relative path
name are answered.
The snapshot files are saved under the CS3000 project database. So if the Link software works on
the PC which has CS3000 project database, an absolute path name is useable.
- Exatif CS3000 does not delete snapshot files automatically. Therefore they must be deleted by
“delete command”, if necessary.
- Regarding the saved item in FCS simulator, please refer to IM 33S4N10-01E “CS 1000/CS 3000
Test Function Manual”. For example, data in SEBOL block are not saved in snapshot files.
8/10/2019 IMR3 - Programmer Guide
http://slidepdf.com/reader/full/imr3-programmer-guide 12/62
LK- ML -1003E
12All Rights Reserved. Copyright 2000, Omega Simulation Co.,Ltd
2.5 Time Scale Change Funct ion
This function allows link software to change time scale of FCS simulators. The “real” execution cycle of
FCS simulator is not changed, but the internal time scale factor is changed.
And the time scale value must be the following value; 1, 2, 4, 8, 1/2, 1/4, 1/8.
NOTE
- When FCS simulators start, their time scale value is one (1).
- When this command is sent to I/F, it is better to set destination station “broadcast address (0xffff)”
2.6 CENTUM CS 3000 Messages Ac quir in g Func t ion
This function allows link software to acquire messages from CENTUM CS 3000.
The messages described in IM 33S2H10-01E “CS 1000/CS 3000 Operation and Monitoring Function
Message Manual” can be acquired.
NOTE
- When HISs starts, they are disabled.
Therefore “enable command for HIS” is required to acquire the message.
- “Enable command for HIS” should be performed for only one (1) HIS. Because if “enable command
for HIS” is performed for more than one (1) HIS, they will send the same messages.
2.7 Capabil i t ies
Item Maximum Remarks
Number of marshaling PUT data :2048 data/FCSGET data :2048 data/FCS
Performance depends on hardwarespecification and so on.
Number of snapshot files 9999 files Number depends on hard diskcapacity.
Time scale change Time scale should be the following value;1, 2, 4, 8, 1/2, 1/4, 1/8
8/10/2019 IMR3 - Programmer Guide
http://slidepdf.com/reader/full/imr3-programmer-guide 13/62
LK- ML -1003E
13All Rights Reserved. Copyright 2000, Omega Simulation Co.,Ltd
3 Exatif CS3000 Interface
This chapter describes Exatif CS3000 Interface structure for LINK SOFTWARE development.
3.1 Guide Line for LINK SOFTWARE Development
All commands provided by Exatif CS3000 are performed as following;
- Create command frame.
- Open I/F by VhfOpen() function.
- Register v_apcmd ID by VhfIoctl() function.
- Write command frame by VhfWrite() function.
- Read answer frame by VhfRead() function.
- Close I/F by VhfClose() function.
The simple sample programs are shown in Appendix C & D.
3.2 Frame Header
Frame header described below is common for all frames.
NOTE
Byte order of frame header is depends on the computer, which generates this. If the computer is bigendian machine, the header must be created in big endian. If the computer is little endian machine, the
header must be created in little endian.
V_FRAME
v_reqid (0x0000 0000) 0x00
v_hochec/v_getrsp VHOC_NERSIG (=0x0001) (0x0000) 0x04
dummy (0x0000 0000) 0x08
v_dstn/v_sstn (**) (0x0000) 0x0c
v_lenf/v_cntf (0x0000) (0x0000) 0x10
v_hdsum/v_dtsum (0x0000) (0x0000) 0x14
v_type/v_sts/v_echo (**) (0x00) (0x0000) 0x18
v_apcmd/v_apwl (**) (*) 0x1c
v_data[1014] 0x20
AP command (**)(***)
(*) v_apwl: The word length for v_data part.
(**) v_dstn/ v_type/ v_apcmd: Please refer to “3.3 individual commands” for detail.
(***) Always BIG ENDIAN is required for this part.
8/10/2019 IMR3 - Programmer Guide
http://slidepdf.com/reader/full/imr3-programmer-guide 14/62
LK- ML -1003E
14All Rights Reserved. Copyright 2000, Omega Simulation Co.,Ltd
3.3 Indiv idual Command s
3.3.1 RUN / FREEZE
(1) LINK SOFTWARE => CS3000
v_dstn: 0xffff(broadcast)
v_type:VTP_PUT(=0)
v_apcmd: VAP_ENG_APC32(=0x0f1f)
v_data[](AP command): big endian
v_data[]U16 Request No. (=1) 0x00
U16 command 0x02
0x04
Command: 0 = Freeze command
1 = Run command
(2) CS3000 => LINK SOFTWARE
No response
8/10/2019 IMR3 - Programmer Guide
http://slidepdf.com/reader/full/imr3-programmer-guide 15/62
LK- ML -1003E
15All Rights Reserved. Copyright 2000, Omega Simulation Co.,Ltd
3.3.2 FCS status Acquisition
(1) LINK SOFTWARE => CS3000
v_dstn: domain No. (upper 8 bits) + FCS station No. (lower 8 bits)
v_type: VTP_PUT(=0)
v_apcmd: VAP_ENG_APC32(=0x0f1f)
v_data[](AP command): big endian
v_data[]
U16 Request No. (=12) 0x00
0 0x02
0x04
(2) CS3000 => LINK SOFTWARE
v_apcmd: VAP_ENG_APC32(=0x0f1f)
v_type: VTP_PUT
v_data[](AP command): big endian
v_data[]
U16 Request No. (=12) 0x00
1 0x02
Return Code 0x04
RUN/FREEZE status 0x06
0x08
Return Code: 0 = The operation succeeded.
0 != The operation failed.
RUN/FREEZE status: 0 = FREEZE
1 = RUN
8/10/2019 IMR3 - Programmer Guide
http://slidepdf.com/reader/full/imr3-programmer-guide 16/62
LK- ML -1003E
16All Rights Reserved. Copyright 2000, Omega Simulation Co.,Ltd
3.3.3 Tag Data Read
(1) LINK SOFTWARE => CS3000
v_dstn:domain No. (upper 8 bits) + FCS station No. (lower 8 bits)
v_type:VTP_GET(=8)
v_apcmd:VAP_PRCS_DBDATIO(=0x0300)
v_data[](AP command):big endian
v_data[]
0 subID(=1) 0x00
Code(=1) Func(=1) 0x02
Aread No.(=1) Access Code 0x04
0 0 0x06
0 0x08
0 0x0a
0 0x0c
0 0x0e
0 0x10
0 0x12
0 0x14
No. of Data (n) 0x16
0x18Requested Tag Parameter (1)
0x38Requested Tag Parameter (2)
----------
Requested Tag Parameter (n)
Access Code : Security mode on HIS
=1 : OFF
=2 : ON
=3 : ENG
=8 : Full access
No. Of Data:Number of data to read(maximum 62)
8/10/2019 IMR3 - Programmer Guide
http://slidepdf.com/reader/full/imr3-programmer-guide 17/62
LK- ML -1003E
17All Rights Reserved. Copyright 2000, Omega Simulation Co.,Ltd
Request Tag parameter
U8[16] 0x00
Tag Name
0x02
0x04
0x06
0x08
0x0a
0x0c
0x0e
U32 0x10
0
0x12
U8[8] 0x14
0x16
0x18
Item Name
0x1a
0/ Dimension Parameter 1 0x1c
0/ Dimension Parameter 2 0x1e
0x20
Dimension parameter:If data is scalar type data, “0” (zero). If dimension type data, dimension parameter.
(start from 1)
One dimension data : parameter =1, 0 ( “0” instead of “2” )
Two dimension data : parameter =1, 2
8/10/2019 IMR3 - Programmer Guide
http://slidepdf.com/reader/full/imr3-programmer-guide 18/62
LK- ML -1003E
18All Rights Reserved. Copyright 2000, Omega Simulation Co.,Ltd
(2) CS3000 => LINK SOFTWARE
v_apcmd:VAP_PRCS_DBDATIO(=0x0300)v_type:VTP_GETANS(=0xc)
v_data[](AP command):big endian
v_data[]
0 subID(=1) 0x00
Code(=1) Func(=1) 0x02
Aread No.(=1) Access Code 0x04
0 0 0x06
Return Code 0x08
0 0x0a
0 0x0c
0 0x0e
0 0x10
0 0x12
Total Size of Return Parameter 0x14
No. of Data(n) 0x16
0x18Return Data (1)
0x30Return Data (2)
----------
Return Data (n)
Return Code : =0 : normal
!= 0 : not normal( no return data attached in this case)
(Note)This is error check result for requested header.
No. of Data:Number of data to read.
8/10/2019 IMR3 - Programmer Guide
http://slidepdf.com/reader/full/imr3-programmer-guide 19/62
LK- ML -1003E
19All Rights Reserved. Copyright 2000, Omega Simulation Co.,Ltd
Return Data :
U16 0 0x00
0 0x02
Return Code 0x04
DataType Size 0x06
U8[16] 0x08
0x0a
0x0c
0x0e
0x10
0x12
0x14
Reference data
(FcDbDataValue)
0x16
0x18
Return Code : =0 : normal
: != 0 : not normal
(note) This is error check result for requested header.
Data Type : Data type of data which has read.
Size : Data size of data which has read.
Reference data: Following common definition is made.
Union FcDbDataValue {I16 sint16; /* 2 bytes integer with +- sign */U16 uint16; /* 2 bytes integer without +- sign */I32 sint32; /* 4 bytes integer with +- sign */U32 uint32; /* 4 bytes integer without +- sign */F32 float32; /* single precision floating point */F64 float64; /* double precision floating point */BYTE string[16]; /* string character */I16S sint16s; /* 2 bytes integer with +- sign with data status */U16S uint16s; /* 2 bytes integer without +- sign with data status */I32S sint32s; /* 4 bytes integer with +- sign with data status */U32S uint32s; /* 4 bytes integer without +- sign with data status */F32S float32s; /* single precision floating point with data status */F64S float64s; /* double precision floating point with data status */F32SR float32sr; /* single precision floating point with data status with range */TCS counts; /* counter with data status */ALRM alrm; /* alarm value */
} ;sint16/uint16:
8/10/2019 IMR3 - Programmer Guide
http://slidepdf.com/reader/full/imr3-programmer-guide 20/62
LK- ML -1003E
20All Rights Reserved. Copyright 2000, Omega Simulation Co.,Ltd
I16 or U16 integer 0x00
0x02
Sint32/uint32:
I32 or U32 0x00integer
0x02
0x04
Float32:
F32 0x00Single precision floating point
0x02
0x04
Float64:
F64 0x00
0x02
0x04
Single precision floating point
0x06
0x08
Sint32/uint32:
F64 0x00
0x02
0x04
Double precision floating point
0x06
0x08
sint16s/uint16s:
I16 or U16 integer 0x00
0 0x02
0x04Data status
0x06
0x08
Sint32s/uint32s:I32 or U32 0x00integer
0x02
0x04Data status
0x06
0x08
Float32s:
F32 0x00Single precision floating point
0x02
Data status 0x04
8/10/2019 IMR3 - Programmer Guide
http://slidepdf.com/reader/full/imr3-programmer-guide 21/62
LK- ML -1003E
21All Rights Reserved. Copyright 2000, Omega Simulation Co.,Ltd
0x06
0x08
Float64s:
F64 0x00
0x02
0x04
Double precision floating point
0x06
0x06Data status
0x08
0x0a
Float32sr
F32 0x00Single precision floating point
0x02
0x04Data status
0x06
F32 0x08Scale high
0x0a
F32 0x0cScale low
0x0e
0x10
string[16]:
U8[16] First character Second character 0x00
Third character 0x02
0x04
0x06
0x08
0x0a
0x0c
16 th character 0x0e
0x10
Last unnecessary space must be NULL
counts:U16 Counter value 0x00
U16 Time stamp 0x02
0x04Data status
0x06
0x08
alrm:
U8[8] 0x00
0x02
Alarm name
0x04
8/10/2019 IMR3 - Programmer Guide
http://slidepdf.com/reader/full/imr3-programmer-guide 22/62
LK- ML -1003E
22All Rights Reserved. Copyright 2000, Omega Simulation Co.,Ltd
0x06
AOSF mode AFLS mode 0x08
U16 0 0x0a
0x0cData status
0x0e
0x10
Alarm Name: Most critical current alarm
AOFS mode : All alarm control = 1, Not all alarm control = 0
AFLS mode : Alarm flashing = 1, Not alarm flashing = 0
Data Status: Please refer to IM 33S1B30-01E “CS 1000/CS 3000 Reference Manual Field
Control Station Basics”.
8/10/2019 IMR3 - Programmer Guide
http://slidepdf.com/reader/full/imr3-programmer-guide 23/62
LK- ML -1003E
23All Rights Reserved. Copyright 2000, Omega Simulation Co.,Ltd
3.3.4 Tag Data Write
(1) LINK SOFTWARE => CS3000
v_dstn:domain No. (upper 8 bits) + FCS station No. (lower 8 bits)
v_type:VTP_GET(=8)
v_apcmd:VAP_PRCS_DBDATIO(=0x0300)
v_data[](AP command):big endian
v_data[]
0 subID(=1) 0x00
Code(=2) Func(=1) 0x02
Aread No.(=1) Access Code 0x04
0 0 0x06
0 0x08
0 0x0a
0 0x0c
0 0x0e
0 0x10
0 0x12
0 0x14
No. of Data(n) 0x16
0x18Requested Tag Parameter (1)
0x38Requested Set Point Parameter (1)
0x50Requested Tag Parameter (2)
0x70Requested Set Point Parameter (2)
--------------
Requested Tag Parameter (n)
Requested Set Point Parameter (n)
8/10/2019 IMR3 - Programmer Guide
http://slidepdf.com/reader/full/imr3-programmer-guide 24/62
LK- ML -1003E
24All Rights Reserved. Copyright 2000, Omega Simulation Co.,Ltd
Access Code : Refer to “Tag Data Read”
No. Of Data:Refer to “Tag Data Read”
Requested Tag Parameter : Refer to “Tag Data Read”
Requested Tag Parameter:
0 0x00
Request Type 0x02
0 0x04
Data Type Size 0x06
U8[16] 0x08
0x0a
0x0c
0x0e
0x10
0x12
0x14
Set Point Data
0x16
0x20
Request Type: Identification of Request
Set Request : =1
Availability Check for Set: =2
Data Type: Refer to “Tag Data Read”
Size : Refer to “Tag Data Read”
Set Point Data: Refer to “Tag Data Read”
8/10/2019 IMR3 - Programmer Guide
http://slidepdf.com/reader/full/imr3-programmer-guide 25/62
LK- ML -1003E
25All Rights Reserved. Copyright 2000, Omega Simulation Co.,Ltd
(2) CS3000 => LINK SOFTWARE
v_apcmd:VAP_PRCS_DBDATIO(=0x0300)v_type:VTP_GETANS(=0xc)
v_data[](AP command):big endian
v_data[]
0 subID(=1) 0x00
Code(=2) Func(=1) 0x02
Aread No.(=1) Access Code 0x04
0 0 0x06
Return Code 0x08
0 0x0a
0 0x0c
0 0x0e
0 0x10
0 0x12
Returned Parameter Size 0x14
No. of Data(n) 0x16
Return Data (1) 0x18
0x20Return Data (2)
0x28----------
Return Data (n)
Return Code : =0 : normal
!= 0 : error(no response is made)
No. of Data:number of write data
Return Data:
0 0x00
Request Type 0x02
Return Code 0x04
0 0 0x06
0x20
8/10/2019 IMR3 - Programmer Guide
http://slidepdf.com/reader/full/imr3-programmer-guide 26/62
LK- ML -1003E
26All Rights Reserved. Copyright 2000, Omega Simulation Co.,Ltd
3.3.5 Read Marshalling Area
(1) LINK SOFTWARE => CS3000
v_dstn:domain No. of FCS (upper 8 bits) + FCS station No. (lower 8 bits)
v_type:VTP_GET(=8)
v_apcmd:VAP_SYS_SHMRW(=0x02c2)
v_data[](AP command): big endian
v_data[]
0 subID(=0) 0x00
Code(=0) Func(=0) 0x02
0 0 0x04
0 0 0x06
0 0x08
0 0x0a
0 0x0c
0 0x0e
0 0x10
0 0x12
0 0x14
0 0x16
0x18
0x1a
0x1c
Segment name (8 chr + NULL terminator)
(=”TIFPAR”)
0x1e
0x20Segment code (=0)
0x22
0x24Off set address
0x26
0x28data size
0x2a
option(=0) 0x2c
0 0x2e
0x30
Off set address : distance from top address of marshaling information table.
Read data size: data size to read. (max. 1980(=0x7bc)
8/10/2019 IMR3 - Programmer Guide
http://slidepdf.com/reader/full/imr3-programmer-guide 27/62
LK- ML -1003E
27All Rights Reserved. Copyright 2000, Omega Simulation Co.,Ltd
(2) CS3000 => LINK SOFTWARE
v_apcmd:VAP_SYS_SHMRW(=0x02c2)v_type:VTP_GETANS(=0xc)
v_data[](AP command): big endian
v_data[]
0 subID(=0) 0x00
Code(=0) Func(=0) 0x02
0 0 0x04
0 0 0x06
Return code 0x08
0 0x0a
0 0x0c
0 0x0e
0 0x10
0 0x12
0 0x14
0 0x16
0x18
0x1a
0x1c
Segment name (8 chr + NULL terminator)
(=”TIFPAR”)
0x1e
0x20Segment code (=0)
0x220x24Off set address (=requested)
0x26
0x28Read data size(=requested)
0x2a
option(=0) 0x2c
0 0x2e
0x30Read data
Return code: 0=finished without error
Non (zero)=error
If return code = non, data after segment name is not returned.
Read data:returns read data.
8/10/2019 IMR3 - Programmer Guide
http://slidepdf.com/reader/full/imr3-programmer-guide 28/62
LK- ML -1003E
28All Rights Reserved. Copyright 2000, Omega Simulation Co.,Ltd
3.3.6 Write Marshalling Area
(1) LINK SOFTWARE => CS3000
v_dstn:domain No. of FCS (upper 8 bits) + FCS station No. (lower 8 bits)
v_type:VTP_GET(=8)
v_apcmd:VAP_SYS_SHMRW(=0x02c2)
v_data[](AP command): big endian
v_data[]
0 subID(=0) 0x00
Code(=1) Func(=0) 0x02
0 0 0x04
0 0 0x06
0 0x08
0 0x0a
0 0x0c
0 0x0e
0 0x10
0 0x12
0 0x14
0 0x16
0x18
0x1a0x1c
Segment name (8 chr + NULL terminator)
(=”TIFPAR”)
0x1e
0x20Segment code (=0)
0x22
0x24Off set address
0x26
0x28Write data size
0x2a
option(=0) 0x2c
0 0x2e
0x30Write data
8/10/2019 IMR3 - Programmer Guide
http://slidepdf.com/reader/full/imr3-programmer-guide 29/62
8/10/2019 IMR3 - Programmer Guide
http://slidepdf.com/reader/full/imr3-programmer-guide 30/62
LK- ML -1003E
30All Rights Reserved. Copyright 2000, Omega Simulation Co.,Ltd
3.3.7 Marshalling Address Generation
(1) LINK SOFTWARE => CS3000
v_dstn: 0xffff ( broadcast)
v_type:VTP_PUT(=0)
v_apcmd:VAP_ENG_APC32(=0x0f1f)
v_data[](AP command):big endian
v_data[]
U16 Request No. (=3) 0x00
0x02
(2) CS3000 => LINK SOFTWARE
v_apcmd:VAP_ENG_APC32(=0x0f1f)
v_type:VTP_PUT
v_data[](AP command):big endian
v_data[]
U16 Request No. (=4) 0x00
U16 Return code 0x02
0x04
Return code: 0=finished without error
1=on-line maintenance is being done
2=tag not matched
3=marshaling work is inhibited (not freeze etc.)
-1=internal error (time out)
8/10/2019 IMR3 - Programmer Guide
http://slidepdf.com/reader/full/imr3-programmer-guide 31/62
LK- ML -1003E
31All Rights Reserved. Copyright 2000, Omega Simulation Co.,Ltd
3.3.8 Snapshot (Initial Condition Save)
(1) LINK SOFTWARE => CS3000
v_dstn: 0xffff(broadcast)
v_type:VTP_PUT(=0)
v_apcmd:VAP_ENG_APC31(=0x0f1e)
v_data[](AP command):big endian
v_data[]
Request No. (=3) 0x00
File No. 0x02
0x04
File No. :U16:The specified snapshot file No.
(2) CS3000 => LINK SOFTWARE
v_apcmd:VAP_ENG_APC31(=0x0f1e)
v_type:VTP_PUT
v_data[](AP command):big endian
v_data[]
U16 Request No. (=4) 0x00
U16 File No. 0x02
U16 dom/stn 0x04
I16 Return code 0x06
0x08
File No. :The specified snapshot file No.
dom/stn:FCS domain (upper 8 bits) + FCS station No. (lower 8 bits)
Return Code :0=normal finish
1=file no. is incorrect
-1=internal error
8/10/2019 IMR3 - Programmer Guide
http://slidepdf.com/reader/full/imr3-programmer-guide 32/62
LK- ML -1003E
32All Rights Reserved. Copyright 2000, Omega Simulation Co.,Ltd
3.3.9 Stepback (Initial Condition Load)
(1) LINK SOFTWARE => CS3000
v_dstn: 0xffff(broadcast)
v_type:VTP_PUT(=0)
v_apcmd:VAP_ENG_APC31(=0x0f1e)
v_data[](AP command):big endian
v_data[]
Request No. (=1) 0x00
File No. 0x02
0x04
File No. :U16:define file no.
(2) CS3000 => LINK SOFTWARE
v_apcmd:VAP_ENG_APC31(=0x0f1e)
v_type:VTP_PUT
v_data[](AP command):big endian
v_data[]
U16 Request No. (=2) 0x00
U16 File No. 0x02
U16 dom/stn 0x04
I16 Return Code 0x06
0x08
File No. :define file no.
dom/stn:domain no. / station no. of FCS that loading was done. (Upper 8 bits / lower 8 bits)
retun code: 0=finished without error
1=initial file not found
2=loading is inhibited now. ( not freeze status etc.)
-1=internal error
8/10/2019 IMR3 - Programmer Guide
http://slidepdf.com/reader/full/imr3-programmer-guide 33/62
LK- ML -1003E
33All Rights Reserved. Copyright 2000, Omega Simulation Co.,Ltd
3.3.10 Snapshot File Deletion
(1) LINK SOFTWARE => CS3000
v_dstn: 0xffff(broadcast)
v_type:VTP_PUT(=0)
v_apcmd:VAP_ENG_APC31(=0x0f1e)
v_data[](AP command):big endian
v_data[]
Request No. (=7) 0x00
0x02
(2) CS3000 => LINK SOFTWARE
No response.
8/10/2019 IMR3 - Programmer Guide
http://slidepdf.com/reader/full/imr3-programmer-guide 34/62
LK- ML -1003E
34All Rights Reserved. Copyright 2000, Omega Simulation Co.,Ltd
3.3.11 Snapshot File Path Name Acquisition
(1) LINK SOFTWARE => CS3000
v_dstn: 0xffff(broadcast)
v_type:VTP_PUT(=0)
v_apcmd:VAP_ENG_APC32(=0x0f1f)
v_data[](AP command):big endian
v_data[]
Request No. (=15) 0x00(0) 0x02
0x04
(2) CS3000 => LINK SOFTWARE
v_apcmd:VAP_ENG_APC32(=0x0f1f)
v_type:VTP_PUT
v_data[](AP command):big endian
v_data[]
U16 Request No. (=15) 0x00
U16 1 0x02
U16 Return Code 0x04
U16 0 0x06
U8[256] Absolute path name
(NULL terminated)
0x08
0x106
U8[256] Relative path name from CS3000 project area
(NULL terminated)
0x108
0x208
retun code: 0=finished without error
0!=error
NOTE
An absolute path name and a relative path name mean the same directory.
8/10/2019 IMR3 - Programmer Guide
http://slidepdf.com/reader/full/imr3-programmer-guide 35/62
LK- ML -1003E
35All Rights Reserved. Copyright 2000, Omega Simulation Co.,Ltd
3.3.12 Time Scale Change
(1) LINK SOFTWARE => CS3000
v_dstn: 0xffff(broadcast)
v_type:VTP_PUT(=0)
v_apcmd:VAP_ENG_APC32(=0x0f1f)
v_data[](AP command):big endian
v_data[]
U16 Request No. (=2) 0x00
Dummy (=0) 0x02
F32 0x04Time scale
0x06
0x08
Time scale:4 bytes floating point data.
NOTE
Time scale value must be 1, 2, 4, 8, 1/2, 1/4, 1/8.
(2) CS3000 => LINK SOFTWARE
No response.
8/10/2019 IMR3 - Programmer Guide
http://slidepdf.com/reader/full/imr3-programmer-guide 36/62
LK- ML -1003E
36All Rights Reserved. Copyright 2000, Omega Simulation Co.,Ltd
3.3.13 DCS Messages Acquisition (Enable/Disable)
This command enables / disables the specified HIS to send all of DCS messages, which are managed by
it.
(1) LINK SOFTWARE => CS3000
v_dstn:domain No. (upper 8 bits) + HIS station No. (lower 8 bits)
v_type:VTP_PUT(=0)
v_apcmd:VAP_ENG_APC32(=0x0f1f)
v_data[](AP command):big endian
v_data[]
Request No. (=7) 0x00Enable/Disable 0x02
0x04
Enable/Disable 1 = Enable
0 = Disable
(2) CS3000 => LINK SOFTWARE
No response.
8/10/2019 IMR3 - Programmer Guide
http://slidepdf.com/reader/full/imr3-programmer-guide 37/62
LK- ML -1003E
37All Rights Reserved. Copyright 2000, Omega Simulation Co.,Ltd
3.3.14 DCS Messages Acquisition
HIS enabled by the above command, sends the following messages.
(1) LINK SOFTWARE => CS3000
No need.
(2) CS3000 => LINK SOFTWARE
v_apcmd:VAP_ENG_APC32(=0x0f1f)
v_type:VTP_PUT
v_data[](AP command):big endian
v_data[]
Request No. ( = 8) 0x00
Training Time (year) Training Time (month) 0x02
Training Time (day) Training Time (hour) 0x04
Training Time (minute) Training Time (second) 0x06
Message No. 0x08
0x0aMessage Buffer(256 byte)
0x108
0x10a
Time stamp (year):0-99 (year 2000 is zero (0))
Time stamp(month):1-12
Time stamp(day):1-31
Time stamp(hour):0-23
Time stamp(minute):0-59
Time stamp(second):0-59
Message No. :
Please refer to IM 33S2H10-01E “CS 1000/CS 3000 Operation and Monitoring Function
Message Manual” for detail
Message buffer : operation message is located (NULL terminator)
8/10/2019 IMR3 - Programmer Guide
http://slidepdf.com/reader/full/imr3-programmer-guide 38/62
LK- ML -1003E
38All Rights Reserved. Copyright 2000, Omega Simulation Co.,Ltd
APPENDIX A – Installation Procedure
NOTE
CENTUM CS 3000 installation software is used to install Exatif CS 3000 software.
1) Preparation:
Before installing software, reconfirm that CENTUM CS 3000 settings are correct. Check that the ID
module and Ethernet card are properly installed in a PC.
For more information about the CENTUM CS 3000 installation, please refer to “CS 3000 Installation
Manual (IM 33Q1C10-01E)”.
2) Requirements for Installation:
Be sure to confirm that the environment is properly provided before installing the software.
- Items required for the Installation
The following items should be ready for use:
<A> CS 3000 software CD-ROM (1)
<B> Exatif CS 3000 software CD-R (1)
<C> Exatif CS 3000 key-coded floppy disk (1 or more)
Regarding the required hardware and software environments, please refer to “CS 3000 Installation
Manual (IM 33Q1C10-01E)”.
3) Installation:
Before Installation- Restart the PC prior to the installation of Exatif CS 3000.
1 With the PC restarted, log on to the administrator.2 Insert “CS3000 Software CD-ROM” and “Exatif CS 3000 Key-code FDC” in accordance with ID
module No.
8/10/2019 IMR3 - Programmer Guide
http://slidepdf.com/reader/full/imr3-programmer-guide 39/62
LK- ML -1003E
39All Rights Reserved. Copyright 2000, Omega Simulation Co.,Ltd
3 Start Windows NT Explorer. Then double-click “SETUP” in the CS 3000 directory, then a dialog box with “Welcome” appears.
Click “Next” or press the “Enter” key.
Destination Directory, which is installed CS3000 software, is displayed. Click “Next” or press the“Enter” key.
8/10/2019 IMR3 - Programmer Guide
http://slidepdf.com/reader/full/imr3-programmer-guide 40/62
LK- ML -1003E
40All Rights Reserved. Copyright 2000, Omega Simulation Co.,Ltd
User Register of CS3000 is displayed. Click “Next” or press the “Enter” key.
Installed software is displayed. Click “Next” or press the “Enter” key.
A dialog asking if there is another key-code floppy disk appears. Click “No” or press the “Enter” key.
8/10/2019 IMR3 - Programmer Guide
http://slidepdf.com/reader/full/imr3-programmer-guide 41/62
LK- ML -1003E
41All Rights Reserved. Copyright 2000, Omega Simulation Co.,Ltd
Exatif CS 3000 (code is Lom9001) is displayed as installing software. Click “Next” or press the “Enter”key.
A dialog asking if there is another medium appears. Click “Yes” for Exatif Software medium.
Change CD-ROM from CS3000 Software to Exatif CS 3000 software, and click “Next” or press the
“Enter” key. The drive name should be CD drive.
8/10/2019 IMR3 - Programmer Guide
http://slidepdf.com/reader/full/imr3-programmer-guide 42/62
LK- ML -1003E
42All Rights Reserved. Copyright 2000, Omega Simulation Co.,Ltd
Installation will start.
A dialog asking if there is another medium appears. Click “Next” or press the “Enter” key.
A dialog notifying the end of installation appears. Press the “Finish” button.And remove Exatif CS 3000 software CD-ROM and Key-code FDC.
4 Restart PC.Restart PC, after the installation of Exatif CS 3000.
8/10/2019 IMR3 - Programmer Guide
http://slidepdf.com/reader/full/imr3-programmer-guide 43/62
LK- ML -1003E
43All Rights Reserved. Copyright 2000, Omega Simulation Co.,Ltd
4) Others
- Microsoft Visual C++Please install Microsoft Visual C++ into the PC, which is installed both of CS3000 and Exatif CS3000 ,
and you will develop the LINK software.
And set linking information as follows;
Open “Project Setting” window. (Select [Project]-[Setting…])
Open “Link” tab.
Add library name, “VhfNthmi.lib” and “wsock32.lib” in “General” Category
Add library path name, “{CS3000 install path}\spenv\tif\lib”, in “input” category.
8/10/2019 IMR3 - Programmer Guide
http://slidepdf.com/reader/full/imr3-programmer-guide 44/62
LK- ML -1003E
44All Rights Reserved. Copyright 2000, Omega Simulation Co.,Ltd
APPENDIX B–TifH.h
/**<<MOH>>*************************************************************** (c) Copyright Omega Simulation Co,.Ltd.** system : Exatif CS3000* $Endlog$** description : Preliminary*>>HOM<<**************************************************************/
#define TIF_FCSMAX 32 #define TIF_HISMAX 8
#define TIF_BROADCAST_ADDRESS 0xffff
#define ntohf(a,b) (*((U32*)&(b)) = ntohl(*((U32*)&(a)))) #define htonf(a,b) (*((U32*)&(b)) = htonl(*((U32*)&(a))))
typedef char I8;typedef unsigned char U8;typedef short I16;typedef unsigned short U16;typedef int I32;typedef unsigned int U32;typedef float F32;typedef double F64;
/********************************************************/
/* V_HEADER structure *//********************************************************/
typedef struct v_header{
I32 v_reqid; /* 00 */U16 v_hochec; /* 04 */U16 v_getrsp; /* 06 */I32 dummy; /* 08 (reserved) */U16 v_dstn; /* 0c */U16 v_sstn; /* 0e */U16 v_lenf; /* 10 */U16 v_cntf; /* 12 */U16 v_hdsum; /* 14 */U16 v_dtsum; /* 16 */U8 v_type; /* 18 */U8 v_sts; /* 19 */U16 v_echo; /* 1a */U16 v_apcmd; /* 1c */U16 v_apwl; /* 1e */
/* 20 */} V_HEADER;
8/10/2019 IMR3 - Programmer Guide
http://slidepdf.com/reader/full/imr3-programmer-guide 45/62
LK- ML -1003E
45All Rights Reserved. Copyright 2000, Omega Simulation Co.,Ltd
/********************************************************//* V_FRAME structure *//********************************************************/typedef struct v_frame{
I32 v_reqid; /* 00 */U16 v_hochec; /* 04 */U16 v_getrsp; /* 06 */I32 dummy; /* 08 */U16 v_dstn; /* 0c */U16 v_sstn; /* 0e */U16 v_lenf; /* 10 */U16 v_cntf; /* 12 */U16 v_hdsum; /* 14 */U16 v_dtsum; /* 16 */U8 v_type; /* 18 */U8 v_sts; /* 19 */U16 v_echo; /* 1a */U16 v_apcmd; /* 1c */
U16 v_apwl; /* 1e */U16 v_data[1014]; /* 20 */
/* 80c */} V_FRAME;
/********************************************************//* Define frame size *//********************************************************/ #define VMAX_FRAME_SIZE 2060 /* */ #define VMIN_FRAME_SIZE 32 /* */ #define VFRM_HDR_SIZE 20 /* */
/********************************************************//* Define frame parameter *//********************************************************//*** v_hochec (HOC) ***/ #define VHOC_NORMAL 0x0000 /* */ #define VHOC_DEBUG 0x8000 /* */ #define VHOC_LITTLE 0x2000 /* */ #define VHOC_NERSIG 0x0001 /* */
/*** v_hochec (HEC) ***/ #define VHEC_DEBUG 0x8000 /* */ #define VHEC_DIAG 0x4000 /* */ #define VHEC_LITTLE 0x2000 /* */ #define VHEC_PUTEND 0x0000 /* */ #define VHEC_GETEND 0x0040 /* */ #define VHEC_GANSEND 0x0080 /* */
/*** v_type ***/
#define VTP_PUT 0x00 /* PUT */ #define VTP_GET 0x08 /* GET */ #define VTP_GETANS 0x0c /* GETANS */
8/10/2019 IMR3 - Programmer Guide
http://slidepdf.com/reader/full/imr3-programmer-guide 46/62
LK- ML -1003E
46All Rights Reserved. Copyright 2000, Omega Simulation Co.,Ltd
/********************************************************//* V_READ_HEADER structure *//********************************************************/typedef struct v_read_header{
I32 rtype; /* 00 read data type */I32 reserved; /* 04 (reserved) */
/* 08 */} V_READ_HEADER;
#define VRD_HDR_SIZE 8 /* */
/********************************************************//* V_READ structure *//********************************************************/typedef struct v_read{
I32 rtype; /* 00 */I32 reserved; /* 04 (reserved) */
union { V_FRAME frm; /* 08 */
} p;} V_READ;
/*** rtype ***/ #define VRD_ANS 0x01 /* */ #define VRD_RCV 0x02 /* */ #define VRD_ERR 0x03 /* */
#define VHF_ANS 0xe000f804 #define VHF_RECV 0xe000f808 #define VHF_DEBUG 0xe000f830
/********************************************************//* Define VhfIoctl request structure *//********************************************************/typedef struct {
U8 *rqbuf; /* 00 */I32 rqbuf_len; /* 04 */
/* 08 */} VHF_IOCTL;
#if !defined(DllExport) #define DllExport __declspec(dllexport) #endif
#ifdef __cplusplusextern "C" {
#endif /* __cplusplus */
EXTERN_C DllExport INT VhfOpen(HANDLE *hSyncObj, LPSTR path, INT flag);EXTERN_C DllExport INT VhfClose(HANDLE hSyncObj);EXTERN_C DllExport INT VhfWrite(HANDLE hSyncObj, V_FRAME *buf, DWORD len);EXTERN_C DllExport INT VhfRead(HANDLE hSyncObj, V_READ *buf, DWORD buflen);EXTERN_C DllExport INT VhfIoctl(HANDLE hSyncObj, INT request, VHF_IOCTL *arg);EXTERN_C DllExport DWORD VhfGetLastError(void);EXTERN_C DllExport INT VhfGetDeviceName(LPSTR path, INT SelectFlag);
#ifdef __cplusplus} #endif
/* EOF */
8/10/2019 IMR3 - Programmer Guide
http://slidepdf.com/reader/full/imr3-programmer-guide 47/62
LK- ML -1003E
47All Rights Reserved. Copyright 2000, Omega Simulation Co.,Ltd
APPENDIX C – fcztifshm.h
/**<<MOH>>*************************************************************** (c) Copyright Omega Simulation Co,.Ltd.** system : Exatif CS3000* $Endlog$** description : Preliminary*>>HOM<<**************************************************************/
#ifndef FCZTIFSHM_INCLUDED #define FCZTIFSHM_INCLUDED
#include <string.h>
#define FCDBVOID 0 #define FCDBI16 12 #define FCDBU16 16 #define FCDBI32 20 #define FCDBU32 24 #define FCDBF32 28 #define FCDBF64 32 #define FCDBCHR 8 #define FCDBI16S 13 #define FCDBU16S 17 #define FCDBI32S 21 #define FCDBU32S 25 #define FCDBF32S 29 #define FCDBF64S 33
#define FCDBF32SR 31
typedef BYTE TAGN[16];typedef BYTE DITMN[8];
#define FCZZPUTDATAMAX (2048) /* */ #define FCZZGETDATAMAX (2048) /* */ #define FCZZPUTDATASIZE (4) /* */ #define FCZZGETDATASIZE (4) /* */
#define FCZZINTERNALADRSIZE (8)
8/10/2019 IMR3 - Programmer Guide
http://slidepdf.com/reader/full/imr3-programmer-guide 48/62
LK- ML -1003E
48All Rights Reserved. Copyright 2000, Omega Simulation Co.,Ltd
/*******************************************************//* 1. AP access table *//* ( All items are BIG endian format ) *//********************************************************/
/************************************************//* FCS shared memory data structure (TIFPAR) *//************************************************/
/*** Tag Information ***/
typedef struct {TAGN TagName; /* Tag name */DITMN ItemName; /* Item name */U16 AreaNo; /* Area number */U8 DataType; /* Data type */U8 WirType; /* Wiring data type */
} TagInF;
/*** Marshaling information (PUT) ***/
typedef struct {U16 TagNum; /* Number of wiring data */BYTE dummy[6]; /* Dummy */TagInF TagInf[FCZZPUTDATAMAX]; /* Tag Information */BYTE dummy2[8]; /* Dummy */
} MrslInfPuT;
/*** Marshaling information (GET) ***/
typedef struct {U16 TagNum; /* Number of wiring data */BYTE dummy[6]; /* Dummy */TagInF TagInf[FCZZGETDATAMAX]; /* Tag Information */BYTE dummy2[8]; /* Dummy */
} MrslInfGeT;
/*** FCS training I/F table structure */
typedef struct {char name[8] ; /* table name "TIFPAR" */MrslInfPuT MrslInfPut; /* Marshaling information (PUT) */MrslInfGeT MrslInfGet; /* " (GET) */BYTE PutData[FCZZPUTDATAMAX][FCZZPUTDATASIZE]; /* Marshaling data (PUT) */BYTE GetData[FCZZGETDATAMAX][FCZZGETDATASIZE]; /* " (GET) */BYTE dummy[8]; /* Dummy */
} FcZzTifParTbL;
#endif /* FCZTIFSHM_INCLUDED */
8/10/2019 IMR3 - Programmer Guide
http://slidepdf.com/reader/full/imr3-programmer-guide 49/62
LK- ML -1003E
49All Rights Reserved. Copyright 2000, Omega Simulation Co.,Ltd
APPENDIX D –TifRun.c
The sample program, which changes CS3000 to RUN mode, is shown below.
/**<<MOH>>*************************************************************** (c) Copyright Omega Simulation Co,.Ltd.** system : Exatif CS3000* $Endlog$** description : Preliminary*>>HOM<<**************************************************************/
#include <stdio.h>#include <windows.h>#include <winsock.h>
#include "TifH.h"#include "fcztifshm.h"
extern unsigned short FCSStn[TIF_FCSMAX], HISStn[TIF_ICSMAX];
int TifRun(){
int kind ; // 1: for Run, 0: for Freezeint len;
unsigned short tif_apcmd = 0x0f1f ;
HANDLE hsyncObj;
V_FRAME frm ;V_READ rd_frm;
kind = 1; // 1: for Run, 0: for Freeze
/*** Initialize ***/memset ( &rd_frm, 0, sizeof (rd_frm) ) ;memset ( &frm, 0, sizeof(frm) ) ;
/*** Open I/F ****/if( ( VhfOpen( &hsyncObj,"/dev/vf00", 0 ) ) == -1 ) {
fprintf ( stderr," VHF Open error \n" ) ;return(VhfGetLastError());
}
8/10/2019 IMR3 - Programmer Guide
http://slidepdf.com/reader/full/imr3-programmer-guide 50/62
LK- ML -1003E
50All Rights Reserved. Copyright 2000, Omega Simulation Co.,Ltd
/** Create RUN/FREEZE Command Frame **//* Create frame header */frm.v_reqid = 0;
frm.v_hochec = VHOC_NERSIG;frm.v_getrsp = 0;frm.dummy = 0;frm.v_dstn = TIF_BROADCAST_ADDRESS;frm.v_sstn = 0;frm.v_lenf = 0;frm.v_cntf = 0;frm.v_hdsum = 0;frm.v_dtsum = 0;frm.v_type = VTP_PUT;frm.v_sts = 0;frm.v_echo = 0;frm.v_apcmd = tif_apcmd;
frm.v_apwl = 2; // This is the length of v_data[]
/* Create RUN/FREEZE command */frm.v_data[0] = htons( (short)(0x001) );frm.v_data[1] = kind;frm.v_data[1] = htons( frm.v_data[1] );
/** Send RUN/FREEZE command **/if( (len = VhfWrite( hsyncObj, &frm, (sizeof(V_HEADER)+frm.v_apwl*2))) == -1 ) {
fprintf ( stderr," VHF Write error =%d\n" , VhfGetLastError() ) ;return(VhfGetLastError());
}
/** Receive ACK **/if ( (len = VhfRead ( hsyncObj, &rd_frm, sizeof(V_READ)) ) == -1 ) {
fprintf ( stderr, " VHF Read error \n") ;return(VhfGetLastError());
}
/** Close I/F **/VhfClose( hsyncObj );
return(0);
}
8/10/2019 IMR3 - Programmer Guide
http://slidepdf.com/reader/full/imr3-programmer-guide 51/62
LK- ML -1003E
51All Rights Reserved. Copyright 2000, Omega Simulation Co.,Ltd
APPENDIX E –TifGetStat.c
The sample program, which answers whether the specified FCS simulator is in RUN mode, or FREEZE
mode, is shown below.
#include <stdio.h>#include <windows.h>#include <winsock.h>
#include "TifH.h"#include "fcztifshm.h"
int stn, domain ;unsigned short FCSStn ;
int domain = 1; stn = 9; // For example; V net address of FCS is 01.09.unsigned short FCSStn = domain<<8 | stn;
void TifGetStat (int status){
int len;V_FRAME frm ;V_READ rd_frm;HANDLE hsyncObj;VHF_IOCTL sIoctl;
unsigned short tif_apcmd = 0x0f1f ;
/** Open I/F **/if( ( VhfOpen( &hsyncObj,"/dev/vf00", 0 ) ) == -1 ) {
fprintf ( stderr," VHF Open error \n" ) ;return;
}
/** Set command ID to I/F **/sIoctl.rqbuf =(unsigned char *)&tif_apcmd;sIoctl.rqbuf_len = sizeof(U16);
if ( VhfIoctl( hsyncObj, VHF_RECV, &sIoctl ) == -1 ) {fprintf( stderr," VHF Ioctl error =%d\n", VhfGetLastError() ) ;
VhfClose( hsyncObj );return;
}
/** Create Status Getting Command Frame **//* Create frame header */frm.v_reqid = 0;frm.v_hochec = VHOC_NERSIG;frm.v_getrsp = 0;frm.dummy = 0;frm.v_dstn = FCSStn;frm.v_sstn = 0;frm.v_lenf = 0;
8/10/2019 IMR3 - Programmer Guide
http://slidepdf.com/reader/full/imr3-programmer-guide 52/62
LK- ML -1003E
52All Rights Reserved. Copyright 2000, Omega Simulation Co.,Ltd
frm.v_cntf = 0;frm.v_hdsum = 0;frm.v_dtsum = 0;frm.v_type = VTP_PUT;
frm.v_sts = 0;frm.v_echo = 0;frm.v_apcmd = tif_apcmd;frm.v_apwl = 2;
/* Create Status Getting Command */frm.v_data[0] = htons( (short)(12) );frm.v_data[1] = 0;
/** Send RUN/FREEZE command **/if( (len = VhfWrite( hsyncObj, &frm, (sizeof(V_HEADER)+frm.v_apwl*2))) == -1 ) {
fprintf( stderr, " VHF Write error =%d\n" , VhfGetLastError() ) ;return;
}
/** Receive ACK **/if ( (len = VhfRead ( hsyncObj, &rd_frm, sizeof(V_READ)) ) == -1 ) {
fprintf ( stderr, " VHF Read error \n" ) ;return;
}
/** Receive Answer **/if ( (len = VhfRead ( hsyncObj, &rd_frm, sizeof(V_READ)) ) == -1 ) {
fprintf ( stderr, " VHF Read error \n" ) ;return;
}
/** Check the length of the answer frame **/if ( rd_frm.p.frm.v_apwl != 4 ) {
fprintf ( stderr, " Answer frame error\n" ) ;return;
}
/** Close I/F **/VhfClose( hsyncObj );
/** Print the result **/ printf ( " answer length = %d\n", rd_frm.p.frm.v_apwl ) ; printf ( " sub code(12) = %d\n", ntohs( rd_frm.p.frm.v_data[0] ) ) ; printf ( " ans code(1) = %d\n", ntohs( rd_frm.p.frm.v_data[1] ) ) ; printf ( " return code(0) = %d\n", ntohs( rd_frm.p.frm.v_data[2] ) ) ; printf ( " status = %d\n", ntohs( rd_frm.p.frm.v_data[3] ) ) ;
return (ntohs( rd_frm.p.frm.v_data[2]));
}
8/10/2019 IMR3 - Programmer Guide
http://slidepdf.com/reader/full/imr3-programmer-guide 53/62
LK- ML -1003E
53All Rights Reserved. Copyright 2000, Omega Simulation Co.,Ltd
APPENDIX F –Marshalling Area Detail
Segment Name (=”TIFPAR”)
Marshaling Information Table
0x00Internal Use (restricted)
0x08Marshaling Information (PUT)
0xe018Marshaling Information (GET)
Marshaling Data 1(PUT) 0x1c028
Marshaling Data 2(PUT)
…
Marshaling Data 2048(PUT)
Marshaling Data 1(GET) 0x1e028
Marshaling Data 2(GET)
…
Marshaling Data 2048(GET)
0x20028
Marshaling Information
(PUT/GET)
U16 Number of Tag 0x00
U8[6] dummy 0x02
0x08Tag Information 1
0x24Tag Information 2
…
Tag Information 2048
U8[8] dummy 0xe008
0xa010
8/10/2019 IMR3 - Programmer Guide
http://slidepdf.com/reader/full/imr3-programmer-guide 54/62
LK- ML -1003E
54All Rights Reserved. Copyright 2000, Omega Simulation Co.,Ltd
Tag Information
U8[16] 0x00Tag Name
(NULL terminated)
U8[8] 0x10Item Name
(NULL terminated)
U16 (=1) 0x18
U8/U8 Data Type Wiring Data Type 0x1a0x1c
Data Type:
Code that presents data type must be set as integer. (Please refer to Table F-8 about code)
And this code must be match for the “Data Value” data type described below..
Wiring Data Type:
No need to set. FCS I/F sets code that is match for actual data type of specified tag-item when
marshalling address generation command is performed.
And FCS I/F read/write “Data Value” area in accordance with “Data Type”, and read/write the
specified tag-item in accordance with “Wiring Data Type” automatically.
(Please refer to Table F-8 about the availability of Marshalling, and data conversion.)
Marshaling Data
(PUT/GET)
0x00Data Value
(Data Type must be match for “data type”)
0x04
NOTE
As shown above, “Data Value” area is four (4) bytes area. So FCS I/F converts data type in accordance
with the combination of “Data Type” and “Wiring Data Type”. (Please refer to Table F-2.)
8/10/2019 IMR3 - Programmer Guide
http://slidepdf.com/reader/full/imr3-programmer-guide 55/62
LK- ML -1003E
55All Rights Reserved. Copyright 2000, Omega Simulation Co.,Ltd
Table F-1. shows the comparison of Wiring Data type and its code, and the availability of marshalling forspecified tag-item data type.
Table F-1. Availability of marshallingWiring
Data type
description code Availability Data conversion
I16 2 bytes integer with +- 12 ○ As it is
U16 2 bytes integer without +- 16 ○ As it is
I32 4 bytes integer with +- 20 ○ As it is
U32 4 bytes integer without +- 24 ○ As it is
F32 single precision floating point 28 ○ As it is
F64 double precision floating point
32 ○ casted
CHR string character 8 ×
I16S 2 bytes integer with +- withstatus 13 ○ Without data status
I16S 2 bytes integer without +-without status
17 ○ Without data status
I32S 4 bytes integer with +- withstatus
21 ○ Without data status
U32S 4 bytes integer without +-without status
25 ○ Without data status
F32S single precision floating pointwith status
29 ○ Without data status
F64S double precision floating point with status
33 ○ Without data statusand casted
F32SR single precision floating point
with status with range
31 ○ Without data status without
rangeADR data connection information 52 ×
DYN active define 56 ×
TCS count with data status 49 ×
ITM Data item name 60 ×
IND Indirect type 44 ×
BIT Bit type 40 ×
ALRM Alarm type 36 ×
UNDEF Undefined function block 64 ×
UNCNN Unconnection I/O 65 ×
8/10/2019 IMR3 - Programmer Guide
http://slidepdf.com/reader/full/imr3-programmer-guide 56/62
LK- ML -1003E
56All Rights Reserved. Copyright 2000, Omega Simulation Co.,Ltd
Table F-2. shows the data conversion between “Data Value” area and tag-item.The horizontal data type shows “Data Type”, which is decided by users, and the vertical data type shows“Wiring Data Type”, which is set by FCS I/F.
Table F-2. Data Conversion
Wiring
Data type
I16 U16 I32 U32 F32
I16 substituted casted casted casted casted
U16 casted substituted casted casted casted
I32 casted casted substituted casted casted
U16 casted casted casted substituted casted
F32 casted casted casted casted substituted
F64 casted casted casted casted casted
I16S substitutedwithout
status
castedwithout
status
castedwithout
status
castedwithout
status
castedwithout
statusI16S casted
withoutstatus
substitutedwithoutstatus
castedwithoutstatus
castedwithoutstatus
castedwithoutstatus
I32S castedwithoutstatus
castedwithoutstatus
substitutedwithoutstatus
castedwithoutstatus
castedwithoutstatus
U32S castedwithoutstatus
castedwithoutstatus
castedwithoutstatus
substitutedwithoutstatus
castedwithoutstatus
F32S castedwithoutstatus
castedwithoutstatus
castedwithoutstatus
castedwithoutstatus
substitutedwithoutstatus
F64S castedwithoutstatus
castedwithoutstatus
castedwithoutstatus
castedwithoutstatus
castedwithoutstatus
F32SR castedwithoutstatus
withoutrange
castedwithoutstatus
withoutrange
castedwithoutstatus
withoutrange
castedwithoutstatus
withoutrange
substitutedwithoutstatus
withoutrange
8/10/2019 IMR3 - Programmer Guide
http://slidepdf.com/reader/full/imr3-programmer-guide 57/62
LK- ML -1003E
57All Rights Reserved. Copyright 2000, Omega Simulation Co.,Ltd
APPENDIX G – Marshalling Area Access
The following two (2) sample programs, “readMem() and writeMem()”, show how to access marshallingarea.
For example,How to read all of marshalling area, which includes marshalling information area and marshalling dataarea, is;
FcZzTifParTbL tifParTbl;unsigned short OwnStn = 0x0101;readMem(OwnStn, "TIFPAR", 0, sizeof(tifParTbl), (char *)(&tifParTbl));
/**<<MOH>>**************************************************************
* (c) Copyright Omega Simulation Co,.Ltd.** system : Exatif CS3000* $Endlog$** description : Preliminary*>>HOM<<**************************************************************/#include <stdio.h>#include <windows.h>#include <winsock.h>
#include "TifH.h"
#include "fcztifshm.h"
int readMem(unsigned short OwnStn, /* (I) Destination Station Address */char *segname, /* (I) Segment Name */int offset, /* (I) offset address from the top of the segment */int req_size, /* (I) size to read */char *pt /* (I) pointer to the area to store data */
){
HANDLE hsyncObj;
struct MemFrM {char v_dummycd;char v_subcode;char v_reqcode;char v_func;U16 reserv[2];U16 ret;U16 dummy[7];char segName[8];int segCode;int address;int readSize;U16 option;
8/10/2019 IMR3 - Programmer Guide
http://slidepdf.com/reader/full/imr3-programmer-guide 58/62
LK- ML -1003E
58All Rights Reserved. Copyright 2000, Omega Simulation Co.,Ltd
U16 option1;} MemFrm;
struct ReadFrM {
struct MemFrM MemFrm;U16 data[1980/2];
} *ReadFrm;
int len;V_FRAME frm ;V_READ rd_frm;
int read_size, size ;char *tifaddress, *memaddress;
/*** Initialize ***/
memset ( &MemFrm, 0, sizeof (MemFrm) ) ;memset ( &frm, 0, sizeof(frm) ) ;
/*** Read tif management table ****/
if( ( VhfOpen( &hsyncObj,"/dev/vf00", (int)NULL ) ) == -1 ) {fprintf ( stderr," VHF Open error \n" ) ;return(1);
}
frm.v_reqid = 0;frm.v_hochec = VHOC_NERSIG;frm.v_getrsp = 0;frm.dummy = 0;frm.v_dstn = OwnStn;frm.v_sstn = 0;frm.v_lenf = 0;frm.v_cntf = 0;frm.v_hdsum = 0;frm.v_dtsum = 0;frm.v_type = VTP_GET;frm.v_sts = 0;frm.v_echo = 0;frm.v_apcmd = 0x02c2;MemFrm.v_dummycd = 0x0000;MemFrm.v_subcode = 0x0000;MemFrm.v_reqcode = 0x0000;MemFrm.v_func = 0x0000;MemFrm.ret = 0 ;strcpy ( MemFrm.segName, segname );MemFrm.segCode = 0;MemFrm.option = 0;MemFrm.option1 = 0;
read_size = req_size ;tifaddress = pt;
memaddress = (char *)offset;
8/10/2019 IMR3 - Programmer Guide
http://slidepdf.com/reader/full/imr3-programmer-guide 59/62
LK- ML -1003E
59All Rights Reserved. Copyright 2000, Omega Simulation Co.,Ltd
while (1) {if ( read_size <= 0 ) break;if ( read_size > 1980 ) {
size = 1980;}else {
size = read_size;}MemFrm.readSize = htonl(size) ;MemFrm.address = htonl((int)memaddress) ;
frm.v_apwl = sizeof(MemFrm)/2;memcpy( frm.v_data, &MemFrm, sizeof(MemFrm) );
if( (len = VhfWrite( hsyncObj, &frm, (sizeof(V_HEADER)+frm.v_apwl*2))) == -1 ) {fprintf ( stderr," VHF Write error \n" ) ;
return(1);}
if ( (len = VhfRead ( hsyncObj, &rd_frm, sizeof(V_READ)) ) == -1 ) {fprintf ( stderr," VHF Read error \n" ) ;return(1);
}
ReadFrm =(struct ReadFrM *)&rd_frm.p.frm.v_data ;
memcpy ( tifaddress, &ReadFrm->data, size );tifaddress += size ;read_size -= size ;memaddress += size ;
}
VhfClose( hsyncObj );
return(0);
}
8/10/2019 IMR3 - Programmer Guide
http://slidepdf.com/reader/full/imr3-programmer-guide 60/62
LK- ML -1003E
60All Rights Reserved. Copyright 2000, Omega Simulation Co.,Ltd
void writeMem(unsigned short OwnStn, /* (I) Destination Station Address */char *segname, /* (I) Segment Name */
int offset, /* (I) offset address from the top of the segment */int req_size, /* (I) size to write */char *pt /* (I) pointer to the area to write */
){
HANDLE hsyncObj;
struct MemFrM {char v_dummycd;char v_subcode;char v_reqcode;char v_func;U16 reserv[2];
U16 ret;U16 dummy[7];char segName[8];int segCode;int address;int wrtSize;U16 option;U16 option1;U16 data[1980/2];
} MemFrm;
int len;V_FRAME frm ;V_READ rd_frm;
int write_size, size ;char *tifaddress, *memaddress;
/** Initilize */memset ( &MemFrm, 0, sizeof (MemFrm) ) ;memset ( &frm, 0, sizeof(frm) ) ;
/*** write wiring information ****/
if( ( VhfOpen( &hsyncObj,"/dev/vf00", (int)NULL ) ) == -1 ) {fprintf ( stderr, " VHF Open error \n" ) ;return;
}
8/10/2019 IMR3 - Programmer Guide
http://slidepdf.com/reader/full/imr3-programmer-guide 61/62
LK- ML -1003E
61All Rights Reserved. Copyright 2000, Omega Simulation Co.,Ltd
frm.v_reqid = 0;frm.v_hochec = VHOC_NERSIG;frm.v_getrsp = 0;
frm.dummy = 0;frm.v_dstn = OwnStn;frm.v_sstn = 0;frm.v_lenf = 0;frm.v_cntf = 0;frm.v_hdsum = 0;frm.v_dtsum = 0;frm.v_type = VTP_GET;frm.v_sts = 0;frm.v_echo = 0;frm.v_apcmd = 0x02c2;
MemFrm.v_dummycd = 0;
MemFrm.v_subcode = 0;MemFrm.v_reqcode = 1;MemFrm.v_func = 0 ;MemFrm.ret = 0 ;strcpy ( MemFrm.segName, segname );MemFrm.segCode = 0;
MemFrm.option = 0;MemFrm.option1 = 0;
memaddress = (char *)offset ;
write_size = req_size;tifaddress = pt;
while (1) {if ( write_size <= 0 ) break;if ( write_size > 1980 ) {
size = 1980;}else {
size = write_size;}MemFrm.wrtSize = htonl(size);MemFrm.address = htonl((int)memaddress) ;
memcpy ( MemFrm.data, tifaddress, size );frm.v_apwl = (sizeof(MemFrm)-1980+size)/2;memcpy( frm.v_data, &MemFrm, sizeof(MemFrm) );
if( (len = VhfWrite( hsyncObj, &frm, (sizeof(V_HEADER)+frm.v_apwl*2))) == -1 ) {fprintf ( stderr," VHF Write error \n" ) ;VhfClose( hsyncObj );return;
}
if ( (len = VhfRead ( hsyncObj, &rd_frm, sizeof(V_READ)) ) == -1 ) {fprintf ( stderr, " VHF Read error \n" ) ;VhfClose( hsyncObj );
8/10/2019 IMR3 - Programmer Guide
http://slidepdf.com/reader/full/imr3-programmer-guide 62/62
LK- ML -1003E
return;}
tifaddress += size ;
write_size -= size ;memaddress += size ;
}
VhfClose( hsyncObj );
return;
}