infoPLC Net BC AppNote 002 PDF
infoPLC Net BC AppNote 002 PDF
infoPLC Net BC AppNote 002 PDF
BECKHOFF www.beckhoffautomation.com
Beckhoff Automation
12150 Nicollet Avenue South
Burnsville, MN 55337
Overview
Sample Files
Key Concepts
Use Hyperterminal to simulate or monitor the RS232 communication. Use the Beckhoff
Modbus Monitor program or Modscan to analyze the system before attempting special-
ized programming.
Refer often to the KL6001 and BK/BC9000 documents to determine the mapping for the
terminal.
Procedure
Configure and program the BC9000 CPU by installing TwinCAT PLC 2.10 build 1244 or
higher. TwinCAT is available via the Beckhoff website, www.beckhoff.com, free of charge,
for 30 days. Please contact your sales representative for quoting TwinCAT and purchas-
ing a registration number to license TwinCAT PLC beyond the 30 days.
Configure your PC Ethernet port for a dedicated IP address by selecting start, My Net-
work Places, and View Network Connections. Right click on Local Area Connection and
select Properties. Scroll down in the selection box to Internet Protocol (TCP/IP) and
select Properties. Set the parameters to:
IP Address: 172.16.17.1
Select "OK"
Connect 24VDC up to 10A for I/O load power to pins marked + and -.
Connect an Ethernet 10/100BaseT, Cat 5e, crossover cable to the PC Ethernet port and
the BC9000.
The following parameterizations can be carried out without using configuration software
and with the aid of the DIP switches and the end terminal (KL9010). This parameteriza-
tion mode is active only if just one end terminal (KL9010) is inserted. Otherwise, the nor-
mal settings apply.
Switch off the Bus Coupler, and plug in just the end terminal (KL9010).
Set all the DIP switches to ON, and switch the Bus Coupler on again.
Once the default parameters have successfully been set, the Error LED lights, and the I/O
Run and I/O Error Led's flash alternately.
You can then switch the Bus Coupler off, connect the Bus Terminals, and continue as
usual.
Switch off the Bus Coupler, and plug in just the end terminal (KL9010).
Set DIP switches 1 to 9 to ON, DIP switch 10 to OFF, and switch the Bus Coupler on
again.
Once the boot project has been successfully deleted, the I/O Run and I/O Error Led's
flash alternately.
"You can then switch the Bus Coupler off, connect the Bus Terminals, and continue as
usual.
Switch off the Bus Coupler, and plug in just the end terminal (KL9010).
Set all the DIP switches to OFF, and switch the Bus Coupler on again.
To accept the values, set DIP switch 10 to ON. The Bus Coupler indicates that it has
accepted the parameters by flashing the I/O RUN and I/O ERR Led's
You can then switch the Bus Coupler off, connect the Bus Terminals, and continue as
usual.
1. Click on the icon in the lower right Windows menu bar (see below)
2. On the left side of this new window under I/O - Configuration, right click on I/O
Devices and then select Append Device. The following image will appear:
3. In the window, select Ethernet and then select Virtual Ethernet Interface.Note the
name at the bottom of the window. While it can be renamed, it is most often not
changed. Please note as well that the BC9000 is not capable of being used in a
Real-Time Ethernet or EtherCAT (Direct Mode) situation.
4. Click OK
6. Right click on Device 1 (Virtual-Ethernet) and select Scan Boxes (see image below).
7. Once the selection has been made, TwinCAT will go out and search for all the PLC's
on the Ethernet network. In this instance, there is only one (see the image below:
8. Note that the name of the PLC was automatically assigned as BC9000-2
(172.16.17.2). Obviously, the PLC is a BC9000. The -2 at the end identifies the last
portion of the Ethernet Node address as Node 2. This is further confirmed with the
display of the full Node address of 172.16.17.2. Place a check mark in the box for
this PLC and then click OK.
10. Double click on BC9000-2 to see if all the Bus Terminals have been found, identified,
and listed below the BC9000-2 heading.
12. When you click Export Variable Info . . . , a Save As window opens. Find the folder to
save this project information to, then click Save. The image below illustrates this
task. Please note that the name of the PLC (BC9000-2) has already been entered
automatically into the name space. Once saved, the document will have an "exp" file
extension attached.
Note: This "exp" document must be saved with the System Manager file (tsm file exten-
sion) as well as the PLC program file (pr6 file extension) in the same folder. The tsm and
pr6 files must also have the same names.
13. At this point, everything about the hardware for this PLC is known. At the top left cor-
ner of the TwinCAT window, select File and Save As. Find the folder of the previous
step and then type in the name for this project. Click Save and this file will be saved
as a tsm file.
Click on the icon in the lower right Windows menu bar (see below)
SelectPLC Control. When the TwinCAT PLC Control windowopens, there may be a pro-
gram already open from a previous effort. If so, go to the File menu and select New.
14. The Choose Target System Typewindow (shown below) will open.Select BC via
AMS and click OK
15. The New POU window appears to allow for the selection of the name for the new
POU, the type of POU, and the Language of the POU. Generally speaking, the first
POU should be MAIN as there has to be one POU in the program named MAIN and
it must also be a selected as a program. Also, a Language for the POU must be
selected. Here, Ladder Diagram (LD) was selected:
18. When Import... is selected, the Import Project windowappears. Find the project
folder and the BC9000-2.expfile. SelectOpen.
The main window, TwinCAT PLC Control, will appear unchanged. But, in fact, it has.
At the bottom left of the window is a tab labeled R... The R stands for Resources.
Click on this tab, then on the Global Variables folder, and then click on
TwinCAT_Import. What appears in the larger central window are all the variables for
the I/O modules. Those variables at the top of the list are the status and control bits
associated with the respective Bus Terminal I/O modules. Those at the bottom (see
the next image) are the actual I/O points. Also shown are the physical addresses
within TwinCAT.
For the most part, these items at the end of the list are what you will use in the PLC pro-
gram.
19. At the bottom of the main window, TwinCAT PLC Control, select "P..." This "P"
stands for POU. Selecting this will return you to the program screen where you may
begin entering your program in the language you have selected.
20. Before continuing with programming, it would be wise to save everything established
thus far. Under File, click Save As, browse for your project folder, and then name the
program. Again, make sure the name for this file is the same as the TwinCAT Sys-
tem Manager file.
21. In the main window is the main form for starting a Ladder Diagram program. The top
section of the main window on the right is a place for declaring variables. In the mid-
dle is where the program is entered. At the bottom is where the status of the program
is displayed.
To insert a contact, coil, or Function Block, right click in the dotted rectangle, and a
menu will appear (see below). Select Contact and a contact will appear on the rung
with three question marks above it.
With the contact inserted, click on the three question marks, and then enter a new
variable name or press F2. F2 opens the Help Manager window, which has a list of
all the variables associated with the I/O Bus Terminals described before.
There is another way of entering contacts and coils. At the top and center of the main win-
dow is a small bar (see below) for making that selection.
If a new variable name is entered, a new window will appear to aid in the declaration
of the variable name. The Declare Variable window (see below) allows for entry of all
the detailed information required to declare the variable. When entered, click OK and
the variable name and Type will appear in the small window at the top.
22. After the program is entered, select Project and then Rebuild All. This will compile
the logic to be downloaded to the BC9000. If there are any errors, they will be
reported at the bottom of the main window.
At the Menu bar select Online and then Choose Run-Time System...Another window will
open (see below). Double click on BC9000-2, click on Run-Time 1 (Port 800), and then
click OK. At the bottom of the main window will be a red colored bar with the name of the
PLC inside.
At the Menu bar select Online and then Login. TwinCAT will issue prompts saying there
may be no program or a different program in the BC9000. Select OK to all prompts.
At the Menu bar select Online and then Run. If all is well, the PLC program will now be
running. Evidence of this will appear at the bottom of the main window with a green bar
that says RUN.