Opis sposobu uruchomienia komunikacji Modbus TCP klient w

Transkrypt

Opis sposobu uruchomienia komunikacji Modbus TCP klient w
Praca sterownika VersaMax Micro jako klient w protokole
Modbus TCP – instrukcja uruchomieniowa
Aby uruchomić pracę sterownika Micro w trybie Modbus TCP Client, naleŜy:
1. Zainstalować w sterowniku kartę komunikacyjną Ethernet (IC200UEM001).
Nadać karcie adres tymczasowy; najprościej przy pomocy narzędzia Set Temporary IP Address w
oprogramowaniu Proficy ME. W oknie podajemy adres MAC karty Ethernet (znajduje się na naklejce z
tyłu karty komunikacyjnej) oraz Ŝądany adres tymczasowy.
2. Za pomocą łącza szeregowego serownika wgrać konfigurację sterownika, zaznaczając dla karty
Ethernet następujące opcje:
Port 2 : Ethernet
Port Mode : RTU
Port Type : Slave
Ustawić prędkość transmisji i parzystość taką samą, jak skonfigurowaną w systemie operacyjnym
karty Ethernet
Uaktywnić Modbus/TCP Client: Enabled
Nadać adresy startowe dla opcji Modbus TCP client (muszą to być wolne rejestry; nie naleŜy ich
później nigdzie uŜywać w programie).
3. Załadować do karty protokół Modbus TCP, uŜywając narzędzia PumpKIN. W narzędziu tym
wcisnąć przycisk Put File, wskazać lokalizację pliku Modbus TCP, jako Remote file wpisać: G3. W
polu Remote host wpisać adres tymczasowy karty Ethernet.
Modbus TCP Client w Micro
1
4. Ponownie nadać adres tymczasowy (po załadowaniu nowego firmware został on „zapomniany”).
5. Wejść w system operacyjny karty poleceniem (wpisując w wierszu poleceń):
telnet [adres IP karty Ethernet] 9999
i zgodnie z wyświetloną informacją, wcisnąć ENTER, jako potwierdzenie wejścia w konfigurowanie
karty.
6. Opcją nr 1 ustawić trwały adres IP i maskę, opcją nr 2 aktywować pracę jako Modbus TCP Client
Modbus/TCP Client: enabled
Zapisać ustawiania za pomocą S – Save
7. Napisać program z uŜyciem bloku MODBUS_TCP_RW. Blok nie moŜe uŜywać adresów
ustawionych w konfiguracji Hardware Configuration.
Modbus TCP Client w Micro
2
Wyjaśnienie znaczenia wejść/wyjść bloku MODBUS_TCP_RW:
Input Operands
Operand Data Type
EN (LD
only)
Power flow
EX
Power flow
(LD), BOOL
variable (IL)
CH
WORD
constant
Memory Description
Area
Enable. When set to On, MODBUS_TCP_RW executes. When set
to Off, MODBUS_TCP_RW does not execute.
I, Q, M,
G, T
Execute. A low to high transition starts command processing.
The channel number on which the current request needs to be
processed.
Valid entry: 1. Other values are caught as validation errors.
FC
LMR
LMO
WORD
variable or
constant
AI, AQ,
R
Function code. Input word.
WORD
variable or
constant
AI, AQ,
R
Local PLC Reference memory Type.
WORD
variable or
constant
AI, AQ,
R
Local PLC Reference Memory Address. For a read operation, this
memory is the destination. For a write operation, this memory is
the source (Modbus/TCP Client device's location).
Valid range: 1 through 7; 15 or 16.
Valid entries: 8, 18, 72.
Modbus TCP Client w Micro
3
RMO
WORD
variable or
constant
AI, AQ,
R
Remote PLC Reference Memory Address. For a read operation,
this memory is the source. For a write operation, this memory is
the destination (Modbus/TCP Server device's location).
DL
WORD
variable or
constant
AI, AQ,
R
Data Length. Length of data to be read.
IP
WORD
variable
AI, AQ,
R
IP start address. IP Address of the Server device. Starting from
this address, four WORDs contain the four octets of the IP.
UI
WORD
variable or
constant
AI, AQ,
R
Unit Identifier. The Modbus/TCP Unit identifier, a special control
code used in a Modbus/TCP message. This value is 1 for most
Modbus/TCP devices except if an Ethernet to Serial Bridge is used
to multidrop to Modbus RTU devices.
Valid range: 0 through 255.
Output Operands
Operand
Data
Type
Memory Description
Area
ENO (LD
only;
optional)
Power
flow
CMPL
BOOL
variable
I, Q, M,
G, T
Complete. When set to 1, the request has been processed.
BUSY
BOOL
variable
I, Q, M,
G, T
When set to 1, the request is in progress.
ERR
BOOL
variable
I, Q, M,
G, T
Error. Used for function block errors.
STS
WORD
variable
AI, AQ,
R
Status or Error ID. Status from the Ethernet option board, after
processing a command. After execute has been triggered, the
firmware checks continuously for a match between the processed
sequence number and the response sequence number.
Enable Output. Set to On when MODBUS_TCP_RW has executed
successfully.
Modbus TCP Client w Micro
4

Podobne dokumenty