l Example of Substituting Character Strings that Include a Numeric Expression
1.9 Include File
The line with a “#include” compiler control instruction is replaced with the entire contents of the file declared by the #include (include file).
The following include files are provided:
• std.h
• smode.h
• sbsts.h
• salarm.h
n #include
The expression of #include statement is shown below:
#include "<include file name>"
Figure 1.9-1 The format of the "#include" statement
The inclusion of files using #include is useful when using the same constant in multiple pro-grams.
For example, create a file that defines identifiers for constants using the #define statements, and include it in multiple SEBOL programs using the #include statement. If the constant changes, the included file must be modified and the SEBOL programs that have included the file must be recompiled.
File inclusion cannot be nested; a compile error will occur if an included file contains a #in-clude statement. When a compile error occurs in an in#in-cluded file, the line number in the error message indicates the line on which the #include statement exists in the file that has included the include file.
To include the user-defined (user-created) files, the files to be included need to be put into the following folders.
<Project Root>\<ProjectName>\SEBOL\INCLUDE
<Project Root>: c:\CENTUMVP\ENG\BKPROJECT (*1)
*1: The default location in the CENTUM VP
If a user-defined (user-created) file has an identical file name with a system file, the system file will be included.
The following lists the system-fixed include files provided:
std.h: Standard label definition
<1.9 Include File>
1-15
***** for valve *****
#define OPEN 2
#define CLOSE 0
***** for pump (start/stop pump) *****
#define RUN 2
#define STOP 0
***** for sequence element *****
#define ON 1
#define OFF 0
***** for judgment *****
#define OK 1
#define NG 0
***** for timer (TM operation) *****
#define TMSTOP 1
#define TMSTAT 2
#define TMCONT 3
#define TMPAUS 4
l smode.h
smode.h is a system-fixed include file that references block modes individually.
The smode.h defines mask patterns, in which the bits corresponding to modes of the basic block mode are set to “1.”
***** block mode *****
#define MD_OS $80000000 ! bit1 O/S
#define MD_IMAN $08000000 ! bit5
#define MD_TRK $04000000 ! bit6
#define MD_SEMI $01000000 ! bit8
#define MD_MAN $00800000 ! bit9
#define MD_AUT $00400000 ! bit10
#define MD_CAS $00200000 ! bit11
#define MD_PRD $00100000 ! bit12
#define MD_RCAS $00080000 ! bit13
#define MD_ROUT $00040000 ! bit14
l sbsts.h
sbsts.h is a system-fixed include file used to reference block statuses individually.
The smode.h defines mask patterns, in which the bits corresponding to modes of the basic block mode are set to “1.”
***** block status *****
<1.9 Include File>
1-16
IM 33K03K10-50E 3rd Edition : Jun.28,2013-00
#define BS_PAUS $80000000 ! bit1
#define BS_ANCK $80000000
#define BS_ERR $80000000
#define BS_FAIL $40000000 ! bit2
#define BS_ABRT $20000000 ! bit3
#define BS_IDLE $10000000 ! bit4
#define BS_ABORT $10000000 ! (ABORTED)
#define BS_SIML $08000000 ! bit5
#define BS_OFF $00800000 ! bit9
#define BS_PALM $00800000
#define BS_HI $00800000
#define BS_LOCK $00400000 ! bit10
#define BS_CTUP $00400000
#define BS_LO $00400000
#define BS_NR2 $00200000 ! bit11 (NR priority 2)
#define BS_SIM $00008000 ! bit17
#define BS_STRT $00008000
#define BS_RUN $00008000
#define BS_NR1 $00004000 ! bit18 (NR priority 1)
#define BS_STOP $00004000
#define BS_IBCH $00004000
#define BS_STUP $00002000 ! bit19
#define BS_STDY $00001000 ! bit20
#define BS_HOLD $00001000
<1.9 Include File>
1-17
#define BS_RSET $00000080 ! bit25
#define BS_SDWN $00000080
#define BS_EMST $00000040 ! bit26
#define BS_ESD $00000040
#define BS_EEMS $00000020 ! bit27
#define BS_RSTR $00000010 ! bit28 SEE
ALSO For more information about the method to reference block modes individually, refer to:
5.5, “Referencing Block Mode” on page 5-24
l salarm.h
salarm.h is a system-fixed include file used to manipulate or reference alarm statuses individ-ually.
***** alarm status mask pattern *****
#define AL_AFL $80000000 ! bit1
#define AL_AOF $40000000 ! bit2
#define AL_AF $20000000 ! bit3
#define AL_NR $00800000 ! bit9
#define AL_OOP $00400000 ! bit10
#define AL_SGNL $00400000
#define AL_IOP $00200000 ! bit11
#define AL_VPTN $00200000
#define AL_IOPM $00100000 ! bit12
IOP-#define AL_DATA $00100000
#define AL_OUTS $00010000 ! bit16
#define AL_HI $00008000 ! bit17
#define AL_LEAK $00002000 ! bit19
#define AL_DVP $00000800 ! bit21 DV+
<1.9 Include File>
1-18
IM 33K03K10-50E 3rd Edition : Jun.28,2013-00
#define AL_BDVP $00000800 ! BDV+
#define AL_DV1 $00000800
#define AL_PERR $00000800
#define AL_CERR $00000800
#define AL_LALM $00000800
#define AL_DVM $00000400 ! bit22
DV-#define AL_BDVM $00000400 !
BDV-#define AL_VELP $00000080 ! bit25 VEL+
#define AL_ANSP $00000080 ! ANS+
#define AL_HDV $00000080
#define AL_RALM $00000080
#define AL_TRP $00000080
#define AL_VELM $00000040 ! bit26
VEL-#define AL_ANSM $00000040 !
ANS-#define AL_LDV $00000040
#define AL_BEND $00000040
#define AL_SCBL $00000040
#define AL_MHI $00000020 ! bit27
#define AL_BPRE $00000020
#define AL_INT $00000020
#define AL_MLO $00000010 ! bit28
#define AL_ERR $00000010
#define AL_CNF $00000001 ! bit32
***** alarm status change command *****
#define AOF_NR "AL09OF"
#define AON_NR "AL09ON"
#define AOF_OOP "AL10OF"
#define AON_OOP "AL10ON"
#define AOF_SGNL "AL10OF"
#define AON_SGNL "AL10ON"
#define AOF_IOP "AL11OF"
#define AON_IOP "AL11ON"
#define AOF_VPTN "AL11OF"
#define AON_VPTN "AL11ON"
<1.9 Include File>
1-19
#define AOF_HALM "AL13OF"
#define AOF_LL "AL14OF"
#define AON_LL "AL14ON"
#define AOF_DV2 "AL14OF"
#define AOF_DV2 "AL14ON"
#define AOF_OUTS "AL16OF"
#define AON_OUTS "AL16ON"
#define AOF_HI "AL17OF"
#define AON_HI "AL17ON"
#define AOF_EMST "AL17OF"
#define AON_EMST "AL17ON"
#define AOF_END "AL17OF"
#define AON_END "AL17ON"
#define AOF_MALM "AL17OF"
#define AON_MALM "AL17ON"
#define AOF_LO "AL18OF"
#define AON_LO "AL18ON"
#define AOF_PRE "AL18OF"
#define AON_PRE "AL18ON"
#define AOF_LEAK "AL19OF"
#define AON_LEAK "AL19ON"
#define AOF_DVP "AL21OF" ! DV+
#define AON_DVP "AL21ON" ! DV+
#define AOF_BDVP "AL21OF" ! BDV+
#define AON_BDVP "AL21ON" ! BDV+
#define AOF_DV1 "AL21OF"
#define AON_DV1 "AL21ON"
#define AOF_PERR "AL21OF"
#define AOF_DVM "AL22OF" !
#define AON_DVM "AL22ON" !
DV-#define AOF_BDVM "AL22OF" !
#define AON_BDVM "AL22ON" !
BDV-#define AOF_VELP "AL25OF" ! VEL+
#define AON_VELP "AL25ON" ! VEL+
#define AOF_HDV "AL25OF"
#define AON_HDV "AL25ON"
<1.9 Include File>
1-20
IM 33K03K10-50E 3rd Edition : Jun.28,2013-00
#define AOF_ANSP "AL25OF" ! ANS+
#define AON_ANSP "AL25ON" ! ANS+
#define AOF_RALM "AL25OF"
#define AON_RALM "AL25ON"
#define AOF_TRP "AL25OF"
#define AON_TRP "AL25ON"
#define AOF_VELM "AL26OF" !
#define AON_VELM "AL26ON" !
VEL-#define AOF_LDV "AL26OF"
#define AON_LDV "AL26ON"
#define AOF_BEND "AL26OF"
#define AON_BEND "AL26ON"
#define AOF_ANSM "AL26OF" !
#define AON_ANSM "AL26ON" !
ANS-#define AOF_SCBL "AL26OF"
#define AON_SCBL "AL26ON"
#define AOF_MHI "AL27OF"
#define AON_MHI "AL27ON"
#define AOF_BPRE "AL27OF"
#define AON_BPRE "AL27ON"
#define AOF_INT "AL27OF"
#define AON_INT "AL27ON"
#define AOF_MLO "AL28OF"
#define AON_MLO "AL28ON"
#define AOF_ERR "AL28OF"
#define AON_ERR "AL28ON"
#define AOF_CNF "AL32OF"
#define AON_CNF "AL32ON"
SEE
ALSO For more information about the method to reference the alarm status individually , refer to:
5.12, “Referencing Alarm Status Individually” on page 5-39
<1.9 Include File>