Home
USER MANUAL – SENECA Z-TWS 3 and Z
Contents
1. Name SysFileRead Description SYSFILEREAD File DWORD SysFileRead DWORD Buffer DWORD Size DWORD Name SysFileRename Description SYSFILEREMAME FileQldName STRING 80 SysFileRename BOOL FileNewName STRING 80 to 01943 602001 salesQissltd co uk b www issitd co uk USER MANUAL SENECA Z TWS 3 and Z TWS64 Description SYSFILESETPOS File DWORD SysFileSetPos BOOL Pos DWORD Name SysFileWrite Description SYSFILEWRITE File DWORD SysFileWirite DWORD Buffer DWORD Size DWORD Library SysLibSocket lib gt TCP specific Name SysSockRecv Description SYSSOCKRECV diSacket DINT SysSackRecv DINT pbyBuffer DWORD diBufferSize DINT diFlags DINT Name SysSockSend Description fu amp 01943 602001 salesQissltd co uk b www issltd co uk USER MANUAL SENECA Z TWS 3 and Z TWS64 SYSSOCKSEND diSacket DIMT syssocksend DINT pbyBuffer DWORD diBufferSize DINT diFlags DINT UDP specific Name SysSockRecvFrom Description SYSSOCKRECVFROM diSacket DINT SysSockRecvFrom DINT pbyBuffer DWORD diBuffersize DINT diFlags DINT pSsockAddr DWORD diSockAddrsize DINT Name SysSockSendTo Description SYSSOCGKSENDTO diSocket DINT SysSockSendTo DINT pbyBuffer DWORD diBufferSize DIMT diFlags DINT pSockAddr DWORD diSockAddrsize DINT gt others Name SysSockAcc
2. Be amp 01943 602001 salesQissltd co uk b www issltd co uk USER MANUAL SENECA Z TWS 3 and Z TWS64 Seneca 7 NET3 CAUsersjEmanueleD e Project Online Tools 7 ue Dee s e o g 0066060 ERR MWR x ee RX TX COM Figure 26 Configuring the Z TWS with I O Modbus step 8 At this point Codesys is opened from menu select Online gt Communication parameters and the following window will be opened Click on New to add a new channel and select TCP IP Be to 01943 602001 salesQissltd co uk b www issltd co uk USER MANUAL SENECA Z TWS 3 and Z TWS64 Communication Parameters as Channels E localhost via TeprIp ur Cancel Value Comment Mew Remove Communication Parameters New Channel Name localhost via Tcp lp Daez Cancel Serial 15232 35 Seral 15232 driver Tep lp Level 2 35 Tepelp level 2 driver Serial Modem 35 Modem driver Tcp lp Level Route 35 Tep lp Level 2 Router Driver Figure 27 Configuring the Z TWS with I O Modbus step 9 At this point replace the localhost string with the IP of the TWS used for example 192 168 90 101 Be amp 01943 602001 salesQissltd co uk b www issltd co uk USER MANUAL SENECA Z TWS 3 and Z TWS64 OF i cpilp Level 2 Cancel ust match with runtime New Motorola byteorder Mo Remove Gateway INSERT THE IP OF TWS default 192 168 90 101
3. USER MANUAL SENECA Z TWS 3 and Z TWS64 Library EXOR_Serial lib Name EXOR_ser_end Description make one serial port free for other uses result of the operation 0 no errors 1 port was not in use EXOR_SER_END port BYTE EXOR ser end SINT Name EXOR ser get Description read some characters from one serial port result of the operation O no errors 1 port not in use 2 not enough chars ATTENTION dimension of array must be large enough to contain number of characters specified in LEN parameter EXOR SER GET port BYTE EXOR ser get SINT len WORD buffP POINTER TO BYTE Name EXOR ser init Description result of the operation 0 no errors 1 port already in use EXOR SER IMIT port BYTE EXOR ser init SIMT channel BYTE baudrate DWORD parity BYTE data BYTE stop BYTE mode BOOL halfduplex BOOL slewrate BOOL fh amp 01943 602001 sales issltd co uk b www issitd co uk A USER MANUAL SENECA Z TWS 3 and Z TWS64 Name EXOR_ser_put Description write some characters to one serial port ATTENTION dimension of array must be large enough to contain number of characters specified in LEN parameter EXOR_SER_PUT port BYTE EXOR_ser_put SINT len WORD buffP POINTER TO BYTE Name EXOR ser test Description test one port to know if characters are available returns number of chars in the input queue EXOR SER TEST port BYTE EXOR ser test WOR
4. SFCACTIONCONTROL N BOOL Q BOOL RO BOOL BOOL D BOOL P BOOL D BOOL S BOOL iL BOOL T TIME Library Modbus_UDP lib Name CallbackModBus Description CALLBACKMODBUS dwEvent DWORD CallbackModBus DWORD dwFilter DWORD dwOwner DWORD Name CyclicReceive Description This program has to be called cyclic without arguments by the user application Name ExitModBusLib Description fh amp 01943 602001 sales issltd co uk b www issitd co uk USER MANUAL SENECA Z TWS 3 and Z TWS64 EXITMODBUSLIB bClose BOOL ExitModBusLib BOOL Name FindRegisteredQuery Description FINDREGISTEREDQUERY Address DWORD FindRegisteredQuery INT Transaction WORD Name GetCommEventCounter Description GETCOMMEVENTCOUNTER DestAddress DWORD Ready BOOL DestPort WORD Error BOOL Enable BOOL EvtCounter WORD Status WORD Name InitModBusLib Description INITMODBUSLIB saRecvy SOCKADDRESS InitModBusLib BOOL Name ModBusReadCoils Description to 01943 602001 salesQissltd co uk b www issitd co uk A USER MANUAL SENECA Z TWS 3 and Z TWS64 MODBUSREADCOILS DestAddress DWORD Ready BOOL DestPort WORD Error BOOL StartAddress WORD DataLen WORD BitCount WORD Enable BOOL Name ModBusReadMultipleRegisters Description MODBUSREADMULTIPLEREGISTERS DestAddress DWORD Ready BOOL DestPort WORD Error BOOL
5. gt M3 OVERFLOW I M3_TOTAL1 M3_TOTAL2 M3_TOTAL3 M3_TOTAL4 M3_TOTALS INET Variable Name ma ef Address on TWS Ok C i Figure 55 Assignment of a variable to a Var panel object Address Z3HREG40002 Z3HREG40003 Z3HREG40004 Z3HREG40005 Z3HREG40006 Z3HREG40007 Description INT INT INT INT INT INT LISTEN Lg Lg m ft ft ft ft pas OG Cance for each module selected the variables window shows the name and the corresponding address for each variable that can be assigned to the icon Select the desired variable and click on OK To change the default features of this object select the Property window as for the others objects amp 01943 602001 salesQissltd co uk b www issitd co uk USER MANUAL SENECA Z TWS 3 and Z TWS64 How to configure the Data Recorder Data recorder is a software that allows to perform the data logging for each variables this one is saved into an access data base mdb This file can be analyze using the Trend Viewer software offered in the Seneca Package CD Data recorder is a not free applicative for more informations visite the website www seneca it or contact Seneca srl This software can be opened from the software Z NET as shown in the following figure Data Recorder Figure 56 Block diagram process to configure the Data Recorder When the Data Recorder operates the PC is configured as Modb
6. BOOL iPart INT Name NetVarPDO Rx Udp Description NETVARPDO RX UDP sNetTelegramm MetvarTelegramm UDP nstatus INT TimeOut TON bDataMew BOOL bNewMessage BOOL nindex INT diBytes Send DINT bReceived BOOL pDataltems POINTER TO ARRAY 0 63 OF MetvarDataltem UDP wDryhr WORD nDataltems INT bySignature BYTE bRequest tBoatup BOOL stlPA amp ddressTransmitter STRING 20 stlPA amp ddressBroadcast STRING 20 Name NetVarPDO Tx Udp Description fu to 01943 602001 salesQissltd co uk b www issltd co uk USER MANUAL SENECA Z TWS 3 and Z TWS64 NETVARPDO_TA_UDP InhibitTimer TON nstatus INT RepeatTimer TON pDataltems POINTER TO ARRAY 0 63 OF NetVarDataltem Udp wDrvNr WORD nDataltems INT bWithChecksum BOOL bySignature BYTE bWithAcknowledge BOOL bExpression BOOL bAnswerBootupRequest BOOL bBootupRequestReceived BOOL stlPAddressBaatupRequest STRING 20 nindex IMT stlPAddressBroaadcast STRING 20 sNetTelegramm MetvarTelegramm UDP Name NetVarSDO Udp Description NETVARSDO UDP bReadData BOOL n3Status MetvarOD Service Udp bWriteD ata BOOL nindex INT nsublndex INT pData POINTER TO ARRAY 0 255 OF BYTE nLen INT nitems INT stlPAddressClient STRING 20 TimeOut TIME Udp specific Name GetlPAddress Description GETIPADDRESS stlPAddress STRING 80 GetlPAddress DINT fu t
7. SENECA a am CEEIWICATE UMIEN BO 9001 Mr PIS NE USER MANUAL Seneca Z TWS3 and Z TWS64 a CERTIFICATE UNI EN ISO 9001 Nr 9115 SENE This document is property of SENECA srl Duplication and reproduction of its are forbidden though partial if not authorized Contents of present documentation refers to products and technologies described in it Though we strive for reach perfection continually all technical data contained in this document may be modified or added due to technical and commercial needs it s impossible eliminate mismatches and discordances completely Contents of present documentation is anyhow subjected to periodical revision If you have any questions don t hesitate to contact our structure or to write us to e mail addresses as above mentioned MN ALAANANAN fu amp 01943 602001 salesQissltd co uk b www issitd co uk SUMMARY Systems based on Seneca Z PC Limes asvgevenseucintscdudedcassincsionaducenesanuedehanitdocennancesenseyanbnasaeinbueasaenopadneanensduensnoadareet 6 Z TWS nd I O modules uer TK 6 PLC FOR SMALL AND MEDIUM AUTOMATIONS eese nennen nnnnnn nennen enses nsns snas sean nnne nnns 6 SUPERVISORY OF PLANTS AND DATA ACQUISITION eeeeseeeeeeeennenenenn nennen nennen nennen nsns nnn nana ananas 7 21 8 RE MIU M c m 8 MMM WEB MEN 8 VO MODBUS AND IO CANOPEN ssedsecccevinseaseesnusssovenesaverd inti
8. Figure 13 A particular of the CoDeSys page list of installed libraries To insert a Seneca library right click into the previous red signed area and select Additional library Wig ECSFC LIB 11 6 08 18 05 14 Ei SYSLIBTIME LIB 11 6 08 18 05 14 SYSTASKINFO LIB 11 6 08 18 05 14 ANALYZATION LIB 5 10 99 09 05 06 SYSLIBCALLBACK LIB 11 6 08 18 05 14 Additional Library Ins Delete Del Properties Alt Enter Figure 14 A particular of the CoDeSys page how to add libraries The Seneca libraries are localized in the following link C 38S Software CoDeSys V2 3 Targets Seneca Lib_SITEK ate amp 01943 602001 salesQissltd co uk b www issltd co uk USER MANUAL SENECA Z TWS 3 and Z TWS64 So find the folder Lib SITEK using the combo box select the desired library for example TWS_MISC lib and open this one r Lib_SITEK j Nome Ultima modifica 4 SysTaskInfo lib 11 06 2008 18 05 F TepUdpLib lib 11 06 2008 18 05 F TWS MISC lib 10 12 2010 09 32 2 Util lib ng Hs GM per Tipo File LIB A Util no Reallib Dimensione 52 5 KB Ultima modifica 10 12 2010 09 32 Annulla Library directory C Program Files 85 35 Sottware CoDesys Wes d CONCAT FUN E DELETE FUN E FIND FUN E INSERT FUN E LEFT FUN ET IFM FLINT Figure 15 A particular of the CoDeSys page TWS MISC lib library An
9. INT Name EXOR CAN SET RXONLY F Description IF TRUE then CAN Master will only act for receiving from configured Slaves Nodes Be amp 01943 602001 salesQissltd co uk b www issltd co uk USER MANUAL SENECA Z TWS 3 and Z TWS64 CAN Master will not do NMT and will not send PDO to configured Slaves Nodes IF FALSE then CAN Master will act normally When switching from TRUE to FALSE the normal Start Up procedure will be executed i e the Slaves Nodes will be initialized and then they will be started NMT Start and Node Guarded Return Return Value is CAN OK if CanPort is valid otherwise CAN INVALID HANDLE is returned see EXOR_CAN LIB for return codes EXOR CAN SET RXONLY F CanPort INT EXOR CAN SET RXONLY_F DINT bRxOnlyF BOOL Library EXOR CANopenBlockTransfer lib Name EXOR CAN BT CLIENT CHECK Description IEC program after calling one time EXOR CAN BT CLIENT DL or EXOR CAN BT CLIENT UL then it will repeatedly call this function to check if download operation has been completed Entry ResPtr this must be the address ADR operator of a EXOR CAN BT CLIENT CHECK T structure where result data will be written Please see the comments embedded in the EXOR CAN BT CLIENT CHECK T Data Type definition Exit Result data will be written at the address specified by ResPtr parameter WARNING Please note that result data is written to ResPtr ONLY when function returns TRUE Return TRUE when o
10. Read one variable from local or remote TWS TWS READVAR enable BOOL O DoneF BOOL name POINTER TO STRING 80 O Integervalue DINT usr POINTER TO STRING 80 O FloatValue REAL psw POINTER TO STRING 80 0 Status INT timeout TIME fu to 01943 602001 salesQissltd co uk b www issltd co uk A USER MANUAL SENECA Z TWS 3 and Z TWS64 Name TWS_sendMail Description Send a E Mail message TWS SEMDMAIL enable BOOL O DoneF BOOL server POINTER TO STRIMG S0 OQ Status INT From POINTER TO STRING 80 QO Error INT MailTo POINTER TO STRING 80 Subject POINTER TO STRING 80 Body POINTER TO STRING 60 AtcPath POINTER TO STRING 80 timeout TIME Name TWS sendMailE Description Send a E Mail message TWS SENDMAILE enable BOOL O DoneF BOOL server POINTER TO STRING 80 OQ Status INT User POINTER TO STRING 80 QO Error INT Pass POINTER TO STRING 60 From POINTER TO STRING 60 MailTo POINTER TO STRING 80 subject POINTER TO STRING 80 Body POINTER TO STRING 80 AtcPath POINTER TO STRING 80 timeout TIME Name TWS SetMser Description Sets serial ports used by PPP SMS and MCTRL TWS_SETMSER PPPport DINT TAS SetMser DINT sMSport DINT MCTRLport DINT Name TWS SetNetPar Description Set Network Parameters to 01943 602001 salesQissltd co uk b www issitd co uk USER MANUAL SENECA Z TWS 3 and Z TWS64 TWS_SETNETPAR ip a
11. StartAddress WORD DataLen WORD Count WORD Data ARRAY 0 10 OF WORD Enable BOOL Name ModBusWriteCoils Description MODBUSWRITECOILS DestAddress DWORD Ready BOOL DestPort WORD Error BOOL Start amp ddress WORD BitCount WORD Enable BOOL Data ARRAY 0 7 OF BYTE Name ModBusWriteMultipleRegisters Description MODBUSWRITEMULTIPLEREGISTERS DestAddress DWORD Ready BOOL DestPart WORD Error BOOL StartAddress WORD Count WORD Data ARRAY 0 10 OF WORD Enable BOOL to 01943 602001 salesQissltd co uk b www issitd co uk USER MANUAL SENECA Z TWS 3 and Z TWS64 Name RegisterQuerylnstance Description REGISTERQUERYINSTANCE Instance DWORD RegisterQueryInstance INT Address DWORD Transaction WORD Port WORD Name SwapWToHostByteorder Description SWAPWTOHOSTBYTEORDER w WORD SwapWToHostByteorder WORD Library NetVarUdp LIB V23 lib gt NetVar POUS Name CallbackNetVar Description CALLBACKNETVAR dwEvent DWORD CallbackNetVar BYTE dw Filter DWORD dwOwner DWORD Name NetVarGetConnectStatus UDP Description NETVARGETCONNECTSTATUS UDP nBasisld INT bConnectNewData BOOL bConnectError BOOL dwErrorCode DWORD Be t 01943 602001 salesQissltd co uk b www issitd co uk USER MANUAL SENECA Z TWS 3 and Z TWS64 Name NetVarManager_Udp_FB Description NETVARMANAGER UDP FB bByteSwap
12. Trend register the signals from field and possible PLC variables are stored at predetermined intervals The WEB SERVER through Web pages properly programmed see the Web Editor chapter offers the possibility to display the time trend of signals as well as the possibility to download these values in a Microsoft Excel format Complex computations of signals are possible during acquisition then stored The stored data can also be acquired through the supervisory systems as SCADA The Z TWS allows two standard modalities for the acquisition of variables to a remote monitoring system OPC Server and Modbus TCP IP Fields of use of the Z TWS are represented by all small medium sized automation applications which may require significant capacity calculation for industrial process control and remote control A system based on Seneca Z PC Line Z TWS unit with I O modules has three characteristics 1 it is a distributed system I O is acquired through RS485 bus communication or CANopen bus communication 2 itis a open system I O data acquisition protocol Modbus RTU Ethernet interface protocol HTTP FTP Modbus TCP and CANopen are standard protocols 3 it is an integrated system all the functions needed for specific applications are enclosed in a single device and are configurable via software Main functions and features of Z TWS device are described in the following lines PLC FOR SMALL AND MEDIUM AUTOMATIONS The Z TWS is a
13. Figure 28 Configuring the Z TWS with I O Modbus step 10 With reference to the previous window click OK then select the Resources window in the left side of the main page Be amp 01943 602001 salesQissltd co uk b www issltd co uk USER MANUAL SENECA Z TWS 3 and Z TWS64 CoDeSys Untitled PLC Configuration File Edit Project Insert Extras Or Seel aag 2 Resources cial Global Variables B library ANALYZATION LIB 5 A library IECSFC LIB 11 5 08 1 aa library SYSLIBCALLBACK LI A library SYSLIBTIME LIB 11 6 Eg library SYSTASKINFOLLIB 1 AY Alarm configuration Til Library Manager E Log a PLC Browser PLE Configuration el Sampling Trace r7 AR Target Settings ee Task configuration rU Watch and Recipe Manage d Workspace RESOURCES Figure 29 Configuring the Z TWS with I O Modbus step 11 Select PLC Configuration and the following window appears as you can see there is a list of modules opened For each module the exported variables can be viewed to 01943 602001 salesQissltd co uk b www issitd co uk A USER MANUAL SENECA Z TWS 3 and Z TWS64 r e CoDeSys aa pro PLC Configuration e NN TNR NR File Edit Project Insert Extras Online Window Help aea 2 I amp amp 9 pla Pesoucez U MEeee Mme E GlobalVaiables i pou L3 d l bram NALYzATIO F Z203 VAR ibrar EXOR ib 14 Er Z
14. PLC programmable logic controller used to manage small medium dimension plants It is optimized to process a large number of data and to perform analogue controls the Z TWS processes floating point calculations and it consists of a significant amount of memory The system used for field connection and data acquisition is based on a RS485 bus with Modbus RTU protocol or a CAN bus with CANopen protocol The Seneca Z PC Line is constituted by digital and analogue modules for I O management The Z TWS has a RS232 serial port for example to connect the Z TWS to a PC or modem using RS232 to display diagnostics of functioning fu amp 01943 602001 salesQissltd co uk b www issltd co uk USER MANUAL SENECA Z TWS 3 and Z TWS64 I amp SENECA Te das Figure 3 TWS used to manage an automation plants SUPERVISORY OF PLANTS AND DATA ACQUISITION Thanks to the Ethernet TCP IP interface it is possible to connect the Z TWS device to supervisory and or data acquisition stations The following communication protocols are implemented HTTP Advanced communication that allows a complete control of the device reading and writing of variables file transfer in reading writing complete control of the PLC and data acquisition start stop restart IP configuration parameters FTP Service protocol used to transfer configuration files or web pages MODBUS TCP Standard protocol used to capture and write all I O v
15. S46 REAR BUS CONNECTOR FRONT SCREW TERMINAL BLOCK PORT 1 e e RS485 Terminator OFF mm RS485 Terminator ON JP CAN PORT CAN Terminator OFF om CAN Terminator ON PORT 2 Mode selector s s RS232 Enabled mm R5485 Enabled Figure 1 Jumper setting fu to 01943 602001 salesQissltd co uk b www issltd co uk USER MANUAL SENECA Z TWS 3 and Z TWS64 Autodiagnostic Functions The Z TWS is equipped with four LEDs on the front one of which indicates the status of form At startup the Z TWS performs some internal controls lasting a few tens of seconds and loads the operating system after which the LED Run will be piloted in the following way LED Off PLC STOP LED On PLC in RUN Flashing LED fault PLC If the LED is flashing it will be necessary to carry out checks for appropriate resolve the anomaly Err Pwr Lnk Run Z TWS3 Figure 2 Front panel of Z TWS module Be to 01943 602001 salesQissltd co uk b www issltd co uk USER MANUAL SENECA Z TWS 3 and Z TWS64 Systems based on Seneca Z PC Line Z TWS and I O modules The Z TWS module is a device that combines the functions of PLC web server data logger data acquisition thanks to its flexibility of configuration can be used in many configurations and architectures different from each other The combination of data acquisition process PLC module and WEB SERVER makes it possible to use the module as a Z TWS datalogger
16. Seneca Z 10DOUT Seneca Z 8A1 Seneca 7 D I0 Seneca 7 203 Seneca Z ARTD2 Seneca Z S TC Seneca S203T Full DC 16 Digital Inputs I2C 16 Digital Outputs LE Analog Inputs IDG Analog Outputs Seneca Test CanMaster Cut Ctrl X Copy Ctrl C Paste Ctrl V Delete Del Figure 43 Configuring the Z TWS with I O CANopen step 9 Be amp 01943 602001 salesQissltd co uk b www issltd co uk USER MANUAL SENECA Z TWS 3 and Z TWS64 Configure the CAN parameters as the baudrate baud rate Com Cycle Period psec Sync Window Lenght uer Sync COB ID 1128 activate m Mode ld i W Automatic startup W Support DSP3UT 4 01 and D5P306 Heartbeat Master me 0 Figure 44 Configuring the Z TWS with I O CANopen step 10 Be amp 01943 602001 salesQissltd co uk b www issltd co uk USER MANUAL SENECA Z TWS 3 and Z TWS64 To insert the I O Seneca module based on CANopen right click into the CanMaster line and select the desired modules Append Subelement CANopen head with integrated VO EDS Replace element CANopen SCM20 head EDS Calculate addresses Exor UniOP HMI EDS ZC 156DISDO EDS ZC 16DISDO HEARTBEAT VERSION EDS ZC 16DI8D0 OLD VERSION EDS T ZC 24DI EDS L ZC 24DI HEARTBEAT VERSION EDS ZC 24DI OLD VERSION EDS ZC 24DO EDS ZC 24D0 HEARTBEAT VERSION EDS ZC 24DO OLD VERSION EDS Z
17. TWS 3 and Z TWS64 An introduction of the Z NET The Z NET is the basic software for the design and configuration of systems Z TWS based on Modbus l O it is a free downloadable software and can be downloaded from the website www seneca it Moreover the Z NET software can be installed by the CD Seneca Package or freely downloaded from www seneca it File Project Online Tools ges nese es se 9 6 2 oceo00 S SISOS OCICIOC KEN al Y gun Type Date Description info 07 06 2011 15 03 14 282 Project created successfully info 07 06 2011 15 03 14 282 Project opened successfully to 01943 602001 sales issltd co uk b www issitd co uk USER MANUAL SENECA Z TWS 3 and Z TWS64 Figure 6 A Seneca Z NET page The Z NET software allows easily gt to configure a bus with Z TWS and I O Modbus The Z NET permits to configure all parameters to manage a bus constitued by a Modbus master and one or more Modbus slaves gt to configure Modbus I O projects The Z NET permits to configure all parameters to manage a bus constitued by one o more Modbus slaves with a generic Modbus master For these purposes Seneca offers many modules that can be used depending on the particular demand of the Customers gt to configure the Data Recorder and analyze the data Data recorder is included a Z NET that allows to perform the data logging for all the variables that are available for each modules and particular o
18. ZNET3VA ff sdr lt E l 5 ll EE EE 192 168 90 101 1000 Scheduler amp View Pages Display ali Graph Figure 62 Configuring the Data Recorder step 6 Set the TCP communication parameters sampling time and Download folder voices after this click on Scheduler to configure the record type manual or from scheduler and the other parameters to 01943 602001 sales issltd co uk b www issitd co uk A USER MANUAL SENECA Z TWS 3 and Z TWS64 Ke z enh See dera D 5 EZ y md KST i NE Picea Darran 22 Tone Essentia yc Al Drmmat ZNIETO ED PA Seneca Z NET3 Data VAL er CAL Polis manuele Vocumen SAP hage etti LNE TS HA SG y i state dime 00 00 Le E d o e 03 00 Monday 06 00 H5 Tuesaay 09 00 HH Wednesday 00 Thursday HH Friday La i ud JC P 3 EJ E sisis 23 t A 3 4 Recording length 01 00 EH Connect if disconnected Figure 63 Configuring the Data Recorder step 7 Click on the view pages to choose the channels that you desire analyze for each module and the number of pages It is possible to add the graph in the report and a table in the report to 01943 602001 sales issltd co uk b www issitd co uk USER MANUAL SENECA Z TWS 3 and Z TWS64 View Pages Not Selected Channels Aggiungere Aggiungere Nome Tipo Grafico nel Tabella nel Report Pa
19. a full use of the Data Recorder software requires the purchase of a license hardware key USB Contact Seneca for more informations and to acquire a license There are several types of licenses which differ from each other for the maximum number of channels that can be managed TREND VIEWER The Trend Viewer software is a free tool able to view the historical data recorded by Data Recorder software When the database mdb is open this database contains the recorded data the following operations are possible amp 01943 602001 sales issltd co uk b www issltd co uk USER MANUAL SENECA Z TWS 3 and Z TWS64 gt extremely accurate graphic visualization of the historical data stored by the Data Recorder software gt visualization of the alarms defined and recorded using the datarecorder software gt print of the obtained graphics gt export of the database currently open in a format CSV File Tools alm Trend Viewer Alarm Viewer Graph Option Pen 1 Pen 5 ee 5 She B D uuu Ir mj PIN D I gi a m a Normalization a Am l EEE J Auto Refresi REFRESH Pen 3 Pen 7 Auto Refresh REFRESH H5 BM al Orientation Show Pen 4 Pen 8 amp Horizontal 31 Max Values en l aeS icu l Show Analog Channels 01 Show Digital Channels Ripristina Date Actual Date T oe Beginning Date and Time 08 07 2011 w 08 52 32 Interval Ending Date and Time
20. at the sametime Purpose IEC program must call this function for each upload it wants to prepare IEC program must call this function to update upload data IEC program can call this function continously or only when data changes Entry ptrSrcBuf Pointer to source data dwDataLen Length of source data EXOR CAN BT SERVER UL windex WORD EXOR CAN BT SERVER UL EXOR CAM BT ResultCodesT ucsublndex BYTE ptrsrcBuf POINTER TO BYTE dwDataLen DWORD Library EXOR DeviceNET lib Name EXOR DEVN EM Description fh amp 01943 602001 sales issltd co uk b www issitd co uk USER MANUAL SENECA Z TWS 3 and Z TWS64 EXOR DEVM EM bEnable BOOL diStatus D diMacid DINT diRxLen D diSerice DINT diRxService D diClass DINT diRxData D dilnstance DINT diRxData1 D diTxLen DINT diRxDataz D diAttribute DINT diRxData3 D diTxData DINT diTxData1 DINT diTxData2 DINT diTxData3 DINT Library EXOR Modbus RTU lib Name EXOR ModbusRTU Description Modbus master protocol engine EXOR MODBUSRTU Enable BOOL Error SIMT Port SINT Slave BYTE OpCode BYTE Address WORD NrOfElem WORD DataP POIMTER TO BYTE Timeout DIMT Library EXOR Modbus TCP lib Name EXOR ModbusTCP Description Modbus master protocol engine fu amp 01943 602001 salesQissltd co uk b www issltd co uk USER MANUAL SENECA Z TWS 3 and Z
21. e File Edit Project Insert Extras Online Window Help amp aaa xe esee SHG s S S a PROGRAM PLC_PRG DA VAR UUUZ i PLC PRG PRG 0003END Var nun 4d al FREE Lin 1 Col 1 ONLINE Ov READ Figure 40 Configuring the Z TWS with I O CANopen step 6 to 01943 602001 sales issltd co uk b www issltd co uk A USER MANUAL SENECA Z TWS 3 and Z TWS64 Select the window Resources in the left side of the previous page and appears the following list me Loleoys Untmied PLL PRG FR OO e File Edit Project Insert Extras Online Window Help See B EEE Heen 2 Resources 1 Global Variables PROGRAM PLC PRG library ANALTASTIDM LIB 5 10 99 09 06 06 global variables I library IECSFC LIB 11 6 08 18 05 14 global variables I library SY SLIBCALLBACK LIB 11 6 08 18 05 14 global variables I library SYSLIBTIME LIB 11 5 08 18 05 14 global variables library SYSTASKINFOLLIB 11 6 08 18 05 14 global variables Fis Alarm configuration Til Library Manager Ef Log Ea PLC Browser UUUG 3 FEE PLC Configuration VU al Sampling Trace 2 Target Settings pr Task configuration d Watch and Recipe Manager e M Workspace 0015 0019 E J pd Figure 41 Configuring the Z TWS with I O CANopen step 7 Double click the PLC Configuration voice and appears the following to 01943 602001 salesQissltd co uk b ww
22. of bytes sent TCPSENDDATA diSocket DINT TcpSendData DINT pbyData DWORD diDataSize DIMT Name TcpServerOpenSocket Description Open a TCP server socket Heturn Main Socket Id TCPSERVEROPENSOCKET iPart INT TcpServerOpenSocket DINT diMaxConnections DINT diMaxDatasize DINT Name TcpServerWaitForConnect Description Wait for a TCP client to connect TGPSERVERWAITFORGONNEGT diServerSacket DINT TcpServerWaitForConnect CLIENT ACCEPT gt len enarifir Be amp 01943 602001 salesQissltd co uk b www issltd co uk USER MANUAL SENECA Z TWS 3 and Z TWS64 Name UdpOpenReceiveSocket Description Open socket to receive data via UDP Return Socket Id UDPOPENRECEIVESOCKET iPart INT UdpOpenReceiveSocket DINT Name UdpOpenSendSocket Description Open socket to send data via UDP Return Socket Id UDPOPENSENDSOCKET iPort INT UdpOpenSendSocket DINT Name UdpReceiveData Description Function to receive data via UDP protocol Return diBytesReceived Number of bytes received stIPAddress Transmitter IP address of client that sent the data UDPRECEIVEDATA di8ocket DINT UdpReceiveData CLIENT REPLY iPort INT pbyData DWORD diDataSize DINT Name UdpSendData Description Be amp 01943 602001 salesQissltd co uk b www issltd co uk USER MANUAL SENECA Z TWS 3 and Z TWS64 Function to send data via UDP protocol Ret
23. options Configuration ExOR SITEK CobeSys for SCMUS eLos Mips ALUR SITEK CobeSys for SCM2s SCM4s eCaos Mips Fp ESOR SITER CobeSys for SCM22 SCM4x SENECA eCos Mips Figure 34 Configuring the Z TWS with I O CANopen step 1 The features of the target settings for two alternative previous cases are shown in the following figures 01943 602001 salesQissltd co uk b www issltd co uk USER MANUAL SENECA Z TWS 3 and Z TWS64 SCM4x eCos Mips if you have selected the first target configuration NOTE USE THIS CONFIGURATION IF FIRMWARE VERSION IS 3 XX Target Settings Configuration Target Platform Memory Layout General Network functionality Visualization Base Size I Automatic li 6 1 00000 Global Automatic Memory M Automatic hemo Input f Automatic ime Output fr Automatic fesson Retain heoo MW Automatic ferson M Retain in own segment Maximum number of POL Total size of data memory f bonn Default Cancel Figure 35 Configuring the Z TWS with I O CANopen step 2A The following table shows the Memory layout for this configuration Size hex bytes Size decimal bytes 100000 1048576 1000 4096 2048 Opt 80 gt 2048 Retain gt 8000 32768 fu amp 01943 602001 salesQissltd co uk b www issltd co uk USER MANUAL SENECA Z TWS 3 and Z TWS64 SCM4x SENECA eCos Mips if you have se
24. to display and record the variable values of the I O modules both through serial system with I O devices only and through Ethernet Z TWS I O modules fu amp 01943 602001 salesQissltd co uk b www issltd co uk A USER MANUAL SENECA Z TWS 3 and Z TWS64 Seneca NET3 Data Recorder D SNETAJTVSSTVIES s r E Ae wWiesaizia Onire Strumenti 7 3 bed p Il E Finestre 3 Gruppo di canali ee Impestasjoni General TE Gruppi di Canadi 1000 4 0 MANG 18 03 00 18 04 00 18 05 00 18 06 00 18 07 00 Durata Grafica Orientamento Bl Mormalezato la e 18 08 00 7 X Data e Diei POIDA 20DG 17 34 42 387 gt D0 31 00 00 00 06 00 00 00 03 00 01 Rajnai PO OG 2006 17 3443 357 g 00 30 00 00 00 05 02 03 02 00 00 majoa 29 06 2006 17 39 49 387 gt 00 30 00 00 00 05 02 03 00 02 00 0 D 79 06 2006 17 34 48 Figure 8 A Seneca Data Recorder page This software allows To define groups of channels that will be defined in a same page To display the instantaneous value of channels To display by a graphics the instantaneous value of channels To display the alarms related to the channels in real time To record the values of the channels in an Access database with an extension mdb VV VV V ON To record the alarm events Then using the Trendviewer software it s possible to view the historical data acquired from the Data Recorder It is important to emphasize that
25. 8Al 1 VAR ibamIECSFCLIB J Er Z 4A 1 VAR library SYSLIBCALL library SYSLIBTIME library SS TASKIMF i S Alarm configuration Til Library Manager PLC Browser PLC Configuration ca Sampling Trace em Target Settings T ask configuration a Watch and Recipe Ms Workspace Figure 30 Configuring the Z TWS with I O Modbus step 11 to 01943 602001 salesQissltd co uk b www issitd co uk USER MANUAL SENECA Z TWS 3 and Z TWS64 AA j a Si E jj SENECA CPU TWS3 amp TWS64 REV 13 E E ag h 7 ATCIVAR Ea Analog Inputs VAR EE 3 AT ID0 DINT M1 LINCH1 CHANNEL 1 dM 5 a AT ID1 DINT M4 LINCH2 CHANNEL I su i E AT ID2 DINT M1 LINCH3 CHANNEL 1 IME Pa 3 AT ID3 DINT M4_LINCH4 CHANNEL 1 KIM B Z203IVAR ition La Double Analog Inputs VAR m AT ID4 REAL M2 VRMS FLOAT CHANNEL I m AT ID5 REAL M2 IRMS FLOAT CHANNEL I e AT ID6 REAL M2 WATT FLOAT CHANNEL I m AT ID7 REAL M2 FREQ FLOAT CHANNEL I A AT ID8 REAL M2 VARRMS FLOAT CHANNEL I tion AT ID9 REAL M2 COSF FLOAT CHANNEL I cipe pes h Z 8Al VAR Be awe AW o n m AT ID10 DINT M3 CH1 MEASURE CHANNEL 1 AT 1D11 DINT M3 CH2 MEASURE CHANNEL I AT ID12 DINT M3 CH3 MEASURE CHANNEL I ho AT ID13 DINT M3 CH4 MEASURE CHANNEL I AT ID14 DINT M3 C
26. AN Handle of a previously created RxSlot Id DINT Mask DINT EXOR_CAN_RXSLOT_SETIDANDMASK Handle hCAN EXOR_CAN_RxSlot_SetidAndMask eCAN Id DINT Mask DINT POUs Data ty i Visualiz o Global Loading library C Program Files x86 3S Software CoDeSys V2 3 Targets SenecalLib_SITEK EXOR_CAN2 lib uw r Arie fa IAran Figure 16 The CoDeSys page a detailed visualization of the libraries In the appendix B are described the Seneca libraries that can be used to CoDeSys 01943 602001 salesQissltd co uk b www issitd co uk USER MANUAL SENECA Z TWS 3 and Z TWS64 Configuring Z TWS with I O Modbus modules The Z TWS permits to use CoDeSYS like a PLC developing environment but first of all it is necessary configure Z TWS Serial Ports and to assign address e baudrate to I O modules All these steps are possible using the softwares ZNET as configurator and Codesys as shown in the following block diagram VO configuration Figure 17 Block diagram process to configure the Z TWS with I O Modbus For example open Seneca ZNET and click on new project the following window appears Project Configuration Nome del progetto NewProject PROGETTO CPU E I O Posizione C Users Emanuele Documents Progetti ZNET3 fu t 01943 602007 sales issltd co uk www issltd co uk USER MANUAL SENECA Z TWS 3 and Z TWS64 Figure 18 Configuring th
27. C 3A0 EDS ZC 3A0 HEARTBEAT VERSION EDS ZC 3A0 OLD VERSION EDS ZC ARTD EDS ZC 4RTD HEARTBEAT VERSION EDS ZC ARTD OLD VERSION EDS ZC 8AI EDS ZC BAI HEARTBEAT VERSION EDS ZC 8AI OLD VERSION EDS ZC BTC EDS ZC 8TC HEARTBEAT VERSION EDS ZC 8TC OLD VERSION EDS C 56 EDS C 5G HEARTBEAT VERSION EDS ZC 5G OLD VERSION EDS Cut Ctrl A Copy Ctrl C Ctrl V Del Paste Delete Figure 45 Configuring the Z TWS with I O CANopen step 11 Be amp 01943 602001 salesQissltd co uk b www issitd co uk USER MANUAL SENECA Z TWS 3 and Z TWS64 Configure the corresponding window CAN parameters Receive PDO Mapping Send PDO Mapping Service Data Objects Module parameters E General Made ID E Write DCF Create all SOO s Optional device Reset Made Mo initialization Mode guard Info W Modeguarding Guard COB ID Us 00 Nodeld Guard time ms MM Life time Factor MM Heartbeat settings Iv Activate heartbeat generation Heartbeat producer time 0 m r Emergency telegram W Emergency COB ID NODEID 0s60 Communication Cycle Cycle Period pec 0 Figure 46 Configuring the Z TWS with I O CANopen step 12 Be amp 01943 602001 salesQissltd co uk b www issltd co uk USER MANUAL SENECA Z TWS 3 and Z TWS64 To download the program select the Online gt L
28. CAN2 lib Name EXOR CAN Init Description Initialize specified CanPort WARNING If specified CanPort is already used in a CanMaster board in PLC Configuration then the CanPort is already initialized and EXOR CAN Init MUST NOT be called Return WARNING For Error Codes of this function please see eCAN Init DataType CANDRV OK if successful otherwise EXOR CAM IMIT CanPort INT EXOR CAN Init eCAN Init Baudkbps INT OptionsFlags eCAN OptionsFlags Name EXOR CAN rxSlot Create Description WARNING Each time this function is called an RxSlot is created and some memory depending on FIFO Len parameter is allocated for it For this reason application program must not continuosly create Rx Slots instead application program should create the needed quantity of Rx Slots at the startup and then use these Rx Slots Purpose This function creates an Rx Slot An Rx Slot is a place a buffer where received CAN messages are deposited The parameter FIFO Len specify how many CAN messages the Rx Slot can contain Rx Slot is a buffer FIFO style First In First Out Application program calls EXOR CAN RxSlot GetPacket function to unload one message at a time from this FIFO fh amp 01943 602001 sales issltd co uk b www issitd co uk USER MANUAL SENECA Z TWS 3 and Z TWS64 How FIFO Len parameter should be calculated First the execution time of the full application program should be measured estimated then t
29. D Library EXOR sys lib Name EXOR flashRD Description read one or more consecutive bytes from main flash memory EXOR FLASHRD offset DWORD EXOR flashRD SIMT dataP POINTER TO BYTE length DWORD Name EXOR flashWR Description write one or more consecutive bytes into main flash memory available on SCMO5 SCM11 SCM21 to 01943 602001 salesQissltd co uk b www issitd co uk USER MANUAL SENECA Z TWS 3 and Z TWS64 EXOR_FLASHWR enable BOOL error SINT offset DWORD dataP POINTER TO BYTE length DWORD Name EXOR SPIfIRD Description read one or more consecutive bytes from SPI flash devices on master board or slave boards through the I O bus EXOR_SPIFLRD module SINT EXOR SPIfIRD SINT offset DWORD dataP POINTER TO BYTE length DWORD Name EXOR SPIfIWR Description write one or more consecutive bytes into SPI flash devices on master board or slave boards through the I O bus EXOR_SPIFLWR enable BOOL error SINT module SINT offset DWORD dataP POINTER TO BYTE length DWORD Name EXOR WDreset Description clear the watch dog giving more time to CPU to run PLC program about 1 3 seconds EXOR WDRESET EXOR WDreset BOOL fu amp 01943 602001 salesQissltd co uk b www issltd co uk USER MANUAL SENECA Z TWS 3 and Z TWS64 Library lecsfc lib Name SFCActionControl Description Action control block for IEC 61131 3 SFC actions
30. ERFLOW BOOL TN DWORD TV DWORD Y OFFSET REAL Y MIN REAL Y MAX REAL MANUAL BOOL 7 RESET BOOL Function manipulators Name CHARCURVE Description function block to map an input signal on a characteristic curve CHARCURVE IN IMT OUT INT N BYTE LJ ERR BYTE P ARRAY 0 10 OF POINT VAR IN OUT P ARRAY 0 10 OF POINT VAR IN OUT Name RAMP INT Description function block to limit the slope of a value to a certain value RAMP INT IN INT OUT INT ASCEND INT DESCEND INT RESET BOOL TIMEBASE TREN Name RAMP_REAL Description function block to limit the slope of a value to a certain value Be amp 01943 602001 salesQissltd co uk b www issltd co uk USER MANUAL SENECA Z TWS 3 and Z TWS64 RAMP REAL IN REAL OUT REAL ASCEND REAL DESCEND REAL TIMEBASE TIME RESET BOOL gt Mathematical functions Name DERIVATIVE Description function block to approximate the derivative of a value DERIVATIVE IN REAL OUT REAL TM DWORD 8x RESET BOOL 8t Name INTEGRAL Description function block to approximate the integral of IN over the time INTEGRAL IN REAL OUT REAL TM DWORD f OVERFLOW BOOL RESET BOOL Name STATISTICS_INT Description function block for statistics calculating minimum maximum and average of an input value STATISTIGS IMT IN INT MM INT RESET BOOL MX IMT AVG IN
31. H5 MEASURE CHANNEL I AT ID15 DINT M3 CH amp MEASURE CHANNEL 1 AT ID16 DINT M3 CH7 MEASURE CHANNEL 1 bon AT ID17 DINT M3 CH8 MEASURE CHANNEL 1 B hi 7 44 1 VAR Figure 31 Configuring the Z TWS with I O Modbus step 12 To download the program select the Online gt Login from menu Be amp 01943 602001 salesQissltd co uk b www issitd co uk USER MANUAL SENECA Z TWS 3 and Z TWS64 CoDeSys 11 pro PLC PRG File Edit Project Insert Extras Online Window Help aeu Hga egin JgogiPROd Logout Ctrl F8 Global Variables Download library ANALYZATI Run library EXDR lib 11 iul Shifts F8 Figure 32 Configuring the Z TWS with I O Modbus step 13 To run the PLC program it is necessary to select Online gt Run fu amp 01943 602001 salesQissltd co uk b www issltd co uk USER MANUAL SENECA Z TWS 3 and Z TWS64 Configuring the Z TWS with I O CANopen Codesys allows to configure a TWS project based on the CANopen bus using the Seneca I O modules for example ZC 8Al ZC SG etc that supports CANopen protocol instead for more information about the use of Isagraf for CANopen see the appendix C Configuration with Codesys Figure 33 Block diagram process to configure the Z TWS with I O CANopen For example launch Codesys and create a new project press file NEW the following window appears select one of the two following
32. LC ini are described in the appendix A WEB SERVER The Z TWS has a built in webserver so by Z NET Web Editor it is possible to create and upload the HTML pages this allows to accede to plants through a remote connection for supervisory remote control functions and remote support recovery variation of parameters system maintenance etc All system configurations can be performed by remote TWS configuration I O modules PLC PLC CODESYS The Z TWS can be used as an integrated PLC able to manage small medium sized automation plants because it consists of a significant amount of memory and computing capacity The inputs and the outputs of PLC are modules that can be interfaced with Modbus RTU protocol or CANopen protocol like Seneca Z PC Line module so it operates like any control evietam hii tha I A daviinae ara rao ncantralizand oe amp 01943 602001 sales issltd co uk b www issitd co uk USER MANUAL SENECA Z TWS 3 and Z TWS64 The PLC target is based on CoDeSys IEC61131 standard the programming languages supported are contacts LD flow chart FC diagram block FDB sequential flow chart SFC structured language ST e instruction list IL CoDeSys Standard Y CTU AE A e File Edit Project Insert Extras Online Window Help SE HeH H e Ga UNGTION BLOCK CTU I POUs DOTA Counter Up El 3 Bistable Function Blocks OOU3 CV is incremented by 1 if CU has a risi
33. O Len specify how many CAN messages the Rx olot can contain Rx Slot is a buffer FIFO style First In First Out Application program calls EXOR CAN RxSlot GetPacket function to unload one message at a time from this FIFO How FIFO Len parameter should be calculated First the execution time of the full application program should be measured estimated then the quantity of CAN messages which can be received in the Rx Slot in this time should be computed Parameter CanPort selects the CAN Port if your hardware has only one CAN Port then specify zero for this parameter After the Rx Slot is created it is configured for receiving no message at all To select which CAN messages have to be received by an Rx Slot the function EXOR CAN RxSlot SetldAndMask must be used fh amp 01943 602001 Q sales issltd co uk b www issltd co uk USER MANUAL SENECA Z TWS 3 and Z TWS64 EXOR CAN RASLOT CREATE CanPort INT EXOR CAM RxSlot Create hCAM FIFO Len INT Name EXOR CAN RxSlot GetPacket Description This function unloads one message from the specified RxSlot EXOR CAN RXSLOT GETPACKET Handle hCAM EXOR CAM RxSlot GetPacket eCAN PacketP POINTER TO CAN PacketT Name EXOR CAN RxSlot SetldAndMask Description This function is used after creating an RxSlot with EXOR CAN RxSlot Create function Application program can call EXOR CAN RxSlot SetldAndMask function each time it wants to change which CAN m
34. Output becomes false and is rose again as soon the second SMS has been fetched Be to 01943 602001 salesQissltd co uk b www issltd co uk USER MANUAL SENECA Z TWS 3 and Z TWS64 PPP GETSMS EnableF BOOL O Donef BOOL Nett BOOL Q State INT MsqDelF BOOL 0 PPPstatus INT O Result INT 0 MoMoreMsgF BOOL O Sender STRING 40 0 DateTime STRING 40 OQ Text STRING 256 Name PPP ModemcCtrl Description allow various functions of control on Modem PPP MODEMCTRL Mode INT Q Status INT Command POINTER TO STRING 80 0 PPPstatus INT Send BOOL O Answer STRIMG 255 timeout TIME Name PPP_SendSMS Description PPP control for SMS send on GSM modem PPP SENDSMS sendS amp M amp S BOOL 0 DoneF BOOL SMSCnum POINTER TO STRING 60 OQ Status INT telnum POINTER TO STRING 80 O PPPstatus INT SMSbody POINTER TO STRING 80 0 LastMum STRING 40 timeout DWORD Name Profi DP Description Profibus DP light driver fu to 01943 602001 salesQissltd co uk b www issltd co uk A USER MANUAL SENECA Z TWS 3 and Z TWS64 PROFI_DP enable BOOL O Error DINT module num DINT O Lenin DINT dp node num DINT O LenQut DINT dp_id DINT addr_in POINTER TO BYTE addr_out POINTER TO BYTE send data BOOL Name TWS FTPget Description Connects to an FTP server and retrieves a file This FB posts a get request to the thread which performs the actual tra
35. Public Sub Serial Open ByVal comName As String ByVal baudRate As Integer ByVal parity As System IO Ports Parity ByVal nbit As Integer ByVal stopBits As System IO Ports StopBits ByVal timeout As Integer ByVal flowControl As System IO Ports Handshake Opening of the serial port Public Sub Modbus setSerial ByRef com As Controlli clsSeriale Member of Controlli clsModbus Description Set the serial interface to be used Parameters com Serial port interface Public Property nRetry As Integer Member Controlli clsModbus Description oet number of retries of Modbus request Return values Actual number of retries Note Must be from 1 to 9 included fu amp 01943 602001 salesQissltd co uk b www issltd co uk USER MANUAL SENECA Z TWS 3 and Z TWS64 Public Property Address As Integer Member of Controlli clsModbus Description set the Modbus address Return values Actual Modbus address Note Must be from 1 to 253 included Public Function Read_Coils ByVal startRegister As Integer ByVal nCoils As Integer As Byte Member of Controlli clsModbus Description Read Coils Modbus request Parameters startRegister Start register address 0 to 65535 nCoils Number of coils 1 to 2000 Return values Coils value Public Function Read Discrete Inputs ByVal startRegister As Integer ByVal n nputs As Integer As Byte Member of Controlli clsModbus Description Read Discrete Inputs Modbus requ
36. REPLACE Description Replaces L characters of STR1 by STR2 starting at the POS th character position REPLACE STR1 STRING 255 REPLACE STRING 255 STR2 STRING 255 L UINT P UINT Name RIGHT Description Rightmost SIZE characters of STR RIGHT STR STRING 255 RIGHT STRING 255 SIZE UINT gt Timer Name RTC Description RIG EN BOOL Q BOOL PDT DT CDT DT amp 01943 602001 salesQissltd co uk b www issltd co uk USER MANUAL SENECA Z TWS 3 and Z TWS64 Name TOF Description Timer of delay Q is FALSE PT milliseconds after IN had a falling edge TOF IN BOOL Q BOOL PT TIME ET TIME Name TON Description Timer on delay Q is TRUE PT milliseconds after IN had a rising edge TON IN BOOL Q BOOL PT TIME ET TIME Name TP Description Timer Pulse QO produces a High Signal with the length of PT on every rising edge on IN TP IN BOOL Q BOOL PT TIME ET TIME gt Trigger Name F_TRIG Description Falling Edge detection F_TRIG CLK 500 Ra BOOL fh amp 01943 602001 sales issltd co uk b www issitd co uk USER MANUAL SENECA Z TWS 3 and Z TWS64 Name R_TRIG Description Rising Edge detection R_TRIG CLK Boo ia Q BOOL Library SysLibCallback lib Name SysCallbackRegister Description Function to register a definite callback function on runtime events Return TRUE if callback function can be regi
37. SamplingRate2 50 NOTE The Modbus registers are 16 bits so if for example you want to read 3 registers BlockLength parameter must contain the value 6 if you want to read the 4 parameter must contain the value 8 and so on In the example above the first block requires reading every 1000mSec of register 40002 of the expansion module with address 2 the second block requires reading every 500msec registers 40020 and 40021 of the expansion module with address 3 oe amp 01943 602001 sales issltd co uk b www issitd co uk USER MANUAL SENECA Z TWS 3 and Z TWS64 Appendix B Seneca libraries for CoDeSys IMPORTANT The file system are managed by the OS File System the number of files that can be opened at the same time is limited as well the number of files that can be saved in a same directory and in the root It is important to consider that on a PLC the flash has a limited cycles of writing To avoid decrease in performances like a PLC watchdog reset it is not recommended to perform multiple operations in the same file In particular it s recommended to avoid e to send a file through FTP while this file is open e to create a high number of files in a folder or a high number of folders e using different threads that perform multiple accesses to a same file The performances of the system depend on the I O modules that have to be managed To improve the system performances it is important to consider that th
38. T fu amp 01943 602001 salesQissltd co uk b www issltd co uk A USER MANUAL SENECA Z TWS 3 and Z TWS64 Name STATISTICS_REAL Description function block for statistics calculating minimum maximum and average of an input value STATISTICS REAL IN REAL MM REAL RESET BOOL MX REAL AVG REAL Name VARIANCE Description function block to calculate the mathematical variance of a variable VARIANCE IN REAL OUT REAL RESET BOOL Signal generators Name BLINK Description Function block to simulate a turn signal BLINK ENABLE BOOL OUT BOOL TIMELOW TIME TIMEHIGH TIME Name GEN Description function block for generating some periodic functions to 01943 602001 salesQissltd co uk b www issitd co uk A USER MANUAL SENECA Z TWS 3 and Z TWS64 GEN MODE GEN MODE OUT INT BASE BOOL PERIOD TIME Manet IMT bolets EN RESET BOOL Library Util no Real lib gt Analog monitors Name HYSTERESIS Description function block which sets OUT to TRUE if input IN is less than LOW and which sets OUT to FALSE if input IN is bigger than HIGH HYSTERESIS IN INT OUT BOOL HIGH IMT LOW INT Name LIMITALARM Description function block monitoring whether the input value IN lies between LOW and HIGH LIMITALARM IN IMT HIGH INTS LOW INT ES to 01943 602001 salesQissltd co uk b www issitd co uk USER MAN
39. TWS64 Configuration Wizard Project Configuration Modules Insert New Modules Set Modules Set to insert Module Type kon 7 Z DIN Figure 22 Configuring the Z TWS with I O Modbus step 5 Click on the end button and the following configuration page appears only an example du amp 01943 602001 salesQissltd co uk b www issltd co uk USER MANUAL SENECA Z TWS 3 and Z TWS64 00006 Q Configurazione Hardware Configurazione Parametri di Rete Porte Seriali Modbus Parametri Sicurezza PPP Porta Seriale 0 Porta Seriale 1 ou c Task Tipo Task Tipo E Modulo 1 Z DIN 1 Libera 4 idet Modbus Master R5485 Baud Rate Data Bits Stop Bits Parita Baud Rate Data Bits Stop Bits Parita B rouo 2 2 340 2 33400 ms 0 Sanur 1 vo Timeout mSec Delay mSec N di rety Primo Slave Ultimo Slave Timeout mSec Delay mSec N di rety Primo Slave Ultimo Slave Modulo 3 5203T 3 vers 200 5 0 1 254 200 Se 0 1 E 254 Porta Seriale 2 Porta Seriale 3 Task Tipo Task Tipo Libera Y RS232 Y Libera M RS485 Baud Rate Data Bits Stop Bits Parita Baud Rate Data Bits Stop Bits Parita 38400 8 1 Nessuna 38400 8 1 Nessuna Timeout mSec Delay mSec N di retry Primo Slave Ultimo Slave Timeout mSec Delay mSec N di rety Primo Slave Ultimo Slave 200 5 0 1 254 200 5 0 1 254 4 Ww Figure 23 Configuring the Z TWS with I O Modbus ste
40. TWS64 EXOR_MODBUSTCP Enable BOOL Error SINT IP STRING 80 Slave BYTE OpCode BYTE Address WORD NrOfElem WORD DataP POINTER TO BYTE Timeout DIMT Library EXOR PMbus lib Name EXOR PMbyteRD Description read one byte from selected slave at specified address EXOR PMBYTERD address DWORD EXOR_PMbyteRD BYTE Name EXOR PMbyteWR Description write one byte to selected slave at specified address EXOR PMBYTEWR address DWORD EXOR PMbyte WR SINT data BYTE Name EXOR PMclose Description stop the I O bus EXOR PMCLOSE mode BYTE EXOR PMclase SINT fu amp 01943 602001 salesQissltd co uk b www issltd co uk USER MANUAL SENECA Z TWS 3 and Z TWS64 Description write one byte to command register of selected slave EXOR_PMCMDWR bitldx BYTE EXOR PMcmdWR SINT bitVal BOOL Name EXOR_PMgetBus Description wait until Bus becomes free in case of other tasks were accessing the bus EXOR_PMGETBUS EXOR PMgetBus SINT Name EXOR_PMinit Description initialize the I O bus EXOR PMINIT mode BYTE EXOR PMinit SINT Name EXOR PMrelBus Description release the use of the Bus EXOR PMRELBUS EXOR PMrelBus SINT Name EXOR PMsetAdr Description select one slave on the bus for future use EXOR PMSETADR SlaveAdr BYTE EXOR PMsetAdr SINT subAdr BYTE fu amp 01943 602001 salesQissltd co uk b www issltd co uk
41. UAL SENECA Z TWS 3 and Z TWS64 gt BCD conversion Name BCD_TO_INT Description function reads BCD Byte and returns its INT value a wrong BCD value causes a return of 1 BCD TO INT B BYTE BED TO INT INT Name INT TO BCD Description function reads INT and returns its BCD value a wrong INT value lt 0 or gt 99 causes a return of 255 INT TO BCD I INT INT TO BCD BYTE Bit byte functions Name EXTRACT Description function returns Bit N of value X EXTRACT X DWORD EXTRACT BOOL MH BYTE Name PACK Description pack eight bits into 1 byte fh amp 01943 602001 sales issltd co uk b www issitd co uk USER MANUAL SENECA Z TWS 3 and Z TWS64 PACK 0 BOOL PACK BYTE 1 BOO B2 BOO H3 BOO B4 BOO 5 BOO BOO BOO Name PUTBIT Description function sets bit N of X to B and returns new value PUTBIT X DWORD PUTBIT DWORD N BYTE B BOOL Name UNPACK Description function block unpacks byte into 8 bits UNPACK B BYTE Function manipulators Name RAMP INT Description function block to limit the slope of a value to a certain value fh amp 01943 602001 sales issltd co uk b www issitd co uk USER MANUAL SENECA Z TWS 3 and Z TWS64 RAMP_INT IN INT OUT INT ASCEND INT DESCEND INT TIMEBASE TINE RESET BOOL gt Mathematical functions Name STATISTICS_INT Description function block fo
42. XOR Canh lib Name UniopCANH Description fh amp 01943 602001 sales issltd co uk b www issitd co uk USER MANUAL SENECA Z TWS 3 and Z TWS64 UNIOPCANH MasterlD USINT Status USINT MinBound UINT MaxBound UINT HMir POINTER TO HMireq HMIt POINTER TO HMlans MemPt DWORD Library EXOR CANopen lib Name EXOR CAN IO CTRL Description EXOR CAM IO CTRL whlodeNumber WORD wSubNodeNumber WORD bIxPDO BOOL ucPDOnr BYTE diFunctionCode DINT di amp rgument DINT Name EXOR CAN NMT Description EXOR CAM NMT bEnable BOOL EXOR CAN NMT BOOL wCanPort WORD ucCmd BYTE ucNodeld BYTE Name EXOR CAN SDO RD Description Be amp 01943 602001 salesQissltd co uk b www issltd co uk USER MANUAL SENECA Z TWS 3 and Z TWS64 EXOR CAN SDO RD bEnable BOOL bDone BOOL wCanPort WORD diErrCod DINT wTxCOBID WORD dwAbortCod DWORD wRxCOBID WORD dilntegervalue DINT windex WORD rFloatValue REAL ucSublndex BYTE wDataType WORD Name EXOR CAN SDO WR Description EXOR CAN 3SDO WR bEnable BOOL bDone BOOL wCanPort WORD diErrCod DINT wTxCOBID WORD dwAbortCod DWORD wRxCOBID WORD windex WORD ucSublndex BYTE wDataType WORD dilntegerValue DINT rFlaatvalue REAL Library EXOR CANopen2 lib Name EXOR CAN INIT NODE Description EXOR CAN INIT NODE CanPort INT EXOR CAN INIT NODE BOOL NodelD
43. a rising edge QV is TRUE if counter is 0 QU is TRUE if counter is PV CTUD QU BOOL QD BOOL GV INT gt String functions Name CONCAT Description Concatenation of two strings CONCAT STR1 STRING 255 CONCAT STRING 255 STR2 STRING 255 Name DELETE Description Delete LEN characters of STR beginning at the POS th character position fh amp 01943 602001 sales issltd co uk b www issitd co uk USER MANUAL SENECA Z TWS 3 and Z TWS64 DELETE SIR STRING 255 DELETE STRING 255 LEN UINT Name FIND Description Find the character position of the beginning of the first occurence of STR2 in STRI If no occurence of STR1 is found then the result is O FIND STR STRING 255 FIND INT STR2 STRING 255 Name INSERT Description Insert STR2 into STR1 after the POS th character position INSERT STRA STRING 255 INSERT STRING 255 STR2 STRING 255 POS UINT Name LEFT Description Leftmost SIZE characters of STR LEFT STR STRING 255 LEFT STRING 255 SIZE UINT Name LEN Description String length function LEN STR STRING 255 LEM INT fu amp 01943 602001 salesQissltd co uk b www issltd co uk A USER MANUAL SENECA Z TWS 3 and Z TWS64 Name MID Description LEN characters of STR beginning at the POS th character position MID STR STRING 255 MID STRING 255 LEN UINT POS UINT Name
44. ariables of PLC SMTP This protocol is implemented in a complete modality selection of addresses server object text etc and it allows the e mail sending Be to 01943 602001 salesQissltd co uk b www issltd co uk USER MANUAL SENECA Z TWS 3 and Z TWS64 ARCHITECTURE Z TWS A TINY WEB SERVER The Z TWS device is based on the most widespread standards Ethernet interface stack TCP IP HTTP server and allows the integration of any systems based on Modbus RTU protocol and serial interface RS485 with Intranet Internet network When the HTML pages are uploaded see Z NET web editor software they can be downloaded into the flash disk using FTP protocol The module can be protected by password to avoid unauthorized access Moreover if you connect the Z TWS to a GSM or GPRS modem it is possible to send related SMS or call the interested center The following figure shows the architecture of TWS with I O serial modules the related interfaces and the communication between them I O modbus I O CANopen bus Modbus bus CANopen Rs485 SERIAL PORTS CAN PORT OD L L L PLC Flash Codesys disk MX O E E Ze N LLI Retentive Webserver RTC variables FeRAM Figure 4 Block diagram of a Z TWS module fu amp 01943 602001 salesQissltd co uk b www issltd co uk USER MANUAL SENECA Z TWS 3 and Z TWS64 YO MODBUS AND I O CANopen The bloc
45. b www issltd co uk USER MANUAL SENECA Z TWS 3 and Z TWS64 Page name Empty Page Plot Graph Page O Webcam Page Totals Page Figure 50 Window to select the type of the page for Web Editor For example select Empty page the Web editor offers at the user some objects that can be used to set a page in a web format as shown in the following figure Label Panel Trend Graph Var Panel Bar Graph Button Toggle Image Set D GE ls l n Figure 51 Objects that can be used to realize a page with Web Editor fh to 01943 602001 salesQissltd co uk b www issltd co uk USER MANUAL SENECA Z TWS 3 and Z TWS64 The previous objects described in the following table can be individually configurated thanks the window Property in the right side of the page for example the text the X Y position the colour of the graph etc OBJECT DESCRIPTION It allows to insert a simple text label in the page It allows to insert a simple image in the page Label panel Depending on the value of the associated variable the string configured will be displayed Trend Graph It allows to create a graph to trace the desired variables It allows to load an output or read a variable Bar graph It allows to display the value of a variable with a colored bar Led It allows to insert a LED in the page referred to a boolean variable variable is displayed One of more rilevant functionality offered by th
46. causes a return of 1 BCD_TO_INT B BYTE BCD TO INT INT fh amp 01943 602001 sales issltd co uk b www issitd co uk USER MANUAL SENECA Z TWS 3 and Z TWS64 Name INT TO BCD Description function reads INT and returns its BCD value a wrong INT value lt 0 or gt 99 causes a return of 255 INT_TO_BCD I INT INT_TO_BCD BYTE gt Bit byte functions Name EXTRACT Description function returns Bit N of value X EATRACT X DWORD EXTRACT BOOL N BYTE Name PACK Description pack eight bits into 1 byte PACK 0 BOOL PACK BYTE 1 BOOL 2 BOOL 3 BOOL B4 BOOL 5 BOOL B6 BOOL 7 BOOL Name PUTBIT Description function sets bit N of X to B and returns new value fh amp 01943 602001 sales issltd co uk b www issitd co uk USER MANUAL SENECA Z TWS 3 and Z TWS64 PUTBIT X DWORD PUTBIT DWORD M BYTE B BOOL Name UNPACK Description function block unpacks byte into 8 bits UNPACK B BYTE B0 B Be H3 B4 B5 B B Controller Name PD Description PD controller ACTUAL REAL TV DWORD Y OFFSET REAL Y MIN REAL Y MAX REAL MANUAL BOOL 7 RESET BOOL Name PID Description PD controller to 01943 602001 salesQissltd co uk b www issitd co uk USER MANUAL SENECA Z TWS 3 and Z TWS64 ACTUAL REAL Y REAL SET POINT REAL LIMITS ACTIVE BOOL KP REAL OV
47. cle At this point a new project of Codesys is opened from menu select Online Communication parameters and the following window will be opened Click on New to add a new channel and select TCP IP fh amp 01943 602001 salesQissltd co uk b www issltd co uk USER MANUAL SENECA Z TWS 3 and Z TWS64 Communication Parameters Channels E localhost via Tcp lp Communication Parameters New Channel Name localhost via Tcp lp Daez Cancel Serial 15232 35 Seral 15232 driver Tep lp Level 2 35 Tepelp level 2 driver Serial Modem 35 Modem driver Tcp lp Level Route 35 Tep lp Level 2 Router Driver Figure 38 Configuring the Z TWS with I O CANopen step 4 At this point replace the localhost string with the IP of the TWS used for example 192 168 90 101 Be amp 01943 602001 salesQissltd co uk b www issltd co uk USER MANUAL SENECA Z TWS 3 and Z TWS64 OF i cpilp Level 2 Cancel ust match with runtime New Motorola byteorder Mo Gateway INSERT THE IP OF TWS default 192 168 90 101 Figure 39 Configuring the Z TWS with I O CANopen step 5 With reference to the previous window click OK at this point in the following page write the program into this page because at least one statement is required otherwise an error occurs 6 for example digit in the line 1 and save CoDeSys Untit PRG e l
48. ddr POINTER TO STRING 80 TWS_SetNetPar INT net mask POINTER TO STRING 80 broadcast POINTER TO STRING 80 gateway POINTER TO STRING 80 server POINTER TO STRING 80 Name TWS SPrintFL Description create a message variable with C like formatting capabilities TWS_SPRINTFL format POINTER TO STRIMG 80 TWS SPrintFL BOOL pari REAL par REAL par REAL par4 REAL outstr POINTER TO STRING 80 Name TWS writeFile Description write one file form local to remote TWS enable BOOL O DoneF BOOL rempath POINTER TO STRING 80 OQ size DINT lacpath POINTER TO STRING 80 OQ Status INT usr POINTER TO STRING 80 psw POINTER TO STRING 80 timeout TIME Name TWS writeVar Description write one variable to local or remote TWS fu to 01943 602001 salesQissltd co uk b www issltd co uk USER MANUAL SENECA Z TWS 3 and Z TWS64 TWS WRITEVAR enable BOOL O DoneF BOOL name POINTER TO STRING 80 O Status INT vartype BOOL IntegerValue DINT FloatValue REAL usr POINTER TO STRING 80 psw POINTER TO STRING 80 timeout TIME Library EXOR lib Name EXOR IO CTRL EXOR 10 CTRL whodeNumber WORD EXOR 10 CTRL DINT diFunctionCode DINT di amp rgument DINT Library EXOR CAN lib Name EXOR CAN RxSlot Create Description This function creates an Rx Slot An Rx Slot is a place a buffer where received CAN messages are deposited The parameter FIF
49. e IEC program runs by Interrupt Service Procedures Data is written directly from the specified address ptrSrcBuf while the transfer proceeds This means that IEC program must not use the Data until the transfer has been completed EXOR CAN BT CLIENT UL dwServerkodd DWORD EXOR CAN BT CLIEMT UL EXOR CAM BT ResultCodesT dwsServerTxld DWORD windex WORD ucSubindex BYTE ptrDestBuf POINTER TO BYTE dwDataLen DWORD bAcceptSmallerSizeF BOOL Name EXOR CAN BT SERVER DL ry L fh amp 01943 602001 sales issltd co uk b www issitd co uk USER MANUAL SENECA Z TWS 3 and Z TWS64 WARNING Both client and server can do only one operation at a time i e they can do a download or an upload They CAN T do both a download and an upload at the sametime They CAN T more then one upload or download at the sametime Purpose IEC program must repeatedly call this function for each download it wants to accept If a download at the specified wlndex ucSublndex has been successfully received then data will be copied to the specified address ptrDestBuf and for the specified dwDataLen If data length specified by the Client differs from the one specified here dwDataLen parameter then Server refuses the download and returns an Abort Message to the client NOTE When this function is called for the first time for a given windex ucSubIndex then a buffer of dwDataLen size is allocated and associated to the speci
50. e Z TWS with I O Modbus step 1 Select Project CPU and I O and then Project CoDeSys for example now select Z TWS3 as CPU unit Moreover choose the target depending on the firmware version of libraries CPU Seneca 7TW503 Target a EXOR SITEK Codesys for SCM2x SCM4x SENECA eCos Mips EN EXOR SITEK Codesys for SCM2x 5CM4x eCos Mips Figure 19 Configuring the Z TWS with I O Modbus step 2 Click next and the following window appears fu t 01943 602007 sales issltd co uk www issltd co uk USER MANUAL SENECA Z TWS 3 and Z TWS64 one MN Nuovo progetto TWS Impostazioni principali Address User Name P Baud Rate Timeout m5ec Password Timeout m5ec 20000 abc 200 T Figure 20 Configuring the Z TWS with I O Modbus step 3 When the project is opened it add automatically CPU with IP ADDRESS 192 168 90 101 at this point click Next For example select Inserted off line in the following window fu amp 01943 602001 salesQissltd co uk b www issltd co uk USER MANUAL SENECA Z TWS 3 and Z TWS64 Configuration Wizard I ts INSERIMENTO INSERIMENTO E NESSUNA OFFLINE Figure 21 Configuring the Z TWS with I O Modbus step 4 Now the type of module window allows to insert all the desired Seneca Z PC Line modules in the new project opened fu amp 01943 602001 salesQissltd co uk b www issltd co uk USER MANUAL SENECA Z TWS 3 and Z
51. e access to files affects heavily in the cycle time of PLC So it is necessary to optimize the accesses to the file system in the PLC program Library TWS MISC lib Name PPP 2Serv Description Enable PPP server on 2 modems The PPP server is automatically started on the MODEM which receives a RING fu amp 01943 602001 salesQissltd co uk b www issltd co uk USER MANUAL SENECA Z TWS 3 and Z TWS64 PPP 2SERV enablet BOOL OQ statust DINT enable BOOL OQ status DINT 0 PPPstatus DINT OQ ActiveServ DINT Q ClientlP STRING 19 init POINTER TO STRING 80 O ServerlP STRING 19 disci POINTER TO STRING 80 disc POINTER TO STRING 80 ServerlP1 POINTER TO STRING 80 Server P2 POINTER TO STRING 80 timeout DIMT Name PPP connect Description PPP connection control PPP CONNECT connect BOOL O Status INT telnum POINTER TO STRING 80 O PPPstatus INT extras POINTER TO STRING 80 QO host STRING 23 user POINTER TO STRING 80 O LocallP STRING 23 password POINTER TO STRING 80 0 primaryDNSIP ST timeout DWORD O secondaryDNSIP ST Name PPP_GETSMS Description Get SMS from GSM modem SIM card Rising edge of EnableF Input starts operations As soon the first SMS has been fetched the DoneF Ouput becomes true and message text is available at Text Output At this point a rising edge on NextF Input causes another SMS to be fetched DoneF
52. e previous window consists in the Var pane object it is possible to assign the variables to the Data Acquisition Module automatically with the following steps open Web editor from Z NET toolbar File Project Online Tools 7 Property s Options BO Data Recorder Web Editor Add Module b 4 6 08 r amp Delete Module k Find present Modules Modules Insert Wizard Harc Modbus Network Occupation c e Module 1 Z DIN 1 Module 2 7 DIN 2 eer Figure 52 Starting the Web Editor oe amp 01943 602001 sales issltd co uk b www issitd co uk USER MANUAL SENECA Z TWS 3 and Z TWS64 drag the Var panel in the left side window Advanced objects ex Label Panel Trend Graph 25 Var Panel dj BarGrap Bar Grap iia Button Toggle E Image Set Figure 53 Drag a Var panel object into the page using Web Editor double click on the icon of Var panel a modify control window appears Wer i Type FLOAT Address on TWS Z1HREG40085 Figure 54 Modify Control window Be to 01943 602001 salesQissltd co uk b www issltd co uk A USER MANUAL SENECA Z TWS 3 and Z TWS64 click on the button near Name and the Select variable window appears 2 2S ore Color Modify Control ide Value abel Font abel Height Select Variable Modules Variables 1 Z DIN Name
53. ept Description Be amp 01943 602001 salesQissltd co uk b www issltd co uk USER MANUAL SENECA Z TWS 3 and Z TWS64 SYSSOCKACCEPT diSocket DINT SysSockAccept DINT pSockAddr DWORD pisackAddrSize DWORD Name SysSockBind Description SYSSOCKBIND diSaocket DINT SysSockBind BOOL pSockAddr DWORD disockAddrsize DINT Name SysSockClose Description SYSSOCKCLOSE diSacket DINT SysSockClose BOOL Name SysSockConnect Description SYSSOGKCONNECT diSacket DINT SysSockConnect BOOL pSsockAddr DWORD diSockAddrSize DINT Name SysSockCreate Description SYSSOCKOREATE di amp ddressFamily DINT SysSockCreate DINT diType DINT diProtocol DINT fu amp 01943 602001 salesQissltd co uk b www issltd co uk USER MANUAL SENECA Z TWS 3 and Z TWS64 Name SysSockGetHostByName Description SYSSOCKGETHOSTBYNAME stHostName POINTER TO STRING 80 SysSackGetHostByMame DWORD Name SysSockGetHostName Description SYSSOCKGETHOSTNAME stHostName POINTER TO STRING 80 SysSockGetHostName BOOL diNameLength DINT Name SysSockGetOption Description SYSSOCKGETOPTION diSocket DINT SysSockGetOption BOOL diL evel DINT diOption DINT pOptionValue DWORD piOptionLength DWORD Name SysSockHtonl Description SYSSOCKHTONL dwHost DWORD SysSackHtonl DWORD Name SysSockHtons Description fu a
54. era uea ANN r EAE ANa REENEN Ea anra aei 9 DATA ACQUISITION MODULE DAM rnnnnnnnnnnnnnnnnnrrnnnnnnnnnnnnnnnnnnnnnnnnnsssvnnnnnnnnnnnnnnnnnnnnnnnnnsssssnnnnnnnnnnnnnnnnnnnnene 9 VEPS 9 PECCODESYS RE EE EE ee Rene MEME 9 RETENTIVE NEA 11 VPN 13 DATA RECORDER ja 14 TREND VIEWER T A E E E A me nonaatane coats 15 Z NET AND TREND VIEWER INSTALLATION rrrrnnnnnnnnnnnnnrrorrnnnnnnnnnnnnnnnnnnnnnnnnssssrnnnnnnnnnnnnnnnnnnnnnnnnssssssnnnnnnnnnnn 16 Introduction of CoDeSys and its installation cecccccesseccceesecceceeecceeeesececeeececeenecceseesecessuecesseneceesenes 18 WHAT IS CODESYS M J 18 IOV TO TIN ST AEC ODE VS MU Um 18 HOW TO INCLUDE THE SENECA LIBRARIES INTO CODESYS rrrrnnnnnnnnnnnrrrrnnnnnnvrrrnnnnnnnnnnnnnnnnssrsnnnnnnvrnnnnnnnnnnnn 19 Appendix A About the PLC Inl file save 66 Appendix B Seneca libraries for CoDeSys rrrrrrnnnrrrrnnnnrrnnnnnnrrnnnnnrrnnnnnernnnnnnrrnnnnnsnnnnnnennnnnnernnnnnesennnuseeennnnseene 70 Appendix C CANopen I O with ISAGRAF PLC eeeeeeeeeeee e eee e enne nnn nenne renes nnns nasa nasa aaa n aas 132 Appendix D Library Controlli for Microsoft Visual Studio NET eee 135 fh to 01943 602001 salesQissltd co uk b www issitd co uk USER MANUAL SENECA Z TWS 3 and Z TWS64 CPU UNIT Features Z TWS3 Z TWS64 COMMUNICATION PORT SERIAL PORT nr 0 Y
55. es Yes RS232 2400 bps 8N1 SERIAL PORT nr 1 Yes Yes MODBUS CAN or rear from IDC10 or rear from IDC10 1200 115200 bps otop bit parity RS232 RS485 RS485 ETHERNET COMMUNICATION SERIAL BUS COMMUNICATION gt master slave RTU or TCP RS232 RS485 Speed serial 1200 115200 bps 1200 115200 bps Max distance 1200 m 1200 m connection CPU amp MEMORY 16 Mbyte of flash 128 Mbyte of flash Battery back up CONNECTIONS Removable 3 way screw terminals Removable 3 way screw terminals 5 08 5 08 mm pitch mm pitch Rear IDC10 connector for DIN 46277 Rear IDC10 connector for DIN 46277 rail rail Do RJ10 4 4 RJ45 on frontal RJ10 4 4 RJ45 on frontal SYSTEM PROTOCOLS PR VCS OS SMTP Yes CONFIGURATIONS SOFTWARE STANDARDS Z NET fh to 01943 602001 salesQissltd co uk b www issitd co uk USER MANUAL SENECA Z TWS 3 and Z TWS64 EN50081 2 EN55011 EN50082 2 EN61000 2 2 4 EN50140 141 EN61010 1 EN60742 POWER SUPPLY Supply voltage 10 40 Vdc or 19 28 Vac 50 60 Hz Power consumption Max 3 5 W Jumper setting A correct position of jumpers is necessary to choose a specified combination of the various communication ports An incorrect configurations preclude the employment of the module See installation manual for more informations CAN I R5485 Port FRONT SCREW TERMINAL BLOCK REAR BUS CONNECTOR REAR BUS CONNECTOR FRONT SCREW TERMINAL INEEN
56. escaler 1 64 SyncJumpWidth 1 4 TSetup 1 16 THold 1 8 SampleMode 0 1 are used to select the speed of the network and have special meaning only if the Baudrate parameter is equal to zero Normally should not be used Now you can point directly to the inputs and outputs of the slave stations using the appropriate boards The example below shows the use of a cando to point to the first digital output of the slave with station number 1 fh amp 01943 602001 sales issltd co uk b www issitd co uk USER MANUAL SENECA Z TWS 3 and Z TWS64 Eg EXOR ISaGRAF TEST CAN 1 0 connection Ele Edit Tools Options Help SG SBP tl KR a E canocfg e amp ra Nodeld 1 EB canodo n mm Length 1 Eas canoai no d ol Out 0 E canmdi n4 7 Lal In 5 vj 6 In a li Figure 69 Isagraf an example of I O connection Be amp 01943 602001 salesQissltd co uk b www issltd co uk USER MANUAL SENECA Z TWS 3 and Z TWS64 Appendix D Library Controlli for Microsoft Visual Studio NET Seneca provides a free library for Visual Studio NET that can be used from the version 2005 This library is free downloadable from the web site www seneca it This library allows the communication through serial port of a PC to the I O Modbus NOTE Seneca provides a variety of RS485 USB converters for example S117P and 5117P1 these devices allows to connect the Seneca Z PC Line modules with the PC
57. essages has to be received on an RxSlot If same Identifier Mask is used in more than one RxSlot then the last created RxSlot receives it Mask parameter gives you the possibility to receive multiple Identifiers in the same RxSlot Bits A 0 value means don t care or accept a 0 or 1 for that bit position A 1 value means that the incoming bit value must match identically to the corresponding bit of the specified Id To completely disable the reception of CAN messages on an RxSlot application program should call this function with Id 1 and Mask 1 EXOR CAM RXSLOT SETIDANDMASK Handle hCAN EXOR CAN RxSlot Setld ndMask eCAM Id DINT Mask DIMT Name EXOR CAN SendPacket Description WARNING There is a 64 messages buffer FIFO messages are deposited in this FIFO and are transmitted by interrupt service procedures as soon there are no higher precedence messages fh amp 01943 602001 Q sales issltd co uk b www issltd co uk USER MANUAL SENECA Z TWS 3 and Z TWS64 in the CAN bus If FIFO gets full because application program calls this function at a rate higher than CAN bus throughput then error CAN FIFO FULL is returned Return Return Value is CAN OK if message has been queued in the FIFO buffer or directly transmitted if FIFO is empty Return Value is CAN FIFO FULL if FIFO is full EAOR_CAN_SENDPACKET CanPort INT EXOR CAN SendPacket eCAN Packet POINTER TO CAN PacketT Library EXOR
58. est Parameters startRegister Start register address 0 to 65535 ninputs Number of discrete inputs 1 to 2000 Return values Discrete inputs fh amp 01943 602001 Q sales issltd co uk b www issltd co uk USER MANUAL SENECA Z TWS 3 and Z TWS64 Note Public Function Read File Record Simple ByVal FileNumber As Integer ByVal RecordNumber As Integer ByVal Nrecord As Integer As Integer Member of Controlli clsModbus Description Read File Record Modbus request Parameters FileNumber File number 1 to 65535 RecordNumber Record number 0 to 9999 Nrecord Number of records Return values File Record values Public Function Read Holding Registers ByVal startRegister As Integer ByVal nHegister As Integer As Integer Member of Controlli clsModbus Description Read Holding Registers Modbus request Parameters startRegister Start register address 0 to 65535 nRegister Number of registers to read 1 to 125 Return values Registers value Note Public Function Read Input Registers ByVal startRegister As Integer ByVal nRegister As Integer As Integer Member of Controlli clsModbus Description Read Input Registers Modbus request fh amp 01943 602001 Q sales issltd co uk b www issltd co uk USER MANUAL SENECA Z TWS 3 and Z TWS64 startRegister Start register address 0 to 65535 nRegister Number of input registers 1 to 125 Return values Input registers Public Property Timeou
59. example is shown in the following figure fu t 01943 602007 sales issltd co uk www issltd co uk USER MANUAL SENECA Z TWS 3 and Z TWS64 b CoDeSys Ui P a PU File Edit Project Insert Extras Online Window Help xs a sal SYSLIBTIME LIB 11 6 08 18 05 14 FUNCTION EXOR CAN RxSlot SetldAndMask CAN SYSTASKINFO LIB 11 6 08 18 05 14 ANALYZATION LIB 5 10 99 09 05 06 Purpose SYSLIBCALLBACK LIB 11 6 08 18 05 14 This function is used after creating an RxSlot with EXOR CAN RxSlot Create function EXOR_CAN2 lib 8 8 08 12 45 12 Application program can call EXOR CAN RxSlot SetldAndMask function each time it wants to change which CAN messages has to be received on an RxSlot If same Identifier Mask is used in more than one RxSlot then the last created RxSlot receives it a POUs Mask parameter gives you the possibility to receive multiple Identifiers in the same RxSlot dl EXOR_CAN_Init FUN Bits A 0 value means don t care or accept a 0 or 1 for that bit position Rf EXOR_CAN_RxSlot_Create FUN A 1 value means that the incoming bit value must match identically to the A EXOR_CAN_RxSlot_GetPacket FUN corresponding bit of the specified Id i EXOR CAN RxSlot Setld ndMask FUN i r EXOR CAN SendPacket FUN To completely disable the reception of CAN messages on an RxSlot application program should call this function with Id 1 and Mask 1 Fe VAR INPUT Handle hC
60. fied wIndex ucSubIndex Data is received while IEC program runs by Interrupt Service Procedures and is stored in this buffer When IEC program calls this function then data is copied from this buffer to ptrDestBuf address This ensures coherence of data because data seen by IEC only changes when calling this function EXOR_CAN_BT_SERVER_DL windex WORD EXOR CAM BT SERVER DL EXOR_CAN BT ResultCodesT ucSublndex BYTE ptrDestBuf POINTER TO BYTE dwDataLen DWORD Name EXOR CAN BT SERVER SET CFG Description IEC program must call this function only one time at the startup and before any calls to EXOR CAN BT SERVER DL or EXOR CAN BT SERVER UL functions The Server will work at the specified RX TX Identifiers IEC program can call this function again to change the RX TX Identifiers but this is not a common case Note CANopen standard defines dwServerRxld as 16 600 Nodeld Note CANopen standard defines dwServerTxld as 16 580 Nodeld fh amp 01943 602001 sales issltd co uk b www issitd co uk USER MANUAL SENECA Z TWS 3 and Z TWS64 EXOR CAN BT SERVER SET CFG dwServerRald DWORD EXOR CAN BT SERVER SET CFG BOOL dwServerTxld DWORD Name EXOR CAN BT SERVER UL Description WARNING Both client and server can do only one operation at a time i e they can do a download or an upload They CAN T do both a download and an upload at the sametime They CAN T more then one upload or download
61. gel Analog Common Settings Scheduler E View Pages Display ali Graph qa Report Automatica TO CREATE DELETE PAGES OF TO SELECT THE CHANNELS DISPLAYING THAT HAVE TO BE ANALYZED Figure 64 Configuring the Data Recorder step 8 After this click on Display and select from menu Online gt Connect the instantaneous value values will be displayed in this window Seneca Z NET3 Data Recorder C Users Emanuele Documents Progetti Je skade E View Pages i Display il Graph is Report Automatico License Fiaure 65 Confiquring the Data Recorder step 9 fa to 01943 602001 salesQissltd co uk b www issltd co uk A USER MANUAL SENECA Z TWS 3 and Z TWS64 while the corresponding time diagram is displayed in the graph window J 7 J E mao J Common Settings Scheduler View Pages E Display qol Report Automatico TED License View Pages Graph Interval Orientation ML CHIN 10000 2 317 14 9000 8000 7000 6000 5000 4000 3000 2000 a 1000 0 09 08 00 09 09 00 09 10 00 09 11 00 09 12 00 09 13 00 09 14 00 09 15 00 09 16 00 09 17 00 Figure 66 Configuring the Data Recorder step 10 The Data Recorder generates an output file Microsoft Office Access data base in the download folder previous selected After this the output file can be analyzed with the Trend Viewer s
62. he quantity of CAN messages which can be received in the Rx Slot in this time should be computed Parameter CanPort selects the CAN Port if your hardware has only one CAN Port then specify zero for this parameter After the Rx Slot is created it is configured for receiving no message at all To select which CAN messages have to be received by an Rx Slot the function EXOR CAN RxSlot SetldAndMask must be used Return An handle to the created RxSlot is returned The returned handle has to be used to reference the RxSlot when calling EXOR CAN RxSlot SetldAndMask and EXOR CAN RxSlot GetPacket functions If no memory is available to create the RxSlot then NULL zero is returned EXOR CAN RXSLOT CREATE CanPort INT EXOR CAM RxSlot Create hCAN FIFO Len INT Name EXOR CAN rxSlot GetPacket Description This function unloads one message from the specified RxSlot Entry Handle Handle of a previously created RxSlot PacketP Pointer to the buffer where unloaded packet will be written Return Return value is CAN NO DATA if no message exists in the RxSlot Return value is CAN OK if one message has been unloaded from RxSlot EXOR CAM RASLOT GETPACKET Handle hCAN EXOR CAN RxSlot GetPacket eCAM PacketP POINTER TO CAM PacketT Name EXOR CAN RxSlot SetldAndMask Description This function is used after creating an RxSlot with EXOR CAN RxSlot Create function Application program can call EXOR CAN RxSlo
63. ing this function the CANopen Figure 67 Isagraf libraries Boards canocfg2 The board canocfg2 is used to configure the communication via the TWS CANopen master The integration of the board is done through the menu Project IO Connection Be amp 01943 602001 salesQissltd co uk b www issltd co uk USER MANUAL SENECA Z TWS 3 and Z TWS64 fo EXOR ISaGRAF TEST CAN I O connection ro 4 kun Nodeld 0 n mum BaudRateKbps 500 cm Scaninterval 20 mum NodeGuardRate 2 cot InputRefreshRate 2 me SyncEnable true smu Prescaler 0 aos SynclumpsWidth 0 sum TSetup ll sot THold 0 ms SampleMode 0 saa StartCmdEnable true m CanPort 0 4 4 3 4 Figure 68 Isagraf I O connection The fields of the IO Boards have the following meanings Nodeid identification of the CANOpen master node Baudrate Select the speed of the network CANOpen It must be the same as set by the DIP switch on the slave e Scaninterval scan time of the inputs and outputs in milliseconds NodeGuardRate number of cycles to scan before sending the NodeGuard message The value 0 means disabled InputRefreshRate request for inputs delivery through Remote Transmission Request not supported by Z PC CANopen slaves e SyncEnable Enabling SYNC message from the master e StartCmdEnable If TRUE the NMT start network command is given at boot up or in case of Node Guarding error The special parameters pr
64. k I O Modbus means one or more modules that are connected with the Z TWS through a serial Modbus bus for example Seneca Z 4TC The block I O CANopen means one or more modules that are connected with the Z TWS through a CANopen bus for example Seneca ZC 8Al DATA ACQUISITION MODULE DAM The thread that runs with highest priority in the system is the acquisition of new data from I O Modbus module to DAM In particular the writing phase is not managed by DAM but in an asynchronous way For example if the Z TWS have to read the content of registers 40022 40023 40025 40027 the DAM allows to optimize the reading phase because it is not necessary to perform six readings registers from 40022 to 40027 but only one DAM needs to be considered in PLC cycles based on Modbus protocol but doesn t need to be considered in PLC cycles based on CANopen protocol the data are acquired from program directly A file called PLC ini is sent to the Data Acquisition Module DAM and contains the modalities to read some Modbus registers for example example read the registers from 40120 to 40128 etc The PLC ini file is easily configurable by the free Z NET software The MODBUS protocol is initialized with the parameters normally contained in this file that must be stored in the root directory of the flash drive Z TWS The PLC ini file contains the parameters for all the four serial ports More information about the file P
65. ket DIMT SysSockSetOption BOOL diLevel DIMT diOption DINT pOptionValue DWORD diOptionLength DIMT Name SysSockShutdown Description SYSSOGKSHUTDOWN diSocket DINT SysSockShutdown BOOL diHow DINT Library SysLibTime lib Name CurTime Description CURTIME SystemTime SysTime64 VAR IN OUT SystemTime SysTime6d VAR IN OUT Name CurTimeEx Description CURTIMEEA Be amp 01943 602001 salesQissltd co uk b www issltd co uk USER MANUAL SENECA Z TWS 3 and Z TWS64 Library SysTaskinfo lib Name taskinfo Description TASKIMFO bReset BOOL tMin DWORD bBeginCycle BOOL thax DWORD tCycleTime DWORD tLast DWORD tCycleReal DWORD titterMax DWORD tlitterLast DWORD Library TCPUdpLib lib gt CPSpecific Name TcpClientOpenSocket Description Open TCP client socket to connect to server Return Socket ld for connection session TCPCLIENTOPENSOCKET iPart IMT TepClientOpenSocket DINT stlPAddress STRING 80 diMaxDatasSize DINT Name TcpReceiveData Description Receive data from a tcp socket Return Number of bytes received fh CS 01943 602001 salesQissltd co uk b www issitd co uk USER MANUAL SENECA Z TWS 3 and Z TWS64 TCPRECEIVEDATA diSocket DINT TcpRecaiveData DINT pbyData DWORD diDataSize DINT Name TcpSendData Description Send data via TCP socket Return Number
66. lected the second target configuration NOTE USE THIS CONFIGURATION IF FIRMWARE VERSION IS 4 XX Configuration Target Platform Memor Layout General Network functionality Visualization Base Size Automatic persoo Global v Automatic Memory fr Automatic Ca Input z Automatic ion Output Automatic imo Retain he fr Automatic fesson IY Retain in own segment hd asimum number of POs Total size af data memory 1 bise Default Cancel Figure 36 Configuring the Z TWS with I O CANopen step 2B The following table shows the Memory layout for this configuration 524288 Size hex bytes Size decimal bytes 2000 8192 1000 4096 Output 1000 4096 Retain 8000 32768 At this point configure a new POU as follows Name Type Language and click OK Be amp 01943 602001 salesQissltd co uk b www issltd co uk USER MANUAL SENECA Z TWS 3 and Z TWS64 Mame of the new POL Type af POU Language of the FOU Cancel Program C IL Function Block C LD Function C FBD Return Type SFC BOOL Em ST C CFC Figure 37 Configuring the Z TWS with I O CANopen step 3 The previous window permits to initialize POu Program Organization units Program functions block and functions in particular the PLC PRG is generally the main program in a single task program Each project must contain this POu which is called exactly once per control cy
67. lue 10 ms delay gt delaymin Irmax Im IPC where T pic is the time employed to perform the phases of PLC reading execution writing Tpic Trotreapine lexe Ttotwritine where Tyo TREADING means the total time to perform the reading phase and it is TToTREADING delay X number of slave modules where T exe means the total time to perform the execution phase and Ttotwriting means the total time to perform the writing phase and it is fh amp 01943 602001 Q sales issltd co uk b www issltd co uk USER MANUAL SENECA Z TWS 3 and Z TWS64 TTOTWRITING WRITING X number of slave modules and Twening Tmaster I TsLave during writing After this select the Network parameters window the default value of IP address is 192 168 90 101 Configuration Network parameters Serial Ports Modbus Security parameters PPP TCPIP Address DNS Address Ports Main DNS 192 168 90 101 HTIP 80 E 20000 IsaGraf 1100 E Tunnel ITTP Gateway C Tunneling Enabled Tunnel name Address Port 3535 Connection Timeout 300 Protocols Protocol name Address Port 0 g oh Errar I an T armimal lial um Figure 25 Configuring the Z TWS with I O Modbus step 7 After you have saved settings the Z NET software produces a configuration file for the Data Acquisition Module called PLC ini click on Download CPu Configuration and click on the following button to export the configuration in Codesys
68. man Coon No database Figure 9 A Seneca Trend Viewer page Z NET AND TREND VIEWER INSTALLATION Z TWS is equipped with Seneca package CD with this CD is possible to install the Z NET software and also TREND VIEWER To install the Z NET software insert the CD double click on the file CD Start exe and so appears the following window b www issitd co uk to 01943 602001 salesQissltd co uk A USER MANUAL SENECA Z TWS 3 and Z TWS64 SENECA PACKAGE SUM CL INSTALL CoDeSys 2 3 INSTALL Codesys Seneca Library 1 06 INSTALL IsaGRAF INSTALL Seneca IsaGRAF libraries ver 1 00 INSTALL Java RunTime INSTALL Seneca Z NET3 2 00 Beta 12 INSTALL Easy Setup 2 02 INSTALL Seneca OPC Server IO 2 00 Beta 1 INSTALL Seneca OPC Server MB Slave 1 02 INSTALL Seneca Z NET3 RTU 1 50 INSTALL Seneca Z NET3 Trend Viewer 2 00 Beta 1 VIEW PDFs Figure 10 The installation page of the Seneca package CD At the first time click on install Seneca Z NET n n Beta x x to install the Z NET and follow the simple operations then click on install Seneca Z NET Trend Viewer n n Beta x x to install the Trend Viewer software and follow the simple operations Note that Seneca Z NET contains Data Recorder and Web Editor softwares while the Trend Viewer have to be installed stand alone previously it need to be started after that the file mdb has been generated by Data Recorder fu amp 01943 602001 salesQissltd co uk b ww
69. mm UDP dwResult DWORD Others Name Swap Description SWAP pi DWORD Swap BOOL nSize INT Library Standard V2 lib Bistable function blocks Name RS Description bistable function reset dominant Q1 NOT R1 AND SET OR Q1 fh amp 01943 602001 sales issltd co uk b www issitd co uk USER MANUAL SENECA Z TWS 3 and Z TWS64 RS SET BOOL sj Q1 BOOL RESETT BOOL Name SEMA Description Software semaphore Interuptable BUSY is TRUE if there was a call with CLAIM TRUE but no call with RELEASE TRUE CLAIM TRUE sets BUSY TRUE REALEASE TRUE sets BUSY FALSE SEMA E CLAIM BOOL BUSY BOOL 3 RELEASE BOOL JE Name SR Description bistable function set dominant Q1 S1 OR NOT RESET AND Q1 SR SET1 BOOL sp Q1 BOOL RESET BOOL Counter Name CTD Description Counter Down CV is decremented by 1 if CD has a rising edge Q is TRUE if CV reached O CID CD BOOL uuu Q BOOL LOAD BOOLIEIE cv INT PV INT fh amp 01943 602001 sales issltd co uk b www issltd co uk USER MANUAL SENECA Z TWS 3 and Z TWS64 Name CTU Description Counter Up CV is incremented by 1 if CU has a rising edge Q is TRUE if CV is reached PV CTU CU BOOL unm Q BOOL RESET BOOLE cv INT FV INT Name CTUD Description CounTer Up Down CV is decremented by 1 if CD has a rising edge CV is incremented by 1 if CU has
70. mp 01943 602001 salesQissltd co uk b www issltd co uk USER MANUAL SENECA Z TWS 3 and Z TWS64 SYSSOCKHTONS wHast WORD SysSockHtons WORD Name SysSocklnetAddr Description SYSSOCKIMETADDR stlPAddr STRING 80 SysSocklnet amp ddr DWORD Name SysSocklnetNtoa Description SYSSOCKINETNTOA nAddr INADDR SysSacklnetMWtoa BOOL stiPAddr STRING 80 dilPAddrSize DINT Name SysSockloctl Description SYSSOCKIOCTL disocket DINT SysSockloctl DINT diCommand DINT piParameter DWORD Name SysSockListen Description SYSSOCKLISTEN di amp ocket DINT SysSockListen BOOL diMaxConnections DIMT fu amp 01943 602001 salesQissltd co uk b www issltd co uk USER MANUAL SENECA Z TWS 3 and Z TWS64 Name SysSockNtohl Description SYSSOGKNTOHL dwMet DWORD SysSockNtohl DWORD Name SysSockNtohs Description SYSSOCKNTOHS wMet WORD SysSockNtohs WORD Name SysSockSelect Description SYSSOCKSELECT diWidth DINT SysSockSelect BOOL fdRead DWORD fd Write DWORD fdExcept DWORD ptvTimeout DWORD Name SysSockSetlP Address Description SYSSOCKSETIPADDRESS stCardName STRING 80 SysSackSetlPAddress BOOL silPAddress STRING 80 Name SysSockSetOption Description Be amp 01943 602001 salesQissltd co uk b www issltd co uk USER MANUAL SENECA Z TWS 3 and Z TWS64 SYSSOCKSETOPTION diSac
71. n a DST transition occurs ie the beginning or the end of the period when DST is in force the clock will be updated automatically If the transition from summer to winter time or vice versa occurs when the module is off the clock must be adjusted manually Time management is carried out according to international standard Note The Coordinated Universal Time UTC is the universal standard time See website for more information http wwwghcc msfc nasa gov utc html FLASH DISK To improve the system performances it is important to consider that the access to files affects heavily in the cycle time of PLC So it is necessary to optimize the accesses to the file system in the PLC program The Z TWS includes a 128 Mbytes 16 Mbytes for Z TWS3 flash disk that can be used to store files for example log files and it is based on FAT file system IMPORTANT The file system are managed by the OS File System the number of files that can be opened at the same time is limited as well the number of files that can be saved in a same directory and in the root It is important to consider that on a PLC the flash has a limited cycles of writing RETENTIVE VARIABLES FeRAM The Z TWS is equipped by a 8 kb static RAM feRAM into this memory is possible to store data like a classic RAM memory but with the retentive ability of a flash memory oe amp 01943 602001 sales issltd co uk b www issitd co uk A USER MANUAL SENECA Z
72. nfo 08 07 2011 09 21 01 336 Project created successfully o Info 08 07 2011 09 21 01 336 Project opened successfully Figure 58 Configuring the Data Recorder step 2 Click on Channels voice in the left side window then click on Add channel to add a variable in the Data Recorder project first choosing the corresponding module and then select one of the variables available for that module It is possible to analyze more modules and variables at the same time fu to 01943 602001 salesQissltd co uk b www issltd co uk USER MANUAL SENECA Z TWS 3 and Z TWS64 S Channel Name Channel Description Z 8Al Description Data Type Channels max number Channel Mi CH3NM Mi CH4NM Name Descriptio Mi CHSNM Mi CH6NM Mi CH7NM Mi CH8NM O Go to Data Recorder i Close Cancel Add Channel Add Channels from modules Delete Channel Channels Figure 59 Configuring the Data Recorder step 3 E Seneca Z NET3 CAUsersleman File Project Online Tools HQ n e amp os 99 17 000006 Q96 ERR PWR ERR PWR Y Y x RX TX ERX TX gt COM COM On NS Z 8AI V R Channels max number Channels number Calculated channels numbe Total channels number 3 v s Channels Name Description Measure Unit Ing BS Ing ES Tec BS b Meer 0 10000 0 M2 CH5 MEASURE 0 10000 0 M2_CH7_MEASURE 0 10000 0 Figure 60 Configuring the Data Recorder step 4 Click on the Calculated Cha
73. ng edge iE AS FB 0004 0 is TRUE if CV is reached PV E SEMA FB 0005 VAR_INPUT I 006 Cu BOOL Count Up Br Eg Counter RESET BOOL ResetCounterto 0 ae 0008 PV INT Counter Limit EID FB OODYEND VAR 0070 VAR_OUTPUT CTUD FB 0011 Q BOOL Counter reached the Limit El String Functions WA CV INT Current Counter Value CONCAT FUN D13 END VAR E DELETE FUN 0014 VAR E FIND FUN M BOOL Variable for CU Edge Detection E INSERT FUN a i LEFT FUN E LEN FUN E RIGHT FUN Eun Timer 4 i ev RTC FB 0001LD 0 EJ TOF FB 0002 E TON FR 0010 0011 Figure 5 A CoDeSys page RTC INTEGRATED MANAGEMENT FOR LOCAL HOUR The Z TWS has an internal hardware clock with a battery that can operate for a month without power Mirinas tha firat start av aftar n nralannanad Akaanans vn fAAnivarnvinn maa than ann manth rsanll ha to 01943 602001 salesQissltd co uk b www issitd co uk USER MANUAL SENECA Z TWS 3 and Z TWS64 reset by the clock at midnight of January 1 2000 When restarted the DAM reads the date and time from this clock and calculates the corresponding UTC respecting the settings for time zone and daylight saving time DST UTC is used as a time stamp of sampling for trend while the local time the value read by the clock is used for all other needs such as event logs or time stamp for the file system If the Z TWS is running whe
74. nnel to configure some particular functions that can be associated to each previous variable for example the alarm or expressions applied to the quantities Be amp 01943 602001 sales issltd co uk b www issitd co uk USER MANUAL SENECA Z TWS 3 and Z TWS64 Calculated Channel Edit S Z 8Al Z 8TC Channel Name Channel Description Calculated Channel Expression Calculated Channels Channels max number Channels number 3 J e TS ote Channels Analog Name Description Mi CH2NM M P Functions and Operators IPSEN ETE Digital M2 CH7 MEASURE Channel Scaling Measure Unit Tec Beg Scale 0 00 v 0 Go to Data Recorder Tec End Scale 10 000 00 v Alarm E Enable Inverted Output on alarm Enabled High High 10 000 00 Retain Output High 10 000 00 21 Delay sec 0 Low 0 00 3 Alarm output Channel Low Low 0 00 Analog alarm type TIIT High High i dese Close cancel Cancel Add Channel Channel Delete Channel Delete mE NE cw laum oo ae Figure 61 Configuring the Data Recorder step 5 Complete this configuration with the Measure units and Summary voices and click on Go to Data Recorder button the following window appears fu amp 01943 602001 salesQissltd co uk b www issltd co uk A USER MANUAL SENECA Z TWS 3 and Z TWS64 OG Seneca Z NET3 Data Recorder C Users Emanuele Documents Progetti
75. nsfer TWS FTPGET EnableF BOOL ServerAdd POINTER TO STRING 8U 0 Status INT UserName POINTER TO STRING 80 OQ Result INT Password POINTER TO STRING 8U QO FTP Error INT RemoteFileName POINTER TO STRING 80 OQ MBcount DINT LocalFileMame POINTER TO STRING 80 Timeout TIME Name TWS FTPsend Description Connects to an FTP server and sends a file This FB posts a send request to the thread which performs the actual transfer TWS FTPSEND EnableF BOOL 0 DoneF BOOL ServerAdd POINTER TO STRING 60 0 Status INT UserName POINTER TO STRING 80 O Result INT Password POINTER TO STRING 80 O FTP Error INT RemoteFileName POINTER TO STRING 80 O NBcount DINT LocalFileMame POINTER TO STRING 80 Timeout TIME to 01943 602001 salesQissltd co uk b www issltd co uk USER MANUAL SENECA Z TWS 3 and Z TWS64 Name TWS GetNetPar Description Get Network Parameters TWS_GETNETPAR ip_addr STRI net mask STRING 23 broadcast STRI gateway STRING 23 server STRIMG 23 Name TWS IsGtwRegistered TWS ISGTWREGISTERED TWS IsGtwRegistered BOOL Name TWS readFile Description Read one file from remote TWS to local TWS TW5 READFILE enable BOOL 0 DoneF BOOL rempath POINTER TO STRING 80 O size DINT locpath POINTER TO STRING 80 OQ Status INT usr POINTER TO STRING 80 psw POINTER TO STRING 80 timeout TIME Name TWS readVar Description
76. o 01943 602001 SalesQissltd co uk b www issltd co uk USER MANUAL SENECA Z TWS 3 and Z TWS64 Name UdpGetReceiveDataSize Description Function to receive data via UDP protocol Return diBytesReceived Number of bytes received stIPAddress Transmitter IP address of client that sent the data UDPGETRECEIVEDATASIZE diSacket DINT UdpGetReceiveDataSize DINT Name UdpOpenReceiveSocket Description UDPOPENRECEIVESOCKET iPort INT UdpOpenReceiveSacket DINT Name UdpOpenSendSocket Description UDPOPENSENDSOCKET iPort INT UdpOpenSendsocket DINT Name UdpReceiveData Description Function to receive data via UDP protocol Return diBytesReceived Number of bytes received stlPAddressTransmitter IP address of client that sent the data UDPRECEIVEDATA disocket DINT UdpReceiveData GLIENT REPLY iPart INT pbyData DWORD diDataSize DINT Name UdpSendData fu amp 01943 602001 salesQissltd co uk b www issltd co uk USER MANUAL SENECA Z TWS 3 and Z TWS64 Description Function to send data via UDP protocol Return Number of bytes really sent UDPSENDDATA diSacket DINT UdpSendData DINT iPart IMT stlPAddress STRING 80 pbyData DWORD diDatasize DINT Name UdpSendTIlg Description Function to send data via UDP protocol Return Number of bytes really sent UDPSENDTLG stlPAddress STRING 80 bReady BOOL sTelegramm NetVarTelegra
77. oftware amp 01943 602001 salesQissltd co uk b www issitd co uk USER MANUAL SENECA Z TWS 3 and Z TWS64 Appendix A About the PLC ini file The PLC ini file can be easily configured by the Z NET free software and in particular this topic describes the file structure for the Z TWS The first part is about the parameters that are read only at startup Syslog If you are not using the serial port 0 for debug monitor via the TWS you can introduce a redirection over ethernet via Syslog which allows you to send all diagnostic prints to a remote server on the network In this field is inserted Sylog remote server s IP address You must then define the parameters for setting the serial ports those that are not indicated are free Uart parameter section starting from 0 For port 0 the parameters are as follows Mode0 0 The modes are allowed 0 RS232 1 485 3 485 master and slave external Channel0 1 DO NOT CHANGE indicates a serial line Baud_Rate0 38400 Indicates the communication speed of the port for which the values are 4800 9600 19200 38400 57600 115200 baud ParityO N Is possible to add sending each character a bit that indicates if the number of bits equal to 1 character is odd or even This is useful for detecting transmission errors due to noise on the line as the receiver replays the count and compares the result to the parity bit received Menu options are none even odd Length0 8 I
78. ogin from menu CoDeSys 11 pro PLC PRG PRG Login Al FB Logout Ctrl F8 Download Run F5 Stop Shift F8 Global Variables library ANAL AAT library EOF lib 11 Figure 47 Configuring the Z TWS with I O CANopen step 13 To run the PLC program it is necessary to select Online gt Run Be amp 01943 602001 salesQissltd co uk b www issltd co uk USER MANUAL SENECA Z TWS 3 and Z TWS64 How to configure the Web Server the Web Editor software The Web editor is a web server editor for the Z TWS and allows mainly to create easily web pages developed for Z TWS moreover permits to associate directly to the objects the variables defined in the corresponding Z NET project This software can be opened from the software Z NET as shown in the following figure Web Editor Figure 48 Block diagram process to configure the Web Editor To open the Web Editor software first it is necessary to open Z NET and from Z NET menu toolbar select Project gt Web Editor Be to 01943 602001 salesQissltd co uk b www issltd co uk USER MANUAL SENECA Z TWS 3 and Z TWS64 Figure 49 Starting the Web Editor software from Z NET When click on Web Editor voice the program is started and the following window appears as you can see more options are available for a Web Editor page ate amp 01943 602001 salesQissltd co uk
79. on Write Single Register Modbus request Parameters Register Register address 0 to 65535 Value Value to write Return values Modbus reply Example imports controlli It Me mcon oerial r150pen Then Ne nom serial Closet End If fh amp 01943 602001 sales issltd co uk b www issitd co uk USER MANUAL SENECA Z TWS 3 and Z TWS64 Me nCom s rial Open coml 38400 parity none 8 StopBits One 300 Handshake None Me mRtu Modbus setSerial Me mCom Me mRtu nRetry 3 Me mRtu Address I Me mRtu Timeout 500 Dim values 1 As Integer Dim reply 1 As Byte Reading of two registers 40001 e 40002 reply gt HRU Reid Holding Registers Oy 2 If reply Length 0 Then sendModbusError Nothing sh Return False End If In reply 0 there is the register 40001 In reply 1 there is the register 40002 Be amp 01943 602001 salesQissltd co uk b www issltd co uk
80. ow often the records should be asked of a particular O The protocol is optimized to handle the reading of a group of user defined variables After defining the groups are updated periodically with the interval set MMS Any requests for variables belonging to the groups by the three main sources PLCs TWS DAM does not give rise to new communication sessions but are met instantaneously by taking the data from memory If writing a variable belonging to a group it involves a writing session and if it succeeds the new value is forced in the memory block belonging The first parameter contains the address of the register to be read this addressing is done through a string like this Zxx lt TYPE gt yyyyy where xx number of slave MODBUS 1 255 fh amp 01943 602001 Q sales issltd co uk b www issltd co uk USER MANUAL SENECA Z TWS 3 and Z TWS64 yyyyy number of selected object TYPE type of required data can be assume the following OUTP digital output ex OUTPO0001 INP1 digital input ex INP10002 IREGS input registers ex IREG30004 HREG4 input registers ex HREG40022 In normal operation with modules of the O SENECA is used the request HREG4 The format of communication blocks is as follows BlockBase0 Z2HREG40002 start BlockLength0 2 lenght BlockSamplingRateO 1000 refresh in ms BlockBase1 Z3HREG40020 BlockLength1 4 BlockSamplingRate1 500 BlockBase2 Z4HREG40002 BlockLength2 2 Block
81. p 6 In particular it is important to set the port 1 RS485 bus because it allows communication with I O modules by IDC10 rear bus connector IMPORTANT The serial port configurations must correspond to the jumper setting of Z TWS see the chapter jumper setting Tipically default the serial port 2 is configurated as RS232 and it is used to communicate with the modem this port is related to the PPP enabled flag IMPORTANT How To Evaluate the Modbus Distributed System Performances The data communication between Master and Slaves using the ModBUS RTU protocol is based on queries replies between one Master and each Slave as shown in the following example Be amp 01943 602001 salesQissltd co uk b www issltd co uk USER MANUAL SENECA Z TWS 3 and Z TWS64 MASTER SLAVE 1 MASTER SLAVE 2 delay Ty Taux TIME Figure 24 An example of Master and slaves communication Modbus n particular the time between the end of a Master query and the start of a Slave response T needs to be greater than Timeout parameter in ZNET The processing time of the Master Ty results a constant value approximately while the Slave response time Trax is a function of the Baud Rate and number of registers queried However this value may be estimated as 1 BaudRate o0 the following formula permits to estimate the minimum value of the delay see figure 23 parameter in ZNET with default va
82. peration has been completed both in case of success and in case of failure FALSE if operation hasn t yet completed WARNING Please note that TRUE will be returned only ONE time after the operation has been completed fh amp 01943 602001 Q sales issltd co uk b www issltd co uk USER MANUAL SENECA Z TWS 3 and Z TWS64 EXOR CAM BT CLIENT CHECK ResPtr POINTER TO EXOR CAN BT CLIEMHT CHECK T EXOR CAM BT CLIENT CHECK BOOL Name EXOR CAN BT CLIENT DL Description WARNING Both client and server can do only one operation at a time i e they can do a download or an upload They CAN T do both a download and an upload at the sametime They CAN T more then one upload or download at the sametime Purpose IEC program calls this function to request a download IEC program calls this function one time and then repeatealy calls EXOR CAN BT CLIENT CHECK to check if download operation has been completed Entry Note CANopen standard defines dwServerRxld as 16 600 Nodeld Note CANopen standard defines dwServerTxld as 16 580 Nodeld Return Please see comments embedded in the EXOR CAN BT ResultCodesT defintion NOTE Data is transferred while IEC program runs by Interrupt Service Procedures Data is read directly from the specified address ptrSrcBuf while the transfer proceeds This means that IEC program must ensure that Source Data does NOT change until the transfer has been completed This can be easily accom
83. perations can be applied to them alarm math functions etc gt to create and configure dynamic HTML pages for the Web Server Z TWS This function is implemented by Web Editor included into the Z NET package gt to export the hardware configuration for CoDeSys The software Z NET permits to export the configuration to CoDeSys PLC Controller Development System that s a comprehensive software tool for industrial automation technology WEB EDITOR The Web editor software is integrated into the Z NET it is an effective tool and it allows to optimize the web server functionality oe amp 01943 602001 sales issltd co uk b www issitd co uk USER MANUAL SENECA Z TWS 3 and Z TWS64 Log window ype Description o Info 05 07 2011 14 59 11 948 Project open correctly Label 05 07 2011 15 03 33 Figure 7 A Seneca Web Editor page This software allows tocreate easily web pages that contain the applets developed for Z TWS toassociate directly to the objects the variables defined in the corresponding Z NET project gt to edit easily the features of the various objects todownload the applets and web pages directly in the CPU todisplay the preview of the web pages DATA RECORDER Data recorder is a software that allows to perform the data logging for each variables otarting from a configuration inherited from a project Z NET Data Recorder is a software that allows
84. plished by IEC program by passing to this function a buffer which is a copy of the source data This way the original source data but the copy buffer will not EXOR CAN BT CLIENT DL dwsServerRxld DWORD EXOR CAM BT CLIEMT DL EXOR CAM BT ResultCodesT dwsServerTxld DWORD windex WORD ucSublndex BYTE ptrsrcBuf POINTER TO BYTE dwDataLen DWORD fh amp 01943 602001 sales issltd co uk b www issitd co uk USER MANUAL SENECA Z TWS 3 and Z TWS64 Name EXOR CAN BT CLIENT UL Description WARNING Both client and server can do only one operation at a time i e they can do a download or an upload They CAN T do both a download and an upload at the sametime They CAN T more than one upload or download at the sametime Purpose IEC program calls this function to request an upload IEC program calls this function one time and then repeatedly calls EXOR CAN BT CLIENT CHECK to check if upload operation has been completed Entry Note CANopen standard defines dwServerRxld as 16 600 Nodeld Note CANopen standard defines dwServerTxld as 16 580 Nodeld bAcceptSmallerSizeF if TRUE then the upload operation will perform also if Server returns less data than the one specified with dwDataLen parameter If FALSE then the upload operation will perform only if Server returns exactly the specified datalen Return Please see comments embedded in the EXOR CAN BT ResultCodesT defintion NOTE Data is transferred whil
85. r statistics calculating minimum maximum and average of an input value STATISTICS_INT IN INT MN INT RESET BOOL MX INT AVG INT Signal generators Name BLINK Description Function block to simulate a turn signal BLIMK EMABLE BOOL OUT BOOL TIMELOW TIME TIMEHIGH TIME Be amp 01943 602001 salesQissltd co uk b www issltd co uk USER MANUAL SENECA Z TWS 3 and Z TWS64 Appendix C CANopen I O with ISAGRAF PLC This section describes the use of CANOpen in the ISaGRAF environment Isagraf Library The use of CANopen in ISAGRAF requires loading library for CANopen In particular it is necessary to load the library for the IO boards canocfg2 canodi canodo and canao s EXOR ISaGRAF Libraries File Edit Tools Options Help IO boards r Ot BSE a CANopen Configuration EXOR description creation date 1999 02 25 author AM Note Normally you should not need to use the SPECIAL PARAMETERS nor the SPECIAL DIAGNOSTIC INFORMATION listed below PARAMETERS Useful only when SCMD3 is a CANopen server sj 1U 20 50 100 125 250 500 800 1000 Scaninterval ms 1 65535 new complete scansion of all F0 i e sending of output values is started every this time NodeGuardRate 0 65535 Node Guarding is executed every n Scan cycles 0 means disabled NodeGuarding Function guarantee reliability and diagnostic of your CANopen network by us
86. s possible to choose if you send or receive all 8 bits of character or 7 Stop0 1 The stop bits are equal to 1 bits that are appended to each character sent These are used to mark the end of the bits of the character and the values are 1 and 2 Half DuplexO N NO CHANGE fu amp 01943 602001 salesQissltd co uk b www issltd co uk A USER MANUAL SENECA Z TWS 3 and Z TWS64 The parameters are configured according to the requirements for all other ports that are not Free Mode1 1 Channel1 1 Baud HRate1 9600 Parity1 N Length1 8 Stop1 1 Half Duplex1 N Mode2 1 Channel2 1 Baud Rate2 9600 Parity2 N Length2 8 Stop2 1 Half Duplex2 N Mode3 3 Channel3 1 Baud Rate3 9600 Parity3 N Length3 8 Stop3 1 Half Duplex3 N Similarly for all ports scheduled are not free it is essential to distribute the addresses of the slaves among the communication ports and overlaps are not allowed Serial2 1 t 01943 602001 salesQissltd co uk b www issitd co uk USER MANUAL SENECA Z TWS 3 and Z TWS64 FirstSlave2 41 LastSlave2 150 Delay2 0 RequestTimeout2 20 RequestNtry2 0 Serial3 2 FirstSlave3 151 LastSlave3 200 Delay3 0 RequestTimeout3 20 RequesiNtry3 0 Serial4 3 FirstSlave4 201 LastSlave4 254 Delay4 0 RequestTimeout4 20 RequesiNtry4 0 Finally therefore are defined blocks optimized communication up to 1024 These blocks indicate to the MODBUS protocol such as how many and h
87. stered SYSCALLBACKREGISTER iPOLlIndex INT SysCallbackRegister BOOL Event RTS_EVENT Name SysCallbackUnregister Description Function to unregister a definite callback function on runtime events Return TRUE if callback function can be unregistered SYSCALLBACKUNREGISTER iPOUIndex INT SysCallbackUnregister BOOL Event RTS_EVENT Library SysLibFile lib Name SysFileClose fh amp 01943 602001 Q sales issltd co uk b www issltd co uk A USER MANUAL SENECA Z TWS 3 and Z TWS64 Description SYSFILECLOSE File DWORD SysFileClose BOOL Name SysFileCopy Description Name SysFileDelete Description Name SysFileEOF Description Name SysFileGetPos Description Name SysFileGetSize m amp 01943 602001 SYSFILECOP Y FileDest STRIMG S0 SysFileCopy UDINT FileSource STRING 80 SYSFILEDELETE FileName STRING 80 SysFileDelete BOOL SYSFILEEOF File DWORD SysFileEOF BOOL SYSFILEGETPOS File DWORD SysFileGetPos DINT salesQissltd co uk b www issltd co uk A USER MANUAL SENECA Z TWS 3 and Z TWS64 SYSFILEGETSIZE FileName STRING 80 SysFileGetsize DINT Name SysFileGetTime Description SYSFILEGETTIME FileName STRING 80 SysFileGetTime BOOL ftFileTime POINTER TO FILETIME Name SysFileOpen Description SYSFILEOPEN FileName STRIMG 80 SysFileOpen DWORD Mode STRIMG 20
88. t As Integer Member of Controlli clsModbus Description Set the timeout of the Modbus request Return values Actual timeout as ms Note Must be gt 0 Public Function Write Multiple Coils ByVal startRegister As Integer ByVal nCoils As Integer ByRef Values As Byte As Byte Member of Controlli clsModbus Description Write Multiple Coils Modbus request Parameters startRegister Start register address 0 to 65535 nCoils Number of coils to write 0 to 1968 Values Coils values Public Function Write Multiple Register ByVal startRegister As Integer ByVal nRegister As Integer ByRef Va ues As Integer As Byte Member of Controlli clsModbus Description Write Multiple Registers Modbus request Parameters startRegister Start register address 0 to 65535 fh amp 01943 602001 Q sales issltd co uk b www issltd co uk USER MANUAL SENECA Z TWS 3 and Z TWS64 nRegister Number of registers to write 1 to 123 Values Values to write Return values Modbus reply Public Function Write Single Coil ByVal Register As Integer ByVal Value As Integer As Byte Member of Controlli clsModbus Description Write Single Coil Modbus request Parameters Register Register address 0 to 65535 Value Coil value 0 or 65280 OxFFOO Return values Modbus reply Public Function Write Single Register ByVal Register As Integer ByVal Value As Integer As Byte Member of Controlli clsModbus Descripti
89. t SetldAndMask function each time it fh amp 01943 602001 Q sales issltd co uk b www issltd co uk USER MANUAL SENECA Z TWS 3 and Z TWS64 Identifier Mask is used in more than one RxSlot then the last created RxSlot receives it Mask parameter gives you the possibility to receive multiple Identifiers in the same RxSlot Bits A 0 value means don t care or accept a 0 or 1 for that bit position A 1 value means that the incoming bit value must match identically to the corresponding bit of the specified Id To completely disable the reception of CAN messages on an RxSlot application program should call this function with Id 1 and Mask 1 EXOR CAM RXSLOT SETIDAMDMASK Handle hCAN EXOR CAM RxSlot Setld ndMask eCAN Id DINT Mask DINT Name EXOR_CAN_RxSlot_SendPacket Description WARNING There is a 64 messages buffer FIFO messages are deposited in this FIFO and are transmitted by interrupt service procedures as soon there are no higher precedence messages in the CAN bus If FIFO gets full because application program calls this function at a rate higher than CAN bus throughput then error CAN FIFO FULL is returned Return Return Value is CAN OK if message has been queued in the FIFO buffer or directly transmitted if FIFO is empty Return Value is CAN FIFO FULL if FIFO is full EXOR_CAN_SENDPACKET CanPort INT EXOR CAM SendPacket eCAN Packet POINTER TO CAM PacketT Library E
90. urn Number of bytes realy sent UDPSENDDATA diSacket DINT UdpSendData DINT iPart INT stlPAddress STRING 80 pbyData DWORD diDataSize DINT others Name ConvertPAddressToString Description Convert the IP Address to a string in dot notation e g 192 168 100 2 Heturn IP address CONVERTPADDRESSTOSTRING dilPAddress DINT ConvertPAddressTosString STRING 80 Name GetlPAddress Description Convert IP Address from string to address Heturn IP address GETIPADDRESS stlPAddress STRING 80 GetlPAddress DINT Name GetReceiveDataSize Description Function to get received number of bytes in socket without removing it from the socket fu amp 01943 602001 salesQissltd co uk b www issltd co uk USER MANUAL SENECA Z TWS 3 and Z TWS64 Return Number of bytes received GETRECEIVEDATASIZE disocket DINT GetReceiveDataSize DINT Library Util lib gt Analog monitors Name HYSTERESIS Description function block which sets OUT to TRUE if input IN is less than LOW and which sets OUT to FALSE if input IN is bigger than HIGH HYSTERESIS IN INT OUT BOOL HIGH INT ru LOW INT Name LIMIT ALARM Description function block monitoring whether the input value IN lies between LOW and HIGH LIMITALARM IN INT gt BDC conversion Name BCD_TO_INT Description function reads BCD Byte and returns its INT value a wrong BCD value
91. us Master it queries the modules saves the values and storages them into a Data Base NOTE Seneca provides a variety of RS485 USB optoisolated converters for example 117P and S117P1 these devices allows to connect safely the Seneca Z PC Line modules with a PC After a configuration of a CPU 1 O project using the Z NET software from the Z NET toolbar select Project gt Data Recorder Be amp 01943 602001 salesQissltd co uk b www issltd co uk USER MANUAL SENECA Z TWS 3 and Z TWS64 Find present Modules Modules Insert Wizard onfiguration Parameters Varia Modbus Metwork Occupation Settings Baudrate Address Filter I 2 1 B dule 2 Z DIN 2 Reverse Input um E Delay of Communication Reply Module 3 Z DIN 3 i 38400 Module 1 Z DIN 1 Z Input 5 Speed Reading Figure 57 Configuring the Data Recorder step 1 At this point the following window appears fu amp 01943 602001 salesQissltd co uk b www issltd co uk USER MANUAL SENECA Z TWS 3 and Z TWS64 File Project Online Tools Channels max number Channels number Calculated channels numbe Total channels number Name Description Measure Unit Ing BS Ing ES Ez Calculated Channels Measure Units m Summary 1 Go to Data Recorder Add Channel Add Channels from modules Delete Channel Channels Error Log Terminal Debug Type Date Description eo I
92. vironments of advanced programming languages HOW TO INSTALL CODESYS Z TWS is equipped with Seneca package CD with this CD is possible to install the Codesys software and its Seneca libraries Be amp 01943 602001 salesQissltd co uk b www issitd co uk USER MANUAL SENECA Z TWS 3 and Z TWS64 To install the Codesys software insert the CD double click on the file CD_Start exe and so appears the following window SENECA PACKAGE SLIM CL INSTALL CoDeSys 2 3 INSTALL Codesys Seneca Library 1 06 INSTALL IsaGRAF INSTALL Seneca IsaGRAF libraries ver 1 00 INSTALL Java RunTime INSTALL Seneca Z NET3 2 00 Beta 12 INSTALL Easy Setup 2 02 INSTALL Seneca OPC Server IO 2 00 Beta 1 INSTALL Seneca OPC Server MB Slave 1 02 INSTALL Seneca Z NET3 RTU 1 50 INSTALL Seneca Z NET3 Trend Viewer 2 00 Beta 1 VIEW PDFs Figure 12 The installation page of the Seneca package CD At the first time click on install Codesys n n to install the Codesys and follow the simple operations then click on install Codesys Seneca Library n n to install the libraries for Codesys and follow the simple operations HOW TO INCLUDE THE SENECA LIBRARIES INTO CODESYS When a project is opened in the CoDeSys toolbar select Window gt Library Manager the standard libraries appear fu amp 01943 602001 salesQissltd co uk b www issltd co uk USER MANUAL SENECA Z TWS 3 and Z TWS64 LE LIO TO LI B 11 5 08 18
93. w issitd co uk A USER MANUAL SENECA Z TWS 3 and Z TWS64 V CoDeSys United PLC Corigucal p M NN NC NN ONES c cm File Edit Project Insert Extras Online Window Help yes alaka Aal 2 Resources H E Global Variables C library ANALYZATION LIB 5 10 99 09 05 06 global variables E library IECSFC LIB 11 6 08 18 05 14 global variables 3 library SYSLIBCALLBACK LIB 11 6 08 18 05 14 global variables library SYSLIBTIME LIB 11 6 08 18 05 14 global variables E library SYSTASKINFO LIB 11 6 08 18 05 14 global variables p AW Alarm configuration fe il Library Manager j EN Log e Ej PLC Browser FEE PLC Configuration j pe m Sampling Trace ae Target Settings I PET Task configuration Q Watch and Recipe Manager on Workspace Figure 42 Configuring the Z TWS with I O CANopen step 8 Automatic calculation of addresses lv Check for overlapping addresses Iv Save configuration files in project E To insert the CAN master right click into the previous red signed area and select Append subelement amp 01943 602001 salesQissltd co uk b www issitd co uk USER MANUAL SENECA Z TWS 3 and Z TWS64 Insert Element Append Subelement ModBus ComboFree Replace element ModBus Combol Calculate addresses Seneca Z 506 Seneca Z DAC Seneca Z 3A0 Seneca Z D OUT Seneca Z PID Seneca Z ATC Seneca 7 44 Seneca Z D IN Seneca Z 10DIN
94. w issltd co uk USER MANUAL SENECA Z TWS 3 and Z TWS64 Introduction of CoDeSys and its installation WHAT IS CODESYS CoDeSys is a complete development environment for your PLC CoDeSys stands for Controlled Development System CoDeSys Untitled Im m File Edit Project Insert Extras Online Window Help aae goaza een if Library Manager bi B PLC PRG PRG IECSFC LIB 11 6 08 18 05 14 FUNCTION BLOCK R_TRIG SYSLIBTIME LIB 11 6 08 18 05 14 SYSTASKINFO LIB 11 6 08 18 05 14 Rising Edge detection ANALYZATION LIB 5 10 99 09 05 06 E SYSLIBCALLBACK LIB 11 6 08 18 05 14 VAR_INPUT TWS MISC lib 10 12 10 10 32 04 CLK BOOL Signal to detect JEND VAR VAR OUTPUT n Q BOOL Edge detected END VAR i i DELETE FUN io iE FIND FUN i PE INSERT FUN PE LEFT FUN i LEN FUN io PUE MID FUN i je REPLACE FUN E RIGHT FUN Eg Timer iE RTCIFB iE TOF FB R TRIG io UE TON FB r E TPIFE cuc eoo a Q BOOL 2 3 Trigger EJ F TRIG FB DIMLII CNN NN B POUs 3 Data ty GA Visualiz Loading library C Program Files x86 3S Software CoDeSys V2 3 Targets SenecalLib_SITEK TWS_MISC lib ONLINE OV READ Figure 11 A Codesys page CoDeSys puts a simple approach to the powerful IEC language at the disposal of the PLC programmer Use of the editors and debugging functions is based upon the proven development program en
Download Pdf Manuals
Related Search
Related Contents
取扱説明書 Fuller Heavy Duty Transmissions TRSM0550 Untitled - Austin Canoe and Kayak Lincoln Electric LN-7 User's Manual gsm-based home intrusion detection device using sms messaging in Les Agents Anti Notice de montage 3000/5000/7500 Service Manual Philips S9711 ons en Volvo - Fichier PDF Copyright © All rights reserved.
Failed to retrieve file