14.08.2013 Views

snap ethernet-based i/o units protocols and programming guide

snap ethernet-based i/o units protocols and programming guide

snap ethernet-based i/o units protocols and programming guide

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

CHAPTER 2: OVERVIEW OF PROGRAMMING<br />

For example, most digital bank data is in this form. To read the state of digital points, you would<br />

read the eight bytes starting at FFFFF0400000. Here’s how the data would be returned:<br />

At address: FFFFF0400000 FFFFF0400007<br />

These bit numbers: 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0<br />

Show data for these points: 63 62 61 60 59 58 57 56 7 6 5 4 3 2 1 0<br />

On modules in these<br />

positions in the rack:<br />

15 14 1 0<br />

Therefore, at this address: FFFFF0400000<br />

This hex data: B 1<br />

Equals this binary data: 1 0 1 1 0 0 0 1<br />

Showing the states: On Off On On Off Off Off On<br />

Of these points: 63 62 61 60 59 58 57 56<br />

Data from other addresses marked as masks is formatted in a similar way.<br />

Unsigned 32-bit Integer Data<br />

Much of the data in the memory map is in the form of unsigned integers, either one byte, two<br />

bytes, or four bytes. With multiple bytes, since the brain uses a Big Endian architecture, the high<br />

order byte is in the low order address.<br />

For example, digital bank counter data is in 4-byte unsigned integers. It takes four bytes to<br />

contain the data for one point. To read digital bank counter data for point 0, you would start with<br />

address FFFFF0400100. The following table shows the pattern of bank counter data for the first<br />

few points:<br />

Bytes at these<br />

addresses:<br />

Show data for<br />

this point:<br />

On the module in this<br />

position on the rack:<br />

FFFFF0400100<br />

FFFFF0400101<br />

FFFFF0400102<br />

FFFFF0400103<br />

FFFFF0400104<br />

FFFFF0400105<br />

FFFFF0400106<br />

FFFFF0400107<br />

FFFFF0400108<br />

FFFFF0400109<br />

FFFFF040010A<br />

FFFFF040010B<br />

FFFFF040010C<br />

FFFFF040010D<br />

FFFFF040010E<br />

FFFFF040010F<br />

The most significant byte is at the lowest address. For point 0, for example, you might receive<br />

the following data:<br />

42 SNAP Ethernet-Based I/O Units Protocols <strong>and</strong> Programming Guide<br />

FFFFF0400110<br />

FFFFF0400111<br />

FFFFF0400112<br />

FFFFF0400113<br />

FFFFF0400114<br />

FFFFF0400115<br />

FFFFF0400116<br />

FFFFF0400117<br />

0 1 2 3 4 5<br />

0 1<br />

At this address This binary data Equals this hex data 16 BB 18 87<br />

FFFF F040 0100 0001 0110 16<br />

FFFF F040 0101 1011 1011 BB<br />

FFFF F040 0102 0001 1000 18<br />

FFFF F040 0103 1000 0111 87

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!