Difference between revisions of "MC-Basic:SYSTEM.DIN"
| Line 34: | Line 34: | ||
Hex: 0x0 to 0x7FFFFF<br> | Hex: 0x0 to 0x7FFFFF<br> | ||
| − | < | + | <number of mapped bits>: 1 to 23 |
| − | < | + | In case you want to use other bits you should mapped the wanted bits using [[softMC Configurator]], on the SDO setting window: <br> |
| + | [[file: SDO mapping.PNG|900px]] | ||
| + | |||
| + | {{note|Reading or writing to user's mapped bits will do with [[EtherCAT:EC SDO READ]] and [[EtherCAT:EC SDO WRITE]] commands, using indexes and sub-indexes as appears at sofMC Configurator.}} | ||
|UNITS= | |UNITS= | ||
Revision as of 09:10, 4 March 2018
| Language: | [[::MC-Basic:SYSTEM.DIN|English]] • [[::MC-Basic:SYSTEM.DIN/zh-hans|中文(简体)]] |
|---|
This property reads the value of one or more of the 23 digital inputs. The variable contains the values of the individual bits in the system input word. As there are 23 inputs, the 9 most significant bits of the word are all zero. When SYSTEM.DIN is qualified by a bit number, only that input bit is read. SYSTEM.DIN returns the value 1 or 0, depending on the value of the input.
If a single bit is being accessed, the argument (or value) must have the value 1 or 0.
When several successive bits are accessed (through the double-index format), the returned value is composed of all the bits’ values within the defined range.
Syntax
System.Din
Sys.Din
? System.Din
?System.Din.<bit number>
?System.Din[<bit number>]
?System.Din[<bit number>][<range>]
Availability
All versions
Type
A query returns a Double value.
Range
Decimal: 0 to 8 388 607 (223 –1)
Hex: 0x0 to 0x7FFFFF
<number of mapped bits>: 1 to 23
In case you want to use other bits you should mapped the wanted bits using softMC Configurator, on the SDO setting window:
Default
0, when no external device is connected.
Scope
Configuration, Task or Terminal
Limitations
Read only
Examples
MyVar = System.Din ‘MyVar is assigned the value of the input word
MyVar = System.Din.3 ‘MyVar is assigned 0 or 1, according to the value of the input bit number 3.
MyVar = System.Din[3] ‘MyVar is assigned 0 or 1, according to the value of the input bit number 3.
MyVar = System.Din[3][4] ‘MyVar is assigned by the values of the input bits 3, 4, 5 and 6.