Difference between revisions of "MC-Basic:SYSTEM.DIN"

From SoftMC-Wiki
Jump to: navigation, search
m
m
Line 66: Line 66:
 
* [[MC-Basic:SYSTEM.VOUT|SYSTEM.VOUT]]
 
* [[MC-Basic:SYSTEM.VOUT|SYSTEM.VOUT]]
  
 +
[[Category:MC-Basic:System|MC-Basic:System]]
 
}}
 
}}
[[Category:MC-Basic:System|MC-Basic:System]]
 

Revision as of 14:20, 28 May 2014

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

<bit number>: 1 to 23

<number of bits>: 1 to 32

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.

See Also