MC-Basic:SYSTEM.VIN
Language: | English • 中文(简体) |
---|
SYSTEM.VIN is used to read the value of one or more of the 32 virtual inputs. The variable contains the values of the individual bits in the system input word. When SYSTEM.VIN is qualified by a bit number, only that input bit is read. SYSTEM.VIN returns the value 1 or 0, depending on the value of the input. Virtual inputs are delivered from the Host over DPRAM. A query returns a Double value.
Syntax
Sys.VIn{.<bit number>} = <value>
System.VIn{.<bit number>} = <value>
?Sys.VIn{.<bit number>}
?System.VIn{.<bit number>}
Availability
All versions
Type
Double
Range
0 to MaxLong (232 –1)
<bit number>: 1 to 32
Default
0, when no external device is connected
Scope
Configuration, Task or Terminal
Limitations
- Read only
- Not supported in EtherCAT system
- DPRAM exists only in SERCOS II version of motion controller.
Examples
MyVar = System.VIn ‘MyVar is assigned the value of the input word
MyVar = System.VIn.3 ‘The variable ‘MyVar’ is assigned the value 0 or 1, according to the value of input bit 3