Instruction/ maintenance manual of the product CJ1W-ETN21 Omron
Go to page of 242
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.
CS1W-ETN21 (100Base-TX) CJ1W-ETN21 (100Base-TX) Ethernet Units Construction of Applications Operation Manual Revised Novembe r 2005.
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.
vi.
vii TABLE OF CONTENTS PRECAUTION S . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xxi 1 Intended Aud ience . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xxii 2 General Precautions .
viii TABLE OF CONTENTS SECTION 4 FTP Server . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 67 4-1 Ove rview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
ix TABLE OF CONTENTS Appendices A Ethernet Network Parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 195 B Buf fer Conf iguration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
x TABLE OF CONTENTS.
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 .
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 2.
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.
xiv.
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.
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.
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.
xviii.
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.
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.
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.
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.
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.
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.
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.
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.
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 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.
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 .
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.
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 .
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.
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.
8 Common Pr otocol Settings Section 1-4.
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 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 .
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.
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.
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.
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 .
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).
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 .
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.
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 t.
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.
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 .
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 .
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.
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.
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 .
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.
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.
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.
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.
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).
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).
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 Info.
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.
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.
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.
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 .
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 ati.
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.
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.
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 .
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 .
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).
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 .
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.
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.
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.
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.
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.
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.
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 .
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 .
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.
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.
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 .
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 ).
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 ).
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.
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.
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.
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.
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.
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.
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.
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 .
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.
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.
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.
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 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.
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 .
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.
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.
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.
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.
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.
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 .
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.
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.
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 .
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 .
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.
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).
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.
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.
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.
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.
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].
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 .
88 UNIX Application Exam ple Section 4-9.
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 .
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).
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 .
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 .
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.
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.
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 .
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 .
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? . . .
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 .
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.
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.
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 .
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.
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.
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.
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.
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 .
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 .
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 .
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).
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.
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.
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 .
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.
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.
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.
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.
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.
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.
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.
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.
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.
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 .
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).
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.
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.
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.
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.
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.
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 .
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 conte.
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.
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.
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 ,.
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.
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.
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.
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.
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.
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 .
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 co.
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.
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.
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.
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.
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 result.
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 Clo.
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.
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.
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.
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.
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.
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 .
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.
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.
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.
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.
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.
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 .
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.
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 .
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 .
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.
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.
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.
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.
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.
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 .
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.
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.
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 (e.
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.
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).
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.
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.
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.
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.
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.
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.
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 F.
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.
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.
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.
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.
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.
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 .
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.
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.
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(sock.
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");.
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_heade.
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 &l.
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.
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.
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.
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 cap.
196 Ethernet Netw ork P arameters Appendix A.
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.
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.
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.
200 TCP Status T ransitions Appendix C.
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 .
202 ASCII Ch aracters Appendix D.
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.
204 Main tena nce Appendix E.
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.
206 Inspections Appendix F.
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.
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 .
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 CONFIRM.
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 me.
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 , 2.
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.
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 r.
214 Index.
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.
216 Revision Histor y.
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.
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.
An important point after buying a device Omron CJ1W-ETN21 (or even before the purchase) is to read its user manual. We should do this for several simple reasons:
If you have not bought Omron CJ1W-ETN21 yet, this is a good time to familiarize yourself with the basic data on the product. First of all view first pages of the manual, you can find above. You should find there the most important technical data Omron CJ1W-ETN21 - thus you can check whether the hardware meets your expectations. When delving into next pages of the user manual, Omron CJ1W-ETN21 you will learn all the available features of the product, as well as information on its operation. The information that you get Omron CJ1W-ETN21 will certainly help you make a decision on the purchase.
If you already are a holder of Omron CJ1W-ETN21, but have not read the manual yet, you should do it for the reasons described above. You will learn then if you properly used the available features, and whether you have not made any mistakes, which can shorten the lifetime Omron CJ1W-ETN21.
However, one of the most important roles played by the user manual is to help in solving problems with Omron CJ1W-ETN21. Almost always you will find there Troubleshooting, which are the most frequently occurring failures and malfunctions of the device Omron CJ1W-ETN21 along with tips on how to solve them. Even if you fail to solve the problem, the manual will show you a further procedure – contact to the customer service center or the nearest service center