02.09.2014 Views

ISPSoft User Manual

ISPSoft User Manual

ISPSoft User Manual

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

<strong>ISPSoft</strong> <strong>User</strong> <strong>Manual</strong><br />

the caller) is four elements. The array type of FB_Var (in the function block) is INT,<br />

and the size of the array for FB_Var (in the function block) is three elements.<br />

The basic principles for the symbols whose data types are ARRAY are satisfied. As a result,<br />

the array types are legal.<br />

Example 7: The array type of P_Var is WORD, and the size of the array for P_Var is two elements.<br />

The data type of FB_Var is WORD (not ARRAY).<br />

The second special principle for the symbols whose data types are ARRAY is satisfied. As a<br />

result, the array type and the data type are legal.<br />

Example 8: The array type of P_Var is WORD, and the size of the array for P_Var is four<br />

elements. The data type of FB_Var is DWORD (not ARRAY).<br />

The third special principle for the symbols whose data types are ARRAY is satisfied. As a<br />

result, the array type and the data type are legal.<br />

ㄨ Example 9: The array type of P_Var is DINT, and the size of the array for P_Var is four elements.<br />

The array type of FB_Var is INT, and the size of the array for FB_Var is two<br />

elements.<br />

The array type of P_Var is not the same as the array type of FB_Var. As a result, the array<br />

types are illegal.<br />

Example 10: The data type of P_Var is DWORD (not ARRAY). The array type of FB_Var is<br />

WORD, and the size of the array for FB_Var is two elements.<br />

The third special principle for the symbols whose data types are ARRAY is satisfied. As a<br />

result, the data type and the array type are legal.<br />

Additional remark<br />

(a) If the principles above are satisfied, the data length of P_Var (in the caller) is larger than that of<br />

FB_Var (in function block), and the value of P_Var is sent to FB_Var, the values of the bits<br />

starting from the lowest bit in P_Var are retrieved, and the number of values retrieved conforms<br />

to the data length of FB_Var. If principles above are satisfied, the data length of P_Var (in the<br />

caller) is larger than that of FB_Var (in function block), and the value of FB_Var is sent to P_Var,<br />

the values of the bits starting from the lowest bit in P_Var are overwritten, the number of values<br />

overwritten conforms to the data length of FB_Var, and the values which are not overwritten<br />

remains unchanged. <strong>User</strong>s have to be more careful about the correctness of the data when they<br />

use P_Var and FB_Var.<br />

(b) The data type of a symbol in a function block in a project for an AH500 series CPU module can<br />

be POINTER. Please refer to section 7.2.4 for more information.<br />

7.2.4 Symbol Whose Data Type is POINTER, T_POINTRER,<br />

C_POINTER, or HC_POINTER<br />

A symbol whose data type is POINTER, T_POINTER, C_POINTER, or HC_POINTER functions to<br />

send the symbol or the device address specified by the caller to the function block. The use of a<br />

symbol whose data type is POINTER, T_POINTER, C_POINTER, or HC_POINTER is quite<br />

different from the use of a symbol whose data type is a general data type. A symbol whose data type<br />

is a general data type in a function block either receives the value from the device specified by the<br />

caller or sends the operation result to the device specified by the caller. If the data type of a pin of a<br />

function block is POINTER, T_POINTER, C_POINTER, or HC_POINTER, the data sent to the<br />

function block will be the symbol or the device address assigned to the pin. As a result, the object<br />

processed in a function block is the object which is specified.<br />

The caller assigns D0 to pVAR in the function block, and the data type of pVAR in the function block<br />

is POINTER, T_POINTER, C_POINTER, or HC_POINTER, as shown in the figure below. If the<br />

function block is called and executed, pVAR in the function block will be regarded as D0.<br />

7-8

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!