0 programming, 1 register organization – Rockwell Automation 61C613 16 Channel Analog Input Module User Manual

Page 17

Advertising
background image

4Ć1

4.0 PROGRAMMING

This section describes how the data is organized in the module and

provides examples of how the module is accessed by the application

software. For more detailed information refer to the AutoMate 30/40

Software Instruction Manual (JĆ3150) or the DCS 5000 BASIC

Language Instruction Manual (JĆ3630).
The input module can operate in one of two modes: onĆcommand

and continuous. When operating in the onĆcommand mode, the

module will execute commands from the application software as they

are received. This mode is used to send configuration and control

information to the module. It may also be used to request data from a

particular channel. Data read in this mode will always be current.
When the module is operating in the continuous mode, the data in all

of the analog input channels that have been configured, as well as

the coldĆjunction compensation value, are converted continuously

and stored in memory on the input module. Application software may

then request the latest reading. Data read in this mode may be as old

as the sum of the conversion times for all of the channels.

4.1

Register Organization

The input module contains a total of four 8Ćbit bytes that can be

accessed by application software. These locations begin at a base

address (M) that is selected by rocker switch S1 (refer to table 3.1 or

3.2). The locations are sequential and are identified as (M+0), (M+1),

(M+2), and (M+3). See table 4.1 for a description of all four

locations.
Every command to the input module involves writing to (M+0),

(M+1), and (M+2) in succession. Conversly, each response from the

input module involves reading from (M+0), (M+1), and (M+2) in

succession.

WARNING

YOU SHOULD ORGANIZE YOUR APPLICATION SOFTWARE SO THAT ONLY ONE

TASK COMMUNICATES WITH THIS MODULE. IF YOU DO NOT DO SO, THE DATA

EXCHANGED IN THESE FOUR REGISTERS MAY NOT ALWAYS BE CORRECT AND

UNINTENDED OPERATION OF THE CARD MAY RESULT. FAILURE TO OBSERVE

THIS PRECAUTION COULD RESULT IN BODILY INJURY.

Location (M+3) is a readĆonly location that is used by the application

software to signal when the module has completed a command.

Whenever data is written to location (M+2) by application software,

(M+3) location will be set to zero. When the input module has

completed the command and written the response back to location

(M+2), (M+3) will be set to one.
On completion of every command, the module returns a status/error

code in location (M+0). A value of zero indicates no errors, while a

nonĆzero value indicates an error. You must check this status byte

after the completion of every command since this is the only way in

which you can detect a RESETthat may have occurred on the

module. Refer to Appendix E for a list of possible error codes. Note

that, after powerĆup or board reset, the module returns a code 13".

Advertising