:Revision=2
:html
<<
128.167
IEC-Bus-Object|IEC
$NoSort
--
The IP-Object <!RW>IEC enables the access to IEC-Bus devices (also known as GPIB or IEEE-488-Bus).

The devices are addressed with the names defined in the basic setup, not with their IEC-Address!

The interface parameter setting occurs also in the basic setup.
>>

<<
128.167.1
Functions of the IEC-Bus-Object|Functions
--
>>
<<
128.167.1.1
IEC.IsActive|IsActive
--
<!DEF>
function <!TW>IEC.IsActive : real;
<!TXT>
Returns <!RW>TRUE, if the IEC-Bus is activated.


<!DEF>
function <!TW>IEC.IsActive (sName : string) : real;
<!TXT>
Returns <!RW>TRUE, if the IEC-device <!PW>sName is activated.
>>
<<
128.167.1.2
IEC.IsOpen|IsOpen
--
<!DEF>
function <!TW>IEC.IsOpen (sName : string) : real;
<!TXT>
Returns <!RW>TRUE, if the IEC-device <!PW>sName is open.
>>
<<
128.167.1.3
IEC.Error|Error
!128.167.3.1
!128.167.3.2
--
<!DEF>
function <!TW>IEC.Error : real;
<!TXT>
Returns the current error code of the IEC-Bus.

<!DEF>
function <!TW>IEC.Error (sName : string) : real;
<!TXT>
Returns the current error code of the IEC-device <!PW>sName.
>>
<<
128.167.1.5
IEC.Read|Read
--
<!DEF>
function <!TW>IEC.Read (sName : string) : string;
<!TXT>
Reads in a string from the IEC-device <!PW>sName. 

The Input-EOS-Sequence is removed automatically.
>>
<<
128.167.1.6
IEC.Get|Get
--
<!DEF>
function <!TW>IEC.Get (sName : string) : string;
<!TXT>
Reads in characters from the IEC-device <!PW>sName. 

The Input-EOS-Sequence is not taken into account.
>>

<<
128.167.1.7
IEC.GetValue|GetValue
--
<!DEF>
function <!TW>IEC.GetValue (sName : string; rDefault : real [; rFrom, rCount : real]) : real;
<!TXT>
Reads in a string from the IEC-device <!PW>sName. 

The Input-EOS-Sequence is removed automatically. 

Then there is an attempt to convert the string into a number. If this attempt is successful, then this number, otherwise the <!PW>rDefault value, is returned.

If <!PW>rFrom and <!PW>rCount are specified, then only <!PW>rCount characters from the <!PW>rFrom-th character are used for the conversion.
>>
<<
128.167.1.8
IEC.Exists|Exists
--
<!DEF>
function <!TW>IEC.Exists (sName : string) : real;
<!TXT>
Returns <!RW>TRUE, if the IEC-device <!PW>sName is available (defined).
>>
<<
128.167.2
Procedures of the IEC-Object|Procedures
--
>>
<<
128.167.2.1
IEC.DeviceClear|DeviceClear
--
<!DEF>
procedure <!TW>IEC.DeviceClear (sName : string);
<!TXT>
Sends the Selected-Device-Clear-Command to the IEC-device <!PW>sName.
>>
<<
128.167.2.2
IEC.GotoLocal|GotoLocal
--
<!DEF>
procedure <!TW>IEC.GotoLocal (sName : string);
<!TXT>
Sends the Go-To-Local-command to the IEC-device <!PW>sName.
>>
<<
128.167.2.7
IEC.Send|Send
--
<!DEF>
procedure <!TW>IEC.Send (sName : string; .Data : string|vector);
<!TXT>
Sends the string <!PW>Data (the byte vector <!PW>Data) decorated with the Output-EOS-Sequence to the IEC-device <!PW>sName.
>>
<<
128.167.2.8
IEC.Put|Put
--
<!DEF>
procedure <!TW>IEC.Put (sName : string; .Data : string|vector);
<!TXT>
Sends the string <!PW>Data (resp. the byte vector <!PW>Data) to the IEC-device <!PW>sName (without regarding the Output-EOS-Sequence)
>>

<<
128.167.3
Error codes of the IEC-Bus-Object|Error codes
--
>>

<<
128.167.3.1
Error codes of the IEC-devices|Device errors
--
<!STBL>
<!+>Code<!+>Meaning<!>
<!c>0<!>everything ok<!>
<!c>1<!>Port not opened (or inactive)<!>
<!c>2<!>Exception (unexpected error)<!>
<!c>3<!>Timeout while waiting for data<!>
<!c>4<!>Error on the IEC-Bus level, enquiry of IEC.Error<!>
<!ETBL>
>>

<<
128.167.3.2
Error codes of the IEC-Bus|Bus errors
--
<!STBL>
<!+>Code</b></td><td colspan=2 align=centered><b>Meaning</b><!>
<!c>1<!>ECIC<!>Not CIC<!>
<!c>2<!>ENOL<!>No Listener<!>
<!c>3<!>EADR<!>Address Error<!>
<!c>4<!>EARG<!>Invalid Arguments<!>
<!c>5<!>ESAC<!>Not System Controller<!>
<!c>6<!>EABO<!>Operation aborted<!>
<!c>7<!>ENEB<!>No GPIB board<!>
<!c>10<!>EOIP<!>Async I/I in progress<!>
<!c>11<!>ECAP<!>No Capability<!>
<!c>12<!>EFSO<!>File Error<!>
<!c>14<!>EBUS<!>Command error<!>
<!c>15<!>ESTB<!>Status byte lost<!>
<!c>16<!>ESRQ<!>SRQ Stuck On<!>
<!c>20<!>ETAB<!>Table Overflow<!>
<!c>252<!>ECFG<!>Incorrect board<!>
<!ETBL>
>>
<<
128.167.4
Upgrading of old IP-Steps of the old Windows-System|Upgrade
--
In the following, the new equivalents for the 'old' commands are specified:

<!CODE>
IEC.SendString -> IEC.Send / IEC.Put
<!TXT>
Basic setup values are to be considered.

<!CODE>
IEC.GetString -> IEC.Read / IEC.Get
<!TXT>
Now a function, the second parameter is not longer used.
The successful result can be enquired with IEC.Error().

<!CODE>
IEC.GetValue -> IEC.GetValue
<!TXT>
Now a function, the significance of the second parameter has changed this time!

<!CODE>
IEC.DeviceClear -> IEC.DeviceClear
<!TXT>
No change.

<!CODE> 
IEC.Local -> IEC.GotoLocal
<!TXT>
Only the name of the command has changed.
>>

