:Revision=2
:html
<<
128.144
Object for Serial-IO-Modules|SerIO
--
The IP-Object <!RW>SerIO gives direct, low level access to all defined serial IO modules. 

By using this object, even such command can be sent to the modules, that haven't been defined inside the test program.
>>

<<
128.144.1
Functions of the SerIO-Objects|Functions
--
>>

<<
128.144.1.1
SerIO.Send|Send
--
<!DEF>
function <!TW>SerIO.Send (sTarget, sSend : string; var sRecv : string [; rTimeout : real]) : real;
<!TXT>
Sends the (HexString) <!PW>sSend to the SerIO-Modul selected by <!PW>sTarget and returns the answer in <!PW>sRecv. 

<font color=#880000>
Warning:
This functions allows the interpreter to send commands to SerIO modules, that are not evaluated by any tool monitor. In case of output changes, the changeds are not reflected in the internal shadow registers and subsequent output changes using the normal commands might be suppressed due to being seen as 'no change' operation against the shadow register.
Example:
<ul indent=15>
<li>a MechIO output is set with a MechIO command</li>
<li>same output is reset with a SerIO command</li>
<li>the MechIO output should be set again with a MechIO command</li>
</ul>
the last MechIO command will not be executed, because the MechIO system doesn't detect a change against its last known output state.</li>
</font>

 <!PW>sTarget may give a module name directly: <!SW>AdapterMechIO or be constructed like:   <!SW>KindOfModule.ModulNumber

KindOfModule may be:
<!STBL>
<!+> Value <!+>Meaning<!>
<!>MechIO<!>MechIO module<!>
<!>IMeasX4<!>Current measuring module<!>
<!>RCMeas<!>RC-Meas module<!>
<!>AdapCPU<!>Adapter CPU<!>
<!>Unknown<!>not especially defined module<!>
<!ETBL>

 <!PW>sSend contains only the payload data, neither the SOT character (#$12), nor address or length byte.

The result returned in <!PW>sRecv will contain the complete answer.

If <!PW>rTimeOut is not given or -1, the default timeout given in the basic setup will be used. otherwise, <!PW>rTimeout defines the timeout in milliseconds.

The return value is an error code, describing the state of the concversation:
<!STBL>
<!+>Value<!+>Meaning<!>
<!c>0<!>no error<!>
<!c>1<!>Timeout, no complete answer<!>
<!c>2<!>Answer was too short<!>
<!c>3<!>Answer did'nt match the command<!>
<!c>4<!>Invalid characters in answer<br /><!REM>(normal, when doing a firmware request)<!TXT><!> 
<!c>5<!>Module sends: "Error in command"<!>
<!ETBL>

Example:
<!CODE>
// Request the firmware version of the second module of the 'unknown' module group
rStatus:=SerIO.Send ('Unknown.2', '3F', sRecv);

// Request the firmware version of the module, named 'AdapterMechMod'
rStatus:=SerIO.Send ('AdapterMechMod', '3F', sRecv);
<!TXT>
>>

<<
128.144.1.2
SerIO.Exists|Exists
--
<!DEF>
function <!TW>SerIO.Exists (sTarget : string) : real;
<!TXT>
Returns <!RW>TRUE, if the module specified by <!PW>sTarget exists.

 <!PW>sTarget may give a module name directly: <!SW>AdapterMechIO or be constructed like:   <!SW>KindOfModule.ModulNumber

KindOfModule may be:
<!STBL>
<!+> Value <!+>Meaning<!>
<!>MechIO<!>MechIO module<!>
<!>IMeasX4<!>Current measuring module<!>
<!>RCMeas<!>RC-Meas module<!>
<!>AdapCPU<!>Adapter CPU<!>
<!>Unknown<!>not especially defined module<!>
<!ETBL>
>>

<<
128.144.1.3
SerIO.IsActive|IsActive
--
<!DEF>
function <!TW>SerIO.IsActive (sTarget : string) : real;
<!TXT>
Returns <!RW>TRUE, if the module specified by <!PW>sTarget can be accessed.

 <!PW>sTarget may give a module name directly: <!SW>AdapterMechIO or be constructed like:   <!SW>KindOfModule.ModulNumber

KindOfModule may be:
<!STBL>
<!+> Value <!+>Meaning<!>
<!>MechIO<!>MechIO module<!>
<!>IMeasX4<!>Current measuring module<!>
<!>RCMeas<!>RC-Meas module<!>
<!>AdapCPU<!>Adapter CPU<!>
<!>Unknown<!>not especially defined module<!>
<!ETBL>
>>

<<
128.144.1.4
EEPROM-Functions|EEPROM
--
>>

<<
128.144.1.4.1
SerIO.EEPROM.Read|Read
--
<!DEF>
function <!TW>SerIO.EEPROM.Read ( sTarget : String; rEEPROMType, rIICAddress, rEEPROMAddress, rCount, rPageSize : real; var vData : Vector ) : real;
<!TXT>
Read EEPROM of SerIO module.
>>

<<
128.144.1.4.2
SerIO.EEPROM.Write|Write
--
<!DEF>
function <!TW>SerIO.EEPROM.Write ( sTarget : String; rEEPROMType, rIICAddress, rEEPROMAddress, rPageSize : real; var vData : Vector; rVerify : real ) : real;
<!TXT>
Write EEPROM of SerIO module.
>>

<<
128.144.2
Procedures of the SerIO-Objects|Procedures
--
>>

<<
128.144.2.1
SerIO.Log|Log
--
<!DEF>
procedure <!TW>SerIO.Log (sText : string);
<!TXT>
Logs the string <!PW>sText into the SerIO.Log file.

Works only, if the logging has been switched on in the basic setup or with <!RW>SerIO.Log.On
>>

<<
128.144.2.1.1
SerIO.Log.On|On
--
<!DEF>
procedure <!TW>SerIO.Log.On;
<!TXT>
Enables the logging of SerIO communication into the file %LOG%\SerIO.Log

Overwrites the setting in the basic setup, but only until the next reset, not permanently. 
>>

<<
128.144.2.1.2
SerIO.Log.Off|Off
--
<!DEF>
procedure <!TW>SerIO.Log.Off;
<!TXT>
Disables the logging of SerIO communication into the file %LOG%\SerIO.Log

Overwrites the setting in the basic setup, but only until the next reset, not permanently. 
>>
