ISPSoft User Manual
ISPSoft User Manual ISPSoft User Manual
Chapter 7 Function Block Class VAR_IN_OUT Description A symbol of this class is used as a feedback pin of a function block. When the function block is called, the value of an operand specified by the superior POU (caller) is sent to the function block through the symbol of this type. After the function is executed, the operation result is sent to the operand specified by the superior POU (caller). • Data types Model AH500 DVP Description BOOL, WORD, DWORD, LWORD, INT, DINT, LINT, REAL, LREAL, ARRAY, STRING, POINTER, T_POINTER, C_POINTER, HC_POINTER, and a function block BOOL, WORD, DWORD, LWORD, REAL, ARRAY, STEP, TIMER, and COUNTER *1. The data type of a symbol of the VAR_INPUT class, the VAR_OUTPUT class, or the VAR_IN_OUT class can not be STRING, STEP, COUNTER, or TIMER. *2. Please refer to section 7.2.4 for more information about POINTER, T_POINTER, C_POINTER, and HC_POINTER. • Assigning memories to the symbols in a function block Model Description When the symbols whose data type is a function block, and the local symbols AH500 created in a function block are declared, users can not assign device addresses to them. The system will automatically assign memories reserved by the CPU module. Every symbol whose data type is a function block is assigned a P device. Besides, DVP the system automatically assigns devices in the PLC to the local symbols in a function block instance according to the data types of the local symbols. *. Please refer to sections 7.2.5~7.2.7 for more information about function block instances and the assignment of memories. 7.2.3 Input/Output Pins of a Function Block When a POU calls a function block, it sends the value in a device to the input pin of the function block. After the function block is executed, the operation result is sent to the device in the POU through the output pin of the function block. Please refer to the following figures. • Before a function block is executed The caller assigns D0 to DT_IN, the input pin of the function block. When the function block is called, the system sends the present value in D0 to DT_IN. (DT_IN is a symbol of the VAR_INPUT type.) • After a function block is executed After the function block is executed, the value of DT_IN becomes 89. The value in D0 is unchanged. Besides, DT_OUT sends the final operation result to D2, the device specified by the caller. Even if the value in D2 is overwritten during the execution of the program, the value of DT_OUT will remain unchanged. (DT_ OUT is a symbol of the VAR_OUTPUT class.) 7-5
ISPSoft User Manual Although the value of the symbol of the VAR_IN_OUT class will be sent to the device that the caller assigns to the symbol after the function block is executed, the present value in the device specified by the caller is sent to the symbol before the symbol sends the final operation result to the device. *. The data type of the symbol of the VAR_IN_OUT class in a function block in a project for an AH500 series PUC module can be POINTER. The caller can send the device address to the function block through the symbol whose data type is POINTER. Please refer to the following section for more information. Please refer to the function blocks below. FB_Var is the pin of the function block, and P_Var is the operand that the superior POU (caller) assigns to FB_Var. The data type of P_Var and that of FB_Var must conform to the basic principle described below. However, in order to make the writing of a program more convenient, ISPSoft provides some special principles. As long as the data type of P_Var and that of FB_Var conform to one of the special principles, the system will regard the data types as legal data types even if the data types does not conform to the basic principle. • Basic principle for the general data types The data type of P_Var must be the same as the data type of FB_Var. • Special principles for the general data types (Please refer to the following table.) 1. If either the data type of P_Var or the data type of FB_Var is WORD, DWORD, or LWORD, the data type of the other symbol can be WORD, DWORD, LWORD, INT, DINT, LINT, REAL, or LREAL. If this condition is met, the data length of P_Var can be larger than or equal to the data length of FB_VAR. 2. If the data type of P_Var is STEP, the data type of FB_Var can be BOOL. The state of the step in the caller will be used in the function block. FB_Var (function block) Data type WORD DWORD LWORD INT DINT LINT REAL LREAL BOOL WORD DWORD P_VAR (caller) LWORD INT DINT LINT 7-6
- Page 200 and 201: Chapter 5 Program Organization Unit
- Page 202 and 203: Chapter 5 Program Organization Unit
- Page 204 and 205: Chapter 5 Program Organization Unit
- Page 206 and 207: Chapter 5 Program Organization Unit
- Page 208 and 209: Chapter 5 Program Organization Unit
- Page 210 and 211: Chapter 5 Program Organization Unit
- Page 212 and 213: Chapter 5 Program Organization Unit
- Page 214 and 215: Chapter 5 Program Organization Unit
- Page 216 and 217: Chapter 5 Program Organization Unit
- Page 218 and 219: Chapter 6 Symbols Table of Contents
- Page 220 and 221: Chapter 6 Symbols • VAR-General s
- Page 222 and 223: Chapter 6 Symbols 6.1.4 Assigning a
- Page 224 and 225: Chapter 6 Symbols Application Examp
- Page 226 and 227: Chapter 6 Symbols • Local symbol
- Page 228 and 229: Chapter 6 Symbols • STRING If the
- Page 230 and 231: Chapter 6 Symbols • Auto-close Di
- Page 232 and 233: Chapter 6 Symbols double quotes, an
- Page 234 and 235: Chapter 6 Symbols *. Before the ini
- Page 236 and 237: Chapter 6 Symbols Select a file whi
- Page 238 and 239: Chapter 6 Symbols Press Alt+ on the
- Page 240 and 241: Chapter 6 Symbols Users can set a d
- Page 242 and 243: Chapter 6 Symbols Double-click RUN_
- Page 244 and 245: Chapter 6 Symbols If users want to
- Page 246 and 247: Chapter 7 Function Block Table of C
- Page 248 and 249: Chapter 7 Function Block 7.1.2 Char
- Page 252 and 253: Chapter 7 Function Block P_VAR (cal
- Page 254 and 255: Chapter 7 Function Block The princi
- Page 256 and 257: Chapter 7 Function Block *. SM400 i
- Page 258 and 259: Chapter 7 Function Block In view of
- Page 260 and 261: Chapter 7 Function Block itself. As
- Page 262 and 263: Chapter 7 Function Block • DVP se
- Page 264 and 265: Chapter 7 Function Block Function b
- Page 266 and 267: Chapter 7 Function Block HC_POINTER
- Page 268 and 269: Chapter 7 Function Block program in
- Page 270 and 271: Chapter 7 Function Block The functi
- Page 272 and 273: Chapter 7 Function Block Please ref
- Page 274 and 275: Chapter 7 Function Block After the
- Page 276 and 277: Chapter 7 Function Block Open the w
- Page 278 and 279: Chapter 7 Function Block Obviously,
- Page 280 and 281: Chapter 8 Ladder Diagram Table of C
- Page 282 and 283: Chapter 8 Ladder Diagram Local symb
- Page 284 and 285: Chapter 8 Ladder Diagram Selecting
- Page 286 and 287: Chapter 8 Ladder Diagram (4) After
- Page 288 and 289: Chapter 8 Ladder Diagram (b) ‣ Bo
- Page 290 and 291: Chapter 8 Ladder Diagram Users can
- Page 292 and 293: Chapter 8 Ladder Diagram (2) Select
- Page 294 and 295: Chapter 8 Ladder Diagram (2) Click
- Page 296 and 297: Chapter 8 Ladder Diagram The steps
- Page 298 and 299: Chapter 8 Ladder Diagram 8.2.10 Sym
<strong>ISPSoft</strong> <strong>User</strong> <strong>Manual</strong><br />
Although the value of the symbol of the VAR_IN_OUT class will be sent to the device that the<br />
caller assigns to the symbol after the function block is executed, the present value in the device<br />
specified by the caller is sent to the symbol before the symbol sends the final operation result to<br />
the device.<br />
*. The data type of the symbol of the VAR_IN_OUT class in a function block in a project for an AH500 series PUC<br />
module can be POINTER. The caller can send the device address to the function block through the symbol<br />
whose data type is POINTER. Please refer to the following section for more information.<br />
Please refer to the function blocks below. FB_Var is the pin of the function block, and P_Var is the<br />
operand that the superior POU (caller) assigns to FB_Var. The data type of P_Var and that of<br />
FB_Var must conform to the basic principle described below. However, in order to make the<br />
writing of a program more convenient, <strong>ISPSoft</strong> provides some special principles. As long as the<br />
data type of P_Var and that of FB_Var conform to one of the special principles, the system will<br />
regard the data types as legal data types even if the data types does not conform to the basic<br />
principle.<br />
• Basic principle for the general data types<br />
The data type of P_Var must be the same as the data type of FB_Var.<br />
• Special principles for the general data types (Please refer to the following table.)<br />
1. If either the data type of P_Var or the data type of FB_Var is WORD, DWORD, or LWORD, the<br />
data type of the other symbol can be WORD, DWORD, LWORD, INT, DINT, LINT, REAL, or<br />
LREAL. If this condition is met, the data length of P_Var can be larger than or equal to the data<br />
length of FB_VAR.<br />
2. If the data type of P_Var is STEP, the data type of FB_Var can be BOOL. The state of the step<br />
in the caller will be used in the function block.<br />
FB_Var (function block)<br />
Data type<br />
WORD DWORD LWORD INT DINT LINT REAL LREAL BOOL<br />
WORD <br />
DWORD <br />
P_VAR<br />
(caller)<br />
LWORD <br />
INT <br />
DINT <br />
LINT <br />
7-6