You are on page 1of 41

CX9000 Comms & Hardware Setup

Beckhoff TwinCAT

Training Hardware - 1

Ethernet Port
Battery Compartment and DIP switches Ethernet Port

Power LED `s and Power For CPU and Terminals.

Beckhoff TwinCAT

Training Hardware - 1

Beckhoff TwinCAT

Training Hardware - 1

Ordering information

E-Bus

K-Bus

DVI, 2 x USB

no TwinCAT
x x x x -

TwinCATPLC-Runtime
x x x x x x x x -

TwinCATNC-Runtime

CX9010-0000 CX9010-0001 CX9010-0002 CX9010-0100 CX9010-0101 CX9010-0102 CX9010-1000 CX9010-1001 CX9010-1002 CX9010-1100 CX9010-1101 CX9010-1102

x x x x x x -

x x x x x x

x x x x x x

x x x x

Beckhoff TwinCAT

Setting up CX9000
Open an empty system manager file.

Beckhoff TwinCAT

Setting up CX9000
When you have 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.

Choose a target system

Then click on the Search (Ethernet) button.

Beckhoff TwinCAT

Setting up CX9000
Click the broadcast search button.

Add Route dialog

Beckhoff TwinCAT

Setting up CX9000
At default the 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.

Add Route Dialog

Beckhoff TwinCAT

Setting up CX9000
Click on the desired 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 01DA-18.

Add Route Dialog

Beckhoff TwinCAT

Setting up CX9000
Default User name is Administrator. Default Password is kept blank

Logon Information

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 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.

Add Route Dialog

Beckhoff TwinCAT

11

Setting up CX9000
Look for the CX that you have just connected to and click on it. It will highlight like on the left. You can then click OK

Choose Target System

Beckhoff TwinCAT

12

Setting up CX9000
As you can now see 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.

Now Connected

Beckhoff TwinCAT

13

Setting up CX9000
Now you will have an extra tab called CX Settings. Click on this and then you will be able to give the CX an address of your choice.

Change CX Address

Beckhoff TwinCAT

14

Setting up CX9000
Change the IP 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*)

Change CX Address

Beckhoff TwinCAT

15

Setting up CX9000
Reboot system

System Manager

Target system is rebooting. Click OK

Beckhoff TwinCAT

16

Setting up CX9000
Change your 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.

Internet Protocol Properties

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. Since we have changed the address we must now link the CX again with the new Address.

Choose Target System

Beckhoff TwinCAT

18

Setting up CX9000
As you can see the 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

Add Route Dialog

Beckhoff TwinCAT

19

Setting up CX9000
The system manager again says the CX is in Run Mode.

CX Is Run Mode

You CX Should look like this at the moment.

Beckhoff TwinCAT

20

Setting up CX9000
Config mode allows 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.

Restarting system in Config Mode

Beckhoff TwinCAT

21

Setting up CX9000
Right click on I/O Devices and click Scan Devices. Click OK Disable items not needed.

Scanning Devices

Beckhoff TwinCAT

22

Setting up CX9000
Click Yes to scan for all boxes. Click Yes do create corresponding device for the Ethercat PRofibus Master.

Scanning of IO

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 manager file and give it a name you think is suitable to your application.

Save Your File

Beckhoff TwinCAT

24

Setting up CX9000
Now your system manager should look like this.

System Manager

Beckhoff TwinCAT

25

Setting up CX9000
Open a new Twincat file. For the CX 9000 IL=Instruction List 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 BC coupler ST=aStructured over Text ethernet select BC via CFC=Continuous AMS. BC via serial Function select BC Chart serial.

Twincat

Beckhoff TwinCAT

26

Setting up CX9000
I have started my 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.

Twincat Programming

Beckhoff TwinCAT

27

Variable Declaration - 1

Variable Name:

Has Memory Allocation

%I = Input %Q = Output %M = Memory

Variable Type

Simple Declaration
Beckhoff TwinCAT 28

Variable Declaration - 2
X I BYTE B 1.0 INT

BOOL

Variable Name

AT

Q 20

:
REAL W

TIME

STRING
29

Beckhoff TwinCAT

Variable Declaration - 3

Select Correct Variable for job Declare Correctly

Use Correctly

Beckhoff TwinCAT

30

Setting up CX9000
Go to your Resources tab below and open your Global variables. Add these variables.

Twincat Programming Global Variables

Beckhoff TwinCAT

31

Setting up CX9000
Choose the run time 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.

Twincat Programming Choose a Run Time System

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 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

Connecting Twincat Program to System manager

Setting up CX9000
Now the program is 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.

Program Connected To System Manager

Beckhoff TwinCAT

35

Setting up CX9000
Every time you 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

Rebuild Twincat Program

Setting up CX9000
Click on the Linked to button. Link all the IO that you have by clicking on it and then clicking the OK button.

Linking IO From Program to System Manager

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

Now to Accept everything we have done and to download the hardware configuration to the CX.

Generate Mappings Check Configuration Activate Configuration Set To Run Mode

Setting up CX9000

Disable all the items we dont 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 the program for the first time.

Twincat Download

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 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.

Program Downloaded.

Beckhoff TwinCAT

40

Setting up CX9000
ALL DONE

Done

Beckhoff TwinCAT

41

You might also like