Code examples for polled and interrupt messaging, Receive examples, Table 3.f receive message example memory map – Rockwell Automation D17846.2.4 CONTROLNET KT EMULA User Manual

Page 28: Receive examples -8

Advertising
background image

Publication 1784-6.2.4 - September 1997

3-8

How Your Driver Operates the KTCX Card

Polled
In the standard KTCX polling procedure the card can transmit around
50 messages per second. To have a faster transmission rate, the host to
KTCX interrupt word located at offset 3FFCh should be written to
after the send flags have been set. This should be done on a per
message basis.

Interrupt
The KTCX interrupt word is at offset 3FFCh in the dual-port. When
the host is interrupted, offset 3FFCh (assuming the dual-port address
is 0D000h) must be read in order for the interrupt to be cleared. This
offset is the second to last word in the dual-port. Refer to Appendix A
for example code for setting the card to interrupt.

Interrupts for Multi-Tasking Operations
You may prefer the interrupt method in multi-tasking operations to
avoid the overhead involved in polling each card. In multi-tasking
systems that have a priority arbitrator, the primary task can be the poll
routine or the interrupt manager. Once the KTCX places data into the
receive mailbox, it waits until the host removes it before proceeding.

Important: The 1784-KTCX card cannot share interrupts.

Code Examples for Polled and Interrupt Messaging

See Appendix A for example code for both the polled and interrupt
messaging processes.

Receive Examples

Refer to the following examples as you develop the receive packet
portion of your driver.

Receive Packet Example #1: Memory Map of Message.
Table 3.D shows what addresses:0482h through:07EFh would
contain during a typical message.

Table 3.F Receive Message Example Memory Map

Byte

Description

Contents = Meaning

:0482h

Length

0Bh (low byte)

:0483h

Length

00h (high byte)

:0484h

SRC

(address of packet)

:0485h

LSAP(type
designation)

00h = on-link packet
off-link N/A

:0486h

CMD

(PCCC CMD, if any)

:0487h

STS

(error status of received packet

:0488h

TNS

(low byte)

:0489h

TNS

(high byte)

:048Ah:0
7EFh

DATA

Data from sender, if any

Advertising