IP

Generalities : For Installation launch setup.exe in provided CD-Rom. ... receiving the result slave. (Ignored). ServerIP. Adress. Port 502. (openmodb us norm) ...
179KB taille 53 téléchargements 570 vues
Open Modbus TCP/IP User's Manual

October 2000

1 Impasse René Lebrun, ZAC de Monthéard 72000 LE MANS Tel : +33 (0)2 43 72 45 45 Fax : +33 (0)2 43 72 73 40 Web : http//:www.arsoft-int.com

Generalities : For Installation launch setup.exe in provided CD-Rom. The system creates a group containing the files including: SERVOPENMODBUS.EXE MONSTERMOD.EXE VISULAD.EXE MONSTERDDE.EXE

: For protocol and dialogues settings. : Server to execute dialogs. : Allow to display variables into the server : DDE server allowing to reading/writing variables by DDE commands.

OpenModbus client makes it possible to dialogue under OpenModbus protocol definite by Modicon. The difference between a traditional connection modbus and OpenModbus, is that the modbus frames are encapsulated in a TCP/IP frames.

First step : IP adress Configuration example:

icon Network Connections.

here IP address (of your Pc) is defined : 169.254.157.28 and the subnet mask is 255.255.255.0. Do not let Windows to determine an address at power on. Force this one by choosing an unsused address.

Server side : For example with a Schneider (Modicon) interface card:

Compared to our example seen before, Set address IP at: 169.254.157.29 SubnetMask : 255.255.255.0. Then the domain corresponds

' Ping ' the address in client side in Dos (Command.exe).

The server must answer in the way described above before being able to go ahead. If it is not the case, check all the parameters. In the worst case, completely uninstall the card and the network and start again.

Frames settings in the client : Launch this program to set the client: To declare new globals variables in the client

exchanges types

To define a project

Server Words/Bits varaibles’ count to adresses exchange

First variable receiving the result

Condition to exchange (option)

slave. ServerIP (Ignored) Adress

Port 502. (openmodb us norm)

Exchanges types: Exchanges Types

: Double-click to choose.

: You must see the memory mapping in your server. : How many words, doublewords, reals or bits to exchange. : Indicate the variable into the client, the rest will be store into the consecutives variables declared. Command : Bit if is True allowing the exchange of the specified frame. If no bit the frame is always sent. Slave : Slave number, in the case of a gateway TCP/IP to serial. In pure Ethernet it is not used. Set 1 for example. Adresse IP : address of the remote openModbus server. Port : normally 502. Adress Count Variables

Note: if a bit of command is specify, the corresponding communication line is performed when this bit is set then this bit is reset by the server returning as this an pseudo acknowledge..

Read 16 Bits : In the Client (or Visual I/O, Visual PLC) the words are 16 Bits. Declare for example: W0, W1, W2 : Word ; Correspondant Exchange: Read Words : Adress =0, Count=3, Variable=W0 … That will perform a storing in W0, W1 and W2 of 6 bytes received. Read 32 Bits : In the client ( or Visual I/O, Visual PLC) the integers are 32 Bits. Declare for example : DW0, DW1, DW2 : Integer ; Correspondant Exchange: Read Words : Adress=0, Count=3, Variable=DW0.. That will perform a storing in DW0,DW1 and DW2 of 12 bytes received. To specify an integer in the client, the system x2 the number of bytes to transfer. Read Real : In the client ( or Visual I/O, Visual PLC) the Reals are 32 Bits. Declare for example : R0, R1, R2 : Real ; Correspondent Exchange: Read Words: Adress=0, Count=3, Variable=R0.. That will perform to store in R0,R1 and R2 the 12 Bytes received. The fact to specify a real in the client, the system adapts the number of bytes to transfer. Note : Generally the reals in servers are Single type (4 Bytes). In Visual I/O, Visual PLC the reals are 10 bytes large (Extended). The system makes the conversion automatically .

For sending numerical values the reasoning is similiaire

Attention the writing towards the slave is done only so at least one of the values in the block changed

For sending or receiving bits, declare in the client Booleans : Example : B0, B1, B2, B3 : Boolean ; Important to control writing at the server launching time To avoid sending values to PLC or remote I/O at the server launching time, simply declare the OPENMODBUSWINIT : Boolean; variable in your global variables. At launching time, the server test if the variable is declared and if that variable is set (True) then is it's true all writing are performed. If that variable is missing or reset (False) no writing are performed at launching time.

Lanching the openmodbus client A window appears:

Strike the runtime code that we communicated to you by fax. Or click on OK. You have 15 Minutes to test.

After having clicked on OK, an icon in the taskbar of Windows appears indicating that the transfer is in service. Double click on this icon, this window appears giving you the state of the communications in progress.

Process : Display the current transaction.

Monster DDE

Monster DDE is the DDE server. Receiving commands from DDE clients DDE (like Excel ). Allow the DDE communication with global variables of Visual I/O or Visual PLC. After double click on the icon, this one is placed in the taskbar of Windows.

Application name Topic Name Item name

: MONSTERDDE. : MONSTERDDE. : variable global name ( ex : W1) .

Command line in Excel to get the value named CPT for example: =MONSTERDDE|MONSTERDDE !CPT explanations: =ApplicationName | Topic ! Item

Other interfaces : To interface the global variables with languages such as Visual BASIC, Visual Pascal, C++Builder you can use

The DLL The DCUS for Delphi The COM Object documentations: VPLC.TXT , VPLCOM.DOC

: VPLC.DLL : VARVPU.DCU for Delphi 4, and Delphi 5. : VPLCOM.DLL