Set I/O Pin Status (Sx) instruction

Description

(see instruction description format info here)

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

Details

Sets I/O Pin Status instruction allows the network host to remotely set the status of the DS I/O line. Parameter x specifies the I/O line:

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

<Cannot be set>***

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 outputs. These I/O lines, however, are connected to the CMOS outputs of RS232 (RS422, RS485) transceivers and that dictates that the lines must only be used as inputs.

*** Hardware limitation

**** 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

Desired I/O line state ( s ) corresponds to the status of I/O lines of Modules. For Serial Device Servers and Boards that incorporate RS232 transceivers actual line status on the RS232 connector is exactly opposite to the value of s : if s =0 then the line will be set to HIGH, if s =1- the line will be set to LOW.

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 .

There are several cases when the Set I/O Pin Status (Sx) instruction is ignored by the DS:

When the current Flow Control (FC) [setting/ parameter] is 1 (enabled) or current Serial Interface (SI) is 1 (half-duplex) the DS ignores SP5s commands (i.e. commands that attempt to set the status of the RTS line). This is because in this case the RTS line is under the internal control of the DS.
When the DTR Mode (DT) setting is 1 (connection status) the DS ignores SP3s commands (i.e. commands that attempt to set the status of the DTR line). This is because in this case the DTR line is under the internal control of the DS.

Note, that in all above cases the DS still returns OK (A) reply code but the commands are discarded internally.