Figure 6.3. interpretation of the i/o status, 2 output control command – SENA HD1100 User Manual

Page 30

Advertising
background image

Starter Kit and User Manual for the HelloDevice 1100

27

The status value of I/O monitor command and response depends on user’s design of the hardware. For

example, the status value may be set as LOW to turn on LED if LED circuitry is designed to operate as Active

LOW. The user should be careful when setting or interpreting the status value, since the result will be based on

the hardware design. Currently, the Input switches of Demo Board are designed to work as LOW-Active mode,

whereas output LED’s are implemented as HIGH-Active mode. The examples in this chapter will be based on

the assumption that you are using HelloDevice Demo Board.

For example, when the input contact point 0, 2, 4 and 10 are in the high state and the output contact point 1, 3

and 5 are in the high state, the HelloDevice will send the FB:EA:00:2A hexadecimal value response as shown by

the Figure 6.3. The socket interface program will interpret this value and display each input and output contact

point according to the value (Only the input contact point 0, 2, 4 and 10 as well as the output contact point 1, 3

and 5 are in the high state.)

15

14

13

12

11

10

9

8

7

6

5

4

3

2

1

0

15

14

13

12

11

10

9

8

7

6

5

4

3

2

1

0

1

1

1

1

1

0

1

1

1

1

1

0

1

0

1

0

0

0

0

0

0

0

0

0

0

0

1

0

1

0

1

0

1111 | 1011 | 1110 | 1010 = 0xFBEA

0000 | 0000 | 0010 | 1010 = 0x002A

Input Contact Point Status

Output Contact Point Status

Figure 6.3. Interpretation of the I/O status

Note:

In response to the I/O status monitoring command, 4 bytes data in total is practically required that combines 16

input points and 16 output points (32 points = 32 bits = 4 bytes), but the HelloDevice always sends 16 bytes

value to the user PC. Therefore, the user should interpret the first 4 bytes of the receiving packet. That’s

because the Ethernet packet of the general PC LAN card is set to receive at least 64 bytes, including IP, TCP

headers, and the LAN card discards the packet that is shorter than minimum Ethernet packet length so that the

packet sent from the HelloDevice to the user PC cannot reach to the socket interface of the user PC. The

packet that the socket interface receives will be as follows:

2 bytes

2 bytes

60 bytes

Input contact point status

Output contact point status

NULL data

6.1.2 Output Control Command

The output control command is used to set the output contact points of the HelloDevice to high or low

discretionary, and no response is generated.

Advertising