Please enable JavaScript to view this site.

Variables are entities whose value is not known during the writing of a program and normally varies during its execution.

The data types used by the R3 language are:

Type

Description

I8

8-bit signed integer variable

I16

16-bit signed integer variable

I32

32-bit signed integer variable

U8

8-bit unsigned integer variable

U16

16-bit unsigned integer variable

U32

32-bit unsigned integer variable

INT

32-bit integer variable (it is like I32)

FLOAT

Floating point variable 4 Byte

REAL

Floating point variable 8 Byte (double)

BOOL

Boolean variable

CHAR

Char type variable (it is like I8)

STRUCT

Structure type variable

STRUCT_P

Packed structure type variable (data is contiguous, takes up less space)

STRING

String type variable (127 char + terminator)

TABSTR

Tables of string constants

COUNTER

Variable of type counter

TIMER

Variable of type timer

POWER_SET

Variable for power handling

BCC_MSGUSER

Support structure for functions bcc_send(), bcc_receive(), ...

STRU_BCC_TCP_CLIENT

Support structure for functions bcc_get_tcp_clients_info() and getTcpClientsInfo()

STRU_AAX

Support structure for functions planar_comp_ip() and planar_comp_cp()

STRU_AXIO_PDI

Support structure for functions axio_robj() and axio_wobj()

STRU_CO_OBJ

Support structure for functions co_robj() and co_wobj()

STRU_COE_OBJ

Support structure for functions co_robj () and co_wobj()

STRU_COERRMSG

Support structure for function co_rerr()

STRU_STAT

Support structure for function statistics()

STRU_GROR

Support structure for function group order()

STRU_FILEINFO

Support structure for function f_dir()

STRU_MVITP

Support structure for movement function mva_to_n()

STRU_MATCAM

Support structure for movement function mv_cam()

STRU_MODBUS

Support structure for communication functions modbus/tcp

STRU_CAM

Support structure for movement function mv_table()

STRU_MVTO

Support structure for movement function mv_to()

STRU_MVTOCJ

Support structure for movement function mv_to_cj()

STRU_MVTOCJV

Support structure for movement function mv_to_cjv()

STRU_MVTOCJV_INFO

Support structure for function mv_to_cjv_info()

STRU_MVTOCJVE

Support structure for movement function mv_to_cjv()

STRU_MVZC

Support structure for movement function mva_zc()

STRU_MVGENITP

Support structure for movement function mva_to_n_v()

STRU_MVITPCJ

Support structure for movement function mva_to_n_cj()

STRU_AH_D

Support structure for function ah_get_d()

STRU_AH_INFO

Support structure for function ah_info()

STRU_AS_D

Support structure for function as_get_d()

STRU_FILEHND

Support structure for functions f_open(), f_close(), ..

STRU_INT

Support structure for functions int_after(), int_inp() e int_timer()

STRU_LARGE_INT

Support structure for functions get_i64() e set_i64()

STRU_LARGE_UINT

Support structure for functions get_u64() e set_u64()

STRU_CRIMPER

Support structure for movement function mv_crimper()

STRU_ECAT_PROBE

Support structure for function ecat_probe()

STRU_FOLLOW

Support structure for movement function mv_follow()

STRU_FOLLOW2

Support structure for movement function mv_follow2()

STRU_FOLLOW2_S

Support structure for movement function mva_follow2()

STRU_FOLLOW2_SM

Support structure for movement function mva_follow2_m()

STRU_FOLLOW2_INFO

Support structure for movement function mv_follow2()

STRU_HW_INFO

Support structure for function get_hw_info()

STRU_PHADJ

Support structure for movement function mv_phase_adj()

STRU_PHADJ2

Support structure for movement function mv_phase_adj2()

STRU_PM_PD

Support structure for function axio_pm_r()

STRU_REACHTARGET

Support structure for movement function mv_reach_target()

STRU_SAFETY_PRJINFO

Support structure for function safe_prj_info()

STRU_SOE_IDN

Support structure for functions soe_ridn() e soe_widn()

STRU_SYNCHRO

Support structure for movement function mv_synchro()

STRU_TRACK

Support structure for movement function tracking()

STRU_MASTERF

Support structure for function master_filter()

NOTE: Nesting of structures (structures of structures) is allowed.

Variables can have the following levels of visibility:

Visibility

Description

Global

These are the R3 language's predefined variables or locales declared as public (see below). They are accessible from all tasks and usable on all debugging tools

Local

Accessible variables (R/W) from the task in which they are declared only.

They must be defined at the beginning of the source file before the instructions.

INT pluto

Public

Variables accessible (R/W) by the task to which they are declared and normally readable by other tasks. (see external)

They must be defined at the beginning of the source file, before instructions, prefixed with "PUBLIC".

PUBLIC INT pluto

External

Variables from a different task.

They are normally read-only unless the task that includes them has the metacommand "$WRITE_ON_EXTERN" at its beginning.

They must be defined at the beginning of the source file with the prefix "EXTERN" to which the equivalent PUBLIC must necessarily correspond in another task. (see Public)

EXTERN INT pluto

Retentive

User structure of which retentiveness is desired at shutdown.(retentive memory)

It has the following special features:

Maximum size of the structure is smaller than that of the user area of retentive memory (see report)

Cannot be an array of structure (but nothing prohibits it from being inside it)

Maximum size of structure name of 31 characters

Maximum variable name size of 31 characters

The metacommand $ WRITE_ON_EXTERN must be present in order to write this structure.

The association of the user structure to the retentive structure occurs only at load time if and only if NO previous associations exist

If a retentive structure already exists then, at task startup, the structure name, instance name, and size are checked to match those previously recorded

This structure is saved, as are the registers, when the control is turned off

Example:

$WRITE_ON_EXTERN

STRUCT ret_struct    

   INT integerData[20];    

   REAL realData[10];    

   STRING setName[64];

END_STRUCT

RETENTIVE ret_struct retentiveData

retentiveData.integerData[0] = SECOND

retentiveData.integerData[1] = MINUTE

retentiveData.integerData[2] = HOUR

NOTE: To delete the association of the user structure to the retentive structure use the device command (ascii directive) REMOVE NV_USERSTRUCT.

NOTE: To initialize the structure in case of memory loss use the device command (ascii directive) RESTORE NV_USERSTRUCT.

NOTE: To automatically enlarge the size of the structure, provided the structure and instance names are the same, use bit 10 of the default variable SYS_CFG.

Local to functions

Variables that are defined within function() and are usable only within it. These variables lose their contents each time the function exits.

NOTE: It is possible to redefine the name of local variables, that means, internal variables can have the same name as local variables. However, it is recommended to use different names to avoid confusion.

WARNING: These are different locations, that means, internal and local variables with the same name occupy different physical memory locations. Changing an internal variable has no effect on a local variable that has the same name.

Several variables with the same name can be declared in functions.

They are NOT usable by debugging tools.

They can also be placed in motion fields within rules. They behave similarly to those declared in functions.

It is possible to declare local variables in rules, as long as they are within the REF / MOTION / AUX blocks. Variables in the REF block are visible only in the block itself; those in MOTION and AUX are in common with each other.

You can declare local variables within the task main code (visibility is limited between the point of declaration and the end of main).

 

  

Keyboard Navigation

F7 for caret browsing
Hold ALT and press letter

This Info: ALT+q
Page Header: ALT+h
Topic Header: ALT+t
Topic Body: ALT+b
Contents: ALT+c
Search: ALT+s
Exit Menu/Up: ESC