RTC
®
5 PC Interface Board
Rev. 1.9 e
10 Commands And Functions
386
Ctrl Command read_io_port
Function returns the current state of the 16-bit digital input port on the EXTENSION 1 connector
Call
IOPort = read_io_port()
Result 16-bit value (DIGITAL IN0 … DIGITAL IN15) as an unsigned 32-bit value
Comments • Also see section "16-Bit Digital Input", page 207.
RTC
®
4
RTC
®
5 unchanged functionality
References write_io_port, write_io_port_mask, set_io_cond_list, clear_io_cond_list,
read_io_port_buffer, read_io_port_list
Ctrl Command read_io_port_buffer
Function returns the data previously stored in the IOPort buffer via read_io_port_list (input value
read at the EXTENSION 1 connector’s 16-bit digital input; the galvanometer set position
and time value that was current at the time of reading).
Call
CurrentIndex = read_io_port_buffer( Index, &Value, &XPos, &YPos, &Time)
Parameter
Index
number of the to-be-returned entry in the IOPort buffer as an unsigned 32-bit
value; only the 4 least significant bits are evaluated (the IOPort buffer only has
sixteen entries). Therefore, the user application can use a continuous counter
for the index.
Returned para-
meter values
Value
The 16-bit value stored in the IOPort buffer under
Index
as a pointer to an
unsigned 32-bit value
XPos,
YPos
The galvanometer scanner set positions (X and Y values) stored in the IOPort
buffer under
Index
as pointers to signed 32-bit values
Time
The time in seconds stored in the IOPort buffer under
Index
(as a pointer to an
unsigned 32-bit value)
Result The index to which data will be written upon the next read_io_port_list, as an unsigned
32-bit value
Comments • Also see comments for read_io_port_list.
• If no read_io_port_list command has been called before read_io_port_buffer, then
the initialization values (default: 0) will be returned.
Example
(C/C++)
Wait until the data under
Index
gets newly written:
while (Index == read_io_port_buffer(Index, &Value, &XPos, &YPos, &Time));
Read all data from
Index
to the current (not yet newly written) read position:
while (Index != read_io_port_buffer(Index, &Value, &XPos, &YPos, &Time))
{ Index = (Index+1) & 0xf; …}
RTC
®
4
RTC
®
5new command
References read_io_port_list