Omron CJ1W-ETN21 manual

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242

Ir para a página of

Bom manual de uso

As regras impõem ao revendedor a obrigação de fornecer ao comprador o manual com o produto Omron CJ1W-ETN21. A falta de manual ou informações incorretas fornecidas ao consumidor são a base de uma queixa por não conformidade do produto com o contrato. De acordo com a lei, pode anexar o manual em uma outra forma de que em papel, o que é frequentemente utilizado, anexando uma forma gráfica ou manual electrónicoOmron CJ1W-ETN21 vídeos instrutivos para os usuários. A condição é uma forma legível e compreensível.

O que é a instrução?

A palavra vem do latim "Instructio" ou instruir. Portanto, no manual Omron CJ1W-ETN21 você pode encontrar uma descrição das fases do processo. O objetivo do manual é instruir, facilitar o arranque, a utilização do equipamento ou a execução de determinadas tarefas. O manual é uma coleção de informações sobre o objeto / serviço, um guia.

Infelizmente, pequenos usuários tomam o tempo para ler o manual Omron CJ1W-ETN21, e um bom manual não só permite conhecer uma série de funcionalidades adicionais do dispositivo, mas evita a formação da maioria das falhas.

Então, o que deve conter o manual perfeito?

Primeiro, o manual Omron CJ1W-ETN21 deve conte:
- dados técnicos do dispositivo Omron CJ1W-ETN21
- nome do fabricante e ano de fabricação do dispositivo Omron CJ1W-ETN21
- instruções de utilização, regulação e manutenção do dispositivo Omron CJ1W-ETN21
- sinais de segurança e certificados que comprovam a conformidade com as normas pertinentes

Por que você não ler manuais?

Normalmente, isso é devido à falta de tempo e à certeza quanto à funcionalidade específica do dispositivo adquirido. Infelizmente, a mesma ligação e o arranque Omron CJ1W-ETN21 não são suficientes. O manual contém uma série de orientações sobre funcionalidades específicas, a segurança, os métodos de manutenção (mesmo sobre produtos que devem ser usados), possíveis defeitos Omron CJ1W-ETN21 e formas de resolver problemas comuns durante o uso. No final, no manual podemos encontrar as coordenadas do serviço Omron na ausência da eficácia das soluções propostas. Atualmente, muito apreciados são manuais na forma de animações interessantes e vídeos de instrução que de uma forma melhor do que o o folheto falam ao usuário. Este tipo de manual é a chance que o usuário percorrer todo o vídeo instrutivo, sem ignorar especificações e descrições técnicas complicadas Omron CJ1W-ETN21, como para a versão papel.

Por que ler manuais?

Primeiro de tudo, contem a resposta sobre a construção, as possibilidades do dispositivo Omron CJ1W-ETN21, uso dos acessórios individuais e uma gama de informações para desfrutar plenamente todos os recursos e facilidades.

Após a compra bem sucedida de um equipamento / dispositivo, é bom ter um momento para se familiarizar com cada parte do manual Omron CJ1W-ETN21. Atualmente, são cuidadosamente preparados e traduzidos para sejam não só compreensíveis para os usuários, mas para cumprir a sua função básica de informação

Índice do manual

  • Página 1

    OPERA TION MANUAL Ethernet Units Construction of Applications SYSMAC CS and CJ Series CS1W -ETN21 (100Base-TX) CJ1W -ETN21 (100Base-TX) Cat. No. W421-E1-03[...]

  • Página 2

    CS1W-ETN21 (100Base-TX) CJ1W-ETN21 (100Base-TX) Ethernet Units Construction of Applications Operation Manual Revised Novembe r 2005[...]

  • Página 3

    v Notice: OMRON products are manufactured for use acc ording to proper procedu res by a qualifi ed ope rator and only f or the pur pos es desc ribe d in th is manual. The following conventions are us ed to indicate and cla ssify precaution s in this manual. A lwa ys heed the informat ion provided wi th them. F ailur e to heed preca utions can resul[...]

  • Página 4

    vi[...]

  • Página 5

    vii TABLE OF CONTENTS PRECAUTION S . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xxi 1 Intended Aud ience . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xxii 2 General Precautions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .[...]

  • Página 6

    viii TABLE OF CONTENTS SECTION 4 FTP Server . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 67 4-1 Ove rview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 68 4-2 FTP Server Function Details . . . . . . . . . . . . . . . . . . . . . . . [...]

  • Página 7

    ix TABLE OF CONTENTS Appendices A Ethernet Network Parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 195 B Buf fer Conf iguration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 197 C TCP Status T ransitions . . . . . . . . . . . .[...]

  • Página 8

    x TABLE OF CONTENTS[...]

  • Página 9

    xi About this Manual: This ma nual descr ibes the operation of th e CS1W-ETN21 and CJ1W-ETN21 Ethe rn et Units (1 00Base- TX) for constr ucting a pplicati ons and i ncludes the sec tions descr ibed be low . Please rea d this manual c arefully and be sure you unders tand the infor mation provided before attempt ing to ins tall or operate the E ther [...]

  • Página 10

    xii Relevant Manuals The following table lists CS- and CJ-s erie s manuals that co ntain infor mation relev ant to Eth er net Un its. Man ual numbe r Model Nam e Contents W420 CS1 W -ETN21 CJ1W -ETN 21 Ethernet Units O per- atio n Manu al Cons tr uc tio n of Net- wor ks Provi des inf ormation on op erating and insta lling 100Base -TX Ethernet Units[...]

  • Página 11

    xiii W394 CS1 G/H-CPU @@ H CS1G/H-CPU- @@ V1 CJ1G/H-CPU @@ H CJ1G-CPU @@ Progr ammab le Con- trollers Prog ram- ming Ma nual Describes pr ogramm ing, tasks, file memory , and other function s for the CS -series and CJ-series PLCs. Use toget her with the Programmab le Controll ers Opera- tion Man ual (W339 f or CS-series PL Cs and W393 f or CJ- ser [...]

  • Página 12

    xiv[...]

  • Página 13

    xv Read and Understa nd this Manual Please read and u ndersta nd this ma nual before using the produc t. Pleas e consu lt your OMRON represent ative if you hav e any questi ons or comm ents. Warranty and L imitation s of Liability WARRANTY OMRON's exclusive warranty is tha t the prod ucts a re free fro m defects in m ater ials and workma nship[...]

  • Página 14

    xvi Application Considerations SUITABILITY FOR USE OMRON shall no t be re sponsible for conformi ty with any s tandards, c odes, or reg ulations tha t apply to the combina tion of products in th e custome r's appl ication or use of the pr oducts. At the cu stomer 's reque st, OMRON wil l provide a pplicable thi rd par ty cer tificati on d[...]

  • Página 15

    xvii Disclaimers CHANGE IN SPECIFICATIONS Produc t specif ications and acc essor ies m a y be changed at any time based on im prov emen ts and other reasons. It is our pra ctice to change model numbe rs when p ublished ratings or features are c hanged, or when signifi cant con stru ction ch anges are made. Howev er , some s pecific ation s of th e [...]

  • Página 16

    xviii[...]

  • Página 17

    xix Unit Versions o f CS/CJ-series Unit V ersions A “unit version” has been introd uced to mana ge Units in the CS/ CJ Seri es accord ing to differences in functiona lity accom panying Unit upgrades. Notation of Unit V ersions on Pr oducts The unit version is gi v en to the r ight of the lot number on the namepl ate of the product s for which u[...]

  • Página 18

    xx Using Unit V er sion Label The following unit version label is provid ed with the Ether net Unit. This label can be attac hed to th e front of the E ther net Unit to differentiate between Ether ne t Units with different unit versions. Unit V ersion Notation In this manual , the unit version of a Eth er net Unit i s given as shown in the fol- low[...]

  • Página 19

    xxi PRECA UTIONS This section pro vides general precaution s for using the CS1W -ETN21 and CJ1W -ETN21 Ethernet Units (100B ase-TX). The information contained in this s ection is impo rtant for the safe and reliable a pplication o f Ethernet Units. Y o u must read this section an d understand the information cont ained bef ore attem pting to set up[...]

  • Página 20

    xxii Intend ed A udien ce 1 1 Intende d A udience This manual is intend ed for the f ollowing person nel, who must als o have knowledge of electr ic al syst ems (an electr ical engine er or the equivalent). • P ers onnel in char ge of ins talling F A systems. • P e rsonnel in ch arge of de sign ing F A sy stems. • P e rsonnel in ch arge of m [...]

  • Página 21

    xxiii Safety Precaution s 3 !WARNING Provide s afety measures in extern al cir cuits (i .e., not in the Pro grammable Controll er), includ ing the following item s, to ensure safety in the system if an abnor ma lity oc curs du e to ma lfunctio n of the PLC or another external factor affecting the PLC o peration. Not doing so may result in se riou s[...]

  • Página 22

    xxiv Operating En vironment Precautions 4 4 Operating En vironment Precautions !Caution Do not operate the c ontrol s ystem i n the following locations : • Loc ation s subje ct to direc t sunligh t. • Loc ation s subj ect to tempe ratures o r humid ity o utside t he range speci fied in the specifi catio ns. • Loc ation s subje ct to conde nsa[...]

  • Página 23

    xxv Application Precaut ions 5 • Al wa ys use the power suppl y v o ltages spe cifie d in the operation manuals. An in correct voltage may result in malfun ction or bur ning. • T ake appro pr iate meas ures to ensure that the specif ied power wit h the rated voltage and frequenc y is s upplied. Be par ticula rly c arefu l in plac es where the p[...]

  • Página 24

    xxvi Conf ormance to EC Direct ives 6 • Wh en transpo r tin g the Un it, use s pecia l packing box es a nd protec t it f rom being exposed to excessive vibration or i mpact s dur ing tran spor ta tion. • CP U Bus Uni ts will be res tar te d when routing tables are transferred fro m a Programming Device to the CPU Unit. Restar ting thes e Units [...]

  • Página 25

    1 SECTION 1 Intr oduction This section introduces the fun ctions and protocols used in Ethernet Uni t communications services. 1-1 Ethernet Unit Communications Services . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2 1-2 Functions Listed by Purpose . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2 1-3 T able of[...]

  • Página 26

    2 Etherne t Unit Commun ications Servi ces Section 1-1 1-1 Ethernet U nit Communications Serv ices Note When tran sferring d ata thro ugh the inter net, a glo bal IP a ddress must be acquired for the Et her net Unit. 1-2 Functions Listed by Purpose Service Main func tions Counterpart dev ice Reference Mail s end function Through intranet or interne[...]

  • Página 27

    3 T able of Protocols Section 1-3 Note Any one of the following conditi ons can be specifie d to send e-m ail automa ti- call y: A per iodic time r times o ut, the Ma il Send S witch is tur ned fr om OFF to ON, a specifi ed word contai ns a par ticular v alue, a spec ifie d bit tu r ns fr om OF F to ON, the CP U Unit 's operat ing mode chang e[...]

  • Página 28

    4 Common Pr otocol Settings Section 1-4 1-4 Common Protocol Settings 1-4-1 SMTP The SMTP ser ver settin gs must be made in order to use the Mail S end Fun c- ti on or Mail Recei ve Funct ion. Mail R eceive Fu nct ion SMTP Requ ired SMTP SECTION 3 Recei ve Ma il Function POP Requi red PO P DNS When sp ecifying the SMTP server an d POP server b y hos[...]

  • Página 29

    5 Common Pr otocol Settings Section 1-4 Note The “PO P before SMTP” is a n authen tication function r equire d when sen ding mail (u sing t he SMTP ser ver). Nor ma lly , ac count na me and p assword authen- tication is perfor med w ith the PO P se r v e r because there is n't an au thentica- tion p rocess i n the S MTP ser v er . Most ISP[...]

  • Página 30

    6 Common Pr otocol Settings Section 1-4 1-4-3 DNS The DNS ser ver's sett ings must be e ntered wh en the PO P3 ser ver , SMTP ser ver , and SN TP ser ver are spec ified with host name s. Item Contents Default Server spe cification type Select whe ther the POP3 serv er used f or receivi ng mail is to be spe cified b y IP address or the host&apo[...]

  • Página 31

    7 Common Pr otocol Settings Section 1-4 The DNS ser ver manage s the IP address es and host nam es of the nodes tha t communica te in th e networ k. The Ether net U nit automat ically acquire s each ser ver's IP addres s from the DNS ser ver and uses those ac quired IP address es. Item Contents Default IP Address Set the IP address f or the DN[...]

  • Página 32

    8 Common Pr otocol Settings Section 1-4[...]

  • Página 33

    9 SECTION 2 Mail Send Function This section pro vides an o vervie w and describes ho w to use the Ethernet Unit’ s Mail Send Fu nction, including application examples and troubleshooting inf ormation. 2-1 Mail Send Function Overvie w . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10 2-1-1 Introduction. . . . . . . . . . .[...]

  • Página 34

    10 Mail Send Function Ov erview Section 2-1 2-1 Mail Send Funct ion Over view 2-1-1 Intr oduction The Mail Send F uncti on sends an e-mail from th e Ethernet Un it to a spec ified e-mail address when a predeter mi ned cond ition o ccurs in the PL C . Data in t he CPU Unit's I/O memor y areas (or any file in the M emor y Card) ca n be sent as a[...]

  • Página 35

    11 Mail Send F unction Details Section 2-2 ■ Attached Files An I/O m emor y data file crea ted automati cally by the Ether n et Unit (a spec i- fied range of the CPU Uni t's I/O memor y data converte d to a .I OM, .TXT , or .CSV file ) or any file in fil e memor y (in the CPU Uni t's Memor y Card) can be sent a s an attac hed file. ■ [...]

  • Página 36

    12 Mail Send F unction Details Section 2-2 2-2-1 Contents of E-mail Bod y Date and time Ethernet Unit's e-mail address Destination e-mail address Title (depends on trigger condition) Content-Type (fixed) Trigger number (required) Trigger information (required) Ethernet Unit model (required) Unit version (required) Ethernet Unit IP address (req[...]

  • Página 37

    13 Mail Send F unction Details Section 2-2 2-2-2 Contents of E-mail Body Ethernet Unit 's Status Information Header The following header i nforma tion is i ncluded. • Subject: OMRON Ethernet Unit Mail Service (Indicates trigger condition. See note.) • Content-Type: text/plain;charset=US-ASCII • Content-Transfer-Encoding:7bit Note The fol[...]

  • Página 38

    14 Mail Send F unction Details Section 2-2 Note Another sentence wil l be attached indicating how the spe cified word's value has ch anged: “Cha nnel da ta has chang ed from XX to XX. ” Ethernet Unit Information The Eth er net Unit inform ation is alwa ys include d in the e-mail . • Model • V ersion • IP address (deci mal notati on) [...]

  • Página 39

    15 Mail Send F unction Details Section 2-2 ■ Erro r Log Information The error l og informat ion inc ludes al l of the data store d in the E ther net Un it's error log . The erro r log can contai n up to 64 r ecords. For details on th e error log, refer to 8-3 Er ror Log in the Operatio n Manual Co nstr uctio n of N etwor ks (W420). ■ Statu[...]

  • Página 40

    16 Mail Send F unction Details Section 2-2 • Si nce the Ethe r net Unit c reates the data file autom atica lly , the Accessin g Memor y/S endin g Mai l Flag ( bit 01 of n+ 17 in the all ocated C PU Bu s Uni t Area) wil l be ON wh ile th e CPU Unit's I/O memo r y is being ac cessed . • T o mai ntain the inte grity of the data, wr ite-p rote[...]

  • Página 41

    17 Mail Send F unction Spec ifications Section 2-3 2-3 Mail Send Funct ion Sp ecifications 2-3-1 Function Specifications Item Specific ations Desti nation e-mail addre ss Up to 2 addresses ca n be regis tered in t he Unit Setu p (CPU Bus Unit System Setup) and the addre sses can b e up to 50 characters long. Subject Fix ed te xt (Depends on the tri[...]

  • Página 42

    18 Using th e Mail Send Functi on Section 2-4 2-3-2 Detail s of the A vail able Mail T rigger s 2-4 Using the Mail Send F unction 2-4-1 Pr ocedure Note The Et her net Un it will be r estar t ed when the settin gs data is trans f erred to th e CPU Bus Un it Syste m Setup Area, s o that the new settings are r ead an d Classification T rigger type Use[...]

  • Página 43

    19 Using th e Mail Send Functi on Section 2-4 become e ff e ctive. V er ify that it is sa f e for the Eth er net Uni t to re star t before transferring th e settings d ata. 2-4-2 Settings Requir ed for the Mail Send Functio n The f oll owing Unit setting s must be made when using the Mai l Send Func tion. CX- Pr ogrammer Unit Setup Ta b Setting Set[...]

  • Página 44

    20 Using th e Mail Send Functi on Section 2-4 Note (1) Mak e POP sett ings when the Use POP be f ore SMTP Optio n was selec t- ed in the SMTP Ta b . (2) M ake D NS set tings when th e Ser v er s pecificati on typ e is set to Host name in th e SMTP or POP Ta b . Send Mail (Send mail conditi ons 1 to 8) T rigger type On e type mu st be sel ected. •[...]

  • Página 45

    21 Using th e Mail Send Functi on Section 2-4 2-4-3 Mail Ad dress Set up to 2 desti nation mail add resses. 2-4-4 Send Mail Set the following sett ings for send ma il condi tions 1 to 8. When a se nd mail cond ition or multip le conditi ons are met, the correspon ding e-mail (s) will be sent au tomatic ally . Item Contents Default Mail ad dress 1 S[...]

  • Página 46

    22 Using th e Mail Send Functi on Section 2-4 Send Mail Condit ion Settings Mail Address Specif ication (Required) Data Sent b y Mail (When Required) ■ Data Se nt in E-mail Body Select wh ether th e user-se t ASCII infor mation , Ether net Unit's er ror lo g, and/ or Ether ne t Unit's s tatus infor matio n will be sent in the e-ma il bo[...]

  • Página 47

    23 Using th e Mail Send Functi on Section 2-4 ■ Attached File Name Send Mail T rigger T ype Setting (Required) Specifi es the typ e send mail cond ition that will be us ed by the Ether net Un it to automa tically send e- mail. When the Mail Send Funct ion is not be ing use d, dis able the s end mail upo n trig ger sett ing. Note The same tr igg e[...]

  • Página 48

    24 Mail Send F unction Status Section 2-5 Note The Area and Address s etting ranges are a s follows: CIO Area: 0 to 6143 ; Work Area: W 000 to W5 11; Hold ing A rea: H000 t o H511; Auxiliar y Area: A 000 to A4 47; Timer PV s: T0 000 to T4095 ; Counter PVs: C000 0 to C409 5; DM Area : D00000 t o D32767; EM Area : 0 to 32767 i n each bank Interval Ti[...]

  • Página 49

    25 Mail Send F unction Status Section 2-5 ■ Send Mail Statu s 2 The transmi ssion status of each send conditio n is indicate d by the conte nt of the co rrespondi ng 3 b its in S end Mail Status 1 or S end Mail Status 2, as sh own in t he foll owi n g t abl e. 0: OFF , 1: O N While m ail is bein g sent, the status of the three bit s for the send [...]

  • Página 50

    26 I/O Memory Data F ormats Section 2-6 ■ Accessin g Memory /Sendin g Mail Flag (Bit 01 of n+1 7) When a data file ( IOM, TXT , or CSV) is being atta ched to the e-ma il, the Ether ne t Unit will access the CPU U nit's I/O m emor y and a utomati cally c reate the data file when the e-mail is being sent. T he Acces sing Memor y/Sending Mail F[...]

  • Página 51

    27 Attac hed F ile T ransfer T imes Section 2-7 Note The TXT file f orma t is compatible with the CPU Unit's READ D A T A FILE and WRITE DA T A FILE in stru ction s (FRE AD and FW RIT) se t to tab-del imite d word format w ith a c arria ge ret ur n ev er y 10 words. CSV Format When hexadecimal I/O memor y data (1234, 5678 , 9ABC, etc.) is bein[...]

  • Página 52

    28 Mail Send Fun ction Errors Section 2-8 ■ Access T imes for CS1 and CJ1 CP U Units ■ Access T imes for CS1-H and CJ1- H CPU Units Note (1) The a ccess times for file data indicate Memor y Card acc ess time s. (2) T he acces s times i n the table above are standard ti mes when th e PLC Setup's “ Fixed P eriphera l Ser vic ing Ti me” s[...]

  • Página 53

    29 Mail Send Fun ction Errors Section 2-8 2-8-2 T roub leshootin g Mail Send Err ors with LED Indi cator s Note F or m ore detai ls on the e rror log, ref er t o 8-3 Er ror Log in th e Operation Man- ual Const ruc tion of Networks ( W420). 2-8-3 Error Log Err or C odes for the Mail Send Function When an error occurs while the Ether ne t Unit is ope[...]

  • Página 54

    30 Example Application Section 2-9 Note F or m ore detai ls on the e rror log, ref er t o 8-3 Er ror Log in th e Operation Man- ual Const ruc tion of Networks ( W420). 2-9 Example Application 2-9-1 Step 1. Create the I/O T ab le Mount the Et her net Unit in the CPU Rack or Expansion Rack, connect onl ine with the CX -Programmer or Programmin g Cons[...]

  • Página 55

    31 Example Application Section 2-9 2. Desti nation Mail Ad dress Setup 3. Send Condition Setting 1 Contents of E-mail Body • Includi ng User-s et Data in E -mail Body • Inc ludi ng Erro r Log Infor matio n in E-m ail B ody • Inc ludi ng Statu s Informa tion in E-ma il Body Attached File Information Ex ample: Sending th e 10 words of da ta fro[...]

  • Página 56

    32 Example Application Section 2-9 Exampl e: Send e- mail when W300 bit 00 g oes from OFF to O N. • Se nd when an Event is Recor ded in the Ether ne t Unit's Er ror Log • Se nd when there is a Change i n the CP U Unit's St atus • Se nd E-mai ls per iodic ally at Fixed Inter vals Exampl e: Send an e-mail every 10 minutes. 2-9-3 S tep[...]

  • Página 57

    33 SECTION 3 Receive Mail Function This section des cribes ho w to use the Ethernet Unit’ s Mail Receive Fun ction, including specifications, status details, I/O memory data formats, file transfer timing, application examples, and troubleshooting informatio n. 3-1 Mail Recei ve Function Ov erview . . . . . . . . . . . . . . . . . . . . . . . . . [...]

  • Página 58

    34 Mail Rec eive Functio n Overview Section 3-1 3-1 Mail Receive Function Over view 3-1-1 Intr oduction The mai l rece ive function p erforms the following func tions u sing e- mails sent to the Ethe r net U nit. 1,2,3. .. 1. The user can enter a command in the e- mail and send that e- mail to the Ether ne t Unit. 2. A command writte n in the e-m a[...]

  • Página 59

    35 Mail Rec eive Functio n Overview Section 3-1 ■ Remote Mail Commands Enter the re mote comm and (for e xample, FileRe ad) in ASCI I in the e-mail subjec t line. ■ Command P arameters Enter the p arameters (for e xam ple, P ara1:Overwrite= OK) in ASC II in the e- mail bod y . ■ Attached File Dat a With rem ote wr ite com mands, a singl e fil[...]

  • Página 60

    36 Mail Rec eive Fun cti on Sp ecif ica tion s Section 3-2 3-2 Mail Receive Function Specificatio ns 3-2-1 Function Specifications Received E- mail File me mory opera- tions P erforming f ile oper ations on a Memor y Card in the CPU Unit or EM fil e memor y A file ca n be attac hed to read/ write data in a ny file i n EM file memory or a Memory Car[...]

  • Página 61

    37 Mail Rec eive Fun cti on Sp ecif ica tion s Section 3-2 Response E-mail Attached file Data f or mat • IOM Write c ommand: Writes an I/O m emor y data fi le (IOM, TXT , or CSV) to the CPU Unit. • File W ri te comm and : Any t ype of fil e (a file with a ny filena me e xtension) can be written to EM file memo r y or a Memor y Card mounted in t[...]

  • Página 62

    38 Using the Mai l Receiv e Function Section 3-3 3-3 Using the Mail Re ceive Function 3-3-1 Pr ocedure Note The Et her net Un it will be r estar t ed when the settin gs data is trans f erred to th e CPU Bus Un it Syste m Setup Area, s o that the new settings are r ead an d become e ff e ctive. V er ify that it is sa f e for the Eth er net Uni t to [...]

  • Página 63

    39 Using the Mai l Receiv e Function Section 3-3 3-3-2 S ettings Required f or the Mail Receive Function The following Unit setti ngs must b e made when u sing the Mail Rec eive Func- tion. Note Make DNS settin gs when t he Ser ver spec ificatio n type is s et to Host na me in the SM TP or POP Ta b . CX-Pr ogrammer Unit Setup T ab Setting Setti ng [...]

  • Página 64

    40 Using the Mai l Receive Function Section 3-3 3-3-3 Receive Mail T ab The CPU Bus Unit setting s f or the mai l receive function c an be set in the CX- Programmer's CPU Bus Unit Setup Win dow . P osting Mail Address Pr otection Setting Item Contents Defau lt Protect us ing mail address Select t his option whe n you d o not wa nt to receiv e [...]

  • Página 65

    41 Using the Mai l Receiv e Function Section 3-3 Rece ive A ttac hed F ile Settin g Receive Command Setting Item Content s Default Rece ive file with specif ied e xtension only Select t his option whe n you d o not wa nt to receiv e at tached files other than the specifi ed file types (filen ame e xtensions). Multiple exte n- sions c an be selec te[...]

  • Página 66

    42 Remote Mail Com mand Details Section 3-4 3-4 Remote Mail Com mand Details 3-4-1 Format Command Format Response Format MailLo gClear Select w hen you want to ex ecute the Mail Log Clear com mand. Selected T est Select when y ou w ant to e x ecute the Mail T e st co mmand . Selected FinsSend Select when you want to ex ecute the FINS Comm and Send [...]

  • Página 67

    43 Remote Mail Com mand Details Section 3-4 FileWrite (File W rite) Function Writes the attac hed file to the CPU Unit's EM file me mor y or a Memor y Card mounted i n the CPU Uni t. Command Format Response Format Subject: FileW rite Notation De scr iption Om issi on Body: Para1: Destination folder name Example ) Specify ing subdirec tor y OMR[...]

  • Página 68

    44 Remote Mail Com mand Details Section 3-4 FileRead (File Read) Function Reads any file from the CPU Uni t's EM file me mor y or a Mem or y Card mounted i n the CPU Uni t and retu r ns the file as an at tachme nt. Command Format Response Format Subject: FileR ead Not atio n Desc ri ption Omiss ion Body: Para1: Source folder name Example ) Spe[...]

  • Página 69

    45 Remote Mail Com mand Details Section 3-4 FileDelete (File Dele te) Function Deletes the sp ecified file fro m the CPU Unit's EM file memor y or a Memory Card mounted in the CPU Unit. Command Format Response Format Subject: FileD elete Not atio n Desc ri ption Omiss ion Body: Para1: Folder name Example ) Specify ing subdirec tor y OMR ON in [...]

  • Página 70

    46 Remote Mail Com mand Details Section 3-4 FileList (File List Read) Function Retur ns a list of the fil es cont ained in t he spe cified folder in the CP U Unit's EM file memor y or a Mem or y Card mounted in the CPU Unit. Command Format Response Format Details Subject: FileL ist Not atio n Desc ri ption Omiss ion Body: Para1: Source folder [...]

  • Página 71

    47 Remote Mail Com mand Details Section 3-4 UMBackup (User Memory Backup) Function Back s up (sav es) the CPU Unit's user program in the CPU Unit's EM file memor y o r a Memor y Card mounted i n the CPU Un it. Command Format Details Response Format Subject: UMBac kup Not atio n Desc ri ption Omiss ion Body: Para1: Destination folder name [...]

  • Página 72

    48 Remote Mail Com mand Details Section 3-4 P A RAMBackup (P arameter Are a Bac kup) Function Bac ks up (sa v es) the para meter area da ta in the CPU Uni t's EM file memo ry or a Memor y Card mounted in the CPU Unit. Command Format Response Format Subject: PARAM Backup Not atio n Desc ri ption Omiss ion Body: Para1: Destination folder name Ex[...]

  • Página 73

    49 Remote Mail Com mand Details Section 3-4 IOMWrite (I/O Memory Write) Function Writes the contents of the attach ed file to the spe cified data area in the CPU Unit's I/O me mor y . The data is wr itte n in word units. Command Format Subject: IOMWrite Notation Description Omission Body: Para1: File format Example) Specifying a file of comma-[...]

  • Página 74

    50 Remote Mail Com mand Details Section 3-4 Response Format Attach ed f ile: Yes Attach an I/O dat a file (IOM, CSV , or TXT f or mat). Note Up to 6,000 words can be writ ten from the data file. Attach a file with 6,000 or fe wer words of data. Note Only a file with t he IOM, CSV , or TXT can be written to I/O memory . Files with an y other file- n[...]

  • Página 75

    51 Remote Mail Com mand Details Section 3-4 IOMRead (I/O Memor y Read) Function Reads the conte nts of the spe cified rang e of words from th e CPU Unit's I/O memor y and retur ns the data in an attach ed file. The data is read in word units. Command Format Subject: IOMRead Notation Description Omission Body: Para1: File format Example) Specif[...]

  • Página 76

    52 Remote Mail Com mand Details Section 3-4 Response Format Para4: File name Example) Specifying MEMORY .TXT: Para4:MEMORY.TXT Specifies the nam e of the file (including the file- name extension) in which the read data will be stored. Note Only filename e xtensions IOM, CSV , and TXT can be used. Other filename e xten- sions cannot be specified. No[...]

  • Página 77

    53 Remote Mail Com mand Details Section 3-4 ChangeMode (Operating Mod e Change) Function Changes th e CPU Unit's operating mod e. Command Format Response Format Subject: Chang eMode Not atio n Desc ri ption Omiss ion Body: Para1:RUN (or MON or P RG) Example ) Chan gin g to RUN mode : Para1:RUN Change s the CPU Unit's oper ating mode . •[...]

  • Página 78

    54 Remote Mail Com mand Details Section 3-4 Err orLogRead (Error Log Read) Function Reads the entir e error log fr om the CPU Uni t or a specifie d Spec ial Unit (CP U Bus U nit or Spec ial I/ O Unit ). Command Format Response Format Subject: Error LogRead Not atio n Desc ri ption Omiss ion Body: Para1: Unit address Example ) Specify ing a CPU B us[...]

  • Página 79

    55 Remote Mail Com mand Details Section 3-4 Err orLogClear (Error Log Clear) Function Clears the enti re error log fr om the CPU Uni t or a specifie d Speci al Unit (CP U Bus U nit or Spec ial I/ O Unit ). Command Format Response Format Subject: Error LogClear Not atio n Desc ri ption Omiss ion Body: Para1: Unit address Example ) Specify ing a CPU [...]

  • Página 80

    56 Remote Mail Com mand Details Section 3-4 MailLogRead (Mail Log Read) Function Reads the mail log, which c ontains in f or mation on mail rec eived b y the Et her- net Unit. (T he mail log c ontain s basic in f or mation on all of the ma il recei v e d since p ower was tur ned ON or the ma il log was cleared.) Command Format Response Format Subje[...]

  • Página 81

    57 Remote Mail Com mand Details Section 3-4 MailLogClear (Mail Log Clear) Function Clears the mai l log, which c ontains in f or m ation on mai l received by the Ether- net Unit. Command Format Response Format Subject: MailL ogClear Not atio n Desc ri ption Omiss ion Body: None --- --- Attached file: None Subject: Re:Ma ilLogClear Resp onse conten [...]

  • Página 82

    58 Remote Mail Com mand Details Section 3-4 T est (Mail T est) Function P e rf or ms an e-ma il send/ receive test with the Ether net Unit. When thi s remote mail comm and is ex ecut ed, the Ether net Unit retu r ns a response to the ad dress that se nt the rem ote mail c omman d. Command Format Response Format Subject: Test Not atio n Desc ri ptio[...]

  • Página 83

    59 Remote Mail Com mand Details Section 3-4 FinsSend (FINS Command Send) Function Requests ex ecution o f the s pecified FINS co mmand by the Ether ne t Unit. Command Format Response Format 3-4-2 Response L ist Subject: FinsS end Not atio n Desc ri ption Omiss ion Body: Para1: FINS header Example ) Specify ing DNA=01, D A1=02, and D A2=00: Para1:01[...]

  • Página 84

    60 Mail Rece ive Fu nction Status Section 3-5 3-5 Mail Receive Function Status 3-5-1 Accessing Memory/Receiving Mail Flag The Ac cessin g Memo r y/Rec eiving M ail Fl ag is loc ated i n CIO Ar ea words allocat ed to the Ether ne t Unit as a CPU Bu s Unit. The lead ing add ress (n) of the allo cated C IO area i s deter m ined by the E ther- net Unit[...]

  • Página 85

    61 I/O Memory Data F ormats Section 3-6 TXT Format When hexadecimal I/O memo r y data (1234 , 5678, 9AB C , etc.) is being co pied to an at tached fil e in TXT f or mat, the data is conver ted to A SCII in one-word fields or two -word fields. The fiel ds (one- word or two-word) a re delim ited by tabs ([HT]: 09 ) and a retur n an d line feed ([CR][[...]

  • Página 86

    62 Attac hed F ile T ransfer T imes Section 3-7 3-7 Attached File T r ansfer Times When se nding an attach ed file with the Mail Rece ive Function, the ac cess time ca n be as long as 30 or 40 minute s f or a ver y larg e file. The f o llowing tables show how long the CPU Un it's memor y will be a ccessed by the Ether- net Unit ( how long the [...]

  • Página 87

    63 Mail Receiv e Function Errors Section 3-8 3-8 Mail Receive Function Err ors 3-8-1 Identifying and Correcting Mail Receive Function Error s The following table shows the pr imar y cau ses of e-ma il transmi ssion e rrors and cor respond ing so lution . 3-8-2 T roub leshootin g Mail Receive Err ors with LED Indicators Note F or m ore detai ls on t[...]

  • Página 88

    64 Mail Receiv e Function Errors Section 3-8 3-8-3 Error Log Codes Related to the Mai l Receive Function If an error o ccurs whi le the Ether ne t Unit is operating, the main er ror code, detailed error code, and t ime stamp will be recorde d in th e error l og. The con tents o f the erro r log ca n be read by sending a F INS comm and to th e Ether[...]

  • Página 89

    65 Example Application Section 3-9 3-9 Example Application 3-9-1 Step 1. Create the I/O T ab le Mount the Et her net Unit in the CPU Rack or Expansion Rack, connect onl ine with the CX -Programmer or Programmin g Cons ole, and cre ate the I /O table. 3-9-2 Step 2. Make the Unit Setup Settings fr om the CX-Pr ogrammer With the CX-Pr ogrammer con nec[...]

  • Página 90

    66 Example Application Section 3-9 3-9-3 S tep 3. T ransfer the CPU Bus Unit Setup Sett ings Select T ran sfer to PL C from the Opt ions Me nu and click the Ye s Bu tton. The settings will be transferred to the CPU Bus Unit Setup Ar ea in the CP U Unit. 3-9-4 S tep 4. Send Remote Mail Commands Send e- mails c ontaining remote m ail comm ands t o th[...]

  • Página 91

    67 SECTION 4 FTP Server This section describes the f unctions provided by the FTP server . 4-1 Ove rview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 68 4-1-1 Specif ications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 68 4-2 FTP Server Function Det[...]

  • Página 92

    68 Overview Section 4-1 4-1 Over view The Ether net Unit has a built-in FT P (File T ransf e r Protocol) ser ver function, so other co mputer s on the Ether net c an read or wr ite (up load/download) large files in the EM fi le memor y b y ex ecuti ng FTP commands from the F TP cl ient software. Note Only o ne FTP cl ient c an co nnect at th e same[...]

  • Página 93

    69 FTP Serv er Function Details Sect ion 4-2 4-2 FTP Se rver Fu nction Details 4-2-1 File T ypes The file system in th e CPU Uni t that can be a ccesse d by the Ether net Uni t include s file s in any Memor y Card mounted in the CPU Uni t and fil es in the EM file memor y . The d irector y tree i s shown below . A connec tion w ill be i nitially ma[...]

  • Página 94

    70 Using the FTP Serv er Function Section 4-3 • If a log in name is not set or co ntains il legal characters, the d efault login name, CONFID ENTIAL, must be use d. No pa ssword is requir ed and any password that is set wil l be igno red. FTP File T ransfer Mode FTP has two fi le transfer modes: ASCI I mode an d binar y mo de. Before star t- ing [...]

  • Página 95

    71 Using the FTP S erver Functi on Section 4-3 become e ff e ctive. V er i fy that it is sa f e for the Eth er net Unit to re star t before transferring th e settings d ata. 4-3-2 List of Settings Req uired for the FTP Ser ver Function Make the f o llowing setti ngs for the unit s etup when t he ser ver func tion is u sed. 4-3-3 S etup T ab The CP [...]

  • Página 96

    72 FTP Serv er Application Example Section 4-4 4-4 FTP Ser ver Application Exampl e The following proced ure show s how to use t he FTP ser ver by conne ction wit h the default login name, CONFIDE NTIAL. No passw o rd is req uired. Note The lo gin n ame an d a p assw ord must be set in th e CPU Bus Se tup for the Ether ne t Unit in the CPU Unit to [...]

  • Página 97

    73 Using FTP Commands Section 4-5 4-5 Using FTP Com mands This sec tion des cri bes t he FTP c ommands which the host c omput er (FTP client) can sen d to the Ether net Unit’ s F TP ser ver . The des cr iption s sh ould also apply to most UNIX wor kstati ons, b u t slight differences may arise. Refer to your wor kstation ’ s operation m anuals [...]

  • Página 98

    74 Using FTP Commands Section 4-5 user Format user [ user_name ] Function Specifi es the u ser nam e. Speci fy the FTP log in na me se t in the Ether net Unit system setup. The default FTP lo gin nam e is “CON FIDENT IAL. ” If a non-de f ault l ogin name i s used, it must be f oll owed b y the p assword. In this case, ente r the FTP password se[...]

  • Página 99

    75 Using FTP Commands Section 4-5 mkdir Format mkdir DIRECTORY_NAME Function Creates a dire ctor y of the spec ified name at the remote host (Memor y Card or EM Fil e Memo r y). An err or will occ ur if a fi le or di rector y of the sam e name already ex ist s in the worki ng director y . rmdir Format rmdir DIRECTORY_NAME Function Deletes the dir e[...]

  • Página 100

    76 Using FTP Commands Section 4-5 type Format type data_type Function Specifi es the fil e data type. The following data t ypes are s uppor ted: ascii: Files ar e transferred as A SCII data binar y ( image) : Files ar e transferred as binar y data. All fil es are t reated by the P LC as binar y fi les. Before reading or wr iting any files, always u[...]

  • Página 101

    77 Using FTP Commands Section 4-5 Any e xis ting file with th e same name in th e remote h ost ( Memor y Ca rd or E M File Memo r y) will be overwritte n by the conten ts of th e transferred file. If a n erro r oc curs du ring fi le tr ansf er , th e file bein g tr ansf err ed wil l be d eleted and the tra nsmiss ion of tha t file will en d in an e[...]

  • Página 102

    78 Using FTP Commands Section 4-5 4-5-3 Error Messa ges and FTP Status Error Mess ages The error messages r etur ned by the Ethe rn et Unit ar e listed in the f o llowing tabl e. Messag e Mea ning PPP is a d irectory . The path name indic ated at PPP is a directory . PPP is not a directory . The path name indic ated at PPP is no t a direct or y . A[...]

  • Página 103

    79 Checking FTP Status Section 4-6 PPP: P ath na me XXX: IP add ress YY : P or t numb er MM: FINS error code NN: Sock et error code 4-6 Checking FTP Status 4-6-1 FTP Status Fl ag The curre nt status of the FTP ser ver can be ob tained from the ser vice status in the words al located to the Ether net Unit in the CPU Bus Unit Area in th e CIO Area . [...]

  • Página 104

    80 Usin g File Memo ry Section 4-7 4-7 Using File Memo ry The re are t wo me dia th at can b e used to stor e file s in me mory f or CS/CJ - serie s PLCs: •M e m o r y C a r d s • EM File Memory 4-7-1 File Memor y 4-7-2 File T ypes ■ File Names Files are dis tingu ished by assigning fil e names and e xtens ions. The following characters can b[...]

  • Página 105

    81 Using F ile Memory Section 4-7 File Names Handled by CPU Unit The fil es desc rib ed in the following table can b e rea d or wr itten by the CPU Unit. Note 1. Refer to informat ion on file me mor y in the CS/CJ-ser ies P rogrammable Controll ers Operation Manual (W339). 2. A ll fil es tr ansf erred au toma tically at sta r tup m ust ha v e the n[...]

  • Página 106

    82 Usin g File Memo ry Section 4-7 4-7-3 Initializing File Memory 4-7-4 I/O Memory Data Format ■ IOM Format The IOM for mat is a data for mat us ed for binar y da ta speci fied by the lad der instr uct ions, READ DA T A FILE (F READ(700 )) and WRIT E D A T A FILE (FWRIT(701)) , in the CP U Unit. If five w ords of data from the I/O mem or y (1234 [...]

  • Página 107

    83 Using F ile Memory Section 4-7 ■ CSV Format The CSV form at is a da ta format (using com ma deli miters ) that is spec ified by ladder instr uctions, RE AD D A T A F ILE (FR EAD(700 )) and WR ITE DA T A FILE (FWRIT(70 1)), in the CP U Unit. The CSV format i s confi gured ac cordin g to the spec ified FREAD(700 ) and FW RIT(70 1) parameters, as[...]

  • Página 108

    84 Usin g File Memo ry Section 4-7 Note FREAD(700 ) wi ll not be able to r ead the las t byte in a file that ha s been wr itten to the Memor y Card if the fil e contain s an odd number of bytes. Add 00 hexa- decimal to the end of the file if necessa r y to wr ite an e ven number of bytes to the Memor y Card. Note The UM and DM Areas contain b inar [...]

  • Página 109

    85 FTP F ile Tr ansfer T ime Section 4-8 4-8 FTP File T ransfer Time File trans f ers using F TP can requir e 30 or 40 m inutes depe nding on the capaci ty of the fil e. Appro xim ate file transf e r time are provid ed in the following table for refere nce. All tim es ar e in sec onds u nless o therwise spec ified. ■ CS1 CPU Units/ CJ1 CPU Units [...]

  • Página 110

    86 UNIX Application Exam ple Section 4-9 4-9 UNIX Application Examp le The following proced ure provides an example of FT P operation s from a UNIX works tation. In t his example, the following as sumpt ions are made. • T he IP add ress of the Et her net Un it is r egister ed in /etc /hosts o n the workst ation as [cs1]. • T he default FTP log [...]

  • Página 111

    87 UNIX Application Exampl e Section 4-9 4. Change to th e MEM CARD direc tor y . 5. Change data type t o binar y . 6. T ransf er the file RES UL T .IOM t o the work station . 7. Wri te the f ile PLAN .IOM to the Memor y Card. 8. End FT P . Change to MEMCARD directory . Binary data type set. File read. File written FTP ended.[...]

  • Página 112

    88 UNIX Application Exam ple Section 4-9[...]

  • Página 113

    89 SECTION 5 A utomatic Clock Adjustment Function This section provides an ov erview of the automatic clock adjustment functi on, including details on specifications, required settin gs, operations fr om CX-Programmer , and troubl eshooting. 5-1 Ove rview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . [...]

  • Página 114

    90 Overview Section 5-1 5-1 Over view 5-1-1 Overvie w The Ether net Uni t can obtain the clock inf o r mation from the SNTP ser ver (see note 1) at a par t icular time or when a designa ted bit tur ns O N and then refresh the in ter nal clock informati on of the CPU Unit to which it is mounted (ref erred t o as the local CPU Unit). Note (1) T he SN[...]

  • Página 115

    91 Using the A utomatic Cloc k Adjustment Funct ion Section 5-2 5-1-2 Specifi cations 5-2 Using the A utom atic Clock Adjustme nt Funct ion 5-2-1 Pr ocedure Item S pec ific at ion Protocol SNTP P or t number 123 ( UDP) Can also be set fro m the CX-Progr ammer in the Unit Setup . Adjustm ent timing Autom atic (fix ed tim e) and man ual (manu al only[...]

  • Página 116

    92 Using the A utomatic Cloc k Adjustment Funct ion Section 5-2 5-2-2 S ettings Required f or A utomatic Cloc k Adjustment Function The following settings must be set in the Unit Se tup when us ing the aut omatic clock adjustm ent func tion. Note When the S er ver spec ificatio n type fiel d in Auto Adjust Tim e T ab is set to Hos t name . CX- Prog[...]

  • Página 117

    93 Using the A utomatic Cloc k Adjustment Fun ction Section 5-2 5-2-3 A uto Ad just Time The cont ents in the CP U Bus Unit S ystem Set up that ar e set f or using mail send and rece ive functions are shown in the CX-Programmer ’ s Unit Set up. Item Contents Defaul t Get the time infor mat ion f rom the SNTP ser ver Enab le to set the CPU Unit&ap[...]

  • Página 118

    94 A utomatic Cloc k Adjustment Switch Section 5-3 5-3 A utomatic C loc k Adju stment Switch The Automati c Clock Adjust ment Swi tch is allocat ed in th e CIO Are a as shown below . The first wo rd n of the CIO Area is calcula ted u sing the follow- ing eq uation. n = CIO 1 500 + (25 × unit numb er) A utomatic Cloc k Adjustment S witch (Bit 04 of[...]

  • Página 119

    95 A utomatic Cloc k Adjustment Error Proc essing Section 5-4 Note F or d etails on other erro r log informa tion, r efer to the Oper ati on Man ual , Con - str uctio n of Networ ks: SE CTION 8 T roubleshooting . 5-4-3 Error Log Err or Codes for the A utomatic Cloc k Adjustment Function When an error occurs while the Ether ne t Unit is operati ng, [...]

  • Página 120

    96 A utomatic Cloc k Adjustment Error Proc essing Section 5-4 Note (1) For details on other error log informati on, refer to the Operatio n Manual, Constru ction of Ne tworks : SECTION 8 T r oubleshooting . (2) An error will oc cur in t he f ollo wing CPU Un its when t he aut omati c cloc k adjustme nt functio n is ex ecuted under the co nditions s[...]

  • Página 121

    97 SECTION 6 Sock et Ser vi ces This section describes th e functionality provided by the Ethernet Unit via the so cket services. 6-1 Overvie w of Socket C ommunications from Ethernet Units . . . . . . . . . . . . . . 99 6-1-1 What are Sock ets? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 99 6-1-2 Socket Port Numb [...]

  • Página 122

    98 6-8 Using Sock et Services with CMND(490) . . . . . . . . . . . . . . . . . . . . . . . . . . . . 136 6-8-1 Using Sock et Service . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 136 6-8-2 Socket Services an d Socket Status . . . . . . . . . . . . . . . . . . . . . . . . . . 137 6-8-3 Basic FINS Command F ormat . . . . . .[...]

  • Página 123

    99 Overview of Soc k et Communications from Ethernet Units Section 6-1 6-1 Overv iew of Soc ket Communications from Ethernet Unit s 6-1-1 What are Soc kets? Sockets are interfaces that allow TC P and UD P protoc ols to be u sed di rectly from the u ser program. W ith person al co mputers, socket are provided as C language i nterface librar ies, whi[...]

  • Página 124

    100 Protocol Ov erview Section 6-2 6-2 Pr otocol Ove rview 6-2-1 Differences between TCP and UDP There ar e differences in the sock et ser vices between TCP and UDP . ■ TCP Communication s The following proc edure i s followed each tim e data is trans mitted to ens ure that the dat a arr ives nor mally at the remote no de: 1,2,3. .. 1. The remote[...]

  • Página 125

    101 Protocol Overview Section 6-2 ■ P as sive OPE N and A ctive OPEN An open comm and is ex ecuted for a node to establish a connec tion. The ope n method d iffers dependi ng on wh ether the node is a client or s er ver . A pass ive open method i s used to open the node as a s er ver and the active open method is used to open the node as a clie n[...]

  • Página 126

    102 Protocol Ov erview Section 6-2 6-2-3 Fragmentation of Send Data The Ether n et Unit fragmen ts data for TCP tran smissi on into uni ts of 1,02 4 bytes and dat a for UDP transmissio n into units of 1,472 b ytes. T CP requ ires one rec eption r equest to recei ve each unit of da ta. UDP , howe v er , r estores th e ori ginal dat a before pass ing[...]

  • Página 127

    103 Overview Section 6-3 3. Data A and Data B a re sent conse cutively . 4. When t he receivi ng user p rogram sends a r equest to receive 1,984 bytes of data, Da ta A a nd Data B are l inked to resto re the or igi nal data, which is passed to the user program. As shown ab ov e, the UDP protoc ol handles data com munication s as datagrams, so t hat[...]

  • Página 128

    104 Overview Section 6-3 The two meth ods of using the socket serv ices a re as follows: • Ded icated Contr ol Bits (Socket Ser vice Re quest S witch es) Requests can be made to a s ock et s er vice by setting pa rameters an d then mere ly mani pulating s pecific Socket Ser vice Re quest Sw itches. • CMND(490) Requests can be made to a sock et [...]

  • Página 129

    105 Overview Section 6-3 reception, data is rec eived to the s end/rec eive data add resses set in the parameter ar ea. 6-3-3 Using Sock et Services with CMND(490) Ser vic e request comman ds can be sent to the Ethe r net Unit by ex ecuting th e CMND(490) instr uctio n in th e ladder diagram. CS/CJ Ether ne t Units su ppor t the same fun ctionali t[...]

  • Página 130

    106 Sock et Serv ice Fu nctio n Guid e Section 6-4 6-3-5 Differences with Pre vious Models Compared with t he socket ser vice function s of previous models (CS1W- ETN01/11 and CJ1 W -ETN11 Et her net Uni ts), th e Number of Bytes Rec eived at the T CP Socket that s tores the size of received data accumula ted in the reception buffer and a related D[...]

  • Página 131

    107 Using Soc k et Service Fu nctions Section 6-5 6-5 Using Socket Service Function s 6-5-1 Pr ocedure 6-5-2 Settings Required for Soc ket Service Function The following settings must be made in the Unit Setup when using so ck et ser- vice s. 1. Mak e the basic settings . Ref er to SECTION 2 Startup Proce dure in the Operation Manua l Con str ucti [...]

  • Página 132

    108 Using Sock et Service Functions Section 6-5 6-5-3 S etup T ab The CPU B us Unit S yste m Setup, which is set when us ing socket ser v ices, is shown in t he CX-Programm er's Unit Se tup Window . . ■ Setup Item Details Default v alue Broadcas t Set the metho d for s pecifying IP address when broadcasting with FINS/UDP . • All 1 (4.3BS D[...]

  • Página 133

    109 Using Soc k et Service Fu nctions Section 6-5 IP Rou ter T able Set when the Ethe r net Unit will commun i- cate with nodes in oth er IP netwo rk seg- ments v ia an IP router . None TCP/IP k eep-aliv e Set the liv eness c hecki ng interval (keep- aliv e). When using FINS /TCP or TCP/IP soc ket se r vices , if the remo te node (server or client)[...]

  • Página 134

    110 Sock et Serv ice S tatu s Section 6-6 6-6 Socket Service Status 6-6-1 CIO Area Allocations The following CIO Area wo rds are a lloca ted in th e CPU B us Unit Area in the CIO Area star ting at word n+ 1. The value of n can be ca lcula ted from the uni t num ber as f ollo ws : Begin ning word n = CIO 150 0 + ( 25 x unit number) ■ UDP/TCP Socke[...]

  • Página 135

    111 Socket Service Stat us Section 6-6 6-6-2 DM Area Allocations The following DM Area words are al located in the CPU Bus Unit A rea in the DM Area. The begi nning word m is cal culated by the f oll owing equat ion. Beginni ng word m = D30000 + (100 x unit number ) ■ Number of Bytes Rece ived at T CP Socket (Ether net Unit t o CPU Unit) The numb[...]

  • Página 136

    112 Using Sock et Services by Mani pulating Dedic ated Control Bits Section 6-7 Up to 4, 096 bytes of da ta are stored in the recepti on buff er , but the value stored i s within the range ( maximum: 1,9 84 bytes) that ca n be set by manipu- lati ng th e contr ol bi ts or se nding t he re ceiv e req uest in the CM ND(490 ) instr u ction . 0000 hexa[...]

  • Página 137

    113 Using Sock et Services by Mani pulating Dedicated Control Bit s Section 6-7 2. T ur n ON the Socket Ser vice Re quest S witches in the CPU Bu s Unit A rea in th e CIO Ar ea. 3. When a send or r eceive reques t is made, the data wi ll be au tomatic ally sent or re ceived accordin g to the sen d/recei v e da ta address in the So c ket Ser vic e P[...]

  • Página 138

    114 Using Sock et Services by Mani pulating Dedic ated Control Bits Section 6-7 Check TCP Connection/UDP Open Flag. The specified UDP sock et is already open. T ur n ON UDP Open Request Switch. Star t UDP Open. OFF? Program Flo w Is Bit 15 (Open Flag) in the sock et status word f or the sock et being used OFF? (Checks to see if the soc ket is open [...]

  • Página 139

    115 Using Sock et Services by Mani pulating Dedicated Control Bit s Section 6-7 6-7-3 Socket Servic e Par ameters The Socket Ser vice Parameter Areas in which pa rameters are set to req uest socket ser vices are in the CPU B us Un it Area in th e DM Are a of the C PU Uni t. The So ck et Ser vice P arame ter Areas are alloca ted as shown i n the f o[...]

  • Página 140

    116 Using Sock et Services by Mani pulating Dedic ated Control Bits Section 6-7 P arameter Settings The following table shows the pa rameters that a re requi red for each se r vic e and the us e of the parameter s by the socket ser vice. UDP Socket Serv ices Note W: Wr itten by user R W: Wr itten by user at ex ecution an d then r ead for results a [...]

  • Página 141

    117 Using Sock et Services by Mani pulating Dedicated Control Bit s Section 6-7 R: Read by us er f or results at co mpletion ---: Not used. 6-7-4 P arameter s ■ Socket Opt ion F or the TCP OP EN REQUES T (ACTIVE or P ASS IVE) com mand, s pecifies whether o r not the keep- alive function is to be used. Whe n the keep-al ive function is used , bit [...]

  • Página 142

    118 Using Sock et Services by Mani pulating Dedic ated Control Bits Section 6-7 If the R emote IP A ddress is set to 0, a conne ction can be m ade to a ny remot e node and the remot e IP address of the node that is connected wil l be stored as the R emote I P Add ress in the So ck et Ser vice P arame ter Area. If a s pecific remote I/O addres s is [...]

  • Página 143

    119 Using Sock et Services by Mani pulating Dedicated Control Bit s Section 6-7 6-7-5 Socket Service Request Switc hes Dedicated contr ol bits c an be man ipula ted to reque st socket ser v ices. Thes e bits are called S ocket Serv ice Reque st Swi tches, and a re tur ned ON in the CPU Unit to request sock et ser v ices th rough the Ether net Uni t[...]

  • Página 144

    120 Using Sock et Services by Mani pulating Dedic ated Control Bits Section 6-7 As shown in the ab ov e table, the R equest S witche s are tur ned OFF by the Ether ne t Unit when t he req uested pr ocesse s has be en com pleted. Note There is a lso a Socket F orce-cl ose Switc h in bit 2 of the firs t word alloca ted to the Ether net Unit in th e C[...]

  • Página 145

    121 Using Sock et Services by Mani pulating Dedicated Control Bit s Section 6-7 UDP Socket Send Request UDP Socket Close Re quest 1103 The b it number i n the Send/R eceiv e Data Addres s is not 00 . 110C Request Switch turned ON during oth er processin g. 220F Speci fied soc ke t is already processing a receiv e reques t. 2210 The s pecified so ck[...]

  • Página 146

    122 Using Sock et Services by Mani pulating Dedic ated Control Bits Section 6-7 TCP So cket P assiv e Open Re quest Note The se respon se codes will be returned on ly on la rge, multi le v el netw orks. TCP Socket Ac tive Open Request Response code Meaning 0000 Normal end 0105 Loca l IP addres s setting erro r . 0302 CPU Un it error; cannot e x ecu[...]

  • Página 147

    123 Using Sock et Services by Mani pulating Dedicated Control Bit s Section 6-7 Note The se respon se codes will be returned on ly on la rge, multi le v el netw orks. TCP Socket Re ceive Re quest 000D Remote IP address p arameter error (EA CCES). 003E Internal b uffe r cannot be o btained due t o high recept ion traff ic (ENOBUFS). 0042 (See note .[...]

  • Página 148

    124 Using Sock et Services by Mani pulating Dedic ated Control Bits Section 6-7 Note The se respon se codes will be returned on ly on la rge, multi le v el netw orks. TCP Socke t Send Request Note The se respon se codes will be returned on ly on la rge, multi le v el netw orks. 004F (See note .) ICMP data receiv ed (EHOSTDO WN). 0051 (See note .) I[...]

  • Página 149

    125 Using Sock et Services by Mani pulating Dedicated Control Bit s Section 6-7 TCP Socket Clos e Reque st 6-7-7 Timing C harts The timin g of flags for sock et ser v ices (Open ing, Rec eiving, Se nding, or Clo s- ing Fla g) when the R eques t Switches ar e used and the cha nges in th e respons e code a re sh own in the following ch ar t. Closing [...]

  • Página 150

    126 Using Sock et Services by Mani pulating Dedic ated Control Bits Section 6-7 Close Request Switch The proce ssing res ults ar e stored as the re sponse c ode when th e Close Request Swi tch is use d. There will alwa ys be one PL C cycle ti me between tur ning O FF the Request S witch for the ca nceled p rocess and tur ning of the Close Req uest [...]

  • Página 151

    127 Using Sock et Services by Mani pulating Dedicated Control Bit s Section 6-7 Note The Open Fl ag will not tur n O N at all if a f o rce-close r equest is made dur ing open proces sing. 6-7-8 TCP/IP Communi cations Pr ogramming Example The f oll owing programming example il lustrates transferring 100 bytes of data between an E ther net Unit and a[...]

  • Página 152

    128 Using Sock et Services by Mani pulating Dedic ated Control Bits Section 6-7 Program Memor y Map The se nd and r eceive data and bits (flags ) used by th e program a re shown i n the following diagram. DM Area CIO Area Send data, 100 bytes (100 = 0064 He x) Receive data, 100 b ytes (100 = 0064 Hex) 7 6 54321 0 CIO 0000 CIO 0001 15 to 8 CIO 0002 [...]

  • Página 153

    129 Using Sock et Services by Mani pulating Dedicated Control Bit s Section 6-7 Pr ogramming Example When the TCP Closing Flag (CIO 000201) turns ON, the follo wing parameter is written to the parameter area for sock et number 1. D30018: 0001 Hex = UDP/TCP soc ket No . 1 TCP Close When the TCP Close Bit (CIO 000001) turns ON, the TCP Close Error Fl[...]

  • Página 154

    130 Using Sock et Services by Mani pulating Dedic ated Control Bits Section 6-7 TCP Receive If the Send Request Switch (CIO 151903) turns OFF while the TCP Sending Flag (CIO 000202) is OFF , the contents of the response code (D30027) in the Sock et Ser vice P a- rameter Area is check ed, and if it is not 0000 Hex (normal end), the TCP Send Error Fl[...]

  • Página 155

    131 Using Sock et Services by Mani pulating Dedicated Control Bit s Section 6-7 Note When usin g the above programming e xample, chan ge the bit and word address es as necessa r y to av oid using the sa me areas used by other par t s of the user pr ogram or the CPU Bus Un it. 6-7-9 UDP/IP Communi cations Pr ogramming Example The f oll owing program[...]

  • Página 156

    132 Using Sock et Services by Mani pulating Dedic ated Control Bits Section 6-7 Basic Oper ations • CIO 000000 is tur ned ON to req uest ope ning a UDP so ck et from the Ether ne t Unit. • CIO 00000 1 is tur ned O N to requ est closi ng the UDP sock et fro m the Ether ne t Unit. • CIO 00000 2 is tur ned ON to req uest sen ding d ata from th e[...]

  • Página 157

    133 Using Sock et Services by Mani pulating Dedicated Control Bit s Section 6-7 Pr ogramming Example If the Close Request Switch (CIO 151905) turns OFF while the UDP Opening Flag (CIO 000201) is OFF , the contents of the response code (D30027) in the Sock et Service Parameter Area is chec ked, and if it is not 0000 Hex (normal end), the UDP Close E[...]

  • Página 158

    134 Using Sock et Services by Mani pulating Dedic ated Control Bits Section 6-7 UDP Receive When the UDP Receive Bit (CIO 000003) turns ON, the UDP Receive Error Flag (CIO 000103) is turned OFF and the UDP Receiving Flag (CIO 000203) is turned ON to initialize processing. If the Send Request Switch (CIO 151903) turns OFF while the UDP Sending Flag [...]

  • Página 159

    135 Using Sock et Services by Mani pulating Dedicated Control Bit s Section 6-7 Note When usin g the above programming e xample, change the bit and word address es as necessa r y to av oid using the sa me areas used by other par ts of the user pr ogram or the CPU Bus Un it. MO V(21) 000003 000203 MO V(21) MO V(21) MO V(21) SET 000003 RSET 000203 SE[...]

  • Página 160

    136 Using Sock et Services with CMND(490) Section 6-8 6-8 Using Socket Services with CMND(490) 6-8-1 Using Socket Service Each Ether n et Unit has eight TCP sockets and eig ht UD P sockets. Open, close, send, and recei v e p rocesses are av aila ble f or com munications with sockets. Open Enables communi cations on a specif ied socket. A socket mus[...]

  • Página 161

    137 Using Sock et Services with CMND(490) Section 6-8 4. When th e process has bee n complet ed, the r esult is stored i n the resu lts storage a rea d efined i n the socket ser vic e reques t co mmand and th e sock- et st atus wi ll indi cate c omplet ion of pr ocessi ng. 6-8-2 Socket Services and Soc ket Status When usi ng socket ser vices, it is[...]

  • Página 162

    138 Using Sock et Services with CMND(490) Section 6-8 6-8-3 Basic FINS Command Format The basi c f or m at for FINS command s used for socket ser vices is s hown in the f oll owing diagram. Command Code: Specifi es the process code r equested from the socket. Socket Opt ion F or the TCP OP EN REQUES T (ACTIVE or P ASS IVE) com mand, s pecifies whet[...]

  • Página 163

    139 Using Sock et Services with CMND(490) Section 6-8 Note If there is more than one Communic ations Uni t mounted to th e PLC, the FINS network addres s must be s et as a param eter for CMND(490) and a loca l net- work ta ble must be created in the ro uting tables from the CX -Programmer . 6-8-4 Response C odes in the Command Respo nse A resp onse[...]

  • Página 164

    140 Using Sock et Services with CMND(490) Section 6-8 ■ CLOSE REQUEST ■ SEND REQUEST ■ RECEIVE REQUEST CLOSE REQUEST command received Error end CLOSE REQUEST command received Normal end Close complete (normal end) 1 0 1 0 1 0 Normal response code Running Running CMND(490) response code Close Flag Closing Flag Results storage area P or t Enabl[...]

  • Página 165

    141 Using Sock et Services with CMND(490) Section 6-8 ■ CLOSE REQUEST during RECEIVE REQUEST Note The tim ing shown in the above diagram occ urs if a CLOSE REQUEST c om- mand is ex ecuted duri ng SEND REQUEST co mmand ex ecuti on. The tim ing shown in the diagram also applie s if a CL OSE REQUE ST com mand is ex e- cuted dur ing OPEN REQUEST c om[...]

  • Página 166

    142 Using Sock et Services with CMND(490) Section 6-8 Data Flow The data wi ll flow between the C PU Unit, E ther net Un it, and hos t compu ter as shown in t he follo wi ng diagram. Note Here, “e xecution bits” re f er to CIO 000000 to CIO 000003, whi ch are us ed in the ladder di agram to control ex ecution of co mmunica tions an d are not sy[...]

  • Página 167

    143 Using Sock et Services with CMND(490) Section 6-8 Pr ogram Memory Maps The se nd an d receive data and b its (flags ) used by the pro gram are shown i n the follo wi ng diagrams. The f o llowing example shows how the memo r y maps are str uctu red. Legend DM Area 0012H 0004H 0001H 012 D0000 CMND(490) control data 00 7 6543210 CIO 0000 15 to 8 T[...]

  • Página 168

    144 Using Sock et Services with CMND(490) Section 6-8 Number bytes to receiv e: 4 bytes 000CH 0004H 0001H 0110H 0000H 0032H 0123456789 D00030 CMND(490) control data for TCP RECEIVE REQUEST Number of bytes receiv ed specified in command data. Number of TCP RECEIVE REQUEST command data bytes: 12 bytes (000C he x ) 2710H 0001H 8203H FC00H 1000H 0000H [...]

  • Página 169

    145 Using Sock et Services with CMND(490) Section 6-8 2713H 0001H 820BH C200H 0123456789 D02000 2714H 0123456789 D01040 D01050 0064H TCP CLOSE REQUEST response Re- sponse code TCP CLOSE REQUEST results storage area TCP SEND REQUEST command data Send data: 100 bytes (0064 he x ) Command code TCP sock et number Results storage area: set to D03010 (0B[...]

  • Página 170

    146 Using Sock et Services with CMND(490) Section 6-8 CIO Area 7 6 54321 0 CIO 0000 CIO 0001 15 to 8 CIO 0002 TCP Send Bit TCP Close Bit TCP Open Bit TCP Receive Error Flag TCP Send Error Flag TCP Close Error Flag TCP Open Error Flag TCP Receiving Flag TCP Sending Flag TCP Closing Flag TCP Opening Flag TCP Receive Bit[...]

  • Página 171

    147 Using Sock et Services with CMND(490) Section 6-8 Pr ogramming Example If the P or t Enabled Flag (A20200) turns ON and the Clos- ing Flag (CIO 150903) turns OFF while the TCP Closing Flag (CIO 000201) is OFF , checks are made and if an y of the follo wing are true, the TCP Close Error Flag (CIO 000101) is turned ON. The Results Storage Error F[...]

  • Página 172

    148 Using Sock et Services with CMND(490) Section 6-8 Note When usin g the above programming e xample, change the bit and word address es as necessa r y to av oid using the sa me areas used by other par ts of the user pr ogram or the CPU Bus Un it. When the TCP Receiving Flag (CIO 000203) turns ON, the status of the P or t Enabled Flag (A20200) is [...]

  • Página 173

    149 Using Sock et Services with CMND(490) Section 6-8 6-8-9 UDP/IP Communi cations Pr ogramming Example The f oll owing programming example il lustrates transferring 100 bytes of data between an Ether ne t Unit and a host compu ter usin g UDP/IP communica tio ns. F or th e UDP connecti on, the Eth er net Unit uses a P ASSI VE OPEN and the host com [...]

  • Página 174

    150 Using Sock et Services with CMND(490) Section 6-8 Pr ogram Memory Maps The se nd an d receive data and b its (flags ) used by the pro gram are shown i n the following diagrams. DM Area 000AH 0004H 0001H 0110H 0000H 0032H 0123456789 D00000 Number bytes to receiv e: 4 bytes Remote Ethernet Unit designation Network address: 01 hex Node address: 01[...]

  • Página 175

    151 Using Sock et Services with CMND(490) Section 6-8 2701H 0123456789 D01010 Re- sponse code Stores the response after command ex ecution. UDP OPEN response 0123456789 D01020 UDP OPEN REQUEST results storage area Re- sponse code 2704H 0001H 8204H 1A00H 0123456789 D01030 UDP CLOSE REQUEST command data Command code UDP sock et number closed: set to [...]

  • Página 176

    152 Using Sock et Services with CMND(490) Section 6-8 CIO Area 2702H 0001H 820FH B400H 0123456789 D04000 2703H 0123456789 D03000 D03010 0064H 0000H UDP SEND REQUEST response Re- sponse code Re- sponse code UDP SEND REQUEST results storage area UDP RECEIVE REQUEST command data No . of bytes to receiv e: 100 bytes (0064 he x ) Timeout value: Not set [...]

  • Página 177

    153 Using Sock et Services with CMND(490) Section 6-8 Pr ogramming Example If the P or t Enabled Flag (A20200) turns ON and the Clos- ing Flag (CIO 150103) turns OFF while the UDP Closing Flag (CIO 000201) is OFF , checks are made and if an y of the follo wing are true, the UDP Close Error Flag (CIO 000101) is turned ON. The Results Storage Error F[...]

  • Página 178

    154 Using Sock et Services with CMND(490) Section 6-8 Note When usin g the above programming e xample, change the bit and word address es as necessa r y to av oid using the sa me areas used by other par ts of the user pr ogram or the CPU Bus Un it. When the UDP Receiving Flag (CIO 000203) turns ON, the status of the P or t Enabled Flag (A20200) is [...]

  • Página 179

    155 Precautions in Using Sock et Services Section 6-9 6-9 Precautions in Using So c ket Serv ices 6-9-1 UDP and TCP Socket Servic es • If a shor t response mo nitor ti me is sp ecified i n CMND( 490) co ntrol dat a and the Ethe r net Unit is operating u nder a high load, a res ult may be stored ev en if th e resp onse code i ndica tes a time- out[...]

  • Página 180

    156 Precautions in Using Sock et Services Section 6-9 • Data can remain in a buff er at the local node if the remo te TCP socket closes dur ing co mmunica tions. Any data r emain ing in the buff e r will b e discarde d when th e TCP socket is closed. T o avoid problems of this nature, steps wil l hav e to be taken in the applicati on program, suc[...]

  • Página 181

    157 Precautions in Using Sock et Services Section 6-9 6-9-5 Maximum T ransmissi on Delays (Ignoring other Netw ork Dela ys) The transmi ssio n delays for sock et s er vice is ca lculated as th e sum of th e communica tions proces sing tim es for both no des. T ransmissi on delay = Remo te node sen d proc essing time + Loc al nod e receive process i[...]

  • Página 182

    158 Precautions in Using Sock et Services Section 6-9 Note 4: Wh en the CPU Unit cy cle time is less than 2 ms, A = 27, and when it is 2 ms or more, A = 53 Note 1. The values obtain ed from the above equations are guid elines for the trans- missio n del a y time when one s ock et in the E ther net U nit is used o nly . The ex ec ution t ime requ ir[...]

  • Página 183

    159 SECTION 7 Using FINS Communications to Cre ate Host A pplications This section provides information on communicating on Et hernet Systems and interconnected networks using FINS commands. The information provided in the section deals only with F INS communications in reference to Ethe rnet Units. FINS commands issued from a PLC are sent via the [...]

  • Página 184

    160 Overview of FINS Comm unicatio ns Section 7-1 7-1 Overview of FINS Communications 7-1-1 Communicati ons On an Ethernet Network Data is sent and received as UDP pack ets or UDP packets on an Ether ne t network . In the FINS com munication s ser vic e, both an IP addr ess f o r IP (the Inter ne t lay er) and a FINS nod e addres s for FINS (the ap[...]

  • Página 185

    161 Overview of FINS Comm unicatio ns Section 7-1 7-1-2 Using the FINS/UDP and FINS/TCP Methods It is reco mmende d that FINS/UDP and FINS /TCP be u sed as follows: • Wh en remote devices do not su ppor t the FINS/T CP method: Use the FINS/UDP method f or FINS co mmunications with tho se devices . • Wh en FINS n odes a re conn ected on th e sam[...]

  • Página 186

    162 FINS F rames Section 7-2 7-2 FINS Frames The FINS c ommunic ation s ser vi ce is ca rrie d out th rough the exchange of FINS comm and fram es and t heir co rrespondi ng res ponse frames. (There are also comma nds with n o respo nses.) Both com mand frames and resp onse frames are com pri sed of a FINS hea der f or stor ing transfer control in f[...]

  • Página 187

    163 FINS/UDP Method Section 7-3 RSV (Res erv ed by System) Set to 00 ( Hex). GCT (Permissible Number of Gat ewa ys) Set to 02 ( Hex). DNA (Destination Network Address) Specifi es the numb er of the net work whe re the d estina tion n ode is located . The addr ess can b e spec ified in the f oll owing range. 00 (He x) : Local network 01 to 7F (He x)[...]

  • Página 188

    164 FINS/UDP Method Section 7-3 The FINS/U DP m ethod has the following features: • Beca use FIN S/UDP i s a co nnecti onless protoc ol, there is no limit to the num ber o f corr ectio ns. • F INS/UDP ca n be used f or b roadcasti ng. • Wh en data is sent vi a an IP network with multiple lay ers (suc h as the Int er net), commun icatio ns rel[...]

  • Página 189

    165 FINS/UDP Method Section 7-3 The UDP por t number for the host ap plicati on (e.g., per sonal c omput er) func- tions differently fr om the por ts that can be us ed dependi ng on the s etting for the ad dress conv ers ion me thod at the Eth er net Unit. Basica lly , the s ame num- ber can be used for the UDP por t number set in the Ether ne t Un[...]

  • Página 190

    166 FINS/UDP Method Section 7-3 It is not neces sar y to set ro uting tables if one Communi catio ns Unit is mounted to the PLC and the n odes a re conne cted as o ne networ k. F or d etails on routin g table, refer to the section on Creating R outing T a bles in the Opera- tion Manual , Constr uction of Networ ks: Sec tion 6 FI NS Communic ations [...]

  • Página 191

    167 FINS/UDP Method Section 7-3 UDP por t number : FINS UDP por t number (Ether n et Unit o f rela y n ode) FINS add resses (R emote nod e CPU Unit) : Network addres s: 2 Node addr ess: 1 Unit number : 0 FINS add resses ( Host com puter): Network addres s: 1 Node addr ess: 50 Unit number : 0 FINS/UDP Sample Pr ogram Operati on Overview • This pro[...]

  • Página 192

    168 FINS/UDP Method Section 7-3 Sample Program 1 #include <errno.h> 2 #include <stdio.h> 3 #include <sys/types.h> 4 #include <sys/socket.h> 5 #include <netinet/in.h> 6 #include <signal.h> 7 8 #define FINS_U DP_POR T 9600 9 # def ine SERV_ IP_ ADDR " 196.36.32.100" /* Ethernet Unit IP ADDRESS*/ 10 #defin[...]

  • Página 193

    169 FINS/UDP Method Section 7-3 32 /* 33 bzero((char *) & s_addr,sizeof(ws_addr)); 34 ws_addr.sin_fam ily = AF_INE T; 35 ws_a ddr. sin_ addr .s_a ddr = h tonl (INADDR_ANY); 36 ws_addr.sin_port = htons(0); /* GET AVAILABLE PORT FOR LOCAL UDP PORT */ 37 if (bind(sockfd,(struct sockaddr *)&w s_addr,sizeof(ws_addr)) < 0) 38 err_exit("ca[...]

  • Página 194

    170 FINS/UDP Method Section 7-3 85 /* RECEIVE FINS RESPONSE*/ 86 addrlen = sizeof(cs_addr); 87 88 if ((recvlen = recvfrom(sockfd,fins_resp,MA X_MSG,0,& cs_addr,&addrlen)) < 0) 89 { 90 if (errno == EIN TR) 91 goto CMND_ SEND; / * 92 err_exit("receive error"); 93 } 94 else 95 { 96 alarm(0); /* 97 printf("recv length %d¥n&qu[...]

  • Página 195

    171 FINS/TCP Method Section 7-4 7-4 FINS/TCP Method 7-4-1 Overvie w FINS/TCP Features The FIN S/TCP method is a FINS com munication s method th at use s the TCP/ IP protocol . TCP/IP is a conn ectio n-type c ommunicati ons pro tocol. Be f o re a message is se nt from one n ode to an other , it is nec essar y to establish a vir- tual circ uit, i.e.,[...]

  • Página 196

    172 FINS/TCP Method Section 7-4 • O nce a FINS/T CP connec tion (conn ection number , remote IP address) has been set in the Unit Set up , it can be dynamica lly chang ed from th e ladder program using a FINS command (i.e., FINS/TCP CONNECTIO N REMO TE NODE CHANGE REQUEST). FINS/TCP Frame Format The following diagram shows the str uctu re of a TC[...]

  • Página 197

    173 FINS/TCP Method Section 7-4 FINS/TCP Connection Status (W or d n+23) While a c onnectio n with a re mote nod e is established, the bit cor respond ing to the FINS/TCP connecti on status tur ns ON in the sectio n of the CPU Bu s Unit words allo cated in the CI O Area. T he bit tur n s OFF if the connecti on is ter m i- nated by an error in commu[...]

  • Página 198

    174 FINS/TCP Method Section 7-4 • If there is no respon se from the clie nt when t he keep-a live functio n is i n effect. • If a command ot her than FINS FRAME SEND or CONNECTION CON- FIRMA TION i s rece ived from the ser ver , the connec tion w ill close after th e FINS FRAME SEND ERROR NO TIFICA TION command is sent. Even if the c onnection [...]

  • Página 199

    175 FINS/TCP Method Section 7-4 ■ Setting Range for A utomatic Allocation of FINS Node Addresses The range of node addr esses that can be used as automatical ly allocate d FINS node ad dresse s is set in the Ether net Unit ’ s Unit Setup. Nor mally (default status), nod e address es 239 to 254 ar e allocat ed to each of the con- nections 1 to 1[...]

  • Página 200

    176 FINS/TCP Method Section 7-4 Even if the keep-alive func tion is n ot speci fied at t he Ethe rn et Unit, a re- sponse is se nt for checks sent from o ther n odes. If the power is tur ned OFF to the host appl ication (e.g., pers onal compute r) while a conn ection is established, the connec tion is no lon ger require d, but will remain open unti[...]

  • Página 201

    177 FINS/TCP Method Section 7-4 • Wh en routi ng tables are used for one or m ore other nodes o n the s ame network . It is not necessa r y to set ro uting tables if one Communi catio ns Unit is mounted to the PLC and the nodes ar e connec ted as on e networ k. F or details on setti ng rout ing ta bles, ref er to the section on cr eating routin g[...]

  • Página 202

    178 FINS/TCP Method Section 7-4 When aut omat ically al loca ted FINS node address es a re set, the cli ent node address auto maticall y al located a t the s er ver is st ored in the c lient nod e address field. After a c onnectio n has b een established as a FINS/T CP client o r ser v er , do not send this command again. O therw ise, the er ror co[...]

  • Página 203

    179 FINS/TCP Method Section 7-4 The deta ils o f the ab ov e frame ar e shown in the following table. FINS FRAME SEND ERROR NO TIFICA TION Command If an error occ urs in the FIN S/TCP hea der of the FINS F RAME SE ND com- mand, this command is us ed so that an error c ode wil l be retu rn ed to the nod e that sent the FINS F RAME S END comma nd by [...]

  • Página 204

    180 FINS/TCP Method Section 7-4 After t he co mmand is se nt, i f ACK is re tur ned i n the TCP l ay er by the remot e node, the connecti on that is established is maintained . If RST is retur ned in the TCP l ay er by the remote node, the es tablished co nnection is clos ed. If the FINS N ODE ADD RESS DA T A SEND (CL IENT T O SE R VER) or FINS NOD[...]

  • Página 205

    181 FINS/TCP Method Section 7-4 1,2,3. .. 1. After the TCP con nectio n is esta blished, the c lient node addre ss is s ent by the cl ient to the serv er usin g the FI NS NODE ADD RESS D A T A SEN D (CLI- ENT T O SERVER) com mand. 2. The clien t’ s FINS node address (client nod e addres s) is obtai ned from th e received comma nd. 3. The ser v er[...]

  • Página 206

    182 FINS/TCP Method Section 7-4 Connection Sequenc e for A utomatic Allocation of FINS Node Addresse s 1,2,3. .. 1. The client speci fies th e client no de addr ess as 00 000000 h e xad ecimal i n the ser v er as th e autom atically alloc ated FINS node a ddress, and se nds i t using the FINS NODE ADDRESS D A T A SEND (CLIENT T O SER VER) comm and.[...]

  • Página 207

    183 FINS/TCP Method Section 7-4 Recovery Conn ection Sequen ce when H ost Computer (WS) is Stopp ed by a n E r ro r 1,2,3. .. In steps 1 to 4 the FINS messa ge send and r eceive processin g is performe d using th e FINS F RAME SEND comm and. 5. This example assu mes that the hos t compu ter’ s power is unexpectedly in- terrup ted. T he nor mal c [...]

  • Página 208

    184 FINS/TCP Method Section 7-4 F rom ste p 12 onwards, the c onnecti on is established a gain. Note When FINS node add resses ar e automa tically al located, th e node add ress canno t be spe cified, so th e connec tion remains o pen un til i t is c losed by th e keep-alive function. 7-4-3 S ending Commands fr o m a Host Computer When sen ding F I[...]

  • Página 209

    185 FINS/TCP Method Section 7-4 ■ Example 2: Host Comput er and Remot e Node Conn ected Via Relay Node (Ethernet Uni t) Destinati on IP Add ress: 196 .36.32.1 00 (Ethe rn et Unit of relay node) UDP por t number : FINS UDP por t number (Ether n et Unit o f rela y n ode) FINS add resses (R emote nod e CPU Unit) : Network addres s: 2 Node addr ess: [...]

  • Página 210

    186 FINS/TCP Method Section 7-4 Sample Program /* Ethernet Unit IP ADDRESS*/ COMMUNICATIONS SAMPLE PROGRAM GENERATE TCP SOCKET*/ 1 #include <errno.h> 2 #include <stdio.h> 3 #include <sys/types.h> 4 #include <sys/socket.h> 5 #include <netinet/in.h> 6 #include <signal.h> 7 8 #define FINS_TCP _PORT 9600 9 # def ine [...]

  • Página 211

    187 FINS/TCP Method Section 7-4 33 34 /* 35 bzero((char *) &ws_addr,sizeof(ws_addr)); 36 ws_addr.sin_family = AF_IN ET; 37 ws_ addr. sin_ addr. s_ad dr = hto nl(I NADDR_ANY); 38 ws_addr.sin_port = htons(0); /* 39 40 if (bind(sockfd,(struct sockaddr *)&ws_addr,sizeof(ws_addr)) < 0) 41 err_exit(“can’t bind local address”); 42 43 /* E[...]

  • Página 212

    188 FINS/TCP Method Section 7-4 86 else 87 { 88 err_exit("FINS/TCP header send error"); 89 } 90 91 /*RECEIVE FINS/TCP COMMAND (READ RECEIVE FUNCTIONS)*/ 92 recvlen = 24; 93 if (tcp_recv(sockfd, fins_tcp_header, recvlen) == recvlen) 94 { 95 alarm(0); /*STOP RESPONSE MONITOR TIMER*/ 96 97 /* CONFIRM WHETHER FINS NODE NUMBER SEND COMMAND (CL[...]

  • Página 213

    189 FINS/TCP Method Section 7-4 139 alarm(RESP_TIM EOUT); /* 140 printf("FINS/T CP header send length %d¥n",sendlen); 141 } 142 else { 143 err_exit("FINS/TC P header send error"); 144 } 145 146 147 /* SEND FINS COMMAND FRAME*/ 148 /* 149 * 150 * (READ 150 WORDS FROM DM 100 ) 151 */ 152 fins_cmnd[0] = 0x80; /* ICF */ 153 fins_cm[...]

  • Página 214

    190 FINS/TCP Method Section 7-4 192 } 193 194 printf("FINS/TC P header receive length %d¥n",recvlen); 195 recvlen = fins_tcp_header[6]; 196 recvlen <<=8; 197 recvlen += fins_tcp_header[7]; 198 recvlen -= 8; /* SUBTRACT LENGTH OF COMMAND & ERROR CODE OF FINS/TCP HEADER*/ 199 printf("FINS/TC P frame receive length %d¥n"[...]

  • Página 215

    191 FINS/TCP Method Section 7-4 245 int total_len = 0; 246 int recv_len; 247 248 for (;;) 249 { 250 recv_len = recv(sockfd, (char *)buf, len, 0); 251 252 if (recv_len > 0) 253 { 254 if (recv_len < (int)len) 255 { 256 len -= recv_len; 257 buf += recv_len; 258 total_len += recv_len; 259 } 260 else 261 { 262 total_len += recv_len; 263 break; 264[...]

  • Página 216

    192 Maximum T ransmission Delays: W riting/Reading to CPU Uni t Section 7-5 7-5 Maxim um T ransmission Dela ys: Writin g/Reading to CPU Unit The tim e for the response to be r eceived after a rem ote nod e on th e Ether ne t network send s a mem or y area read or write comm and to a PLC ca n be ca lcu- lated using the f o llowing for mula. Write Co[...]

  • Página 217

    193 Maximum T ransmission Delays: W riting/Reading to CPU Uni t Section 7-5 F or d etails, refer to the CPU Unit operation m anual. T ransmission Pr ocessing (Response) 0.704 ms Note The ac tual operating environme nt can c ause t ransmissio n delays larg er than those c alculated with th e meth ods given he re. Among the caus es of l onger delays [...]

  • Página 218

    194 Maximum T ransmission Delays: W riting/Reading to CPU Uni t Section 7-5 F or d etails, refer to the CPU Unit operation m anual. CPU Bus Unit Serv ice Pr ocessing Time The proces sing time wi ll be as f oll ows, depending on the CP U processin g mode sett ings at th e CPU Unit. F or d etails, refer to the CPU Unit operation m anual. T ransmissio[...]

  • Página 219

    195 Appendix A Etherne t Netw ork P arameter s P ar ame ter Value Desc rip tion TCP se nd buff er 4,096 byt es Maximu m capacity of the TCP s end buff er TCP rec eive b uff er 4,096 bytes Maxim um capacity of the TCP re ceive buff er UDP send b uff er 9,000 byt es Maximu m capacity of the UDP send buff er UDP r ecei ve buff e r 9, 016 by tes Ma xim[...]

  • Página 220

    196 Ethernet Netw ork P arameters Appendix A[...]

  • Página 221

    197 Appendix B Buffer Configuration Network memor y (248K bytes) Communications controller IP pack et output queue (50 max. × 1,500 bytes) UDP sock et send request buff ers (8 × 9,000 max.) TCP sock et send request buff ers (8 × 4,096 max.) FTP service send buff er (4,096 bytes) FINS send buff er (9,000 bytes max.) FINS reception buff er (16,383[...]

  • Página 222

    198 Buf fer Configur ation Appendix B Netw ork Memo ry Most of the buffers used for communicatio ns se r vicin g by the Ethe rn et Unit a re ad minister ed in a buffer config- uration call ed net work m emor y . Networ k me mor y con sists of 196K bytes of me mor y div ided into sho r t a nd lon g buff ers. The use of s hor t and long buffers is de[...]

  • Página 223

    199 Appendix C TCP Status T ransitions The TCP so cket status can be confi r med us ing the sock et st atus data r etur ned for the FINS c omman d SOCKET ST A TUS READ (2764). Status Mean ing CLOSE D C onne cti on clos ed. LISTEN Wa iting f or connec tion. SYN SENT SYN sent in activ e status. SYN RECEIVED SYN receiv ed and sent. EST ABLISHED Alread[...]

  • Página 224

    200 TCP Status T ransitions Appendix C[...]

  • Página 225

    201 Appendix D ASCII Characters Bits 1 to 4 Bits 5 t o 7 Binary 0000 0001 001 0 0011 010 0 0101 0110 0111 H e x 012 34567 0000 0 NUL D LE Space 0 @ P p 0001 1 SOH DC1 ! 1 A Q a q 0010 2 STX DC2 ” 2 B R b r 0011 3 ETX DC3 # 3 C S c s 0100 4 E O T D C 4 $4 D T dt 0101 5 ENQ NAK % 5 E U e u 0110 6 ACK S YN & 6 F V f v 0111 7 BEL ET B ’ 7 G W g[...]

  • Página 226

    202 ASCII Ch aracters Appendix D[...]

  • Página 227

    203 Appendi x E Maintenance The Ethe rn et Unit ma kes up par t of a n etwor k. Repa ir a defective Ether net Unit a s soon as possible as it ca n hav e a neg ative eff ect on the entire net work . We recommend tha t custo mers keep one or m ore spar e Ether ne t Units to a llow immedia te recovery of t he networ k. Replacing an Ethernet Uni t Obse[...]

  • Página 228

    204 Main tena nce Appendix E[...]

  • Página 229

    205 Appendi x F Inspections Carr y ou t regular inspecti ons to ensure t he Ether net U nit is funct ioning pe rfectly . Items Most of the pa r ts th at make up an Ethe rn et Uni t are s emicond uctor com ponents. N one of the p ar ts i n the Unit will wear out after a specif ic li fetime , but so me par ts may deter iorate due t o extreme ope rati[...]

  • Página 230

    206 Inspections Appendix F[...]

  • Página 231

    207 Index Numerics 100Base -TX transmission delays , 193 10Base-T transmission delays , 193 A Accessing Memory/Rec eiving Mail Flag , 60 Accessing Memory/S ending Mail Flag , 25 Account Name field , 6 , 19 , 39 Adjust Ti me field , 92 , 93 applica tions examples mail se nd functi on , 30 using UNIX , 86 precaut ions , xxiv ASCII characters , 201 At[...]

  • Página 232

    208 Index D delete co mmand , 68 , 73 , 77 dir comman d , 68 , 73 , 74 DNS co mmun icati ons , 3 DNS server , 31 auto mati c clock adjustm ent errors , 94 DNS Tab , 6 , 19 , 39 , 92 initial setting s , 31 E EC Directive s , xxvi electromag netic fields , xxiv EM File Memory , 80 using , 80 E-mail attached files , 16 , 17 , 35 receiving , 41 body , [...]

  • Página 233

    Index 209 FileWrite c ommand , 2 , 36 command /re sponse fo rmat , 43 FileWrite fi eld , 41 FINS commun ications , 2 , 4 address c onversion , 161 application layers , 160 command s CONNECTION CONFIRMATION , 179 FINS FRAM E SEN D , 178 FINS FRAME SEND ERROR NOTIFICATI ON , 179 FINS NODE ADDRESS DATA SEND (CLIENT TO SERV ER) , 17 7 FINS NODE ADDRESS[...]

  • Página 234

    210 Index I I/O memory data , 15 CSV format , 61 IOM format , 60 TXT format , 61 I/O tables creating , 30 ICF , 162 inspectio ns , 205 installatio n location , xxiv Interval time field , 20 , 24 IO memory data field , 20 , 22 IOM field , 41 IOM format , 15 , 26 IOMRe ad comma nd , 2 , 35 command /re sponse fo rmat , 51 IOMRead field , 41 IOMWrite c[...]

  • Página 235

    Index 211 send timing , 11 send ing metho d (encod ing) , 17 settings , 19 DNS Tab , 19 Mail Address Tab , 19 POP T ab , 19 SMTP Ta b , 19 SMTP setti ngs , 4 status , 17 , 24 Send Mai l St atu s 1 , 24 Send Mai l St atu s 2 , 25 status information , 15 subject , 17 triggers , 13 , 17 , 18 , 23 user-set information , 14 Mail Sen d Switch , 25 MailLo[...]

  • Página 236

    212 Index TCP/IP , 4 UDP/IP , 4 put comma nd , 68 , 73 , 76 , 85 pwd comm and , 68 , 73 , 75 Q quit co mmand , 68 , 73 , 77 R radioactiv ity , xxiv READ DATA FILE (FREAD) instruction , 26 , 60 Receive file with specified extension only field , 39 , 41 Receive Ma il Tab , 39 , 40 Receive Request Switch , 11 9 Receive specified c ommands only field ,[...]

  • Página 237

    Index 213 port num bers , 99 TCP status , 199 TCP sock ets , 184 numbe r , 117 status , 199 UDP socket numbe r , 117 UDP sockets , 166 Software switch field , 23 specifications FTP serve r , 68 mail recei ve function , 36 mail s end functio n , 17 SRES , 139 static electri city , xxiv precaut ions , xxv STD field , 41 switches Socket Servi ce Reque[...]

  • Página 238

    214 Index[...]

  • Página 239

    215 Revision History A manual r e visi on cod e appear s as a s uffix to th e catalog number o n the fron t cov er o f the ma nual. The following table outlines the changes mad e to the manual dur ing ea ch revision. Page numbers ref e r to the previous version. Revi sion code Date Re vised content 1 Ju ly 2003 Original produc tion 02 March 2004 Th[...]

  • Página 240

    216 Revision Histor y[...]

  • Página 241

    OMRON Corporat ion Cont rol D evice s Di vi sion H.Q . Shiok oji Horikaw a, Shimog yo-k u, K yoto , 600-8 530 Jap an T el: (81)7 5-344-7109/F ax: (81)75 -344-7149 Regional Hea dquarters OMRON EUR OPE B.V . W egalaan 6 7-69, NL-213 2 JD Hoofddo r p The Ne therlands T el: (31)2 356-81-300 /F ax: (31)23 56-81-388 OMRON ELECTR ONICS LLC 1 East Comm erc[...]

  • Página 242

    Authorized Distributor: Cat. No. W421-E1-03 Note: Specificat ions subject t o change without not ice Printed in Japan This manual is printed on 100% recycled paper.[...]