Home

Tutorial - Mect srl.

image

Contents

1. 55 FF_D D flip flop 55 FF_T T flip flop 56 Date_ Read read the current date 56 Time_ read read the current time 56 TimeE_write write the current time 57 Date_write write the current date 57 ONE_SEC one second pulse 58 pulse 58 pulses 58 PWM 59 freq_dlv 59 digital_in_filter 60 Chrono
2. 96 16 12 STRINGS MANIPULATION FUNCTIONS 98 16 13 DATE FUNCTIONS 98 17 0 TPAC Remote Options 99 17 1 Remote Desktop 100 17 2 Remote Desktop Access 100 17 3 Setting Remote Desktop Password 101 17 4 Monitor 101 17 5 Variables Upload 101 17 6 Monitor Access 103 17 7 Remote PLC 104 17 8 PLCLIB Description 104 17 9 Functions 106 17 10 Working with PLCIB in a Turbo C environment 108 17 11 VPN ACCESS CONFIGUR
3. 13 5 5 THE FBD PROGRAM 14 5 6 THE ST PROGRAM 16 5 7 COMPILE AND DOWNLOAD THE PROGRAM 16 6 0 HOW TO DOWNLOAD A PROGRAM INTO TPAC 17 6 1 HOWTO DOWNLOAD PLC PROGRAM 17 7 0 HOW TO CREATE AN HMI INTERFACE 18 7 1 HOW TO DISPLAY A TEXT FILE 22 7 1 1 inserting a text file in an HMI project 22 7 1 2 Using text file in the HMI environment 24 8 0 HOW TO CONFIGURE A CANOPEN NETWORK 24 8 1 EDS File List 26 8 2 Insert a node in the network 26 8 3 Node Configuration 26 8 3 1 MECT CanOPEN Node 26 8 3 2 CanOPEN
4. 36 8 7 1 SDO Usage 37 6 all SDORGad ina PLC procera geksteccssesaet a O 37 8 falle2 SOO Wiite tid PG DOSTA do eantsaneeianae 38 9 0 RESETTING THE SYSTEM 38 ME7000_14 03 11 3 TPAC tutorial s r l mect 10 0 RECEIPTS 39 10 1 INTRODUCTION 39 10 1 1 Programmer side 39 10 1 2 Final User side 39 11 0 LANGUAGE MANAGEMENT IN HMI ENVIRONMENT 42 11 1 INTRODUCTION 42 11 2 STRING TABLE 42 11 3 INSERTING A NEW LANGUAGE 43 11 4 MODIFY TPAC LANGUAGE 43 12 0 SOFT KEYBOARD 44 13 0 COLOR DEFIN
5. 60 timer_retri g 61 timer_rit_ecc 62 timer_rit_dis 63 timer_Ccoil 64 T_trig 64 Set_Reset 65 Start 65 STOP 65 Cell Only TPAC 02 cell version 66 14 1 Embedded Functions 66 15 0 HOW TO CONFIGURE TPAC THROUGH THE WEB INTERFACE 68 15 1 Preface 68 15 2 Open TPAC web interface 68 15 3
6. 113 19 4 NetBuilder registration 113 19 5 Software update 114 19 5 1 System software update 114 19 5 2 Services software update 114 19 5 3 User software update 114 ME7000_14 03 11 5 TPAC tutorial s r l mect ME7000_14 03 11 6 TPAC tutorial 2 0 TPAC AT A GLANCE TPAC has many peripherals that may be divided in four sets see the user manuals for details 1 local control IO PNP digital input 0 24V PNP digital output 0 24V s r l mect Analog input 0 20mA 12 bits resolution max sample rate 500 samples per second Analog output 4 20mA 12 bits resolution refresh frequency 500Hz Incremental encoders max count es rpm 2 remote control IO 2 CAN channels 1 Mb sec with CAN OPEN protocol 1 RS485 or 1 RS232 115kbit per second 3 TPAC ports 1 LAN port 1OMbit per second 1 USB 1 0 port master 4 Human Machine Interface LCD 320 x 240 color STN Touch screen interface 16 keys keyboard A description of the TPAC port usage in a PAC project is given below The shortest PLC cycle may be Ims the timer accuracy is 30
7. B D O oO p UNH oO 2 a O D Analog PLCO PLG1 PLC IRGO IRQ1 Disabled Output 1 O D D Output 2 D O D O Digital PLCO PLC1 PLC IRQO IRQ1 Disabled Output 1 oO Output 2 O Output 3 E O Output 4 O QUIPUL z O w G w G w Output 29 D Output 30 O D Output 31 Output 32 O D ME7000_14 03 11 69 TPAC tutorial s r l mect 15 3 Configuration The Network Configuration section allows changing the IP address to which TPAC will reply after the next reboot The System Configuration section allows the activation of a number of parameters The watchdog The MECT serial protocol The cancellation of the recipes saved on TPAC within a previous project The restart of the system The touch screen calibration The download of the PLC and HMI currently running on TPAC Section PLC setup allows to set the cycle time for each of the available PLC Inserting the required time value for the PLC cycle in the available text box sets the cycle time time value must be expressed in milliseconds It worth to point out that only cycle times for effectively used PLC must be set hence if you plan to use a single PLC set the time cycle for PLCO to the requested value and turn off the other two PLCs Checking the box Free Run will make the corresponding PLC to run without a predetermined cycle time NOTE A non
8. TPACO10 PLC MONITOR Microsoft Internet Explorer aag File Modifica Visualizza Preferiti Strumenti Q rdero X gt x B A P Cerca P Preferiti B om w j rel 2 http 192 168 0 210 monitor v Vai Collegamenti TPACO10 PLC MONITOR gt 7 nam I Groups A i rrF Fi J z E ANALOG INPUTS Gruppo b Variabile Tipo Valore E M ANALOG OUTPUTS ANALOG_OUTPUTS ANALOG_OUTPUT_1 UINT 0 JV ANALOG OUTPUT_1 Fy ANALOG OUTPUT 2 ANALOG_OUTPUTS ANALOG_OUTPUT_2 _UINT 0 j DIGITAL _FEEDBACK ENCODER ENC_COUNT_1 UDINT 134217728 EREA nas ENCODER __ENC_COUNT_2 uont BE it ZENCODER ENCODER l ENC_COUNT_3 UDINT 0 E Micha ite ENCODER ENC_COUNT_4 UDINT 0 ENCODER _ ENC_MODE_1 UDINT 1 DATE_DD ENCODER ENC_MODE_2 UDINT 0 Fonem ENCODER ENC_MODE_3 T unr o DELAY DI ENCODER ENC_MODE_4 UDINT 0 ee ae RESULT ENCODER ENC_PRESET_1 UDINT 2147483648 TIME MM ENCODER ENC_PRESET_2 UDINT 2147483648 pa ENCODER ENC_PRESET_3 UDINT i 2147483648 g TIMERS ENCODER ENC_PRESET_4 UDINT 2147483648 SYSTEM_VAR I BUZZER 600i o E wv lt E a 2009 Mect S r l Internet 17 7 Remote PLC The TPAC PLCLIB library allowes the programmer to 1 Create a PC application that accesses the TPAC I O system analog digital local input output or CAN bus input output 2 Interact with the PLC program eventually already p
9. e c ES a 2 g i orala oS es we ee GT Delete abject PLO Object properties Alt Enter lomapo cmg Object Browser i ai networsiemg 7 RA Task configuration ea Collaudo can exp R a Programs e S c Ld collaudo _cA cnb i fE powa Compile FF El a Function Recompile al ji ool Functions Generate application files Cc a T Global va f EA varal iee a a library F EPL Ov Export object to library Mome filer collaudo _can exp ii AA Library manager Macros P Tipa file al Files Annulla we Select target fee Object browser f 22 22 O28 To ofc e Options Programa Function blocks Filters j ii Functions Variables Macros Mame CHO 4001015 CHO DO 01 CHO HODIERA CHO pO 03 CHO_ NO0IGODDO CHO CO 0S Symbol location CHO NO01AST CHO DO OF All ee CH nie OOTF 3 H Librar Vars type i import a PLC object select the tab with the object type select he object and press the Import object button ME7000_14 03 11 36 TPAC tutorial s r l mect Select the Variables tab on the pop up window Object browser A list of CAN variables is presented select all and press the button Import object The selected variables will be inserted into the PLC project and become usable like any other variable B File Edito View Project Debug Communication Wari lSe eloo eel as a pes see i eet
10. From the installation CD copy the openvpn 2 0 9 install exe file in any directory on the pc where you wish to install the client Double click on the executable name the installation wizard will guide you through the installation process The default installation path is C Program Files OpenVPN you can change it if necessary Once installation has been completed the directory C Program Files OpenVPN easy rsa contains all the tools needed to set up your PKI ME7000_14 03 11 108 TPAC tutorial s r l mect NOTE This tutorial is written assuming the installation path unchanged from the default proposed by the wizard OpenVPN will only run on Windows 2000 or later Also note that OpenVPN must be installed and run by a user who has administrative privileges this restriction is imposed by Windows not OpenVPN The restriction can be sidestepped by running OpenVPN in the background as a Service in which case even non admin users will be able to access the VPN once it is installed 17 13 Certification authority OpenVPN supports bidirectional authentication based on certificates meaning that the client must authenticate the server certificate and the server must authenticate the client certificate before mutual trust is established Both server and client will authenticate the other by first verifying that the presented certificate was signed by the master certificate authority CA and then by testing information in the now authenticated c
11. Rcpt_add_ty_UInt_par Rcpt_add_ty_Int_par Rcpt_add_ty_UDInt_par Rcpt_add_ty_DInt_par ME7000_14 03 11 Example result Rcpt_add_ty_SInt_par O PLC_var2 wide mm Adds an unsigned 16 bit integer parameter to the list Example result Rcpt_add_ty_UInt_par O PLC_var1 leng mm Adds a signed 16 bit integer parameter to the list Example result Rcpt_add_ty_Int_par O PLC_var2 wide mm Adds an unsigned 32 bit integer parameter to the list Example result Rcpt_add_ty_UDInt_par O PLC_varl1 leng mm Adds a signed 32 bit integer parameter to the list Example result Rcpt_add_ty_Dint_par O PLC_var2 wide mm 80 s r l mect Returns O if success other if fail Parameter index Parameter PLC name Parameter Mnemonic associated to the variable Parameter Measure Unit associated to the variable Returns O if success other if fail receipt list variable Parameter index Parameter PLC name Parameter Mnemonic associated to the variable Parameter Measure Unit associated to the variable Returns O if success other if fail receipt list variable Parameter index Parameter PLC name Parameter Mnemonic associated to the variable Parameter Measure Unit associated to the variable Returns O if success other if fail receipt list variable Parameter index Parameter PLC name Parameter Mnemonic associated to the va
12. change the used protocol udp the used device tun and the path and name for the server certificates and key Once you are finished rename the sample_server conf file in tpacO10 conf Open your browser and type the following address _http 192 168 0 210 vpn cgi_ to access the vpn configuration upload page Upload the following files e ca crt e dh1024 pem e tpac010 key e tpac010 crt e tpacO10 conf 17 18 Client VPN Configuration From the SAMPLE_VPN directory on the installation cd copy the sample_client conf file Open the file with a text editor and modify it according to the server configuration and substitute in the following lines cert client crt key client key the filename you ha chosen for the client certificate and key in the above example my_pc cert client crt gt cert my_pc crt key client key gt key my_pc key ME7000_14 03 11 110 TPAC tutorial s r l mect Also rename the sample_client conf file with the COMMON NAME you have chosen for the client in our example the client conf file will be my_pc conf Copy the following files e ca crt e my_pc crt e my_pc key e my_pc conf in the C Programmi OpenVPN config directory This completes your client configuration To configure more than one client install the vpn client openvpn 2 0 9 install exe on each pc client and repeat steps outlined in paragraph 17 16 and 17 18 as many times as you need 17 19 TPAC VPN address If using the s
13. e l Eg LO be WK i ix p Coie imported CAN variables oft CHO_ NO01GOOD lt CHOL NO01RST oft CHO_ NOOTRUN lt CHO_ NETDIS d CHO_ NETERA lt CHOL NETGOOD lt CHOLSNETRST lt CHOL NETRUN ft CHO_DILO2 ft CHO_DILO4 ft CHO_DI_OB ei CHO D108 a eee lt CHO_DO_03 ft CHO_DO_05 oft CHO_DO_OF wE CH1_ N002015 am m 8 7 2 SDO Usage CANOpen protocol relates PDO to variables that need to be known in real time or need to be heavily modified during the PLC execution On the contrary the protocol takes care of less frequently updated data such as node configuration parameters usually modified only at the beginning of a new running cycle through the SDO Service Data Object The SDO is serviced by two functions SDORead and SDOWrite that allows node configuration SDOs can access any parameter defined in the node object dictionary but they are not suited to make real time parameter modification since they require an acknowledgment and so are quite slow After naming all the objects that you need to access to upload CanOPEN project on the TPAC target as described above Once configured the objects are read and written in the PLC program by invoking the SDORead SDOWrite and functions SDO Objects will be read and written in the PLC program by calling the SDORead and SDOWrite functions 8 7 2 1 SDORead in a PLC program The function res SDORead 0 pr80 requires two p
14. 0 ELSIF AnInO lt threshold_2 THEN DO_1 0 DO_2 1 END_IF ELSE DO_1 0 DO_ 2 0 DO_3 0 END_IF 5 7 COMPILE AND DOWNLOAD THE PROGRAM Before being able to compile the program it must be assigned to a task To this purpose select Task in the workspace window by right click then click on the Task configuration tag that shows up In the column Program name of the Task configuration pop up window select the task ME7000_14 03 11 16 TPAC tutorial s r l mect to be assigned to the program then press Select An Object browser pop up window shows up Select the program name and press OK to validate the choice and close the window temp LogicLab fdb HA File Edit View Project Debug Communication Scheme Variables Window Tools Help asg ocon ASW SR DADeSG E Temp project Sj Programs Mie fdb E IL TTi Id 9 Function blocks C Functions 9 Global variables C3 Variables Sq 1 0 variabl s CJ Constant J Retain variables 0001 Filters 9 Project parafneters GFT asks EA Name Task configuration eooo Symbol location all l Select Unselect Cancel OK Library All v Yars type Cancel Once the program is assigned to a task we can proceed to compile and download it into the TPAC To compile the project select Recompile all in the menu Project The compilation progress and log can be monitored in the Output window If the program has been modified si
15. 1s necessary to update the outputs as soon as possible without waiting the end of the cycle In these cases there are available some functions called immediate that update the outputs These functions are listed below Description Input parameters Reads the encoder value Parameters encoder number 1 Imm_read_encoder Example of encoder 2 read Returns the read value if success read_value Oxffffffff if failure Imm_read_encoder 1 Sets the value of encoder Parameters encoder number 1 Imm_set_encoder counter preset value to set the encoder Example to set the encoder 1 Returns Q if success 1 if failure to 14322 result Imm_set_encoder 0 14322 Sets the encoder counter Parameters encoder number 1 Imm_set_encoder_mode_ mode mode to set the encoder Example of set the mode 3 Returns 0 if success other if on encoder 1 failure result Imm_set_encoder 0 3 ME7000_14 03 11 73 TPAC tutorial s r l mect Reads the digital input value Parameters input number 1 Imm_read_digital_input Example of read the input Returns the read value if success 45 Oxffff if failure read_val Imm_read_digital_input 44 Reads the outputs state Parameters detecting output 1 Imm_read_digital_feedb 2 ack Example of read of output 9 Returns the read value if success and 10 status Oxffff if failure Read_val Imm_read_digital_feedback 4 Sets the digital outputs Parameters
16. Configuration 70 16 0 FUNCTIONS 73 16 1 IMMEDIATE FUNCTIONS 73 ME7000_14 03 11 4 TPAC tutorial s r l mect 16 2 DELAY FUNCTIONS 222 222 2202 2222222 nnccn nnn nnnccnne 74 16 3 TIMERS 75 16 4 VIDEO CONTROL FUNCTIONS 75 16 5 RECEIPTS FUNCTIONS 77 16 6 DATE AND TIME FUNCTIONS 83 16 7 MECT SERIAL FUNCTIONS 83 16 8 MODBUS Functions 85 16 9 CanOpen FUNCTIONS 9 16 10 HMI TEXT FILE IMPORT FUNCTIONS 93 16 11 DATALOGGER 93 16 11 1 CRYPTO DATALOGGER CFR21 11
17. ENABLE BOOL l Enable bit PERIOD UINT 16 Pulse duration OUT BOOL l Output pulse Description When ENABLE is 1 the output OUT is set to 1 for PERIOD ms pulses PULSES M_PULS OUT PULSE_ON PULSE OFF STR Parameter Data Type Dimension Description N_PULS UINT 16 Number of output pulses PULSE_ON UINT 16 ON state of each pulse PULSE_OFF UINT 16 OFF state of each pulse ME7000_14 03 11 58 TPAC tutorial s r l mect STR BOOL l Enable input OUT BOOL l Output Description When input STR detects a rising edge on the output is present a train of N_PULS pulses whose on state is equal to PULSE_ON ms and off state 1s equal to PULSE_OFF ms pwm Py ha PERIOD OUT BL RESET Parameter Data Type Dimension Description PERIOD UINT 16 PWM period DC UINT 16 Duty cycle RESET UINT 16 Reset input OUT BOOL l Output Description When RESET is set to 1 on the output is present a square wave whose period is equal to PERIOD and duty cycle is DC freq_div FREG Oy CLE OUT e DIV Parameter Data Type Dimension Description CLK BOOL l Input frequency DIV UINT 16 Division factor OUT BOOL l Output Description Divides the input frequency by the factor value set on the DIV input ME7000_14 03 11 59 TPAC tutorial digital_ in_filter digital _in_filter s
18. New shows the New receipt window In this window the user must insert the name of receipt and if needed its description New receipt Receipt description To insert the name of the receipt the user must touch the field Receipt name A virtual keyboard appears on the screen Receipt names are limited to maximum18 characters To confirm the insertion press J on the virtual keyboard or enter on the hardware one ME7000_14 03 11 40 TPAC tutorial s r l mect New receipt xX Receipt name Receipt name Description Receipt description The field receipt description is an explanation associated to the receipt that helps the user to better identify it Touching the field Description displays the virtual keyboard At most 190 characters may be contained into the description field To end the description typing press the Ese button on the virtual keyboard By pressing OK the receipt with its name and description is saved The parameters values of the new receipt are loaded from actual PLC variables If ESC is chosen the New receipt page is closed and no receipt is created Delete a receipt To delete a receipt from the list after selecting it press Canc a dialog window will ask to confirm the deletion If Yes is chosen the receipt will be definitely lost Visualization and description change The description associated to a receipt is shown by pressing the button View in the page Receipt Description xi
19. Node Manual Configuration 29 5 2 Administration ODICCIS dics varck cate ces ben lithe nandd via eke cn enone basse emseaied sav euetebeaant eins 30 S penal aul oss ne Perea ena ee tr eee my nena eM Rn nT nen eT Ene Teer Oe mR try ner oe re Te eee 30 ec DECC I Oa steele Sten perce cece r a beat aerioaacies 31 S522 OD ject DICH ONAL Ys sesctasenrscnnaatossesawensain sins alendadeanachsargannsawtnesin sun E EE 32 Bi 9522 Paran er IS ane A E S 32 ON DE L aaae E A e E 33 69 27 SOO and PDO HS Tai A tetas 33 8 4 Object List 33 8 5 Network parameter configuration 34 8 6 Main Ment 35 8 6 1 File Menu 35 S021 Build the cOmimeuration Mierer N ae neta 35 8 6 1 2 Download the configuration file 0 0 0 0 cccccsssssseccceccceeeeeeseecceceeeeeaeeeseeeceeeeeeaeeeeeees 35 SLI PEOIECE SAVE oria E eae elena eeu als 35 8 6 2 Tools Menu 35 SO 2A RC Cena a a a a a Te ee ae 36 8022 EDS INPO cera a E 36 8 7 Using the CANopen objects in the PLC
20. Rcpt_store_vars the functions that assign the value of each element to the corresponding PLC variable The functions to be called are Rept_get_tyDInt_par j to copy the element j of the receipt in a signed integer variable and Rept_get_tyReal_par j to copy the element jJ into a real variable The Rept_store_vars procedure is called when the user press the Store button Note The PLC variables that belong to the receipt must be placed into the retentive memory block In this way the variables values will not be lost when the TPAC is turned off To call the receipt package main window the programmer needs to open the window ric 10 1 2 Final User side A graphical interface is made available for the final user in order to e Insert new receipts e See the receipts parameters e Delete receipts ME7000_14 03 11 39 TPAC tutorial s r l mect e Scan the receipts list e See and modify receipts descriptions e See and modify the values of PLC variables part of a receipt Te Receipt Receipt name KeA sini Si ak Saves the current LARmo p A receipt New f Teli Wiel ere es p Wiews the receipt Creates a newj o s gt a Ree EE description receipt Tepe Uatune Te i P Automatic delay 15000 ms Delete the current receipt Stores the receipt values into Displays the actual values PLC of PLC variables Scans the parameters into the receipt To create a new receipt Pressing the button
21. gt gt gt gt O D REER ERREKERI LEE i REEERE EIEII ICO LEES SSG SESSEEEEEEEEEEEEEE ESOS REEERE EEEIEI EEEIEE EEES EEEE EEIEIEE EEEIEE REEERE EEEIEE IIIS EEEE EEEIEE ARERR RRR RRR RRS 7 oH PS eee ISelectBord Se S S s OSS O D 0 D D Q gt SECC ES ORERE EEEE ORERE OEE OERE IK SECC ESSERE SOS EONS SOOO OOOO EER OOOS SOCCER OOOO SESS EEE EES 4 Q D OO O or gt x 6 Q G Q C gt ee s s o s e z es gt lt es os lt 9 amp a 6 5 oe o D D CA Se gt gt D Q gt Q eS 6 e 2 se os es es s amp x a SS D gt gt Q D Se a ZS 28 2 a 2 2 w a 2 5 a S s F D Te Q O o a o gt EEEIEE D Q Q D gt gt D gt D D gt Cx EEEE EEE esters EKEK KKK KKK KK E S783 RREKET EKKREIS k REKEL KREKERI LEKKE RERE KKKKEKKKKEKKKRRKS EEEE A UE ERRER RERE Visible EEEE KKI EEEE EEKE KKKS EEEIEE RELEE REKREIS LEKKERKERK ransparen RREK KEKEREKE ERKEK KEKEKE OO OE Um Merete eee KKK KKKS SSS EES EO Lv eR MpR pe pz III IEI pz Mp Mpg IKIRE tts SOCSEECCEEEEEEEEECEEEEEEEEEECEEEEEEEEEEEEEEEEEEEECEEEEEEEEEECEEEEEEEEEEEEEEEEEEREE ES x REKREO KRK KRKK MMe t ERER RRR RRR RRR SECCSECEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEREEEEEEEEEEEEEEEEEEEEEEEEEEEEEE
22. has been instantiated the configuration file that contains variables and parameters value must be created to allow the communication with the CanOPEN master Even if the Can Builder software supports the configuration of a generic Node in case of MECT CanOPEN nodes the software allowes a graphical configuration that simplify this activity The following section describes the configuration of a MECT CanOPEN node while the configuration of a generic one is depicted in section 8 3 2 8 3 1 MECT CanOPEN Node When building a CanOPEN network based on the MECT MPNC module after instantiating the number of required nodes by double clicking on the instance to configure the following window appears ME7000_14 03 11 26 TPAC tutorial s r l mect ake ia oo said LDS for Mect CANopen Slave bus coupler 16 Ghottal in a i dint SLAR SANE BOUT The configuration window offers two sections the left one showes the various kind of MECT MPNC available terminal while the right one will contain the tarminal instances that will compose the node To configure the node select the kind of terminal you wish to use and drag it on the right side of the configuration window Each terminal will be automatically assigned with an identifier Pay attention the sequence of instantiated terminal must be the same when phisically assembling the node ME7000_14 03 11 21 TPAC tutorial s r l mect Configure Bus Coupler 16 digital In 16 digtal Ou
23. limits the output START is set to 1 If the input is greater than MAX_VAL output START is reset the output HIGH is set to 1 if input is smaller then MIN_VAL the output START is reset the output LOW is set to 1 ME7000_14 03 11 54 TPAC tutorial GAIN s r l mect Parameter Data Type Dimension Description X UDINT 32 input X A UDINT 32 Multiplier parameter B UDINT 32 Divisor parameter C UDINT 32 Offset Y UDINT 32 Output Y Description Calculates the function value Y X A B C FF_D D flip flop Parameter Data Type Dimension Description D BOOL l Input Bit CLK BOOL l Clock input Q BOOL l Output bit Description The output Q is equal to the input D when a rising edge is detected on the CLK input ME7000_14 03 11 55 TPAC tutorial s r l mect FF _T T flip flop FF_T CLE Parameter Data Type Dimension Description CLK BOOL l Clock input T BOOL l Output bit Description The output T toggles its value at every rising edge on the CLK input Date_ Read read the current date Date read Tr hal ful OD Parameter Data Type Dimension Description YY UINT 8 Year MM UINT 8 Month DD UINT 8 Day Description Call this function to update the system variables DATA_YY DATA_MM DATA_DD Time_ read rea
24. on the Internet Explorer browser version 6 0 IE6 Switch on the TPAC and plug a network cable to connect the device to the local network then on a host pc run IE6 and insert in the address field http lt IP address of TPAC gt The TPAC IP address assignment is described in the section TPAC Configuration After entering the IP address press Enter the TPAC responds by sending to the browser the web page shown in the picture below The loaded web page contains the following section Google Microsoft Internet Explorer File Modifica Visualizza Preferiti Strumenti http 1 92 168 0 249 Network Configuration System Configuration PLC setup IO Setup IO Configuration IDs ME7000_14 03 11 68 TPAC tutorial s r l mect TPACO10 Configuration Network Configuration System Configuration DHCP Watchdog is off Enabled Disabled Static Serial OFF MECT IP 192 168 0 124 Receipts Remove NM 255 255 255 vlo pNsi 1 wo vijo Mo M f DNS2 l ilo v o o ae TS Calibration Download current application PLC Setup State PLCO PLC1 PLC2 IRQO IRQ1 Real Time 20ims Ims Ims Free Run O O Disabled IO Setup CAN PLCO PLU1 PLt Disabled Network 0 is C Ep O Network 1 O O Encoder PLGO PLC1 PLO IRQO IRQ1 Disabled O O B
25. output number Imm_write_digital_outpu setting value 0 1 t Example of set 1 to the Returns O if success other if output 3 result Imm_write_digital_output 2 1 Reads the analog input value Parameters analog input 1 Imm_read_analog_I Example of reading the Returns the read value if success analog input 2 Oxffff if failure Read_val Imm_read_analog_1i 1 Sets the analog output value Parameters analog output number Imm_write_analog_o 1 value 0 4095 to be writtne on the output Example of write the value Returns 0 if success other if 100 on analog output 1 result Imm_write_analog_o 100 0 16 2 DELAY FUNCTIONS To reduce the digital inputs sensibility it is possible to make a digital filtering of inputs that makes to consider reliable an input when it is stable for a while The settling time is user defined For each delayed input the programmer must do two steps e set in the variable DEALY_DI input the delay time in ms e call the function di_delay_set input The input parameter must contain the delayed input The inputs are numbered from 0 to 47 Example of delaying the input 5 of 100ms DELAY_DI 4 100 result di_delays_set 4 In the example the function di_delays_set returns O if succeed it returns not zero value for failure ME7000_14 03 11 74 TPAC tutorial 16 3 TIMERS s r l mect A number of timers 128 are available for the programs When
26. r l mect H OUT FILT Parameter Data Type Dimension Description IN BOOL l Input signal FILT UINT 16 Filtering factor OUT BOOL l Output Description If the input is stable for almost FILT number of PLC cycles its value is propagated to the output chrono chrono WINS RESET Parameter Data Type Dimension Description MINS UDINT 16 Minutes set START BOOL 16 Start chrono OUT BOOL l Terminal count OUT_TIME UDINT i Time elapsed Description When RESET is set to 1 and a rising edge is detected on the START input the chrono starts to count until it reaches the value set on MINS input then output OUT is set to 1 The count stop if RESET input is reset ME7000_14 03 11 60 TPAC tutorial timer_retrig TIMER_RETRIG s r l mect e CLE SH e TIMER CURR e DELAY RESET Parameter Data Type Dimension Description CLK UDINT 32 Clock input TIMER BOOL l Choose one of 128 available timers DELAY BOOL l Delay setup RESET UDINT 32 Reset timer SYNC BOOL l Terminal count output CURR UDINT 32 Counter current value Description RETRIGGERED DELAY INPUT TIMER Starts the selected timer if on the CLK input is detected a rising edge and RESET is set to 1 The timer works for a DELAY even if the CLK input goes 0 before the time is ended The output SYNC is set to 1 when the time is elapsed Th
27. sections we have seen that some objects have associated parameters or variables and we have seen how the lists of variables and parameters can be created Going back to the Can Builder main window by selecting the tab Variable list the list of the variables associated to all the nodes that form your network will be displayed ME7000_14 03 11 33 TPAC tutorial s r l mect L MELCI Can Builder ODW cnb File Strun E T 2 MINPI_T O_OF MP1 TEO_OF DINP1_TEO_OF o DINP1_T 0_OF DINP1 T 3 OF In the same way by selecting the tab Parameters List you can visualize the list of parameters that will be sent from the master to the nodes available in the network during the configuration step The previous mentioned lists summarize all variables andp arameters that will be used in your network configuration 8 5 Network parameter configuration The rightmost portion of Can Builder main window shows the parameters used to configure the CANopen network e Baud rate speed of data transmission CAN Channel which of the two TPAC CAN channels must be used Cycle time of the CANopen network Guard time time between two Node Guarding messages sent by the master Life Time number of Guard time periods over which the master message is considered disconnected when a Node Guarding messagges is not received Sync Enable the master is required to send sync e Manage NG toggle bit the master is required to send NG message with data bit t
28. see see SEEGER a a Se ae a saat ee E aac SRR eee See A E o ee A A AAA a eee A EE BREE E a E a EE a E a E a eee A E a E a E E a Heer BA E a E a E a E A EE a EEE a EE A EE a EE A EE A EE BA EE A EE EEE E a r E t teet E E eR r E tetetete EEEE E EEEE EEE EEEE EEEE Se EEEE E ER Bee eee Bere enacted coerced A terre Sa aeertrtaa aerate Sree ere EEEE E EE SESE EES Etre SESE EEE eee ees RE SE EAEE RERET ER EE ERNIE EEEE e RE A ESE Stee EEE SEE et ttre SESE Ett tisis EE P E E PERENE P er E ERR RR E SEE SER Eee SES EEE Sete SEE Ete SESE Etre SERS SEE ete SER etre E HGH ER ERE REER SEGRE AREAS SEENEN ES SENENI SEERA SERNER SEEREN RERE RE ES RES o GEER o REE Pee rE PEE RAFEH Sa teeta aS etait PACH eer Settee eet PSHE ESSERE Stee eA AAPEEE FS PEEHI R e PEE E n FEL ERE RAEE EEEE E EE pe Ee HEE eI Sa eee E P AEREE EEE SS Shannan R RSE R PR SE R EA EER E E PE SE PE SRE P SRA PR SEA PR SERA S SERA S SERA SR SERA SR SERA SE SERRA E PER SERRA SR AERAR PAE ARRA NEA E EREE EREE EERE EERE ERME EEE EERE REENE RENE REENE RENE REENE REENE REENE r RENNE e taie PRR ERN ERNE a ERR EER ices ERR ices a ERRE a ENR a ERR a ENR Seonsonnnnntccs Seonsonnnnni cas Se ouaennnnn nts Se onaennnnn nas Scousonnnnn ices SS nis PR PRR PRASA PRS PRSA PRAS E n
29. the file with the specified file name and returns an error code If the returned code is O the function was successful and the HMI_LOAD variable contains the returned file pointer The following code details an example for the HMItestLoad function res HMItextLoad instruction txt IF res 0 THEN output FILE_READ ELSE output File not available END_IF HmitestLoad looks for the file named instruction txt If the file exists res is 0 hence ouput declared as a 1000 character string contains the file pointer returned by the function By assigning output to a HMI text box the file content is displayed on the screen 8 0 HOW TO CONFIGURE A CANOPEN NETWORK The TPAC works as CanOPEN master device hence a number of CanOPEN node devices can be connected to the master in order to build a CanOPEN network These CanOPEN node devices must be configured and the configuration parameters with the master must also be set The previous mentioned configuration are set through a specific software that depends from the CanOPEN master hence it is bounded to the TPAC Mect provides the Can Builder CanOPEN network configurator ME7000_14 03 11 24 TPAC tutorial s r l mect If you want to manage a CANOpen network from the CANOpen section of the dashboard create or open a project CANopen lt Set workspace Create project Click on the icon New Project and through the Set Workspace button select
30. the project or to open an existing one press the button Launch HMI the HMI developing environment begins ME7000_14 03 11 18 TPAC tutorial s r l mect NOTE Before starting the PageLab HMI designer needs to be linked with the TPAC variables defined in the TPAC project To this aim select Link PLC variables file in the menu Project Then find in the PLC project folder the exp file select the file and click open The IO variables created in the TPAC development environment are now visible in the HMI project PageLab paged Exp ort lang u age to file 2 Import language From File ee Link PLE variables file C Refresh PLC variables lapri Cerca im project E Generate code Bownload project ai o SME Leal Risorse del computer Slproiect a Floppy da 3 5 pollici f 43 variable Disco locale C PRAJ g M2130 D sys su Hpserver F iol Risorse di rete BoI2000 __ ore lavora EJ TPLCIo Tipo file As done for the PLC project we first need to define the communication parameters with the TPAC Select the menu Project gt Communication settings then follow the steps described in section How To download PLC program To begin the HMI project we define a new page In the project window select Pages right click on it then left click on the Insert page tab in the pop up menu that appears In the New page pop up window insert the name of the page and then click OK button as in the figu
31. value is decremented by 1 If DIRECTION 1 when the counter equals the PRESET value the output SYNC is set to 1 If DIRECTION 0 when the counter equals the 0 the output SYNC is set to 1 At the next rising edge on the CLK input if DIRECTION 1 the counter restarts from 0 if DIRECTION 0 the counter restarts from PRESET value If RESET 0 the counter sets the value to 0 if DIRECTION 1 set to PRESET if DIRECTON 0 If RESET 0 the counter never changes its value ME7000_14 03 11 49 TPAC tutorial 32 bit up counter counter up s2bit MIFRESET IELK SYTHE COUN T s r l mect Parameter Data Type Dimension Description PRESET UDINT 32 Counter value set from 0 to 2432 CLK BOOL 1 Clock input RESET BOOL 1 If RESET 0 the count set to zero SYNC setto 1 SYNC BOOL 1 Terminal count Output It stays to 1 1f in count up it has the PRESET value COUNT UDINT 32 Counter current value Description 32 bit up counter The counter changes value if on the CLK input a rising edge is detected When the counter equals the PRESET value the output SYNC is set to 1 At the next rising edge on the CLK input the counter restarts from 0 If RESET O the counter sets the value to 0 If RESET 0 the counter never changes its value 32 bit down counter counter down 32bit SYNC COUNT Parameter Data Type Dimension Description PRESET U
32. zero PLC cycle time for an unneeded one lowers the overall system performances since a PLC uses CPU time An output device can be driven exclusively by a single PLC The IO Setup section assigns analog outputs digital output CanOpen channels and encoders that each PLC is entitled to use In the following example the network CAN 0 is assigned to PLC 0 and network CAN 1 to PLC 1 If Idle is selected the corresponding CANOpen network will not be handled by TPCO10 As mentioned earlier a PLC can manage both CANOpen network but it is unfeasible to assign a CANOpen network more than one PLC at the same time Analog and digital outputs are subject to the same constraint ME7000_14 03 11 70 TPAC tutorial s r l mect IQ Setup CAN PLCO PLC1 PLC Disabled Network O ie fo J Network 1 r e E z Encoder PLCO PLC1 PLC IRQO IRQ1 Disabled D F tC D s 2 f D i D c Analog PLCO PLC PLE IRQO IRQ1 Disabled Output 1 i p D i Output 2 co C i i Output 3 i p i E Output 4 e p p B f B Digital PLCO PLC1 PLC IRQO IRQ1 Disabled Output 1 i s i i E i Output 2 D i F i s Output 3 e Ss i i Ss D Output 4 i p i i i Output 5 fe p i J J Output 6 e D 3 B B e Output 7 ic s i s C3 Pbk M re p p p p p The IO Configuration section configures for both digital and analogue channels the kind of physical value detected in the case of analog inputs or generated in the case of exits IO Configuration Universal An
33. 2 2 2 0 0 0 0 0 0000 R TREKKE aasa aaa 2222 2S i Raised 6 OOOO OO OOOO OOS OOOO OS 4 4 D gt Q D C Q x D D gt x D gt x os O 8 s Se Se lt lt amp S S es os ie D D D D Q D Q gt Q 0 gt gt Q Q a oe D 2 S 5 ee ereneee Sei OSS Seid g o 2 2 2 2 amp 2 x SS o Cx xO Cx xx D D Q SSSI CI ICI a OO G Q gt gt gt gt D gt gt 4 7 gt gt 3 s AS ren oea gt D gt D gt gt gt 7 gt gt Q O en gt Q gt gt gt gt gt Q gt x gt gt ae amp S 5 ty gt gt gt gt gt gt gt gt gt gt gt gt O gt gt D D D 4 o gt D gt D Q 4 ox O Oe gt 4 or gt gt D gt gt gt gt gt gt D o er gt gt gt gt gt gt gt gt gt COO OOOO x 2 2 2 2 2 2 D2 O 0D 0 OS o eS Q 2 2 2 2 2 2 A T A A 2 OOO Oo amp I ID Se 2922 0020 0 0 OO 0 OO Oo amp 2 2 2 2 2 2 2 0 6 OO 6 OOo a ERREKEN EEEE EEEE REEERE x 2 SISIE IIIS K365 T L_8x16 OO ID 5 Bose en gt Q gt gt gt gt
34. ATION 108 17 12 PKI setting up 108 17 13 Certification authority 109 17 14 Session key 109 17 15 TPAC certificate and private key 110 17 16 Client certifcate and key 110 17 17 TPAC VPN Configuration 110 17 18 Client VPN Configuration 110 17 19 TPAC VPN address 111 18 0 USB ALLOWED OPERATIONS 111 19 0 APPENDIX 3 112 19 1 Software Registration 112 19 2 Registration code request for LogicLab PageLabe and NetBuilder 112 19 3 LogicLab and PageLab registration
35. Builder must assign a name to the dictionary object to which you need to access to 8 3 2 5 Parameter List The parameters set in the Object dictionary tab are collected in this section as shown below Theese parameters are sequentially sent by the master at the inizialization step The Parameter list tab showes the order that will be used to send them If necessary you can rearrange the order of ME7000_14 03 11 32 TPAC tutorial s r l mect configuration parameters by moving them in the Parameter list by selecting the item you want to move and using the up down available arrows Adminstration Objects File Info Device Info Object dictionary Parameter List ysriable List RSD TsD0 ReDo troo tex RE 1400 1 0x0123 COB ID used by RXPDO1 1400 1 Ox0456 COB ID used by RXPDO1 1400 1 0x0345 8 3 2 6 Variable List The picture below lists the variables created in the Object Dictionary those variables will be user accessible via the PLC The list of variables can not be changed JANINS TE1 02 Ath Ui _TE1 03 eee eee ee eee JANINS_TE2_00 ANINS TES OL JANINS TES FT ANINS TESS AOL 8 3 2 7 SDO and PDO list Sections RSDO TSDO RPDO TPDO show respectively e SDO with read permission e SDO with write permission e PDO with read permission e PDO with wirte permission Theese lists are read only and contain a different representation of the object dictionary 8 4 Object List In previous
36. DINT OZ Counter value set from 0 to 2432 CLK BOOL 1 Clock input RESET BOOL 1 Counter set to PRESET SYNC setto 1 SYNC BOOL 1 Terminal count Output Set to if counter value is 0 COUNT UDINT 32 Counter current value ME7000_14 03 11 50 TPAC tutorial s r l mect Description 32 bit down counter The counter changes value if on the CLK input a rising edge is detected When the counter equals the 0 value the output SYNC is set to 1 At the next rising edge on the CLK input the counter restarts from PRESET If RESET 0 the counter sets the value to PRESET If RESET 0 the counter never changes its value Byte to bit Bute To Bit H BU AA Bz Biz Bd AS BE By Parameter Data Type Dimension Description IN BYTE 8 Input Byte BO B7 BOOL 1 Output Bits Description Split the input byte in eight bits Word to bit WrordTo Bit H Parameter Data Type Dimension Description IN WORD 16 Input word B0 B15 BOOL l Output Bits ME7000_14 03 11 5I TPAC tutorial s r l mect Description Splits the input word in 16 bits Word to byte Word To Byte IH BY TEO BYTE Parameter Data Type Dimension Description IN WORD 16 Input word BYTEO BYTE 8 Output Byte low BYTEI1 BYTE 8 Output Byte high Description Splits the input word in two
37. Data project H E Programs H E Function blocks H E Functions ipa ea Global variables gee CJ Variables a New 1 0 variable eS gs CJ Constar Retain variables 2 Project parameters L Ovariable declaration e A eal Tasks Name Datatype LISINT eet Group O H a oNo we Data block M E T r Subindex a ms Location 10 data black Base add Size Unused retentive User area MBS 0 4097 4097 User area a ZMEDO 262145 2pat44 Other data blocks ee 1 0 block free indexes E 4 User area Description Ok Cancel ok Cancel In the workspace window expand the I O variables tree In this tree select which input or output to use then drag and drop it into the program window The software will ask if the selected variable is an input or an output Choose the right type and then press OK ME7000_14 03 11 14 TPAC tutorial s r l mect imectplc LogicLab triali Mi File Edit View Project Debug Communication Scheme Variables Window Tools Help asgl or ASD SR IDA DRSSe ax Name Type Address Array Initvatue eed Mectple project A E3 Programs 9 Function blocks 0 Functions 6 03 Global variables 9 Variables B A 1 0 variables ddwl analog_O_ko idw analog_O_ok idw analog_1_ko idw analog_1_ok Description lui JAR ai ud BA i aA Darana L ui nutt ar CHO_ NOO1ERR nln AnOutO A is k Ba
38. EEEE EEEE EEEE CA 5 5 5 SS 4 EOS ELLEKE KKKEEK EEKEREN EEEIEE EEEE EEEO TIIE IIE I III IIIS RRI IRIIRI I III III IISI EEEE EEEE EEEE EEEE EEEE E EE EES Among the most important elements of a button there s its action To assign an action select the row Action then the action to associate from the drop down menu In our example we want that the ME7000_14 03 11 20 TPAC tutorial button opens the operative page hence we select the OpenPage entry as below Name Butlon 17 Text lmg jil Sel Text lmg Font Asciibx8 A ppeatance Raised Border pts 1 1 Border col Back Color i sclecBod i Select Back J Visible TRUE Transparent FALSE Fress var D QOS fein F Ed fi t OpenPage s r l mect shown in the figure As depicted for the button example we may insert others elements such as static labels or images The operative page has more objects than the welcome one There are five static labels two input fields and two output objects The properties of objects are inserted in the same way as described for the button element above ME7000_14 03 11 21 TPAC tutorial s r l mect Before compiling the project we need to set the page from which the visualization starts From the project window select Pages and right click on it then left click on the Page proprieties label in the pop up window In the Page properties window select Genera
39. EEEEEERE ROE SSS gt gt gt gt Q Q gt gt gt gt D gt gt D D gt D D Q gt gt D OO gt gt Q gt gt gt gt gt oO D COO COO OOOO G gt Q Q gt Q gt gt x O D O S oe SSO E EERE ON f EEEIEI EEEE EEIE f EEEIEE EEEIEE EIEIO f EEEE eee ELELEE ITIS f SSS SSRI IID 5 EEES ERRER ERREK eee ee EES EERE REKKERS SSCS CSCC ES ORRERI EEES Q ee ty D D 2 D 4 D Q gt x gt gt gt gt gt 0 002 82 2222 SOs 9 2 2 0 Oo D EEEE EEEE EEEE EEEIEE 2 2 9 9 2 2 9 9 9 2 9 9 9 S99 29 9 9 2 9 9 929 92 or gt 5 o O D o o D Q o Q D o Q o Q o C Q D Q C D CA gt gt gt amp 628 a en Q Q gt gt gt gt Q x D re S a 44 gt O Q D D D 4 D D D a 2 gt gt D gt gt D gt gt en gt EIRINN I CCC TA ction eres SN Or or oro oo OUI TI TTI ITT I IT TTT TTT HRT T IT TTT I TCC Action par or Xe gt gt gt gt gt gt gt gt gt gt D D EEEE CC CCC CC CCCEEEEEEEEEEEEEEEEEECR tats EEEE EEEREN EEEE EEEE EEEE EEEIEE
40. INTRODUCTION When inserting a string in a PageLab project is always possible to write the plain text or use a resources string by calling its identifier In the first case the text will be always constant while by using the resources string the text will be displayed in the active language 11 2 STRING TABLE To show the string table press the Tag Resouces in the project window then select the key String table The table is composed by two columns the left column contains an identifier ID the right one the string that will be shown on screen Caption 09 PageLab String table c prj tpaci0 hmi transmatic_fmo_hmi transmatic_fm_hmi paj String table abe File View Project String Window Help jOaea oc she as Spl sla SX 4a CBA Im A e elec Fela a ake String table ation 5 Resources Italiano Ela Fonts ce Bitmaps SA string table IDS_LINGUA Lingua Italiano Hg Enumeratives IDS_SAVE Salva igs age lists IDS_ESEGUI Esegui IDS_ CANCEL Annulla IDS_VALORE VYalore IDS_ ALARM Allarme IOS RECEIPT Ricetta IDS_NeEVy Muova IDS _ DEL cant IDS MIEY Vedi IDS LOAD Visualizza att IDS_VARMAMNE Mome variabile IDS_hl um IDS WAL Valore IDS_SAVEAS Salva come IDS NEVWROPT Muova ricetta IDS DESCR Descrizione IDS NAMERCPT Mome ricetta IDS DELETE Cancellare la ricetta IDS_ YES Si IDS _ Mo No IDS _ STORE Utilizza att _ IDS_ STORED Parametri scaricati EF Project ey Resources IDS_NOTSAVED P
41. ITION HMI 46 14 0 FUNCTION BLOCKS 47 PID 47 Self tuning PID 48 32 bit up down counter 49 32 bit up counter 50 32 bit down counter 50 Byte to bit 51 Word to bit 51 Word to byte 52 Double word to byte a2 MUX_8_x_1 multiplexer 8 per 53 COMPARE 54 GAIN
42. OEEEOO LESSEE ODEO OS OOS OOS ee AORTA ARADATACRTAD ATA TADAMANACACREA TAC ACEO SECECCECCECSESEESCECSESEESEESEESEOSESEESEESEESESSESEOSEEEEOS LOCEEOEEOD ODED DODD OO DOS Ob x K9 D gt K3 o sh O50 es XY gt D D 4 Cx gt o e S e o 5 25 s s s amp amp amp ss amp s amp 9 s OO gt gt gt gt gt ee gt gt gt gt gra CA gt gt gt x C3 gt en gt ex Q s S x D S oo S O Q D O a S S D C 6 amp es amp amp amp s amp amp amp es s amp amp es amp amp amp 6 amp amp amp D RRRS KS Q Q Q OO gt gt gt gt gt D D gt Cx XS 5 6 es oe 250 ois o 6 amp 5 6 s s s s 6 6 s 6 s 2 a s amp s s a es 5 amp s s y s os Cx gt gt gt 2 EELEE EEEIEE EEI EEEE II II S gt PY EES CRY PPP PPP OM Button_1 x I ID r Q 4 AAA A SI NS 0 00 OOO OOO Oo IIVI VVTI VTT NVN NVON Oo KRY OOOO Y 2 2 2 2 2 2 2 2 2 2 2 2 222 2 2 0000D g 2 2 2 2 2 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 START 2 2 2 2 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 00 2 2 2 2 2 2 2 2
43. OK Error Datalog_stop Stop the logging and create the log Input file FILE STRING File name for the log file Output Error Code DINT 0 OK gt 0 error The programmer must calculate the space needed to store the data for the required time giving that each sample stands for 100byte If there s the need to sample five variables every four seconds for three hours the BUFF_LENGTH is 5variables 3 3600seconds 4seconds 13500 That means a free area on the USB disk at least of 100byte Svariables 3 3600seconds 4seconds 1350000 bytes If after three hours the sampling process is not stopped data acquired earlier will be overwritten following a circular buffer logic ME7000_14 03 11 94 TPAC tutorial s r l mect If you run the Dalaog_start function and there s no enough free space on the USB disk to host the requested number of samples the function returns the maximum number of samples allowable by the USB disk After the USB disk has been loaded and free available space evaluated the Datalog_get function is called with the required frequency in the example once every four seconds Input parameters for the Datalog_get functions are the tag label to associate to the logged data and the name of the variable to log When the samplig process is over calling the Datalog_stop function with the chosen log filename will output the log Sampled data will be available both in the file give
44. PLC program wants to use the receipts the first step for a programmer is to define the receipt needed variables and declare them into the retentive memory Once defined the programmer have to link the variables to the receipt This step take place in the HMI environment When a new project is created the global function Rept_add_vars is available to the programmer Inside this procedure two functions deal with adding variables Rept_add_tyReal_par to add a float variable and Rept_add_tyDInt_par to add a signed integer variable The above mentioned functions require four parameters e The list position of variable integer from 0 to N e The name of PLC variable to be associated as defined into the PLC project e The mnemonic associated to the variable that may be either the variable name or the any other name The maximum string length is 18 characters e The measurement unit associated to the variable The maximum string length is 5 characters The function return zero if the operation is correctly handled For instance to insert the PLC variable Varl in the first position of a receipt defined as real variable with mnemonic speed and measure unit m s The result is stored into the Result variable Result Rcpt_add_tyReal_par 0 Var1 speed m s To use receipt values into a PLC program the selected receipt parameters need to be copied into the PLC The programmer must predispose this copy by inserting into the procedure
45. S and libraries 2 Services Software configuration and settings for example the soft keyboard style 3 User Software PLC HMI program and Can network settings Software belonging to group and 2 can be updated merely through USB pen Instead software described in group 3 can be updated through USB pen or LAN by using the development tool LogicLAb PageLab and NetBuilder 19 5 1 System software update MECT supplies to its customers system software update by means of a file named sysupdate sh To upgrade the TPAC user must copy the file sysupdate sh on the USB plug the pen in the usb port and then reboot the device Updates will be automatically effective upon reboot completion Update files can be also loaded on the USB pen through the dashboard Go through Target Settings and then Firmware upgrade a window for sysupdate sh file selection will be displayed by pressing Browse Once selected the update file it can be download on the USB pen by pressing Export current configuration 19 5 2 Services software update Services software includes all user modified software that is not specific to any project To update such files like soft keyboard files pursue the following steps build the update file on the PC for example skbd txt and skbd gif copy the new files on the USB pen and plug the pen on the TPAC and reboot the device Updates become effective once the TPAC restarts 19 5 3 User software update User software groups all applica
46. T BOOL l Set input RESET BOOL l Reset input OUT BOOL l Output Description Output is set to 0 if RESET input is 1 Output is set to 1 if input SET is 1 start START OUT Parameter Data Type Dimension Description OUT BOOL l Output set to 1 Description Output is set to logic level 1 stop STOF OUT Parameter Data Type Dimension Description OUT BOOL l Output set to 0 Description Output is set to logic level O ME7000_14 03 11 65 TPAC tutorial Cell Only TPAC 02 cell version Cell Sensibilita Uscita Fondoscala ingressa Abilita SensMom s r l mect Parameter Data Type Dimension Description Sensibilita REAL 4 Cell Sensibility FondoScala REAL 4 Call range Ingresso REAL 4 Cell input variables from CELL_1 to CELL_4 Abilita BOOL 1 If 1 Enable function block SensNom REAL 4 Nominal sensibility of attached cell Uscita REAL 4 Measured weight Description If Abilita TRUE the measured weight is based on cell input FondoScala and Sensibilita The real sensibility is rated with Nominal sensibility of cell 14 1 Embedded Functions Name Description ABS Absolute ACOS arcosine ADD Arithmetic addition AND Logical bitwise AND ASIN Arsine ATAN Arctangent ATAN2 Arctangent of Y X CEIL Ceiling of a value COS Cosine COSH Hyperbo
47. TUTORIAL for TPAC series McC T 011 9664616 ME7000_14 03 11 TPAC tutorial s r l mect 1 0 INDEX 1 0 INDEX 3 2 0 TPAC AT A GLANCE 7 2 1 FBD EXAMPLE 8 2 2 LD EXAMPLE 8 2 3 ST EXAMPLE 8 2 4 IL EXAMPLE 8 3 0 HOW TO INSTALL THE DEVELOPMENT SUITE 9 4 0 HOW TO CONFIGURE TPAC 9 5 0 HOW TO DEVELOP A SIMPLE PROGRAM 12 5 1 TO CREATE A NEW PROJECT 12 5 2 COMMON STEPS TO CREATE A NEW PROGRAM 12 5 3 PROJECT DESCRIPTION 13 5 4 INSERT THE IOS
48. TextBox Save When the description window is shown to modify the text press on the text box field and the virtual keyboard will be available To exit while saving the modification press Save otherwise press Esc to discard any changes Modify the value of receipt parameters If you have a newly created receipt or you selected an old one four parameters are visible on the screen To view all the other parameters associated with the chosen receipt just press the arrows buttons placed on the left part of parameters fields Each parameter has three attributes Variable ME7000_14 03 11 4 TPAC tutorial s r l mect Name Value and m u measurement unit The Variable name and m u are fixed defined by the programmer and can t be modified by the user the field Value instead may be changed by the user If any changing is required the user may save it through the button Save in the Receipt page Saving the receipt parameters into the PLC variables The receipts are saved on the TPAC flash memory To save receipt s parameters into the PLC program the user must select the needed receipt through the receipts scan buttons and then press the Store button The parameters values of the receipt are inserted into the PLC variables and immediately used by the program Visualization of actual PLC variables The Load button allows the user to see the receipts actual values of PLC variables 11 0 LANGUAGE MANAGEMENT IN HMI ENVIRONMENT 11 1
49. XXX reference address Function does not support start_addr UINT starting broadcast register address to be read register 30001 actually addresses register 30000 count UINT number of register to be read limited to 256 byteorder USINT data byte format modbus rtu data byte are organized with HI byte first but some controllers put LO byte first 0 HI LO order 1 LO HI order Example OUTPUT Returned value UINT 0 if modbus request has been fulfilled 1 if modbus is busy Error if any it s written in MODBUSstatus 1 Values Read data are stored in MODBUSdata array MODBUSdata 0 number of the read items MODBUSdata 1 register value MB_f05 Forces either ON or OFF the INPUT referenced coil status slave_addr UINT salve Function does support address broadcast in this case tha same coil_ addr UINT coil address coil refrence is forced in all the coil state UINT O forces the attached slave coil status to OFF 1 forces the coil status to ON ME7000_14 03 11 87 TPAC tutorial Example MB_ f06 Preset a value into a single holding register 4X reference When broadcast the function presets the same register reference in all attached slaves Example MB_fOF Forces each coil OX reference in a sequence of coils to either ON or OFF When broadcast the function forces the same coil references in all attached slaves ME7000_14 03 11 88 s r l mect OUTPUT Returned
50. _init PROTOTYPE int plc_init char hostname DESCRIPTION Open the communication with the plc PARAMETER Char hostname is either the hostname or an IPv4 address in Standard dot notation IP1 IP2 IP3 IP4 RETURED e Oonetror VALUE e the plc communication descriptor on success Plc_release NAME plc_release PROTOTYPE int plc_release int plcID DESCRIPTION Close the communication with the plc PARAMETER Int plcID PLC communication descriptor returned by plc_init function RETURNED e 0 on success VALUE e Negative on error Ple_var_list NAME plc_var_list PROTOTYPE int plc_var_list int plcID plc_uservar_t list DESCRIPTION Provide the variables available from the PLC memory allocated in a plcuservar_t array ME7000_14 03 11 106 TPAC tutorial s r l mect PARAMETER e Int plcID plc communication descriptor e plcuservar_t pointer to the memory allocated variable array RETURNED e number of the read variables on success VALUE 0 or negative on error Plc_var_read NAME plc_var_read PROTOTYPE int plc_var_read int plcID char label void data DESCRIPTION attempts to read the variable named label into the data buffer provided by the user PARAMETERS e Int plcID plc communication descriptor e char label variable identifier e void data pointer to the buffer used to store the val
51. aS C Configure CANOpen net Parameter list Variable list Mode config Bus Coupler Setup Delete the node lnp eds NCO10 eds slyvdn_dsp402 eds d5046c eds A new window with 10 configuration tabs will appear Those tabs are described in the following sections ME7000_14 03 11 29 TPAC tutorial s r l mect 3 slvdn_dsp40 eds I Node ID 3 virtual Disable WG SLYD M DSP402 8 3 2 1 Administration Objects In this section you can set and visualize the value of the following parameter e The node ID eventually it can be modified here Node Guarding enabled disabled state Node virtualization Node name as shown in the EDS file Prefix for network variables to be exported in the PLC All modifications will be retained only if confirmed by pressing the OK button 8 3 2 2 File Info This section showes data contained in the EDS file related to the node All shown data cannot be changed by the user ME7000_14 03 11 30 TPAC tutorial s r l mect 3 slvdn_dsp40 eds File Name File Yersion E File Revision fo EDS Yersion 4 0 Description e eds standard per SLYD N DSP402 Creation Time Creation Date 01 31 2006 Created By Giulio Sassetti Modification Time MModitication Date 07 30 2007 Modified By Giulio Sassetti 8 3 2 3 Device Info The third section shows the data regarding the characteristics of the selected node as the number of PDO the baud
52. ables Upload Before accessing PLC variables through the monitor feature the variables data set created by the PLC programmer must be exported to the TPAC When a plc project is compiled by LogicLab the tool creates also an exp file that needs to be sent to the TPAC to synchronize the variables data set From LogicLab Tools menu chose upload_var the following window will be displayed ME7000_14 03 11 101 TPAC tutorial s r l mect iie UPLOAD PLC YARS ES IP Address lise fies fo 210 File list PLE TANDEM exp Username oot Password p Connect File Close The UPLOAD PLC Vars window displays the IP Address field that shows the IP already set for the current project connection 1f necessary please modify the address with the IP of the TPAC where the variables data set needs to be exported e the username and password fields show the last credentials provided to access the TPAC please change them according to your current TPAC configuration the field File List shows all the exp files in the current project directory Once the fields IP address username and password are filled with the correct values click on the Connect button and wait until the red box becomes green which means the connection with the TPAC has been successfully established Select the exp file to be uploaded to the TPAC and press the Upload button Upon successful completion a messagge box Upload OK will be displaye
53. according to the MODBUS RTU protocol specification MODBUS availability and serial communication paramenters are set through the TPAC web setup interface accessible by any web browser at http lt TPAC ip address gt The following MODBUS function are made available 01 Read Coil Status 02 Read Input Status 03 Read Holding Registers 04 Read Input Registers 05 Force Single Coil 06 Preset Single Register 15 Force Multiple Coil 16 Preset Multiple Registers 22 Mask Write 4X Register 23 Read Write 4X Registers Description Example Input parameters Returned value Reads the ON OFF status of INPUT discrete outputs OX reference slave_addr UINT slave coils in the slave Function address does not support boradcast start_addr UINT starting coil to be read coil 1 actually addresses coil 0 count UINT number of the coil to be read max count allowed is 256 Example OUTPUT Returned value UINT 0 if modbus request has been fulfilled 1 if modbus is busy Error if any it s written in MODBUSstatus 1 Values Read data are stored in MODBUSdata array MODBUSdata 0 number of the read items MODBUSdata i coil status 1 gt ON 0 gt OFF from to lower to the higher adress requested ME7000_14 03 11 85 TPAC MB_f02 MB_f03 ME7000_14 03 11 tutorial Reads ON OFF status of discrete inputs 1X reference in the slave Function does not support boradcast Example Read the holding registers
54. alog Input Voltage Current Thermocouple J Thermocouple K Thermocouple T PT100 200 PT100 800 Disabled Input 1 se e p p C i Input 2 4 e i J J p E i YI HighGain Input Yoltage Current High Gain Disabled Input 3 to i F Input 4 g a e Input 5 i i r Input 6 O r fe Analog Out Yoltage Current Disabled Output 1 3 r fe Output 2 t i e Output 3 i 5 e Output 4 t E e Once finished press Set values to save the TPAC configuration parameters On the next reboot configuration parameters will be automatically set ME7000_14 03 11 71 TPAC tutorial s r l mect The last section shows software and firmware revisions IDs for the system components IDs Main 20080215 154412 Timer 20080215 144637 RootFS 20080215 154412 Kernel 20080215 154412 CAN 20080215 154412 Local FS 20090215 154412 FPGA oxooo0so0o001 DSP gx00000101 Boot S0070509 162126 Retentive 20080215 154412 Mac 00 11 22 22 11 00 Serial ME7000_14 03 11 72 TPAC tutorial s r l mect 16 0 FUNCTIONS A number of functions are made available to control TPAC 1 Immediate functions 2 Input delay functions 3 Timers 4 Video control functions 5 Receipts functions 6 Date and Time 7 MECT Serial 8 MODBUS RTU 9 CanOpen 10 HMI text file import 11 Data logger 12 Strings functions 13 Date sum and subtraction functions 16 1 IMMEDIATE FUNCTIONS Into the PLC outputs changing or inputs acquisition occur every cycle but sometimes it
55. angITA dummy Video_LoadLanguage kbResStrings kbLangIdxITA kbResEnums kbEnumIdxITA kLangENG dummy Video_LoadLanguage kbResStrings kbLangIdxESP kbResEnums kbEnumIdxESP _ kLangFRA dummy Video_LoadLanguage kbResStrings kbLangIdxFRA kbResEnums kbEnumIdxFRA END CASE ml oe a y gl 1 x2 BL V2 f 250 bStatRedrw TRUE bMapsReset TRUE EALE 3 The lines to be included within the CASE construct are as many as the languages t to be managed This procedure must be called whenever a change occurs in the sysLangID variable 12 0 SOFT KEYBOARD By default on the TPAC front panel there is a numeric keyboard but in case of receipts for which some alphanumeric edit boxes fields exists the numeric keyboard is not enough In this case when the user touch the edit box field a virtual keyboard with alphabetic keys is available The default keyboard layout looks like the following ME7000_14 03 11 44 TPAC tutorial s r l mect The programmer may define by himself a keyboard with different layout and functions To define a new keyboard the programmer must create an image of the keyboard he wants to create in gif standard For example suppose that we need to create a four keys keyboard with these keys Through a graphic editor create the following image The keyboard image must be less than 320 x 240 pixels otherwise it can t be correctly shown on the screen Also th
56. arameters the first specifies which of the available CANOpen network is indented to receive the request the second one states the name given to the object through the Can Builder program ME7000_14 03 11 37 TPAC tutorial s r l mect The function returns an error code 0 on success Detailed explanation about error codes is available in the user manual It worth to point out that for the SDORead function a 0 error code means only that the SDO service requesting a parameter has correctly been forwarded and accepted in the network Actually the addressee node will answer by its time schedule hence receiving the 0 code from a SDORead does not imply that the data is accessible The data is stored in the SVODATA variable only when after SDORead operation the SDOStatus variable is set to a value different from 0 8 7 2 2 SDOWrite in a PLC program Besides the network and the name of the object involved in the request the SDOWrite function requires as additional parameter the value to be written in the addressed CANOpen object The function returns an error code reporting a successful execution or a failure SDO services need an acknowledgement the node receiving a write request answers by sending a confirmation upon data receipt Hence in order to make consecutive writing when the PLC program issues a SDOWrite it must wait until the SDOStatus variable goes to a value different from O before starting the next writing operation NOTE T
57. arametri modificati x eng ge Te wee e STS he beer cba Fm Leith bas sta Fe besa nea ME7000_14 03 11 42 TPAC tutorial s r l mect To add a string to the table press the be button in the tool bar a new row will be added Select the ID cell and insert the identifier name then select the cell Caption and insert the string to be associated 11 3 INSERTING A NEW LANGUAGE From the project window select Pages and then Page properties to view the window Pages properties Select the Tab Language selection the available languages field shows the list of languages defined until now To add a new language press the button Add insert the name of the language then press Insert the new language 1s added to the list ele PageLab cpr tpacit hmi transmatic_fm_hmitransmatic_fm_hmi paj Eile view Project Help Degalo i celna laar aa Bls amp Ae SS be l oe a fa Transmatic fm hmi project Insert page Page properties Display Frame set Pages properties a General System options Language selection Alara p Language selection Available languages Current language Remove Inger Annulla To set the new current language in the PageLab environment highlight a language in the Available languages list and press the button Select When pressing OK the Page properties window will be closed and all changes saved Once selected the language the programmer must modify the strings table by i
58. ative Constant KD_out REAL 32 Calculated Derivative Constant COMMAND REAL 32 Regulating value 100 a 100 TUNED BOOL 8 Indicates when self tuning is complete CUT _BACK REAL 32 Calculated CutBack Constant Description of PID self tuning When START goes to 1 the function block begins the self tuning procedure using the parameters set The COMMNAD output varies according to the chosen tuning algorithm Once the self tuning is completed the output TUNED is raised and outputs KP_out KI_out KD_out and CUT_BACK exhibit the calculated values ME7000_14 03 11 48 TPAC tutorial 32 bit up down counter mM counter up down 32bit PRESET al LE CIREC TION RESET ees SYTHE COUNT s r l mect Parameter Data Type Dimension Description PRESET UDINT 32 Counter value set from 0 to 2432 CLK BOOL 1 Clock input DIRECTION BOOL 1 DIRECTION 1 count up DIRECTION 0 count down RESET BOOL 1 If RESET 0 the count set to zero if DIRECTION 1 count up Counter set to PRESET if DIRECTION O count down SYNC setto 1 SYNC BOOL 1 Terminal count Output It stays to 1 1f in count up it has the PRESET value or in count down if it has 0 COUNT UDINT 32 Counter current value Description 32 bit up down counter The counter changes value if on the CLK input a rising edge is detected If DIRECTION 1 the counter is incremented by 1 1f DIRECTION 0 the counter
59. be saved Example Returns O on success gt 0 on Result Rcpt_export 1 error temp receipts ME7000_14 03 11 82 TPAC tutorial s r l mect 16 6 DATE AND TIME FUNCTIONS Two functions allows to read and write current date Example Returned Value DateTimeRead Example Updates the following variables Result DateTimeRead Q TIME _HH TIME_MM TIME_SS DATE_YY DATE_MM DateTimeWrite Example Updates the RTC time with values hold Result inside variables DateTimeWrite 0 16 7 MECT SERIAL FUNCTIONS The TPAC can interface through serial connection RS232 or RS485 MECT devices therefore four functions are offered that read device status or set their parameters These functions return a code indicating whether the operation was successful or not The error code table is given below 0 ACK success 1 NACK 9 Data format error 11 TX ID error 12 transmitted command code error 13 transmitted integer value error 14 transmitted hexadecimal value error 15 TX error for a real value 16 TX error on data type 21 TX error 31 RX BCC error 32 timeout 33 RX error 41 incorrect received string 100 unknown error ME7000_14 03 11 83 TPAC tutorial s r l mect Description Input Parameter Example Returned Value Function Name MECT_H_sread Read an hexadecimal Input variable from a MECT id INT MECT device address device command STRING Command Code
60. bytes Double word to byte OvvwordTo Byte e IH By TEO BYTE BYTE By TEs Parameter Data Type Dimension Description IN UDINT 32 Input Double word BYTEO BYTE 8 Output byte 0 BYTEI1 BYTE 8 Output byte BYTE2 BYTE 8 Output byte 2 BYTE3 BYTE 8 Output byte 3 Description Splits the input double word in four bytes ME7000_14 03 11 32 TPAC tutorial MUX_8 x_1 multiplexer 8 per 1 MUX B OX 4 OUT WAL SELECT INPUT_1 INFUT_2 INPUT 3 INFUT_ 4 INPUT 5 INPUT 6 INPUT_ INPUT s r l mect Parameter Data Type Dimension Description INPUT_1 BOOL l Input Bits INPUT_8 SELECT USINT 8 Select which input bit is sent to the output OUT_VAL BOOL l Output bit Description OUT_VAL output is the input bit selected by SELECT input ME7000_14 03 11 53 TPAC tutorial COMPARE compare MAX WAL START MINAL HIGH IHPUT WAL LO s r l mect Parameter Data Type Dimension Description MAX_VAL UDINT 32 Max limit value MIN_VAL UDINT 32 Min limit value INPUT_VAL UDINT 32 Input value START BOOL l Output set to if the input value is into the range limits HIGH BOOL l Output set to if input value is greater then max limit value LOW BOOL l Output set to if input value is smaller then min limit value Description ON OFF control If the 32 bit input value is into the range set by MAX_VAL and MIN_VAL
61. ce a valid IP configuration must be provided to the operator panel access through WAN is granted by means of proper virtual private network configuration ME7000_14 03 11 99 TPAC tutorial s r l mect NOTE Hereafter TPAC remote options will be exemplified assuming the default TPAC IP address 192 168 0 210 During normal operations TPAC default IP address must be replaced by the address assigned on your own LAN 17 1 Remote Desktop The TPAC offers remote WEB access to the HMI environment allowing the final users to interact with the HMI by their computer mouse like if they were working directly on the TPAC touchscreen interface 17 2 Remote Desktop Access To access remote desktop features open the browser either Internet Explorer 6 0 Mozilla Firefox 2 0 or higher and type in the address bar the following URL http 192 168 0 210 remote_desktop TPAC010 Remote Desktop Microsoft Internet Explorer BE x File Modifica Visualizza Preferiti Strumenti Fa rdero E gt El EA JO cerca Sie Preferiti L2 gt ts ww Lael rel 3 Indirizzo http 192 168 0 210 remote_desktop TPACO10 Remote Desktop bd Vai Collegamenti gt t Options TPAC Remote Desktop Password ase OK Applet VncViewer started Internet A web page like the one depicted below will appear Insert the remote desktop access password and press OK The fully functional HMI page currently displayed on the TPAC scre
62. colors number must always be a power of 2 ME7000_14 03 11 46 TPAC tutorial s r l mect 14 0 FUNCTION BLOCKS PID PIO CONTROL COMMAND KP_in ERROR klin KD in SETPOINT CYCLE CUT BACK START Parmeter Data Type Data Width Description CONTROL REAL 32 Quantity under measurement KP_in REAL 32 Proportional Constant KI_in REAL 32 Integrative Constant KD in REAL 32 Derivative Constant SETPOINT REAL 32 Setpoint CYCLE UDINT 32 PID Time Cycle in ms CUT_BACK REAL 32 Cutback Constant START BOOL 8 Start Regulating Command COMMAND REAL 32 Regulating value 100 100 ERROR BOOL 8 Reports that some parameters are not set properly Description of PID Regulation When START goes to 1 the function block performs PID adjustment depending on the chosen parameters The output regulator takes values ranging from 100 to 100 When the time cycle or the constant proportional KP_in is set to 0 the function block raises the exit ERROR and no regulation is performed ME7000_14 03 11 47 TPAC tutorial Self tuning PID PID Self Tuning CONTROL KP_out START kl_out SETPOINT kD_out s r l mect Parameter Datatype Data Width Description CONTROL REAL 32 Qunatity under measurement START BOOL 8 Selftuning Start Command SETPOINT REAL 32 Setpoint KP_out REAL 92 Calculated Proportional Constant KI_out REAL 32 Calculated Integr
63. configuration Besides the aforementioned buttons the Settings window offers five sections 1 Net Configuration LAN network set up 2 Splash Image system start up image 3 USB Pen 4 Firmware Upgrade 5 Reset In the first section you can set the TPAC network IP address Choose DHCP if in your LAN network a DHCP server automatically releases IP addresses select STATIC if the DHCP server is not present or you prefer a static IP address assignment In the latter case you must insert manually in the Net Configuration window the IP address you plan to use NOTE If the TPAC IP address is set by a DHCP server the leased address must be known since needed by several configuration procedures ME7000_14 03 11 11 a s r l mect lay a window to select the project destination directory isp lld dow through section PLC allows users to create new projects First is Wi In Win tutorial le program with all these languages A new project needs to be defined before developing a program 5 1 TO CREATE A NEW PROJECT simp The Dashboard ma select the project target hardware and click on the New project button the one circled in red and TPAC may be programmed in five IEC 61131 3 compliant languages This tutorial covers then click Set workspace th 5 0 HOW TO DEVELOP A SIMPLE PROGRAM TPAC lt ae eee ee Petrie E A tit o AAAA E E ee ee ee PEs gee see eee ee eee
64. d Set workspace TPAC tutorial s r l mect a To create a new project in the PLC section click on the new project icon and select the model of hardware for which you are creating the project The button Set Directory allows you to set the path on your hard drive where the project will be created Fill in the Project Name field with the name of the project and then click on Create Project To start the programming environment press Start PLC In the Target box the following buttons are available ali Export current configuration save on a USB device or on the local file system the current network configuration or the reset configuration e E Launch web browser Starts the web browser and connects to the TPAC by the local area network using the configuration specified as Net Configuration In the same box the LAN configuration can be set and eventually 1f the need arises the flag that restores the original settings for the system can be selected To restore factory settings see chapter Reset the system The network configuration is a must for the TPAC since all programming software works through LAN Choose DHCP if in your LAN network a DHCP server automatically releases IP addresses select STATIC if the DHCP server is not present or you prefer a static IP address assignment In the latter case you must insert the IP address you plan to use NOTE If the TPAC IP address is set b
65. d UPLOAD PLO VARS ioj x IP Address fisz E lo 210 File list Username roct Password c O x Upload OF File fe pri tpac 10 plc enenoyalolc_t Upload close ME7000_14 03 11 102 TPAC tutorial s r l mect 17 6 Monitor Access To access the monitor feature type in the browser address bar the following address http 192 168 0 210 monitor In the displayed web The left portion of the displayed page supplies the PLC variables and I O list logically grouped as defined by the PLC programmer TPACO10 PLC MONITOR Microsoft Internet Explorer File Modifica Visualizza Preferi Strumenti nero KA B A pi Cerca Pe Preferiti g gt tes w a 3 Indirizzo http 192 168 0 210 monitor v va Collegamenti TPACO10 PLC MONITOR ACCESS TPAC Remote Deskto To view current I O staus variable s value as single or group expand the the tree and select the elements whose value is desidered Selection are made by checking the box on the left side of the variable s name for single variable selection and by checking the group name for multiple selection Press the button GET VALUES to retrieve the values state for the selected items To update the displayed values mantain or modify your selection and press the GET VALUEs button whenever needed The CLEAR button cancel the displayed values ME7000_14 03 11 103 TPAC tutorial s r l mect
66. d the current time Time read Parameter Data Type Dimension Description HH UINT 8 hours MM UINT 8 minutes SS UINT 8 seconds ME7000_14 03 11 56 TPAC tutorial s r l mect Description Call this function to update the system variables TIME_HH TIME_MM TIME_SS TimeE_write write the current time Ti me write HH 55 ENABLE Parameter Data Type Dimension Description HH UINT 8 hour MM UINT 8 Minutes SS UINT 8 Seconds ENABLE BOOL l Enable bit Description When ENABLE 1 call this function currently available on the inputs to change the value of the system time with the value Date_write write the current date Date write 7T hihi DD ENABLE Parameter Data Type Dimension Description YY UINT 8 Year MM UINT 8 Mounth DD UINT 8 Day ENABLE BOOL l Enable bit Description When ENABLE 1 call this function currently available on the inputs to change the value of the system date with the value ME7000_14 03 11 57 TPAC tutorial s r l mect ONE_ SEC one second pulse ONE SEC SYNC Parameter Data Type Dimension Description SYNC BOOL 1 One second pulse Description Every one second a pulse with a lifetime of a PLC cycle is generated pulse PULSE ENABLE OUT PERIOD Parameter Data Type Dimension Description
67. dd UDINT Number of digit required by the protocol 6 or 8 Output INT Returned error code MECT_H_swrite Write on a MECT device Input hexadecimal variable id UINT MECT device address command Command code value UINT Variable value dd UDINT Number of digit required by the protocol 6 or 8 Output Returned error code MECT_sread Read an ASCH variable Input from a MECT device id INT MECT device address command STRING Command code dd UDINT Number of digit required by the protocol 6 or 8 Output Returned error code MECT _swrite Write on a MECT device Input ASCII variable id UINT MECT device address command Command code value UINT Variable value dd UDINT Number of digit required by the protocol 6 or 8 Output Returned error code MECT_H_sread Example Read an hexadecimal value from serial port error MECT_H_sread 1 S W 6 Retrieved data is stored in PLC_MECT_engq variable MECT_sread Example Read an ASCH value from serial port error MECT_sread 1 RO 6 Retrieved data is stored in PLC_MECT_engq variable MECT_H_swrite Example Write an hexadecimal value on serial port error MECT_H_swrite 1 S W 16 0001 6 MECT_swrite Example Write an ASCII value on serial port error MECT_swrite 1 S W 16 0001 6 ME7000_14 03 11 84 TPAC tutorial s r l mect 16 8 MODBUS Functions TPAC implements the MODBUS master functionality Communication is based on RS232 or RS485 serial support
68. de request for LogicLab PageLab and NetBuilder software and the serial number of the hard disk where the installation has took place If the software installation has been completed on a PC with no Internet connection the aforementioned email must be copied and manually sent to MECT The registration step can be also performed after completing the installation through the register exe program available on the installation CD The program launches the to be filled registration form NOTE register exe execution must take place on the same PC where the development software has been installed 19 3 LogicLab and PageLab registration Once the registration code have been shipped to register Axel software LogicLab and PageLab follow the instruction displayed in the registration window 19 4 NetBuilder registration When the code is shipped complete the registration by inserting the code in the registration form Registrazione del prodotto ID utente SED SSB 981 BOB SFRS466F9EC2601 656 1 Licenza La licenza pu essere nchiesta inviando una mail all indirizzo di posta trama canopen tt indicando come oggetto Registrazione CAN Open WET Builder e speciicando nel testo l ID utente sopra indicata ee Registra Se Annulla ME7000_14 03 11 113 TPAC tutorial s r l mect 19 5 Software update TPAC is based on different software that can be updated disjointedly Software can be grouped as follows 1 System Software the O
69. destination usb device ME7000_14 03 11 111 TPAC tutorial s r l mect Output Error code UINT 0 OK Error Usb_delete Save crypted variable value on the Input usb device LABEL STRING Label for the data to be saved used as heading of the data column VAR REAL Value of the variable to be saved Output Error codes DINT 0 OK error Usb_mkdir Create a directory on the chosen INDEX USINT identifier from 1 to 4 usb device of the target usb device Output Error Code UINT 0 OK 1 error 2 Directory already exists 19 0 APPENDIX 3 19 1 Software Registration The development software LogicLab PageLab and NetBuilder must be registered 19 2 Registration code request for LogicLab PageLabe and NetBuilder The installation program in its final stage prompts the user a registration form that asks some personal details and the approval for the MECT newsletter subscription ME7000_14 03 11 112 TPAC tutorial s r l mect jis Register TPACOI0 ser Data First Name parc Second Name possi company meg Address cso Italia 78 City Roma i Country Italia Phone 41 30 66262871 e mail m rossi rne corn Humber News letters Once the form has been filled by pressing the button Register an email will be sent to MECT This email contains the registration co
70. e folder of the program executable 17 11 VPN ACCESS CONFIGURATION TPAC remote features can be accessed also from multiple networks by activating the already embedded VPN server A Virtual Private Network VPN delivers private network services over a public infrastructure by means of authentication and content encryption to grant communication security At a glance using the VPN service requires TPAC configuration and pc client s installation and configuration To simplify VPN usage when security is not a major concern the TPAC can adopt the provided standard VPN configuration both for the panel and the client the latter is included in the installation cd along with the vpn client executable software If using the standard configuration the TPAC is accessible by vpn clients on the ip address 10 8 0 1 The connecting clients will requires the installation of openvpn 2 0 9 install exe software furthermore one of the provided client configuration must be copied in the sub directory config of the installation path When an ad hoc configuration is needed besides installing the vpn client software on the connetting clients a PKI public key infrastructure needs to be established The PKI grants the communication security through a separate certificate and private key for the server and each client and a master Certificate Authority CA certificate and key which is used to sign each of the server and client certificates 17 12 PKI setting up
71. e PLC accesses the TPAC IO pins through input and output state variables These IO variables are already defined in the TPAC template Thus the first step is to map the project IOs to the PLC variables as listed below e the project output 0 to the output variable DO_1 which is directly connected to the output 1 on the rear terminal block of the TPAC e the project output 1 on the DO_2 variable directly connected to the output 2 of the TPAC e the project enable input to DI_1 e the project analog input to ANALOG _INPUT_1 Next step is to define the threshold variables threshold_1 and threshold_2 In the workspace window select the folder I O variables right click to pop up the tag New I O variable then left click it to show up the I O variable declaration window ME7000_14 03 11 13 TPAC tutorial s r l mect Click over the User area row to view the I O block free indexes window By clicking twice on the showed row the variable will be assigned to that memory location this avoids memory variables overlapping Type the name of the variable threshold_1 in the field Name of the I O variable declaration and click OK the variable will be created and available to the program By the same procedure assign threshold_2 variable idata LogicLab File View Project Debug Communication Tools Help joson tel ec w oa lamer E So Fo Owe a 7 4 eB tr aur LEIF APE ant 4 O O O 9 l leone dB KE ABT Ele
72. e either the content of read file or the error message To display the File_content assign the variable to a TextBox in HMI entering the property Assoc string 16 11 DATALOGGER This section details functions available to store data on a disc mounted on the external USB port thus enabling the recording of variables values or events that occurred during the TPAC operation The data are stored in text file easily readable into a spreadsheet program for further processing Each function returns a code indicating whether the operation was successful or not The fuctions and the error code table 1s given below as Input Parameter ME7000_14 03 11 93 TPAC tutorial s r l mect Datalog_start Load the USB disk on the TPAC __ Input and check if the available space on BUFF_LENGHT UDINT the disk is enough for data logging Number of sample to log CHANNELS UDINT Number of input to log INDEX UINT identifier for the usb device to be used as storage area from to 4 Output Error Code DINT 1 OK 2 Cannot load the USB disk 3 Cannot estimate the free space available on USB disk 4 Cannot create the directory to store logged data gt 0 MAX allowed BUFF_LENGHT Datalog_get Save a variable on the USB disk Input LABEL STRING String containing the tag to be associated the logged data i e the heading of the data column VALUE REAL the name of the variable that is logged Output Error code DINT 0
73. e file must be named skbd gif Besides the keyboard image the programmer needs to create a description file that contains its functionalities On the first row of the description the file contains the keyboard image dimensions in pixels From the second row and on for each key there s a line with the following information Key ASCII code Top left corner x coordinate Top left corner y coordinate Bottom right x coordinate Bottom right y coordinate The description file must be named skbd txt In example case the skbd txt file will be 100 100 42 3 3 48 48 45 5I 3 96 48 47 3 5I 48 96 43 5I 5I 96 96 These files once created needs be saved onto TPAC as described in the section Update software ME7000_14 03 11 45 TPAC tutorial s r l mect 13 0 COLOR DEFINITION HMI TPAC uses a 256 color palette coded in RGB standard with an eight bit code for each color By default in PageLab 16 colors are defined whose codes reported in the following table ID hexadecimal RGB code 0 000000 l 000080 2 008000 3 800000 4 008080 5 800080 6 808000 7 1808080 8 AAAAAA 9 OOOOFF 10 OOFFOO ll FFOOOO 12 OOFFFF 13 FFOOFF 14 FFFFOO 15 FFFFFF When further colors are needed the programmer can add the new color in the file C Programmi MECT TPAC_01 dashboard MECTjar TemplateH MI Targets TPAC def the new colors that you wish to add NOTE The
74. e timer is restarted if a new rising edge is detected on CLK input ME7000_14 03 11 61 TPAC tutorial timer rit ecc TIMER_RIT_ECC CLE S THC TIMER CURR DELAY RESET s r l mect Parameter Data Type Dimension Description CLK UDINT 32 Clock input TIMER BOOL l Choose one of 128 available timers DELAY BOOL l Delay setup RESET UDINT 32 Reset timer SYNC BOOL i Terminal count output CURR UDINT 32 Counter current value Description DELAY INPUT TIMER 1 Starts the selected timer if on the CLK input is detected a rising edge and RESET is set to 1 The timer works for a DELAY time then it sets the SYNC output If the CLK input goes 0 before the time is elapsed the timer is reset The output SYNC is set to 1 when the time is elapsed The timer is restarted if a new rising edge is detected on CLK input ME7000_14 03 11 62 TPAC tutorial timer rit dis TIMER_RIT_DIS CLE SHC TIMER CURR DELAY RESET s r l mect Parameter Data Type Dimension Description CLK UDINT 32 Clock input TIMER BOOL l Choose one of 128 available timers DELAY BOOL l Delay setup RESET UDINT 32 Reset timer SYNC BOOL l Terminal count output CURR UDINT 32 Counter current value Description DELAY INPUT TIMER 2 Starts the selected timer if on the CLK input is detected a falling edge and RESET is set to 1 The ti
75. earrange button restores the correct sorting 8 6 2 2 EDS Import MECT Can Builder software allows the usage of any type of CANopen node with a MECT CanOPEN master However in order to use a node the EDS file related to the node provided by the node manufcturer must be imported in the configuration tool By chosing EDS Import on the menu Tools a dialog box that allows you to insert and manage a new type of node will be opened Conversely cancellation of an EDS file is done by selecting the file you want to delete form the EDS file list Right click with the mouse on the selected file and chose from the pop up menu that will appear the Delete EDS option 8 7 Using the CANopen objects in the PLC 8 7 1 Import Can variables in LogicLab We must import the variables created with Can Builder to make the inserted node available into our PLC project and use them as any other PLC variables To import the CANOpen variables from the LogicLab menu Project select Import object from library In the opened pop up window browse the file system until you reach the project directory created by Can Builder and open the var exp file Rember that variables file have exp extension fecollaudo_plc LogicLab Globals vartables Ep File Edit view Project Debug Communication Yariables Wind New object E Hopr Obyerck cee m s P P a ee Peete eee Import PLE object from library a i ajx Duplicate object Cerca in E collaudo _can
76. eipt O list is reached ric_name address The variable ric name contains the receipt address Loads the current receipt Parameter the receipt Rcpt_load_curr parameters name Example Returns O if success other if result Rcpt_load_curr fail ric_name The parameter ric_name contains the name of the receipt Sets the description of current Parameter description Rcpt_set_curr_descr receipt Example Returns O if success other if result Rcpt_set_curr_descr fail description The parameter description contains the description of the receipt Loads the current receipt Parameter constant Rcpt_get_curr_descr description Example Returns the description string description Rcpt_set_curr_descr 0 The variable description contains the returned description of the receipt Adds an unsigned 8 bit integer Parameter receipt list Rcpt_add_ty_USInt_par parameter to the list index Parameter PLC variable name Parameter Mnemonic associated to the variable Parameter Measure Unit associated to the variable Example Returns O if success other if result Rcpt_add_ty_USInt_par fail O PLC_var1 length mm Adds a signed 8 bit integer Parameter receipt list Rcpt_add_ty_SInt_par parameter to the list index Parameter PLC variable name Parameter Mnemonic associated to the variable Parameter Measure Unit associated to the variable ME7000_14 03 11 79 TPAC tutorial
77. en will be also visible and accessible by the mouse in the browser until when the Disconnect button is pressed ME7000_14 03 11 100 TPAC tutorial s r l mect TPACO10 Remote Desktop Microsoft Internet Explorer fei File Modifica Visualizza Preferiti Strumenti Qrir x AOD Pee Ferree O eGo aw LB rizzo http 192 168 0 210 remote_desktop v Vai Collegamenti TPACO10 Remote Desktop Disconnect Options Clipboard Send Ctril AltDel Refresh No HMI loaded Main 20081114 141610 Retentive 20081114 141610 CPLD 000000000 Root 20081114 141610 Kemel 20081114141610 Local 20081114 141610 Timer 20081111 131501 Boot 20080723 152648 CAN 20081114 141610 MAC 10 11 22 22 11 00 Serial Applet VncViewer started Internet 17 3 Setting Remote Desktop Password Remote Desktop default password is root To set a different password follw the link Set Password available in the http 192 168 0 210 remote_desktop web page In the displayed form insert the current password the new password retype the new password as confirmation and press button SET The freshly changed password is immediatly active and must be used for the next log in The remote desktop password never expires and can be changed whenever necessary 17 4 Monitor PLC variable s values can be accessed through the monitor feature Also programmer s plc variable and I O status are made available 17 5 Vari
78. ertificate header such as the certificate common name or certificate type client or server From START gt RUN type command to open a DOS console window and cd to C Program Files OpenVPN easy rsa Run the following batch gt init config Now edit the vars bat file and set the KEY COUNTRY KEY PROVINCE KEY_CITY KEY_ORG and KEY_EMAIL parameters Don t leave any of these parameters blank For example export KEY _COUNTRY I1T export KEY PROVINCE Italy export KEY CLlTyY Turin export KEY_ORG MyCompany export KEY_EMATL info mycompany com Run the following commands gt vars gt clean all gt build ca The clean all command will cancel any preexisting pki infrastructure while the final command build ca will build the certificate authority CA certificate and key Note that in the above sequence most queried parameters were defaulted to the values set in the vars bat files The only parameter which must be explicitly entered is the Common Name for example MyCompanyCA The certificate authority CA certificate ca crt and key ca key files are stored in C Program Files OpenVPN easy rsa 2 0 keys 17 14 Session key VPN connections require also a session key rebuilt by default each hour by using the parameters from the pem file To get the parameter file cd to C Program Files OpenVPN easy rsa Run the following batch gt build dh The obtained dh1024 pem file is stored in C Program Files O
79. et_ty_DInt_par parameter from receipt list receipt index var6 Rcpt_get_ty_DInt_par 5 Reads Real parameter from Rcpt_get_ty_Real_par receipt list receipt index var 7 Rcpt_get_ty_Real_par 6 Parameter the parameter Rcpt_get_param_comment receipt index Returns the read string Example ric_name Rcpt_get_param_com ment 6 Reads the parameter type Parameter the parameter receipt index ME7000_14 03 11 81 TPAC tutorial s r l mect Reads the parameter type Parameter the parameter Rcpt_get_param_type receipt index Reradsplite measurement unit of Retamnstethe vathable pypameter Rcpt_get_param_tyne paverRept_get_param_type 6 receipt index Expasplist Returns the read string um Rdpt_get_parargnedn 6 hort unsigned 8 bits Recpt_get_curr_descr descriptis Example unsigned int unsigned Returns the receipt descriptl6mb Rcpt_get_curr_desc description 3 signed int signed 16 Rcpt_get_curr_param_count pk Returns the number of result Rt edet2 hits param_co parameters unt Q unsigned double int se Ape index that Rcpt_import identifies the usb device and relative path to the directory where the receipts are stored Returns O on success gt 0 for Result Rcpt_import 1 error temp receipts Bulk export of recipts from Parameter index that TPAC to a usb device identifies the usb device and relative path to the directory where receipts will
80. hat will toggle each time The previous mentioned parameter will be sent ot the master during the configuration ME7000_14 03 11 34 TPAC tutorial s r l mect Once the network parameters have been modified to retain the new values save the CanOPEN project 8 6 Main Menu The main Can Builder menu is made by e File e Tools e Help 8 6 1 File Menu The file menu allowes build the configuration file download the configuration file save project exit 8 6 1 1 Build the configuration file In the project folder this option creates the configuration file to be sent to the master 8 6 1 2 Download the configuration file Configuration file are downloaded to the TPAC by the LAN network connection Chose download configuration file in the file menu The following window will appear x IP address ink shake Link to GP lise fies p pir eS Mok connected Project root Set the IP address for the TPAC master on your network and press the Link to OP button this will enable the transfer of your configuration file 8 6 1 3 Project Save Select Save the Project to save your project file in order to re use your project later 8 6 2 Tools Menu The Tools Menu containns e Rearrange e Import EDS ME7000_14 03 11 35 TPAC tutorial s r l mect 8 6 2 1 Rearrange When nodes are repeatedly inserted and deleted from a network it can happen that nodes are no more sorted with with increasing ID The r
81. i a Bisosososoggogonoi i sant Panan Hane shat i RaR RRR ERERO ER RPE RRP ERES anne AAAHHH AAAA ARR ARA a Hi a ARH ia Hunn array ae a T AAAA PARARE AR PAPANE NAERA TAIE PR Rite oan pea oe AOR RAR AR RAR ARE n i Eni o PAA H pas se i ue gueni SRST iiiter SSSR ARRERA ARE ERR RERE i pceatece scat esses RRR E E RR RR ts deseascatiaS tit SEER Se works H aa n A iN mi PHH eee EEEE ae ee innn a RR si 3 fee su Bey aU ane E E e E EAER Es seas it Be ie seit _ ananin sey ieee dee ee i i 5 H i H H 4 i i i ae oe SAREE ARE na no sie RARER Rate oe See Se EERO n Rien n ect creation OJ Il activate the PLC programming t to complete the pr ojec t the name of the project to be created by ing 1t w1 inser 9 12 folder press Open start with programm tion ma selected the desti environment To create a new program select Programs in the Workspace window left side of the main window then right click it and a New program tag is displayed Left click the tag and a New program window will show up as in the following figure 5 2 COMMON STEPS TO CREATE A NEW PROGRAM filling the Project name field Pre
82. in a slave and put data into an array 4X XXX reference Function does not support broadcast 86 s r l mect INPUT slave_addr UINT slave address start_addr UINT starting input to be read input 1 actually adresses input 0 count UINT number of the input sto be read max count allowed is 256 OUTPUT Returned value UINT 0 if modbus request has been fulfilled 1 if modbus is busy Error if any it s written in MODBUSstatus 1 Values Read data are stored in MODBUSdata array MODBUSdata 0 number of the read items MODBUSdata i input status 1 gt ON 0 gt OFF from to lower to the higher adress requested INPUT slave_addr UINT slave address start_addr UINT starting register address to be read register 40001 actually addresses register 40000 count UINT number of register to be read limited to 256 byteorder USINT data byte format modbus rtu data byte are organized with HI byte first but some controllers put LO byte first 0 HI LO order 1 LO HI order TPAC tutorial s r l mect Example OUTPUT Returned value UINT 0 if modbus request has been fulfilled 1 if modbus is busy Error if any it s written in MODBUSstatus 1 Values Read data are stored in MODBUSdata array MODBUSdata 0 number of the read items MODBUSdata 1i register value MB_f04 Read the holding registers ina INPUT slave and put data into an slave_addr UINT slave array 4X
83. isplay one or more text files stored on the TPAC flash through the HM ItextLoad function 7 1 1 inserting a text file in an HMI project A text file can be uploaded into a HMI project by clicking the button in the dashboard HMI section and picking the selected file To cancel a text file click on the button and chose the file to be deleted ME7000_14 03 11 22 TPAC tutorial s r l mect Project name hmi provati Project workspace enis and SettingsipclDocumenti Sef WOrKSpPace Create project Launen Haat TXT files Ea _ Cercain CI hmi_prova10 i ea ca Do A prova txt 3 proval tet Restransmatic_fm_hmi_ITA txt Home file Tipo file When all needed files have been selected by clicking the button l the user is prompted to chose the logical drive that maps the USB pen the text file archive will be saved on that drive after pressing the OK button ME7000_14 03 11 23 TPAC tutorial s r l mect H Ble Project name hrm provai EXPORT TXT Project workspace ents Launch HMI Tx Target Dial Project name lirica OK Annulla mmh d a I lined By plugging the USB pen into the TPAC and rebooting the device the text files will be transferred on the TPAC flash drive and made available to the programmer 7 1 2 Using text file in the HMI environment Text files are manipulated through the HMItestLoad file_name function This function searches for
84. itten byteorder USINT data byte format modbus rtu data byte are organized with HI byte first but some controllers put LO byte first 0 HI LO order 1 LO HI order Value to be written into registers are read from MODBUS dat array MODBUSdata 0 gt reg_addr register value MODBUSdata 1 gt reg_addr register value MODBUSdata N gt reg_addr N register value TPAC tutorial s r l mect Example OUTPUT Returned value UINT 0 if modbus request has been fulfilled 1 if modbus is busy Error if any it s written in MODBUSstatus 1 Read values are stored in the MODBUSdata array MODBUSdata 0 number of the read elements MODBUSdata 1 start_addr register value MODBUSdata 2 start_addr 1 register value MODBUSdata N start_addr N 1 register value MODBUS function example SLAVE _ADD 1 START _ADD 40689 COUNT 12 ORDER 0 IF MODBUSstatus 0 O THEN MB READ1 MB 03 SLAVE ADDRESS START ADD COUNT ORDER END_IF IF MB READI O THEN LINE FREQUENCY hZ MODBUSGata lS 1 0 POWER FACTOR PE TOt TO USINT MODBUSdatats I7 T0 END IF 16 9 CanOpen FUNCTIONS Two functions are given to read and write SDO on CanOpen network A code is returned indicating whether the operation was successful or not The error code table is given below 0 OK l Variable name invalid 2 Not existent variable 3 CAN channel number invalid 126 Node is not in running
85. l Program WINGO 8 a hae Ma Paa acc O a BE SIN PSII PM ESS C Output o eee eee CHO_ NO01DIS CHO Noo1Goo0D CHO NOOIRST CHO NOOIRUN CHO Noo2DIS CHO NOOZERR CHO No02G00D CHO NOO2RST CHO_ NO02RUN CHO Noo4DIS CHO NOO4ERR CHO Noo4Go0D CHO NOO4RST x Perform the same operations for the internal variables threshold_1 and threshold_2 In the program window you ll see the pads corresponding to the selected inputs and outputs After positioning the IOs and the variables in the program window they have to be connected to ANALOG INPUT 1 gt threshold_4 mu oa wiles e i eaa pass qa a due WOME Gach Mec Ghai kee Liens a MWe a lt coe aa e ald Asean Gur oea cade uae a aes A ao CSE Gr Fear Oo Spare ae aif Sst ont Suge oee fat Mom tet Ghee aye E thas jet Gabe vap amp poe ie ott Tes r yi he ff hast in 3 Dit iy Gace Ga See oe a CSR Gree a ie A A eee ei ER RS aE ma a aa See an eee as 4 bo poi PAI her Get ose Eee pat y tai kgo Wonga maD yer tas Eee i bos toes FAT oie oat GS Gui PAD ote ek threshold 2 the functional blocks that implement the program behavior In the library window select the Operator and standard blocks tab If the library window is not active activate it by typing Ctrl L or select View gt Library in the main window menu You can select the needed functional blocks drag and drop them into the program window to obtain a layout similar to the one ill
86. l then from the pages list select which page to use as the first then press OK z5 PageLab File View Project fy Cwem loc teael as Slnme a sles ees EA a ee Bei gd ae ee sl Page properties Be A Display frame set Pages properties General System options Language selection Alarms Ay Initial page 5 elect the initial ti OpETALUYE page Open the project C sPRI TPACIO collaudo collaudo paj Preprocessing file TPACO1O def completed Preprocessing file TPACUIOU tgt completed Preprocessing file collaudo ple completed Preprocessing file collaudo pag completed Preprocessing file sciibx plf completed Preprocessing file Asciidgxl6 plt completed Preprocessing file Asciilfx3 plf completed Preprocessing file collaudo plc ezp completed When all the pages are defined the project can be compiled From the menu Project select Generate code which compiles the project Before being able to download the project into the TPAC a connection has to be established with it in the same way as for the LogicLab environment Once the connection is established code download occurs by selecting Download project from the Project menu 7 1 HOW TO DISPLAY A TEXT FILE A HMI project may require static text like help instructions to be viewed on the screen Such kind of information cannot be stored in the retentive variables since they have a different role The programmer can d
87. le of screen switch off Returns 0 if success other if result LCDSS_ off 0 fail Enables the screensaver Parameters constant LCDSS_enable Example of screensaver Returns 0 if success other if enabling result LCDSS_ enable 0 Disables the screensaver Parameters constant LCDSS_disable ME7000_14 03 11 76 TPAC tutorial s r l mect 16 5 RECEIPTS FUNCTIONS The receipts package has already been created by MECT The programmer may use the available functions or if needed can create by himself receipts interface ets the parameter of current Parameter receipt name Rept_set_curr receipt Parameter description Example result Rcpt_set_curr Returns 0 if success other if ric_name description The ric_name parmeter contains the receipt namewhile the description contains the description of receipt Saves on flash memory the Parameter constant Example Returns O if success other if result Rcpt_save_curr 0 fail Rcpt_clean_all Example result Rcpt_clean_all 0 fail ME7000_14 03 11 T1 TPAC tutorial s r l mect Deletes the current receipt data Parameter constant Returns O if success other if fail Rcpt_clean_list Example result Rcpt_clean_list 0 Deletes the current receipt data Parameter constant Example Returns O if success other if result Rcpt_clean_curr Q fail Deletes from flash memory aj Parameter the receipt Rcpt_remove name
88. lic cosine DIV Arithmetic division EQ Equal EXP Base e exponential FLOOR Floor of a value GE Greater or equal GT Greater than JMP Jump LE Less or equal LIMIT Limit ME7000_14 03 11 66 TPAC tutorial Name Description LN Natural logarithm LOG Base 10 logarithm LT Less than MAX Maximum value selection MIN Minimum value selection MOD Modulo operator MOVE Move MUL Arithmetic multiply MUX Multiplexer NE Not equal NOT Not OR Logical or POW Power R Boolean reset RET Return ROL Binary rotate left ROR Binary rotate right S Set SEL Selector SHL Binary shift left SHR Binary shift right SINH Hyperbolic sines SQRT Square root SUB Arithmetic subtraction TAN Tangent TANH Hyperbolic tangent TO_BOOL Conversion to BOOL TO_DINT Conversion to DINT TO_INT Conversion to Int TO_REAL Conversion to REAL TO_SINT Conversion to SINT TO_UDINT Conversion to UDINT TO_UINT Conversion to UINT TO_USINT Conversion to USINT XOR Logic XOR ME7000_14 03 11 67 s r l mect TPAC tutorial s r l mect 15 0 HOW TO CONFIGURE TPAC THROUGH THE WEB INTERFACE 15 1 Preface The TPAC has a set of parameters and devices that must be configured before their usage Any Internet browser executes these configurations through a web interface 15 2 Open TPAC web interface The following example is based
89. mer works for a DELAY time then it sets the SYNC output If the CLK input goes 1 before the time is elapsed the timer is reset The output SYNC is set to 1 when the time is elapsed The timer is restarted if a new falling edge is detected on CLK input ME7000_14 03 11 63 TPAC tutorial s r l mect timer_coil TIMER _BOBIMA CLE STH TIMER CURR DELAY RESET Parameter Data Type Dimension Description CLK UDINT 32 Clock input TIMER BOOL l Choose one of 128 available timers DELAY BOOL l Delay setup RESET UDINT 32 Reset timer SYNC BOOL l Terminal count output CURR UDINT 32 Counter current value Description RETRIGGERABLE COIL Starts the selected timer 1f on the CLK input is detected a rising edge and RESET is set to 1 The timer works for a DELAY even if the CLK input goes 0 before the time is ended The output SYNC is set to 1 until the time is elapsed The timer is restarted if a new rising edge is detected on CLK input r_trig R_TRIG CLE F Parameter Data Type Dimension Description CLK BOOL l Clock input Q BOOL 1 Output Description Q output is set when a rising edge is detected on the CLK input Q is 0 when input CLK is 0 ME7000_14 03 11 64 TPAC tutorial Set Reset Set Reset SET OUT RESET s r l mect Parameter Data Type Dimension Description SE
90. n as input parameter for Datalog_stop and also in the tempdata directory where there s stored a file whose name is the chosen tag for each sampled variable Below an example of a program in ST that acquires and saves data from two variables Goto eee ee A E variables KART RS Pe ANETT VAGI AIN CHI 4y0 760007160 VAL2 lt AIN CH2 4z 07T E00 07 16 0 E ER A E E EN mounting disk RA ian oar E E Pe IF state O THEN num_ch 2 channel to sample acq_rate 4 sampling frequency each 4 seconds acg dur s 2 acgurLrsition dural rlom 2 Nours required_byte 180000 buftfer_lenght 1800 buffer_lenght acq_dur 3600 acg rate ris Datalog_start buffer lenght num_ch there should be at least required_byte of free space on the disk to honor buffer_lenght state 1 END TE CRRA AT TS setup samples number PERRE ERRER AERE IF state 1 THEN IF res lt 0 THEN loading usb error state 3 ELSIF res gt 0 THEN free space is not enough max_camp res state 2 ELSE state 2 max_camp buffer_lenght END_IF TIMERS 1 4000 samples 0 END_IF CERE ieee RIN ae data recording ERR etn eo ey IF state 2 THEN ME7000_14 03 11 95 TPAC tutorial s r l mect IF TIMERS 1 0 AND samples lt max_camp THEN TIMERS FLAG 1 1 samples samplestl dummy Datalog_get Temp_chl1 VAL1 dummy Datalog_get Temp_ch2 VAL2 ELSIF samples gt max_camp THEN sta
91. n result FALSE OK TRUE FAIL Str_inttostr Convert an integer into a string Input X UDINT integer to convert DEST STRING resulting string WIDTH USINT number of digit to be copied into the string ZERI BOOL set zero filling for missing digits Res Str_inttostr 34 string1 3 TR Output UE BOOL function result Result string will be 034 FALSE OK TRUE FAIL Example Str_concat Define the two strings String and String2 to be appended and an integer that stores function result SEringli abo SETInNG22 derg Rest Strconcatl Stringl Stringz When Res 0 Sgring 1 will be abcdefg Example Str_inttostrQ Define a string and an integer value that stores function result Convert to string the number 34 with the result expressed in three digits zeros make the string completion Res oUr InttOStr s4 scuring 3 TRUE When Res 0 String will be 034 16 13 DATE FUNCTIONS Two functions handle date manipulation by adding an offset or calculating the difference between given dates Function Name Description Input Parameter Example Returned Value ME7000_14 03 11 98 TPAC tutorial s r l mect Date_add Add an offset expressed in days TYPE STRING offset type D Days weeks months or year to a give W Weeks M Months Y Year to be date and return a string congaing added to date represented by the string the calculated date START START STRING string represe
92. nce the last download on the TPAC or a new project was loaded DIFF CODE will be displayed in the right end of the status bar of the main window In this case to update the program on TPAC select Download code in the Communication menu In the Output window is logged the result of the download operation 6 0 HOW TO DOWNLOAD A PROGRAM INTO TPAC Before downloading a program into TPAC a communication link between the target TPAC and the personal computer with the development environment has to be established It s necessary to connect the target to a personal computer using the TCP IP network 6 1 HOWTO DOWNLOAD PLC PROGRAM Prerequisite e the TPAC IP address must be known e Setup the communication parameters of the development environment using the TPAC IP address ME7000_14 03 11 17 TPAC tutorial s r l mect Aimectplc LogicLab Medium File Edit View Project Debug Communication variables Window Tools Help 2 S AF Download code ES B E E Connect asu E Settings Upload Ii ME ie DWORD Auto No ic DWORCE Auto Mo EHEs Mectple project Programs 7 T 5 ip Lae be alia i H Pedii starh stopanski vale E Function blocks SEET e3 DWORD Auto Mo Ea Functor E a_ref_out UINT Auta Ma S E Global variables jana_ref_in WINT Auto Mo o Variables 49 lana orr L IT antn wE iO variables DD Ge Peers Choose Settings from the Communication menu In the Device Link Manager C
93. nna aen SH ERERRRRES AE EREEREER AE ERRRRRR annan E PR RER A ERERRRRRRS POSSE REE E EEE PE ERRER is RAI Fg aE AER SERRE BE r ERRE E REE E Sounn R EREHE a HEEE fo i E i E E E E E E a ERBEN ft ose SHEE z es eee a ne ee sees HE E EEEE ARE EEEE A Eteen ee SAUER RERE k es i EHER E EERE i z Se eee n a a Z z i ees Se steer SERRE tet SERRE E tet RERE SHEERS Stet SERBS Ht SERRE SERBS tet SERRE tet SERREE Stet es SARREREN ARRENE ARRENE E SEES SERRA Stet SEES SERERE Stet SERS tet SERS SHER SHEERS tt Sees See Seat See ANNANN SHR tet Seen SHES SHES Basen Base Bessie Bessie Besse Bessey Besse Bessie Bessey Bessie Bereseeenseeees ERRER Bees sesies Bere seeees RR ERRES EENNRRREN Bessie Bisse Bessie RSE E RNN AE RNN AE RNN RRRS E S NNSS REESE St ea NNSS REESE St ee ee AE NN foe Bosc Boscia Bee RARER Be S NNSS E NNSS R REEERE E RRR EES EE EREEREER EEEE SSeS RRS ERE R BREE REESE S EE REER EREE EE R RRR EE ERRARE EE ERREEN ESSERE EES ES ERROR REESE S ESSERE RES EERE ERE S ESRB REESE S ARERR fe fe TAREE RES HEISE OR ERE ESSE ERE ESSERE SS ESS ge RISER ER SERS ESS E BS poset e E EEES A AoE E z a et ERE ie jet sere n sahana i a SS eneee S gece poe a
94. nserting the string translations Open the strings table as described in the previous section and modify the values in the Caption column NOTE The just described language selection does not modify the language shown on the TPAC it is only used by programmer to fill the strings tables in PageLab environment 11 4 MODIFY TPAC LANGUAGE Modifying the variable sysLangID changes the language displayed by TPAC screen Values assignable to this variable are defined by constants For example if there are 3 languages defined in ME7000_14 03 11 43 TPAC tutorial s r l mect Pagelab ITA and ENG FRA the compiler will create three constants kKLangITA kLangENG kLangFRA To change the displayed languages assign one of the constant variables to sysLangID and then restart the TPAC To change the language without having to reboot the system you need to modify the global function chg_lang within the HMI program For each language created inside PageLab two other constants are generated These constants are made by a suffix that represents the name of the created language eg ITA ENG FRA etc and a prefix kbLangIdx for elements defined in the strings table and kbEnumlIdx for enumerative strings With respect to the above mentioned example the following constants will be creted kLangIdxITA kLangIdxFRA kLangldxENG and kbEnumIdxITA kbEnumIdxENG and kbEnumIdxFRA The function chg_lang will be amended as follows CASE sysLangID OF kL
95. nting the starting date to which offset will be added to Date format is DD MM YYYY OFFS UDINT offset value Output STRING string that contains the resulting date Calculate the difference between START STRING first date two dates and returns a value END STRING second date expressed in days weeks months TYPE STRING result type time unit or years Output DINT Contains the difference between first and second date expressed in the chosen result type time unit Example Date_add Define a string to contain the function result Add 2 weeks to the date expressed as DD MM YYYY Stering Data acer Wa OG 03 2 006 A String will be 20 03 2008 In case of a wrong intial date format 1 e the initial date 1s expressed as MM DD YYYY instead of DD MM YYYY the result string String will contain Error Example Date_diffQ Define a DINT variable to contain the function result Calculate how many days there are between the 25 03 2008 and 18 03 2008 Res 2 Dave 1 fr 25H 03 Z00e LE 0S 2006 DD Res will be 8 17 0 TPAC Remote Options Starting from software release 3 0 TPAC10 includes the following new features e Remote Desktop remote access to HMI interface e Monitor PLC variables state monitoring e Remote PLC remote PLC creation or remote intercation with on board PLC to mange system s I O The above mentioned features are accessible through LAN interface hen
96. o properly deal with SDORead and SDOWrite functions each object in the network needs to be identified univocally Working with two identical nodes belonging to the same network and making access to the same object i e object 2000 51 implies assigning to each object a unique name 9 0 RESETTING THE SYSTEM If you can no more obtain the control of TPAC for programming or configuring it there is a back door that make possible reset the TPAC From the Target section of the dashboard open a project or create a new one Press the button Settings the window will show the configuration parameters Check the Reset label Insert into a USB port of the PC the pen drive then press the button export current configuration The pen drive will be loaded with a reset configuration Netmask 7 o Getway i i a o DNS Afterwards plug the pen drive into the USB port of the TPAC then power it on The code files of PLC HMI and CANOpen will be erased from TPAC flash memory The TPAC becomes free from code files that may be the cause of problems ME7000_14 03 11 38 TPAC tutorial s r l mect 10 0 RECEIPTS 10 1 INTRODUCTION TPAC has the ability to manage the receipts into a PLC program When a HMI project is created the receipts software package is automatically loaded In this manual we ll describe both what the programmer and what the final user have to do to use the receipts in a PLC project 10 1 1 Programmer side When a
97. onfiguration window select the GDB protocol If it s not active press the Activate button Next click on Properties and the GDB config window shows up Select as Port TCP IP set the IP address to the address of the TPAC Set 5000 as port number and leave all other parameters unchanged Click OK on both pop up windows x Current selected protocol GDE PF Candpen xl 3 an race Comunication 4 GDE Active Y hladbus Fort FF Baudrate sean Data frame Nei Properties Activate F address fa216814 OOO Description 5 Fort ja GOB Protocol a Pick food Ei Enable remote communication ok are Sener name j Cancel Now we re ready to connect to the TPAC In the Communication menu of the main window select Connect to establish a connection between the target and the PC When a link is up on the right of the status bar of LogicLab you ll see e DIFF CODE meaning that a connection is established but the code on the TPAC is different from the one in the development environment meaning that a connection is established and the code on the TPAC is the same as the one in the development environment e ERROR meaning that there is a problem with the connection between the TPAC and the development environment 7 0 HOW TO CREATE AN HMI INTERFACE When a PLC program has been created we may need to develop also an HMI interface From the dashboard create a New project as explained for the PLC To launch
98. penVPN easy rsa 2 0 keys ME7000_14 03 11 109 TPAC tutorial s r l mect 17 15 TPAC certificate and private key Now we will generate a certificate and private key for the server From the prompt console in the C Program Files OpenVPN easy rsa directory run the following batch gt build key server tpac010 As in the previous step most parameters can be defaulted When the Common Name is queried enter tpacO10 Two other queries require positive responses Sign the certificate y n and 1 out of 1 certificate requests certified commit y n 17 16 Client certifcate and key Generating client certificates 1s very similar to the previous step From the prompt console in the C Program Files OpenVPN easy rsa directory run the following batch gt build key my_pc As in the previous step most parameters can be defaulted When the Common Name is queried enter my_pc Again answer yes to the sign certificate query You will obtain the ny_pc crt and my_pc key files respectively certificate and key for the client Remember this step can be repeated to genereate as many as client certificate and key you need Now we need only to move all these configuration file in the proper directories to complete the VPN set up 17 17 TPAC VPN Configuration From the SAMPLE_VPN directory on the installation cd copy the sample_server conf file Open the file with a text editor and modify it according to your needs You are not allowed to
99. rate available etc aker Hannifin civ SAC 125 kbs 290 kb Number Of TXPDO ME7000_14 03 11 31 TPAC tutorial s r l mect 8 3 2 4 Object Dictionary In this section that contains the list of the node dictionary object the user can set node parameters and variables As can be seen from the figure the window is divided into several sections the left side contains the list of objects available in the node that need configuration By selecting an object its properties are shown in the top part of the window its For each object with write access w you can insert a parameter that will be sent by master in the configuration step in order to configure the node besides you can associate to the object a variable to make the object accessible through the PLC For some objects such as those that enable PDO you must enter more than one parameter which will be sent in sequence to the node by the master during the configuration We will see later how to change the order used to send configuration parameters Read only ro object type can be bound only to a single a variable whose value can be read through the PLC To clear any parameters or variables select with the mouse the value to delete right click on it and chose delete in the pop up menu that will appear Remind that items to change in this section are closely linked to the node and the application you wants to achieve In order to use the SDO service by PLC the program Can
100. re below PageLab File view Project Help EHE Pril project Insert page 1 Insert the name of the new page paged To display the page layout canvas click twice on the Page name in the Project window A blank page will show up and you can start populating it with the available elements To insert an object into the page select the element to be inserted from the Page menu The available objects are ME7000_14 03 11 19 TPAC tutorial s r l mect Static Image Animation Edit Button Custom control For our project we will define two pages a welcome page and an operative page The welcome page has three elements two static objects and one button and looks like the following picture To insert the button select the New Button entry in the Page menu then place the button on the page in the desired position The right part of the main window will list all the properties of the button element These properties can be edited to suit your needs 4 4 OOOO OOO OOOO o gt 222022202228 Se eS r sotsa S2 EEES EEEE EEES EEEE E EIS LEEKI EEEIEE EE E OE EEEE EEA EREEREER ERIE EEEIEI rotatetetetetetetetetetet eee OOOO OOS RPP I I SOCCEROOS es ears SSS ETIO OOOO OOOO OOOO EEEE EIEII EKKREIS ERREKERI SOCCEEOCEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE E EEEE EEEIEE EEEIEE CR OR COO BSS SC SC CC I I I I OC I I I AC I I I I I I CS SECCEEEEEEECEEECSEEOSEECSEEESEE
101. riable Parameter Measure Unit associated to the variable Returns O if success other if fail receipt list variable TPAC tutorial s r l mect Adds a Real parameter to the list Parameter receipt list Rcpt_add_ty_Real_par index Parameter PLC _ variable name Parameter Mnemonic associated to the variable Parameter Measure Unit associated to the variable Example Returns O if success other if result Rcpt_add_ty_Real_par fail O PLC_var speed m s Reads an unsigned 8 bit Parameter the parameter Rcpt_get_ty_USInt_par parameter from receipt list receipt index Example Returns the read value PLC_var1 Rcpt_get_ty_USInt_ par 0 Reads a signed 8 bit parameter Parameter the parameter Rcpt_get_ty_SInt_par from receipt list receipt index Example Returns the read value PLC_var2 Rcpt_get_ty_SInt_pa r 1 Reads an unsigned 16 bit Parameter the parameter Rcpt_get_ty_UInt_par parameter from receipt list receipt index Example Returns the read value PLC_var3 Rcpt_get_ty_UInt_p ar 2 Reads a signed 16 bit parameter Parameter the parameter Rcpt_get_ty_Int_par from receipt list receipt index Example Returns the read value PLC_var4 Rcpt_get_ty_Int_par 3 Reads an unsigned 32 bit Parameter the parameter Rcpt_get_ty_UDInt_par parameter from receipt list receipt index Example PLC Returns the read value _var5 Rcpt_get_ty_UDInt_par 4 Rcpt_g
102. rogrammed for the panel by writing in a specific memory area PLCLIB is made available as windows dll in both OME and COFF format 17 8 PLCLIB Description PLCLIB publishes through the plclib h header the following data type and functions Data type plcuservar_t The plcuservar_t is used to allocate in memory the array containg all the PLC variables defined in the PLC program to which is directed the communication Since the array is memory allocated it needs to be freed by the programmer when no more needed The array consist of structured items defined as Typedef struct plcuservar char name 32 char type 16 plcuservar_t ME7000_14 03 11 104 TPAC tutorial s r l mect The name of the variable is used to read write it The detailed description of the meaning and the usage of each variables comes with the PLC documentation The type of the variable can be used by the user to rapresent it The following variable type are available TYPE BOOL SINT USINT INT UINT DINT UDINT BYTE WORD DWORD STRING N ME7000_14 03 11 DIMENSION BYTE ZAPPNrRrPBRBNNR RB RANGE From 0 to 1 From 128 to 127 From 0 to 255 From 32768 to 32767 From 0 to 65535 From 2431 to 2431 1 From 0 to 2432 1 From 0 to 255 From 0 to 65535 From 0 to 2432 1 O Terminated string 105 TPAC tutorial 17 9 Functions s r l mect Plc_init NAME plc
103. ror if any it s written in MODBUSstatus 1 INPUT slave_addr UINT slave address start_addr UINT starting register address count UINT number of registers to be set Values to be set for coils are read from the MODBUS data array MODBUSdata 0 gt start_addr register value MODBUSdata 1 gt start_addr 1 register value MODBUSdata N gt start_addr N register value OUTPUT Returned value UINT 0 if modbus request has been fulfilled 1 if modbus is busy Error if any it s written in MODBUSstatus 1 INPUT slave_addr UINT slave address start_addr UINT register address Mask values are read from MODBUSdata MODBUSdata 0 gt AND mask MODBUSdata 1 gt OR mask TPAC MB _f17 ME7000_14 03 11 tutorial Example Performs a combination of one read and one write operation in a single modbus transaction The function can write new contents to a group 0a 4X registers and then return the contents of another group of 4X registers Broadcast is not supported 90 s r l mect OUTPUT Returned value UINT 0 if modbus request has been fulfilled 1 if modbus is busy Error if any it s written in MODBUSstatus 1 INPUT slave_addr UINT slave address start_addr UINT starting address for the registers to be read count UINT number of location to be read reg_addr UINT starting address for the registers to be written reg_count UINT number of the registers to be wr
104. software Axel PageLab Human Machine Interface software Axel LLComp communication software to download the PLC program into TPAC Trama Netbuilder CanOpen netbuilder Microsoft Windows net framework 2 0 needed if not already available on the PC SUN J2SE runtime To install the entire suite from CD execute TPAC exe that leds to a guided installation procedure Once the installation is completed an icon named TPAC is placed on the desktop The installed software needs to be registered please refer to Appendix 3 for information about the registration procedure 4 0 HOW TO CONFIGURE TPAC Before any project development executing the TPAC dashboard configures the TPAC 2 MECT alles File PLC HMI Ba la Project name Undefined Project name Undefined Project workspace Undefined at oe ae oe ed f Ph rerai Set WOrKSpace Create project g ia Ted E fu Lau zh PEE CANopen B n Ga Project name Wndetined Project workspace Undefined ae a ey eee ange m oe SebWwOrkspace Create project i i I sah oh oe a Launch CANopen ME7000_14 03 11 Project workspace Undefined E a A Ti Crna irain Set workspace Create project Launch HM tatfiles Target Bla Project name Lindefined Project workspace Undefine
105. ss the button Create pr step Press the launch PLC button to ME7000_14 03 11 Once TPAC tutorial s r l mect iproject_i LogicLab File View Project Debug Communication Tools Help 8eGR 186 464 42 aans x et hen proram Workspace window HATI feel oo Functions 2D Variables I _ a E E 1 0 variables Bd Constants Language Retain variables anit wro Cn Pet Pee He Project parameters AEE Tasks Cancel ok This window allows the programming language selection The project exemplify first the graphical language then we ll go through the textual ones Hence choose the FBD Function Block Diagram as the programming language insert the program name and then click OK You are ready to input the project 5 3 PROJECT DESCRIPTION The implemented project consists in an on off pressure regulator The pressure in a room has to stay between two thresholds If the pressure is over the high threshold threshold_1 it is reduced by setting output 0 to logic 1 leading to a discharge valve opening If the pressure is below the low threshold threshold_2 it is incremented by setting output 1 to logic 1 A digital input enables to operation the pressure regulator 5 4 INSERT THE IOS The first step is the PLC IOs configuration From the project description we require an analog input pressure measurement two digital outputs valve opening and one digital input the enable Th
106. state 127 Operation not yet available ME7000_14 03 11 91 TPAC tutorial s r l mect Example Returned Value SDORead Read a variable from a Input CanOpen node through ch UINT CanOpen Network 0 or 1 to SDO poll var_name STRING String containing the variable name as defined in the CanOpen Netbuilder setup of the network Output Error Code SDOWrite Write on a variable of a Input CanOpen node through ch UINT CanOpen Network 0 or 1 to SDO poll var_name STRING String containing the variable name as defined in the CanOpen Netbuilder setup of the network data UDINT Value to be written Output Error Code SDORead Example Read the variable pr80 from a node in the CanOpen network number 1 IF can_var 0 THEN rist SDOREGad ly oreo Can var 1 END_IF IF ris 0 THEN IF SDOStatus gt 0 AND can_var 1 THEN COUNT Can s count_cantl can_var 0 PRSO 2 3 SDODATA END_IF END_IF Since the node takes some time to respond to a request the value read from the node by the SDORead function is stored in the SDOData variable but is not immediately available The programmer must therefore check SDOStatus variable which is set to 0 as a result of the command and goes to 1 when SDOData contains the value read from the node SDOStatus goes back to zero after a reading of SDOData SDOWrite Example Write 100 in the pr81 variable for a CanOpen node on the network 0 IF SDOStatus 0 THEN ris o DOWrIi
107. t 4 analog In S Dl 8 DOT Analog terminal channels can be configured one by one Right click with the mouse on an analog terminal and select the Bus Coupler Setup option in the pop up that will appear The Bus Coupler Setup window showes all the channel available for the terminal Each channel can be configured by selecting one of the available channel configuration option in the dropdown menu related to the channel itself en 16 digital In ipd se Tail O analogici 16 digital Out AMIN 1_TE2_00 f Y ANIN1_TE2_02 P fi hd ANIN 1_TE2_01 INPUT 1 Y ANINI _TE2_03 INPUT fi X 4 analog In 8DIN 8 DOUT Configura nodo ME7000_14 03 11 28 TPAC tutorial s r l mect iO analogici ANINI _TE2 01 NP To save the chosen configuration press the Node Config button while to matain the previous settings just press the Exit button Once terminal configuration has been accomplished by closing the terminal configuration window you ll be back in the main CanBuilder window where the 5 Download Configuration File button allowes the transfer of the CanOPEN Network configuration to the TPAC CanOPEN Master as showed in section 8 6 1 2 8 3 2 CanOPEN Node Manual Configuration To configure a node right click on the node instance as shown in the below picture and chose the Node Config option __MECT Can Builder C Programmi MECT PR I test_cantest_can cnb File Tools Help
108. tandard configuration TPAC VPN address is 10 8 0 1 otherwise the address is specified in the tpacO10 conf file NOTE if you require to contact by vpn connection the TPAC from external networks please be sure that your gateway allows udp communication on port 1194 and that such communication 1s redirected to the TPAC 18 0 USB ALLOWED OPERATIONS To expand the number of usb memory device actually pluggable into the panel one and only one usb hub can be connected to the TPAC usb port Four port hub usb device is the maximum expansion currently supported The programmer retrieves the number and the working status of the available usb port through the USBstatus array while the USBfeedback array reports the locked unlocked status for the whole usb subsystem 1 e availability to process the requested operation cfr TPAC manual Permitted operation are between two usb device or on the same usb device itself e Copy file or directory e Delete file or directory Operations that refers to directory are performed recursively a Input Parameter Usb_copy Copy the specified file in the Input specified destination SRC STRING Path on the usb device Copy the specified directory with for the file or directory to be copied DST STRING Path on the usb device where the file or directory must be copied to SRC_INDEX USINT identifier from 1 to 4 for the usb device containing the source data DST_INDEX USINT identifier from 1 to 4 for the data
109. te 4 END_IF END_IF CE ee es eres as stop recording BOTS De E E EE ET IF state 4 THEN res Datalog_stop data txt state 5 END_IF IF state 5 THEN IF res 0 THEN state 6 ELSIF res lt 0O THEN state 7 END_IF END_IF 16 11 1 CRYPTO DATALOGGER CFR21 11 Datalogger functionality is available also with full compliance to CFR21 11 standard The TPAC Crypto Datalogger works as the previously described standard datalogger except that data are ciphered in memory before being written to the storage media Decrypted data are available only to whom hold the cipher key and the authorization password used to log the data themselves thus ensuring data integrity and protection Once decrypted data are available in text format for easy elaboration with a standard spreadsheet tool Input Parameter CryptoDatalog_start Connect the USB device to Input TPAC check for the available BUFF_LENGHT UDINT space free space and initialize the required to save data on the usb device cipher CHANNELS UINT number of variables to be logged INDEX UINT identifier for the usb device from to 4 to be used as storage area KEY STRING 16 characters cipher key PWD STRING 8 characters password ME7000_14 03 11 96 TPAC tutorial CryptoDatalog_get Save crypted variable value on the usb device CryptoDatalog_stop Stop Logging The usb device contains in the directory tempdata the crypted datalog for each requested
110. tele TOPS La U0 END_IF ME7000_14 03 11 92 TPAC tutorial s r l mect Before writing check that SDOStatus is zero meaning that previous write operation was successful 16 10 HMI TEXT FILE IMPORT FUNCTIONS To view one or more text files in a HMI project call the function HMItextLoad The function returns a code indicating whether the operation was successful or not The error codes table is given below 0 Success 1 Error reading file contents 2 Invalid file name 3 File does not exist 4 File cannot be open Function Function Name ame Description Input Parameter Function Name penne Returned Value HM ItextLoad Input Filename Output Error code If the function returns zero the variable FILE READ contains the address of the read file To display the file contents create a string variable long enough to contain the file and assign the FILE_READ pointer to the created string The following example shows the usage of the HMItextLoad function define the variable File_content as a 500 items STRING variable in which the file contents will be saved If a call to HMlItextLoad returns zero assign the value in the FILE_READ variable to File_content otherwise write an error message R sult HMItexthoad 1tealiam instruction ij IF Result 0 THEN File content FILE READ ELSE File content file not available END_IF As a result of the previously described step the variable File_content may b
111. the programmer set the timers j variable with the required time where j may be a value from 0 to 127 the timer starts to count and on timeout the variable timers j is zeroed To trigger the timer put a 1 into TIMERS_FLAGIj variable 16 4 VIDEO CONTROL FUNCTIONS Some functions to directly control the video are available to the programmer LCDSS_set_timeout LCDSS_get_timeout LCD _set_backlight ME7000_14 03 11 Description Input parameters Sets the the screensaver Parameters Timeout of the timeout in second sscreensaver Example of set the timeout of Returns O if success other if the screensaver to 5 minutes result LCDSS_ set_ timeout 300 Reads the screensaver timeout Parameters constant Example of screensaver timeout Returns the screensaver reading timeout value result LCDSS_ set_ timeout 0 Sets the screen brightness from Parameters brightness of the 0 to 100 screen Example of setting the Returns 0 if success other if brightness to 54 result LCD_set_backlight 54 75 TPAC tutorial s r l mect Reads the screen brightness Parameters constant LCD_get_backlight Example of reading _ the Returns the brightness value brightness brightness LCD_get_backlight 0 Switches on the screen Parameters constant Example of screen switch on Returns O if success other if result LCDSS_on 0 fail Switches off the screen Parameters constant Examp
112. the project destination folder Fill in the Project Name field with your project name and click on the Create Project button to complete the project creation and start the Can Builder software Project name Project folder The CanBuilder main window is made by three sections e EDS file list e CanOPEN Nodes instantiated in the network e Network parameter settings ME7000_14 03 11 25 TPAC tutorial s r l mect __MECT Can Builder C Programmi MECT PRIJ test_can test_can01 test_can01 cnb 8 x Fie Tools Help AS C Configure CANOpen net Parameter list Variable list cwhy2 8dio eds cwhy2 8pt100 eds a alsn24 eds PNCO10 eds Network parameters Baud rate BaudiM v CAN channel Can Open NOde Instance Cycle time ms Guard time ms Life time Sync enable Iv iv Manage NG toggle bit _EDSFILELIST HETWO RK PARAMETER SETTINGS 8 1 EDS File List The left side of the Can Builder window showes the list of EDS file available to create a CanOPEN network 8 2 Insert a node in the network To add a node in the CanOPEN network select the EDS file that represents the node to be created By double clicking on the chosen EDS file a new node will be instantiated in the network and will be visible in the central section of the Can Builder window Also an ID will be automatically assigned to the node by default the ID will be the first still free 8 3 Node Configuration Once a node
113. tion software PLC and HMI programs and CANOPen configuration Two kinds of possible TPAC users can be distinguished the programmer and the final user The former can update programs running on the TPAC through the development tool PageLab LogicLab and NetBuilder The latter may not have the development environment or it can happens that the TPAC is used on equipments without Ethernet connection in these cases update can be provided through the USB pen Once the update file named sysupdate sh is available it must be copied on the USB pen By restarting the TPAC with the USB pen plugged the device will automatically obtain the updates Sysupdate sh is built through the command Download _ current application available in the TPAC web interface ME7000_14 03 11 114
114. to delete Example result Rcpt_remove Returns O if success other if ric_name The variable ric_name contains the name of the receipt to be deleted Deletes from flash all the saved Parameter constant Rcpt_remove_all receipt ee Example result Rcpt_remove Returns 0 if success other if 0 Checks for the receipt name Parameter the receipt Rcpt_exists name to search for Rcpt_clean_curr Example result Rcpt_exists Returns O if success other if ric_name fail The variable ric_name contains the name of the receipt Returns the first receipt saved in Parameter constant Rept_get_first_set_curr the list and set it as current receipt Example Returns the name of receipt ric_name Rcpt_get_first_set_cu rr 0 The variable ric_name contains the name of the returned receipt Returns the next receipt in the Parameter constant Rcpt_get_next_set_curr receipts list on flash and set it as current receipt Example Returns the receipt addressor 0 address Rcpt_get_next_set_curr if the end of receipt list is O reached ric_name address The variable ric_name contains the receipt address Returns the previous receipt in Parameter constant Rcpt_get_prev_set_curr the receipts list on flash and set it as current receipt ME7000_14 03 11 78 TPAC tutorial s r l mect Example Returns the address of receipt address Rcpt_get_prev_set_curr or 0 if the top of the rec
115. ue of the variable named label RETURNED e 0 on success VALUE negative on error Ple_var_write NAME plc_var_write PROTOTYPE int plc_var_write int plcID char label void data DESCRIPTION attempts to write the variable named label with the content of the data buffer provided by the user PARAMETERS e Int plcID plc communication descriptor e char label variable identifier e void data pointer to the buffer used to store the value of the variable named label RETURNED e 0 on success VALUE negative on error ME7000_14 03 11 107 TPAC tutorial s r l mect NOTE When trying to write value to read only variables will cause errors See PLC documentation for the list of writable variables When interacting with the PLC already programmed on the panel the plc_var_write function must be used only to perform wirte in the RemoteArea Writing on any of the other variables may results in unpredictable behaviour or errors 17 10 Working with PLCIB in a Turbo C environment PLCLIB required format to work with TurboC is OMF Turbo C project must include the following files 3 plclib h Header proiding the dll interface 4 plclib_omf lib dll import library to be imported in the project or called by the directive pragma comment lib plclib_omf 1lib 5 plclib_omf dll DII that will be called during program execution To be copied in the sam
116. us Time Cycle must be configured by user A TPAC program is composed by two elements 1 PLC program built by the Axel LogicLab software 2 Human Machine Interface developed using the Axel PageLab software A PLC program may be developed in the following IEC 61131 3 compliant languages FBD Functional Block Diagram Graphical Like electric schematic LD Ladder Graphical Ladder schematic SFC Sequential Function Chart Graphical States diagram ST Structured Text Textual Pascal like language IL AWL Instruction List Textual Assembler like language To illustrate the various languages a very simple program is developed The program sets output_0 to 1 when the logic input_0 is set to 1 and the logic input_1 is set to 0 ME7000_14 03 11 TPAC tutorial s r l mect 2 1 FBD EXAMPLE Output OF os oo ogot 2 3 ST EXAMPLE IF INPUT_O AND NOT INPUT_1 THEN OUTPUT_0 1 ELSE OUTPUT_0 0 END_IF 2 4 IL EXAMPLE START LD INPUT_1 XOR INPUT_1 AND INPUT_O ST OUTPUT_O Further details about programming languages will be provided throughout the tutorial see section Develop a simple program ME7000_14 03 11 8 TPAC tutorial s r l mect 3 0 HOW TO INSTALL THE DEVELOPMENT SUITE TPAC is supplied with a CD containing the software that a user must install into a Windows system based personal computer The supplied software is Mect Dashboard Axel LogicLab PLC
117. ustrated below If the needed functional block is not available in the system functional blocks set you can access an additional set of functional blocks created by MECT To list these blocks select the Function blocks entry from the workspace window For details about functional block please refer to the section Functional Blocks ME7000_14 03 11 15 TPAC tutorial s r l mect ANALOG INFUT_1 threshold 1 gt Finally we need to draw the wiring that properly connects the elements This is achieved by right clicking in the program window and selecting Connection mode from the pop up menu that appears The cursor changes shape to mean that now we can draw the connections between the elements of the diagram For instance click first on the connection pin of the DI_1 input and then on the connection pin EN of the GE functional block A connection wire should be drawn between the two pins Repeat these operations until you wire all the elements as shown in the figure above At this stage the program is ready to be compiled and downloaded the on the TPAC as will be described in the section Compile and download the program 5 6 THE ST PROGRAM The same functionality can be implemented using the following code in the Structured Text language Repeat the steps described in the section Common steps to create a new program and select ST instead of FBD IF DI_I 1 THEN DO_2 1 IF AnInO gt threshold_1 THEN DO_1 1 DO_2
118. value UINT 0 if modbus request has been fulfilled1 if modbus is busy Error if any it s written in MODBUSstatus 1 INPUT slave_addr UINT slave address reg_addr UINT register address to be referenced register 40001 actually reference register 40000 Value to be written in the register is read from MODBUSdata 0 OUTPUT Returned value UINT 0 if modbus request has been fulfilled 1 if modbus is busy Error if any it s written in MODBUSstatus 1 INPUT slave_addr UINT slave address coil_addr UINT coil starting address coil_count UINT number of coils to be set Values to be set for coils are read from the MODBUS data array MODBUSdata 1 coil status 0 gt OFF 1 gt ON MODBUSdata 0 gt status for coil_ addr MODBUSdata 1 gt status for coil_addr 1 MODBUSdata N gt status for coil_addr N TPAC tutorial MB_f10 MB_f16 ME7000_14 03 11 Example Preset values into a sequenze of holding registers 4X references When broadcast the function presets the same register references in all attached slaves Example Modifies the contents of a specified 4X register using a combination of an AND mask an OR mask and the register current contents The function can be used to set or clear individual bits in the register Broadcast is not supported 89 s r l mect OUTPUT Returned value UINT 0 if modbus request has been fulfilled 1 if modbus is busy Er
119. variable CryptoDatalog_decrypt Decrypt variables single datalogs and create the text full datalog CryptoDatalog_eject Unmount USB key ME7000_14 03 11 97 s r l mect Output Error code DINT 1 OK 2 USB device cannot be accessed 3 Cannot estimate the free space on the usb device 4 Cannot create cancel directory to save data gt 0 MAX number of byte available on the usb device Input LABEL STRING Label for the data to be saved used as heading of the data column VALUE REAL Value of the variable to be saved Output Error codes INT 0 OK error Input costant Output Error Code UINT 0 OK gt 0 error Input FILE STRING full datalog filename SRC_INDEX uINnT identifier from 1 to 4 for the usb device containing the source data DST_INDEX vINT identifier from 1 to 4 for the KEY STRING 16 characters cipher key PWD STRING 8 characters password Output INT 0Q OK gt 0 Error Input INDEX UINT identifier for the usb device from to 4 to be used as storage area Output INT Q OK gt 0 Cannot unmount USB device TPAC tutorial s r l mect 16 12 STRINGS MANIPULATION FUNCTIONS String manipulation is handled by two functions Description Input parameter Str_concat Concatenates two strings Input IN1 STRING string to which String2 is appended IN2 STRING string to append to String Output BOOL Functio
120. y a DHCP server the leased address must be known since needed by all software programming tools Target 4 Reset DHCP STATIC IP Address 192 168 10 D Metmask 255 255 255 Getway E E Poff DNS The network settings or the reset configuration can be saved on a USB device or on the local file system using the Export current configuration that will create a file respectively Net conf including the LAN setup or reset conf containing the reset settings Once the configuration file is saved on the USB device to configure the TPAC just insert the USB device in the USB slot and switch on the TPAC The TPAC will load the newc onfiguration that will be active from the next reboot Once the TPAC got its configuration it becomes ready to be programmed ME7000_14 03 11 10 TPAC tutorial s r l mect Het Configuration USB Pen lE se Drive t DHCP w STATIC Splash Image IP Address Netmask E zj 3 File path Gateway eat i Browse DHS 1 DNS2 Firmware upgrade File path Browse The Settings window in the high left corner displays four buttons Back to the homepage back to the previous page Save configuration save current configuration on the hard disk al Export current configuration save current configuration on a USB pen drive T Launch web browser Start a web browser and connect to the TPAC by IP the address defined in the Net

Download Pdf Manuals

image

Related Search

Related Contents

WebParts Mercedes-Benz  取扱説明書 - 日立リビングサプライ  SDA-15B User Manual  STATION METEO-PRO “HEAVY WEATHER” et ses  Royal (15.0 L + 2.0 L)  Cisco Unified Communications Software Subscription, 2 Years -100 Users  DIGIT - schede  Dell 1702FP Computer Monitor User Manual  Warehouse of Tiffany LD5001 Instructions / Assembly  Microscopie et photographie Histoire d`une évolution  

Copyright © All rights reserved.
Failed to retrieve file