<< 点击显示目录 >> 主页 PVI通信 > PVI帮助信息 > PVI Services > BR.AN.Namespace > BR.AN.PviServices > Variable Class > Variable Properties |
The properties of the Variable class are listed below. For a complete list of Variable class members, see the Variable Members topic.
Gets or sets the access type of this variable object. Object attributes control the approach when acquiring and handling process data of variable objects. Use OR to combine the different access types. |
|
Gets or sets the active state of this instance. |
|
The offset used for bitwise access to the variable. This parameter equals the Pvi VA parameter. Variable addressing. Default: -1 No variable addressing Using variable addressing, link objects can address subsets from the process data of a variable object. Bit addressing: With bit addressing, an individual bit is defined an integer variable. In the link object, the data format of the single variable or array must be defined with variable type Boolean (VT=boolean) or to a type which can be converted to Boolean. The variable object must have variable type Integer (signed or unsigned). The bit number is specified with the VA parameter. The bit number begins with 0 at the lowest valued bit. Example: "VT=boolean VA=2" - addresses Bit 2. If the variable object is an array of Integers, then a Boolean array can also be defined in the link object. Bit addressing is then carried out for each individual array. |
|
This is a combination of the supported cast / conversion modes. Combine the different modes by using the logical OR operator. The cast mode parameter is a bit coded. The adjustable conversion modes are represented by a bit within the bit list: Bit 0 (Value: 1) PG2000 or AS 1.3 - String variable: If the process object data format defines a i8 or u8 array (1 byte array), then the process data is regarded as a single variable of type string (VT=string) during data conversion. When reading the data format (access type TYPE or event "data format change"), "string" is returned as a variable type (i.e. actual data format = "VT=i8 VL=1 VN=24 CM=1" -> returned data format VT=string VL=24 VN=1). The parameter CM=1 must be specified in the process object for this. If CM=1 is only specified in the link object, then the actual data format is returned. Note: This conversion mode is provided for "old" PG2000 or AS 1.3 applications. New applications should not use these conversion parameters; rather, a String variable should also be defined as a String variable in the PLC. Bit 1 (Value: 2) Determines the way numbers appear in the string when converting from variable type String ("VT=string") to variable type Integer ("VT=i8, VT=u32"). Decimal mode is not active (bit=0): A string with leading 0 places is interpreted as octal (i.e. -077, 0012). If the string begins with "0x" or "0X", then the following places are interpreted as hexadecimal (i.e. 0x1f, -0x56a9, 0xA3). In all other cases, the string is interpreted as decimal. Decimal mode is active (bit = 1): The string is always interpreted as decimal. In other words, a string with leading zeroes is interpreted as decimal; "0x123" (hexadecimal) cannot be interpreted. Bit 2 (Value: 4) Determines the behavior of a variable when the value range is violated. A value range violation occurs if a number value cannot be represented in a variable. Example: The value 130 cannot be represented in a variable of type i8 (value range: -128 to 127), but rather in a variable of type u8 (value range: 0 to 255). If link objects and process objects use variable types of different value ranges, then a value range violation can occur in read or write direction (i.e. variable type in the link object i32 and in the process object i16, or variable type in the connection object i8 and in the process object u8). Value range monitoring is not active (bit=0): Group type behavior during data conversion: Group type Integer to a variable type Integer with a smaller value range: The number is truncated binary. Group type Float to a variable type with a smaller value range: In the number is not representable in the value range, then the result is undefined. Group type String to a variable type Float or Integer: If the number is not representable in the value range, then the result is undefined. Group type Float or Integer to variable type String: If the converted String is longer than the length of the string variable (parameter "VL"), then the string is truncated. Value range monitoring is active (bit=1): The behavior during active value range monitoring is the same as the behavior of limit monitoring (see "Scaling and Limiting"). Behavior when a violation of the value range occurs depends on the transfer direction: Writing variable data (PviWrite): Write tasks are halted when an error occurs. Data is not written to the PLC variable. Error code 12014 is returned in the write response. Additionally, the maximum representable value is returned with the write response and is sent to the application in the event data buffer (if specified) for function "PviWrite" or "PviWriteResultResponse". Reading variable data (PviRead or data change event): The maximum representable value is sent instead of the variable data. An error message is not given. In both cases, the respective retVal flags for Cast-overflow or Cast-underflow are set in the response info data (structure T_RESPONSE_INFO). Additional information concerning the response info data can be found in the "PviGetResponseInfo" function or the callback function SET_PVICALLBACK_DATA. Monitoring of limits is also carried out for String variable types ("VT=string"). A limit violation occurs when the string data is longer then the buffer size of the variables. Example: A string "abcdefg"+ terminating null cannot be put completely into a variable with the data format "VT=string VL=4". The retVal flag Cast-Overflow is set when a violation of the string limit or a violation in the positive value range of a numeric variable occurs. Cast-Underflow can only occur in connection with numeric variables with a negative value range (signed Integer, Float). A violation of the negative value range is signaled in this case. In non-interpretable characters are contained in a string which is to be converted to another variable type, this is handled like a string limit violation. Bit 3 (Value: 8) Determines the type of conversion of variable type Float ("VT=f32 ...") to variable type Integer ("VT=i8, VT=u32 ..."). Rounding mode is not active (bit=0): All places behind the decimal point of a Float are truncated. Example: 1.3 -> 1, -15.5 -> -15, 0.9999 -> 0. Rounding mode is active (bit = 1): All places behind the decimal point of a Float are rounded (4/5). Example: 1.3 -> 1, -15.5 -> -16, 0.9999 -> 1. Default / standard conversion = 0. |
|
Gets the array of names of the changed members if this variable is a struct or array. |
|
Gets or sets the Convert class of the Variable Value |
|
Gets the alignment for structures. This is the alignment of the structure on the PLC only!!! |
|
Gets the state of the instances data. |
|
Gets or sets if mebers of a struct or array should be expanded. If set to false no Variable objects will be created. The binary data which is a byte array will be accessable directly. |
|
Gets or sets |
|
Gets the FullName of this instance. |
|
Gets or sets the hysterese-value of this instance. The event hysteresis is only valid for single variables or fields of type Integer or FloatingPoint. The event hysteresis works only for read- NOT for write- access! |
|
Gets the IEC compliant data type infomration. |
|
Gets the INITIAL value from the PLC. Will be null as long no one calls ReadInitialValue or if the method fails. Do not mix up with InitialValue!!! |
|
Gets or sets the value which is used for the creation command. Will not be used if not set or empty. You must not mix up InitValue with . |
|
The collection of IO data points. |
|
Gets or sets the connection state of the PviServices object |
|
Overloaded. Gets an array element of type variable. |
|
Gets a collection of type MemberCollection which holds all members of this variable. Does only return objects of the first nesting level. Use StructureMembers to get a hashtable of all objects. |
|
Gets the name of the owning variable object if this is a struct or array member, else will return null. |
|
Gets the parent object of this instance (Parent types Cpu, Task or Service) |
|
Gets or sets the Polling state of the instance. Operating mode as a line or PLC event variable. If "false" monitoring for changes in the process data is carried out in the line or on the PLC. For this reason, PVI Manager doesn't need to carry out any cyclic read requests. |
|
Gets the PviPathName of this instance. |
|
Gets or sets wheter the varible is readonly or not. Instead of using this member you can also set the member Access to Access.Read. Allows read access to the process data of a variable object. If this attribute is not specified, a read access to the variable data is rejected with Error 12035. In addition, PVI Manager doesn't carry out any cyclic read requests. |
|
Gets or sets the refreshtime of this instance. |
|
Gets or sets the options for the RuntimeObjectIndex for INA2000. Use this options for arrays which have a start index != 0. |
|
Gets or sets a Scaling object for value manipulation |
|
Gets the scope of the instance. |
|
Gets the name of the structure element if this variable is part of a complex data type. The name starts at the first nesting level. If you call this method for the root item you will get an empty string! |
|
Gets the name of the structure if the variable is of type struct. |
|
Gets the hashtable of all structure members of this variable not only of the first nesting level like Members does. Do not add or remove objects to this hashtable. |
|
Only Valid for ANSL connections!!! Defines synchronized write/read access to variable data on the PLC Possible settings: /SYNC=0 ... Data consistency can only be ensured for single variables with a maximum size of 4 bytes and single variable of type double (8-byte float). This setting corresponds to write/read access to variables in INA2000. If the data from entire structures or fields should be transferred consistently, the user has to implement corresponding measures(e.g.with handshake variables). /SYNC=1 ... Write/Read access to variable data on the PLC is synchronized with the task class, thus guaranteeing data consistency. With synchronized write/read access, the variable data is copied to a buffer in the context of the respective task class. Only one copy procedure takes place in each task class cycle. The size of the buffer is currently 4096 bytes. This results in the following limitations: 1. The maximum data size of a synchronized variable is limited by the size of the buffer. 2. If the data size of all synchronized variables is greater than the size of the buffer, then the copy procedure will be split up across several task class cycles. In this case, it may not be possible to observe the predefined refresh rate or the associated necessary currentness of the variable data. For this reason, synchronized write/read access should be used sparingly. |
|
Gets or sets user specific information of type string for interaction between server and client variables |
|
Gets the actually read value or sets the value of the processvariable depending on the WriteValueAutomatic property(Event: ValueWritten) |
|
Gets or sets the WriteValueAutomatic state of this instance. |
Variable Class | BR.AN.PviServices Namespace
Generated from assembly BR.AN.PviServices [8.1.0.4]
Topics in this section: