Introduction

Add to My manuals
704 Pages

advertisement

Introduction | Manualzz

Chapter 17 ASCII Serial Port Instructions (ABL, ACB, ACL, AHL, ARD, ARL, AWA, AWT)

ASCII Test For Buffer Line

(ABL)

Operands:

The ABL instruction counts the characters in the buffer up to and including the first termination character.

Relay Ladder

ABL

ASCII Test For Buffer Line

?

Channel

SerialPort Control

Character Count ?

EN

DN

?

ER

Operand

Channel

Serial Port

Control

Character

Count

Type

DINT

Format

immediate

Description

0

SERIAL_PORT_

CONTROL

DINT tag tag tag that controls the operation immediate 0

ABL(Channel

SerialPortControl);

.RN

.EM

.ER

.FD

.POS

Mnemonic

.EN

.EU

.DN

.ERROR

Data Type

BOOL

BOOL

BOOL

BOOL

BOOL

BOOL

BOOL

DINT

DINT

During execution, displays the number of characters in the buffer, including the first set of termination characters.

Structured Text

The operands are the same as those for the relay ladder ABL instruction. You access the Character Count value via the .POS member of the

SERIAL_PORT_CONTROL structure.

SERIAL_PORT_CONTROL Structure

Description

The enable bit indicates that the instruction is enabled.

The queue bit indicates that the instruction entered the ASCII queue.

The done bit indicates when the instruction is done, but it is asynchronous to the logic scan.

The run bit indicates that the instruction is executing.

The empty bit indicates that the instruction is done, but it is synchronous to the logic scan.

The error bit indicates when the instruction fails (errors).

The found bit indicates that the instruction found the termination character or characters.

The position determines the number of characters in the buffer, up to and including the first set of termination characters. The instruction only returns this number after it finds the termination character or characters.

The error contains a hexadecimal value that identifies the cause of an error.

570

Publication 1756-RM003K-EN-P - July 2008

Artisan Technology Group - Quality Instrumentation ... Guaranteed | (888) 88-SOURCE | www.artisantg.com

ASCII Serial Port Instructions (ABL, ACB, ACL, AHL, ARD, ARL, AWA, AWT) Chapter 17

Description

The ABL instruction searches the buffer for the first set of termination characters. If the instruction finds the termination characters, it:

• sets the .FD bit

• counts the characters in the buffer up to and including the first set of termination characters

The Controller Properties dialog box, User Protocol tab, defines the ASCII characters that the instruction considers as the termination characters.

To program the ABL instruction, follow these guidelines:

1.

Configure the serial port of the controller for user mode and define the characters that serve as the termination characters.

2.

This is a transitional instruction:

In relay ladder, toggle the rung-condition-in from cleared to set each time the instruction should execute.

In structured text, condition the instruction so that it only executes on a transition.

Arithmetic Status Flags:

not affected

Fault Conditions:

none

Execution:

Condition

prescan rung-condition-in is false rung-condition-in is true

EnableIn is set instruction execution postscan

Relay Ladder Action

The rung-condition-out is set to false.

The rung-condition-out is set to false.

The instruction executes when rung-condition-in toggles from cleared to set.

The rung-condition-out is set to true.

na

Structured Text Action

No action taken.

na na

EnableIn is always set.

The instruction executes.

The instruction counts the characters in the buffer.

The .EN bit is set.

The remaining status bits, except .UL, are cleared.

The instruction attempts to enter the ASCII queue.

The rung-condition-out is set to false.

No action taken.

Publication 1756-RM003K-EN-P - July 2008

Artisan Technology Group - Quality Instrumentation ... Guaranteed | (888) 88-SOURCE | www.artisantg.com

571

Chapter 17 ASCII Serial Port Instructions (ABL, ACB, ACL, AHL, ARD, ARL, AWA, AWT)

MV_line.EN

/

Example:

Continuously test the buffer for the termination characters.

Relay Ladder

ABL

ASCII Test For Buffer Line

Channel

SerialPort Control

0

MV_line

Character Count 0

EN

DN

ER

Structured Text

ABL(0,MV_line);

572

Publication 1756-RM003K-EN-P - July 2008

Artisan Technology Group - Quality Instrumentation ... Guaranteed | (888) 88-SOURCE | www.artisantg.com

advertisement

Related manuals

advertisement

Table of contents