Get I/O Pin Status (Gx) instruction

Description

(see instruction description format info here)

Function:Reads the status of a certain I/O line of the DS
Parameter (P) cmd format:PGx, where x is the I/O line number
Possible replies:As, C, D, R, where s is the state of I/O line (0 or 1)
Relevance conditions:---
First introduced:Earlier than "baseline" V3.14/V3.51
See also:Serial port and serial communications

Details

Get I/O Pin Status instruction returns the status of the DS I/O line specified by the x parameter:

Value of x

DS100R, EM100-EV

DS100B, DS203, EM120/EM200-EV*

0

<Not implemented>

<Not implemented>

1

<Not implemented>

<Not implemented>

2

<Not implemented>

DSR (input)**

3

<Not implemented>

DTR (output)**

4

CTS (input)

CTS (input)**

5

RTS (output)**

RTS (output)**

6

<Not implemented>

<Not implemented>

7

<Not implemented>

<Not implemented>

8

<Not implemented>

<Not implemented>

Value of x

EM100

EM120, EM200

0

P0

<Not implemented>

1

P1

<Not implemented>

2

P2/DSR(input)***

P2/DSR(input)***

3

P3/DTR(output)***

P3/DTR(output)***

4

P4/CTS(input)***

P4/CTS(input)***

5

P5/RTS(output)***

P5/RTS(output)***

6

<Not implemented>

P6

7

<Not implemented>

P7

8

<Not implemented>

P8

* This data is for the case when you are using RS232 FB9M connector of the EM120/EM200-EV. If you are using expansion connector (three jumpers removed) then use I/O data for the EM120 and EM200 Modules

** From firmware standpoint, these are general-purpose lines of the Ethernet Modules that can be used as inputs. These I/O lines, however, are connected to the CMOS inputs of RS232 (RS422, RS485) transceivers and that dictates that the lines can only be used as outputs.

*** These are general-purpose input/output pins. Application firmware uses these pins to implement specific serial port functionality (shown in blue)and this defines "logical" direction of the pins

I/O line status ( s ) returned by the Get I/O Pin Status instruction indicates current status of the I/O lines of Modules. For Serial Device Servers and Boards that incorporate RS232 transceivers actual line status on the RS232 connector actual line status is exactly opposite to the value of s : if s =0 then the line is at HIGH, if s =1- the line is at LOW. Notice, that not only inputs, but also outputs can be monitored using this command.

Error (C) reply code is returned if the data supplied in the command is invalid. Denied (D) reply code is returned if:

On-the-fly Commands (RC) setting is 0 (disabled).
If no password or incorrect password is supplied while the On-the-fly Password (OP) setting is 1 (enabled) and the password is set (value of the Password (PW) setting is not <NULL>).

Rejected (R) reply code is returned if this command is sent while the DS is in the serial programming mode .

I/O line status can be set using Set I/O Pin Status (Sx) instruction .