Direct Logic 205 Triple Port Basic Coprocessor F2-Cp128
Direct Logic 205 Triple Port Basic Coprocessor F2-Cp128
Direct Logic 205 Triple Port Basic Coprocessor F2-Cp128
com™
F2-CP128
COPYRIGHT
Copyright 1994-1999, FACTS Engineering Inc., 8049 Photonics Dr., New Port Richey,
Florida, 34655.. World rights reserved. No part of this publication may be stored in a
retrieval system, transmitted, or reproduced in any way, including but not limited to
photocopy photograph, magnetic or other recording media, without the prior agreement
and written permission of FACTS Engineering, Inc.
Thank you for purchasing automation equipment from FACTS Engineering. We want
your new FACTS Engineering automation equipment to operate safely. Anyone who
installs or uses this equipment should read this publication (and any other relevant
publications) before installing or operating the equipment.
To minimize the risk of potential safety problems, you should follow all applicable local
and national codes that regulate the installation and operation of your equipment.
These codes vary from area to area and usually change with time. It is your
responsibility to determine which codes should be followed, and to verify that the
equipment, installation, and operation is in compliance with the latest revision of these
codes.
At a minimum, you should follow all applicable sections of the National Fire Code,
National Electrical Code, and the codes of the National Electrical Manufacturers
Association (NEMA). There may be local regulatory or government offices that can
help determine which codes and standards are necessary for safe installation and
operation.
Equipment damage or serious injury to personnel can result from the failure to follow all
applicable codes and standards. We do not guarantee the products described in this
publication are suitable for your particular application, nor do we assume any
responsibility for your product design, installation, or operation.
If you have any questions concerning the installation or operation of this equipment, or
if you need additional information, please call us at 1-800-783-3225.
This document is based on information available at the time of its publication. While
efforts have been made to be accurate, the information contained herein does not
purport to cover all details or variations in hardware and software, nor to provide for
every possible contingency in connection with installation, operation, and maintenance.
Features may be described herein which are not present in all hardware and software
systems. FACTS Engineering assumes no obligation of notice to holders of this
document with respect to changes subsequently made. FACTS Engineering retains the
right to make changes to hardware and software at any time, without notice. FACTS
Engineering makes no representation or warranty, expressed, implied, or statutory with
respect to, and assumes no responsibility for the accuracy, completeness, sufficiency,
or usefulness of the information contained herein. No warranties of merchantability of
fitness for purpose shall apply.
TABLE OF CONTENTS
This manual describes details specific to the 205 BASIC CoProcessor. This document
should be used to supplement the FACTS Extended BASIC User's Reference (FA-
BASIC-M) when programming the FACTS Engineering 205 CoProcessor modules.
205 CoProcessor modules are installed in Slot 1 to 7 of a D2-240 or D2-250 CPU base.
Slot 0 (1st IO slot beside CPU) cannot be used. The D2-230 CPU is not supported.
The CoProcessor module communicates to the DL205 PLC CPU using the S205_,
BMOVE, and SHARED instructions. A high speed dual port RAM interface, across the
parallel bus of the DL205 backplane, is used for CoProcessor to PLC and PLC to
CoProcessor communications. Up to 128 bytes can be transferred by the CoProcessor
in one PLC scan using the BMOVE instruction. No PLC ladder logic is required for
CoProcessor to PLC or PLC to CoProcessor communications. The CoProcessor does
not take any X's or Y's from the DL205 PLC CPU's memory map.
The DL205 PLC ladder logic can generate an interrupt in the CoProcessor with the RX
or WX ladder instructions and the ONPLC CoProcessor statement. In addition to the
128 bytes that can be transferred using the BMOVE instruction, 128 bytes can be
transferred using an RX or WX triggered ONPLC interrupt.
The CoProcessor module communicates to external devices using the built in serial
port(s)
1.1
DL205 CPU SYNCHRONIZATION
Upon application of power the 205 CoProcessor resets and establishes communication
with the DL205 PLC CPU. Next the operating mode saved by the last AUTOSTART
command is executed. Please see AUTOSTART in the FACTS Extended BASIC
User's Reference for additional information.
Unlike the 305 I/O BASIC Modules, the CoProcessor does not reset when the DL205
PLC CPU is reset. If desired, the current state of the DL205 PLC CPU may be
determined by examining Special Purpose relays SP11-20. See Chapter 2 (205
CoProcessor Statements) for a description of the S205_ statement. See the DL205
User's Manual for a description of DL205 PLC CPU special relays.
Often a DL205 CPU control relay or stage status is used as a permissive in the BASIC
program. Control relays and stage status bits are used to communicate program status
information to the CoProcessor. For example, a control relay may be used to signal the
start of a shift report or to simply indicate that the DL205 CPU is running.
1.2
CHAPTER 2: 205 COPROCESSOR STATEMENTS
BMOVE
Usage Up to 128 bytes of DL205 memory may be read or written in one scan
using BMOVE. Memory in the DL205 CPU is referenced using any one of
11 different operands specified with an octal address number.
Use either a "R" or "W" for direction to specify a DL205 memory Read or
Write. "R" will read DL205 CPU memory and copy to SHARED memory.
"W" will read SHARED memory and copy to DL205 CPU memory.
2.1
Octal numbering and data types for BMOVE operands
2.2
Example Load a table of 6 constants into user V-Memory starting at V2000
10 REM Load the table into shared memory
20 SHARED(128)=10H
30 SHARED(130)=20H
40 SHARED(132)=25H
50 SHARED(134)=30H
60 SHARED(136)=100H
70 SHARED(138)=9798H
80 REM Copy the table to DL205 CPU V-Memory
90 BMOVE W, VH(2000), K(12)
2.3
SHARED
The SHARED operator retrieves the value at the shared memory address
and assigns it to the variable.
Use "H" to specify the high byte or use "L" to specify the low byte.
2.4
Example Retrieve a 4 digit BCD value from shared memory
10 REM Put a BCD number at V-Memory 2000
20 S205_VB(2000)=1234
30 REM Get it back with a block move
40 BMOVE R, VH(2000), K(2)
50 PRINT1 "BCD value at V-Memory 2000 =",
52 PRINT1 HEX$(SHARED(0))
Example Store 4 digit BCD values in V-Memory 2000 and 2001 using BMOVE
10 SHARED(128) = 1234H : REM Constant for V-Memory 2000
20 A = 5678 : REM A Must be a BCD value from 0 - 9999
30 SHARED(130) = VAL(HEX$(A)) : REM Same as SHARED(130,B)=A
40 BMOVE W, VH(2000), VH(2001)
2.5
Example Using SHARED with PICK statement type modifiers
1000 V=1120H
1010 SHARED(128)=V : PRINT1 "Retrieving values from SHARED"
1020 PH1. "SHARED(128) = ",V," in hexadecimal"
1030 PRINT1 "1st nibble = ",SHARED(128,N(0)), SPC (5),
1040 PRINT1 "3rd nibble = ",SHARED(128,N(2))
1050 PRINT1 "SHARED(128) in binary = "; : FOR BT=15 TO 0 STEP -1
1060 IF SHARED(128,B(BT)) THEN PRINT1 "1"; ELSE PRINT1 "0";
1070 NEXT BT : PRINT1
1080 PH1. SHARED(128),
1090 PRINT1 " or ",V," treated as BCD = ",SHARED(128,B)," decimal"
1100 HB=SHARED(128,H) : REM Swap the bytes
1110 SHARED(128,H)=SHARED(128,L) : SHARED(128,L)=HB
1120 PH1. "Value with bytes swapped = ",SHARED(128)
1130 PRINT1 : PRINT1 "Assigning bits and nibbles in SHARED"
1140 SHARED(128)=0
1150 FOR BT=0 TO 15
1160 SHARED(128,B(BT))=1
1170 IF BT=8 THEN PRINT1
1180 PH1. SHARED(128), SPC (3),
1190 NEXT : PRINT1
1200 SHARED(0)=0
1210 FOR N=0 TO 3
1220 SHARED(0,N(N))=0FH
1230 PH1. SHARED(128), SPC (3),
1240 NEXT : PRINT1
1250 PRINT1 "BCD ASSIGNMENT"
1260 SHARED(128,B)=1120
1270 PH1. SHARED(128)," = 1120"
READY
>run
Retrieving values from SHARED
SHARED(128) = 1120H in hexadecimal
1st nibble = 0 3rd nibble = 1
SHARED(128) in binary = 0001000100100000
1120H or 4384 treated as BCD = 1120 decimal
Value with bytes swapped = 2011H
2.6
ONPLC
ONPLC specifies the beginning line number where program execution will
continue when the interrupt occurs. The interrupt is delayed until the
current BASIC statement is completed (Execution begins immediately if
the current statement is IDLE or DELAY).
The ONPLC statement will enable only a single BASIC program interrupt
to occur. Future ONPLC interrupts are disabled until another ONPLC
statement is executed. Normally another ONPLC statement is included in
the interrupt subroutine.
The DL205 CPU passes data to the ABM and causes an ONPLC interrupt
to occur using a Write Data To Network (WX) instruction. Up to 128
bytes of data may be transferred with one WX instruction. The data is
transferred to the CoProcessor dual port locations SHARED(256) to
SHARED(383). The number of bytes written is stored in SHARED(385).
2.7
Special Purpose (SP) Data Communications Relays
Slot 0 1 2 3 4 5 6 7
BUSY N/A 122 124 126 130 132 134 136
ERROR N/A 123 125 127 131 133 135 137
The high byte of the first load (LD) in the following example, holds the
ABM's base number (0) and the slot number (0-7). The low byte contains
a two digit BCD code from 1 to 90 which gets written to the ABM at
SHARED(384). This value may be used as required in the application
program and does not effect the execution of the WX instruction. The
value loaded will be in the second stack register when the WX instruction
executes.
The first stack register holds the BCD number of bytes to write to the
ABM. This is specified by the second LD in the following example. The
byte count gets stored in the ABM at SHARED(385).
The accumulator holds the octal V-Memory source address of the data in
the DL205. This is specified by the LDA instruction in the following
example. Up to 128 bytes or 64 consecutive V-Memory locations may be
moved to the ABM with one WX instruction. The data is stored in the
ABM beginning at SHARED(256).
LD K0310 directs the WX to the ABM in CPU base (base 0) of slot 3 and
stores the value 10 in SHARED(384). LD K128 specifies that 128 bytes
will be written. LDA O2000 specifies the source V-Memory address.
Data will be moved from V-Memory 2000-2077 to SHARED(256) -
SHARED(383). The WX V5 instruction sets the BUSY relay SP126,
resets the ERROR relay SP127, writes the data, and stores 5 in
SHARED(386).
2.8
10 ONPLC 100
20 GOTO 10 : REM Do nothing while we wait for the interrupt
100 REM
110 REM Start of PLC interrupt service routine - PRINT the data
120 REM
130 PRINT "Data identification codes ",
140 PRINT SHARED(384,L),SPC(2),SHARED(386)-1
150 FOR K = 0 TO SHARED(385,L)-1 STEP 2
160 PRINT "Dual Port Word ",K/2+1," = ",SHARED(256+K)
170 NEXT K
180 RETI
2.9
S205_
Shorthand S.
Usage DL205 memory may be accessed directly each scan using any one of 12
different operands specified with an octal address number.
The S205_ statement moves the value of expression into the DL205
memory address specified by operand(number). If the memory address is
written to by the DL205 CPU program, the S205_ statement will be
overridden.
The S205_ operator copies the value from the DL205 memory address
specified by operand(number) into a numeric variable.
The table below specifies the octal numbering and data types for each of
the S205_ operands (typical VB and VH operand usage is shown).
2.10
Octal numbering and data types for S205_ operands
2.11
Example Using DL205 bit data type operands:
10 REM Display status on Input X4
20 IF S205_X(4) THEN PRINT1 "ON" ELSE PRINT1 "OFF"
2.12
Advanced The V-Memory numbering for each operand is shown in the previous
table. The VH and VB operands may be used to access any portion of
V-Memory.
2.13
2.14
CHAPTER 3: F2-CP128 Triple Port OverDrive CoProcessor
3.1
F2-CP128 DESCRIPTION
128K bytes of nonvolatile memory allows multiple program storage and execution,
DL205 register expansion, and retentive data storage and retrieval.
The real-time battery-backed calendar clock maintains time and date when power
outages occur. Time based BASIC interrupts can be programmed to .010 of a second.
The FACTS Extended BASIC interpreter has many features and statements that
simplify control oriented programming.
Extensive serial port control (SETPORT, SETINPUT, PRINT, INPUT, INPLEN, INLEN)
3.2
F2-CP128 JUMPER DESCRIPTIONS AND LOCATIONS
3.3
PORT 2
The communication interface type for port 2 is selected by placing a jumper on one of
the port 2 options, either RS422/485 or RS232. The RS232 selection is the default
factory setting.
PORT 1
The communication interface type for port 1 is selected by placing a jumper on one of
the port 1 options, either RS422/485 or RS232. The RS232 selection is the default
factory setting.
CLR ALL
The CLR ALL jumper specifies the AUTOSTART mode that the module will use at
reset. Placing the jumper on both posts disables AUTOSTART and waits for a space
bar character in port 1. Placing the jumper on one post allows the module to use the
last stored AUTOSTART parameters (this is the default factory setting).
CAUTION: Installing the CLR ALL jumper will erase program 0, all stored variables,
cancel a COMMAND@2, remove LOCKOUT, and clear stored
AUTOSTART information.
3.4
F2-CP128 PORT PINOUTS
3.5
3.6
APPENDIX A: QUICK START
3. Connect the cable from the computer to the 205 CoProcessor module.. See
APPENDIX C for wiring diagrams.
5. Select 'COMMAND MODE Connect to BASIC Module' from the main window.
Select 'SYstem_Stats' from the COMMAND MODE menu. The 'SYstem_Stats'
button will send a SPACE BAR character so the BASIC CoProcessor can
correctly calculate the baud rate.
READY
> (">" character indicates BASIC is in COMMAND mode)
If you do not receive the sign on message, please follow the trouble shooting
procedure in APPENDIX B.
4.1
EDITING A PROGRAM
User Action Display Window
>
PRM 0
READY
>
4.2
SAVING A PROGRAM
User Action Display Window
>
Enter the following on the 'Command Line' field: >10 p. "MY FIRST PROGRAM"
10 P."MY FIRST PROGRAM" <ENTER> >
PRM 0
READY
>
Enter the following on the 'Command Line' field: >10 p. "MY SECOND PROGRAM"
10 P."MY SECOND PROGRAM" <ENTER> >
Saving program 3
PRM 0
READY
>
4.3
AUTO RUN MODE
User Action Display Window
Select 'Auto' from the menu bar. Select Mode 1, AUTOSTART 1,2
Program 2, and Click 'OK'. This specifies that the
BASIC CoProcessor will run program 2 after a Mode = 1, RUN (CLEAR)
reset. Program = 2
Port 1 Baud = 9600 Programming
(Port 2 = 9600)
(Port 3 = 9600)
>
Select 'List' from the menu bar. Confirm that the list
program in the edit buffer (PRM0) is still present. 10 PRINT1 "MY SECOND PROGRAM"
PRM 0
READY
>
DELETING A PROGRAM
User Action Display Window
Enter '2' then click 'OK'. Click 'Yes' on the 2 stored programs, 64309 program storage bytes
confirmation dialog. free
>
4.4
CANCEL AUTO RUN MODE
User Action Display Window
Select 'Auto' from the menu bar. Select Mode 0, AUTOSTART 0,0
Program 0, and Click 'OK'. This specifies that the
BASIC CoProcessor will start up in edit mode Mode = 0, Edit
after a reset. Program = 0
Port 1 Baud = 9600 Programming
(Port 2 = 9600)
(Port 3 = 9600)
>
4.5
4.6
APPENDIX B: TROUBLE SHOOTING
1. If the Port 1 RXD LED flashes when data is entered on the terminal then go to
step 2. If the LED does not flash then use a RS-232 break-out box to determine
if the problem is in the cable or the computer.
2. Power off the base, remove the module, and place the "CLR ALL" jumper on
both posts.
CAUTION: Installing the CLR ALL jumper will erase program 0, all stored data,
cancel a COMMAND@2, remove LOCKOUT, and clear stored
AUTOSTART information.
5. Connect the cable from the computer to the 205 CoProcessor module. See
APPENDIX C for wiring diagrams.
7 Select 'COMMAND MODE Connect to BASIC Module' from the main window.
Select 'SYstem_Stats' from the COMMAND MODE menu. The 'SYstem_Stats'
button will send a SPACE BAR character so the BASIC CoProcessor can
correctly calculate the baud rate.
READY
> (">" character indicates BASIC is in COMMAND mode)
>AUTOSTART 0,0
10. Power off the base and remove the module. Place the "CLR ALL" jumper on a
single post.
5.1
11. Install the module and power up the base. The module will now respond with the
sign on message.
READY
> (">" prompt character indicates BASIC is in COMMAND mode)
5.2
APPENDIX C: RS232 AND 422/485 WIRING DIAGRAMS
RS-232 STANDARD
RS-232 signals travel over a serial interface cable that may have up to 25 wires. Since
most signals are not required for simple communication, cables have as few as 2 or 3
wires. As shown in the following cabling diagrams, jumpers often are installed at one or
both of the connectors to ensure that flow control signals are satisfied.
The signals flow between two types of interface ports, data communication equipment
(DCE) and data terminal equipment (DTE). The pin names are the same for both DCE
and DTE equipment, however, the direction of signal flow is reversed.
DCE DTE
6 DSR Data Set Ready Output Input DCE has data to XMIT
20 DTR Data Terminal Ready Input Output DCE may XMIT data
6.1
IBM COMPUTER CABLES
6.2
IDENTIFYING A COMMUNICATION PORT AS DCE OR DTE
With an unknown RS-232 port powered, measure the dc voltage between pin-2 and
ground (pin-7) and pin-3 and ground. If the most negative pin is pin-2 then the port is
DTE. If the most negative pin is pin-3 then the port is DCE. Improper connection of
pins 2 and 3 will not damage the interface.
6.3
RS-422/485 STANDARD
RS-422 uses high current differential outputs and is specified to 4000 feet at 10
Megabaud. Lower speed communications, such as 19.2K baud, may use substantially
longer cables.
RS-485 is an upgraded version of EIA RS-422-A and offers higher current tri-state
drivers which are internally protected from bus contentions caused by multiple drivers
on the same line. RS-485 drivers will also withstand higher voltages on their outputs
when disabled (high impedance state). RS-485 is specified for multiple transmitter and
multiple receiver systems as well as single and multi-drop RS-422 applications. The
RS-422 specification permits only one driver and 10 receivers on a line. The RS-485
standard allows up to 32 drivers and receivers on the same transmission line.
RS-422/485 COMMUNICATION
Most CoProcessors have one RS-422/485 communication interface some have two. To
select a port for RS232 or RS422/485 data reception mode, please refer to "JUMPER
DESCRIPTIONS AND LOCATIONS" in the chapter for the CoProcessor module that
you are using. Transmissions from a selectable port are always available at RS-232
and RS-422/485 signal levels simultaneously.
6.4
RS-422/485 MULTI-DROP MADE EASY
Four wire RS-422 multiple transmitter multi-drop networks and all 2 wire RS-485
connections require that the transmitters float when not in use.
To enable the RS-422/485 transmitters only when PRINTing, use SETPORT to select
multi-drop mode "M". Use the multi-drop option when the CoProcessor is a slave in a
master/slave configuration or when a peer to peer configuration is required.
To leave the RS-422/485 transmitters ON even when not PRINTing, use SETPORT to
select point to point mode "P". Use the point to point option when the CoProcessor is a
single master in a master/slave or point to point configuration. This configuration
provides the greatest noise immunity because the RS-422/485 drivers remain enabled
and prevent noise from being received by the slave devices on the network.
Example: Configure Port 1 for 9600 baud, no parity, 8 bit word, 1 stop bit, software
XON/XOFF handshaking, and multi-drop RS-422/485 mode.
SETPORT 1, 9600, N, 8, 1, S, M
6.5
RS-485 TWO WIRE MULTI-DROP
6.6
RS-422 FOUR WIRE MULTI-DROP
6.7
Cable Shielding
A dual twisted pair plus ground connection is recommended for 4-wire RS-422
networks. Proper termination of the balanced transmission line is required to prevent
data errors. A typical AWG 22 solid wire with .060 inch plastic cover, twisted 4.5 times
per foot has a characteristic impedance of about 120 S. Thus the selection of the two
62 S line-to-ground terminating resistors. Line-to-ground termination is preferred to the
often shown line-to-line 120 S termination. In noisy or long line applications the much
better line-to-ground common-mode rejection capability is particularly important. In
multidrop networks, the line must be terminated at the extreme ends only as shown in
the two previous diagrams. Addition of intermediate terminations will adversely load
the line. If both the transmit and receive ends of the same twisted pair are terminated,
double the value of the termination resistors.
The RS-422/485 drivers at the host should remain enabled to prevent noise from being
received by the slave devices on the network. To prevent noise reception at the host
when there is no slave transmitting, add a pair of network biasing resistors to the host
as shown in the two previous diagrams. This will pull-up the floating transmit line from
the slaves to the RS-422/485 idle state (RXD+ to RXD- > .45 V). The equivalent of this
can be done in a CoProcessor using the "P" parameter in the SETPORT statement.
6.8