Sie sind auf Seite 1von 41

CX9000 – Comms & Hardware Setup

Beckhoff TwinCAT 1
Training Hardware - 1

Power LED `s
and Power For
Ethernet Port
CPU and
Battery Terminals.
Compartment
and DIP
switches
Ethernet Port

Beckhoff TwinCAT 2
Training Hardware - 1

Beckhoff TwinCAT 3
Training Hardware - 1

no TwinCAT- TwinCAT-
Ordering information E-Bus K-Bus DVI, 2 x USB
TwinCAT PLC-Runtime NC-Runtime

CX9010-0000 x - - x - -

CX9010-0001 x - - - x -

CX9010-0002 x - - - x x

CX9010-0100 x - x x - -

CX9010-0101 x - x - x -

CX9010-0102 x - x - x x

CX9010-1000 - x - x - -

CX9010-1001 - x - - x -

CX9010-1002 - x - - x x

CX9010-1100 - x x x - -

CX9010-1101 - x x - x -

CX9010-1102 - x x - x x

Beckhoff TwinCAT 4
Setting up CX9000

Open an empty system manager file.

Beckhoff TwinCAT 5
Setting up CX9000

When you have


Choose a target system
opened the system
manager. Click on
the System
configuration and
then click on the
Choose target
button. Which you
can find on the right
hand side.

Then click on the


Search (Ethernet)…
button.

Beckhoff TwinCAT 6
Setting up CX9000

Click the broadcast Add Route dialog


search button.

Beckhoff TwinCAT 7
Setting up CX9000

At default the Add Route Dialog


CX9000 is
addressed via
DHCP therefore
under the address
info make sure the
Host name is
selected and not the
IP Address. If you
cannot find the CX
this way make sure
that your network
settings are DHCP
as well and that a
cross over Ethernet
cable is used.

Beckhoff TwinCAT 8
Setting up CX9000

Click on the desired Add Route Dialog


CX and click Add
route. AS you can
see the CX`s name
is CX_01DA18. If
you look at the CX`s
MAC ID the last 6
digits are the last six
digits of the CX.
Therefore the last
six digits of this
CX`s Mac ID is 01-
DA-18.

Beckhoff TwinCAT 9
Setting up CX9000

Default User name Logon Information


is Administrator.
Default Password is
kept blank

For CX10** and


other embedded
PC`s and Industrial
PC`s the default
Username is
administrator. The
Password is 1.

Beckhoff TwinCAT 10
Setting up CX9000

Once you have Add Route Dialog


accepted the
Username and
Password you
should get a “X”
under the
Connected. This
means Twincat and
the system manager
now has a route to
connect to the
device.

Beckhoff TwinCAT 11
Setting up CX9000

Look for the CX that Choose Target System


you have just
connected to and
click on it. It will
highlight like on the
left. You can then
click “OK”

Beckhoff TwinCAT 12
Setting up CX9000

As you can now see Now Connected


at the top of the
System manager
the name of the
device connected is
showing. Also on
the bottom right side
is the status of
Twincat on the CX
and the CX
connected in red.

Beckhoff TwinCAT 13
Setting up CX9000

Now you will have Change CX Address


an extra tab called
“CX Settings”. Click
on this and then you
will be able to give
the CX an address
of your choice.

Beckhoff TwinCAT 14
Setting up CX9000

Change the IP Change CX Address


Address to
172.16.17.90.
Change the Subnet
mask to 255.255.0.0
Click apply.
Default address for
BC9000 couplers is
172.16.17.(*Dip
switch*)

Beckhoff TwinCAT 15
Setting up CX9000

Reboot system System Manager

Target system is
rebooting. Click
“OK”

Beckhoff TwinCAT 16
Setting up CX9000

Change your Internet Protocol Properties


Networks IP
address. You can
use any range from
1 – 255. Better to
Disconnect your
network cable when
changing IP
addresses.
I have addressed it
172.16.17.1
Click ok.

You will now be able


to ping the CX using
this range.

Beckhoff TwinCAT 17
Setting up CX9000

Now back to the Choose Target System


Choose Target
System. Since we
have changed the
address we must
now link the CX
again with the new
Address.

Beckhoff TwinCAT 18
Setting up CX9000

As you can see the Add Route Dialog


connected “X” has
gone again. The
address has
changed.

Click the IP Address


option next to the
Host Name and Add
Route.

Once again. The


Username and
Password is asked.

Click ok and you will


now see the system
is connected again
with the new IP
range

Beckhoff TwinCAT 19
Setting up CX9000

The system CX Is Run Mode


manager again says
the CX is in Run
Mode.

You CX Should look


like this at the
moment.

Beckhoff TwinCAT 20
Setting up CX9000

Config mode allows Restarting system in Config Mode


you to monitor and
scan the bus.
Click the Blue
button at the top of
the system
manager.

Click the “OK”


button.

Now your CX is in
config mode.

And should look like


this.

Beckhoff TwinCAT 21
Setting up CX9000

Right click on I/O Scanning Devices


Devices and click
“Scan Devices”.

Click OK

Disable items not


needed.

Beckhoff TwinCAT 22
Setting up CX9000

Click “Yes” to scan Scanning of IO


for all boxes.

Click “Yes” do
create
corresponding
device for the
Ethercat PRofibus
Master.

Do not activate free


run. Free run is
used when you
want to force
outputs when in
config mode.

Your Scan tree


should look similar
to this

Beckhoff TwinCAT 23
Setting up CX9000

Save your System Save Your File


manager file and
give it a name you
think is suitable to
your application.

Beckhoff TwinCAT 24
Setting up CX9000

Now your system System Manager


manager should
look like this.

Beckhoff TwinCAT 25
Setting up CX9000

Open a new Twincat Twincat


file.

For the CX 9000List


IL=Instruction
range CX (ARM)
LD=Ladder
must be selected.
For CX10**,
FBD=Function
Industrial PC`s
Block Diagram
and your local
SFC=Sequential
system select the
Function
PC or CX Chart
(x86).
For
ST=aStructured
BC coupler
over
Text ethernet
select BC via
CFC=Continuous
AMS. BC via serial
Function
select BC Chart
serial.

Beckhoff TwinCAT 26
Setting up CX9000

I have started my Twincat Programming


programming using
Structured Text. On
the left are your
programs, Function
Blocks and
Functions. Below
that is your
Resources tab
(Global variables,
Task configuration
etc), Visualization
tab Data Types tab
and Program tab.

Beckhoff TwinCAT 27
Variable Declaration - 1

Variable Has %I = Input Variable Type


Name: Memory
Allocation %Q = Output
%M = Memory

Simple Declaration

Beckhoff TwinCAT 28
Variable Declaration - 2

X BOOL

I
BYTE

B 1.0
INT
Variable AT
Name % Q : ;
REAL
W 20

M TIME

D STRING

Beckhoff TwinCAT 29
Variable Declaration - 3

•Select Correct Variable for job


•Declare Correctly
•Use Correctly

Beckhoff TwinCAT 30
Setting up CX9000

Go to your Twincat Programming – Global Variables


Resources tab
below and open
your Global
variables.

Add these variables.

Beckhoff TwinCAT 31
Setting up CX9000

Choose the run time Twincat Programming – Choose a Run Time System
system that is your
CX. This will now
connect the Twincat
program to the CX
so that when you
download, the
program will be
downloaded into the
CX.

If you look at your


bottom left hand
corner you will see
a target and if the
system is Running.
This does not mean
that the system is in
Run mode however.

Beckhoff TwinCAT 32
Setting up CX9000

Twincat Programming - Save

Save your program in a specific


location. This is important and
remember where you have
saved it as the system manager
reads a *.tpy file in the folder
where the plc program has been
saved.
Beckhoff TwinCAT 33
Setting up CX9000

Go back to the Connecting Twincat Program to System manager


system manager.
Click on PLC –
Configuration.
Right click and Click
on “Append PLC
Project…”

Search for you File


*.tpy file which is
saved in the
directory that you
saved your
program. If you
move your program
and rebuild it this
file will not be
updated. You will
have to search for
the new *.tpy file
created in the
directory where you
moved the
program.
Beckhoff TwinCAT 34
Setting up CX9000

Now the program is Program Connected To System Manager


connected. As you
can see the
program can be
rescanned. This is
for when extra
variables have been
added to your
program. You can
set this to automatic
by clicking “Options”
and tick “Check PLC
project changes”.

Beckhoff TwinCAT 35
Setting up CX9000

Every time you Rebuild Twincat Program


Rebuild your
Twincat program
this message will
now come up in
your system
manager. If this
does not happen
then either.
The program that
you rebuilt is not
linked correctly to
the system
manager.
The name or
directory that the
system manager is
looking for is not
correct
The option to check
PLC changes is not
ticked.

Beckhoff TwinCAT 36
Setting up CX9000

Click on the Linked Linking IO From Program to System Manager


to… button.

Link all the IO that


you have by
clicking on it and
then clicking the
“OK” button.

Now you will be


seeing an arrow
next to the Input.
This indicates that
this input is being
used by an I/O.

Beckhoff TwinCAT 37
Generate Mappings
Check Configuration Setting up CX9000
Activate Configuration
Now to Accept
everything we have
Set To Run Mode
done and to download
the hardware
configuration to the CX.

Disable all the items


we don’t need at
this moment by
clicking on the
object not needed
and then clicking the
disabled checkbox.
Then begin by
clicking on Generate
mappings,
Check
Configuration,
Activate
Configuration and
Set/Reset to Run
Mode.

Beckhoff TwinCAT 38
Setting up CX9000

Now to downlaod Twincat Download


the program for the
first time.

Run mode has not


been activated yet.
Push F5 Key or go
to online tab and
click “Run”.

Beckhoff TwinCAT 39
Setting up CX9000

Now you can Program Downloaded.


continue testing
whatever you need.
However every time
the CX shuts down
the CX will start with
a blank memory. So
to make the CX start
with your program
on startup every
time make sure you
create a Boot
project.

Beckhoff TwinCAT 40
Setting up CX9000

ALL DONE

Done

Beckhoff TwinCAT 41