beckhoff training - 03 cx900x comms & hardware setup 2011 (1).ppt
DESCRIPTION
Beckhoff Training - 03 CX900x Comms & Hardware Setup 2011 (1).pptTRANSCRIPT
Beckhoff TwinCAT 1
CX9000 – Comms & Hardware Setup
Beckhoff TwinCAT 2
Training Hardware - 1
Ethernet Port
Battery Compartment and DIP switches
Ethernet Port
Power LED `s and Power For CPU and Terminals.
Beckhoff TwinCAT 3
Training Hardware - 1
Beckhoff TwinCAT 4
Training Hardware - 1
Ordering information E-Bus K-Bus DVI, 2 x USBno
TwinCATTwinCAT-
PLC-RuntimeTwinCAT-
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 5
Setting up CX9000
Open an empty system manager file.
Beckhoff TwinCAT 6
Setting up CX9000
Choose a target systemWhen 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.
Then click on the Search (Ethernet)… button.
Beckhoff TwinCAT 7
Setting up CX9000
Add Route dialogClick the broadcast search button.
Beckhoff TwinCAT 8
Setting up CX9000
Add Route DialogAt 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.
Beckhoff TwinCAT 9
Setting up CX9000
Add Route DialogClick 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 01-DA-18.
Beckhoff TwinCAT 10
Setting up CX9000
Logon InformationDefault User name 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 11
Setting up CX9000
Add Route DialogOnce 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.
Beckhoff TwinCAT 12
Setting up CX9000
Choose Target SystemLook 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”
Beckhoff TwinCAT 13
Setting up CX9000
Now ConnectedAs 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.
Beckhoff TwinCAT 14
Setting up CX9000
Change CX AddressNow 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.
Beckhoff TwinCAT 15
Setting up CX9000
Change CX AddressChange 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*)
Beckhoff TwinCAT 16
Setting up CX9000
System ManagerReboot system
Target system is rebooting. Click “OK”
Beckhoff TwinCAT 17
Setting up CX9000
Internet Protocol PropertiesChange 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.
You will now be able to ping the CX using this range.
Beckhoff TwinCAT 18
Setting up CX9000
Choose Target SystemNow back to the Choose Target System. Since we have changed the address we must now link the CX again with the new Address.
Beckhoff TwinCAT 19
Setting up CX9000
Add Route DialogAs 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
Beckhoff TwinCAT 20
Setting up CX9000
CX Is Run ModeThe system manager again says the CX is in Run Mode.
You CX Should look like this at the moment.
Beckhoff TwinCAT 21
Setting up CX9000
Restarting system in Config ModeConfig 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.
Beckhoff TwinCAT 22
Setting up CX9000
Scanning DevicesRight click on I/O Devices and click “Scan Devices”.
Click OK
Disable items not needed.
Beckhoff TwinCAT 23
Setting up CX9000
Scanning of IOClick “Yes” to scan 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 24
Setting up CX9000
Save Your FileSave your System manager file and give it a name you think is suitable to your application.
Beckhoff TwinCAT 25
Setting up CX9000
System ManagerNow your system manager should look like this.
Beckhoff TwinCAT 26
Setting up CX9000
TwincatOpen a new Twincat file.
For the CX 9000 range CX (ARM) must be selected. For CX10**, Industrial PC`s and your local system select the PC or CX (x86). For a BC coupler over ethernet select BC via AMS. BC via serial select BC serial.
IL=Instruction List
LD=Ladder
FBD=Function Block Diagram
SFC=Sequential Function Chart
ST= Structured Text
CFC=Continuous Function Chart
Beckhoff TwinCAT 27
Setting up CX9000
Twincat ProgrammingI 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.
Beckhoff TwinCAT 28
Variable Declaration - 1
Variable Name:
Has Memory Allocation
%I = Input
%Q = Output
%M = Memory
Variable Type
Simple Declaration
Beckhoff TwinCAT 29
Variable Declaration - 2
Variable Name
AT % Q
I
M
B
X
W
D
20
1.0
:
BOOL
;
BYTE
INT
REAL
TIME
STRING
Beckhoff TwinCAT 30
Variable Declaration - 3
•Select Correct Variable for job
•Declare Correctly
•Use Correctly
Beckhoff TwinCAT 31
Setting up CX9000
Twincat Programming – Global VariablesGo to your Resources tab below and open your Global variables.
Add these variables.
Beckhoff TwinCAT 32
Setting up CX9000
Twincat Programming – Choose a Run Time SystemChoose 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.
Beckhoff TwinCAT 33
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 34
Setting up CX9000
Connecting Twincat Program to System managerGo 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 35
Setting up CX9000
Program Connected To System ManagerNow 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”.
Beckhoff TwinCAT 36
Setting up CX9000
Rebuild Twincat ProgramEvery 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 37
Setting up CX9000
Linking IO From Program to System ManagerClick on the Linked 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 38
Setting up CX9000Generate Mappings
Now to Accept everything we have 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.
Check ConfigurationActivate Configuration
Set To Run Mode
Beckhoff TwinCAT 39
Setting up CX9000
Twincat DownloadNow to downlaod 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 40
Setting up CX9000
Program Downloaded.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.
Beckhoff TwinCAT 41
Setting up CX9000
Done
ALL DONE