Rockwell Automation 1771-DB BASIC MODULE User Manual

Page 213

Advertising
background image

Chapter
Call Routines 0–68

12

12 -23

Important: This call requires the BASIC module jumper JW5 to be in 16
point mode (page 1 -7).

Use CALL 33 to transfer data from the BASIC module ASCII ports
directly to the BTR buffer and/or an internal string within the BASIC
module.

This call is useful for reading bar code data and sending it to the PLC
processor or an internal string. Once you set up and enable this operation,
it is performed transparently in the background while the BASIC module
executes a BASIC program in the foreground.

During data transfer, data is automatically transferred in 8-bit blocks from
the receive buffer of the port you selected to the BTR buffer locations
and/or BASIC internal string you selected for storage. The transfer occurs
when the BASIC module detects the number of characters you specified in
the receive buffer of the port or receives the user-defined delimiter in the
port. You can store the data either low byte first, then high byte, or high
byte first, then low byte within the 16-bit word of the destination. Data is
transferred on word boundaries. If you transfer an odd number of bytes,
the unused byte contains a zero.

The byte swap selection (low byte first, then high byte, or high byte first,
then low byte) of the last CALL 33 or CALL 34 you executed determines
the data packing method for all the ports that CALL 33 enables.

The low byte of BTR word 1 contains the character count (byte count) of
the data you transferred. If a delimiter is found, the byte count is expanded
to include the first occurrence of the delimiter. BTR word 2 contains the
first two characters of data.

If you choose an internal string, the first character of the string contains the
byte count. The second character of the internal string is a transaction
number and increments to inform the BASIC module that new data is in
the string. The value of this character wraps around from 255 to 0.
The third character of the string contains the first data character.

Execute CALL 33 to set up the data transfer parameters. After you
execute the call, the BASIC module gets data from the port and transfers it
to the destination.

CALL 33: Transfer Data from
PRT1 or PRT2 to the
BTR Buffer

Tip

Advertising