CDS-3310
Chapter
7 Application Programming
i
43
EN End
program
Operator Data Entry Mode
The Operator Data Entry Mode provides for un-buffered data entry through the RS-232 port. This
mode is entered and exited by the CI command.
NOTE:
Operator Data Entry Mode cannot be used for high rate data transfer.
To capture and decode characters in the Operator Data Mode, the controller provides the following
keywords:
Keyword Function
P1CH
Contains the last character received
P1ST
Contains the received string
P1NM
Contains the received number
P1CD
Contains the status code:
-1 mode disabled
0 nothing received
1 received character, but not <enter>
2 received string, not a number
3 received number
NOTE:
The value of P1CD returns to zero after the corresponding string or number is read.
These keywords may be used in an applications program to decode data and they may also be used in
conditional statements with logical operators.
Example
Instruction Interpretation
JP #LOOP,P1CD< >3
Checks to see if status code is 3 (number received)
JP #P,P1CH="V"
Checks if last character received was a V
PR P1NM
Assigns received number to position
JS #XAXIS,P1ST="X"
Checks to see if received string is X
Communication Interrupt
The controller provides a special interrupt for communication allowing the application program to be
interrupted by input from the user. The interrupt is enabled using the CI command. The syntax for the
command is CI n,m:
n = 0
Don't interrupt Port 1
n = 1
Interrupt on <enter> Port 1
n = 2
Interrupt on any character Port 1
n = -1
Clear any characters in buffer
m = 0
Disable entry mode
m = 1
Enable entry mode
The #COMINT label is used for the communication interrupt. For example, the controller can be
configured to interrupt on any character received on Port 1. The #COMINT subroutine is entered
when a character is received and the subroutine can decode the characters. At the end of the routine
the EN command is used. EN,1 will re-enable the interrupt and return to the line of the program where
the interrupt was called, EN will just return to the line of the program where it was called without re-
Summary of Contents for CDS-3310
Page 26: ...18 i Chapter 2 Getting Started CDS 3310 THIS PAGE LEFT PLANK INTENTIONALLY...
Page 32: ...24 i Chapter 3 Connecting I O CDS 3310 THIS PAGE LEFT PLANK INTENTIONALLY...
Page 124: ...CDS 3310 Chapter 8 Hardware Software Protection i 63 THIS PAGE LEFT PLANK INTENTIONALLY...
Page 138: ...CDS 3310 Chapter 10 Theory of Operation i 77 THIS PAGE LEFT BLANK INTENTIONALLY...