:Revision=3
:html
<<
128.140
Mechanics-IO-Modul-Object|MechIO
--
The IP-Object <!RW>MechIO makes the connection between the interpreter and the mechanics-IO-Modules defined in the basic setup.
>>

<<
128.140.1
Functions of the MechIO-Object|Functions
--
>>

<<
128.140.1.1
MechIO.ADC.Get|ADC.Get
--
<!DEF>
function <!TW>MechIO.ADC.Get (rNr, rChannel : real [; rUpdate : real]);
function <!TW>MechIO.ADC.Get (sName : string; rChannel : real [; rUpdate : real]);
<!TXT>
Returns the value of the AD-converter channel <!PW>rChannel (1..4) as byte.

If <!PW>rUpdate is <!RW>FALSE, then the internally saved value is used; otherwise the value is read in again. The default value for <!PW>rUpdate is <!RW>TRUE!

The module is selected by with <!PW>rNr by its module number or with <!PW>sName by its module name.
>>

<<
128.140.1.2
MechIO.DIn.Get|DIn.Get
--
<!DEF>
function <!TW>MechIO.DIN.Get (rNr : real) : real;
function <!TW>MechIO.DIN.Get (sName : string) : real;
<!TXT>
Returns the status of the digital inputs.
 
The module is selected by with <!PW>rNr by its module number or with <!PW>sName by its module name.
>>

<<
128.140.1.3
MechIO.DOut.Get|DOut.Get
--
<!DEF>
function <!TW>MechIO.DOUT.Get (rNr : real) : real;
function <!TW>MechIO.DOUT.Get (sName : string) : real;
<!TXT>
Returns the status of the digital outputs.

The module is selected by with <!PW>rNr by its module number or with <!PW>sName by its module name.
>>

<<
128.140.1.4
MechIO.Error|Error
--
<!DEF>
function <!TW>MechIO.ERROR (rNr : real) : real;
function <!TW>MechIO.ERROR (sName : string) : real;
<!TXT>
Returns the current error code

The module is selected by with <!PW>rNr by its module number or with <!PW>sName by its module name.

<!STBL>
<!+>Code<!+>Meaning<!>
<!c>0<!>everything ok<!>
<!c>1<!>Timeout while waiting for data<!>
<!c>2<!>response was too short<!>
<!c>3<!>response type was incorrect<!>
<!c>4<!>invalid characters in the response<!>
<!c>5<!>response error in the command<!>
<!c>101<!>port not opened (or inactive)<!>
<!c>102<!>exception (unexpected error)<!>
<!c>103<!>Timeout while waiting for data<!>
<!ETBL>
>>

<<
128.140.1.5
MechIO.IsActive|IsActive
--
<!DEF>
function <!TW>MechIO.IsActive (rNr : real) : real;
function <!TW>MechIO.IsActive (sName : string) : real;
<!TXT>
Returns <!RW>TRUE, if the module is activated in the basic setup.

The module is selected by with <!PW>rNr by its module number or with <!PW>sName by its module name.
>>

<<
128.140.2
Procedures of the MechIO-Object|Procedures
--
>>

<<
128.140.2.1
MechIO.DOut.Bits|DOut.Bits
--
<!DEF>
procedure <!TW>MechIO.DOut.Bits (rNr, rBits, rOperation, rSendIt : real);
procedure <!TW>MechIO.DOut.Bits (sName : string; rBits, rOperation, rSendIt : real);
<!TXT>
The bits given in <!PW>rBits are combined, as specified in the <!PW>rOperation, with the current status of the output bits.

If <!PW>rSendIt = <!RW>Send, then the data is sent to the card, otherwise it is stored internally.

 <!PW>rOperation  : <!RW>CLR | <!RW>SET | <!RW>FLIP | <!RW>NOP or 0..3

 <!PW>rSendIt     : <!RW>STORE | <!RW>SEND      or 0..1

The module is selected by with <!PW>rNr by its module number or with <!PW>sName by its module name.
>>

<<
128.140.2.2
MechIO.DOut.Word|DOut.Word
--
<!DEF>
procedure <!TW>MechIO.DOut.Word (rNr, rWord, rSendIt : real);
procedure <!TW>MechIO.DOut.Word (sName : string; rWord, rSendIt : real);
<!TXT>
The bits given in <!PW>rWord are used as the new status of the output bits.

If <!PW>rSendIt = <!RW>Send, then the data is sent to the card, otherwise it is stored internally.

 <!PW>rSendIt : <!RW>STORE | <!RW>SEND  or 0..1

The module is selected by with <!PW>rNr by its module number or with <!PW>sName by its module name.
>>

<<
128.140.2.3
MechIO.DOut.Send|DOut.Send
--
<!DEF>
procedure <!TW>MechIO.DOut.Send (rNr : real);
procedure <!TW>MechIO.DOut.Send (sName : string);
<!TXT>
Internally stored data is sent.

The module is selected by with <!PW>rNr by its module number or with <!PW>sName by its module name.
>>
