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

From SoftMC-Wiki
Jump to: navigation, search
 
Line 1: Line 1:
{{Languages}}
+
{{Languages|MC-Basic:SYSTEM.DIN}}
 
{{MC-Basic
 
{{MC-Basic
 
|SHORT FORM=
 
|SHORT FORM=
Line 20: Line 20:
  
 
|DESCRIPTION=
 
|DESCRIPTION=
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.
+
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 [[MC-Basic:SYSTEM.DOUT| .DOUT]] command. <br>
 +
 
 +
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.
 
If a single bit is being accessed, the argument (or value) must have the value 1 or 0.
Line 34: Line 36:
 
Hex: 0x0 to 0x7FFFFF<br>
 
Hex: 0x0 to 0x7FFFFF<br>
  
<number of mapped bits>: 1 to 23
+
<number of default 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|Approaching (reading or writing) 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=

Latest revision as of 09:56, 4 March 2018

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