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
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 />
Float calculation: (-1) Sign x [1 + Signific<strong>and</strong>/2 23 ] x 2 (Exponent-127)<br />
Example for Opto 22 memory map<br />
At this address: base address base address + 1 base address + 2 base address + 3<br />
This hex data: 41 77 33 33<br />
In binary: 0 100 0001 0 111 0111 0011 0011 0011 0011<br />
In these bits: 31 30 . . . 23 22 . . . 0<br />
Equals (in decimal): 0 130 7,811,891<br />
Representing: Sign Exponent Signific<strong>and</strong><br />
Decimal = (-1) 0 x [1 + 7,811,891/2 23 ] x 2 (130-127)<br />
= 1 x [1.931] x 8<br />
= 15.45 (rounded to 2 decimal places)<br />
Two-Channel Analog Modules<br />
Remember that the memory map is set up for four points per module. If the SNAP analog modules<br />
you are using have only two channels, the addresses for the upper two points in each module<br />
will not contain data.<br />
For example, to read all bank analog point values in scaled <strong>units</strong>, you would read 256 bytes<br />
starting at address FFFFF0600000. Here’s how data for two-channel modules in positions 0<br />
<strong>and</strong> 1 would appear:<br />
Beginning Address Ending Address Module Point Data Format<br />
FFFF F060 0000 FFFF F060 0003<br />
0 four bytes—IEEE float<br />
FFFF F060 0004<br />
FFFF F060 0008<br />
FFFF F060 0007<br />
FFFF F060 000B<br />
0<br />
1<br />
2<br />
four bytes—IEEE float<br />
(no data)<br />
FFFF F060 000C FFFF F060 000F 3 (no data)<br />
FFFF F060 0010 FFFF F060 0013<br />
4 four bytes—IEEE float<br />
FFFF F060 0014<br />
FFFF F060 0018<br />
FFFF F060 0017<br />
FFFF F060 001B<br />
1<br />
5<br />
6<br />
four bytes—IEEE float<br />
(no data)<br />
FFFF F060 001C FFFF F060 001F 7 (no data)<br />
44 SNAP Ethernet-Based I/O Units Protocols <strong>and</strong> Programming Guide