beautypg.com

6 - discrete i/o, Chapter objectives, Direct image table access – Rockwell Automation 6008-SI IBM PC I/O SCNNR 6008-SI User Manual

Page 56: Discrete i/o

background image

Chapter

6

6-1

Discrete I/O

This chapter explains how to use the functions contained in the host
software library to do discrete I/O. After reading this chapter, you should
be able to:

examine any discrete inputs

set or clear any discrete outputs

examine any outputs that you set or cleared previously.

You should be able to do all three of these either directly, by subscripting
into the I/O image tables, or indirectly, by using the supplied library
routines.

The output and input image tables are two unsigned integer arrays of 64
words each, named g_oit and g_ipt respectively. You can directly read
either table using C language assignment statements, and you can directly
write to the output image table in the same way. (You can write to the
input image table to use unused input areas for storage. We do this
frequently in programmable controllers. However, with all the memory
available to you for storage in user RAM, we do not recommend using the
input image area for storage.)

The techniques, discussed in this section for accessing discrete I/O, execute
the quickest , but may be a little hard to understand. The techniques
discussed later in this chapter (see ”Library Routines”), sacrifice some
execution speed to gain some clarity. You’ll need to decide which
techniques are best for your application.

WARNING: Whichever technique you use to set outputs, make
sure that you don’t write to the output image table bytes that
correspond to intelligent I/O (block transfer) modules. If you do
write to these bytes, you’ll be unintentionally requesting a block
transfer. For more details, please see chapter 8, ”Unsolicited
Block Transfer”.

Chapter Objectives

Direct Image

Table Access