MC-Basic:SYSTEM.DIN

From SoftMC-Wiki
Jump to: navigation, search
Language: English  • 中文(简体)‎

This property reads the value of one or more of the 23 digital inputs. These inputs mapped to support legacy application that required them. Reading of these inputs will give you "0" as a default value. To change that use .DOUT command.

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 default mapped bits>: 1 to 23

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