CH Tech EM405D user manual Write Data command, Read Data command

Page 25

4.3.2 Write Data command

The Write Data command writes data to an EM405D control register or to a register residing on an M-module. The command consists of seven bytes including the command-id, the module to which the data should be written, an address space selector, the access width, the address, and two data bytes. The return value consists of a single status byte.

Command Syntax:

0x20 md as ws ad dh dl

Return:

SC

where

md = module (0 = EM405D control, 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 = address (0 to FF)

dh = data (MSB) dl = data (LSB) SC = Status Code

Example (values shown hex):

To write the data value 0x1234 to M-module A, send the following command:

Command:

cd

md

as

ws

ad

dh

dl

Send:

20

01

00

02

06

12

34

Receive: 00 (if successful)

4.3.3 Read Data command

The Read Data command reads data from an EM405D control/status register or from a register residing on an M-module. The command consists of five bytes including the command-id, the module from which the data should be read, as address space selector, the access width and the address from which to read. The return value consists of two data bytes followed by a single status byte.

Command Syntax:

0x30 md as ws ad

Return:

dh dl SC

where

md = module (0 = EM405D control, 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 = address (0 to FF)

dh = data (MSB) dl = data (LSB) SC = Status Code

19

Image 25
Contents H E R N E T Copyright 2004 by C&H Technologies, Inc CopyrightDocument Revision Notice Introduction Installation Table of Contents General DescriptionFunctional Description Operating InstructionsList of Tables EM405D Ethernet M-Module CarrierKey Features Features and SpecificationsPurpose of Equipment Maximum Ratings SpecificationsMechanical ElectricalEnvironmental Bus ComplianceApplicable Documents Handling Precautions Installation Unpacking and InspectionInstallation of M-MODULES MA Configuration Diagram Ethernet Interface Functional Description GeneralModule 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 Error Handling Table I. Command SummaryCommunicating with the Carrier and M-MODULES Table II. Status Code SCPage Read Data command Write Data commandStarting address + block size * word size Block AccessNumber of bytes = number of blocks * block size * word size 0x50 md as ws ad ai nh nl bs Table III. Register Summary 5 EM405D Configuration/Status RegistersDevice Identification Reset Error & Manufacturer IdentificationHardware Version Firmware VersionFan Control & Temperature Status Reset & Trigger ControlFollowing values would be invalid Controlling the TriggersFAN and Temperature Control Page Figure A-1 -Pin Dsub Connector Page Table B-1. Ethernet Interface Default Settings Appendix B Wired Ethernet Default SettingsOn Passive Connection True CPU Performance High Page Wireless LAN Settings Table C-1. Wireless Ethernet Configuration Default SettingsCurrent Port Profile TCP Sockets Gpio Page T E S Page Comments Readers Comment FormInstructions