Вы находитесь на странице: 1из 31

FIELDBUS

DOCUMENTATION
M_Ethernet IP_C - Last update: 07/2021

ETHERNET/IP
INTEGRATION
A. Contents
A. Contents.....................................................................................................................................................2

B. Package content........................................................................................................................................3

C. Quick start..................................................................................................................................................4

D. Communication configuration.................................................................................................................5
1. Aim..........................................................................................................................................................5
2. Hardware................................................................................................................................................. 5
3. Add HMS module in the EDS Studio 5000 Library.................................................................................. 6
4. Programming PLC configuration............................................................................................................. 9
5. Programming the embedded ETHERNET/IP module........................................................................... 11
6. Quick communication control................................................................................................................ 11

E. Example PLC program............................................................................................................................12

F. Function block.........................................................................................................................................15
1. Inputs.................................................................................................................................................... 16
2. Outputs.................................................................................................................................................. 16
3. Parameters............................................................................................................................................ 17
4. Local constants..................................................................................................................................... 19
5. Code description................................................................................................................................... 20
„ Introduce��������������������������������������������������������������������������������������������������������������������������������������������� 20
„ Inputs�������������������������������������������������������������������������������������������������������������������������������������������������� 21
„ Functions
������������������������������������������������������������������������������������������������������������������������������������������������������������������23
„ Outputs����������������������������������������������������������������������������������������������������������������������������������������������� 26

G. Troubleshooting analysis.......................................................................................................................27
1. Communication error............................................................................................................................. 27

H. Appendix..................................................................................................................................................31
1. Appendix 1 - Unicode Table.................................................................................................................. 31

M_Ethernet IP_C 2
B. Package content

• 005A0000002E0100.eds:
EDS file to import the communication device in the network PLC configuration
• Comm_reseau_GVT_V2_1.ACD:
PLC program writing with Studio 5000 Logix Designer Version 32.02.00
• M_Fieldbus_EN_A.pdf: Manual to use the fieldbus requests
• M_Ethernet IP_EN_C.pdf:
Manual to use the communication pack
• Marking.L5X:
function block to be import in the customer program
• Marking.pdf:
listing of the function block to be import in the customer program
• ProgExemple_MainProgram.L5X:
example PLC program can be import in the customer program (with all tags, laser and mechanical example
routines and function block)
• ProgExemple_Laser.pdf:
listing of the example laser PLC program
• ProgExemple_MicroPercussion.pdf:
listing of the example mechanical PLC program
• ProgExemple_Tags.pdf:
tags listing of the example PLC program
• IPconfig Setup 3.2.1.1.exe:
HMS software to configure the devices IP address

M_Ethernet IP_C 3
C. Quick start

Follow these points to quickly test the exchanges with the marking machine:

1. Configure the Ethernet/IP address about the HMS module in the marking machine with the software
IPConfig, or directly on the marking machine for the XCOM (see "Programming the embedded
ETHERNET/IP module").

2. Open Studio 5000, the example program and change the PLC model if necessary. You can remove
the Laser program if you have only a mechanical machine, or the MicroPercussion program if you
have only a laser machine.

3. Install the EDS file (see "Add HMS module in the EDS Studio 5000 Library").

4. Download the program in the PLC and verify the communication between the PLC and the marking
machine with the function block outputs (see "Quick communication control").

5. Send a marking file in the marking machine with the name “TEST.t2l” for the laser, and “TEST.tml”
for the XCOM and switch it in “Controlled mode”.

6. Start the PLC cycle example program with the bit XX_PbStartCycle to mark your marking file (see
"Example PLC program").

M_Ethernet IP_C 4
D. Communication configuration
1. Aim

The aim of these instructions is to set up an Ethernet/IP communication between a COMPACTLOGIX controller
and a GRAVOTECH LASER MARKING MACHINE via the embedded HMS CompactCom module.

Compactlogix

Laser marking machine

Mechanical marking machine

2. Hardware
• UC laser marking machine or XCOM mechanical marking machine
• CompactLogix controller (1769-L24ER QB1B controller in this example)
• Ethernet cable
• Studio 5000 Logix Designer (Version 32.02.00 in this example)

M_Ethernet IP_C 5
Communication configuration
3. Add HMS module in the EDS Studio 5000 Library

Click on “TOOLS/EDS Hardware Installation


Tool”:

A new window appears.


Click on “Next”:

Select “Register an EDS file(s)” and click on


“Suivant”:

M_Ethernet IP_C 6
Communication configuration

Select the EDS file (you can find the EDS file
in the support folder) and click on “Suivant”:

Check if the file is OK and click on “Suivant”:

Change the icon if you want and click on


“Suivant”:

M_Ethernet IP_C 7
Communication configuration

Confirm by clicking on “Suivant”:

Finish the operation by clicking on


“Terminer”:

M_Ethernet IP_C 8
Communication configuration
4. Programming PLC configuration

Right click “Ethernet” in the “Controller


Organizer” and click on “New module…”:

Select the module “Anybus-CC EtherNet/IP


2-Port”.
It is possible to filter with “HMS Industrial
Networks AB”.
Click on “Create”:

M_Ethernet IP_C 9
Communication configuration

Now the module is added in the configuration and you must modify the settings. You can change the “Module
Name”.

In our example, we use:


- IP address “192.168.0.11” for the mechanical marking machine
- “192.168.0.12” for the laser marking machine.

Change the “Module Definition”. Click on “Change…” and apply these parameters:

Variables associated with the transmission and receipt of data are created in "Controller Tags":

M_Ethernet IP_C 10
Communication configuration
5. Programming the embedded ETHERNET/IP module

The IP address of the marking machine Ethernet/IP module can be configured via “Anybus IPconfig by HMS
Networks” software. You can find it in the support folder or you can follow this link:

https://www.anybus.com/support/file-doc-downloads/anybus-support-tools?orderCode=tools

With the XCOM, you can change directly in the marking machine in the screen “Settings / Communication /
Parameters: Fieldbus”. Read the marking machine manual for more explications.

In our example, we use:


- 192.168.0.11 for the mechanical marking machine,
- 192.168.0.12 for the laser marking machine.

6. Quick communication control

You can quickly check the right communication with the devices (see "Communication error ").

To communicate with the XCOM, switch it in “Controlled mode”.

M_Ethernet IP_C 11
E. Example PLC program

The example PLC program easily allows the integration of the communication function block for the marking
machine.

When the communication established with the marking machine and the function block parameters are OK,
you can prepare a marking file for the test in the marking machine. In this example, the file name is “TEST” in
Unicode transcription (see "Appendix 1 - Unicode Table"), without the extension name, in rung 4:

MP_ArrLD[0] = 84 = T

MP_ArrLD[1] = 69 = E

MP_ArrLD[2] = 83 = S

MP_ArrLD[3] = 84 = T

MP_CycleLD.LEN = number of characters = 4

You can change the call marking file parameters: one mark (rung 5) in normal mode (rung 6).

MP_ArrMarkingMode[0] = 78 = N

MP_ArrMarkingMode.LEN = number of characters = 1

M_Ethernet IP_C 12
Example PLC program
If you set at 1 the bit XX_PbStartCycle (XX = MP for mechanical or LAS for laser marking machine in our
example) in rung 3, the PLC call the marking file with the precedent parameters and start automatically when
the machine is ready and without fault.

If you get a communication fault (bit XX_CycleFault stay at 1 in rung 0) after a wrong request to the machine
for example, you must send manually a new request (see after) to reset this fault and start a new cycle.

Between the rungs 10 to 15, you can send manually a request to the marking machine. No sequencing is in
this program part. It only depends on the PLC memories:

- Command start marking


- Command stop marking (must stay at 1 to mark, remove the “Shunt” bit if necessary)
- Command acknowledge fault;
- Command load marking file (LD function), the parameters are depending on function block inputs
(see "Parameters"), automatically reset to send a front edge;
- Command load variable (VS function), the parameters are depending on function block inputs
(see "Parameters"), automatically reset to send a front edge;
- Command read variable (VG function), the parameters are depending on function block inputs
(see "Parameters"), automatically reset to send a front edge;

M_Ethernet IP_C 13
Example PLC program

Finally, the last rung 16, is the function block calling (see "Function block"):

M_Ethernet IP_C 14
F. Function block

The function block is suitable for


mechanical or laser marking machine.
The integrator must synchronise before
the sequencing of the requests, no control
did it inside, and each request are sent at
the front edge of the demands.

M_Ethernet IP_C 15
Function block
1. Inputs

Name Type Description

HmsCompactComO Ethernet/IP data send to the marking machine


HmsCompactComI Ethernet/IP data receive from marking machine
iLaserOrXcom INT Type of machine marking (10=Laser or 20=XCOM)
xCmdStartMarking BOOL Command start marking
xCmdStopMarking BOOL Command stop marking (must be at true)
xCmdAckFault BOOL Command acknowledge marking machine fault
sLd STRING Name of marking file for LD function
diNumberMarking DINT Marking number for LD function (0 to 2 147 483 647)
sMarkingMode STRING Marking mode for LD function
xCmdLd BOOL Load marking file request
sVs STRING Value to set in the variable for VS function
iNumberVs INT Variable number for VS function (0 to 9)
xCmdVs BOOL Load variable value request
iNumberVg INT Variable number for VG function (0 to 9)
xCmdVg BOOL Get variable value request

2. Outputs

Name Type Description

xConnectionFaulted BOOL Connection problem with marking machine


xMachineFault BOOL Marking machine with error
xEstopOk BOOL Marking machine emergency stop OK (OK if true)
xUCAlive BOOL UC alive
xMachineInitOk BOOL Marking machine initialized
xMarkingReady BOOL Marking ready
xMarkingPaused BOOL Marking in pause
xMarkingInProgress BOOL Marking in progress
xHeartBeat BOOL Heart beat (1Hz) (only for XCOM)
xMachineReady BOOL Marking machine ready (only for laser)
xShutterState BOOL Shutter state (only for laser)
xLaserEmission BOOL Laser emission (only for laser)
xLdOk BOOL Front edge request load marking file OK
xVsOk BOOL Front edge request load variable value OK
xVgOk BOOL Front edge request get variable value OK
sValueVg STRING Value of the variable after VG function
iTriggerReceive INT Trigger received from marking machine (from 1 to 255)
iErrorMachine INT Machine error number
sErrorCommunication STRING Error communication return by the marking machine
iErrorParam INT Bloc function parameters error

M_Ethernet IP_C 16
Function block
3. Parameters

If the exchange data (HmsCompactComI/HmsCompactComO) and the PLC communication configuration


with the marking machine are completed, the output xConnectionFaulted change to 0. The value of
HmsCompactComI and HmsCompactComO is the device name with “:I” for the inputs and “:O” for the outputs.

• iLaserOrXcom: must equal at 10 for the laser marking machine or 20 for the mechanical marking machine

• xPbStartMarking: the start marking is not reset automatically. The integrator must do it if he receives the
marking progress signal, for example. In this way, he can activate continuously the marking for debugging
for example.

• xPbStopMarking: the stop marking must stay at 1 to mark.

• xPbAckFault: acknowledge fault demand.

M_Ethernet IP_C 17
Function block

To call a marking file name in the marking machine, the file name must set in the string variable sLd (UTF-8
format, is similar with ASCII characters) without the name extension.

For example, sLd=’TEST’ for the marking file name “TEST.tml” for the XCOM and “TEST.t2l” for the laser. The
number of marking diNumberMarking must be between 1 to 2 147 483 647. String value of the marking mode
sMarkingMode must be:
- N = normal

When these parameters are completed, the bit xCmdLd can be set at 1. The frame is sent at the front edge
and the integrator must reset this demand to send a new one. When the request completed, the confirmation
xLdOk stay at 1 for one PLC scan (front edge).

To set a value in a variable in the marking machine, the value must set in the string variable sVs. For example,
sVs=’ValueVar’ in this program example. The number of variable iNumberVs must be between 0 to 9. When
these parameters are completed, the bit xCmdVs can be set at 1. The frame is sent at the front edge and the
integrator must reset this demand to send a new one. When the request completed, the confirmation xVsOk
stay at 1 for one PLC scan (front edge). You can check the trigger iTriggerReceive to confirm the new data
sent if you write two different variables.

To read a value in a variable in the marking machine, the number of variable to be read iNumberVg must be
between 0 to 9. When this parameter is completed, the bit xCmdVg can be set at 1. The frame is sent at the
front edge and the integrator must reset this demand to send a new one. When the request completed, the
confirmation xVgOk stay at 1 for one PLC scan (front edge), and the value read is copied in sValueVg and stay
until a new frame receipted from the marking machine. You can check the trigger iTriggerReceive to confirm
the new data received if you read two different variables.

If the function block parameters are complete, then iErrorParam equal 0. This information is set bit by bit,
with that you can get different faults at the same time:

- Bit 0: control if the marking machine type (iLaserOrXcom) is equal at 10 or 20

The sErrorCommunication give back a diagnosis if the last frame is not compatible with the marking file. For
example, if the operator wants to load a marking file but this one does not exist in the marking machine, the
frame received is ‘ER 1 5’ (see the specific documentation to know explanation of the error codes).

It is different if the marking file get a fault. With the H.E.L.P. code, the function block gives back the value
iErrorMachine, without the letter (for example, 114 = P114 PLEASE REBOOT for laser, see the service manual
of the machine).

M_Ethernet IP_C 18
Function block
To know the marking machine states, it sends some bits in live (see the specific documentation to know
explanation of the error codes):

- xMachineFault: stay at 1 if the marking machine get an error. You can diagnosis with the iErrorMachine
value (see laser manual to get more information)
- xEstopOk: stay at 1 if the emergency stop is OK
- xUCAlive: stay at 1 if the marking machine is alive
- xMachineInitOk: stay at 1 if the marking machine initialisation is OK
- xMarkingReady: stay at 1 if the marking machine is ready to mark
- xMarkingPaused: stay at 1 if the marking machine is in pause mode
- xMarkingInProgress: stay at 1 if the marking is in progress
- xHeartBeat: toggle every second (1Hz) to confirm no freezing marking machine (only use for mechanical
machine)
- xMachineReady: stay at 1 if the machine is ready (different with marking ready)
- xShutterState: stay at 1 if the shutter is open (only use for laser machine)
- xLaserEmission: stay at 1 if the marking machine emits laser (only use for laser machine)

4. Local constants

Name Value Type Description

sCsteVSEspace1 'VS 1' STRING Constant characters 'VS 1'


sCsteVSEspace 'VS ' STRING Constant characters 'VS '
sCsteVGEspace 'VG ' STRING Constant characters 'VG '
sCsteSS 'SS' STRING Constant characters 'SS'
sCsteSP 'SP' STRING Constant characters 'SP'
sCsteS 'S' STRING Constant characters 'S'
sCsteN 'N' STRING Constant characters 'N'
sCsteLDEspace1 'LD 1' STRING Constant characters 'LD 1'
sCsteLDEspaceGuill 'LD "' STRING Constant characters 'LD "'
sCsteEREspace 'ER ' STRING Constant characters 'ER '
sCsteA 'A' STRING Constant characters 'A'
sCstePointTML '.tml' STRING Constant characters '.tml'
sCstePointT2L '.t2l' STRING Constant characters '.t2l'
sCsteDollarR '$r' STRING Constant characters '$R'
sCsteGuillDollarR '"$r' STRING Constant characters '"$R'
sCsteGuillEspace '" ' STRING Constant characters '" '
sCsteEspaceGuill ' "' STRING Constant characters ' "'
sCsteEspace '' STRING Constant characters ' '
sCsteNull '' STRING Constant characters ''

At the import of this function block, these data are automatically set. The integrator can change it later, but if
the values of the local constants are not equal like that, the function block does not work.

M_Ethernet IP_C 19
Function block
5. Code description

The function block is not locked or protected. In this way, the integrator can modify anything. Therefore, in this
case, there will be no technical support. If the integrator wants to delete functions, we advise to remove the
tags with unused rungs.

„ Introduce

At the beginning, the function block set the constant character at null. This rung is important to be sure to reset
the request before sending a new one for example:

The function block check if the marking machine does not communicate with the PLC, to block the outputs (and
do not give a wrong indication) like “Machine fault”, “Emergency stop”, LD request, etc…

At the first PLC scan or if the marking machine does not communicate with the PLC, the function block reset
different variables and frames to work correctly when the communication come back:

M_Ethernet IP_C 20
Function block
„ Inputs

The function block check if the inputs data is correctly set (from rungs 3 to 4) before to use it. It will block the
LD request if the machine is different to 10 or 20 (laser or mechanical machine) for example

From rungs 5 to 15, the digital data received from the marking machine are copied to the function block
outputs. If the communication is not working, the data are automatically reset. It is for that, just the “Emergency
stop” is depending the bit xConnectionFaulted. All digital communication outputs are copied (mechanical and
laser), without regard the parameter marking machine type iLaserOrXcom.

When the marking machine trigger changes, the function block copies the frame in a buffer for the latest
treatment (control data received if request before, errors, etc…).

M_Ethernet IP_C 21
Function block

The function block extracts the integer value of the error marking machine, without the letter. When the marking
machine does not give a message H.E.L.P, the value is 0.

To finish with the fault’s diagnosis, the function block extracts from the buffer, the string value of the
communication error with the marking machine if the first characters are “ER ”.

After a reading value (VG function) for example, if the value is “ER A BC”, you get an
error! The function block reads only the three first characters “ER ” and the fifth “ ”like
a communication error.

This error can be reset with the acknowledge fault command to resend a new request and check the machine
response.

M_Ethernet IP_C 22
Function block
„ Functions

• LD function (load marking file)

Does it at the front edge. The function block constructs the frame like “LD ‘marking file name’.’ t2l for laser or
tml mechanical machine’ ‘number of marking’ ‘mode’” depending the inputs function block parameters. When
the frame is ready, the data are copied in the output frame and the trigger incremented.

M_Ethernet IP_C 23
Function block
If the frame received is “LD 1”, the function block set the output xLdOk stay at 1 for one PLC scan (front edge).

After a reading value (VG function) for example, if the value is “LD 1”, you can get the
LD validation while it is just a VG function.

• VS function (write a value in a variable)

Does it at the front edge. The function block constructs the frame like “VS ‘variable number’ ‘value’” depending
the inputs function block parameters. When the frame is ready, the data are copied in the output frame and
the trigger incremented.

M_Ethernet IP_C 24
Function block
If the frame received is “VS 1”, the function block set the output xVsOk stay at 1 for one PLC scan (front edge).

After a reading value (VG function) for example, if the value is “VS 1”, you can get the
VS validation while it is just a VG function.

• VG function (read a value in a variable)

Does it at the front edge. The function block constructs the frame like “VG ‘variable number’” depending the
input function block parameter. When the frame is ready, the data are copied in the output frame and the
trigger incremented.

M_Ethernet IP_C 25
Function block

When the frame is sent to the marking machine, the last trigger received is memorized. When the function
block gets a new one (different with the last one and no communication error), the output xVgOk is set for one
PLC scan (front edge), and the data read is set and reset with a new frame received (a new trigger).

„ Outputs

The marking machine commands are copied one by one in the digital outputs frame if no communication fault
with the marking machine.

M_Ethernet IP_C 26
G. Troubleshooting analysis

In this chapter, we will try to give you different possibilities about troubleshooting. If you find another one,
please email it to us at : technical@support.gravotech.com. We will add it in this documentation.

1. Communication error

To verify the correct communication between the


marking machine and the PLC, you can open
RSLinx and go online. When the communication
is established, the symbol must be grey without
red cross:

If not, the symbol is with a red cross:

Or a yellow ‘?’ if the EDS file is not installed in


Studio 5000:

M_Ethernet IP_C 27
Troubleshooting analysis

You can:

• Uninstall the HMS EDS file in Studio 5000 and reinstall the file from this package.
• Verify each step in the “PROGRAMMING PLC CONFIGURATION” chapter (module reference, IO device
structure, IP address, etc…) (See "Programming PLC configuration").
• Check hardware with the LEDs on the module:

NS MS Comments

Off No power or no IP address connection


with PLC: verify IP address and MS
LED
Green blinking Online and connection with PLC not
established
Green Online and connection with PLC
established
Red Duplicate IP address, FATAL error
Red blinking One or more connections timed out
Off No power: contact the support
Green Controlled by a Scanner in run mode
Green blinking Not configured, or Scanner in Idle
state
Red Major fault: contact the support
Red Blinking Recoverable fault: contact the support

• Create a new empty program, without code and only with the communication configuration about the
marking machine. You can test with the example program too and change the CPU version like yours.
• Verify if the XCOM is in “Controlled mode”. Read the marking machine manual for more explications. Not
need for the laser.
• Verify if you get a changing state about the bit emergency stop for example. And if the bit stop marking
(from PLC to marking machine) is true (must be always at true and false if you want to stop the marking
machine).
• Verify each character in the request and the IO, not the buffer data before to send to the device.
• Two tables are prepared to read the variables value (marking machine IO, function bloc exchanges and
automatic cycle states) and facilitate the diagnosis if you get an error:

M_Ethernet IP_C 28
Troubleshooting analysis

• When you send a request to the marking machine, all bytes after the $R (0D) must be null.

With the XCOM device, you can verify if the module is


correctly identified by the marking machine. Go on home
page and click on “Settings”:

Click on “Communication”:

M_Ethernet IP_C 29
Troubleshooting analysis

You must see the icon “Parameters: Fieldbus”. If not,


please contact the support.

If these propositions do not solve your issue, please contact the support.

M_Ethernet IP_C 30
H. Appendix
1. Appendix 1 - Unicode Table

Unicode and ASCII table are the same from 0 to 127 (decimal).

DEC HEX ASCII DEC HEX ASCII DEC HEX ASCII DEC HEX ASCII

0 0 NUL 32 20 64 40 @ 96 60 `
1 1 SOH 33 21 ! 65 41 A 97 61 a
2 2 STX 34 22 " 66 42 B 98 62 b
3 3 ETX 35 23 # 67 43 C 99 63 c
4 4 EOT 36 24 $ 68 44 D 100 64 d
5 5 ENQ 37 25 % 69 45 E 101 65 e
6 6 ACK 38 26 & 70 46 F 102 66 f
7 7 BEL 39 27 ' 71 47 G 103 67 g
8 8 BS 40 28 ( 72 48 H 104 68 h
9 9 HT 41 29 ) 73 49 I 105 69 i
10 0A LF 42 2A * 74 4A J 106 6A j
11 0B VT 43 2B + 75 4B K 107 6B k
12 0C FF 44 2C , 76 4C L 108 6C l
13 0D CR 45 2D - 77 4D M 109 6D m
14 0E SO 46 2E . 78 4E N 110 6E n
15 0F SI 47 2F / 79 4F O 111 6F o
16 10 DLE 48 30 0 80 50 P 112 70 p
17 11 DC1 49 31 1 81 51 Q 113 71 q
18 12 DC2 50 32 2 82 52 R 114 72 r
19 13 DC3 51 33 3 83 53 S 115 73 s
20 14 DC4 52 34 4 84 54 T 116 74 t
21 15 NAK 53 35 5 85 55 U 117 75 u
22 16 SYN 54 36 6 86 56 V 118 76 v
23 17 ETB 55 37 7 87 57 W 119 77 w
24 18 CAN 56 38 8 88 58 X 120 78 x
25 19 EM 57 39 9 89 59 Y 121 79 y
26 1A SUB 58 3A : 90 5A Z 122 7A z
27 1B ESC 59 3B ; 91 5B [ 123 7B {
28 1C FS 60 3C < 92 5C \ 124 7C |
29 1D GS 61 3D = 93 5D ] 125 7D }
30 1E RS 62 3E > 94 5E ^ 126 7E ~
31 1F US 63 3F ? 95 5F _ 127 7F

M_Ethernet IP_C 31

Вам также может понравиться