CH Tech EM405D user manual 0x50 md as ws ad ai nh nl bs

Page 28

4.3.4.2Block Read command

The Block Read command reads a block of data from an M-module. Unlike the block write command, block read does not have a restriction on the number of bytes that can be read with a single command. The number of bytes read in any given command is equal to:

number of bytes = number of blocks * block size * word size

The block read command consists of nine command bytes. The return value is any number of data bytes followed by a single status byte indicating the success of the command.

Command Syntax:

0x50 md as ws ad ai nh nl bs

Return:

d1 d0 ... SC

where

md = module (0 = invalid, 1 = M-module A, 2 = M-module B) as = address space (0 = I/O, 1 = future use)

ws = word size (2 = 16-bit word, other values for future use) ad = starting address (0 to FF)

ai = address increment (number to increment address by after each write) nh = number of blocks to read (upper 4 bits)

nl = number of blocks to read (lower 8 bits)

bs = block size in words (i.e., number of words per block)

d1 = data (MSB)

d0 = data (LSB)

= the number of data bytes = ws × bs × number of blocks (nh:nl) SC = Status Code

Example (values shown hex):

To read three data values from a 32-bit FIFO located at I/O Register 6 and 8 on M-module B, send the following command:

Command:

cd

md

as

ws

ad

ai

nh

nl

bs

Send:

50

02

00

02

06

00

00

03

02

Receive:

da1 db1 dc1

dd1 da2 db2 dc2

dd2 da3 db3 dc3 dd3 00 (if successful)

where

dax = MSB of register 6 dbx = LSB of register 6 dcx = MSB of register 8 ddx = LSB of register 8

Note: x = 1 is first read, x = 2 is second read, x = 3 is third read

22

Image 28
Contents H E R N E T Copyright Copyright 2004 by C&H Technologies, IncDocument Revision Notice Introduction Table of Contents General Description InstallationFunctional Description Operating InstructionsEM405D Ethernet M-Module Carrier List of TablesKey Features Features and SpecificationsPurpose of Equipment Specifications Maximum RatingsElectrical MechanicalEnvironmental Bus ComplianceApplicable Documents Handling Precautions Installation Unpacking and InspectionInstallation of M-MODULES MA Configuration Diagram Functional Description General Ethernet InterfaceModule Interface Power ConversionRear Panel Front Panel Front PanelPage Operating Instructions General Configuring the Ethernet InterfaceIP Address Default gateway address is Port Numbers Default subnet mask is GatewayRecommendation Default setting is Auto-Scan Telnet x.x.x.x Performing the Configuration Wireless Ethernet Wi-Fi Page Table I. Command Summary Error HandlingCommunicating with the Carrier and M-MODULES Table II. Status Code SCPage Write Data command Read Data commandBlock Access Starting address + block size * word sizeNumber of bytes = number of blocks * block size * word size 0x50 md as ws ad ai nh nl bs 5 EM405D Configuration/Status Registers Table III. Register SummaryReset Error & Manufacturer Identification Device IdentificationHardware Version Firmware VersionReset & Trigger Control Fan Control & Temperature StatusControlling the Triggers Following values would be invalidFAN and Temperature Control Page Figure A-1 -Pin Dsub Connector Page Appendix B Wired Ethernet Default Settings Table B-1. Ethernet Interface Default SettingsOn Passive Connection True CPU Performance High Page Table C-1. Wireless Ethernet Configuration Default Settings Wireless LAN SettingsCurrent Port Profile TCP Sockets Gpio Page T E S Page Readers Comment Form CommentsInstructions