| View previous topic :: View next topic |
| Author |
Message |
mojo Senior

Joined: 01 Oct 2011 Posts: 2404
|
Posted: 22/11/2011 07:00 Post subject: Beckhoff CX 1020 with Weintek HMI |
|
|
I would like to know how to configure a cx1020 with Weintek HMI (or any other HMI in general)
I would also like to communicate the HMI with the PC having TWINCAT installed for offline simulation purpose. So how do i configure the connection between the Twincat (on Pc) with the HMI software?
Thanks. |
|
| Back to top |
|
 |
rott Senior

Joined: 23 Aug 2011 Posts: 2266
|
Posted: 22/11/2011 07:06 Post subject: Beckhoff CX 1020 with Weintek HMI |
|
|
Hello Mojo,
In genaral you have three options:
1. The HMI has an ADS driver.Easy.
2. Using a standard driver like ModbusTCP or ModbusRTU.
3. Using an OPC.
You can also purchase Indusoft Web Studio for HMI, which is one of the least expensive choices and is also fairly modern (object design, etc).
It interfaces natively with TwinCAT, rather than the generic OPC interface
which need a little more experience. |
|
| Back to top |
|
 |
mojo Senior

Joined: 01 Oct 2011 Posts: 2404
|
Posted: 07/12/2011 07:15 Post subject: TwinCAT TCP/IP Connection Server(PLC Server, VB Client) |
|
|
Hi all,
We have CX1020(WinCE, TwinCat), laptop(WinXP, TwinCat v2.11.0) some input, output modules. All is normal. It is working.
I tried to use that example. I loaded from beckhoff.com TCP/IP server project(TcpIp_SERVER.pro), Visual Basic client project (VBSample01.exe), TcpIpServer.exe and TcTCPIPSrvCE.exe
I installed TwinCAT TCP/IP Server (TcpIpServer.exe or TcTCPIPSrvCE.exe), Library(TcBase.lib, TcSystem.lib, TcpIp.lib, Standart.lib)
Laptop connect to СХ1020-0111(Ethernet-Port X01)
IP CX1020 10.1.1.6; IP laptop 10.1.1.7
opened in 'TwinCAT PLC Control' project TcpIp_SERVER.pro
in MAIN(PRG) wrote sLocalHost := '10.1.1.6' (IP CX1020 10.1.1.6)
compiled TcpIp_SERVER.pro (0-Errors, 0-Warning) and downloaded to CX1020.
do run cx1020 and run Project1.exe(Visual Basic client project)
In client write ip 10.1.1.6 (ip CX1020) port - the same like nLocalPort in MAIN(PRG)
after try connect to server in Visual Basic client project(laptop) i see message 'Client Error:10061(Connection is forcefully rejected)'
It's meaning no connection...
What I did wrong and what I did not? May be someone, can explain.
Thanks |
|
| Back to top |
|
 |
rott Senior

Joined: 23 Aug 2011 Posts: 2266
|
Posted: 07/12/2011 07:19 Post subject: Re: TwinCAT TCP/IP Connection Server(PLC Server, VB Client) |
|
|
| mojo wrote: | Hi all,
We have CX1020(WinCE, TwinCat), laptop(WinXP, TwinCat v2.11.0) some input, output modules. All is normal. It is working.
I tried to use that example. I loaded from beckhoff.com TCP/IP server project(TcpIp_SERVER.pro), Visual Basic client project (VBSample01.exe), TcpIpServer.exe and TcTCPIPSrvCE.exe
I installed TwinCAT TCP/IP Server (TcpIpServer.exe or TcTCPIPSrvCE.exe), Library(TcBase.lib, TcSystem.lib, TcpIp.lib, Standart.lib)
Laptop connect to СХ1020-0111(Ethernet-Port X01)
IP CX1020 10.1.1.6; IP laptop 10.1.1.7
opened in 'TwinCAT PLC Control' project TcpIp_SERVER.pro
in MAIN(PRG) wrote sLocalHost := '10.1.1.6' (IP CX1020 10.1.1.6)
compiled TcpIp_SERVER.pro (0-Errors, 0-Warning) and downloaded to CX1020.
do run cx1020 and run Project1.exe(Visual Basic client project)
In client write ip 10.1.1.6 (ip CX1020) port - the same like nLocalPort in MAIN(PRG)
after try connect to server in Visual Basic client project(laptop) i see message 'Client Error:10061(Connection is forcefully rejected)'
It's meaning no connection...
What I did wrong and what I did not? May be someone, can explain.
Thanks |
Hi Mojo,
I think, you need to install cabinet file 'TcTCPIPSvrCe.I586.CAB' in CX1020 as WinCE version on CX1020 requires this installation to support TCP/IP communication. Below are the details of installations as per the Beckhoff systems,
1. Install the product on your programming PC. The PLC libraries are copied into ..\TwinCAT\PLC\Lib folder.
A. X86 CPU (CX1000, CX1020)
1. The folder ...\TwinCAT\CE\TCPIP\Install\ contains a Cabinet-File for the CE runtime system.
2. Copy the file: TcTCPIPSvrCe.I586.CAB in a folder of the CE runtime system.
B. ARM CPU (CX9000), TwinCAT TCP/IP Connection Server v1.0.0.44 and higher:
1. The folder ...\TwinCAT\CE\TCPIP\Install\ contains a Cabinet-File for the CE runtime system.
2. Copy the file: TcTCPIPSvrCe.ARMV4I.CAB in a folder of the CE runtime system.
2. On CE system: Install (double click to Cabinet-File) CE components.
Note: Please suspend the CE device once after installation via "Start-> Suspend". The TwinCAT TCP/IP Connection Server starts with CE operating system.
Hope, this will solve your problem.
Cheers,
Rott |
|
| Back to top |
|
 |
mojo Senior

Joined: 01 Oct 2011 Posts: 2404
|
Posted: 03/01/2012 06:46 Post subject: modbus TCP |
|
|
| Anyone have experience in modbus TCP? I try to read a modbus TCP address 304096 from twinCAT, but have not yet success. Please help with sample program or guidance. Thanks |
|
| Back to top |
|
 |
rott Senior

Joined: 23 Aug 2011 Posts: 2266
|
Posted: 03/01/2012 06:48 Post subject: Modbus TCP |
|
|
Hi,
Do you use the Beckhoff device as Modbus TCP server towards another Client? Is it a CX or BC or another Beckhoff system?
If I take a CX9010 as example the 304096 address could mean 3xxxxx Input Register (Input Area, I) and the address to read is 4096 dec (1000 hex). If so, with function code 4 you read the input register.
To be able to use the CX9010 as Modbus TCP Server the TwinCAT Supplement Modbus TCP Server (CE) needs to be installed
Rott |
|
| Back to top |
|
 |
mojo Senior

Joined: 01 Oct 2011 Posts: 2404
|
Posted: 03/01/2012 06:49 Post subject: |
|
|
Hi Rott,
Currently I am trying to use a PC with twincat as a client to read from a IFM ASI modbus controller. The 304096 is a adress from IFM ASI modbus controller. |
|
| Back to top |
|
 |
rott Senior

Joined: 23 Aug 2011 Posts: 2266
|
Posted: 03/01/2012 06:50 Post subject: |
|
|
Hi Mojo,
When using PC with TwinCAT as Modbus TCP Client, you need to install the supplement TwinCAT Supplement Modbus TCP Server anyway. The Modbus ADS server enables communication with a Modbus device (Modbus server) via ADS and a MODBUS/TCP connection.
http://infosys.beckhoff.com/content/1033/tcmodbussrv/html/TcModbusSrv_Client_Overview.htm
Use different function block depending on what function code you need to read/write to. Function block FB_MBReadInputRegs uses Modbus function code 4 to read Input Register (word).
The adress to read from will in your case be 4096. |
|
| Back to top |
|
 |
|