Home

Win-GRAF-User-Manual-english V1.01

image

Contents

1. 3 Click the Insert Master Port button on the left side to open the setting window Then select the Serial MODBUS RTU set COM Port e g COM2 9600 N 8 1 and Delay time recommended value 10 ms it can be O to 10000 and then click OK 10 Drivers H MODBUS Master Name Value F Name Type ee es Global variables Dk HODUUS Mester Lor E RETAIN variables Main 2 O MODBUS on Ethernet Ta pOnBadindex A Address Fe pOnDivZero F Port Eire a Mo Protocol pP Onen M Se e If wish to set it as a Modbus ASCII Master change the setting to ASCIl COM2 9600 N 8 1 Doly between roguests After receiving the respond waiting for 10 ms to send the next command Delay ms 10 Try to reconnect after communication error peas ee iiemed bt for slaves Select Disabled if you do not want Disabled do not open and manage this port to use this COM Port setting 4 Click the Insert Slave Data Block button on the left side to create a data block 10 Drivers g Sl Mig MODELS Maste Name Value i ATU COM S600 N 6 Mode ATU Address LOM 2 S600 68 1 Fort Ji Reconnect after error Slaves diagnostics Delay between requests me 10 Disabled E Win GRAF User Manual V 1 01 Oct 2014 by ICP DAS 5 2 This table lists five data blocks and each data block stands for one
2. Win GRAF User Manual V 1 01 Oct 2014 by ICP DAS 14 1 2 Check the Smart Device on the left then selecting the NET framework 3 5 and Smart Device Project Then entering a proper project name and the last click on OK Project types Templates NET Framework 3 5 isual Stadio installed templates act mart Device Project as Hy Templates peach Online Templates AD Name project 3 Select the Device Application and Windows CE and NET Compact Framework Version 3 5 then click on OK Windows CE wt NET Compact Frantework Version 3 5 w NET Compact Framework Version 20 NET Compact Framework Version 3 5 Target platform NET Compact Framework version Templates Empty Project 4 project for creating a NET Compact Framework 3 5 forns application for Windows CE Flattorm Download additonal emulator images and smart device SOEs Win GRAF User Manual V 1 01 Oct 2014 by ICP DAS 14 2 14 3 1 Add C Project Reference The UserShareNet library contains all modules functions Before you use the UserShare keyword in the program you must add the UserShareNet dll into the reference list of your application 1 Copy the UserShareNet DLL from WP 8xx8 CD ROM napdos Win GRAF WP 8xx8 CSharp net_2008_demo demo_CSharp01 to your project folder ex C project1 2 Right click on the Project
3. Port OK _ If succeeds do the next 2 Action P Clear input buffer In this example clear input buffer of 3 COM _clear Port_number COM3 first and then send a COM_send_str Port_number QUESTION End_Action After sending query wait for 250 ms to allow the device reply Bytes GS3 T gt T 250ms 4 are safely delivered to the Win GRAF PAC Do not set the time too short or cannot receive a full reply Action P receive reply from COM3 max 200 bytes in this example 5 NUM1 COM_recv Port_number ByteAry 0 200 do operations if protocols is correct if NUM1 10 then Fal end_if End_action GS5 T gt T 2 Put the received Byte into ByteAry 6 R and check if the number is correct If yes h i h When done wait 2 seconds and then we eo m M cra 1 return to the step 1 to send the next qppucenoniiceden query command Win GRAF User Manual V 1 01 Oct 2014 by ICP DAS 12 10 12 2 3 Wait Data Coming from Remote Device by COM Port This way is common in the general store or supermarket such as using the barcode readers After reading the barcode of the product it will send the barcode data to the Win GRAF PAC s COM Port RS 232 485 422 and need not to reply any messages Win GRAF PAC 1 Device 2 If receives the complete data from device al 1 After triggering send data to do operations the Win GRAF PAC 3 When done wait for the next data coming Re
4. T Name Type Dim Inst_D 700 EAR F gan ot 3 a Global variables a id RETAIN variables o B k DCON E 1x5 0 BOOL T a i z wH l H COUNTER_RESET Re 20 COUNTER_START Sta Di COUNTER_STATE Get E H COUNTER_STOP Stop a D 7005 remote i 7005 H S EF D_701 Utemote i7011 gt E7012 remote i 7012 gt D_7012_ 2 Get only 1 ai D_7013 remote i 7013 Tips l D ZONA Crernote 2014 Press F1 to see the setting description z 2a ee a z i Define ENUM gt Main Variables Win GRAF User Manual V 1 01 Oct 2014 by ICP DAS 8 4 8 2 1 D_ 7065 Function Block D_ 7065 Connect a remote l 7065 I 7065D Power Relay Output Module or I 7065A I 7065AD 7065B I 7065BD Solid State Relay Output Module Note 1 All connected DCON I O modules should be configured once by the DCON Utility see P8 1 2 Please use DCON Section 8 1 in the I O boards window and set proper settings Port baud_rate etc on it 3 All values of DI channels are meaningful only when the returned communication state is TRUE If OK returns TRUE 4 Referring Chapter 12 click the menu bar File gt Add Existing Project gt From Zip to restore the demo project CD ROM Napdos Win GRAF demo project DEMO_D_7065 zip in the shipping CD and see the program and descriptions Supposition Use PAC s COM2 to connect the l 7065 Addr
5. 1 8144iW Pin Assignment Di TxD1 D1 TxDi RxD1 RxDi GND1 D2 TxD2 D2 TxD2 RxD2 RxD2 GND2 D3 TxD3 D3 TxD3 RxD3 RxD3 GND3 D4 TxD4 D4 TxD4 RxD4 RxD4 GND4 8114iW 8114W 4 port Isolated RS 232 4 port RS 232 Pin Ar Assignment Aasigmet NC N C NC st N C ste RTS3 CcTS3 TxD3 were N C arr GND4 DTR4 as DSR4 RxD4 vari N C onc N C pais NC zess RTS2 CTS TxD2 re N C GNDI DTR1 asi OSRI RDI RTSi TxDi I 8142iW 2 port Isolated RS 422 485 RS 485 port1 D1 D1 RS 485 port2 D2 D2 RS 422 port1 TxD1 TxD1 RxD1 RxD1 RS 422 port2 TxD2 TxD2 RxD2 RxD2 I 8144iW 4 port Isolated RS 422 485 RS 485 port1 D1 D1 RS 485 port2 D2 D2 RS 485 port3 D3 D3 RS 485 port4 D4 D4 RS 422 port1 TxD1 TxD1 RxD1 RxD1 RS 422 port2 TxD2 TxD2 RxD2 RxD2 RS 422 port3 TxD3 TxD3 RxD3 RxD3 RS 422 port4 TxD4 TxD4 RxD4 RxD4 Win GRAF User Manual V 1 01 Oct 2014 by ICP DAS AP 6 Appendix E Enabling a Serial Port for Connecting the Win GRAF Workbench In this section we use the WP 8xx8 as an example to show the way to enable the serial port for connecting the WinGRAF Workbench and this way is also applied to other Win GRAF PACs The Win GRAF PAC s Ethernet Port is typically enabled for the Win GRAF Workbench to debug or download or upload the project If users want to enable a serial port i e RS 232 o
6. or press the Ins key or click the fa i WE A E g B S Al Dim Attrib Syb Initvalue User Group Tag Description gt fe Global variahles PAC Year Undo Current time of the PAC PAC Month PAC Day PAC WeekDay PAC Hour 44 Cony PAC Minute A a PAC Second Clear a new Year en new time for the PAC Se Edit new Month new Day Cancel Sorting new Four Enable Changes Space new Minute a 3 wap Global lt gt Retain new Second Set TRUE to set new time m AIN var 2 Double click the new NewVar item and change its name to LED1 then click Enter to finish the setting In this case the data type is BOOL set new time BOL E set TRUE to set new time T Biarn iar Aril eo O OOO O Note The settings will be done only after clicking the Enter key 3 Follow the previous steps to add the LED2 boolean variable Set new time BOOL L Set TRUE to set new time LED BOOL E LED EDOL E la RETAIN variables Tips To set up multiple ordinal variables enter the name LED as the step2 and then press Ctrl C and Ctrl V twice to create LED1 and LED2 auto sequential numbering finally delete the first variable i e LED Win GRAF User Manual V 1 01 Oct 2014 by ICP DAS 2 8 Tip 2 1 If you need to add multiple variables e g Boo 01 to Boo_16 simply right click the Global variables
7. 3 Before establishing a connection make sure the PAC and the network are working properly Win GRAF User Manual V 1 01 Oct 2014 by ICP DAS 2 19 4 Click the menu bar Project and select On Line or click the Al tool button to establish a connection Win GRAP Demoli File Edit View Insert piwan Tool Window Help ly 4 g Build All Projects Fi Workspace E 7 Clean Al Projects 5 E Demoli ta Download All Projects H Exception pre 5 As the screenshot if it shows App TEST different to the current project name i e Demo01 that means there is a project name TEST running in the PAC Click Stop application tool button to stop the TEST project Win GRAF Demoli File Edit View Insert Project Tools Window Help ae EE ee IE eee eee ee MER 6 7 Ifit shows RUN that means the Demo01 project is successfully running in the PAC Works D E oo cl PAC_Time m 7 p yeepion programs Inst_TIME_GET _ PAC Time Get Set FA Ea ee F a Programs Ri Get current t HEn TIME_GET Ena j Inst_TIME_GET 2 PAC Time Get Set Inst TIME SET wow fe LD1 Blinking E Current time of th fay Global variables YearLPAc Year 2014 ie Watch for debugging PAC Year 2014 R Soft Scope i PAC Month 4 seen Initial values 1H Month HPAC Month 4 PAC Day lif Binding Configuration PAC WeekDay 1 E
8. Normal day Schedule pias Schodok 34 Schedule 2 Sunday Holiday 1 T Monday Schedule 3 arcs J Tuesday Holiday 2 J Wednesday 5 Special day J Thursday Vv Friday schedule 4 Toia Schedule 5 5 Default Value in the upper right is for the default setting If the current date is not found in any Schedule setting or the date is found however its time period is not found in the related Schedule 1 5 the Target device will be controlled follow the Default Value The Default Value in this demo project is Boolean OFF Integer 0 Real 0 0 Advantage of the Default Value Utilizing the Default Value can reduce the amount of the Periods setting in the Schedule 1 5 Ex The following example sets 5 Periods in the Schedule 1 1 00 00 08 00 OFF O 0 0 2 08 00 09 50 ON O 0 0 3 09 50 10 00 OFF O 0 0 4 10 00 11 50 ON O 0 0 5 11 50 24 00 OFF O 0 0 If utilize the Default Value as OFF O 0 0 the user just needs to set 2 Periods as below 1 08 00 09 50 ON O 0 0 2 10 00 11 50 ON O 0 0 6 After completing all settings click Save to PC to save a configuration file in PC This demo uses test1 txt 7 Click Back to return to set up other Targets This demo sets Target 1 only Win GRAF User Manual V 1 01 Oct 2014 by ICP DAS 17 9 17 4 Testing this demo This section shows the way to implem
9. TMR_2_last_state FALSE end_if Win GRAF User Manual V 1 01 Oct 2014 by ICP DAS 16 11 16 4 Test Demo Programs demo_RDN_2 Two PAC XP 8xx8 CE6 without connecting any I O modules Win GRAF RS 408 NS 408 Win GRAF PAC Alive Port Rotary Switch RS 232 ee ee ee ee 1 Hardware installation using XP 8xx8 CE6 as an example Refer Section 16 2 PAC Installation notes make sure three communication ports of the PAC have been connected properly and the rotary switch is set to 7 Main PAC or 9 Backup PAC 2 If there is no redundancy app in the redundant system yet that is no control right switching procedures start the Main PAC 7 first and then start the Backup PAC 9 in that case the Active PAC will be the Main PAC Later users can run the Win GRAF driver on a PAC s monitor to see which one is the Active PAC PAC side 2P Oxx8 CE6 driver Version 1 01 Sep 11 2014 Te e This PAC is the Active PAC Project demo_sw 107 Extra_port None It will appeal blank if this is the Passive PAC Ed Win GRAFA P axa CEA Elapsed time 0 0 15 0 Fassive Ready Add DLL provider here Add DLL version here Add Your DLL information here Win GRAF Driver 1 First look up the LAN1 IP address of the current Active PAC factory defaults P 192 168 255 1 Mask 255 255 255 0 refer Section 1 3 and make sure that your PC is on the same network domain e g IP 192 168 255 x
10. _4 Ping ip 4043 IP 4 NiA Interval_4 15 2 Ping ip Test Ethernet Internet connection mlana co i oO Setting Description Note 1 If wish to test the connection between PAC and Internet please set proper Gateway settings 2 If test only local Ethernet connection then Gateway may not be necessary 3 One PAC can use only one Ping_IP Note 1 If wish to test the connection between PAC and Internet please set proper Gateway settings 2 If test only local Ethernet connection then Gateway may not be necessary 3 One PAC can use only one Ping_ IP Don t use two or more 4 When Ping success return Boolean channel as TRUE 5 When Ping fails it will try one more time If still fail then return Boolean channel as FALSE Parameters IP_01 to IP_49 Data type STRING The IP address of targets Set as N A if wish to disable it For example 192 168 1 100 or 52 19 125 242 or N A Interval_01 to Interval_ 49 Data type DINT The unit is second The interval to send one ping command Value can be 6 to 86 400 seconds Setting smaller than 6 will use as 6 Setting greater than 86400 24 hours will use as 86400 Win GRAF User Manual V 1 01 Oct 2014 by ICP DAS 4 29 Timeout_01 to Timeout_49 Data type DINT The unit is second The timeout settings of the ping command Value can be 2 to 30 seconds Setting smaller than 2 will us
11. error message It means that the compiled version between the PC and the PAC is different The most common reason is that users have modified and re compiled the program To solve the problem 1 Click the Stop application button to stop the running program Win GRAF Demoli kx File Edit View Insert Project Tools Window Help rae BE al a E gt Hamel i Bj GO aA Workspace seee PAC_Time EEX e gt DO Bad version A Ti Hame N Value La Exception programs Ls _ PAC_Time Get Set FA FL Programs Second PAC_ Second i _TIME_GET o pPI PAC Time Get Set Set TRUE to set n Inst_TIME SET eee BE LOT Blinking et_new time El fat Global variables M DE Watch for debugging R2 Set TRUE to at TIME SET GP PAC Year at zai acep new time tor the Fete etal ka e E Initial values new Year 4 Year m a E Hig Binding Configuration T El G Al A i g Global defines K Aae new Month A Month H O Used EE Types LI a Project E Advanced new Day ety H O Arithmetic E Arrays new Hour Hour El La AS interface w c gt 4 gt Blocks Sovlist Define ENUM Demoli 192 168 255 1 502 x H Time Event description Bad version Cycle time me Last 0 Allowed 0 Maximum 0 lt Build Cross references Call stack Breakpoints Bad version 192 168 255 1 502 jill Bad version Cycle time ms Last 2 2 Click the Download butt
12. msg unicode_to_byte_array str_val UserShare Set_STRING Convert ToUInt16 7 msg Convert String to byte array private byte unicode_to_byte_array string msg byte tmpbuf if msg Length gt 255 return null tmpbuf Encoding GetEncoding UTF 8 GetBytes msg return tmpbuf Demo program CD ROM 1 R W String variable napdos Win GRAF demo project CSharp net_2008 demo demo_CSharp04 Win GRAF User Manual V 1 01 Oct 2014 byICPDAS 14 12 ME Get STRING Description This function is to set a String value to the Win GRAF String variable Syntax UserShare Set_STRING ushort addr Byte msg Parameter addr Address of Variable 1 to 1024 msg Set the string value Example String str_val Hello World Byte msg Set a string value Hello World to the Win GRAF String variable with address 7 UserShare Get_STRING Convert ToUInt16 7 msg str_val byte_array_to_unicode msg Convert byte array to String private string byte_array_to_unicode byte buf string tmpmsg if buf Length gt 255 return null tmpmsg Encoding GetEncoding UTF 8 GetString buf O buf Length return tmpmsg Demo program CD ROM 1 R W String variable napdos Win GRAF demo project CSharp net_2008_demo demo _CSharp04 Win GRAF User Manual V 1 01 Oct 2014 by ICP DAS 14 13 14 5 5 How to Use C to Convert Win GRAF String Variable Before NET program write to Win GRAF Str
13. reset PAC is declared as BOOL and has initial FALSE TMP_BOOL is declared as BOOL ONLY when reset_PAC is set to TRUE the PAC will reboot if reset_PAC then reset PAC 21 reset_PAC FALSE DEO REBOOT i end_if i Dangerous Coding TMP_BOOL is declared as BOOL Dangerous This coding method will let the PAC reboot always and cannot stop TMP_BOOL PAC_Reboot If a mistake to reboot the PAC always turns the rotary switch of the Win GRAF PAC to 1 and reset it Then it will boot up in safe mode Then you may rename the Win GRAF application code in the PAC to an invalid name Then when the rotary switch is turned back to 0 and reboot it will boot up normally No application The Win GRAF application code in the XP 8xx8 CE6 WP 8xx8 WP 5xx8 VP 25W8 and VP 4138 is System_Disk Win GRAF t5 cod Win GRAF User Manual V 1 01 Oct 2014 by ICP DAS 11 7 11 6 Using ST Syntax in LD and FBD The Win GRAF Workbench allows users using simple ST syntax in Ladder LD and Function Block Diagram FBD to facilitate programming Before use go to the menu bar Project gt Settings gt Runtime and set the Complex variables in a separate segment to Yes to enable this function Win GRAF Test File Edit View Insect Steam Tools Window Help fis amp Build All Projects F Workspace Clean All Projects El Test E Download All Projects H Exception pre H FProoamg Proj
14. 2 Backup_Real_1 txt i GetPacName exe RBY penmount_usb_touch_v2010052 TE a 3 69 AOT Working_Int txt Win GRAF User Manual V 1 01 Oct 2014 by ICP DAS 12 16 12 3 2 Read Data from a File in the PAC Refer P12 1 to open the project demo_file2 zip and can view add variables in the variable area ST Program This program can be used to read 10 REAL values from a file in the PAC this demo_file2 project will read 10 REAL value from a file in the System_Disk Real_data2 txt File format Each row contains one REAL value and ends with lt CR gt lt LF gt characters Like 1 08 2 786 38 45 41 5 59 875 60 76 71 23 80 5 99 8 100 7 Variables Declaration Write_File BOOL Tmp_string String len 255 File_ID DINT REAL_val 0 9 REAL ii DINT File_path String len 128 initial val System_Disk Real_data2 txt File Status String len 128 Because the size of System_Disk is small recommend you amy change the directory to below Depends on your application Set Read_File as TRUE to read data from the file if Read_File then Read_File FALSE WinPAC ViewPAC Series Check if file exists Micro SD or if F_exist File path FALSE then 7 file doesn t exist XPAC Series File Status File File_ path does not exist System_Disk2 else file does exist open it in read mode File ID F_Ropen File_path i
15. After completing the settings the defined variables show as below T D F Attrib Syb Initvalue User Tag Description Word Write 1 WORD O lt gt 3 Inthe lO Drivers window drag variables Word _Write_1 and Status that created in the Section 5 1 1 from the Variables Area to the Symbol Area in the 4th data block Note The Status is an array variable When you drag Status into the Symbol Area it will show Status 0 to Status 4 simply press Del key to delete Status O to 2 and Status 4 4 Set the Operation field of the Status 3 as Error report that means this variable will be set to an error code when a read error occurs or reset it to 0 when a read request is successful Press the F1 key to see the description of the Modbus Master Configuration and move to the title Status and command variables to know related commands and error codes IO Drivers E MODBUS Master Name Value a S ar ATU COM2 9600 N 8 1 Request lt 6 gt Write single holdi oan B lt 2 Read Input Bits 1 1 16 Slave Unit 3 B lt 5 gt Write single coil bit 2 1 1 Address 1 ie lt 4 gt Read Input Reaisters 3 1 10 Nb Item 1 g i lt 6 gt Write single holding register 3 1 1 Activation On Change Period rms 0 E Period on err 0 ep Timeout ms 250 E Number of tri 1 gt Description
16. Enter key to display a drop down menu Then select DWORD Low High and press Enter key to complete the setting If using a 16 bits or below it s no need to set the Storage item Spmbol Offset Mask Storage y d Range Low FEFE Default PAC Year 0 PAC Month z FFFF Default PAC Day 4 FFFF Default PAC Hour E FFFF Default PAC Minute g FFFF Default PAC Second 10 FFFF PAC WeekDay 12 0 FFFF i DWORD Low High lt STRINGIS z FAC Time wariables LOI 10 Drivers STRING 10 To expand this Data Block and you can see the Modbus addresses of all variables It equals to the Offset value plus 1 Base address IO Drivers E E Input Registers 1 2000 Read Value Name Value By 400 7 PAC Year a Request Input Registers 1 By 2 3 PAC Month Address B By 4 5 PAC Day Nb Item 2000 i 7 6 7 PAC Hour Description Read Value E m 8 35 PAC Minute F j m 10 11 PAC Second gS Symbol Offset Mask Storage Range Lo a PAC Year T FFFF DWORD Low High PAC_Month 2 FFFF DWORD Low High PAL Day 4 FFFF DWORD Low High PAL Hour G FFFF DWORD Low High PAC_Minute 0 FFFF DWORD Low High PAC Second 10 FFFF DWORD Low High PAC WeekDay 12 FFFF DWORD Low High lt m gt Win GRAF User Manual V 1 01 Oct 2014 by ICP DAS 3 4 10 Then we need to add the second Data Block for the Modbus Master to rea
17. Initvalue User Group Tag Description 1X1 0 i_8055_DI QX1 1 i_8055 DO me Bay ie 7 I means Input Q means Output olf npu wod BOOL Input T X means Boolean 1 means Slot 1 1x1 0 5 BOOL LJ 6010 6 BOOL L Note of Input aT ee a i nput C Double click this item to modify the variable TOTTI Output O name and click Enter to accept the setting O11 BOOL Output O OMT 1 2 BOOL Output O o B axi 16055 DO M113 BOOL Output C1 METITA BANI Output M114 BOOL Output O j Output C1125 BOOL Output C i Outout OX1 1 6 BOOL Output C ips 0X1 1 7 BOOL Output C Output S nT 4 PAC Time Wariables Win GRAF User Manual V 1 01 Oct 2014 by ICP DAS 4 3 4 2 i_scale Conversion Table The i_scale function can set up to 29 scaling functions to convert values for the Al or AO module that plugged in the slot 0 to slot 7 See the Chapter4 P4 1 to add this I O board 1 Mouse double click the i_scale_O or i_scale_1 or i_scale_2 to open the Properties window and then to see the setting description Note Using the slot 8 or above No because the slot 0 to slot 7 are reserved for the real I O module rE 170 Boards f ja Es 9 0 i_scale Properties x 3 Key 6 a6 Ref 16 24 5 ChOO_X0 reserved 0 0 E ChOO_X1_ reserved 0 0 gt Choo _ 0 _teserved 0 0 8 9 i
18. The I 8084W is a 4 8 channel high speed Frequency Counter Data type DINT that can be used to measure frequency or as a UP Down Counter or as a UP Counter The following will describe these three modes See the Chapter4 P4 1 to add this I O board 4 7 1 i 8084 freq 8 channel Frequency 1 Mouse double click the i_ 8084 freq to open the Properties window and then to see the setting description SEE 140 Boards 0 ve Close 8084 freq Es 1 i 8084 freq Properties PA ey i PITTTITITITITITITITITITITITITITITITITITITITITITITITITITITITITITITITITITITITI TITTY o 4 Bat igya gi E Ch0_1_Filter 0 5 ChO_1_Freq_timeout 1800 Ch0 1 Low High Auto 2 Ch2_3_Filter 0 8 Ch2 3 Freq_timeout 1800 ss Ch2_3 Low High Auto 2 10 Ch4_5_ Filter 0 17 Ch4_5 Freq_timeout 1800 Ch4_5 Low High Auto 2 12 Ch6o_ _ Filter 0 Esi Ch6_7_Freq_timeout 1800 14 Ch6_7 Low High Auto 2 15 sae Update intervals 0 16 a Setting Description 17 B084 W 8 Ch Frequency Inputs Value type is DINT Parameters Ch_Filter unit is 0 000001 second can be 0 200 The default setting is 0 without filter The Ch_Filter is for filtering out some noise signals with samll signal width Parameters Ch_Filter The unit is 0 000001 second us the value can be O to 200 The default setting is O without filter The Ch_Filter is for filtering out some noise signals
19. When the PAC sets up the PUBLIC area means to publish its own data 1 Mouse right click on the toolbar Open Binding Configuration icon to open the Binding window 2 Click PUBLIC 9000 to configure the data to be published as PUBLIC Address field needs not to fill in Port field is fixed to 9000 do not change it _ Sele Open Binding Configuration Ve Win GRAF Test 3 File Edit View Insert Project Tools Window Help Workspace a Binding s M X a Test_3 Epo Network Na e Value Y Name H C Exception programs lg meee PLIBLIC 9000 Name PUBLIC O Global variables A L Programs Address ied RETAIN variables ae Main H Port 3000 _ Main La Watch for debugging 7 2 nOnBadIndex P T ae nn PUBLIC area _ ea TEET i 39 Initial values n i ariable eens Name Identifier ister N Hfd Binding Configuration needs not to fill Ss area 3g Global defines in the Address 3 Variables KE Types lt 4 gt Binding Wariables Win GRAF User Manual V 1 01 Oct 2014 by ICP DAS 7 1 3 Before setting the data to become public first you must create the variables want to become public in the Variable area Right click on Global variables and press Ins key to add the new variables In the following table the variables are used for this example You can set up your own After finished the screen is as below 3 fa Global variables Public BOO
20. 1 8 xXV308_AL0 INT a Main B B lt 15 gt Write Coil Bits 1 1 8 z xV308_Al1 INT Miep n debugging Symbol peon E E AY308_ Al 2 INT came xV 308_Al_0 Data exchange 0 FFFF Default we S T Initial values Be xv308_AL1 Data exchange 1 FFFF Default GALA INT Ya Binding Conhiguration 3308 Al 2 Data exchange 2 FFFF Default ANGE NE aha AoA eles GPI 4v308_Al_3 Data exchange 3 FFFF Default line Ee G NORAS en x 308_Al_ 4 Data exchange 4 FFFF Default AVIOO AL INT ie ee XV308_Al_5 Data exchange 5 FFFF Default xv a08_Al_6 Data exchange 6 FFFF Dejar i 5 gt xV308 Al 7 Data exchange FFFF Default _ Name Value lt AE i a Note The Offset value is starting from 0 and the Modbus address for variables is equal to the Offset value plus 1 Base address Moreover if you set the Operation as Error report the Offset value for the mapping variable Date Type DINT must set to O HODBUS Master Request Request Description slave Unit The Net ID fixed to 1 of the Slave device i e XV board MODBUS Request lt 2 Read Input Bits lt 3 gt Read Holding Registers lt 4 gt Read Input Registers JE Leike cinal amil Lik Le Data block wa Read Al data Base address Hf east Start from addr 1 and read eight data Activation Periodic on call On change Misc Timeout An exception occurrs if no Nb tria
21. 308_DI_6 Data exchange 6 FFFF Default Peon xv308_DI_ Data exchange 7 FFFF Defaut Hame akie lt gt Notw When using the XV308 to read DI data the address must start from 33 MODBUS Master Request Request Description Slave Unit 1 The Net ID fixed to 1 of the MODBUS Request Slave device i e XV board lt 1 gt Read Coil Bits A lt 2 gt Read Input Bits 3 gt Read Holding Registers N A Nase Trek Nanickave Data block f Base address 33 Start from addr 33 and Nb items 8 read eight data Activation Periodic 50 O On call On change Read every 50 ms Misc Timeout 100 i An exception occurrs if no Nb trials 1 respond for 100 ms Win GRAF User Manual V 1 01 Oct 2014 by ICP DAS 5 29 Demo description demo_XV308 2 This demo added two data blocks one is used to read 8 Al data and the other is used to write 8 DO data 1 Mouse double click the 1st data block i e lt 4 gt Read Input Registers to open the setting window Workspace IO Drivers i 7 Xx C demo_X 308_2 E Mp MODBUS Master T Name Type H C Exception programs cs 3 ATU COMO 115200 N 8 1 5 fa Global variables GL Programs aa f lt 4 gt Read Input Reaisters 1
22. 6 As the screenshot above it s recommended to set the Base address to 1 and the Nb items refers to how much variable data can be provided by one data block If the data address requested from the Modbus Master e g the SCADA software is greater than this value in this example the value is 2000 the Modbus Slave i e Win GRAF PAC will not respond 7 Mouse drags all the needed variables e g PAC_xxx data type DINT one by one from the Variables area and then drop it to the Symbol field IO Drivers Ll es g El Mg MODBUS Slave T Name Dim Lo El TT Serer Slave number 1 Request Input Registers PAC Month CINT J H B Input Registers 1 2000 Read Va Address PAL Da DINT oO Descript Head Value rast Four CT 7 PAC Minute DINT Symbol Offset Mask Storage PAC S cond DINT v ERI pac vear i FFF Default JE So as PAL Month U FFFF Default as Value PAC Day 0 FFFF Default F B PAC Hour 0 FFFF Default A FAC Minute 0 FFFF Default Lc 7 PAC Second 0 FFFF Debarlt A 4 ai lt m gt 4 p PAC Time Warables LDI 10 Drivers 8 Mouse double click the Offset field and fill in a value then press Enter key to finish the setting Note 1 The Offset value starts at O and the Modbus address of variable is equal to this value plus 1 Base address 2 If using a 32 bits or more than 32 bits data typ
23. FALSE Fail or Ethernet cable is disconnected Ch 10 is_Passive LAN1_ok ls the LAN1 port of the Passive PAC ok TRUE OK FALSE Fail or Ethernet cable is disconnected Win GRAF User Manual V 1 01 Oct 2014 by ICP DAS 16 7 demo_RDN_1 To connect DCON I O modules via PAC s COM3 RS 485 FREE TAQ Boards i 9 DCO Properties A 2 Sd 3 4 Ton watchdog Ena Connect DCON I O modules by F Wathdoz_timeout 5000 Checksum_enabled 0 PAC s COM3 and the Baud rate B Delay ms between polls 7 is 9600 g 10 i redundance redundancy rs485 Setting Description DCON A 14 ll i redundancy rs485 Properties Edfote DCON 1 0 l 7000 series modules RU 87PE 15 Sata gegtea aetna eee eta 16 DIPO NT Open COM3 and set the timeout as 30 seconds Ch05_Port_No 0 i_redundancy_rs485 is used to Setting Description check if the RS 485 port of the Passive PAC can receive data Detect the AS 465 port state of the passive PAC of a redundant system m on re i Ii pam Ch b_Timeont 30 i redundancy rs485 The following FAC support redundancy eP Gend CEB oP Sen8 CEB WP 5248 Important Notice 1 Please must also use the i_ redundancy or the i_redundancy_rs485 will not work 2 The i_redundancy_rs485 will only open the related RS 485 ports to receive data in the passive PAC It doesn t send any data 3 The i_redundancy_rs485 is used to detect whether th
24. Get 8 bit integer value from the Win GRAF SINT variable with address 10 UserShare Get_SINT Convert ToUInt16 9 out sbyte_val Demo program CD ROM 1 R W analog I O napdos Win GRAF demo project CSharp net_2008 demo demo_CSharp02 2 R W internal Boolean long integer Timer and Real floating point values napdos Win GRAF demo project CSharp net_2008 demo demo_CSharp03 Win GRAF User Manual V 1 01 Oct 2014 by ICP DAS 14 9 14 5 3 R W Real variable Functions Mi Get_REAL J Get_LREAL Description These functions are to get 32 bit REAL and 64 bit double from the Win GRAF Syntax UserShare Get_REAL System UInt16 iUserAddress out float iStatus UserShare Get_LREAL ByVal iUserAddress As System UInt16 out Double iStatus Parameter iUserAddress Address of Variable 1 to 8192 iStatus Get the 32 bit REAL or 64 bit double value Example float float_val double double _val Get 64 bit double value from the Win GRAF LREAL variable with address 7 UserShare Get_LREAL Convert ToUInt16 7 out double_val Get 32 bit REAL value from the Win GRAF REAL variable with address 8 UserShare Get_REAL Convert ToUInt16 8 out float_val Demo program CD ROM 1 R W analog I O napdos Win GRAF demo project CSharp net_2008 demo demo_CSharp02 2 R W internal long integer Timer and Real floating point values napdos Win GRAF demo project CSharp net_2008 demo demo_demo_CSharp03 Win GRAF
25. OK button IO Drivers MODBUS Slave Mame Value MODBUS Slave Protocol a fs lz zf Slave number Server D 4 PAC Time Wariables LD1 10 Drivers 4 Click the Insert Slave Data Block button on the left side to open the MODBUS Slave Request window IO Drivers fg Gl Mg MODBUS Slave SE Server Slave number 1 Slave number g Server ID i Tips F 1 Press the F1 key to open the Help on this subject g 2 If you add two or more Server settings type a Server ID for easier use a string e g SVR1 Ee J Request Address Nb Item Description 4 gt PAC Time Variables LD1 10 Drivers 5 Enter a simple note in the Description Ealan 11RA erg at ptr field and then click the Input Registers Request option Description For Modbus Master to Read data Options Data types Enter a simple note Input bits BOOL Input Bits puekeeigg oO NON K Registers REAL etc SENG eines For Modbus Master to Write data O Cail Bits Holding Registers Data types Recommend to set Coil bits BOOL Data block a Base address to 1 Base address and set the value of Nb items is greater Data read by the master Holding BYTE INT DINT Registers REAL etc Refer the Appendix A to see more data type Mb items than 200 Win GRAF User Manual V 1 01 Oct 2014 by ICP DAS 3 2
26. PAC Year PAC_Month PAC Day PAC_WeekDay PAC Hour PAC Minute PAC Day PAC VWeekDay PAC Second are declared as PAC Haut DINT PAC Minute PAC Second If want to adjust the Win GRAF PAC time you can use TIME_SET Function Block Refer the Section 2 3 6 First fill the new time to the variables of new_Year new_Month new _Day new_WeekDay new_Hour new_Minute and new_Second then set the Set_new_time to TRUE one time Set TRUE to set new time Set_nevw_ time Inst_TIME_SET Set TIME SET new time for the PAC neve Year Set_new_time is declared as BOOL new_Year new_Month new_Day eee new_WeekDay new_Hour new Day new_Minute new_Second are declared as DINT new Hour new Minute new Second Set TRUE to set news time Set nev time R I Win GRAF User Manual V 1 01 Oct 2014 by ICP DAS 10 13 Chapter11 Commonly Used Tools and Useful Tips 11 1 Upgrade Win GRAF Libraries Users can download the latest version of Win GRAF libraries Win GRAF Lib e g win graf lib x xx zip from http www icpdas com root product solutions softplc based _on_pac win graf download win graf driver html The Win GRAF Libraries Including Function Function Block and I O Board definitions are saved in the folder of ICP DAS XP WP VP under the directory of C Win GRAF DATA HWDEF In some situations you need to upgrade the Win GRAF Libraries to the new version for supporting
27. Refer the Section 2 3 4 Section 2 3 5 Win GRAF User Manual V 1 01 Oct 2014 by ICP DAS 3 10 Chapter 4 Linking I O Boards This section lists the usage of the I O Boards function in the Win GRAF Workbench to link the Real I O modules or to enable other I O functions First you need to know the slot numbering and supported I O modules for each PAC Slot No from the PAC Model eE NE The supported PAC I O modules WP WP 8x8 0to7 to 7 Supported XP 8x48 CE6 aes I 8K and I 87K series High Profile I O modules 1to7 M T XP 9x48 CE6 E E g l 8017HW and I 87055W Not Supported VP C oa l 8K and I 87K series Low Profile I O modules VP vp 4138 000 j E g l 3017H and l 87055 Palm size PAC it can support one XV board E g XV107 XV116 XV308 etc WP 5xx8 The XV board belongs to the Modbus slave I O board Refer the Section 5 1 6 to 5 1 12 for using XV boards The XP 8048 CE6 is the O slot PAC Refer P1 1 for all PAC models Add the I O board I O board refers to the I O functionality in the Win GRAF e g i_8037_DO and I O module refers to the hardware device e g I 8037W Notice Besides the software setting for the I O board there are some kinds of I O modules need to set the hardware Jumper e g Single ended and Differential Jumper So go to the website to look up the product information or the description printed on the module cover
28. eee Ma Konoe E gt lt gt Notice The value of the Offset starts from 0 but the Modbus address of the variable is the Offset value plus 1 Base address If set the Operation to Error report the Offset value of the variable Data Type DINT must set to 0 MODBUS Master Request x Request Description Severn a The Net ID of the Slave Unit MODBUS Request ET 7000 is fixed to 1 lt 1 gt Read Coil Bits a Data block Base address 1 i z Start from the address 1 Hb items 6 to read 6 items Activation gt A Periodic Onca Read once every 50 ms J u On change ae If error occurs wait 5 s to send the next commend Misc Timeout 500 _ms hb trial F 7 If no responds in 500 ms means error rials Win GRAF User Manual V 1 01 Oct 2014 by ICP DAS 5 45 2 Double click the second Data Block lt 15 gt Write Coil Bits to open the setting window Workspace IO Drivers Ll Ae 1 demo_ET7060 E p MODBUS Master si T Name Type Bj C Exception programs 3 G Open MODBUS 192 168 1 128 502 ET7060 DI 02 BOOL E L Programs a o HAB lt 2 gt Read Input Bits 1 1 6 K ET7060_DI_03 BOOL oe GE Main L SRi lt 15 gt Write Coil Bits 1 1 5 ni ET7060_DI 04 BOOL A ia aan for debugging Symbol pee N orel katlama ET7060_DI_05 BOOL oe Fi ET7060_RL_00 Data exchange OO RE baa p eus BiT a VIOE fe ET7060_R
29. product solutions softplc based on pac win graf download win graf driver html to begin the process Mirik A F mp ver 1 01 exe Win GRAF Setup ICP DAs CO LTD 2 Click Next to continue and then select I accept the agreement then click Next to continue Setup Win GRAF Ses Welcome to the Win GRAF Setup Wizard This will install Win GRQF version 1 01 on your computer It is recommended that you close all other applications before continuing Click Next to continue or Cancel to exit Setup setup Win GRAF License Agreement Please read the Following important information before continuing Please read the Following License Agreement You must accept the terms of this agreement before continuing with the installation Welcome to the Win GRAF setup program Cancel The Win GRAF is a ICP DAS software Ib supports only hardwares PAC PLC controllers produced by ICP DAS WARNING This software is protected by copyright law and international treaties Unauthorized reproduction or distribution of this software or any portion of it may result in severe civil and criminal penalties and will be prosecuted to the maximum extent possible under law Cancel Win GRAF User Manual V 1 01 Oct 2014 by ICP DAS 1 7 3 Recommend to use the default installation path i e C Win GRAF and then click Next to continue S
30. 01 it follows the setting of Default Value Schedule 1 Boolean Integer OFF 100 ON 150 OFF 120 ON 150 OFF Co OFF OFF OFF OFF OFF OFF 0 0 0 0 0 0 0 0 0 0 Pave and emit Win GRAF User Manual V 1 01 Oct 2014 by ICP DAS 17 20 17 5 6 Save and Send to the PAC When complete the configurations please save and then send it to the PAC xe d 2 F ER AA testl txt L test2 txt test3 txt x i H 4i H i m gE amp FREE C ca FUBREE D cy FREE E Ga My Gladinet Cle _ e TT i FERE log ties txt i FRANA 2 Click Send to Controller to send the configuration file to the linked PAC Please assign the PAC IP address and set up the password Check the Remember password can save the password for speeding the next sending process a Controller info IP 192 168 75 101 PAC IP address Password 1J Remember password e Cee Win GRAF User Manual V 1 01 Oct 2014 by ICP DAS 17 21 17 5 7 Time Synchronization If the PAC has not synchronized the system time after working a long period e g one year the time may be differ over 10 seconds to a few minutes For the time synchronization of the controller the Schedule Control Utility provides a function to set the PAC time from the PC a Schedule Control Utility 1 Your PC must connect to an Ethernet Switch and then to the Win GRAF
31. 2 with 4 DI and 5 Relay output channels Inst D 7065 A yY Name i Re TER Type Dim re fa Global variables n ni DI 1 BOOL Fe BOOL bel BOOL i sa BOOL DES BOOL Q i BOOL DI_4 BOOL a BOOL BOOL po i BOOL v lt gt a Declare 9 BOOL variables D_7063 remote i 7063 4 M DI amp DO of the l 7065 D_ 7065 remote i 7065 D_ 7066 temote i 7066 a SEE MN FORF iranata imne med ASML gt 4 gt Blocks Sovlist Define ENUM gt Mains Variables Input Parameters EN Data type BOOL TRUE enable it FALSE disable it Port Data type DINT COM port number can be 1 to 37 depends on PAC Must use a constant value cannot be a changed value Addr Data type DINT The Net ID address of the module can be 1 to 255 Must use a constant value not a changed value RL_1 RL_5 Datatype BOOL 5 Ch DO values Output Parameters OK Data type BOOL TRUE Communication is Ok FALSE Communication failed IN 1 IN_4 Datatype BOOL 4 Ch DI values Win GRAF User Manual V 1 01 Oct 2014 by ICP DAS 8 5 8 2 2 D_ 70182 Function Block D_70182 Connect a remote I 7018Z module that is a 10 channel Thermocouple analog input module for measuring voltage current or temperature with features of individual channel configuration open wire detection and over Voltage protection Note 1 All connected DCON I O modules should be con
32. 2014 by ICP DAS 4 12 4 6 i exist Test if the I O module exists The i_exist is used to check if the I 8K and I 87K series I O modules exist in the PAC s slot 0 to 7 See the Chapter4 P4 1 to add this I O board 1 Mouse double click the description i_exist to open the Properties window and then to see the setting Note Using the Slot 8 or above No because the slot 0 to slot 7 are reserved for the real I O module EEE 140 Boards Setting Description Test if Oxxx W and 8 xxx io boards in the slot O thru exist or not i_exist 8 ch boolean inputs represent the board state in the slot O thru 7 True exists FALSE board not found 2 After linking the i_exist in the I O Boards window it will auto add 8 BOOL input variables in the Variables window and display the state of the I O module from slot 0 to slot 7 when connecting the Win GRAF PAC TRUE means the I O module exists FALSE means can not find this I O module Variables i MX WF Name Type Dim Attrib Syb Init value User Tag Description IX9 i exist A 0 pi np You can change the variable oxo 2 name by double clicking it XI See the Section 4 1 HI 4 Input E 1x9 5 BOOL Input LI IXT B BOOL Input E wlKI 7 BOOL Input L a lt gt Win GRAF User Manual V 1 01 Oct 2014 by ICP DAS 4 13 4 7 i_8084 Frequency UP Down Counter UP Counter
33. 33 36 F Y310_ DO 1 BOOL iil Soft Scope F lt 16 gt Write Holding Registers 1 33 M will x 310_ DO 2 BOOL s E Initial values XV310_D0_3 BOOL Ajd Binding Configuration HE Symbol Besistion Offset Man elk ee x V310 DIO BOOL fg a amp 310_D0_0 Data exchange 0 FFFF Default oe 9g Global defines c5 AVSIO_DIL1 BOOL SA V310 D01 Data exchange 1 FFFF Default i v D A Variables MAA MT BAM Tubes as 310_D0_2 Data exchange 2 FFFF Default Li LI ka E xv310_D0_3 Data exchange 3 FFFF Default Neme Value c 7 gt ir MODBUS Master Request x Request Description Slave Unit 1 The Net ID of the Slave device i e XV board MODBUS Request MITE An TAE asi E write single coil bit lt 6 gt Write sin er En Usitn Unltinn Manickae i Write DO data Data block Base address t Nb items 4 Start from addr 1 and write four data Activation Periodic 0 O On call fon error On change Write only when data changed Misc n Timeout 100 An exception occurrs if no Nb trials 1 respond for 100 ms 3 Mouse double click the 3rd data block i e lt 2 gt Read Input Bits to view the setting window Workspace f 10 Drivers HAA C demo_X 310 E Ma MODBUS Master A T Name Type H J Exception programs 3 3 G ATU COMO 115200 N 8 1 310 DOO BOOL G L Programs i o H AB lt 4 gt Read Input
34. 5 Type DINT Refer the Sectin 2 3 1 for the way to declare variables and the figure below shows defined variables Yariables Name Dim Attrib fo Global variables Bool 01 BOOL Bool 02 Bool O35 Bool 04 Bool O05 Bool Ob Bool OF Bool 08 Bool 09 Bool 10 Bool 11 Bool 12 Bool 13 Bool 14 Bool 15 Bool 16 i ax Spb Initvalue User Tag Description gt Bool 16 Status Bool 16 BOOL Status DIMT See eee eee eee eee 4 Id Drivers Wariables lt 3 Inthe IO Drivers window like the figure below drag all required variables in the Variables Area i e Bool _01 to Bool _16 and Status and drop them to the Symbol area in the first data block Note The Status is an array variable so the Status O to Status 4 will show on the Symbol area Click the Del key to delete the Status 1 to Status 4 4 Next select Offset field from Boo 01 to Boo _16 and then click the Iterate Property button on the left side to set the Offset value From 0 By 1 refer the Section 3 1 Step8 Win GRAF User Manual V 1 01 Oct 2014 by ICP DAS 5 4 5 Inthe Operation field set the Status O as Error report which means the return value is an Error Code if a read error occurred and the value will be reset to O if read successfully tO Drivers AS E E Mp MODBUS Master Name Val
35. 8088 DutyO 0 5 REAL B Watch for debugging i8088_Run0 TRUE Start FALSE Stop 8088 Cnt0 1 DINT a Soft i8088_Statel Current State 8088 RunO BOOL i8084_freqO 0 frequency chO of 8084W 9086 StateO BOOL g Newey il RETAIN variables d s g IX1 i 6088 3g Global defines W ID2 i 8084 freq a Variables ID2 0 i60 0 DINT KE Types ID2 1 0 DINT 1D2 2 0 DINT 1D2 3 0 DINT ae z gaa gt 14 gt Main Variables NewSpy1 me iz z x Now set the i8088 RunO as TRUE to start the PWM output At this time the i8088 State will change from FALSE to TRUE and output a PWM signal to the I 8084W module and then the value of the i8084_ FreqO will change from O Hz to 100 Hz PAE EE ARENE eee ee eee H Ws eG GE sq OS 4 Al RUN Magu Workspace COO NewSpyt spl aa H D demo_8088w RUN Name Value Description Y Name ss Value Type H Exception programs si i8088_Fregq0 100 Init 100 Hz a i Global variables a Programs i8088_DutyO 0 5 Init 0 5 50 9066 Freqd 100 DINT Ae Main a i8088 Cnt0 1 Init 1 Continuous mode is088 DutyO 0 5 REAL a Watch for debugging TRUE Start FALSE Stop i8088_Cnt0 1 DINT BF Soft Scope i8088_State0 TRUE Current State is086 RunO TRUE BOOL oo EN Initial values i8084_freqO 100 frequency chl of i B084 W i9086 StateD TRUE BOOL Bd NewSpyl 2088 Run A ld RETAIN variables Ajd Binding Configuration z a g 1 i 8088 3g Global defines W ID2 i 608
36. Att a Phy V is declared as REAL array with Dim 8 S ag STI Data Conversion Eng V is declared as REAL array with Dim 8 i DINT IF z p Phy V REAL 0 7 E for ii 0 to 7 do Eng_V REAL 0 7 o f Global variables Using conversion function 2 to convert an OUTI BOOL ed b 1 engineering value to a physical value lt gt Phy Viii Convert t Phy 2 Eng V ii E E All E ii is declared as DINT variable aS Phy_V is declared as REAL array with Dim 8 4 gt atiables Md Eng Vis declared as REAL array with Dim 8 for ii O to 7 do Using conversion function 2 to convert an engineering value to a physical value Phy_V ii Convert_to_Phy 2 Eng_V ii end_for Win GRAF User Manual V 1 01 Oct 2014 by ICP DAS 10 3 10 3 Data Type Conversion When different types of data want to do calculation or gt lt lt gt lt gt not equal operation or when the variable types of the parameters in the function are different you must first use the type conversion function in the following table to convert them into the same data type then can use the data normally Data Conversion Ros Data Conversion ee Descriptions Descriptions Functions Functions ANY_TO_BOOL Convert to Boolean ANY_TO_REAL ANY_TO_SINT Convert to Short Integer 8 bit ANY TO _LREAL Convert to Double ANY_TO_INT Convert to Integer 16 bit ANY_TO_STRING Convert to Long
37. Byte iStatus 0 Get the value of Win GRAF BOOL variable with address 1 UserShare Get_ BOOL Convert ToUInt16 1 out iStatus Demo program CD ROM napdos Win GRAF demo project CSharp net_2008 demo demo_CSharp01 Win GRAF User Manual V 1 01 Oct 2014 by ICP DAS 14 7 14 5 2 R W Integer Functions Mi Set SINT W Set_INT W Set DINT Set LINT Description These functions are to set 8 bit Integer 16 bit Integer 32 bit integer amp 64 bit Integer value to Win GRAF integer variables Syntax UserShare Set_SINT ushort iUserAddress sbyte iStatus UserShare Set_INT ushort iUserAddress short iStatus UserShare Set_DINT ushort iUserAddress int iStatus UserShare Set_LINT ushort iUserAddress long iStatus Parameter iUserAddress Address of Variable 1 to 8192 iStatus Set the 8 bit Integer 16 bit Integer 32 bit Integer or 64 bit Integer Example Set a 32 bit integer value 1234567 to the Win GRAF DINT variable with address 1 int temp1 1234567 UserShare Set_DINT Convert ToUInt16 1 temp Set a 16 bit integer value 1234 to the Win GRAF INT variable with address 2 short temp2 1234 UserShare Set_INT Convert ToUInt16 2 temp2 Set a 64 bit Integer value 123456789012345 to the Win GRAF LINT variable with address 3 long temp3 123456789012345 UserShare Set_LINT Convert ToUInt16 3 temp3 Set a 8 bit Integer value 125 to the Win GRAF SINT vari
38. Ch 3 Filter 0 Ch2 3 Freq_timeout 1800 Ch2 3 Low High Auto 2 Ch4_5 Filter 0 Ch4 5 Freq_ timeout 1800 Ch4_ 5 Low High Auto 2 Ch6_7 Filter 0 l Ch6_7_Freq_timeout 1800 Ch6 7 Low High Auto 2 Min Update Interval 200 Signal Inverted 0 ChO 1 Freq timeout 100 x 3 After linking the i_ 8084 freq in the I O Boards window it will auto add 8 DINT input variables in the Variables window When the Win GRAF connects the PAC it will display the frequency value for each channel Variables He AB NOTE a tPe __Dim__Atb _Syb _Int vale_ User _Tag_Deseipton BB ID1 i na _freg Al a 0 Input You can change the variable D kas 3 on name by double clicking it J 1D1 2 DINT See the Section 4 1 ID1 4 DINT Input a Ly ID1 5 DINT Input LI 1D1 6 DINT Input LJ ID1 7 DINT Input LI vi lt ij Win GRAF User Manual V 1 01 Oct 2014 by ICP DAS 4 16 4 7 2 i_8084_cnt_ch04 4 channel UP Down Counter Note Using the COUNTER_START COUNTER_STOP COUNTER _GET COUNTER_STATE and COUNTER_RESET functions in the Win GRAF Workbench to operate counter channels in an I 8084W 1 Mouse double click the i_ 8084 cnt_ch04 to open the Properties window and then to see the setting description EE 140 Boards 0 8084_ecnt_O4ch E k 1 i 8084 cnt O4ch Properties 4 E 6 Chil_Mode 0 i Chl _ Filter 0 8 Ch2_ Mod
39. Chapter 13 VB net 2008 Program Running in WP 8xx8 Access to Win GRAF Variables This chapter lists the procedure for creating the first demo program by Visual Studio NET 2008 development tool There are some sample programs in the WP 8xx8 CD ROM VB NET example CD ROM napdos Win GRAF demo project vb net_2008 demo demo_vb01 Digital 1 0 demo with one I 87055W in slot 0 of the WP 8xx8 demo_vb02 Analog I O demo with one I 87024W in slot 1 one I 8017HW in slot 2 demo_vb03 Read Write Win GRAF internal integers timers amp real variables No 1 0 demo_vb04 Read Write Win GRAF internal String variables No I O Win GRAF example CD ROM napdos Win GRAF demo project demo_vb01 zip demo _vb02 zip demo_vb03 zip demo_vb04 zip 13 1 Add an Existing Win GRAF Project from a ZIP Please follow these steps to restore the Win GRAF project First Click File gt Add Exiting Project gt FromZip Then choose the Win GRAF project zip file which you would like to restore After restoring the project you have to build the project and then download it to the PAC View Tools Window Help pa EO New Project List Open Project List Ql Add New Project Print Setup LOW i GR AR Projects p vbOl wl 2 On OR ARP Projectswp_ vb0s wl 3 CAWin GRAFProjectswp_yb02 w5l EHD gt f ea d Oin GE AF FrojecthICP PDAS template w5 5 O CSharp net_2008_demo 3 vb net_2008_demo fit Exit C ezm
40. GH Hame Value Description H C Exception programs re Hour 12 A Programs Minute 35 ae PAC Time H Second SE RDN contral a The Main PAC is active t Retain and timer C Watch for debugging is_ Main_ready TRUE The Main PAC and Backu p PAC AF Soft S is_ Back d TRUE fa Soft Scope 7 are ready and their LAN1 are Initial values is_first_cycle_just_ather_ switch is Main LANT ok TRUE working properly Ed NewSpy oli Binding Contiquration is Backup LAN ok TRUE vs ag Global detines is_ Alte port_ok 7 Variables is_ Passive_ready The Alive Port RS 232 E Types is_Active_LANT_ok communication is ok Slat Eee EG The Passive PAC is ready DINT_1 0 F er e j The Active and Passive PAC s ie REAL 1 o o LAN1 are working properly gi FEAL 2 0 0 TMA_1 HHO TMA _1_last_ state FALSE TRUE ticking FALSE sleep To_tick_ TMAR_1 LSI Set TRUE to start ticking timer To_stop_TMA_1 FALSE Set TRUE to stop the ticking of timeri TMA_2 HHOs TMA _ _last_state FALSE TRUE ticking FALSE sleep To_tick_TMA_2 PALS Set TAUE to start ticking timer To stop TMA FALS Set TRAUE to stop the ticking of timers 6 Enter values for DINT_1 DINT_2 REAL_1 and REAL _1 variables and then set the To_tick_TMR_1 and To_tick_TMR_2 as TRUE it will auto reset to FALSE to start the TMR_1 and TMR_2 ticking Now the status of TIMER will change from FALSE to TRUE DIN T 1 Setup as Retain vari
41. I Watch for debugging PAC Hour a i PAC WeekDay DINT GR Soft Scope PAC_Minute a PAQ Hour DINT fs NewStructure PAC_Second yA PAC _Minute DINT F Initial values INT_Val _ PAC Second DINT henee E REAL Val INT_ al INT BS NewSpyl REAL al g Binding Configuration EJM m i J i g Global defines E r LD1 PAC Time Variables NewSpy1 5 When the Win GRAF and the PAC are connected the NewSpy1 window will show the variables information clearly File Edit View Insert Project Tools Window Help MAR BE ae ME EE kee eer a a g al Mas uh Workspace aan a A x gt DemoO1 RUN TE Y Name Value Jp Dim Attrib A 3 Exception programs g 5 t Global variables Programs PAC Month PAC Year 2014 DINT HE PAC Time Get Set P EH PAC_Day PAC Month 6 DINT o 8 LD1 Blinking PAC WeekDay PAC Day 13 DINT Watch for debugging PAC Hour PAC WeekDay 5 DINT i Soft Scope PAC_Minute PAC_Hour 5 DINT 8 NewStructure PAC_Second PAC Minute 13 DINT EJ Initial values INT_Val PAC Second 0 DINT L E NewRecipel INT_Val 0 INT Val INT 0 2 Sg TE INT_Val 1 REAL Val REAL 0 3 A Binding Configuration INT_Yal 2 new Year 0 DINT 39g Global defines REAL_Val new Month 0 DINT t Variables REAL Val 0 5 new Day 0 DINT BA Types REAL Val 9 new Hour 0 DINT REAL _Val 2 new Minute 0 DINT a REAL Val 3 Pe Capan m MIRIT ata 4 gt LDI PAC Time Wariables NewSpyi Win GRAF
42. Q as FALSE if the value is NaN Not a Number or other error happens In the case of NaN the REAL LREAL variable will get the value 0 0 6 3 2 EEP_WRITE Write a Value to the EEPROM EEP WRITE Q Addr Data Type DINT Address can be 1 to 1200 If the variable type of the Value parameter is a 64 bit data e g LINT or LREAL the Addr can be 1001 to 1200 only Value The value to write to the EEPROM DO NOT use string variable The value type can be BOOL SINT USINT BYTE INT UINT WORD DINT UDINT DWORD REAL TIME LINT or LREAL Q Data Type BOOL TRUE Ok FALSE Error Win GRAF User Manual V 1 01 Oct 2014 by ICP DAS 6 12 Chapter 7 Exchange Data between PACs Data Binding Binding function is used to exchange data between ICP DAS Win GRAF PACs the data transmission is event triggered It is much more efficient than polling way Win GRAF offers two ways to set up Binding PUBLIC Publish one PAC s own data or for use of VB net CH C or Soft GRAF HMI in the same PAC EXTERN To get data from other PAC Application Diagram PUBLIC Note The max number of Binding EXTRN can be PUBLIC F p EXTERN used by one Win GRAF EXTERN a PAC WP 5xx8 PUBLIC EXTERN rar XPAC Max 32 WinPAC Max 16 ViewPAC Max 16 WP 8xx8 VP 25W8 waag See P1 1 for details EXTERN PUBLIC XP 9xx8 CE6 1P1 1P2 XP 8xx8 CE6 Redundant Binding PUBLIC Setting Steps
43. There is one Win GRAF PAC CD in the Win GRAF PAC package box The Schedule Control Utility file name is Schedule_in_PC exe in the CD napdos Win GRAF Tools_Utility path Please copy this Schedule Control Utility Schedule_in_PC exe to your PC Recommend to copy it to the directory of your Win GRAF project For instance copy it to D Schedule Control Station1 Schedule_in_PC exe then run this Schedule_in_PC exe file Then we will see the following windows Click New gt Target 1 ep Schreck Conte Utity Ski j 3 Lee Smd amp Loto Lonnie tas eye beezeore gen foes Gn Gren Ouma Te Te Target 1 Target 2 Target 3 Ba le w HET nakbncicns Makoval day ae a e z ral ae ert i roet 5 Dries Pains Target 4 Target 7 Dish Liah Tata i There is one another Schedule control utility however it is set up in the PAC not in the PC It is Schedule_in_PAC exe You can find it in the System_Disk Win GRAF path of the Win GRAF WinCE PAC Win GRAF User Manual V 1 01 Oct 2014 by ICP DAS 17 2 Restore Win GRAF demo project The Win GRAF demo project for the Schedule Control is demo_schedule zip It is in the napdos Win GRAF demo project path of the Win GRAF PAC CD Restore it to the PC Win GRAF workbench by the following way A Win GRAF File View Tools Window Help i New Project List Open Project List gt EI i Add New Pr
44. User Tag Description Qh Global variables A RETAIN variables DCON Win GRAF User Manual V 1 01 Oct 2014 by ICP DAS 8 3 8 2 Using I O Function Blocks The Win GRAF supports many ICP DAS DCON remote I O modules you can open the Library Manager Refer Section 1 2 3 or press F1 key in the Function and FBs to view these I O Function Block descriptions This section will introduce D_ 7065 D_ 70182 D_7083 D_87084_ freq D_87084_cnt4 D_87084_cnt8 and DL_100T485 I O Function Blocks Wi Library Manager ICP DAS XP WP P File Wead Help Os Profiles AS i ll Types Function and FBs DXO s D 7005 emote i7005 l Py gD_7O11 remote 1 7011 7011D 7011P 7011PD mD_7012 remote 1 7012 7012D 7012F 7012FD oT ININ TM a ta ed UL AN nee eae INI INANI INIANT IWN1ATh we M ttt Function Block A Input parameters EN BOOL TRUE enable it FALSE disable it Port DINT COM port number can be 1 to 37 depends on PAC Must use a constant value not a changed value Addr DINT Net ID address of the module can be 1 to 255 v In the LD Program Functional Block area expand the ICP DAS XP WP VP folder of the Blocks panel There are many Functions and Function Blocks You can select the desired one and drag it into the editing area of the program Main H A x I 7
45. UserShareNet dll and Quicker dll The UserShareNet dll and Quicker dll can be copied from the Win GRAF PAC s System_disk Win GRAF path Win GRAF User Manual V 1 01 Oct 2014 by ICP DAS 13 7 13 5 UserShareNet dll This section we will focus on the description of the application example of UserShareNet dll functions There are some functions that can be used to read write data from to the Win GRAF soft logic The functions of UserShareNet dll can be divided into as listed below 1 R W Boolean 2 R W 8 bit Integer 3 R W 16 bit Integer 4 R W 32 bit Integer 5 R W 64 bit Integer 6 R W 32 bit Float 7 R W 64 bit Float 8 R W String X Refer the Appendix A to get familiar with the definition of Win GRAF variables 13 5 1 R W Boolean Functions Mi Set BOOL Description This function is to set a value to a Win GRAF Boolean variable Syntax UserShare Set_BOOL iUserAddress As System UInt16 ByVal iStatus As byte as Byte Parameter iUserAddress Address of the Variable 1 to 8192 iStatus Set the status For instance iStatus 1 for True iStatus 0 for False Example Set the Win GRAF BOOL variable with address 1 to True UserShare Set_ BOOL Convert ToUInt16 1 1 Demo program CD ROM napdos Win GRAF demo project vb net_2008 demo demo_vb01 Win GRAF User Manual V 1 01 Oct 2014 by ICP DAS 13 8 Mi Get BOOL Description This function is to get the value from a Win GRAF
46. XV board lt 2 gt Read Input Bits lt 3 gt Read Holding lt 4 gt Read Input Registers AE Leike areal r bib Data block Base address Nb items Start from addr 1 and read eight data Activation Periodic on call On change Misc Timeout An exception occurrs if no Mb trials respond for 100 ms Win GRAF User Manual V 1 01 Oct 2014 by ICP DAS 5 28 2 Mouse double click the 2nd data block i e lt 2 gt Read Input Bits to open the setting window Workspace 4 demo_X 308_1 al E Exception programs G C Programs a Watch for debugging toll Soft Scope L E Initial values Ajd Binding Configuration 9g Global defines at Main fat Variables Types E Mg MODBUS Master Name Type ga ATU COMO 115200 N 8 1 xYV308_ AL INT n B E B lt 4 gt Read Input Registers 1 1 8 xv306_status DINT CE DR lt 2 gt Read Input Bits 1 33 40 a XY308 DIO BOOL Symbol Operation Offset Mask Storage yore Seis g 2v 308_DI_0 Data exchange 0 FFFF Default ac i a V306 DIS BOOL z xv 308_DI_1 Data exchange 1 FFFF Default TRE i xXV308_DI 4 BOOL za amp 308_DI_2 Data exchange 2 FFFF Default 6 Y308 DIL 5 BOOL V 308_DI_3 Data exchange 3 FFFF Default XV308 DIL6 BOOL g x 308_DI_4 Data exchange 4 FFFF Default 308 DI BOOL F xv 303_DI_5 Data exchange 5 FFFF Default am
47. a Address 1 v Va Word 2 WORD Operation Offset Mask Storage Range ff WORD Data exchange 0 FFFF Default es G Word_1 Data exchange 0 FFFF _ _Defauk 7 aa Word 2 q Data exchange 7 T FEFF Default N Se Word_3 Data exchange 0 FFFF Default Pinata ay Word _4 Data exchange 0 FFFF Default f gt gt 10 Drivers Variables lt A Win GRAF User Manual V 1 01 Oct 2014 by ICP DAS 5 40 8 Set the Operation of the Status 0 to Error report If reading data fails its value is an Error Code when reading data OK it will reset to O Press F1 key to view the setting descriptions for the Modbus Master In the title of Status and command variables you can find the details about this commend and Error Code 9 Select Word_1 Word_4 and click Iterate property to set up the Offset value From 0 By 1 IO Drivers E Mo MODBUS Master Name Value BA Sg Open MODBUS 192 168 1 100 502 Request lt 4 gt Read Input Regist LA B lt 4 gt Read Input Registers 1 1 4 Slave Unit 1 H Address 1 _ Nb Item 4 E Activation Periodic F Period ms 1000 Period on err 15000 c5 Timeout ms 1000 Number of tri 1 Description Operation Offset Mask Storage T Range fl Error report FFFF Default Data exchange Data exchange Data exchange Results ___Dataexcha
48. are 32 bit variables and require two Modbus addresses So set their Storage column as DWORD Low High IO Drivers i i xX E amp Mp MODBUS Master Name Value Dim 2 S ar ATU COM2 9600 N 8 1 Request lt 4 gt Read Input Regis B B lt 2 Read Input Bits 1 1 16 Slave Unit 3 BB lt 5 gt Write single coil bit 2 1 Address 1 gt 4 gt Read Input Registers 3 Nb Item 10 z Activation Periodic Fe Period ms 1000 q Period on err 15000 c5 Timeout ms 250 Number of tri 1 at Description Symbol Offset Mask Storage Word_4 Data exchange 0 FFFF Default Word 5 Data exchange OL FEF Brefault 7 Word 6 Data exchange D FFFF Default Long_1 Data exchange 0 FFFF Real_1 Data exchange 0 FFFF DWORD Low High Status 2 Error report FFFF Default oO i4 gt 10 Drivers Variables Win GRAF User Manual V 1 01 Oct 2014 by ICP DAS 5 9 vi 6 As the figure below select the Word_1 to Word_6 and then click Iterate property to set their Offset value From O By 1 Operation Offset Mask Storage Data exchange s FF Defa A Data exchange Data exchange Word _4 Data exchange Word 5 Data exchange Word 6 Dataexchange fa lt s Results 4 i Bl 10 Drivers Variables L OK WI Cancel 7 Next double click the Offset field of Long_1 and Real_1 items an
49. ee xv308 i ih 115200 Disable N 8 1 Modbus RTUJ8 AI 8 Uni Double click COM O N 8 1 Address 1 01h Baud Rate 115200 Checksum Disable 5 Inthe Configuration tab set the Data Format as Engineering Format recommended setting set the Fast Mode as Fast Mode and uncheck the Reverse DI State INIT XV3O06 Firmware A102 eee d Configuration PALAI Alarm DO Alarm Host WDT DI About ProtocolfINit Modbus RTU 7 Address 1o 01H Baud FateINIT 115200 7 Parity INIT 3 Ho 1 None Parit Checksum INIT Disable Data Format Engineering Forn x Fast Mode Fast Mode Response Delay Set Module Configurations Win GRAF User Manual V 1 01 Oct 2014 by ICP DAS 5 17 6 Inthe Al Al Alarm tab to configure the proper ranges and values for each Al channel and remenmber to select any Al channel e g CH 00 you want to use then click the Set Alarm button XV308 Firmwvare A102 Configuratidg AI AL Alarm Do alarm Host WOT pt About High Alarm Limit Low Alarm Limit 9 Alarm Mode 7 ch o0 00003 000 003 fioe 10v io ho Disable v cH o2 00052 00 0052 ffosj asvix 2s fas Disable cHio4 00022 000 022 00 20 me Disable cH os 00005 000 005 fios 10v eio sd Disable cHos 00006 000 006 fios 10v eio Disable lM cH o7 00001 000 001 fio 10v elio sd Disa
50. i PAC_Minut Ga mcuanead PAC Seco Arithmetic E io v m gt 4 Blocks Sovlist Define ENUM 4 PAC Time ariables LC 1 Demoli 192 168 71 19 502 H Time Event description RON 1 2000 01 01 00 15 21 000 Board error in the slot Mo 1 ae ane 2 2000 0101 00 15 29 000 Board error in the slot No 1 e 0 Al 2000 01 07 00 15 37 000 Board error in the slot Mo 7 haximurm 36 Overflow 0 Local application 4 F Build Cross reference Runtime 23 stack breakpoints Digital sampling trace Prompt Hr When doing the On Line al operation it will automatically switch to the Runtime tab and you can see if there is any error message for the downloaded program E g in this example we need to plug the I 8055W module in the Slot1 of the PAC and the message Board error in the slot No 1 means there is no I O module in the Slot1 or an I O exception Shutting down the PAC and plug one I 8055W module in the PAC s Slot1 then reboots Then click On Line al button to connect to the PAC Demoli 192 166 71 19 502 E H Time Event description RUM Cycle time ms Last 2 Allowed 0 Maximum 36 Overflow 0 Local application 4 Build Cross references Call stack Breakpoints Digital sampling trace Prompt Hbl Win GRAF User Manual V 1 01 Oct 2014 by ICP DAS 2 21 2 3 6 Testing the Program In the previous section you have successfully downloaded the Demo01 project and
51. setting window Win GRAF User Manual V 1 01 Oct 2014 by ICP DAS 5 32 Workspace J 10 Drivers H E E demo_X 308_3 E El Mg MODBUS Master A SF Name Tyre Lj Exception programs ga ATU COMO 115200 N 8 1 AV308_Al INT Gal Programs H t lt 4 gt Read Input Registers 1 1 8 AV308_status DINT 7 ae Main B BEI lt 15 gt Write Coil Bits 1 1 4 as AVS08_DO_O BOOL Watch for debugging H B lt 2 gt Read Input Bits 1 33 40 v xv300_DO_1 BOOL Al Soft Scope LD nisl veo 1 Symbol Operation Mask Storage Offset 0 1 2 3 xV308_DO2 BOOL xV308_DO3 BOOL wi Raitt l fe X 308_D0_0 Data exchange FFFF Default i Y e _ XV308_D0_1 Data exchange FFFF Default ara k paR y 39g a al delmes Gp xv308_D0_2 Data exchange FFFF Default gt B me g ei ie Data exchange FFFF Default EEEE r Workspace 10 Drivers ra C demo_X 308_3 E Mg MODBUS Master ame Type Exception programs a Elway ATU COMO 115200 N 8 1 AV308_DO_1 BOOL Programs q Fl lt 4 gt Read Input Registers 1 1 8 7 AYSUB DO 2 BOOL O ho E Man B eB lt 15 Write Coil Bits 1 1 4 v306_D0_3 BOOL von C Watch for debugging 2 H B lt 2 gt Read Input Bits 1 33 40 Avona D4 BOOL _ at State g Symbol Operation Offset Mask Storage eee Wee asta 1 Initial Wales svaga DI Bi BOOL i 914 Binding Corfigurat F ava0e_Dl_4 Data exchange 4 FFFF Default O08 DIF BEDOL
52. t5 cod GF Wwin_GRAF_WP_S000Ink Win GRAF User Manual V 1 01 Oct 2014 by ICP DAS 6 10 6 3 Save Data to EEPROM The Win GRAF PAC has a built in EEPROM memory for users to read and write data which will not lose data when the PAC shut down Compared to the read and write of the SRAM EEPROM has the following disadvantages Note Some PAC have no EEPROM memory like the WP 5238 WP 5248 They don t support EEP_Read and EEP_Write Advantages Provides another way to save the important data besides the Retain Variable Section 6 1 Disadvantages 1 The operation to read write EEPROM will use much more CPU time about 5 50 ms but changing to the way of Retain variable CPU time is much less than 1 ms Therefore do not use the EEP_Read and EEP_Write Functions too frequently or it will increase the PAC Cycle time 2 EEPROM has a write limitation depending on the PAC it is not suitable to write the same data many times So DO NOT call EEP_Write Function within each PAC Cycle to do the write operation ST Program Following will show the safe and dangerous coding ways Declare FIRST CYCLE as a BOOL variable and has an initial value TRUE Declare tmp_bool as a BOOL variable Declare New_Val and Old_Val as DINT variables Read the EEPROM once in the first Cycle if FIRST CYCLE then FIRST CYCLE FALSE means it is not the first Cycle any more tmp_
53. 000 Q Data Type BOOL TRUE Ok FALSE Error Note 1 One Addr can accept only one variable or one element of the array DO NOT assign the same Addr to two variables or more or the Retain Value will be wrong 64 bit data type LINT or LREAL can use only the Addr No from 10 001 to 12 000 Other data type BOOL SINT USINT BYTE INT UINT WORD DINT UDINT DWORD REAL or TIME can use the Addr No from 1 to 12 000 Win GRAF User Manual V 1 01 Oct 2014 by ICP DAS 6 3 6 1 2 RETAIN_ARY Retain an Array Variable RETAIN_ARY Q Tips Press F1 key to see the detailed setting descriptions Name An ARRAY variable name DO NOT use String Variable type can be BOOL SINT USINT BYTE INT UINT WORD DINT UDINT DWORD REAL TIME LINT or LREAL Addr Data Type DINT The starting address number for retaining the array variable can be 1 to 12 000 Num Data Type DINT The amount of elements in the Array variable to be retained For example If there are 100 elements in an Array variable set Num to 1 to 100 is correct but if set it more than 100 that is not correct If there are 5 elements in an Array variable set Num to 1 to 5 is correct but if set it more than 5 that is not correct Q Data Type BOOL TRUE Ok FALSE Error Note 1 One Addr can accept only one variable or one element of array DO NOT assign the same Addr to two variables or more or the Retai
54. 1 means the Y axis and 2 means the Z axis Value The data type can be DINT UDINT DWORD LINT and ULINT It returns the current counter or encoder value Refer the Appendix A for the range of values Q Data type BOOL Counting state TRUE Counting FALSE Stopped Win GRAF User Manual V 1 01 Oct 2014 by ICP DAS 4 26 4 9 4 COUNTER_STATE For example Using the I 8084W module in the PAC s slot2 and to get the counting status of the channel 5 ST program TMP BOOL Counter State 0 2 8084 5 Note First adda TMP_BOOL BOOL variable in the Variable Area LD program JENCOUNTER_STATE Gi Tips Press the F1 key for the details on settings S064 10 Mame Port Data type DINT For a module in the slot O to 7 of the PAC set it as 0 Fora DCON module connected to a serial COM port can be 1 to 37 depends on PAC means COM1 to COM37 Addr Data type DINT For a module in the slot 0 to 7 of the PAC set it as the slot number 0 to 7 For a module connected to a serial COM port set it as the Net ID address of the module 1 to 255 lO_Name Data type DINT The name of relative Counter Encoder module it can be set to 8084 8093 87084 87082 7083 and 7080 Channel Data type DINT The channel No of the Counter Encoder module it can be set to 0 1 and so on depends on the module Fo
55. 1 3 Setting the Win GRAF PAC s IP AddresSS eesessenessersssresereesseresreressresereeseeeesserssssesseeeseeee 1 14 Chapter 2 A Simple Win GRAF Program s ssesessesessscoessscecessecsesoecescecesoecesoscessececssoecssoecesoesesceseeseo 2 1 2 1 Creating a New Win GRAF PrOj Ct su cevicsase cece sccsnieadans ved ses U TAA 2 1 2 1 1 Creating a Template Project DEMOOL iociciho cs cassconsiachvaactsconsianends sadaceantancrtuadaes 2 1 ZL IMportant Project SCTE SS wus sndceisisesivcdinw ines sveesvowssasvncesvan esa denned NaS 2 3 2 2 introduction Ofthe Oy Cb ec ct siete cisatews talacsert NE TREN OAS 2 5 22 Demo LLD PROS Gail 436 sc saucer eesiee Oia cawisedlensawe raed ssedenGoiw tle satis don dant otal eausveasaek eaaeees 2 5 222 WEMOO l V avlaOles ecvascesasiseecd exons Setsceai hex caries EATE 2 7 2 3 GWe It I TVer it erste en ied de T dc ares id vies ed TEE deve 2 8 2 3 1 Declaring the Win GRAF Project Variables ccccccsccccssececesseceseseceseeeceseescesseness 2 8 232 Dedlanne Tel OW Atle Sasa E 2 10 23 3 Credne am ED Rro AIM arani a a a male twaanatecwes 2 12 2 3 4 Compiling the ProglaMieereienr aenn a E ETET ATNA 2 18 23 9 D wnload the Program tO PAC econinkeanmiiannse E ENEN 2 19 230 Testine TNE Proe dM ennaa a R a a a series 2 22 Chapter3 Modbus Slave Allow the SCADA HMI Software to Access Win GRAF Variables 3 1 3 1 To Enable the Win GRAF PAC as a Modbus TCP Slave ccccssecccsssccceesceeeese
56. 100 CNT1 CNT1 1 if CNT1 gt 100 then CNT1 0 end_if end_if Win GRAF User Manual V 1 01 Oct 2014 by ICP DAS 12 8 12 2 2 Request Answer the Device by COM Port If an application needs to use RS 232 485 422 Port to get the data from other devices the steps are as the following request and answer Win GRAF PAC 1 Send a command to request the Device Device 2 Check if receive a complete query If yes reply an answer to the 3 Check if receive the complete reply If yes do the proper operations and wait for a while and then return to the step 1 to send the next command Win GRAF PAC 4 Wait for the next command and if receive a command then go to the step 2 Refer P12 1 to open the project demo_com_port2 zip and view add variables in the variable area Note Double click Action will first open a Notes window then click Action icon to see the code Win GRAF femo oom porti Bk Edit Yew met Port Toob Wmdov Help Wdy 3 aA H amp MEA j NA Workspace Main iJ deno com pait E lt lt Ue Step Action aj Exception progam a i hey ActioniP J Piog ams ie Fj Man ai Watch lo debuggrg WD Sot Scope EJ bia vaut ta Binding Con guaion gis if poct is not open open it t End Action 3 7 Ta7S0ue gt C Wa Veiis kalaki Er i Crore eeaeee Murire resi ports Cegte ewredens trace Prorat Hi Offline 192 168 71 18502 0 0 Cad etant
57. 128 4 132 BD 72 272 Descriptions poo o olo ojg Pp 1 fofolfot aie Ea on oe ee oe eae Oooo a eee E NOTE BCD code can only represent numbers from 0 to 9 It can not be used for these six 4 Jlo fjojo 5 Jo i o i z 5 6 Jo 1 1 o zv z 6_ T a a values 1010 1011 1100 1101 1110 1111 and will return 0 The function table below can be used for BCD Binary Coded Decimal value conversion T Function BIN TO BCD Convert Binary to BCD value BCD_TO_BIN Convert BCD value to Binary BIN TO BCD Svyw2 TRUE OUTI TRUE 1940 0001 1001 eco 1 2742 2 164 841 25 BCD_TO_BIN Svy2 TRUE OUT1 TRUE 33 10 0010 0001 2 21 8p 15 10 0000 4444 9 Osco You can open the HTML Help from the 4 S ues dard menu bar an i a H you want to see the detail setup MEN E PEN Q instructions RE 1 a Filtt 88 L BREEN BHE 3 e res IB FF BCD _TO_BIN IEC 61131 3 1 Type conversion functions IEC 61131 3 2 BIN_TO_BCD IEC 61131 3 3 Win GRAF User Manual V 1 01 Oct 2014 by ICP DAS 10 5 10 5 Pack Unpack Integer or Boolean Unpack Integer to Boolean If want to unpack one BYTE or USINT range 0 to 255 to 8 Booleans you can use UNPACK8 Function Block Inst_UNPACKs Aool_ 0 Inst_LUNPACKS Bool _1 USINT 1 ifin Bool 2 Booli Bool 4 Aiool 5 Bool 6 Bool_ Bool 7 TRUE If want to unpack one SIN
58. 255 1 502 Digital sampling trace A Frompt HMI f 0 0 205x18 o 0 To solve the problem 1 Make sure your Win GRAF PAC is started and the network communication between the PC and the PAC is functioning properly 2 Make sure the IP setting of the Win GRAF project is the same as the PAC IP refer the Section 2 3 5 in this example the IP address is 192 168 255 1 502 3 Make sure the network communication of your PC is working Win GRAF User Manual V 1 01 Oct 2014 by ICP DAS AP 3 Appendix C Enable the Screen Saver of WinCE PAC Please set the following two items to enable the screen of WinCE PAC 1 Choose Control Panel gt Power gt Schemes and set the Power Scheme as AC Power set the User Idle and the System Idle to the same value or set the System Idle value larger than the User Idle value 2 Then remember to run WinPAC Utility gt File gt Save and Reboot to save the settings and auto reboot the PAC Using the WP 8xx8 as an example If users do not touch the screen or button until the time out e g 1 minute the WP 8xx8 will turn off the backlight for enabling the screen saver Whenever users touch the screen or button the WP 8xx8 will turn on the backlight again The way to disable the screen saver is to set the User Idle and the System Idle as Never and then remember to run WinPAC Utility
59. 4 2013 10 01 2014 01 18 Win GRAF User Manual V 1 01 Oct 2014 by ICP DAS 17 16 17 5 4 Normal Day Holiday Special Day Configuration There are Normal day Holiday 1 Holiday 2 and Special day in each Season The normal days usually are Monday Friday Normal day When enabled the user must select one of the Schedule options 1 5 PE Holiday 1 e g normally are Saturday or Sunday canal When enabled the user must select one of the Schedule options 1 5 sande Holiday 2 e g Some cases need 2nd different Holiday such as Monday Ceca When enabled the user must select one of the Schedule options 1 5 Used for special Holidays or for the make up workdays such as 10 10 7 4 10 1 Special Day 12 25 and so on One Season can set up maximum 50 Special days When enabled the user must select one of the Schedule options 1 5 Rak Aven PO Season Season 2 Season J Season 4 Seacca Alwayo A The Searching Priority of Normal Day Holiday Special Day The PAC will first search Special day If the date is not found in this Special day setting then search Holiday 2 then Holiday 1 and then Normal day B Default Value for Boolean Integer Real Each Target must set the default value for the Boolean Integer and Real variables The default value is mainly set to use when the PAC cannot find the current date in any Date Period in the enabled Season 1 4
60. 5 1 10 Connecting the XV116 5 DI 6 Relay The XV116 is a 5 channel digital input and 6 channel relay output board This section provides a Win GRAF demo program demo_XV116 zip First go to Section 5 1 6 for the information of the XV Board before using it Demo description This demo added two data blocks One is used to read 5 DI data and the other is used to write 6 DO data 1 Mouse double click the 1st data block i e lt 2 gt Read Input Bits to open the setting window Workspace IO Drivers HRs C demo _X 116 E Mp MODBUS Master T Name Type D H Exception programs a Ge ATU COMO 115200 N 8 1 3 116_DI_00 BOOL S L Programs B agy i lt 2 gt Read Input Bits 1 1 5 p 116 BlO1 BOOL i a Main mE H B lt 15 gt Write Coil Bits 1 1 6 z xv116_DI 02 BOOL a Watch for d i l a atch for debugging Symbol Operation Mask Storage AY116 DIOS BOOL fill Soft Scope Fant _ XV116 DI 04 BOOL BE o wa XV116_DI_00 Data exchange 0 FFFF Default L E Initial values xv116_status DINT 912 Binding Configuration 2v116_DI1_01 Data exchange 1 FFFF Default WHE DLO COOL Se Global defines a s 116_DI_02 Data exchange 2 FFFF Defaul sient egi A Variables S 116_DI_03 Data exchange 3 FFFF Default gt 4 116_DI_04 Data exchange 4 FFF Default _ Name Value Types 116_status Error report F Default oro Note The Offset value is starting from 0 and the Mod
61. 6 gt ai single holding register 3 1 1 Activation On Change EE HTA rE ral pet twats el gtep ete eee de Reed Period ms 0 Real_VVrite_1 REAL Period on err 0 Status z c5 Timeout ms 250 J V ord_ Number of tri 1 Pia Word 2 WORD g Description o_o en a RENEE Symbol Operatio i Real write _1 Tarr echange j lt m gt gt 10 Drivers Variables Win GRAF User Manual V 1 01 Oct 2014 by ICP DAS 5 14 5 1 6 How to use the XV Board The XV board belongs to the Modbus Slave I O board Before using the I O board users must plug it into the WP 5xx8 and then enable the WP 5xx8 as a Modbus Master refer the Section 5 1 Please visit the XV board Selection Guide page to get more details www icpdas com root product solutions hmi touch monitor touchpad xv board selection html All the Win GRAF demo programs listed in the following table can be found on the CD ROM Refer the Chapter 12 click the Win GARF menu bar File gt Add Existing Project gt From Zip to restore the demo program and to view the details CD ROM Napdos Win GRAF demo project demo filename eseription XV116 demo_XV116 zip Read 5 Dl Write 6 DO XV308 1 demo_XV308_1 zip 1 Read 8 Al Read 8 DI XV308 2 demo_XV308_2 zip 2 Read 8Al Write 8 DO XV308 3 demo_XV308_3 zip 3 Read 8AIl Write 4 DO Read 4 DI XV310 demo_XV310 zip Read 4Al Write 4 DO Read 4 DI Write 4 AO Common setting 1 Mouse click the
62. 7 10 8 Chapter 11 11 1 11 2 11 3 11 4 11 5 11 6 11 7 11 8 11 9 11 10 11 11 11 12 Chapter 12 Save Data tO EEPROM me re Se ee 6 11 6 3 1 EEP READ Read a Value from the EEPROM ccccccssessseeessceeseseeeeseseeeeeeeees 6 12 6 3 2 EEP_WRITE Write a Value to the EEPROM ccccccesececeeececeeneseeeeeseseeeseseens 6 12 Exchange Data between PACs Data Binding sscccsescccssscccessccceseccceseecesseesenees 7 1 Connecting DCON I O Modules sssssseessossossossssossossossssossossosossossossosossossossossssossossos 8 1 Setting DECON TOBO GS aa a ences aera tes 8 2 Usine VO FICTION BIOCKS innr Er ARO O AE E OETA av OAOT 8 4 82 D 77065 Function BioCare ar e oat canal scsueaesb santas anal eat cual saad 8 5 S22 D 70187 EUNCLIO MGB IOCK sacio ation tit aea e Hanenee 8 6 8 2 3 D7 083 FUNCTION BIO GK nense aa EE EEN 8 8 82 4 D 87084 PREO FUNECUION BIG CK aiai i uae N 8 9 8 2 5 D 87084 CNTA Function BIOCK wiccccciesncsciasivaddaseourceananaticaiecussehaciind Advaneotaateasiaas 8 10 8 2 6 D_ 87084 CNTS FUNCTION BIOCK ccccceeeccccssecceesececeeececeesceceeeceeeuecessueceesenees 8 11 S27 DESTOOTASS SFUNCHOMBIOGK occire baa cansesanstae asap eniee Poa ae AA 8 12 On Line Chani Cassettes vasa eas esas eevee ewan 9 1 Linaitations7or On ine Chane radni E cetcactseak bqunctioseteneeaaatatsaees 9 1 Using On LING Change nanoia aa e ATE AT E 9 3 Data Type Conversion and Using the PA
63. 87005W I 87013W I 87015W I 87015PW I 87016W I 87017W I 87017RCW I 87017ZW I 87017DW I 87018W I 87018RW I 87018ZW I 87019RW I 87019ZW and other Analog Input modules B When using the AO module of l 7000 and I 87KW set the Data format to Engineering E g l 7021 l 7022 l 7024 7024R 87024W I 87024UW I 87024CW I 87028UW I 87028CW I 87028VW 87028VW 20V and other Analog Output modules DCON Utility is an easy to use software toolkit that help user search the network configure the I O modules and test the I O status Please visit the website to get the software program and user manual www icpdas com products dcon introduction htm The following will introduce the setting method in the Win GRAF Workbench Win GRAF User Manual V 1 01 Oct 2014 by ICP DAS 8 1 8 1 Setting DCON I O Boards DCON can be used to enable an RS 485 Port to connect remote DCON I O modules e g l 7000 series modules RU 87P8 I O Expansion Unit 87KW I O modules or I 87K8 I O Expansion Unit I 87KW I O modules If want to enable more than one DCON Port please set up multiple DCON I O Boards One PAC can enable up to 16 DCON 1 Click Open I Os of the Win GRAF tool bar to open the I O Boards setting window File Edit View Insert Project Tools Window Help id hs XK 9c vials to Gm ss Sm al 2 Double click Slot8 to add DCON I O Boards Refer Chapter 4 and then double click DCON to open the Prope
64. A om Global variables A apa DI 1 BOOL m 21 Port DI 2 BOOL bel D3 BOOL 4 Addr 3 COM BOOL v Di3 To read write operate a D_7080_CNT remote i A Encoder refer Section 4 9 aes 5 is i Ues emote 1 053 EEY lt Declare 3 BOOL variables 4 Blocks Sovlist Define ENUM o_o Z index DI of l 7083 Input Parameters EN Data type BOOL TRUE enable it FALSE disable it Port Data type DINT COM port number can be 1 to 37 depends on PAC Must use a constant value cannot be a changed value Addr Data type DINT The Net ID address of the module can be 1 to 255 Must use a constant value not a changed value Output Parameters OK Data type BOOL TRUE Communication is Ok FALSE Communication failed ZO Z2 Data type BOOL 3 ch Z index DI value Win GRAF User Manual V 1 01 Oct 2014 by ICP DAS 8 8 8 2 4 D 87084 FREQ Function Block D_ 87084 freq Connect a remote I 87084W in an I O Expansion Unit e g 87K4 5 8 9 or RU 87P4 or RU 87P8 to measure 8 ch frequency Note Please MUST configure the I 87084W s frequency data format as Hex format by DCON utility see 1 P8 1 when using the I 87084W to measure frequency Or it will not work Please use DCON Section 8 1 in the I O boards window and set proper settings Port baud_rate etc on it All values of Al channels are meaningful only when the returned comm
65. Apply ral had ule Sunday M ond ay Season Setting Season 1 4 need to set its Date Period i e From Year Month Day To Year Month Day Note 1 The Date Periods of the 4 Seasons must not overlap but can cross the year end Note 2 The Periods of Season 1 4 need not in a date order e g Season 1 s date period can be later than Season 2 but not overlap each other Note 3 If the Every Year is checked the system diagnoses the overlap of Month Day only not the year If the Every Year is not checked it will diagnose the From Year Month Day should be earlier than the To Year Month Day and the Year must not earlier than 2013 Win GRAF User Manual V 1 01 Oct 2014 by ICP DAS 17 15 ay Schedule Contral Utility Target 1 gt Season 4 gt Normal day Back Save to PC Boolean Integer Real v Target Default Value OFF si 0 0 0 V Season 4 Every year From 2013001 2013 Dex 31 Season Always Season Season 2 Season 3 For example 1 The Correct Setting User can check Every Year so that the setting will be used for every year 2 The Wrong Setting Because 2013 03 16 2013 03 31 overlaps in the Season 1 and Season 2 3 The Correct Setting The Season 1 is later than other Seasons but the Periods don t overlap Season 1 2014 01 19 2014 03 31 Season 2 2013 04 01 2013 07 15 Season 3 2013 07 16 2013 09 30 Season
66. BOOL variable Syntax UserShare Get_BOOL iUserAddress As System UInt16 ByRef iStatus As byte Parameter iUserAddress Address of the Variable 1 to 8192 iStatus Get the variable value iStatus 1 for True iStatus O for False Example Get the value of Win GRAF BOOL variable with address 1 Dim iStatus As Byte UserShare Get_BOOL Convert ToUInt16 1 iStatus Demo Program CD ROM napdos Win GRAF demo project vb net_2008 demo demo_vb01 Win GRAF User Manual V 1 01 Oct 2014 by ICP DAS 13 9 13 5 2 Integer R W Functions Mi Set SINT W Set_INT W Set DINT W Set LINT Description These functions are to set 8 bit Integer 16 bit Integer 32 bit integer amp 64 bit Integer value to Win GRAF integer variables Syntax UserShare Set_SINT ByVal iUserAddress As System UInt16 ByVal iStatus As SByte As Byte UserShare Set_INT ByVal iUserAddress As System UInt16 ByVal iStatus As Short As Byte UserShare Set_DINT ByVal iUserAddress As System UInt16 ByVal iStatus As Integer As Byte UserShare Set_LINT ByVal iUserAddress As System UInt16 ByVal iStatus As long As Byte Parameter iUserAddress Address of Variable 1 to 8192 iStatus the value of 8 bit Integer 16 bit Integer 32 bit Integer or 64 bit Integer Example Set a 32 bit integer value 1234567 to the Win GRAF DINT variable with address 1 UserShare Set_DINT Convert ToUInt16 1 Convert Tolnt32 1234567 Set a 16 bit int
67. Browse Recent O My Project obj S UserShareNet dll The current project is located in C projecti ee MM RAUT Component Files d tlb olb ocx exe Conca Note You may copy the UserShareNet dll from the CD ROM to your current project path first Then add it to the project reference Win GRAF User Manual V 1 01 Oct 2014 by ICP DAS 13 5 4 When UserShareNet dll is added please double click on My Project to check if the UserShareNet dll is well added Solution Explorer ix Double click Application Compile Debug E Unused References Reference Paths T Reference Name Type Ver CopyLocal Path References System Data HET EA ii if ii False C m Filesthticnosntt HETSDE CompactFrameworkwe iii Pescurces ersten Drawing NET 2000 False CProgram Files Microsoft WET SDE WCompacthrameworkwe OV n Ui For NET 2000 Fale C ae ara Ss ats el eee ae a l TEINI JAE HE an nm signing TeetSharellet NET 1010 True C Documents ad Setinestrser RiEiWine floc Nepdos Win GRP Devices 5 Right click on the Form1 vb and select View Code from the pop up Move cursor to top and insert the Option Explicit On and Imports UserShareNet in the first two statements Formi vb solution Explorer TSEN El a ajel project ion EEIT Sa My Project fl Foml wb A Open Open With Viw Code Ln Imports UsersS
68. Dim str_val As String Hello World Dim msg As Byte msg unicode_to_byte_array str_val Set a string value Hello World to the Win GRAF String variable with address 7 UserShare Set_STRING Convert ToUInt16 7 msg Convert String to byte array Private Function unicode_to_byte_array ByVal msg As String As Byte Dim tmpbuf As Byte If msg Length gt 255 Then Return Nothing End If tmpbuf System Text Encoding GetEncoding UTF 8 GetBytes msg Return tmpbuf End_ Function Demo program CD ROM 1 R W String variable napdos Win GRAF demo project vb net_2008_demo demo_vb04 Win GRAF User Manual V 1 01 Oct 2014 by ICP DAS 13 15 13 5 5 How to use VB NET R W to Win GRAF String Variable Before NET program write to Win GRAF String variable The String type has to convert to byte array If you need to read Win GRAF String variable Then you have to convert byte array to String There is a VB NET example to show how to convert each other Encode UTF 8 Convert String to byte array Private Function unicode_to_byte_array ByVal msg As String As Byte Dim tmpbuf As Byte If msg Length gt 255 Then Return Nothing End If tmpbuf System Text Encoding GetEncoding UTF 8 GetBytes msg Return tmpbuf End Function Convert byte array to string Private Function byte_array_to_unicode ByVal buf As Byte As String Dim tmpmsg As String If buf Length gt 255 Then Return Nothing End If tmpmsg
69. FREN fremote Bic gt 4 gt Blocks Sovlist Define ENUM Main Variables Input Parameters EN Data type BOOL TRUE enable it FALSE disable it Port Data type DINT COM port number can be 1 to 37 depends on PAC Must use a constant value cannot be a changed value Addr Data type DINT The Net ID address of the module can be 1 to 255 Must use a constant value not a changed value Output Parameters OK Data type BOOL TRUE Communication is Ok FALSE Communication failed Win GRAF User Manual V 1 01 Oct 2014 by ICP DAS 8 10 8 2 6 D 87084 CNT8 Function Block D_ 87084 _CNT8 Connect a remote 87084W in an I O Expansion Unit e g 87K4 5 8 9 or RU 87P4 or RU 87P8 to measure 8 ch counters Note 1 Please MUST configure the 87084W s counter data format as Hex format by DCON utility see P8 1 when using the I 87084W to measure counters Or it will not work 2 Please use DCON Section 8 1 in the I O boards window and set proper settings Port baud_rate etc on it 3 To get the 8 ch counter value from the remote I 87084W first using D_ 87084 _cnt8 Function Block Then using the Counter_ Start Counter_Stop Counter_Get Counter_State and Counter_Reset Functions refer Section 4 9 to operate counter channels 4 All values of Al channels are meaningful only when the returned communic
70. GRAF directory and then click OK to restore the project File 3 iiw Tools Window Help EE 3 im New Project List eee LF Sa 2a 84 Open Project List gt a Add New Project Select project p P ry UL etine JE i sf Lid G Projects Demol E B Demol 0613 O Default ICPDAS_template MICP_M E H G other E Test ea Tan tl My a oy From Zip X From Target Print Setup 1 CAWin GRAF Projects Demo01 w5 2 CAWin GRAF Projects Test w5 From XML Expy Win GRAF Demoli 0613 File Edit View Insert Project Tools Window Help 2 E EM J9 i G mnt val 1 lt Ho selection RCepuon programs d Programs oe LD1 Blinking os E PAC_Time Get M Watch for debuggi Build olf Soft Scope bag Fe NewStructure i Initial values 7 sna 6d NewSpy1 9 4 Binding Configuration 3g Global defines A Variables E Types lt 4 gt Buik Build Crossi references 4 Runtime Call stack ack _ Breakpoints Digitals sa Offline 192 168 71 19 502 s Win GRAF User Manual V 1 01 Oct 2014 by ICP DAS 11 6 11 5 Software Reboot a PAC Based on some cases users may want to reboot the PAC in a software way The Win GRAF provides a Function PAC Reboot for users to restart the PAC Note Please DO NOT call this Function in every PAC Cycle or the PAC will reboot all the time Safety Coding
71. HERE AE so eal Current time of the PAC PAC Year PAC_Month Red means PAC pacwe does not support PAC Hour PAC Minute Blocks Panel gt Blocks Hi 7 DTHOUR Get hours from time stamp H DTMIN Get minutes from time stamp T DTMONTH Get month from date sta T DTMS Get milliseconds from time sta H DTSEC Get seconds from time stamp DTYEAR Get year from date stamp EEP_READ Read a value from the h EEP_WRITE write a value to the E x amp EPLNMT Send NMT command EPLREADARRAY Read an array pa EPLREADOBJECT Read a simple pa EPLREADULINT Read a simple 64 b EPLWRITEARRAY write an array pa EPLWRITEOBJECT write a simple EPLWRITEULINT rite a simple 64 EXP Natural exponent 1 EXPL Natural exponent LREAL I EXPT Exponent h F_AOPEN Open file in append mode h F_CLOSE Close file OTRA CO ne Ch HD povdist Define ENUM 4 gt Build Crossreferences Runtime Callstack Breakpoints Digital sampling trace Offline 192 168 71 19 502 Prompt HMI 0 4302 Win GRAF User Manual V 1 01 Oct 2014 by ICP DAS 263x18 0 0 11 13 11 9 Upload the Win GRAF Source Code For some applications users need to get the source code of the Win GRAF project from the PAC to the PC this is called Upload This function can prevent t
72. I vee anes X08 DIS Data exchange 5 FFFF Default x o A a j T oe aw a0 Dl 6 Data exchange G FFFF Default Sll Ts iai j ge 308D Data exchange 7 o FFFF Defaut Name Value ananasa Des lt ii s iii MODBUS Master Request 2 lt 15 gt Write Coil Bits Write 4 DO dat Request rite ald Description Slave Unit aoo MODBUS Request lt 5 gt Write single coil bit A lt 6 gt Write single holding regi an 1 lt 15 gt Write Coil Bits Let es UWeike Unldinan Oni A The Net ID fixed to 1 of the Slave device i e XV board as OK Base address 1 r Start from addr 1 and Nb items 4 E o l write four data HODBUS Master Request Activation pene O Periodi o eques ni a m mr OK On call ere ATRA Write only when data Pd Cancel p Slave Unit i Misc changed i MODBUS Request Timeout ae lt 1 gt Read Coil Bits A Nb trials 1 An exception occurrs if no lt 2 gt Read Input Bits z lt 3 gt Read Holding Registers N respond for 100 ms LeAnn Nand Trek Manickav Data block Base address 33 a Start from addr 33 and read Nb items 8 c only four data in this example Activation Periodic so ms oo O On call lt On change 3 lt 2 gt Read Input Bits read 4 DI data Misc z Note Timeout m When using the XV308 to read DI data Nb trials the address must start from 33 Win GRAF
73. ICP DAS 17 18 17 5 5 Schedule Configuration Each Season can set up maximum 5 Schedules Schedule 1 5 and each Schedule can set up maximum 15 Time Periods The time unit is minute in the range of 00 00 24 00 Sosson Always beaeon Deaton s Saon j morn L Nor mal cay l Apoly Schedule 1 Copy from Boolean Integer ON 10 ON OFF OFF OFF OFF OFF mi pim d a a a a G a G G ayo amp t J Cc SeTo oa oy oyl oy oo oy oy oy oy oy lo SeTo oy ol ol oy oo oy oy oy oy oy lo SS SS SK eS SS SS SS OS SS SS aS Ss So aya oa Cs Oa ole ess ia So olay ca pave and exit EX The following setting is correct Cno tered oooton meer test 0070800 orF 100 20071300 o io 130071700 on aso 700 2800 o 200 Win GRAF User Manual V 1 01 Oct 2014 by ICP DAS 17 19 The Searching Priority of Time Period The searching priority of the Time Period in the schedule is in the order from the largest number to the smallest number For example the following table shows five Time Periods settings we tered ooton meser wear 00 00 08 00 OFF 100 12 00 13 00 OFF 17 00 24 00 OFF 1 The searching will in the order from No 5 to No 1 05 04 03 02 01 If the Time Period overlaps the PAC will follow the larger number setting to control the schedule 2 If the PAC cannot find the current time in any Time Period in the 15
74. ID fixed to 1 of the MODBUS Request Slave device i e XV board OR RS 25 gt Write single coil bit A lt 6 gt Write single holding lt 15 gt Write Coil Bits ates Usikn Unldina Nanickave N Write DO data Nb items 8 Start from addr 1 and write eight data Data block Base address Activation Periodic On call fon error On change Write only when data changed Misc z Timeout 100 An exception occurrs if no Nb trials t respond for 100 ms Win GRAF User Manual V 1 01 Oct 2014 by ICP DAS 5 31 Demo description demo_XV308_ 3 This demo added three data blocks the 1st one is used to read 8 Al data the 2nd one is used to write 4 DO data and the 3rd one is used to read only 4 DI data 1 Mouse double click the 1st data block i e lt 4 gt Read Input Registers to open the setting window Workspace iO Drivers He Ae 1 demo_X 308_ 3 E E ts ATU COMO 115200 N 8 1 T Names Type H Exception programs 2 H w 8 lt 4 gt Read Input Registers 1 1 8 308_ Al 1 INT A S L Programs B H B lt 15 gt Write Coil Bits 1 1 4 E XY308_ Al 2 INT ae Main E H B lt 2 gt Read Input Bits 1 33 40 J XY308_ Al 3 INT Watch for debugging F es a F Sieh Or HODU Symbol Operation Offset Mask Storage KV300_AL4 INT A Soft Scope H n XV308_AL5 INT Op a wt XV 308_Al_0 Data exchange 0 FFFF Default A SAO
75. Input O ID2 7 DINT Input O v iw lit gt Main Variables NewSpyt Win GRAF User Manual V 1 01 Oct 2014 by ICP DAS 4 32 PWM_8088W Function Block Then using the function block PWM_8088W to control the PWM output for each channel such as the LD program below Slot and Chan must use constant value Freq PWM frequency Init 100 Hz BOOL always returns Ture Inst_PyYwh_ S085 Pv BOSSY Pa l Current State iS088_Stateo 14 Slot 1 OChan State BOOL the current working status I8055_Fregd nly prin True working False stopped Init 0 5 50 Data type REAL ee rie Num DINT it reserved for future usage Int 1 Continuous mode isgos8_Crto TRUE Start FALSE Stop i088 Runt Cnt DINT gt 1 Continuous mode used to output PWM pulse continuously 1 65535 Burst mode used to output the required pulse count and then stop Run BOOL used to start True or stop False the PWM output Parameters Slot The used I O slot No and it must be a constant value not a changeable value In this case the value is 1 Data type DINT Chan The used I O channel No and it must be a constant value not a changeable value In this case the value is 0 Data type DINT Freq The PWM output frequency Data type DINT Unit Hz The value can be from 1 to 500 000 i e 1 Hz to 500 KHz In this case the initial value is 100 Hz Duty The PWM out
76. Integer 32 bit EOIVE ENUM EE TO ne ANY_TO_DINT NUM_TO_STRING Can set the decimal digital Default number after converting C t Hexadecimal ANY_TO_LINT Convert to Large Integer 64 bit ATOH ween ee String to Integer Convert Integer to ANY TO_TIME Convert to Timer HTOA Hexadecimal String For example the following ST program will convert the DINT variable to a Real first and then do the calculation REAL Val_1 ANY TO REAL DINT Val_1 3 5 4 8 You can open the HTML Help from the menu bar and enter the searching key word you want to see the detail setup instructions E HIML Help B EERE Bt H E 7 EHE A q ASO RUBEL HRA RESNF EM Language FIH EREL ERETO BRAN Ba fis BFE Type conversion functions IEC 61131 3 ANY_TO_BOOL IEC 61131 3 2 ANY_TO_DINT Z ANY_TO_U NEC 61131 3 3 ANY_TOINT ZANY_TO_UINT IEC 61131 3 4 ANY_TO_LINT IEC 61131 3 5 ANY_TO_LREAL IEC 61131 3 6 ANY_TO_REAL IEC 61131 3 Fi ANY_TO_TIME IEC 61131 3 8 ANY_TO_SINT IEC 61131 3 9 Programming languages Refe IEC 61131 3 10 ANY_TO_STRING IEC 61131 3 11 NUM_TO_STRING IEC 61131 3 12 BCD_TO_BIN IEC 61131 3 13 BIN_TO_BCD IEC 61131 3 14 Win GRAF User Manual V 1 01 Oct 2014 by ICP DAS 10 4 10 4 BCD Conversion BCD 4 bit code is used to represent decimal numbers from 0 to 9 Suppose there is a decimal value 132 if converted to BCD code is 000100110010 and if converted to binary is 10000100 e g 2 2
77. L 1X9 1 8 BOOL Input LI IXD 1 9 BOOL Input LJ IX9 2 i scale 2 1X9 2 0 BOOL Input E 1x9 2 1 BOOL Input L Aa RANI Innit m zd v Win GRAF User Manual V 1 01 Oct 2014 by ICP DAS 4 5 4 3 i_8017HW 8 16 channels Al The I 8017HW can be an 8 channel differential or a 16 channel single ended analog input module Data type REAL The following will describe a 16 channel module you can see the Chapter4 P4 1 to add this I O board Note Before using the I 8017HW I O module it requires to set the Differential or Single ended Jumper in the hardware 1 Mouse double click the i_ 8017 _16ch to open the Properties window and then to see the setting description sett 140 Boards 5 8017_16ch x 1 i 8017_16ch Properties 5 Key 6 ae Ref 16 801716 _6 ChO_type 16 08 Chl _type 16 08 9 Ch2_type 16 08 9 10 11 We 13 14 15 16 ee E Setting Description 801 7HW 1 801 7HCW B01 7DW p 16 Ch Analog lutputs Value type is REAL single ended input Parameters Ch_type 16H SSRR SS Scaling function is defined by the virtual board scale 00 means No scaling 01 to 29 means Appling a scaling function No 01 to 29 Parameters Ch_type 16 SSRR SS Scaling function is defined by the i_scale I O board see the Section 4 2 00 means No scaling 01 to 29 means Appling a scaling function No 01 to 29 Setting SS as other v
78. Margin fields Note If both Value and Margin have set values it will use the larger value In this example Value is set as 30 and Margin is set as 10 then the displayed value x 10 is smaller than 30 so it will use the larger value 30 4 Click the needed Variable Type then click the Set button E g Click BOOL SINT variables and Set button then the number become 9 30 39 Note STRING buffers characters FB instance data bytes approx and Complex variables segment bytes need to set a larger number This example uses 5000 5 After setting as the picture below click the X in the upper right corner to exit the setting On Line Change On Line Change Current Status Current Status Number of variables allocated Number of variables allocated ENABLED BOOL SINT variables l ERE BOOL SINT variables INT variables These 3 Types DINT REAL variables need larger values DINT REAL variables LINT LREAL variables LINT LREAL variables TIME variables TIME variables Active timers Active timers STRING variables STRING variables STRING buffers characters FB instances FB instance data bytes approx Published variables Complex variales segment bytes POUS fr n at oe NJ a am a POUS Numbers displayed Used Allocated Numbers displayed Used Allocated Displayed used numbers are according to the la
79. Modbus Master Request 6 Write single holding register Write one AO data U6 bi Write Holding Registers 5 1 1 Read DI data 1 Completing all the following settings in the MODBUS Master Request window and then click OK MODBUS Master Request a Slave Unit Ears Enter the Net ID of the Slave device a In this case the Net ID is 1 Slave Unit Me lt a b MODBUS Request i Select lt 2 gt Read Input Bits option Request Description MODBUS Request pees P c Base address aie K Start from 1 by default lt 3 gt Read Holding Registers re Nb items 2A Mand Tamuk DManizkav _ lt ee The number of DI signals to read Jala DIOC In this case the number is 16 Base address 1 Note Nb items 16 isi L m If you want to change the Base address GA Activation right click the MODBUS Master and Periodic 2000 ms jisooo then select the MODBUS Master 70n call on error Addresses to modify the value On change Misc Q Timeout 250 ms This option can not apply to the Read request IO Drivers we PMODBUS Master Nb trials 1 MODBUS Master addresses g First valid MODBUS addresses d Activation The way to send the Modbus request Input bits Periodic Sending the request periodically Cail bits In this case to send once every two seconds Input registers on error means the next sending time
80. NewSpyl Variables Build x gt Build Crossreferences Runtigoa allstack Breakpoit __ Digitalsamplingtrace Prompt HMI Offline 192 168 71 19 502_ A nihi Oxi Ini chi Win GRAF User Manual V 1 01 Oct 2014 by ICP DAS 11 19 demo_passwd Project This program first uses PAC _SN Function to read out the Serial Number and then uses a user defined algorithm to generate a password Finally save the password to an address within the PAC s file user can decide where you want to store Variable Declaration Wwarkepsce a OEA fl demo_passwd rt Type Dim Attrib Syb Initvalue User Tag Description Gl 3 Exception programs E fe feeeieeneiesc amp 5i C Programs INIT BOOL L TRUE init as TRUE oT Main NO_O DINT M 6 byte hardware serial number 5 Watch for debugging NO 1 DINT O lif Soft Scope NO_2 DINT C s E Initial values NO_3 DINT LI Bd NewS py NO 4 DINT m a Mj Binding Configuration NO 5 DINT a sT Global detins NO 6 DINT CJ NO DINT LJ password DINT LJ v lt gt 4 gt Main NewSpy1 Variables ST Program This demo_passwd example will generate a password by the 8 Byte Serial Number of the PAC and save it into the EEPROM of the PAC Declare No_0 No_7 and password variables as DINT Declare INIT variable as BOOL and has Initial value TRUE Operations in the first PAC Cycle if INIT then INIT FALSE No more first
81. OFF Signal TON Function Block can detect the steady ON signal Keeps ON for a minimum period of time Inst_TON T23 M1 OUT 1 PT Programmed Time ET Elapsed Time As the picture above this function can detect the steady ON signal that keep at least 2 seconds ON ON 2 sec 2 sec IN 1 ON I ON l l l l l l OUT_1 TOF Function Block can detect the steady OFF signal Keeps OFF for a minimum period of time that can keep OFF for a period of time N Inst_TOF OUT 4 TOF PT Programmed Time ET Elapsed Time As the picture above this function can detect the steady OFF signal that keep at least 3 seconds ON ON 2 sec 2 sec IN 1 ON I ON a a a a T l l OUT_1 OFF OFF OFF IN 1 l l l l 1 3sec 1 3 sec l OUT_1 OFF OFF OFF Win GRAF User Manual V 1 01 Oct 2014 by ICP DAS 12 5 12 1 4 Keep Outputting ON for Some Time after Triggering TP Function Block can keep outputting ON for some time after triggering e g from OFF to ON IN 4 OUT 4 PT Programmed Time ET Elapsed Time As the picture above after triggering it can keep outputting ON signal for 10 seconds 10 sec 10 sec 10 sec ON ON OUT 1 Win GRAF User Manual V 1 01 Oct 2014 by ICP DAS 12 6 12 2 Operations of Serial Port Communication Users can directly operate the serial port e g RS 232 RS 485 or RS 422 Port to achieve some specific communicat
82. On Line Change AN Please notice the important limitations before enabling the On Line Change When On Line change is enabled you can perform on the fly the following kinds of changes Change the code of a program Change the condition of a SFC transition or the actions of a SFC step Transitions Sequential Function Chart SFC Create rename or delete global and local variables Create rename or delete global and local function block instances Workspace Si Test Ea Name Type Attrib H Exception programs A Inst BLINK E J Main Programs oa Main e RUN BLINK d Inst BLINK1 blink S f Global variables T 2s ICYCLE _del SVV1 BOOL Deleted OUT1 BOOL o2 BOOL Watch for debuggin A Soft Scope oO Initial values Win GRAF User Manual V 1 01 Oct 2014 by ICP DAS 9 1 The following kinds of changes are not allowed Create delete or rename a program It will appear a warning message if delete a program E Test LI Exception programs Programs X Main 4 POU cannot be deleted with On Line Change active Do you want to disable it Change SFC charts Change the local parameters and variables of a UDFB Change the type or dimension or string length of a variable or function block instance Change the set of I O boards Change the definition of RETAIN variables In addition the following programming features that are not safe durin
83. PCIFETCESB1 OK IP Information JPy6 Information Internet Protocol TCP IP Static Address Type IP Address 192 168 255 1 Subnet Mask 255 255 255 0 Default Gateway Win GRAF User Manual V 1 01 Oct 2014 by ICP DAS 16 12 2 At the first time to download the Win GRAF redundancy application users Must modify the communication IP address refer Section 2 3 5 Communication Parameters to the LAN1 IP address of the current Active PAC Communication Settings 192 168 255 1 502 T5 Runtime ka Communication IP address P x a 3 Recompile the demo _RDN_2 project and then download it to the Active PAC refer Section 2 3 4 and Section 2 3 5 for details After that the LAN1 of the Active PAC will be automatically set as the Active IP i e 192 168 71 37 in this example program refer Section 16 3 1 and the LAN1 of the Passive PAC will be set as the Active IP 1 i e 192 168 71 38 automatically PCIFFETCESB1 OK IP Information Pyv6 Information Internet Protocol TCP IP Static Address Type IP Address 192 168 71 37 Subnet Mask 255 255 255 0 Default Gateway The LAN1 IP and Mask of the Active PAC after running the demo_RDN_2 PCIFETCESB1 OK IP Information Pyv6 Information Internet Protocol TCP IP Static Address Type IP Address 192 168 71 56 Subnet Mask 2
84. PS Ae a Destination folder C Win GAAF Projects Ww Name demo_ b l Win GRAF User Manual V 1 01 Oct 2014 by ICP DAS 13 1 13 2 Publishing the Win GRAF Variable for NET and Soft GRAF HMI If users wish to use NET program to Read Write the Win GRAF variables Except for String variable all of the variables need to use the Open Binding Configuration function to set an address The following demonstrates how to publish Win GRAF variable 1 Click Open Binding Configuration on the toolbar to open the Binding setup window 2 Click PUBLIC 9000 Keep the Address value is blank and Port value is fixed to 9000 _ De aek _ Open Binding Configuration Ve Win GRAF Test 3 File Edit View Insert Project Tools Window Help San Wee Oe ere ae alte G2 i Seal Workspace Binding SG Test_3 a Mig Network 7 Name H C Exception programs S meee PUBLIC 9000 Name PUBLIC fa Global variables Programs Address ied RETAIN variables a Main Ht Port 9000 _j Main 3 Watch for debugging 7 2 nOnBadindex elf Soft Scope E T 5 Initial values Name Identifier Binding Configuration 3g Global defines 3 Variables im Types lt gt 4 gt Binding Variables 3 Before publishing these variables make sure you have declared them in the Variables Area Click Global variables and press the Ins key to insert a new variable The following table
85. Real_dataz txt 123 2 Update History 94120418 bet al 5 2 Working_Real txt 49 6 100 7 Win GRAF User Manual V 1 01 Oct 2014 by ICP DAS 12 18 Test Program 1 Please set up IP configurations Refer P12 1 compile and download the program to the PAC Click on Project gt Build All Projects On Line if not familiar with the operation refer to Section 2 3 4 Section 2 3 5 2 Click NewSpy1 to open a Spy List and set the Read_File to TRUE to read the data If OK File Status will show Open File System_Disk Real_data2 txt Ok ED B 2 9 4 fe ta GE jo hall hed gt mAs uD Workspace T OCOD HewSpyt spl X P demo_file2 RUN fp Name Ch LI Exception programs H a REAL_val d Programs REAL vall0 1 08 Read File S 8 Main Be REAL_val1 2 786 Watch for debuagi REAL_val 2 38 450001 ME Soft Scope REAL_val 3 141 5 gS biti REAL_val 4 59 975 REAL_val 5 60 759998 St REAL _val6 71 230003 gq Global defines REAL_val 80 5 H Variables REAL_val 8 39 800003 Unlock By Types PeAL walls 100 699997 Read File FALSE set TRUE to read data from the file Open File sSystem_Disk Real_data2 txt Ok le_ status i so Main variables NewSpy1 Note There is one another file operation example listed in the Section 6 2 It handles many data in the file you may refer it Win GRAF User Manual V 1 01 Oct 2014 by ICP DAS 12 19
86. Registers Sacer IO Drivers HP oO demo_X 310 iB 1 MODBUS Master ASF Name Type a Exception programs ce Bid ATU COM0 115200 N 8 1 AVS1IO AL 1 INT A S L Programs d H A lt 4 gt Read Input Registers 1 1 4 RV31I0_AlL2 INT 3 ae Main B H B lt 15 gt Write Coil Bits 1 1 4 XV310_AL3 INT J E Watch for debugging H B lt 2 gt Read Input Bits 1 33 36 xY310_A0 0 INT AE Soft Scope g H M i lt 16 gt write Holding Registers 11 33 34 v XV310 AQ 1 INT aE es Initial values Symbol pere K offset Mask Storage AV3I0_status DINT w l ea _ V310_A0_0 Data exchange 0 FFF Defaut OSS 2 Sea gt xV310_A0_1 Data exchange 1 FFF Default Name Value SG Variables fi Types H lt ei e EH gt _10 Drivers Variables MODBUS Master Request Request Description t 1 RVOR The Net ID fixed to 1 of the MODBUS Request Slave device i e XV board lt 6 gt Write single holding register A lt 16 gt Data block Base address Note When using the XV310 to write AO data the base Nb items address must be set to 33 seduces Activation Periodic On call On change Misc Timeout Nb trials lt 15 gt Write Coil Bits Write Holding Reaisters N Write AO data Start from addr 33 and write two data Write only when data changed An exception occurrs if no respond for 100 ms Win GRAF User Manu
87. Registers 1 1 4 X 310 DO 1 BOOL i at Main k H B lt 15 gt Write Coil Bits 1 1 4 3 x 310_ DO 2 BOOL Watch for debugging F eee lt 2 gt Read Input Bits 1 33 36 say XV310_ DO 3 BOOL so fi Soft Scope i lt 16 gt Write Holding Registers WA 33 34 vl Xv310_DL0 BOOL H E Initial values 310 DI 1 BOOL A coana E Symbol Operation Offset Mask Storage Wer aD gt BOOL IOo og a XV310 DI_0 Data exchange 0 FFFF Default 0 co 3g Global defines a gt AYV31I0_DILS BOOL y J A Variables xW310_DI_1 Data exchange 1 FFFF Default an a E Types g x 310_DI_2 Data exchange 2 FFFF Default pe p 310_DI_3 Data exchange 3 FFFF Default _ Name Value ae T J AK E Win GRAF User Manual V 1 01 Oct 2014 by ICP DAS 5 35 MODBUS Master Request Request Description Slave Unit MODBUS Request lt 1 gt Read Coil Bits lt 2 gt Read Input Bits lt 3 gt Read Holding Registers LeAnn Nand Terk Nanickonen Note When using the XV310 Data block Base address to read DI data the base address must be set to 33 Nb items Activation Periodic On call On change Misc Timeout Nb trials The Net ID fixed to 1 of the Slave device i e XV board Start from addr 33 and read four data Read every 50 ms An exception occurrs if no respond for 100 ms 4 Mouse double click the 4th data block i e lt 16 gt Write Holding
88. Slave Unit The Net ID fixed to 1 of the MODELS Request Slave device i e XV board lt 5 gt Write single coil bit Ail _ lt 6 gt Write single holding Data block Base address Start from addr 1 and Nb items write eight data Activation Periodic On call On change Misc Timeout An exception occurrs if no Nb trials f respond for 100 ms Win GRAF User Manual V 1 01 Oct 2014 by ICP DAS 5 22 5 1 8 Connecting the XV110 16 DI The XV110 is a 16 channel digital input board This section provides a Win GRAF demo program demo_XV110 zip First go to Section 5 1 6 for the information of the XV Board before using it Demo description This demo added one data block that used to write 16 DI data 1 Mouse double click lt 2 gt Read Input Bits to open the setting window Workspace 10 Drivers His E demo_X 110 E lM MODBUS Master T Name Type H Exception programs 3 B ATU COM0 115200 N 8 1 E 110_DI_ 00 BOOL S L Programs B a i lt 2 gt Read Input Bits 1 1 16 PY 110_Dl_01 BOOL at Main a 110 Dl 02 BOOL al l Operat Offset Mask St wets Watch for debugging gt LIN al OO ND Dips ation _ I askal i aa xv110_DI1_03 BOOL 2110_D1_00 Data exchange 0 FFFF Default EE e 3 a G xv110_DI_o1 Data exchange 1 FFFF Default se an ae mae 913 Binding Configuration xv110_D1_02 Data exchange 2 FFFF Default N14 0 DI Og
89. System Text Encoding GetEncoding UTF 8 GetString buf 0 buf Length Return tmpmsg End Function Win GRAF User Manual V 1 01 Oct 2014 by ICP DAS 13 16 Chapter 14 C net 2008 Program Running in WP 8xx8 Access to Win GRAF Variables This chapter lists the procedure for creating the first demo program by Visual Studio NET 2008 development tool There are some sample programs in the Wp 8xx8 CD ROM C demo CD ROM napdos Win GRAF demo project CSharp net_2008 demo demo_CSharp01 Digital O demo with one I 87055W in slot 0 of the Wp 8xx8 demo_CSharp02 Analog I O demo with one 87024W in slot 1 and one I 8017HW in slot 2 demo_CSharp03 Read Write Win GRAF internal integers timers and real variables No I O demo_CSharp04 Read Write Win GRAF internal String variables No O Win GRAF demo CD ROM napdos Win GRAF demo project demo_vb01 zip demo_vb02 zip demo_vb03 zip demo_vb04 zip 14 1 Add an Existing Win GRAF Project from a ZIP Please refer the Chapter 13 1 14 2 Publishing the Win GRAF Variable for NET Please refer the Chapter 13 2 14 3 Create a New C Project 1 First users need to open Microsoft Visual Studio NET 2008 software And then in the menu of File please run the New Project fy Start Page Microsoft Visual Studio Edit View Tools Test Window Help Be New Project Ctrl N Bah a gl New Web SiteVA Shift Alt N Mew File Open Project Ctrl C
90. User Manual V 1 01 Oct 2014 by ICP DAS 14 10 ME Set REAL J Set_LREAL Description These functions are to set 32 bit REAL and 64 bit double value to the Win GRAF REAL LREAL variable Syntax UserShare Set_REAL ushort iUserAddress float iStatus UserShare Set_LREAL ushort iUserAddress Double iStatus Parameter iUserAddress Address of Variable 1 to 8192 iStatus Set the 32 bit REAL or 64 bit double Example Set a 64 bit double value 11234 234567 to the Win GRAF LREAL variable with address 7 UserShare Set_LREAL Convert ToUInt16 7 Convert ToDouble 11234 234567 Set a 32 bit REAL value 123 12 to the Win GRAF REAL variable with address 2 UserShare Set_REAL Convert ToUInt16 8 Convert ToSingle 123 12 Demo program CD ROM 1 R W analog I O napdos Win GRAF demo project CSharp net_2008 demo demo_CSharp02 2 R W internal long integer Timer and Real floating point values napdos Win GRAF demo project CSharp net_2008 demo demo_CSharp03 Win GRAF User Manual V 1 01 Oct 2014 byICPDAS 14 11 14 5 4 R W String variable Functions HE Set STRING Description This function is to get a Win GRAF String variable Syntax UserShare Set_STRING ushort addr Byte msg Parameter addr Address of Variable 1 to 1024 msg Get the string value Example String str_val Byte msg Get the String value of the Win GRAF String variable with address 7
91. You can click the Variables tag to open the Variables window Variables T Nane Type Dim Attrib Syb Init value User Tag E fat Global variables Port OK BOOL C NUNIT DINT C ByteAry BYTE 0 199 El Port_number DINT ae g 4 H Main Variables eee el Eee e Win GRAF User Manual V 1 01 Oct 2014 by ICP DAS l aS a heat r Hasan Type if CON status Port_number FALSE Action zn s Port OF COR openiPort number Double click 155 99 Ss une x i A 4 Global variables Pot_OK BOOL NUMI DINT BylaAry BYTE Port_number DINT lt 2 A J Propa D Advarced I tnei J aap J AS atettace I Mone J Bookaw CI CAND gj CANopen gy Ooch D Comores gt P Sects Soviet ww Dette ENUb Description Byte Array DIM 200 init as 3 z gt 12 9 In this example the Win GRAF PAC sends a string QUESTION by COM3 to the device and then wait for the reply and does operations After the operations waits 2 seconds and then sends the same command QUESTION and repeated SFC Program Declare Port_OK as BOOL NUM1 as DINT ByteAry as BYTE and Dim 200 Port_number as DINT and has initial value 3 Action P if port is not open open it if COM_status Port_number FALSE then Port_OK COM_open Port_number 9600 N 8 1 end_if t Open COM3 as 9600 N 8 1 End_Action
92. and Season Always or the current date is found however cannot find the current time in any Time Period in the related Schedule 1 to Schedule 5 Then the PAC follows the setting of the Default Value Usually the Default Value of Boolean is set to be OFF the Integer and Float value are set to be O User can set the different Default Value by the case Win GRAF User Manual V 1 01 Oct 2014 by ICP DAS 17 17 C Date Setting for Normal day Holiday 1 Holiday 2 Note that NO OVERLAP For example The Correct Setting Monday Tuesday gt Wednesday gt Thursday Friday Sunday Saturday Disabled Monday Tuesday gt Wednesday gt Thursday Friday Sunday Friday D Date Setting for Special Day The Special day is for special schedule such as the special holidays or make up workdays Each Season can set maximum 50 Special days The searching priority of the Special day is higher than the priority of Holiday 2 and Holiday 1 and Normal day Each enabled Special day date must select a Schedule number 1 5 to be applied special day Nomal day Schedule 1 O Holiday 1 Holiday 2 Special day G a t i 5 A A r 34 39 z men m ra ed Q 76 3 5 5 J I a EMES a Add a taw dee f X a 9A 7 7 SF 2013 5 24 7 Deke Win GRAF User Manual V 1 01 Oct 2014 by
93. and select the Add Multi Variables I Variables Ql Test 0 Y Name ira Undo nit value E 3 Exception programs fal PEIRCE u Redo S L Programs ial RETAIN variables ea Main _ Main Mouse right click S Watch for debuggi 7 2 nOnBadindex Ag Soft Scope 7 2 nOnDivZero n E Initial values L pShutDown Ajg Binding Configuration _ pStartup 3g Global defines 2 Variables EY Types Baul e gt 10 Drivers Variables Dj See 2 Follow the settings like the figure below Name Bool _ Type BOOL From 1 To 16 to create Boolean variables i e Bool_ 01 to Boo_16 and then click Create all button to complete the settings Creation of N variables 2 Global variables Read only Dim 0 From 1 To 16 Overview Creation of 16 variables From variable Bool 01 to variable Bool_16 Variables LE T Name Type Dim Attrib Syb Initvalue User Tag Description fa Global variables Bool 01 BOOL BOOL BOOL BOOL BOOL BOOL BOOL BOOL BOOL BOOL BOOL BOOL BOOL BOOL BOOL Bool 1b BOOL L gt r OOOOOOUOOOOOOOOOO lO Drivers Wariables Win GRAF User Manual V 1 01 Oct 2014 by ICP DAS 2 9 2 3 2 Declaring the I O Variables In this example the 8055W module that used to show the blinking feature must be plugged in the PAC s slot1 So we need
94. bit integer value Example Dim Dlong_ val As Int64 Dim short_val As Int16 Dim long_val As Int32 Dim Sbyte_val as byte Get 64 bit integer value from the Win GRAF LINT variable with address 7 UserShare Get_LINT Convert ToUInt16 7 Dlong_ val Get 32 bit integer value from the Win GRAF DINT variable with address 8 UserShare Get_DINT Convert ToUInt16 8 long val Get 16 bit integer value from the Win GRAF INT variable with address 9 UserShare Get_INT Convert ToUInt16 9 short_val Get 8 bit integer value from the Win GRAF SINT variable with address 10 UserShare Get_SINT Convert ToUInt16 9 sbyte_val Demo program CD ROM 1 R W analog I O napdos Win GRAF demo project vb net_2008 demo demo_vb02 2 R W internal long integer Timer and Real floating point values napdos Win GRAF demo project vb net_2008 demo demo_vb03 Win GRAF User Manual V 1 01 Oct 2014 by ICP DAS 13 11 13 5 3 R W Real Variable Functions Mi Get_REAL J Get_LREAL Description These functions are to get 32 bit REAL and 64 bit double from the Win GRAF REAL LREAL variable Syntax UserShare Get_REAL ByVal iUserAddress As System UInt16 ByRef iStatus As Single As Byte UserShare Get_LREAL ByVal iUserAddress As System UInt16 ByRef iStatus As Double As Byte Parameter iUserAddress Address of Variable 1 to 8192 iStatus Get the 32 bit REAL or 64 bit double value Example Dim float_val A
95. cycle Get the hardware serial number PAC_SN No_0 No_1 No 2 No 3 No 4 No_5 No_ 6 No 7 Please use your own algorithm to generate a password This example generate only one password You may change it to generate some passwords password No _0 No_1 No 2 12345 No_ 3 No 4 No _5 No 6 No 7 save the password in a file mMy_product pwd in the System_Disk Win GRAF file name System_Disk Win GRAF my_product pwd file_id f_wopen file_name if file id O then failed do nothing else open file ok save the password into it fm_write file_id Any_to_String password f_close file_id close file end_if end_if Win GRAF User Manual V 1 01 Oct 2014 by ICP DAS 11 20 demo_my_ap Project This project first uses PAC _SN Function to read out the Serial Number then calculates the password and then compares the password that read from the PAC s file to check if the password correct Workspace See demo_my_ap La Programs i Siir hi ain 34 Watch for debuggi 2 A Soft Scope ow E Initial values j SJ NewSpyl Ajd Binding Configurati g Global defines ft Variables i E Types tolg operations in the first PAC cycle if INIT then u m z INIT FALSE No more first cycle wy Woh get the hardware serial number Pac SN No_O No_1 No 2 No_3 No_4 No_5 No_6 No_ j Please use y
96. declared variables to modify your Go_ retain sub program Add your REAL variables for retain here a a a a aan My_REAL_00 REAL_VAR_now 0 My_REAL_ 01 REAL_VAR_now 1 My_REAL_02 REAL_VAR_now 2 My_REAL_03 REAL_VAR_now 3 My_REAL_04 REAL_VAR_nowJ4 My _REAL_O5 REAL_VAR_now 5 My_REAL_06 REAL_VAR_nowJ 6 My _REAL_0O7 REAL_VAR_now 7 My_DINT_00O OTHER_VAR_nowJ Q My_DINT_01 OTHER_VAR_now 1 My_DINT_02 OTHER _VAR_now 2 My_DINT_03 OTHER_VAR_now 3 My_DINT_04 OTHER_VAR_nowJ 4 My_DINT_05 OTHER_VAR_nowJ 5 Win GRAF User Manual V 1 01 Oct 2014 by ICP DAS 6 8 My_BOOL_00 Any_to_BOOL OTHER_VAR_nowJ 6 My_BOOL_01 Any_to_BOOL OTHER_VAR_now 7 My_BOOL_02 Any_to_BOOL OTHER_VAR_nowJ8 My_Timer_00O Any_to_TIME OTHER_VAR_now 9 My_Timer_01 Any_to_TIME OTHER_VAR_now 10 My_Timer_02 Any_to_TIME OTHER_VAR_now 11 My_Timer_03 Any_to_TIME OTHER_VAR_now 12 My_Timer_04 Any_to_TIME OTHER_VAR_now 13 My_Timer_05 Any_to_TIME OTHER_VAR_now 14 wo rr REAL VAR_now 0O My_REAL_OO REAL VAR_now 1 My_REAL_ 01 REAL VAR_now 2 My_REAL_02 REAL _VAR_now 3 My_REAL_03 REAL VAR_now 4 My_REAL_04 REAL VAR_now 5 My_REAL 05 REAL VAR_now 6 My_REAL_06 REAL _ VAR_now 7 My_REAL_07 Add your integer BOOL Timer variables for retain here suas AE OTHER _VAR_now 0O O
97. demonstrates variables using in the Test_3 project and you can declare them according to the needs of your application Type BOOL Public BOOL Public INT INT DINT Public_DINT DINT Public WORD WORD WORD Diublic DEA DEAI 3 REAL Public REAL 4 As the figure below click on PUBLIC 9000 and drag all the needed variables to the Name area The Identifier will generate an address number automatically If any other VB or NET program wants to use these public variables it must set to the same address number ID NOTE The PUBLIC allows to use up to 8192 variables and the Identifier number JUST can be 1 to 8192 Win GRAF User Manual V 1 01 Oct 2014 by ICP DAS 13 2 Binding ir HE Network r gee PUBLIC 9000 i xX Name Value T Name s_ Type Name PUBLIC a fa Global variables A Address Public BOOL BOOL Port 9000 Public_INT INT Public _DINT A DINT Public WORD WORD 5 B gt Public REAL REAL Name Identifier JPositive hysteresis Public_B00L Public_INT 2 __ Public_DINT go Pubic WORD 4 Public REAL 5 lt gt 4 gt Binding Variables 7 The following procedure will show you how to use the pub_ string function to publish the Win GRAF String variable in the ST program Syntax Pub_string Address String val Address The public address number and its range can be 1 to 1024 String val The name of String variable Variables descriptio
98. gt File gt Save and Reboot to save the settings and auto reboot the PAC Programs ie Favorites H d G Documents E Settings Control Panel WordPad _ S My Documents D 4 ve ted N Certificates Date Time Dialing Power Properties Battery Device Status Switch state to System Idle ft er 1 minute Switch state to Suspend Never ka WInPAG Utility 2 1 0 4 Help Configuration Save and Reboot Reboot Without Save Restore Default Settings Win GRAF User Manual V 1 01 Oct 2014 by ICP DAS AP 4 Appendix D Using Expansion RS 232 485 422 The Win GRAF PAC See P1 1 expand more COM port in its slot No 0 to 7 by using following modules I 8112iW 2 port Isolated RS 232 module I 8114iW 4 port Isolated RS 232 module I 8114W 4 port RS 232 module Note The WP 5xx8 does not support I 8142iW 2 port Isolated RS 422 RS 485 module A ae I 8144iW 4 port Isolated RS 422 RS 485 module ats ee Canine Cs penane he ee Using the WP 8xx8 as an example Before using these modules please configure them by using the WinPAC Utility First plug the module in the WP 8xx8 s slot O to 7 It is better to be in slot O to 3 and then run the WinPAC Utility Click the Multi serial port wizard tab Check the USE COMx option Note The Win GRAF doesn t support USE MSA MSBx Click the Slot
99. gt Read Input Bits 1 1 3 DINTA DINT H 0 boo DINT 5 DINT 1 boo_2 ERROR_STATUS1 DINT E E ERROR STATUSIT Ba D E Plead Inga Regione 1 1 5 ERROR STATUS21 a 40 1 DINTI 7 po te DINT e Name Value n m 4 5 DINT_3 A 46 7 DINT_4 48 9 DINT 5 MODBUS ariable Symbol Me MODBUS Slave ERROR_STATUS21 La eet ENE Error report DINT_5 B ERROR_STATUS1 ERROR_STATUS2 O Data exchange ERROR_STATUS11 x TERROR STATUS21 Offset o e Variables al Mask F ie U Local variables only peas paral _ Hide FB instances Win GRAF User Manual V 1 01 Oct 2014 by ICP DAS 5 52 Chapter 6 Retain Variable and Data Storage 6 1 Retain Variable This chapter lists the way to use the RETAIN VAR RETAIN _ARY RETAIN FLAG GET RETAIN FLAG SET and RETAIN FLAG CLR Functions The Win GRAF PACs are built in the Retain memory for users to store the retain variable data that will not lose due to the PAC shutdown and can retain the last value at the next time reboot In the shipping CD Napdos Win GRAF demo project you can find the demo project for this chapter demo_retain zip please refer Chapter 12 to restore this project Execute File gt Add Existing Project gt From Zip and set the current IP address of your PAC Note Function Retain _Var or Retain Ary can only be used in the first PAC Cycle or in the Cycle that performs the On
100. i6068_Freq0 DINT J G L Watch for de 1 4 is068_Duty0 REAL li Soft Scog 9088 CntO DINT E Initial values i8088_Run0 BOOL Sa NewSpyl i8086 Statel BOOL jf Binding Configurator 7 7a TET TM aS ee eae p g 3g Global defines W wea Sale E i al GY Variables 0 001 0 999 0 E Used Types p E i8088_Duty0 E Project init as 1 Continu ee Advanced woe i8088_Crto E Arithmetic gy Arrays cag all d g AS interface vi E BACnet v Be Eoin gt 4 gt Blocks Soviist Define ENUM gt Main Variables NewSpyt Build x j lt mi Build Cross references z Runtime Call stack E Breakpoints Digital sampling trace F Prompt r Hid z Ready Offline 192 168 71 19 502 _ 70 0 132x18 0 0 118 Win GRAF User Manual V 1 01 Oct 2014 by ICP DAS 4 31 I O Boards In this case add the i_8088 and the i_8084_ freq to the corresponding I O slot No in the I O Boards window see the Chapter 4 Then mouse double click the Slot No to open the Properties window and you can see the setting description to set this I O board eee 140 Boards i x 5 Double click it to set ee and to see the details g as Key 6 Ref 16 8088 11 Hard _ Trigger 16 00 12 Reserved 0 gt Reserved1 0 AW Reserved 2 0 rr 0 Double click it to set up this item 16 00 means the associate PWM output channel is triggered by the i_808
101. in the step2 6 do the following steps 1 Check 01 to enable the setting for the No 01 Time Period of the Schedule 1 A Set up the time as the figure below or the time which easily for testing B Set up the Boolean Integer Real variables to the values that you want to control or follow the setting in the figure below 2 Check 02 to enable the setting for the No 02 Time Period such as the step 1 Each schedule can set up a max of 15 Time Periods After completing the settings click Save and exit to save and exit this window Schedule 1 Copy from Boolean Integer ON 10 ON 20 mm i a oy oy oy oy oy oy Oy Ody a a Ga A A mm G G A G a G GO m A G G G oy oy oy oy ody Oy Ody Ll oo oS oS oe oe eS eS Oe ly lly Se aS oo oS oS oe oe eS eS eS yl lulu Pave and exit K ux 4 Then it will go back to the previous setting window as the figure below And the symbol show on the screen means the season or schedule has been configured Win GRAF User Manual V 1 01 Oct 2014 by ICP DAS 17 8 m e M ad Schedule Control Utility Target 1 gt Season Always gt Norma day Boolean i O v Target 1 Default Value OFF Back V Season Always Always Season awash Season Season 2 Season 3 Season 4 tt Se She FTN AME v Normal day
102. line Change If use them in other Cycle it will return FALSE If the Retain Variable has not assigned any initial value and the PAC calls the Function the return value is not meaningful users need to assign appropriate initial values to all Retain Variables at least once ST Program This demo uses Function Retain _Var and Retain Ary on_line_change_ cycle is declared as DINT nonezero means it is in the cycle just after doing on line change retain _done is declared as BOOL and inited as FALSE tmp_bool is declared as BOOL on_line_change cycle GetSysInfo _SYSINFO_CHANGE_CYCLE if retain done FALSE or on_line_change_cycle lt gt 0 then retain done TRUE just do it one time tmp_bool Retain Var DINT_1 1 retain a DINT variable tmp_bool Retain Var DINT 2 2 tmp_bool Retain_Var REAL_1 3 retain a REAL variable tmp_bool Retain Var BOOL_1 4 retain a BOOL variable tmp_bool Retain Var BOOL 2 5 retain 10 elements of an INT array variable at retain addr starting at 6 tmp_bool Retain Ary INT_ARY 6 10 retain 20 elements of a REAL array variable at retain addr starting at 16 tmp_bool Retain Ary REAL_ARY 16 20 tmp_bool Retain _Var DINT_ 3 36 64 bit variable can use only addr from 10 001 to 12 000 tmp_bool Retain Var LINT_1 10001 retain a LINT variable 64 bit tmp_bool Retain Var LR
103. n 12 00 CON 10 12 34 ON 20 25 67 3 OFF 0 0 OFF 0 0 OFF 0 0 OFF 0 0 OFF on OFF 0 0 GEE 0 0 OFF 0 0 OFF 0 0 OFF 0 0 COFF 0 0 OFF 0 0 OFF 0 0 Cancel Win GRAF User Manual V 1 01 Oct 2014 by ICP DAS 17 24 17 5 9 Using Schedule Control in the Soft GRAF The Soft GRAF Studio supports Schedule Control Utility since Version 1 09 The user just needs to fill 201 in the To Which page of the g ToPage Object and then when the user clicks the g ToPage button on the HMI page in the PAC the Schedule Control Utility will be executed Tolare Size W iF C Ask before operation Location X mo f AEN Font size Tar eal a Fore Color m Deny mesage E rine C Shov it m O Using bool addr to hide For more Soft GRAF Studio information please refer to FAQ 146 at the ISaGRAF FAQ web site ICP DAS Web gt Product gt Solutions gt Soft PLC ISaGRAF amp Soft GRAF HMI gt ISaGRAF gt Download FAQ gt FAQ 146 There is a Soft GRAF demo project demo_soft_graf_schedule zip in the Win GRAF PAC CD s napdos Win GRAF demo_ project Soft GRAF demo path The user may copy it to the PC and then unzip it Then run the Soft GRAF Studio to open it and download this demo project to the Win GRAF PAC Note PAC should run the Win GRAF project demo_ schedule it enables soft GRAF in the I O boards window or the S
104. name on the right E xl hand side then select Add Reference Solution Explorer pr v A X Rebuild Deploy Clean Add Add Reference Add Web Reference 3 Click the Browse button Select the UserShareNet dll from your project location Change folder to your current project Path ja A EN RAAU T Component Files d tb olb ocx exe Note You may copy the UserShareNet dll from the CD ROM to your current project path first Then add it to the project reference Win GRAF User Manual V 1 01 Oct 2014 by ICP DAS 14 3 4 When UserShareNet dll are added you can see them in the solution explorer as below volution Explorer eva a2 projectil H Sal Froperties B k a 42 mecorlib HI System 4 System Core 4 system Data 42 System Data DatatetExtensions 43 system Drawing 42 System Windows Forms 4 2 System t 5 Right click on the Form1 cs and select View Code from the pop up Move cursor to top and insert the using UserShareNet in the first statements Se Ae E Sa Propertes va References using System Drawing i md L TEET Y Or using UsershareWet E namespace wo Csharpul i F Open Open With View Code R public partial class Forml Form i Then you can design all required objects and actions inside your C Forms Refer the Section 14 5 for more information about using
105. network Specify an IP address does not automatically assign IP addresses ask your networld 1 Address 192 165 1 10 administrator for an address Subnet Maske 555 255 2755 0 and then type it in the space T provided Default Gateway Po e m Programs d z Favorites C Documents E3 Network and Dial up Connections Settings amp Help 5 RUN ee Taskbar and Start Menu se 7 Network Connections Win GRAF User Manual V 1 01 Oct 2014 by ICP DAS 1 14 Open the WinPAC_Utility exe or XPAC_Utility exe on the desktop or System Disk tools Then click File gt Save and Reboot to reboot the PAC Notice For connecting properly the PC Win GRAF IP and the PAC IP must on the same network segment For example set the PC s IP to 192 168 1 20 Mask 255 255 255 0 My Device Win GRA WinPAG Utility 2 7 0 4 its Help Configuration Explorer Ethernet Settings Network Settings System Information Save and Reboot Reboot Without Save _ Welcome to use WinPAC Utility WordPad Restore Default Settings This tool will help you to set up the WinPAC 8000 Exit Display Resolution eoo 600 had WinPAC My Documents Frequency 55 8 v cri Industrial Control Products ope Data Acquisition System Battary1 OK Task Bar Settings auto Hide Always On Top ca Battery OK Blank Desktop Regview Configure synchronization with a
106. or the attached shipment document I 8K and I 87K series product website http www icpdas com root product solutions remote_io rs 485 i 8k_i 87k i 8k_ i 87k selection html 1 Inthe Win GRAF click the Open I Os button from the toolbar to open the I O Boards window File Edit View Insert Project Tools Window Help Gd og sa ax oo 9 vi Lae od ss Fm al 2 As the figure below mouse double click the slot number that corresponds to the real I O module and then select the proper I O board e g i_ 8037 DO Note The Slot 0 to Slot 7 are reserved for real I O modules that plugged into the PAC and the slot 8 or above are for other usage Win GRAF User Manual V 1 01 Oct 2014 by ICP DAS 4 1 HEE 140 Boards ibrary Device Hao o A IDCON Enable one serial port to connect DCON I Os A ICP DAS XP wP VF 4_8017_O8ch 8 ch A 1 differential for 1 501 7H W I 8017HCW amp Standard ji 8017_16ch 16 ch A single ended for I 8017HW I 8017HCW 18024 AO 1 5024W 4 ch A D i R03 DO 1 BO37 6 ch yw E 1_8040_DI 1 8040W S040P W 32 ch D rr i R046 Oe Lan Select and to see the li 8050 1 8050 T 8051_DI 1 80 setting description B037W 16 Ch Digital Outputs Nov 05 2013 ICP DAS Taiwan Buttons Description Click the following buttons to modify the settings IE 140 Boards 8037_D0D la lalz lalallala wojo Properties Virtual Re
107. ow E Initial values V308 AI 6 INT Ae xV 308_Al 1 Data exchange 1 FFFF Default tas tjg Binding Configuration WDS AIF INT am amp s 308_Al 2 Data exchange 2 FFFF Default atta 9g Global defines c5 AVGUG_status DINT i A SV308_Al 3 Data exchange 3 FFFF Default f Variables xV308_DO O0 BOOL ie Types ay xV 308_Al 4 Data exchange 4 FFFF Default W308 DO 1 BOOL SV 308_A4 5 Data exchange 5 FFFF Default aiiora i V308_Al_6 Data exchange e FFF Det NESS 2 v30 Al_7F Data exchange FFFF Default v Name Value lt liz amp Note The Offset value is starting from 0 and the Modbus address for variables is equal to the Offset value plus 1 Base address MODBUS Master Request x Description Slave Unit The Net ID fixed to 1 of the Slave device i e XV board MODBUS Request lt 2 gt Read Input Bits Ail 3 gt Read Holding Registers mn 1 lt 4 gt Read Input Reaisters LO Wivikn minal emil bik Data block Base address Start from addr 1 and read eight data Nb items Activation Periodic On call C On change Misc Timeout 100 z An exception occurrs if no Nb trials t respond for 100 ms 2 As the figure below mouse double click the 2nd data block i e lt 15 gt Write Coil Bits to view the setting window 3 As the figure below mouse double click the 3rd data block i e lt 2 gt Read Input Bits to view the
108. scale H oiei Ch0i_ Y0 Engineering Yal For _0 00 Boc ESK lt S chol Y1 1_Engineering Val For_X1 0 0 2 i scale_2 Ch02 Z1 Max Physical_ al 0 0 10 Ch02 YO Engineering Fal For X0 0 0 EER Ch02_Y1_Engineering Yal For_Zi 00 12 Ch03 X0 Min Physical Yal 00 Ch03 X1 Max Physical al 0 0 bes 13 a Setting Description 14 ve scaling function No 01 to 29 for scaling 1 0 variables ting both value of Ch_X0 and Ch_ gt 1 to 0 0 it means the relative scaling function No is disabled 2X0 is greater than or equal to Ch 1 the setting is wrong Parameters Ch means the Ch01 to Ch29 Ch00 is a reserved item Ch_X0O_Min_Physical_ Val The min value of Al or AO boards X0 Ch_X1_Max_Physical_ Val The max value of Al or AO boards X1 Ch_YO_ Engineering Val_For_X0 The engineering value after scaling XO Ch_Y1_Engineering Val_For_X1 The engineering value after scaling X1 2 Double click the item and fill in a value then press the Enter key to complete the setting Notice 1 If set both value of Ch_X0O and Ch_X1 to 0 0 it means the relative scaling function No is disabled 2 If Ch_XO is greater than or equal to Ch_X1 the setting is wrong 3 If Ch_YO is equal to Ch_Y1 the setting is wrong For example if the Al board s value is 4 to 20 mA and wish to scale as O to 10000 then set Ch_X0O as 4 0 Ch_X1 as 20 0 Ch_YO as 0 0 Ch_Y1 as 10000 0 Win GRAF User Manual V 1 01 Oct 20
109. scan button and then the current found serial port expansion module will be listed on the left The earlier COM port setting is listed on the right if you have already set it before Click the Set button to refresh the new setting like the figure below Click File gt Save and Reboot to save the new setting and auto reboot the WP 8xx8 WinPAG Utility 2 1 0 3 File Help Configuration WordPad Ethernet Settings Network Settings System Information l Auto Execution diaa Slot 0 e bel Slot 1 _ 1 Driver enabled EX Driver disabled My Documents Slot 2 Slot 3 Slot 5 Slot 6 Slot 4 Step1 Port number assigned according to 1 Install driver Apply to 1 8112 8114 8142 8144 series modules Slot 7 Sequence order C Slot order Fixed order gt JUSE MSA MSBx Slot scan Refresh WinPAG Utility 2 1 0 3 i Help Configuration Save and Reboot Select USE COMx option Reboot Without Save A gt Restore Default Settings lt 1 o Win GRAF User Manual V 1 01 Oct 2014 by ICP DAS AP 5 After the configuration succeeds the COM port No for the expansion is COM6 to COM37 in the Win GRAF definition In this case it expands the COM6 to COM9 Network Settings System Information Slot 0 sor Slot 2 Slot 3 8144 Pin Assignment 1 8112iW 2 port Isolated RS 232 Auto Execution Multr serial port wizard
110. sdiags 1 reconnect 1 disabled 0 reqdelay 10 rtu 0 gt lt modbusreg name mode Read Input Bits address 0 nbitem 3 slave 1 call Periodic 1000 8000 timeout 1000 retry 1 gt lt modbusitem ope Data offset 0 symbol boo_1 nbword 1 mask ffff RangeHi RangeLo SigHi SigLo gt lt modbusitem ope Data offset 1 symbol boo_2 nbword 1 mask ffff RangeHi RangeLo SigHi SigLo gt lt modbusitem ope Data offset 2 symbol boo_3 nbword 1 mask ffff RangeHi RangeLo SigHi SigLo gt lt modbusitem ope Status offset 0 symbol ERROR_STATUS1 nbword 1 mask ffff RangeHi RangeLo SigHi SigLo gt lt modbusreg gt lt modbusreg name mode Read Input Registers address 0 nbitem 5 slave 1 call Periodic 1000 8000 timeout 1000 retry 1 gt lt modbusitem ope Data offset 0 symbol DINT_1 nbword 32770 mask ffff RangeHi RangeLo SigHi SigLo gt lt modbusitem ope Data offset 2 symbol DINT_2 nbword 32770 mask ffff RangeHi RangeLo SigHi SigLo gt lt modbusitem ope Data offset 4 symbol DINT_3 nbword 32770 mask ffff RangeHi RangeLo SigHi SigLo gt lt modbusitem ope Data offset 6 symbol DINT_4 nbword 32770 mask ffff RangeHi RangeLo SigHi SigLo gt lt modbusitem ope Data offset 8 symbol DINT_S nbword 32770 mask ffff RangeHi RangeLo SigHi SigLo gt lt modbusitem op
111. signal is 10 to 10 V Channel value 5 67 is to output 5 67 V value 3 752 is to output 3 752 V For example 16 133 means the physical output signal is 10 to 10 V with the scaling function 1 Channel value is a user defined engineering value will be converted first by the scaling function 1 i e ChO1 before output it as 10 to 10 V Win GRAF User Manual V 1 01 Oct 2014 by ICP DAS 4 8 3 For example 16 30 means the physical output signal is O to 20 mA Channel value 12 5 is to output 12 5 mA value 6 27 is to output 6 27 mA For example 16 1730 means the physical output signal is O to 20 mA with the scaling function 17 Channel value is a user defined engineering value will be converted first by the scaling function 17 i e Ch17 before output it as O to 20 mA 1 1 8024 AO Properties Key 6 Ref tosco Chi eee 16833 Ch2_type 16 33 Ch3_type 16 33 ReservedO 0 Reservyedl 0 Reserved 0 Reserved 0 After linking the i_8024 AO in the I O Boards window it will auto add 4 REAL Output variables in the Variables window These variables can be used in the program Variables a a Xx Type Dim Attrib Syb Initvalue User Tag Description QD1 i 8024 _AO A o Koo You can change the variable S LODI 2 name by double clicking it 0D13 See the Section 4 1 ee at Win GRAF User Manual V 1 01 Oct 2014 by ICP D
112. the demo _RDN_2 project if is first_cycle just_after_switch then Just in the cycle after switching Win GRAF User Manual V 1 01 Oct 2014 by ICP DAS 16 18 Chapter 17 Schedule Control SCHEDULE CONTROL e Aa oo e ry ar E yii VP 2xW8 WP 8xx8 XP 8xx8 CE6 VP 4xx8 WP Sxx8 XP 9xx8 CE6 Introduction All Win GRAF WinCE series PAC support the Schedule Control function One PAC can control max 10 Targets devices with specified schedule configurations Each schedule Target device contains three variables to be controlled one BOOL variable one DINT variable and one REAL variable ICP DAS provides a free software Schedule Control Utility User can use this software to edit modify the schedule configurations easily in PC or in PAC Driver version of Win GRAF PAC The Win GRAF PAC supports Schedule Control in the below driver version and the new version WinCE PAC Win GRAF PAC Driver Version ViewPAC V 25W68 VP 4138 1 02 WP 8000 WP 8148 WP 8448 WP 8848 1 02 WP 5000 WP 5238 WP 5248 1 01 XP 8000 CE6 XP 8048 CE6 XP 8348 CE6 XP 8748 CE6 1 01 XP 9000 CE6 XP 9148 CE6 XP 9348 CE6 XP 9748 CE6 1 01 You may download newer Win GRAF driver at htto www icodas com root product solutions softplc based on pac win graf download win graf dri ver html Win GRAF User Manual V 1 01 Oct 2014 by ICP DAS 17 1 17 1 Install the Schedule Control Utility and Restore the Win GRAF Demo Project
113. the Main PAC ready If Ch 2 returns FALSE The possible reason could be the following 1 The Ethernet cable LAN2 between Main and Backup PAC is broken 2 The Main PAC is dead or damaged 3 The rotary switch of the Main PAC is not set at 7 Is the Backup PAC ready If Ch 3 returns FALSE The possible reason could be the following 1 The Ethernet cable LAN2 between Main and Backup PAC is broken 2 The Main PAC is dead or damaged 3 The rotary switch of the Main PAC is not set at 9 Ch 4 is_first_cycle_just_after_switch For Active PAC only Ch 5 is Main _LAN1_ok Ch 6 is_Backup_LAN1_ ok Ch 7 is_Alive_port_ok Ch 8 is_Passive_ready Ch 9 is_ Active LAN1_ ok True Now is in the first cycle just after switching False Now is not in the first cycle after switching Is the LAN1 port of the Main PAC ok TRUE OK FALSE Fail or Ethernet cable is disconnected Is the LAN1 port of the Backup PAC ok TRUE OK FALSE Fail or Ethernet cable is disconnected True The communication of the Alive Port is ok False The communication of the Alive port fails or the Passive PAC is dead or damaged Is the Passive PAC ready now If Ch 8 returns FALSE The possible reason could be the following 1 The Ethernet cable LAN2 between Main and Backup PAC is broken 2 The Passive PAC is dead or damaged 3 The rotary switch setting of the Passive PAC is incorrect Is the LAN1 port of the Active PAC ok TRUE OK
114. them separately to the buf 2 buf 3 buf 4 and buf 5 from the location 2 of the BYTE Array in the Little Endian sequence Note The last parameter is FALSE that means to use the Little Endian sequence To save the Low Byte to the starting address Win GRAF User Manual V 1 01 Oct 2014 by ICP DAS 10 11 Example 2 To unpack one Word_Val to 2 Bytes and save them separately to the buf 0 and buf 1 from the location O of the BYTE Array in the Big Endian sequence TMP_DINT SerializeOut buf Word_Val 0 TRUE Note The last parameter is TRUE that means to use the Big Endian sequence To save the High Byte to the starting address Example 3 To pack the buf 0 buf 1 buf 2 and buf 3 in the BYTE Array into one REAL Val in the Little Endian sequence TMP_DINT Serializeln buf REAL Val O FALSE Note The last parameter is FALSE that means to use the Little Endian sequence To save the Low Byte to the starting address Example 4 To map one DINT_Val to one REAL Val in the Little Endian sequence TMP_DINT SerializeOut buf DINT_Val 0 FALSE TMP_DINT Serializeln buf REAL Val O FALSE Win GRAF User Manual V 1 01 Oct 2014 by ICP DAS 10 12 10 8 Get Set the PAC Time If you want to get the current time of a Win GRAF PAC you can use a TIME_GET Function Block Refer the Section 2 2 1 Current time of the PAC fear PAC Month
115. time server m _ Enable Autorun when connecting a USB Disk TaskMar Enable Autorun when connecting a Micro SD isqlwS5 mina E Win GRAF User Manual V 1 01 Oct 2014 by ICP DAS 1 15 Chapter 2 A Simple Win GRAF Program 2 1 Creating a New Win GRAF Project The following sections will introduce you to a simple template project that used to get set read write the Win GRAF PAC s system time Follow the steps below to complete this demo program 2 1 1 Creating a Template Project Demo01 1 Run the Win GRAF Workbench refer the Section 1 2 and click File Add New Project from the menu bar Win GRAF ie View Tools Window Help eo Mew Project List Open Project List Add Existing Froject 2 Click From template to create a project from a template enter a project name e g Demo01 in the Name field and add a simple note in the Comment field then click Next By default it will show a ICPDAS_template option provided by Win GRAF Workbench just click Next to continue B Project wizard A Project ea ML Import CI Library gn Automation script Creates a new project using a template Recommend to use the default folder Hew project Destination folder 9 CW in GRAAF Projects a a C fT Template ICPDAS_template k Hame Comment Previous Win GRAF User Manual V 1 01 Oct 2014 by ICP DAS 2 1 3 Now you have created the Demo01 template p
116. timeout 1000 retry 1 gt SFRS A N pe Data offset 0 symbol boo_1 nbword 1 mask ffff RangeHi RangeLo SigHi SigLo gt pe Data offset 1 symbol boo_2 nbword 1 mask ffff RangeHi RangeLo SigHi SigLo gt SUREFIEDASSHC pe Data offset 2 symbol boo_3 nbword 1 mask ffff RangeHi RangeLo SigHi SigLo gt FIED Ctd P pe Status offset 0 symbol ERROR_STATUS1 nbword 1 mask ffff RangeHi RangeLo SigHi SigLo gt ERE mode Read Input Registers address 0 nbitem 5 slayve 1 call Periodic 1000 8000 timeout 1000 retry 1 gt lt modbusitem ee offset 0 symbol DINT_1 nbword 32770 mask ffff RangeHi RangeLo SigHi SigLo gt lt modbusitem ope Data offset 2 symbol DINT_2 nbword 32770 mask ffff RangeHi RangeLo SigHi SigLo gt lt modbusitem ope Data offset 4 symbol DINT_3 nbword 32770 mask ffff RangeHi RangeLo SigHi SigLo gt lt modbusitem ope Data offset 6 symbol DINT_4 nbword 32770 mask ffff RangeHi RangeLo SigHi SigLo gt lt modbusitem ope Data offset 8 symbol DINT_S nbword 32770 mask ffff RangeHi RangeLo SigHi SigLo gt lt modbusitem ope Status offset 0 symbol ERROR_STATUS2 nbword 1 mask ffff RangeHi RangeLo SigHi SigLo gt lt modbusreg gt lt modbusport gt lt modbusport kind master Eleieig eee TEE REREN port 502
117. to Status 4 simply press Del key to delete Status 0 and Status 2 to 4 4 Set the Operation field of the Status 1 as Error report that means this variable will be set to an error code when a read error occurs or reset it to O when a read request is successful Press the F1 key to see the description of the Modbus Master Configuration and move to the title Status and command variables to know related commands and error codes 5 Set the Operation field of Act_0 as Command one shot that means the request will be sent only once when Act_0 is set to TRUE Then this Act_0 will auto reset to FALSE The Command Enable means the request is sent continuously as long as the Act_0 is TRUE So users can set the Act_0 to FALSE to stop sending command IO Drivers H g E Mp MODBUS Master Name Value Y Name Type Dim Att co as ATU COM2 9600 N 8 1 Request lt 5 gt Write single coil bit Bool_11 BOOL 2 AB lt 2 gt Read Input Bits 1 1 16 Slave Unit 2 Bool 12 BOOL E eae dias ae eaea ia M Address 1 Bool 13 BOOL oO Nb ltem 1 Bool 14 BOOL B Activation On Call Bool 15 BOOL rE Period rms 0 Bool 16 BOOL Period on eror 0 Status DINT 0 4 eb Timeout ms 250 DOO e BOOL Number of trials 1 Act 0 Pi BOOL at Description SB Loati T ee s Symbol Operation Offset Mask Storage _
118. type setting B Accuracy is better amp total 10 Channels C Temperature input with sensor broker line detection FF Temperature format It only apply to the channel type is Thermocouple ChO_7_ type 16 RR RR Range definition of signals 01 means the unit of the input value is Degree Celsius 02 means the unit of the input value is Degree Fahrenheit Win GRAF User Manual V 1 01 Oct 2014 by ICP DAS 4 10 Normal Range For mA or Volt Thermocouple Range For temperature o oos 06 20to 20mA C 4 B Oto 1820 C When l 87018 and l 87018R are connected B N O 0 to 2320 C t t d set to 06 type o a curren source and set to yp 900 to 800 C code an optional external 125 Ohm resistor 200 to 900 C Setting RR as other value will use the default value 05 Type Code Physical Input Signal On Rk owas is required 2 Double click the item and fill in a value then press the Enter key to complete the setting For example 16 05 means the physical input signal is 2 5 to 2 5 V Channel value 1 28 means the input signal is 1 28 V Channel value 0 752 means the input signal is 0 752 V For example If ChO_7_ type set as 16 0F and Tmp_F set as 16 01 means the physical input signal is 270 to 1372 degree Celsius Channel value 25 75 means 25 75 degree Celsius For example If ChO_ 7 type set as 16 10 and Tmp_F set as 16 01 means the physical input signal is 454 to 75
119. variables are controlled well File Edit View Insert Project Tools Window Help PFEP GORE NAYE Sq OF a LUN Workspace OOOO NewSpyi spi i P demo_schedule RUN H Name Value Description a O Exception programs g Year 2014 3 Programs Month g i Main H Dan 30 Watch for debugging WeekDayl 2 AB Soft Scope Hourl 17 ZJ Initial values Minutet 25 Za NewSpyl y Second 3 3 Binding Configdation Target0i 3g Global defines Target02 ta Variables Target03 Types Target_01_BOOL Target_01_DINT Target_01_REAL Target_02_BO00L Target_02_DINT Target_02_REAL Target_03_BOOL Target_03_DINT Target_03_REAL Current_Page 1 To_Page 1 Win GRAF User Manual V 1 01 Oct 2014 by ICP DAS 17 11 17 5 Configurations of the Schedule Control Utility 17 5 1 Address for each Target Variables The Schedule Control Utility can configure max 10 Target s schedule Each Target contains one BOOL variable one DINT variable and one REAL variable To enable the schedule control in the Win GRAF PAC first add a Schedule in the I O boards windows refer Section 17 2 The user can declare all required variables in the Variables window and add these variables in the Binding window and then assign correct Identifier number 5001 5030 refer Section 17 2 Variable declaration After downloading the Win GRAF project to the PAC the scheduling will control these variables well 5001 BOOL BOOL DINT and
120. when Holding registers an exception occurred e g 15 seconds On call The request is activated when a program call to send it On change In case of a write request means that the request is activated each time any variable changed e Timeout Set a timeout value When time out occurred it will show the defined error code The recommended value for the Modbus RTU ASCII device is 200 to 1000 ms In this case the value is 250 ms Win GRAF User Manual V 1 01 Oct 2014 by ICP DAS 5 3 2 Next open the Variables window and then declare variables that are available for the program Workspace 10 Drivers 5 5 Watch for debuggi HA Soft Scope Initial values 4 Binding Configuration 3g Global defines fal Vanables 2 Types Tips z gi LS Press F1 key to view the details on the MODBUS Master settings 2 Test_01 fe Ma MODBUS Master Name Yale o G L Exception programs 2 g ATU COM2 9600 N 8 1 Request lt 2 gt Read Input Bits uu Programs A lt 2 Read Input Bits 1 1 16 Slave Unit 1 1 Main H x i Address 1 Nb ltem 16 Activation Periodic Period ms 2000 Period on error 15000 Timeout ms 250 Number of trials 1 Description Double click it to open the window Operation Offset Mask x Declaring 16 variables to read data Name Boo_01 to Boo_16 Type BOOL and one array variable to record the state of data access Name Status Dim
121. you want to import PO PERETE ed Import project items XML mport ST file Import project items from previous versions Import common definitions Import library definitions Import OEM libraries Import Embedded HMI hardware definition Eal O Projects Demo01 yICPDAS_template EAA EST oc a 9 MICP_M other G Test Test_01 aia test C Test_2 G Test_3 RAF test_0528 ar OHNI SDE AtS ERIRE aM Master_2 xml v Bde O ERRAU T XML files xml v Raa 4 Win GRAF User Manual V 1 01 Oct 2014 by ICP DAS 5 51 10 Click Finish to finish the import action Import Assistant Import is complete 11 In the IO Drivers window there has added a new Open MODBUS setting item that includes two Modbus Master Request for using to read the DI and Al One Error report is used to check the IP connecting status so please add two DINT variables in the Variable area e g ERROR_STATUS11 ERROR_STATUS21 and double click the Error report to assign variables IO Drivers HE Mp MODBUS Master T Na e O ee E gs Open MODBUS 192 168 1 100 502 boo_3 BOOL hd E ng B lt 2 gt Read Input Bits 1 1 3 DINT_1 DINT g _ oe B lt 4 gt Read Input Registers 1 1 5 DINT 2 DINT Ea ER Open MODBUS 192 168 1 101 502 DINT_3 DINT E i lt 2
122. 100T485 Utility software in the shipping CD to configure the appropriate parameters of the module e g Module ID The TDL 100T485 s default Address ID is 1 Baudrate is 9600 and the Checksum is Disable 2 Please use DCON Section 8 1 in the I O boards window and set proper settings Port baud_rate etc on it 3 All values of Al channels are meaningful only when the returned communication state is TRUE If OK returns TRUE 4 Referring Chapter 12 click the menu bar File gt Add Existing Project gt From Zip to restore the demo project CD ROM Napdos Win GRAF demo project DEMO_DL_100T485 zip in the shipping CD and see the program and descriptions Supposition Use PAC s COM2 to connect the DL_100T485 Addr 1 to get humidity and temperature value my seer A TY Name Type Dim Inst_DL_100T485 S Global variables m COM BOOL RH1 REAL g Temp_1 REAL Fr gt D_87084_CNTS rem A D_87084_FREQ re OL 1007485 remate Declare 2 REAL variables 3 h EEP_READ Read a Ti TL EEP WRITE f asrite a S humidity and temperature P Blocks Sovlist Define ENUM gt Main Variables values of the DL 100T485 Input Parameters EN Data type BOOL TRUE enable it FALSE disable it Port Data type DINT COM port number can be 1 to 37 depends on PAC Must use a constant value cannot be a changed value Addr Data type DINT The Net I
123. 14 5 UserShareNet DLL This section we will focus on the description of the application example of UserShareNet DLL functions There are some functions that can be used to read write data from to the Win GRAF variable The functions of UserShareNet DLL can be divided into as listed below R W Boolean R W 8 bit Integer R W 16 bit Integer R W 32 bit Integer R W 64 bit Integer R W 32 bit Float R W 64 bit Float R W 32 bit String CON DM RA UW N e X Refer the Appendix A to get familiar with the definition of Win GRAF variables 14 5 1 R W Boolean Functions HI Set BOOL Description This function is to set a value to a Win GRAF Boolean variable Syntax UserShare Set_BOOL ushort iUserAddress byte iStatus Parameter iUserAddress Address of Variable 1 to 8192 iStatus Set the status For instance iStatus 1 for True iStatus 0 for False Example Set the Win GRAF BOOL variable with address 1 to True UserShare Set_ BOOL Convert ToUInt16 1 1 Demo program CD ROM napdos Win GRAF demo project CSharp net_2008_demo demo_CSharp01 Win GRAF User Manual V 1 01 Oct 2014 by ICP DAS 14 6 Mi Get _BOOL Description This function is to get the value from a Win GRAF BOOL variable Syntax UserShare Get_BOOL ushort iUserAddress out byte iStatus Parameter iUserAddress Address of Variable 1 to 8191 iStatus Get the variable status iStatus 1 for True iStatus O for False Example
124. 14 by ICP DAS 4 4 For example if the AO board s value is 10 to 10 V and their respective engineering value is 50 to 1200 then set Ch_X0O as 10 0 Ch_X1 as 10 0 Ch_YO as 50 0 Ch_Y1 as 1200 0 90 1 scale Properties x Eey 0 A Ref 160 4A4 Ch000 XO reserved 0 0 ChOO 21 reserved U1 ChOO O_reserved U1 Lees at Chol _40_ Min Physical Fal 100 Eng Le Chol 2l Engineering Yal For l 13 A001 0 Cho Zl eta Physical Fal 00 ChoO2 O Engineering Yal For X0 00 ChO2 Y1 Engineering Yal For 1 00 ChO3 0 Min Physical Yal 00 ChO3 1 Max Physical al 0 0 I 3 After linking the i_ scale in the I O Boards window it will auto add 30 Boolean variables in the Variables window When the Win GRAF connects the PAC it will display the state of each scaling function True scaling function is ok FALSE scaling function is not enabled or setting error Y Mame Type Dim Attrib Syb Initvalue User Tag Description a a AXI 0 i_scale_0 A BOOL Input L 0 BOOL Input E 1x9 0 2 BOOL Input E 1x9 0 3 BOOL Input L 1x9 0 4 BOOL Input O 1x9 0 5 BOOL Input E 1x9 0 6 BOOL Input L 1x9 0 7 BOOL Input L 1x9 0 8 BOOL Input LI 1x9 0 9 BOOL Input LI 5 IX9 1 i scale 1 1X9 1 0 BOOL Input LI IXT 1 1 BOOL Input LJ IXG 1 2 BOOL Input LI 1x9 1 3 BOOL Input E x9 1 4 BOOL Input LI 1x9 1 5 BOOL Input LI 1x9 1 6 BOOL Input E 1x9 1 7 BOOL Input
125. 14 by ICP DAS 5 44 5 2 2 Connecting the ET 7060 6 DI 6 Relay The ET 7060 is a 6 DI and 6 Relay channels Ethernet I O module The Win GRAF demo project for this section is demo_ET7060 zip Please refer Section 5 2 1 to set up the module channels using the Internet Browser and restore open the demo project Demo Descriptions This demo creates two Data Blocks one is used to read 6 DI data the other is used to write 6 DO data 1 Double click the first Data Block lt 2 gt Read Input Bits to open the setting ener lO Drivers a demo_E T7060 fe E To MODBUS Master Name H Exception programs ce Bid pari MODBUS 192 168 1 128 502 ET7060_DI_00 BOOL HL Programs B Esme f lt 2 gt Read Input Bits 1 t 6 W ET7060_DI_ 01 BOOL a Main i 3 A lt 15 gt Write Coil Bits 1 1 6 p ET7060_DI_02 BOOL Symbol Operation Offset Mask Storage a an F EN A z al perenne z ET7060_D1_00 Data exchange 0 FFFF Default A E1060 B08 BOOL Initial values ET 060 DI 05 BOOL LACIE MENN G ET7060_D1_01 Data exchange 1 FFFF Default 9 3 Binding Configuration ET 060 status DINT a ET 060_DI_02 Data exchange 2 FFFF Default 3g Global defines GE ET UbU RL OL BGE a ET 060_DI_03 Data exchange 3 FFFF Default Behar fg Variables ET7060 RL 01 BOOL g ET7060_DI_04 Data exchange 4 FFFF Defer esc KE Types ET7060 RL 02 BOOL ET 060_DI_05 Data exchange 5 FFFF Default Eri ETZ060 RL 03 BOOL ET7060_status Error report 0 FF Default
126. 19 2 Double click the item and fill in a value then press the Enter key to complete the setting 1 1 8084 cont _O8ch Properties Signal Inverted _ Reserved 3 U 3 After linking the i_ 8084 cnt_ch08 in the I O Boards window it will auto add one BOOL Input variable no meaning always FALSE in the Variables window Y Name Type Dim Attrib Syb Initvalue User Tag Description B IX1 1 8084 cnt_O8ch olX1 0 BOOL Input LJ y x i 4 gt dO Drives Variables S 4 After linking the I O board refer the Section 4 9 to use COUNTER_START COUNTER_STOP COUNTER _GET COUNTER_STATE and COUNTER_RESET functions in the LD or ST program to operate the Counter channel of the l 8084W Win GRAF User Manual V 1 01 Oct 2014 by ICP DAS 4 20 4 8 i 8093 3 axis High Speed Encoder Module The I 8093W is a 3 axis high speed encoder module that can be independently configured as one of the Quadrant Pulse Direction or CW CCW input mode for each channel If not familiar with the way to add the this I O board see the Chapter4 P4 1 1 Mouse double click the i_8093 to open the Properties window and then to see the setting description SE 140 Boards Be 1 i 8093 Properties RN eee _5 ZX Mode 1 6 Y Mode 1 E Z_Mode 1 o Signal Inverted 0 R S Rese
127. 2 degree Fahrenheit Channel value 25 75 means 25 75 degree Fahrenheit Ch5_scale 16 0 Note If using a temperature module with a broken line detection function e g 87018ZW and the temperature value is greater than 9000 0 it means 1 The temperature sensor may be broken line 2 The temperature sensor may be damaged 3 The DCON module is not configured well to fit the connected temperature sensors 4 The ohm measured by the connected sensor is not correct Win GRAF User Manual V 1 01 Oct 2014 by ICP DAS 4 11 ChO_scale to Ch7_ scale 16 SS SS Scaling function is defined by the i_scale I O board refer the Section 4 2 00 means No scaling 01to29 means Appling a scaling function No 01 to 29 Setting SS as other value will use the default value 00 For example 16 17 means the physical input signal is converted with the scaling function 17 3 After linking the i_87018 O8ch in the I O Boards window it will auto add 8 REAL input variables in the Variables window that are available for programming T Name Type Dim Attrib Syb Init value User Tag Description ID1 i 87018 O8ch A 1D1 0 DEL Input You can change the variable ID1 1 Input iit oD 2 DEAL art ae tie it ID1 3 REAL Input See the Section 4 1 ID1 4 REAL Input E 1D1 5 REAL Input LI ID1 6 REAL Input O 1D1 7 REAL Input L v lt ul gt Win GRAF User Manual V 1 01 Oct
128. 2008 demo demo_vb02 2 R W internal long integer Timer and Real floating point values napdos Win GRAF demo project vb net_2008 demo demo_vb03 Win GRAF User Manual V 1 01 Oct 2014 by ICP DAS 13 13 13 5 4 R W String Variable Functions HI Get STRING Description This function is to get a Win GRAF String variable Syntax UserShare Get_STRING ByVal iUserAddress As System UInt16 ByVal msg As Byte As Byte Parameter iUserAddress Address of Variable 1 to 1024 msg Get the string value Example Dim str_val As String Dim msg As Byte Get String value of the Win GRAF String variable with address 7 UserShare Get_STRING Convert ToUInt16 7 msg str_val byte_array_to_unicode msg Private Function byte_array_to_unicode ByVal buf As Byte As String Dim tmpmsg As String If buf Length gt 255 Then Return Nothing End If tmpmsg System Text Encoding GetEncoding UTF 8 GetString buf O buf Length Return tmpmsg End Function Demo program CD ROM 1 R W String variable napdos Win GRAF demo project vb net_2008 demo demo_vb04 Win GRAF User Manual V 1 01 Oct 2014 by ICP DAS 13 14 HE Set_STRING Description This function is to set a String value to the Win GRAF String variable Syntax UserShare Set_STRING ByVal iUserAddress As System UInt16 ByVal msg As Byte As Byte Parameter iUserAddress Address of Variable 1 to 1024 msg the string value Example
129. 255 1 502 Build in progress Please Walt Cin GARAFSProjects4 Demolt a If the Win GRAF is running in Demo Mode this message means the Win GRAF project can run for up to 15 minutes in the PAC Win GRAF User Manual V 1 01 Oct 2014 by ICP DAS 2 18 2 3 5 Download the Program to PAC Before downloading the program you need to set up the communication parameters By now it only supports the Ethernet TCP IP 1 Mouse right click the project name i e Demo01 and select Communication Parameters to open the settings window File Edit View Insert Project Took Window Workspace PAC Tim Sea Demo et 2 Enter the PAC IP 502 e g 192 168 255 1 502 to add an IP address and then click OK It can also click the L button to add modify the IP address Note the default PAC IP is 192 168 255 1 and the fixed port number of Win GRAF PAC is 502 Communcaton Settings Wt Cancel 192 169 255 1 502 lod 142 169 2505 1 502 Tips All the configured IP will be listed here You can select the unwanted IP and press Del key to delete it e g 192 168 78 8 502 192 168 78 8 502 ha 192 165 255 1 502 192 168 71 19 502 192 169 78 9 502 Communication Settings Ethernet TCP IP IF adress 192 168 255 1 Fort number Serial link FPL port Baudrate Parity Shop bits
130. 255 1 502 a tx 1 1 Note 21 means this program is opened locked cannot be deleted Click the X in upper right corner of window to close this program un locked i i Win GRAF User Manual V 1 01 Oct 2014 by ICP DAS 2 16 If you want to add a program to the first line after completing the programming follow these steps 1 Click the upper left corner of the Program Editor Area and you will see the selectable items on the Object bar Select an object 4 to 7 as the screenshot below to add a program to the first line Note You can also select an object 1 to 3 to add it on the left of the current program 5 Inst_BLINK LED il Add a object on the left of the current program LED 1 Insert contact before shift F4 l 2 Insert horizontal line shift space Sea 3 Insert FB before shift F8 z A 21 AA Output Ees Add a object on the left of the program l a 4 Insert jump shift F9 Sete 5 Insert Coil F9 l i a 6 Insert new rung E 7 Insert commecnt line v a ee 4 gt PAC Time Variables LDI j 2 In this case click Insert new rung to add it to the first line TIE Lee Ht A it hH LED A T LED 4 e 20041 1 0 a Output gt hn A OK AA a Output N IK 12 Outputs w oH Salil mm E e gt PAC Time Variables LD1 Win GRAF User Manual V 1 01 Oct 2014 by ICP DAS 2 17 2 3 4 Compiling the Program In the previous section we have added an
131. 2W I 87084W l 7083 and l 7080 Mod le S aaria E ON E E abmmerntateaecedaneeeeeriadiacdies 4 23 API COUNTER START conien T N AN 4 23 AA COUNTER STOP oiea cde cemni cna enced ueaiatnGatan dedi anusueeneten 4 25 AEI COUNTER GE li dcecsenesssiacnaxoacacnnnccestancscaecosetia O 4 26 49 4 COUNTER SS ATE braises ea 4 27 BOS COUNTER RES Toere a tueeatene enlatae echt oieccetonn 4 28 Ping ip Test an Ethernet Internet CONNECtION cceeeesseeeeeececccccccseeseeeeeeeeeeeesseeeeess 4 29 I B088W 8 channel PWM Output MOdule ccccceeccccsssccessececeeceeeeeeeseeeceseeeceeeeeeees 4 31 Modbus Master connecting to Modbus Slave Devices cscsccscsecscsccscsccecsceccnceees 5 1 Enabling the Win GRAF PAC as a Modbus RTU ASCII Master ccccecscecscssseseeeeseeseesess 5 1 Sk Red Dra anea a EAE E EAE a 5 3 SLZ Wite DO Data ea a a a a mer eeeieetere 5 6 513 Read All Data ieina E a erated 5 8 SA Wire AO Data 16 pit honran e EA O 5 11 S15 We AO Dita 2 Di ears a a hada 5 13 MLO MOwWtou sethe XV BOITO nenii aa E a E A 5 15 5 1 7 Connecting the XV107 XV107A 8 DI 8 DO esssssssssessssrsrsrsssesssrsrrrrreesssssrereree 5 21 5 1 8 Connecting The XV 110 16 DI eeo ine EE Bevustseds 5 23 StI Connecting the XV111 XVTITA 16 DO hirae E 5 24 5 1 10 Connecting the XV116 5 DI 6 Relay sesessssseessssreesssrrrsssrersssreressreressrrressreresses 5 26 5 1 11 Connecting the XV308 8 Al 8 DIO ssessssssssssrssssrrs
132. 4_freg 8 Variables 1D2 0 i80 100 DINT Types ID2 1 0 DINT ID2 2 0 DINT ID2 3 0 DINT _ amp lt anal lt gt 4 gt Main Variables NewSpy1 Build 7 xX If set the i8088 Cnt0O as 500 Burst mode the i8084_Freq0 value will become O after the I 8088W outputs 500 PWM pulses You can try to change the i8088 Cnt0O value and then set the i8088 RunO as TRUE to view the changes of output Win GRAF User Manual V 1 01 Oct 2014 by ICP DAS 4 34 Chapter5 Modbus Master connecting to Modbus Slave Devices This chapter lists the way to enable the Win GRAF PAC as a Modbus Master to connect Modbus RTU ASCII Slave or Modbus TCP UDP Slave devices If you want to use one XV board in the WP 5xx8 refer the Section 5 1 6 to Section 5 1 11 5 1 Enabling the Win GRAF PAC as a Modbus RTU ASCII Master Application Diagram Win GRAF PAC Modbus RTU ASCII Master Recommend to connect Max 32 devices port Max 32 Ports i 8142iW oO i B144iW Other Modbus RTU ASCII Slave Device XPAC XP 9xx8 CE6 XP 8xx8 CE6 WinPAC WP 8xx8 tM Series O Modules WP 5xx8 ViewPAC VP 25W8 one to one VP 4138 Modbus RTU ASCII A Slave Device RS 422 485 Modules i 8142iW 2 ports i 8144iW 4 ports Refer the P1 1 to view all PAC models Follow these steps 1 Mouse click the Open Fieldbus Configuration tool button to open IO Drivers window Wi
133. 55 255 255 0 Default Gateway The LAN1 IP and Mask Rt ofthe Passive PAC i g 1 D Right now Win GRAF will show Communication error because the current Active PAC IP e g 192 168 71 37 and the communication IP settings on the workbench e g 192 168 255 1 are not on the same network domain So stop the connection and change the communication IP of this demo _RDN_ 2 project to 192 168 71 37 refer Section 2 3 5 Communication Parameters and then check if the PC s IP is on the same network domain e g 192 168 71 x Then this project will always link to the Active PAC whenever user want to debug it or change it 192 166 7137 502 Win GRAF User Manual V 1 01 Oct 2014 by ICP DAS 16 13 5 After re connecting with the PAC click NewSpy1 to open the spy list window and you can see the current Active PAC is the Main PAC Note Redundancy x Don t switch control right if the Passive PAC is not ready i e is Passive ready Redundancy ig not enabled in the runtime FALSE because it cannot receive the redundant data from the Active PAC Running as active runtime The user can click the Redundancy Passive runtime is alive button to switch control right for testing Running as passive runtime File Edit View Insert Project Tools Window Help al Maal E Fe HE Es Ge Workspace 0000 HewSpy1 spl g gt demo_rdn_ 2 RUH
134. 66 255 1 502 F 54 261x168 o 0 100 gh Tips Mouse click the Program Editor Area and press the or key to zoom in or zoom out the content Inst_TIMIE R1 Get c R1 Get current HEn TIME GET E I Current tim PAC ear Current time of th Year PAC_ ear PAC Month PAC_Month mae A Month a g E g press key twice to PAC Week zoom out the content a PAC Hour wiDay PAC VWeekDay i PAC_Minute PPAC_Second Hour PAc_Hour Set_new_ti Po ceti TIME_SET I new time f Minute HPAC _Minute new ear Year A Program Editor Area LD This area allows to edit or display this LD program you can click the object button on the left of Program Area to add a program and then drag and drop variables in the Variables Area onto the function block one by one Win GRAF User Manual V 1 01 Oct 2014 by ICP DAS 2 5 R1 Get current time of the PAC R2 Set Set_new_time to True to set the new time Inst_TIMIE_SET Set nev time Inst_TIME_SET En TIME GET Eno l l Current time of th new time for the F Year PAC_ ear new ear Month HPAC Month new Month Day pF Day new Day wDay PPAC_VWeekDay newe Hour PAC Hour new _Winute PAC Minute new Second PAC Second Set neve time R3 Reset it to False R l B Variables Area This area shows the function blocks and variables that used in this program Mouse double click the Name or Type item
135. 8W function block 8088W l A me Setting Description 8 Ch PWM outputs and 8 ch Digital Inputs Note To control PWM outputs of the 8088 W first connect the 8088 in 170 board windows then use the PWM _8088w function block to control each PWM channel After linking the i_8088 and the i_8084_ freq I O boards it will auto add related variables in the Variables window or Variables Area And you can also declare all the variables that will be used in the program here refer the Section 2 3 1 Workspace variables As demo _8088w Y im i Init value Description H C Exception programs a HLI Programs i9088_FreqQ unit is Hz init as 100 88 Main i8088_Duty0 REAL O 05 0 001 0 999 0 1 99 9 L Watch for debugging is086_CntO DINT O 1 init as 1 Continuous mode 1 fl Soft Scope i8088_Run0 O Set TRUE to start Set FALSE ES Initial values i8088_ State E Current State SJ NewSpyl d RETAIN variahle EN Oi OS To declare all the variables that TRTE DT BOOL Input L 1X1 1 i8088_DI_1 BOOL Input o will be used in the program 1x1 2 i8088_D BOOL Input O 1x1 3 i8088_D BOOL Input O a 2 13 1X1 4 i8088_DI 4 1x1 5 i8088_DI_5 L6 Double click it to change its name Refer the Section 4 1 DINT nas quency ch of i S064 VY ID2 1 DINT Input LJ ID2 2 DINT Input E 1D2 3 DINT Input E ID2 4 DINT Input O 1D2 5 DINT Input O ID2 6 DINT
136. A 12 17 VB net 2008 Program Running in WP 8xx8 Access to Win GRAF Variables 13 1 Add an Existing Win GRAF Project from a ZIP euroari eaa E E 13 1 Publishing the Win GRAF Variable for NET and Soft GRAF HM1 cc cssecceeseceeeeeeees 13 2 Create anew V BANE PDO SCE x cc sccesstres dene dunsascunnsswemenssaaensues a a a 13 4 1331 Add Project Referen Cerura tnacie ios eee eid a eet ciate eis eee 13 5 COMPINING THEA DON GATION sxc cated a a e a A a O 13 7 Usern ged hoe Bene er erence E TE E 13 8 135 1 R W Boolean FUNCIONS cromare a aaaeei 13 8 13 52 IAteger R W FUNCUON Srecna o a a soiecseeisenise 13 10 13 5 3 R W Real Variable Functions ssssessssesssensssersssersssresssrsseressrressressrrrsseresseresse 13 12 13 5 4 R W String Variable FUncHUON Serora ninan na ER EEEE ERE ROSEA 13 14 13 5 5 How to use VB NET R W to Win GRAF String Variable eeen 13 16 C net 2008 Program Running in WP 8xx8 Access to Win GRAF Variables 14 1 Add an Existing Win GRAF Project from a ZIP cccccssecccssecccesececeeeceseeseeeeeecesseecesagaees 14 1 Publishing the Win GRAF Variable for NET cccccssscccessececesececeeeceeeesceeeeeeeseeecesseneeees 14 1 Create a NOW CRP IOleC Uiiccostcssccksccouasaset acon tonscdet ones tee eanecadaitansstuvsanaeei creat woomadesteanreiectses 14 1 14 31 Add CH Project Referen eearri a iota eka estaba ees eee 14 3 Compiling the Application Program ccccsscccssseccsos
137. AF Test Sele Fil Edit View Ins E Tools Window Help 8 fe E AEs See mmx AT naa e o Inst_ BLINK A fa Global variables nl _ lt RUN BLINK Q swt BOOL Clean all T OUT1 BOOL Download All Projects T 2s CYCLE 1 i pettings E All Hobe O gt gt E _ ___________ 1 E Used Gy Pro ject 9g nbs defines m GmAdvanced O ss GS Variables E A Blocks Sovlist Define ENUA Types ie l Variables _ Main Build Building application data n lt IBOOLZSINT O INT 1 DINT REAL 0 LINT LREAL 3 TIME 1 STRING CRC 1102ac76 gt On Line Change not possible too many variables elocating code This message can be ignored when just lt Code CRC a9cc42e6 File CRC fea01925 Size 1832 gt enable On Line Change No error detected 4 gt Build Grossreferences Runtime Callstack Breakpoints Digtal sampinatace Prompt HMI Offline 192 168 71 18 502 0 90 692x18 0 0 Win GRAF User Manual V 1 01 Oct 2014 by ICP DAS 9 3 Setup the Number of Variables When the On Line Change is enabled you have to set up the number of variables reserved for the declaration of the new variables and Function Blocks for future on line change usage 3 The same as the step 1 mouse click Project gt Settings from the menu bar then double click on the On Line Change to show the setting window Please set the needed new number in the Value or
138. AL OTHER_VAR_now DINT D Sot Scops 3 Ir ial vahues D Nagy Hi Binding Congsration 7g Global deines A Y apatist E Types 3 Al J Poet 3 Advarced uj Ahaoe 3 Anys a AS etalon T BACnet a SI ER FY fe nF Bodoms gt 1 Gtecks ipo ot Wa ii preter s t Must Creme tetetenoer Horgan Cal stack Wweweperer Depta ramopino trace tomet HI Offline 192 162 71 19 502 i0 32x 18 0 0 Limitation This project is not good at handling Retain variables which value changes frequently For example value changed about every second or every minute That is because these retain values of this project are saved within files in the System_Disk The file operations in it consume more CPU time which will slow down the PAC performance if retain value changed frequently The demo _wp5_retain project has the following default values Please set your own proper initial values MAX_VAR_REAL 100 Max amount for retaining REAL variables MAX VAR _OTHER 100 Max amount for retaining integer Bool Timer variables Dim of REAL_VAR_now and REAL_VAR_ old 100 0 99 the same as the value MAX_VAR_REAL Dim of OTHER_VAR_now and OTHER_VAR_ old 100 0 99 the same as the value MAX_VAR_OTHER Note The bigger the value of the MAX_VAR_REAL and MAX_VAR_OTHER the larger the PAC cycle time will be So it is better to declare just fine value for the MAX_VAR_REAL and MAX_VAR_OTHER Win GRAF User Manual V 1 01 Oct 2014 by ICP DAS 6 7 Thi
139. AN1_ak DIMT_1 DINT_2 REAL_1 FREAL_2 TMF _1 To_tick_TMA_1 To_stop_TMA_1 ET Y050_COM_err ETYO50_D00_0 ReadBack ETY050_D0_1_ReadBack ETYO50_D0_2 ReadBack ETFO50_D0_3 ReadBack ETYO50_D0_4 ReadBack ETYO50_D0_5 ReadBack ETYO50_D0_0 ETFO50_D0_1 ETYO50_D0_2 ETYO50_D0_3 ETYO50_D0_4 ETFO50_D0_5 ag Global defines Varables Types lt 4 NewSpyt 10 Drivers PAC Time is Main Active TRUE Na ROW control Description The Main PAC is Active gt It allows to switch PAC control right only when the Passive PAC is ready Setup as Retain variable in the program Retain and_tirner Setup a Retain variable in the program R etain_and_timer Setup as Retain variable in the program Retain and_tirner Setup as Retain variable in the program Retain _and_timer Set TRAUE to start ticking timer Set TRAUE to stop the ticking of timer 0 No error corm ok Communication error of the ET 060 Relay O07 5 of the ET 060 Relay 0 5 of the ET 7060 Relay 07 5 of the ET 7060 Relay 07 5 of the ET 7060 Relay O07 5 of the ET 060 Relay 0 5 of the ET 7060 Relay 07 5 of the ET 7060 Relay 07 5 of the ET 060 Relay O07 5 of the ET 060 Relay 07 5 of the ET 7060 Aelay 07 5 of the ET 7060 Relay 07 5 of the ET 060 iii Variables aw Retain and timer Enter some values for these retain variables DINT_1 DINT_2 REAL_1 and REAL 2 and set To_tick_TMR_1 as TRUE to st
140. AS 4 9 4 5 i 87018W 8 channel Al The I 87018W is an 8 channel analog input module Data type REAL that provides thermocouple input current input 20 mA to 20 mA and voltage input 15 mV 50 mV 100 mV 500 mV 1 V 2 5 V See the Chapter4 P4 1 to add this I O board Important Notice 87018ZW is better than I 87018W I 87018RW 87018PW because A Each channel can use different range type setting B Accuracy is better and total 10 Channels C Temperature input with sensor broken line detection Please visit h www icodas com roducts Remote 10 i 87k i 87018z htm 87018W does not support sensor broken line function 1 Mouse double click the i_ 8018 O8ch to open the Properties window and then to see the setting description tt T O Boards Bile inka co i 1 or ee j ico Parameters Tmp_F 16 FF Key 6_ Rei 16 97018 Emp SR 16 01 ChO si tme 16 05 16 0 16 0 Ch3 scale 16 0 Ch4 scale 16 0 Ch5 scale 16 0 16 0 Ch _scale 16 0 Reserved 0 Reserved 0 Reserved 0 OOM Poe ggg HEES r S N 5 8 J Reserved 0 L87018 87018RW 7 8701 SPW A Close x i_87018_08ch Properties R Setting Description 8 Ch Analog inputs Value type is REAL Important 1 1670182 is better than 87018 87018RW 7 1 87018PW because 4 Each channel can use different range
141. BOOL OR ce ee a 110_DI_03 Data exchange 3 FFFF Default 11 0 DI 07 BOOL a pena S V110_DI_04 Data exchange 4 FFFF Defaut anatre Ba gi 2110_D1_05 Data exchange 5 FFFF Default KE Types AY110 DI 09 BOOL 2v110_DI_06 Data exchange 6 FFFF Default eet 110 DIL10 BOOL e 110_DI_0 Data exchange fd FFFF Default ae rs AY110 DI 11 BOOL amp 110_DI_08 Data exchange 8 FFFF Default Tae x 110 DI 12 BOOL 110_Dl_09 Data exchange FFFF Default lt _ A 110 DI 13 BOOL 110_DI_10 Data exchange FFFF Default a ea 110 Dl 14 BOOL e 110_DI_11 Data exchange FFFF Default ae ters AV110 DI 15 BOOL amp 110_Dl_12 Data exchange FFFF Default A0 tal DINT V110_DI_13 Data exchange FFFF Default ina v 110_DI_14 Data exchange FFFF Defau l Sue 2 W110 DI 15 Data exchange FFFF f tault Name Value 110_status Error report Default Note The Offset value is starting from O and the Modbus address for variables is equal to the Offset value plus 1 Base address Moreover if you set the Operation as Error report the Offset value for the mapping variable Date Type DINT must set to O MODBUS Master Request Request z Description ral i The Net ID fixed to 1 of the MODBUS Request Slave device i e XV board J AE AG ned ce z1 gt Read Coil Bits p m ff r Data block Base address 1 Nb items 16 Start from addr 1 and read 16 data Activatio
142. C Time ssccsscssscssscsscssccnssceseescnsssesesens 10 1 A Data CONVESSO Nerine a N A E AA 10 1 AO Data Convers Oeann a E a 10 2 Bata VY DG CONV SYSION aisgcesiaeecansetiwecesne ST A 10 4 BCD COmVerslOn ae nc lavcue see naaiicedsaiemuestabasnd le rugietageaaiicke EREN 10 5 Packs Unpack Integer OF BOOLEAN sites Seseiecst oceccatnaiecs ait A 10 6 Pack Unpack BYTE WORD DW ORD oniiir aa autaarie ttn aurserha N 10 8 Unpack Variable to Byte Array or Pack Byte Array into Variable cccccceseeeeeeeeeee 10 11 Get SEU The PAC TiC sce cssencscaccash cectecsasanadtaeceetenans EAT E 10 13 Commonly Used Tools and Usefull Tips ccscsccscsceccccscsceccccscsceccccecsceccccscscsceecess 11 1 Uperade WiIn GRAP LIDE S aranense aa 11 1 Upgrade WINMGRAEDFIVET mranani aa a a 11 2 SPV E eane E E E E tngeeeaaee tia 11 3 Backup Restore a Win GRAF Project eesesssssssssrrrrsrrrrrrrereeeeeesssssssrrrrrtrtrrrrreeeesesssrrrrrererres 11 5 Sotware ReDOOLa PAC inoran a a a NA N 11 7 WSing STSyntax in LD and FBD arssisian a 11 8 APPa Recipe IN tie PAC ariera anae E a 11 9 Get the Functions and Function Blocks that Supported by the PAC ccccssseeeeeees 11 11 Upload the Win GRAF Source COdEe ccccsssecccesececeesceceenccceesececeuscessuneeeseaecesauscesaeaees 11 14 Set Wi the PAC Rass Ww On oiiro tas EE E Sag vad decwsnesb ota E E 11 16 Using Function Block in the ST Program ccccccssecccsececessceccesececeesceseeseeee
143. D address of the module can be 1 to 255 Must use a constant value not a changed value Output Parameters OK Data type BOOL TRUE Communication is Ok FALSE Communication failed RH Data type REAL The value is Relative humidity unit is 1 For example a value 45 7 means 45 7 Temp_C Data type REAL The temperature value is in Degree Celsius For example a value 25 7 means 25 7 Degree C Temp F Data type REAL The temperature value is in Degree Fahrenheit For example a value 78 26 means 78 26 Degree F Win GRAF User Manual V 1 01 Oct 2014 by ICP DAS 8 12 Chapter 9 On Line Change On Line Change function allows Win GRAF PAC change its application to a modified one during the PAC running time The modified application must be the same name as the original one that currently running in the PAC The On Line Change is primarily used for emergency such as when the application is not allowed to be disabled or stopped for a while or cannot find time to replace a new application for example the device needs 24 hours operation and cannot be stopped Except the above situations it is not recommended to use this function You had better stop the running application then download the modified application to the PAC see Section 2 3 5 which is more safe Application 1 A little modified Win GRAF Application 1 pa Original Zra WP 8xx8 ONLINE CHANGE Ph 9 1 Limitations of
144. E Declare password_ok variable as BOOL Operations in the first PAC cycle if INIT then INIT FALSE No more first cycle get the hardware serial number PAC_SN No_0 No_1 No 2 No 3 No 4 No_5 No 6 No 7 Win GRAF User Manual V 1 01 Oct 2014 by ICP DAS 11 21 Please use your own algorithm for the PAC_password value PAC_password No_0 No_1 No_2 12345 No_3 No_4 No_5 No_6 No_7 Read the password value from a file my_product pwd in System_Disk Win GRAF file_name System_disk Win GRAF my_product pwd file_id f_ropen file _name if file id 0O then can not open file set password to 0 password 0 else open file ok read the password if f eof file_id then reach the end of file else hasn t reached the end of file read a string form it Tmp_ string fm_read file_id Convert a string to a DINT value password Any_to_DINT Tmp_ string end_if f_close file_id close file end_if check if the password is correct password ok FALSE set it as FALSE in the beginning if password PAC_password then password ok TRUE the password is correct end if end_if LD Program LD2 If the password_ok is FALSE it means the password is incorrect then will exit the program Only when the password is correct can the program execute continuously and then your application can be pr
145. EAL_ 1 10002 retain a LREAL variable 64 bit end if Win GRAF User Manual V 1 01 Oct 2014 by ICP DAS 6 1 You can check set variables in the Variables window if you are not familiar with the way of the variable declaration please refer Section 2 2 2 and Section 2 3 1 Variables Hs T Name Type Dim Attrib Syb Initvalue User Tag De t Global variables Al BOOL 1 BOOL LJ BOOL 2 BOOL C DINT_1 DINT LJ DINT_2 DINT LI DINT 3 DINT LJ INT_ARY INT 0 9 C LINT 1 LINT C LREAL 1 LREAL a on_line_ change cycle DINT L REAL 1 REAL LJ REAL ARY REAL a O LI retain_done BOOL 20 s L tmp_bool BOOL C v w Note ICP DAS Win GRAF PAC does not support the RETAIN variables Functions in the Variables window so please refer the five Functions in the following sections to use the Retain Variables Variables i 4 TY Name i Type Dim Attrib Syb Initvalue User Tag Description la RETAIN variables EAE New ar BOOL L A lw Win GRAF User Manual V 1 01 Oct 2014 by ICP DAS 6 2 6 1 1 RETAIN VAR Retain a Variable RETAIN VAR Press F1 key to see the detailed setting descriptions Name A variable name DO NOT use Array variable or String Variable type can be BOOL SINT USINT BYTE INT UINT WORD DINT UDINT DWORD REAL TIME LINT or LREAL Addr Data Type DINT The address number for retaining the variable can be 1 to 12
146. Export 2 In the Export Assistant window click Export some project items XNL and Next ae Help ee oOo 9 amp Marh GAEso GBs File Edit View Insert Proj as d SOBRE l lO Drivers m MODBUS Master Name Value i Open MODBUS 192 168 1 100 502 Mode Open MODBUS nead Input Bits Address 192 168 1 100 a 0 boo Port 502 Convert T 1 boo_2 Reconnect after error ene E 2 boo_3 Slaves diagnostics Eror report ERROR_STATUS1 Delay between requests ms 10 Ey Binding Configuration B lt 4 gt Read Input Registers 3g Global defines kS em 40 1 DT Each Modbus TCP Master can only set to j z Export Assistant connect one Slave IP address so here we will show the way to copy and generate the second Modbus Master to connect the second Slave IP address Welcome to the Export Assistant What do you want to export lt Export a pete silos tied ion S000 R 8000 z Cancel Win GRAF User Manual V 1 01 Oct 2014 by ICP DAS 5 48 3 Check the Configurations and uncheck all other items and then click Next Export Assistant Select items to be exported C Programs and UDFBs Main C pOnBadIndex J pOnDivZero pShutDown J pStartup Dale bis Configurations Ba Tap MODBUS Master export referenced global variables 4 Browse a suitable path default in C Win GRAF Projects and named for the file e g Master
147. FFF Default l AE gt EE 10 Drivers Variables Note The Offset value is starting from 0 and the Modbus address for variables is equal to the Offset value plus 1 Base address Moreover if you set the Operation as Error report the Offset value for the mapping variable Date Type DINT must be set to 0 MODBUS Master Request Request Description Slave Unit The Net ID fixed to 1 of the MODBUS Request Slave device i e XV board lt 2 gt Read Input Bits A 3 gt Read Holding Registers TA lt 24 gt Read Input Registers LO Wisikn minal enil bit Data block Base address 1 Nb items 4 Start from addr 1 and read four data Activation Periodic 50 ms lo On call z z On change Read every 50 ms Misc Timeout 100 a An exception occurrs if no Nb trials 1 respond for 100 ms Win GRAF User Manual V 1 01 Oct 2014 by ICP DAS 5 34 2 Mouse double click the 2nd data block i e lt 15 gt Write Coil Bits to view the setting window Workspace 10 Drivers Hs B E demo_X 310 E Mg MODBUS Master T Name Type gi C Exception programs a G ATU COMO 115200 N 8 1 MYV310_ AO 1 INT A i C Programs B H A lt 4 gt Read Input Registers 1 1 4 Y310_ status DINT a Main 23 BSS Ae xV310_D0_0 BOOL Watch for debugging E f lt 2 gt Read Input Bits 1
148. Fan Name Male Status 1 Error report 0 ros EFEF Defanit poo atetxthange 0 FFFF Defaut Act_0 Command fone shot lo FFFF Default lt Data exchange aan opier dag eo ae a Error report Set only Or going request Succes counter Fail counter Retry counter ae Command enable Reset counters Slave last error Slave last eror date stamp Slave last error time stamp Clava last rasak daka staran t Win GRAF User Manual V 1 01 Oct 2014 by ICP DAS 5 7 5 1 3 Read Al Data 1 Using the same way in the Section 5 1 Step 4 to create the third data block and completing all the following settings in the MODBUS Master Request window and then click OK MODBUS Master Request In this example Request a Slave Unit Description Enter the Net ID of the Slave device Slave Unit 3 Sancel e g the Net ID is 3 MODBUS Request b MODBUS Request lt 2 gt Read Input Bits N Select lt 4 gt Read Input Registers lt 3 gt Read Holding i T d Base address Start from 1 by default En WMvika min nle amil bik Data block Q bass aidais Refer the Section 5 1 1 to change it Nb items fb items The number of Al signals to write Activation In this case the number is 10 Periodic jms 15000 i F Pa l i Periodic Refer the Section 5 1 1 O On call on er
149. Function to convert the unpacked BYTE into SINT type En HIB TE En ANY _TO_SINT Ena OOM Os tes jp_Temp BYTE Temp_By TE IN f SINT_Hi LOBYTE Eno OOM p E ANY TO WORD INT_VAL_1 En ANY TO SINT Eno Os Temp BYTE Temp_BYTE fh LSINT_Lo ANY TO WORD INT WAL 1 Pack Two 16 bit Data into One 32 bit Data If want to pack 2 WORD or UINT into a DWORD or UDINT you can use a MAKEDWORD Functions DWORD_VAL_1 MAKEDWORD Hi_word Lo_word LD FBD Program ST Program En MAKEDV WORD Ena Hi orc H Q eOYYORD MALI Lo word4Lo MAKEDY ORD Hi word j il E DWORD WAL 1 Lo word Win GRAF User Manual V 1 01 Oct 2014 by ICP DAS 10 9 If want to pack 2 INT into 1 DINT you must first use an ST program ANY_TO _WORD to convert INT to WORD and then use an ANY_TO_DINT Function to convert the unpacked DWORD into DINT type MAKEDWWORD Eno A al Temp DVVORD Temp DVVORD a a DINT AL En AMY TO _VVWORDCHi_int ANY TO WORD Lo_ int Unpack One 32 bit Data to Two 16 bit Data If want to unpack one DWORD or UDINT to 2 WORD or UINT you can use HIWORD LOWORD Function Blocks ST Program Hi word HIWORD DWORD_VAL_1 Lo_word LOWORD DWORD_VAL_1 LD FBD Program En HORO Eno O DWORD VAL 4 in gfHi word En LOW ORD Eno O DWORD VAL 4 ing blo word HMO R Ci DWORD WAL 1 rl ts 1 i Hi word LOVWORD DWORD WAL 1 pe Gy Lo word If want to unpack
150. Generation Release i Exchange lOs while stepping Yez Win GRAF User Manual V 1 01 Oct 2014 by ICP DAS 10 7 10 6 Pack Unpack BYTE WORD DWORD Pack Two 8 bit Data into One 16 bit Data If want to pack 2 BYTE or USINT into one WORD or UINT you can use a MAKEWORD Function ST Program WORD_VAL_1 MAKEWORD Hi_byte Lo_byte LD FBD Program En MAKEVWWORD Ena m leo 4 T I G lt E lg as ly 4 T Ii a MAK EVVOR LD Hi byte 128 Lo pyte 0 Gy WORD VAL T 32766 If want to pack 2 SINT into one INT you must first use an ST program ANY_TO_ BYTE to convert SINT into BYTE and then use an ANY_TO_INT Function to convert the packed WORD into INT type En MAKEWORD AOON al Temp WORO Temp WORD NT YAL ANY TO _BYTECSINT_HI ANY TO _BYTEPSINT Lo Unpack One 16 bit Data to Two 8 bit Data If want to unpack one WORD or UINT to 2 Byte or USINT you can use HIBYTE LOBYTE Functions ST Program HIBYTE WORD_VAL_1 LOBYTE WORD_VAL_1 Win GRAF User Manual V 1 01 Oct 2014 by ICP DAS 10 8 LD FBD Program HIB TE Ena HIB TE Eno WORD VAL 1 LOBYTE Ena LOBYTE Ena OTT WORD WAL 1 WORD VAL 1 pe Gey Hi byte LUBYTE WORD VAL 1 pe Gy Lo byte If want to unpack one INT to 2 SINT you must first use an ST program ANY_TO _WORD to convert INT into WORD and then use an ANY_TO_ SINT
151. I O module will light up 4 gt e ae FMEA Es SA Workspace E P Demoli RUN E O Exception programs Sl C Frograms eP PAC Time Get ie LD Blinking A C Watch for debugging li Soft Scope i a E Initial values Ajg Binding Configuration a Sg Global defines 2 Ir Varables RUM BLINK lt Mm E ali a FAC Time Wariables LB Inst_BLIMK E R IK1 0 18055 Dil LED TRUE E z l W OX1 1 1 80656 DO 0x1 1 0 0utputi TRUE Bot LED TRUE YOON 1 1 Outputs TRUE Bot Fol 10 Outputt TRUE Fo 77 Output TRUE HotU 1 Outputs TRUE 6 Click the A tool button again to cancel the PAC connection Note Do NOT click the Stop Application button it will stop the running project in the PAC Win GRAF User Manual V 1 01 Oct 2014 by ICP DAS 2 23 Chapter 3 Modbus Slave Allow the SCADA HMI Software to Access Win GRAF Variables In Chapter2 we have described how to get set the PAC system time i e the PAC_Time program and create a blinking function i e the LD1 program in the Demo01 project The following sections describe how to allow the SCADA HMI software e g InduSoft to access Win GRAF variables that defined in the Demo01 project The Win GRAF Workbench provides two ways to open the PAC data one way is to enable the Win GRAF PAC as a Modbus TCP Slave and the second way is to enable the Win GRAF PAC as a Modbus RTU Slave you mu
152. I Win GRAF PAC Disi IP 192 168 71 19 lt amp E Port 502 ndasa lt E Slave number 1 WP 5xx8 WP 8xx8 Modbus TCP Master Modbus TCP Slave Refer the P1 1 to view all PAC models After completing all the steps the HMI SCADA software can access to all the Win GRAF variables listed above via Modbus TCP protocol Win GRAF User Manual V 1 01 Oct 2014 by ICP DAS 3 6 3 2 To Enable the Win GRAF PAC as a Modbus RTU Slave Before doing this you must complete all the content that described in Section 3 1 to open the Modbus Slave data The way to enable the Win GRAF PAC as the Modbus RTU Slave is to add the MBSLAVERTU or the MBSLAVERTUEX function block in the program To begin follow these steps Add the MBSLAVERTU function block 1 Inthe LD1 window mouse click the place where you want to add this function block and then click the Insert FB button on the left side of the window LD1 JE 5 i Inst_BLINK LED Fi NE RUM BLINK a Jul LED Sol 10 Output Sol 1 Output SoC 12 Outputs lt uili 4 gt PAC Time vase Lor Drivers 2 Double click on this function block and select the name MBSLAVERTU then click OK Fa T LNL Natural logarithm LAEAL T LOADCSTRING Get a string fram a table T LOBYTE Low part of a word LOG Logarithm base 10 LOGFILECSY Generate log file in CSW format LOGL Logarithm ba
153. KA Aspmetric blin PLS Pulse signal gene SIG_GEWN Signal gene 5 Double click this function block and select the BLINK then click the OK button aa J Sovlist Define ENUM LD1 l ee JH A J Ft J bH AMVERAGEL Running average LAEAL a T BACNETFMTDTYPES Set BACnet device types formatting T BACNETFMTNAMES Set BACnet objects name formatting In F BACNETMAXMASTER Read Write MaxMaster parameter E T BACNETOYERRIDE Set BACnet OVERRIDE fl F BACNETSETFLAGS Set BACnet flags obsolete Tips 4TH j BACNETSLAVE Controls the BACnet Mak Sle You can press the BL key HON BACNETS TATE Curent BAChet token ring stat icklyv find h Jj 1 BCD_TO_BIN BCD to binary conversion t quIcKIy TING OUL the name raii T BIN TO BCD binary to BCD conversion EE PAC Time Variables LD1 BLINK Blink signal generator BLINKA Asymetic blink signal CANRACY MSG Receive CAN bus message T CANSNDMSG Send CONbus message T CHAR Build character CMP 3 output comparison lt CONCAT Concatenate strings Inst_BLINkK RUM BLINK ER Refer Section 2 2 1 B Click the upper area to change a FB instance variable Click t
154. L BOOL Public_INT INT Public DINT DINT Public WORD ORD Dublie DEAL DEAI Public_REAL 4 Right click on the PUBLIC 9000 and then select the variables that you want to publish and drag them to the Name area Identifier field will automatically generate numbers if other PAC wants to access the data need to set the same ID number Note PUBLIC can use up to 8192 variables Identifier number can only be 1 8192 Binding HRs g O aG Netwod Y Name Type a El PUBLIC 3000 Name PUBLIC 3 fa Global variables A Ro Address Public BOOL BOOL Port 9000 Public_INT INT Public_DINT DINT Public WORD WORD Public REAL REAL y Name Identifier Positive hysteresis 3 u Ee Public BOOL 2 1 _ __ Public_INT 2 pve DINT 3 If the user want to assign continuous Identifier Public_WORD 4 A TE T S ARAL number first click Identifier field and select ie those variables wish to be assigned and then Si click Iterate property to set up numbers i4 gt Binding variables Binding es Ses PUBLIC 9000 101 Public_BOOL Name x ay 102 Public_INT 103 Public_DINT 104 Public_WORD 105 Public_REAL Results Public BOOL Public_INT Public_DINT Public_ WORD Public REAL lt Win GRAF User Manual V 1 01 Oct 2014 by ICP DAS 7 2 EXTERN Setting Steps When the PAC sets up the EXTERN area means will
155. LY Exception programs eae open MODUS 192 168 71 128 502 Li Programs B B lt 2 gt Read Input Bits 1 1 12 connect an ET 050 module and ae PAC_Time E lt 15 gt write Coil Bits 1 1 6 create some data blocks to read write Se ADN _ control i B lt 1 gt Read Coil Bits 1 1 6 gt Retainand imer CMa MODBUS Slave the DI DO data refer the Section 5 2 C Watch for debugging g ay Server Slave number 1 UN Soft Scope B Input Registers 1 2000 Initial values SE zJ New5pyl Request Slave Unit Address Nbltem Activation Period ms Period on eror Timeout ma Number of trials Hig Binding Configuration Hk lt 2 gt Read Input Bits 12 Periodic a S000 1000 Sg Global delings lt 15 gt White Coil Bits 1 1 6 On Change O 0 1000 1 3 ahis 12 Read Coil Bits G Periodic ail ogg 1000 Types lt ii gt 4 F NewSpyi 10 Drivers PAC Time RON control Retain and timer wariables 3 Click NewSpy1 to open the spy list now the Main PAC is Active EE 4 23 BX 3S Ho Tia GB jo GS lR ECLER Workspace Cl m OO HewsSpyi spl l demo _rdn_3 RUN Exception programs FE Hame C Frograms H is Backup ctve ae PAC Time H i Main_ready TRAUE Be RON control is Backup ready TRAUE S r Retain _and_timer is_first_oycle_just_ather switch FALSE LJ watch for debugging is_ Man LANT ok TRAUE UR Soft Scope is Backup LAN1_ak TRAUE is Alive port_ok i Active LANT _ok is Fasse L
156. L_01 Data exchange 1 FFFF Default E060 REO ROOL H Binding i _ ET7060_RL_02 Data exchange 2 FFFF Default ERE BLOF BOGE paga aona ceme S2 ET7060_RL_03 Data exchange 3 FFFF Default FRR Bee BABE F j G Variables ge ET 060_RL_04 Data exchange 4 FFFF Default EUGUI in US abut i oe ET7060_RL_05 Data exchange s FFFF Default EFOR PLEIE ROOL z JA i Fauci RI NS ROO v a MODBUS Master Request x Request 3 Description ra SlavefUnity 1 The Net ID of the Slave Unit MODBUS Request ET 7000 is fixed to 1 lt 5 gt Write single coil bit 6 gt Write single holding lt 15 gt Write Coil Bits Data block Base address t Nb items 6 Start from the address 1 to write 6 items Activation Periodic E ms 5000 oe call fon error On change Write data if data is changed Misc Timeout 500 ms Nb trials 1 If no responds in 500 ms means error Win GRAF User Manual V 1 01 Oct 2014 by ICP DAS 5 46 5 2 3 Connecting the ET 7018Z 10 Al The ET 7018Z is an 10 Al channels Ethernet I O module The Win GRAF demo project for this section is demo _ ET7018z zip Please refer Section 5 2 1 to set up the module channels using the Internet Browser and restore open the demo project Demo Descriptions This demo creates one Data Block to read 10 Al data 1 Double click the first Data Block lt 4 gt Read Input Registers to open the setting wind
157. MODBUS RTU Com port After received an answer Delay between requests wait for 10 ms and then Delay ms 10 send the next request Try to reconnect after communication error Manage diagnostic info for slaves Disabled do not open and manage this port If not need the TCP UDP Port setting check Disabled Win GRAF User Manual V 1 01 Oct 2014 by ICP DAS 5 38 4 Click the icon Insert Slave Data Block in the left side to create a Data Block IO Drivers E MODBUS Master Mame Value Stee Open MODBUS 192 168 1 100 502 Mode Open MODELS Address 192 168 1 100 Fort Biz Reconnect after error Slaves diagnostics Delay between requests ms 10 Disabled a Read Al Data 5 Inthe MODBUS Master Request setting window set up the following items and then click OK MODBUS Master Request Description Slave Unit 1 fa In this example a Slave Unit Fill in the Net ID of the Slave device Usually is 1 Request MODBUS Request b MODBUS Request 22 gt Read Input Bits gi Select lt 4 gt Read Input Registers 3 gt Read Holding Registers fv c Base address 1 lt 4 gt Read Input Registers a AEn vika nimala amil hik B Default to start from 1 CA Data block a Nb items Base address 1 The Al numbers to read here is 4 Nb items 4 l Note If want to change the Base address Ac
158. M_recv Port_number ByteAry 0 200 do proper operations if protocol is correct here assume correct protocols has 25 bytes in this example if NUM1 25 then erry end_if When receive data check if data is correct If yes do the operations the application needed end_if END_CASE Win GRAF User Manual V 1 01 Oct 2014 by ICP DAS 12 12 12 2 4 Report Data Periodically to Remote Device by COM Port If wants to periodically report data to other devices by RS 232 485 422 Port do as follows Win GRAF PAC l Device Every period time e g 5 sec put the l l data to be sent into array Type BYTE E Check if receive the complete and send data by Function COM_send and correct data krs And then do proper operations Refer P12 1 to open the project demo_com_port4 zip and view add variables in the variable area SFC Program Refer Section 12 2 2 to open the Action window Declare Port_OK as BOOL TMP_DINT as DINT ByteAry as BYTE and Dim 100 Port_number as DINT and has an initial value 2 Action P if port is not open open it if COM_status Port_number FALSE then Port_OK COM_open Port_number 19200 E 8 2 end_if End_ Action Open COM2 as 19200 E 8 2 Port OK If succeeds do the next 5 Action P The sent data concers with prepare ByeAry to be sent your application please Fa use COM_send to send Send it here send 20
159. Modbus Master TCP UDP Port or can set up not to enable the setting Win GRAF User Manual V 1 01 Oct 2014 by ICP DAS 5 37 IO Drivers Name Value fa Global variables A tel RETAIN variables Add Configuration Choose a configuration E All MODBUS Cancel ga MODBUS Master i MODBUS Slave 3 Click the tool icon Insert Master Port in the left side open the setting window and select the MODBUS on Ethernet Set up the following items and then click OK Address Port Protocol Delay Fill in the IP Address of the Modbus Slave device e g 192 168 1 100 TCP port Number of the Slave device If as a Modbus TCP Master select the TCP Open MODBUS If as a Modbus UDP Master choose the UDP Open MODBUS Fill in the delay time e g 10 ms can be O 10000 rE E l Drivers MOODBUS Master Name alue Y Ni fa Global variables GELAN variables x E dindex F g fero v gt i Address 192 168 1 100 Mode l Value EE Port 502 2 G e Protocol TCP Open MODBUS UDP MODBUS RTU UDP Open MODBUS Serial
160. No of the Counter Encoder module it can be set to 0 1 and so on depends on the module For example when using the I 8093W module 0 means the X axis 1 means the Y axis and 2 means the Z axis Q Data type BOOL TRUE OK FALSE Error Win GRAF User Manual V 1 01 Oct 2014 by ICP DAS 4 25 4 9 3 COUNTER_GET For example Using the I 8093W module in the PAC s slot1 and get the Encoder value of the Z axis ST program Note First add variables in the Variables Area see section 2 2 1 TMP_BOOL BOOL Encoder_1 DINT LD program En COUNTER_GET Tips Press the F1 key for the details on settings Ecoder 1 Port Data type DINT For a module in the slot O to 7 of the PAC set it as 0 Fora DCON module connected to a serial COM port can be 1 to 37 depends on PAC means COM1 to COM3 7 Addr Data type DINT For a module in the slot 0 to 7 of the PAC set it as the slot number 0 to 7 For a module connected to a serial COM port set it as the Net ID address of the module 1 to 255 lO_Name Data type DINT The name of relative Counter Encoder module it can be set to 8084 8093 87084 87082 7083 and 7080 Channel Data type DINT The channel No of the Counter Encoder module it can be set to 0 1 and so on depends on the module For example when using the 8093W module 0 means the X axis
161. O RV Ww GSE v gt sch gt casel HERBE A Aa i sa x Sar H ER kga oy ARNEE E i TS Label_Name txt 2013 5 29 1 MERE testOL txt 2013 6 11 FF 0 AFAA a aNs J Banciao Eva L ftp private dy MAB SS R ftp i L ftp PM downlo 43 Dropbox ESEN Label_Name tt Fiai MSM tt 9 Label Namept il DIB HERES Schedule5 Win GRAF User Manual V 1 01 Oct 2014 by ICP DAS 17 14 17 5 3 Season Configuration Each Target 1 10 includes the Season Always Season 1 Season 2 Season 3 and Season 4 setting items The user can enable or disable each item according to application needs The Searching Priority of Seasons 1 PAC will first search the Season 4 if it is enabled If found the current date in the Season 4 then do the Boolean Integer Real control 2 If not found then search the Season 3 Season 2 at last search the Season 1 3 If not found then search the Season Always to do its control If not found the current date in this Target then do the Default Value control ay Schedule Control Utility Target 1 gt Season 4 gt Normal day ne i ers Back Save to PC Boolean Integer Real I Taree tl Default Value OFF 0 0 0 Season 4 Every year Fram 2013 Dev0 To 201 3 Dec 1 Season Season 2 Season 3 Sema Season Always Normal day
162. Open Fieldbus Configuration tool button to open the I O Drivers window Ve Win GRAF demo X 107 File Edit View Insert Project Tools Window Help aa Tath e AEs Bes Workspace Sj 10 Drivers i demo _XV107 fe Mo MODBUS Master Y Name Type H Exception programs a SRAT COMO 115200 N 8 1 10 7 DLOO BOOL Programs S H B lt 2 Read Input Bits 1 1 8 xv107_DI_01 BOOL a Main 5 4 B lt 15 gt Write Coil Bits 1 1 8 VIN DLN ROO a Soft Scope Ee e E Initial values Request Slave Unit Ai Ea 5 Binding Configuration lt 2 gt Read Input Bits 1 1 O MODBUS on Ethernet 2 i r Global defines gS lt 15 gt Write Coil Bits 1 1 Ride Ai Variables J EE Types Has Port E Build A If using it as the Modbus l Protocol ASCII Master modify it to ASCIl COM0 115200 N 8 1 2 Double click on RTU COM 115200 N 8 1 to open the MODBUS Master Port window L grrr DoT Note Com port COMO0 115200 N 6 1 All the demo programs listed in above table z enable the WP 5xx8 as a Modbus RTU Delay between requests Master device and set the Com Port as Delay ms 0 COM0 115200 N 8 1 Win GRAF User Manual V 1 01 Oct 2014 by ICP DAS 5 15 Configure the Al AO channel If you want to use the Al AO channel of the XV Board e g XV308 XV310 in the WP 5xx8 First stop the Win GRAF driver in the PAC and then configure e
163. Open MODBUS 192 168 1 128 502 ET7060_DI 00 BOOL E Programs a o E nead Input Bits ET 7060 DI 01 BOOL Liaw iin BB lt 15 gt White Coll Bits 1 1 6 ET 060_DI_02 BOOL Watch for debugging Me MODBUS Slave ET7060_DI_03 BOOL UA Soft Scope g ET 060_DI04 BOOL Initial values g Request Slave Unit Address Nbltem Activation Peric ET7060_DI_05 BOOL Mfd Binding Configuration L lt 2 Read Input Bis 102 421 6 Petiodic 50 ET 7060 status DINT 3g Global defines lt 15 gt Write Coil Bits 1 1 6 OnChange 0 ET7060_RL_00 BOOL fa Variables ET7060_RL01 BOOL w ben E Types a gii i gt rere Notice Double click Open Modbus IP 502 to open the MODBUS Master Port window All demo projects in this chapter can enable the Win GRAF PAC as a Modbus TCP Master Please fill in the current IP address of your ET 7000 and set Port to 502 and Protocol to TCP Open Modbus MODBUS Master Port sesssssssssesssesesssesesssssesesssssesssesesessees Dmm Address 192 168 1 128 a Port 502 Protocol E UDP MODBUS RTU UDP Open MODBUS Serial MODBUS RTU Enter the current IP address of your ET 7000 Com port Delay between requests Delay rms 5 Try to reconnect after communication error Manage diagnostic info for slaves Disabled do not open and manage this port Win GRAF User Manual V 1 01 Oct 20
164. PAC by using Ethernet cables 2 Click Controller Time Synchronization button 3 Set a new date hour minute and second 4 Click Set new Controller time button to set the new time to the PAC ad Controller time setting Controller time 901322 6A248 Set new Controller time 2012 6A248 av set new Controller time Win GRAF User Manual V 1 01 Oct 2014 by ICP DAS 17 22 17 5 8 Schedule Control Utility in PAC Site The configuration process in the PAC side is similar as the process in the PC side just a little bit different on the screen Please refer the Section 17 5 2 17 5 6 1 Target Configuration Schedule Control Utility Title Title Target 1 Target 2 Target 5 Target 8 Help about Target 3 Target 6 Target 9 Target 10 2 Season Configuration Target 1 gt Season Always gt Normal day ooo Schedule Controal Utility Target 1 Enable Season Always Enable Always Season Always Season 1 Season 2 Season 3 Season 4 Normal day Enable Apply Schedule 1 w schedule 1 Normal day Schedule 1 _ Sunday Mond Schedule 2 onday Tuesday wednesday Thursday Friday _ Saturday Schedule 3 Schedule 4 Schedule 5 Win GRAF User Manual V 1 01 Oct 2014 by ICP DAS 17 23 3 Special Day Configuration gt Season Always gt Special day Date info Add a new date 4 Schedule Configuration Schedule 1 08 30
165. Passive PAC In the Win GRAF redundant system not all of the data in the Active PAC can be automatically backed up to the Passive PAC What Can be Backed Up Automatically The user s Win GRAF applications The execution step of programs Value of variables Private data of Function Block instance The PAC s RTC Real Time Clock time Retain memory SSS SS YS Schedule control configuration refer Chapter 17 What are NOT Backed Up Automatically The following are the most common items that cannot be automatically backed up to the Passive PAC 1 The status of Timer variable Ticking or Sleeping 2 Files in the Active PAC e g files located in the path system_disk or Micro_SD or files not belong to the Win GRAF applications such as C VB net C and Soft GRAF applications These files cannot be backed up automatically So all of them should be pre installed in a spare or repaired PAC before mounting this PAC in the redundant system Exclusive of user designed Win GRAF application and schedule control configuration which can be backed up automatically 3 If using the COM_OPEN function to open the serial port it will not be automatically opened again after switching PAC control right 4 The PAC s EEPROM memory cannot be backed up automatically All the items which unable to back up automatically users can use the following similar procedures to deal with them Refer the Retain and_timer program in
166. Periodic 50 ms o On call Read every 50 ms On change Misc Timeout 100 l An exception occurrs if no Nb trials 1 respond for 100 ms Win GRAF User Manual V 1 01 Oct 2014 by ICP DAS 5 21 2 Mouse double click the 2nd data block i e lt 15 gt Write Coil Bits to open the setting window Workspace 10 Drivers HIES fl demo_X 107 B S Mp MODBUS Master aji Name Type E E Exception programs CE G ATU COM0 115200 N 8 1 xV107 DIO5 BOOL s E L Programs ce o BB lt 2 gt Read Input Bits 1 1 8 xV107_ DLO6 BOOL foe aE Main B i SE lt 15 gt Write Coil Bits 1 1 8 xV10 7_ DLO BOOL Watch for debugging 7 g 0 XV 107_DO_00 XV107_status DINT p a Soft Scope iz Ce Offset Mask Storage AVIO _DO_OO BOOL pa Initial values A XV107_DO_00 Data exchange 0 FFFF Default AVI07_DO_01 BOOL j t Binding Configuration xV107_DO0_01 Data exchange 1 FFFF Default AVIO _DO_02 BOOL 3g Global defines SS xV107_D0_02 Data exchange 2 FFFF Default xXv107_D0_03 BOOL 5 f Variables ge 107_DO0_03 Data exchange 3 FFFF Default XV107_DO_04 BOOL 3 E Types _ XV107_DO_04 Data exchange 4 FFFF Default AVIO _DO_05 BOOL XV107_DO_05 Data exchange 5 FFFF Default xv107_DO 06 BOOL g V107_DO_06 Data exchange 6 FFFF Default am R V107_DO_0 7 Data exchange 7 FFFF Default p r A i Name Value i m a a es e MODBUS Master Request X Request Description
167. Q7 MyUnpack Q7 Win GRAF User Manual V 1 01 Oct 2014 by ICP DAS 11 18 11 12 How to Protect Your Win GRAF Program to Avoid Unauthorized Copied When you finish a Win GRAF application development and prepare for delivery to the customer please think about the possibility that your Win GRAF application in the PAC may will be copied into another same model PAC Be careful Someone else may steal your hard outcome The following provides a simple and easy way to protect your application Note If you give the Win GRAF application Source Code to the customer then sorry the following method will not protect your program from stolen Because having the Source Code anyone can modify the code and apply into another PAC Each ICP DAS Win GRAF PAC has a Serial Number that has 8 Bytes also known as 64 Bit and each PAC has the different and unique Serial Number Therefore you can use this serial number combine with your own algorithm to generate a password and pre store this password in the PAC s file Then verify this password in your application If not passed the application will not be allowed to execute The steps are as follows This example uses two Win GRAF projects one is demo_passwd used to generate a PAC password and save it into the PAC s file the other is demo_my_ap application that has been developed and ready to ship to the customer Before shipping a PAC to the customer user needs to download the project demo_pass
168. REAL variable controlled by Target 1 BOOL DINT and REAL variable controlled by Target 2 BOOL DINT and REAL variable controlled by Target 3 BOOL DINT and REAL variable controlled by Target 4 BOOL DINT and REAL variable controlled by Target 5 5016 BOOL Win GRAF User Manual V 1 01 Oct 2014 by ICP DAS BOOL DINT and REAL variable controlled by Target 6 BOOL DINT and REAL variable controlled by Target 7 BOOL DINT and REAL variable controlled by Target 8 BOOL DINT and REAL variable controlled by Target 9 BOOL DINT and REAL variable controlled by Target 10 17 12 17 5 2 Target Configuration Every Win GRAF WinCE PAC can control maximum 10 Target Target 1 to Target 10 devices First execute the Schedule Control Utility and click New to create a new configuration file the Targets will show as 10 buttons See the figure below The default Target names are Target 1 Target 10 One Ux Target can set up the schedules to fit different Seasons The Target button will show a to distinguish it is enabled Addition to New a configuration file the user can open an existing file in PC or get from the PAC New Create a new file Open from PC Open an exist configuration file from PC Get from Controller Get an existing configuration file from PAC required enter the PAC s IP and password and then to show on the PC Open from PC Get from Controller Helprab
169. SCII I O modules COM4 TT RS 485 g ZT 2000 RS 408 HMI SCADA NS 408 M 7000 I O R5 485 Note LAN1 Normal Ethernet Cable LAN2 Ethernet Crossover Cable Alive Port RS 232 Crossover Cable COM3 COM4 RS 485 Data to Data Data to Data 6 It can also equip with two or more kinds of I O modules such as item 2 to 5 The Win GRAF redundant system is composed by two PACs Users need to set one PAC s rotary switch to 7 called Main PAC and set the other one to 9 called Backup PAC Do not use two Main PACs or two Backup PACs to make up a redundant system Win GRAF User Manual V 1 01 Oct 2014 by ICP DAS 16 3 16 2 Important Communication Ports and Installation Notes The Win GRAF redundant PACs require the following three communication ports to communicate with each other 1 Alive Port The Win GRAF redundant PACs use one RS 232 Port as the Alive Port also called Heart beat Port This Alive Port must use a RS 232 crossover cable or NULL Modem Cable which link with each other as the following figure Main PAC Backup PAC Alive Port TXD TXD RS 232 The different PAC uses different Alive Port like below XP 8xx8 CE6 COMS XP 9xx8 CE6 COM5 WP 5248 COM1 2 Replication Port The Win GRAF redundant PACs use their Ethernet Port LAN2 as a Replication Port Both PAC s LAN2 ports use an Ethernet crossover cable to transfer redundant data Do not use any Ethernet Switch or Hub betwee
170. SE or on_line_change_cycle lt gt 0 then retain done TRUE just do it one time tmp_bool Retain_Var DINT 1 1 retain a DINT variable tmp_bool Retain _Var DINT 2 2 tmp_bool Retain_Var REAL _1 3 retain a REAL variable tmp_bool Retain _Var BOOL_1 4 retain a BOOL variable After doing all the Retain Functions retain_flag Retain Flag Get if retain_flag FALSE then If Retain variable does not set up any proper value you can do some proper operation here a end_if end_if When all Retain variables are assigned proper values remember to set the to_set_flag to TRUE for calling Retain_Flag_Set once so that when next time you use the Retain_Flag_Get it can return TRUE if to _set_flag TRUE then to_set_flag FALSE tmp_bool Retain Flag Set end_if Win GRAF User Manual V 1 01 Oct 2014 by ICP DAS 6 5 LD Program Press F1 key to see the detailed setting descriptions RETAIN FLAG SET Set the retain flag to_set_flag E RETAIM FLAG SET to_set_flag R ST Program _s if to set flag then to_set_flag FALSE Q Data Type BOOL Always return TRUE TMP_BOOL Retain Flag Set end_if RETAIN _FLAG_GET Get the state of the retain flag retain_tlaq E RETAIN FLAG GET ST Program Q Data Type BOOL retain flag Retain Flag Get TRUE flag is
171. T to 8 Booleans you must first use the ST program ANY_TO_BYTE to convert the SINT to be a BYTE type as follows Inst_LINPACKS Bool_O UNPACKS i Bool AMY TO BYTECSINT VAL 13 D I Bool 2 Boal 3 Bool 4 Bool 5 Bool 6 Bool Pack Boolean Into Integer If want to pack 8 Booleans into one BYTE or USINT range O to 255 you can use PACK8 Function ST Program Win GRAF User Manual V 1 01 Oct 2014 by ICP DAS 10 6 LD Program Bool _o OUTI Bogl_1 i Bool 2 i Bool O TRUE OUT1 TRUE i INO PACKS Eno O E Aiool 3 l Bool_1 TRUE i Bool_4 i Bool _2 TRUE Bool 5 l Bool_3 TRUE l Bool 6 l E l l Bool _7 l l l l l l l l l l l l If want to pack 8 Booleans into one SINT you must assign a BYTE variable to the output Q to save the value temporary and use a ANY_TO_SINT Function to convert BYTE into SINT type as follows a En ANY TO SINT Eno gt Bool 0 INO PACKS Ena I In i Temp_B TE Temp BYTE SINT WAL 1 Bool 2 I N2 Boal 3 I IMs Bool 4 I 4 Bool 5 I IMS Aool_6 I IME Bool 7 i In Note If the compiling fails please click Project gt Settings from the menu bar to check if the setting of Complex variables in a separate segment in the Runtime is Yes Project sethngs CriWin GRAF Projects Test Hame Value General BB Runtime system Little endian Compiler Debugging Cycle time 0 Cie Go Code
172. THER_VAR_now 1 OTHER_VAR_now 2 OTHER_VAR_now 3 OTHER_VAR_now 4 OTHER_VAR_now 5 OTHER_VAR_now 6 OTHER_VAR_now 7 OTHER_VAR_now 8 OTHER_VAR_now 9 T E My_DINT_OO My_DINT_01 My_DINT_02 My_DINT_03 My_DINT_04 My_DINT_05 Any_to_DINT My _BOOL 00 Any_to_DINT My_BOOL_01 Any_to_DINT My_BOOL_02 Any_to_DINT My_Timer_00 OTHER_VAR_now 10 Any_to_DINT My_Timer_01 OTHER_VAR_now 11 Any_to_DINT My_Timer_02 OTHER_VAR_now 12 Any_to_DINT My_Timer_03 OTHER_VAR_now 13 Any_to_DINT My_Timer_04 OTHER_VAR_now 14 Any_to_DINT My_Timer_05 T eee Win GRAF User Manual V 1 01 Oct 2014 by ICP DAS 6 9 Test Project Before testing make sure you have already set up the PAC IP and compile download the project into the PAC refer Section 2 3 4 and Section 2 3 5 When connecting with the PAC all values in the Spy list refer Section 11 3 will be O or FALSE at the begging please enter some values at will When the value has changed it will create a text file in the PAC System_disk Win GRAF retain_real txt and retain_other txt and Write data to the files Note The Save _file counter will show the number of times the file is written if this value is changing rapidly e g to write several times every second minute it is not suitable for this application Because to write into files frequently in the System_disk will reduce t
173. Tools Window Help od HX a OO io T Worksnac Ho selection BK UPL_projectl Sa Programs oe FBD fa j at Main st ST1 Data Conversi E Watch for debugging E Initial values 5 NewRecipel porra x Yj Binding Configuration _ g Global defines a Variables EE Types b Build Crossreferences Runtime Callstack Breakpoints Diaitatsa Offline 192 168 71 19 502 Win GRAF User Manual V 1 01 Oct 2014 by ICP DAS 11 15 11 10 Set Up the PAC Password In order to avoid the important program running in the PAC is changed or stopped by an unfriendly connecting PC you can set up a password for the PAC to prevent unauthorized operation 1 Click on the menu bar Project gt Settings to open the setting window 2 Double click on the Runtime password of the Compiler set a password and then click OK Win GRAF Test File Edit View Inert Project Tools Window Help o gt Wa a Build Al Projects F lean All Projects S Download AT Projects Workspace ve TNES H Programs CT Project settings C Win GRAF Projects Test General Name a A Check array bounds at runtime e global definition of extern PO Runtime password C C post compiling Password Value Yes A Allocate status flags for variables with embedded p No Advanced B5 Embed symbols of all
174. UE OK FALSE Error Win GRAF User Manual V 1 01 Oct 2014 by ICP DAS 4 24 4 9 2 COUNTER_STOP For example Using the I 8093W module in the PAC s slot1 and stop counting the X axis ST program IF Stop1 TRUE THEN Note Stop1 FALSE First add two BOOL variables TMP_BOOL Counter_Stop 0 1 8093 0 Stop1 TMP_BOOL in the Variables Area END_IF LD program Stop1 Boolean set it to TRUE to start counting and then reset Stop1 to FALSE Main LT OS 09 w _o7 _ gt gt 1_ amp i x i EE J JE R1 hH Set it to TRUE to stop counting Tips Press the F1 key for Stop En COUNTER STOP i 1 a 1 the details on settings Ly 6093 gt A Reset it to FALSE HHCH E stopi H Re F Port Data type DINT For a module in the slot O to 7 of the PAC set it as 0 Fora DCON module connected to a serial COM port can be 1 to 37 depends on PAC means COM1 to COM3 7 Addr Data type DINT For a module in the slot O to 7 of the PAC set it as the slot number 0 to 7 For a module connected to a serial COM port set it as the Net ID address of the module 1 to 255 lO_Name Data type DINT The name of relative Counter Encoder module it can be set to 8084 8093 87084 87082 7083 and 7080 Channel Data type DINT The channel
175. User Manual V 1 01 Oct 2014 by ICP DAS 11 4 11 4 Backup Restore a Win GRAF Project Back up A Win GRAF Project 1 Mouse right click on the project name e g Demo01 and select Save Project and then To Disk Workspace l Demoli r ae Progr Communication Parame Insert New Item pti OnLine EE E ag m Watel Pa Simulate j Duplicate Project TA s Monitor 4 Print Project fy To Zip and Mail a jety jg Insert New Folder J Project Description To Target Xj Remove Project 2 Click on the Browser button to assign a directory you want to save the project e g D Win GRAF_demo_ backup fill in the project name e g Demo01_0613 and then click OK to back up the project A Saye as Current Project C Win GRAFSProjects Demo01 Save as Project Destination D Win GRAF_demo_backup Project Name Demo01_061 xO Restore A Win GRAF Project 1 Copy the previously backed up the project folder e g Demo01_0613 into C Win GRAF Projects Demoll 0613 cE Win GRAF User Manual V 1 01 Oct 2014 by ICP DAS 11 5 2 Click the menu bar File gt Close Project List to close all opened project windows Win GRAP Demoli New Project List Open Project List r wave Froject List J 3 Click the menu bar File gt Add Existing Project gt From Disk select the project you want e g Demo01_0613 in the C Win
176. User Manual V 1 01 Oct 2014 by ICP DAS 5 33 5 1 12 Connecting the XV310 4 Al 2 AO 4 DI 4 DO The XV310 is a 4 ch analog input 2 ch analog output 4 ch digital input and 4 ch digital ouput board This section provides a Win GRAF demo programs demo_XV310 zip First go to Section 5 1 6 to view the XV Board instructions and then configure each Al channel by using DCON_Utility_ Pro CE 200 exe Demo Description This demo added four data blocks The 1st one is used to read 4 Al data the 2nd is used to write 4 DO data the 3rd is used to read 4 DI data and the 4th is used to write 2 AO data 1 Mouse double click the 1st data block i e lt 4 gt Read Input Registers to open the setting window ane iO Drivers ae demo_X 310 fey E Ma MODBUS Master ame H C Exception programs 3 E a ATU COMO 115200 N 8 1 E Global variables J L Programs a See f lt 4 gt Read Input Registers 1 1 4 W310 ALO INT i 34 Main B H A lt 15 gt Write Coil Bits 1 1 4 E XV310_AL1 INT Watch for debugging H B lt 2 gt Read Input Bits 1 33 36 XV310 Al 2 INT AE Soft Scope lt 16 gt Write Holding Registers 1 33 34 3 XV310_AL 3 INT Initial values g TEE XV310_AO_0 INT Ys Binding Configuration WAAT Dataexchange 0 FrEF Detak X310 AO 1 INT jong Hiona nenne SP JIOA Data exchange 1 FFFF Defaut Ya Variables gy xV310_AL2 Data exchange 2 FFFF Defg MOL Ose Types a gt XVI AlI Data exchange 3 F
177. V 1 01 Oct 2014 by ICP DAS 1 10 1 2 1 Win GRAF Operating Mode The Win GRAF Workbench provides two operating modes Demo Mode Without using a Win GRAF Dongle The compiled Win GRAF project can run for 15 minutes in the PAC Once the time limit has expired users must Stop Start this project again and it only supports up to 40 I O tags Large Mode Using a Win GRAF Dongle The project can run in the PAC without the time limit Demo Mode Without using a Win GRAF Dongle The start screen will show as below after running the Win GRAF Workbench Win GRAF Starter az No VWin GRAF Dongle found Demo mode No Win GRAF Dongle found Demo mode E Win GRAF Win GRAP Termon 1 01 HAER 18 2014 Copyright by ICF DAS CO LID since 2014 EEEE Demo mode EEEk For Large mode please plug in the Win GRAF Dongle while munine it For technical support and sales service contact service icpdas com It describes the limitations in Limitations in demo mode Applications are limited to 40 Os demo mode you can also The code generated by the compiler stops after 15 minutes click the main menu Help gt The simulation stops after 15 mutes About to see this content Limitations of controller type The Win GRAF software supports only hardwares FAC PLC controllers produced by ICF DAS Note If you install the Win GRAF Dongle in the Demo Mode you must close Win GRAF Workbench and then start it
178. Win GRAF User Manual By ICP DAS CO LTD 2014 All Rights Reserved ICP DAS CO LTD would like to congratulate you own your purchase of our Win GRAF PACs The ease to integration of the controller system and the power of the Win GRAF software program combine to make a powerful yet inexpensive industrial process control system Win GRAF PAC Programming Automation Controller Series of ICP DAS includes ViewPAC 2000 VP 25W8 ViewPAC 4000 VP 4138 WinPAC 5000 WP 5238 WP 5248 WinPAC 8000 WP 8148 WP 8448 WP 8848 XPAC 8000 CE6 XP 8048 CE6 XP 8348 CE6 XP 8 748 CE6 XPAC 9000 CE6 XP 9148 CE6 XP 9348 CE6 XP 9748 CE6 Legal Liability ICP DAS CO LTD assumes no liability for any and all damages that may be incurred by the user as a consequence of this product ICP DAS CO LTD reserves the right to change this manual at any time without notice ICP DAS CO LTD constantly strives to provide our customers with the most reliable and accurate information possible regarding our products However ICP DAS CO LTD assumes no responsibility for its use or for any infringements of patents or other rights of third parties resulting from its use Trademark amp Copyright Notice The names of products are used for identification purposes only and are the registered trademarks of their respective owners or companies The version number and release date of this document are listed at the bottom of each page Users can download the l
179. Win GRAF User Manual V 1 01 Oct 2014 by ICP DAS 15 3 ICP DAS P awP V A i jk g ch DiD Bee w ianea i e Bch DiO PhatuMOS Relay ch 32 bit counten 2 ch DAO 1 g 2 ch 32 bit frequency 2 ch Dal i exist test if k and 87k boards exist or not i redundancy Enable a Active IF in the redundancy system i scale Setup the scaling function No 01 to 29 Ping ip Test Ethemet Intemet connection Soft GRAF Enable Soft GRAF driver 1 soft GRAF Enable Soft GRAF driver Double Click 1 ch boolean inputs Always TRUE Jun 04 2014 ICP DAS Taiwan After adding I O boards please compile the Win GRAF project Then download to the Win GRAF PAC Then users can start to develop your Soft GRAF HMI X Note Please refer ISaGRAF FAQ146 chapter 1 2 to get more details about Soft GRAF Studio ISaGRAF FAQ146 http www icodas com faq isagraf 146 htm Win GRAF User Manual V 1 01 Oct 2014 by ICP DAS 15 4 Chapter 16 Redundancy 16 1 Features and Architecture The following ICP DAS Win GRAF PACs support redundancy XP 8xx8 CE6 XP 9xx8 CE6 WP 5248 One redundant system is composed by two Win GRAF PACs that one PAC s rotary switch is set to 7 means Main PAC and the other one is set to 9 means Backup PAC When one of them is damaged or crashed or need to release its control right by user defined event the PAC control right will automatically switch to the healthy one Features of t
180. _2 xml and then click Save button Finally click Finish to export the settings GRR OD O Projects Demoli GICPDAS template v P a fiiin Export Assistant RATI p Export is complete SNEIN p LATE FERUD eeue eese senses eae ereeeeeeeeeeeee Finish Win GRAF User Manual V 1 01 Oct 2014 by ICP DAS 5 49 a 5 Using the Notepad software to open the file xml that exported in the step 4 and then copy the content between the lt modbus gt and lt modbus gt DP Master 2 0nl PE Seles BRE RPE EAO WAO H lt types gt Al lt types gt lt Variables gt lt Vargroup name Global kind GLOBAL gt lt vargroup gt lt vargroup name Retain kind RETAIN gt lt vargroup gt lt varlables gt ai maa emndbies lt modbusport kind master address 192 165 1 100 port 502 sdiags 1 reconnect 1 disabled 0 reqdelay 10 rtu 0 lt modbusreg name mode Read Input Bits address 0 nbitem 3 slave 1 call Periodic 1000 8000 timeout 1000 retry 1 lt modbusitem ope Data offset 0 symbol boo_i nbword 1 mask ffff RengeHic RangeLo SigHi Siglo gt lt modbusitem ope Data offset 1 symbal boo_2 nbword 1 mask ffff RangeHi RangeLo SigHi SigLo fy lt modbusitem ope Data offset 2 symbol boo_3 nbword 1 mask ffff RangeHi RangeLo SigHi SigLo gt lt modbusitem ope Status o
181. _D0_15 lt Request Description Slave Unit MODBUS Request _ lt 5 gt Write single coil bit lt 6 gt Write sin Data block z Base address 1 fb items Activation Periodic On call On change Misc Timeout Nb trials Operation N Offset Mask Storage Data exchange Data exchange Data exchange Data exchange Data exchange Data exchange Data exchange Data exchange Data exchange Data exchange Data exchange Data exchange Data exchange Data exchange Data exchange Data exchange Hi Wl AE Ge A HE eT ee Type BOOL BOOL BOOL BOOL 818 BOOL BOOL BOOL Pe x 111_DO_00 3 xv111_DO_D1 xV111_DO_02 xV111_D0_03 0 Default A ni Mir 1 5 Note The Offset value is starting 3 from 0 and the Modbus address 4 i 5 of a variable is equal to this value E plus 1 Base address 1 f erer ray a8 8 FFFF Default W11 1 DO 12 FFFF Default w111 D 04 3 FFFF Default W141 1 DO 1 4 FFFF Default w11 1 DO 15 FFFF Default XV111_status FFFF Default lt FFFF Default FFFF Default The Net ID fixed to 1 of the Slave device i e XV board Start from addr 1 and write 16 data fon error Write only when data changed An exception occurrs if no respond for 100 ms Win GRAF User Manual V 1 01 Oct 2014 by ICP DAS 5 24 BOOL DINT Name Value M gt 2 Mouse double click t
182. a EO 4 Wii 4 gt PAC Time Wariables Win GRAF User Manual V 1 01 Oct 2014 by ICP DAS 2 22 3 Then the new system time will show on the TIME_GET function block or the Variables Area and the Set_new_time variable will be reset to FALSE automatically OOO P4ac_Time C inst_tine_cet D Ti R1 Get current t HEn TME CET PAC Year 2015 PAC Month 1 PAC Day 1 PAC VYeekDay 4 Hour HPAC Hour 12 Minute HPAC Minute 30 Second ePAc Second 35 F PAC Time arables The LD1 program o A F Name Current time of th ui new Year new Month new Day new Hour new Minute AIN variables LES The new system time f1 0 i 8055_DI1__ w gt 4 Ly All E Used Froject 9 Advanced I tii 4 9 Arithmetic Q Arrays 4 9 AS interface BACnet Blocks Sovlist Define ENUM we lt H H amp 4 When the Demo01 project is running you can check to see if the DOO DO1 and DO2 tags of the Il 8055W I O module that plugged in the slot1 of the PAC is blinking every two seconds like the value T 2S we set before You can also assign a TIME variable on the left side of the CYCLE for easy to change the time setting Refer the Section 2 3 1 for the setting way 5 Ifthe QX1 1 3 variable is set to TURE in the Variable Area the LED4 i e DO3 at the top of the l 8055W
183. a variables in the Section 6 1 E Plain Flour 0 GE 1 Lemon Juice 5 Suger 2H H Sat 1 Variables NewRecipel Win GRAF User Manual V 1 01 Oct 2014 by ICP DAS 11 10 11 8 Get the Functions and Function Blocks that Supported by the PAC In the Win GRAF Workbench window user can expand the All directory in the Blocks panel to see quite a lot of Functions and Function Blocks however some are not supported in the Win GRAF PAC The following will show how to quickly get the Functions or Function Blocks that supported by the PAC A Win GRAF Demoli BAA File Edit View Insert Project Tools Window Help sAN PE MES MP eee eh S aS a He twele GBs Ses See PAC Time c Demoli TE soolean AND Inst_TIME_GET E E R1 Get current time N ame En TIME_GET Eno _ a Project 5 Ga Programs a sS PAC __ Expand Sise LD1 Blinking E Current time of the PAC i i Watch for debugging COE All Soft Scope Directory fe NewStructure s PAC_Month Initial values Pr 7 o fs NewRecipel T i 6d NewSpyl Pao puy Binding Configuration 39 Global defines PAC WeekDay fa Variables E Types Multiply Addition Subtraction Divide 1 copy 1 gain lt Less than lt Less or equal lt gt ls not equal ls equal gt Greater than gt Greater or equal gt gt LJ K Put array item gt gt LJ Put arr
184. able in the program Retain _and_timer DIN T 2 Setup as Retain variable in the program Retain _and_timer FEAL_1 variable in the program Retain and_ tinier REAL 2 variable in the program Retam_and_timer TMA_1 H1894 rns TMA _1_last_ state TRUE TRUE ticking FALSE sleep Set TRUE to start ticking timer To stop TMA_1 Set TRUE to stop the ticking of timer THA_2 PT Tesco THA 2 last state TRUE TRUE ticking FALSE sleep Set TRUE to start ticking timers To_tick_TMR_2 Win GRAF User Manual V 1 01 Oct 2014 by ICP DAS 16 14 7 Make sure the Passive PAC is ready i e is_ Passive Ready is TRUE remove the LAN1 cable of the Main PAC or turn off and on restart the Main PAC Wait for a short time refer the RDN_ control program the Main PAC will automatically reboot and give control right to the Backup PAC Now Then the Active PAC belongs to the Backup PAC and all the values you set before still exist and the Timer is still ticking is_ Main_Active FALSE DINT 1 DINT 2 is_ Main_ ready TRUE FAEAL_1 is Backup ready TRUE Backup PAC FEAL 2 99 5 is_firstocycle just after switch is active TMA_1 is_ Main LANT _ok TMA 1 last state HHT Tm as 771 mes TRUE FALSE is Backup L4AN1_ok TRUE To_tick_THA_1 is Alive_port_ok TRUE To_stop_TMA_1 FALSE TMR_2 is Active LAN Tok TRUE TMA_2_last_state TRUE is_ Passive _LAN1_ok To_tick_TMA_2 FALSE Note After that plug in the LAN1 cable of the Main PAC
185. able with address 4 Sbyte temp4 125 UserShare Set_SINT Convert ToUInt16 4 temp4 Demo program CD ROM 1 R W analog I O napdos Win GRAF demo project CSharp net_2008 demo demo_CSharp02 2 R W internal Boolean long integer Timer and Real floating point values napdos Win GRAF demo project CSharp net_2008 demo demo_CSharp03 Win GRAF User Manual V 1 01 Oct 2014 by ICP DAS 14 8 Mi Get SINT W Get_INT W Get DINT W Get_LINT Description These functions are to get 8 bit integer 16 bit integer 32 bit integer amp 64 bit integer value from Win GRAF integer variables Syntax UserShare Get_SINT ushort iUserAddress out sbyte iStatus UserShare Get_INT ushort iUserAddress out short iStatus UserShare Get_DINT ushort iUserAddress out int iStatus UserShare Get_LINT ushort iUserAddress out long iStatus Parameter iUserAddress Address of Variable 1 to 8192 iStatus Get the value of Win GRAF integer variables Example Int64 Dilong val Int16 short_val Int32 long val sbyte sbyte_val Get 64 bit integer value from the Win GRAF LINT variable with address 7 UserShare Get_LINT Convert ToUInt16 7 out Dlong_ val Get 32 bit integer value from the Win GRAF DINT variable with address 8 UserShare Get_DINT Convert ToUInt16 8 out long val Get 16 bit integer value from the Win GRAF INT variable with address 9 UserShare Get_INT Convert ToUInt16 9 out short_val
186. ach Al AO channel by using DCON_Utility_ Pro _CE_200 exe Using the WP 5238 as an example 1 Click the Win _GRAF_WP_5238 or the small icon on the taskbar to open the Win GRAF driver window and then click the End Driver button Win GRAF WP 3236 WP 5238 driver Version 1 01 Jul 16 2014 This product is licensed Project name demo w110 VMODB size 308928 Elapsed time 0 0 0 19 Stop the Win GRAF driver 2 Click My Device on the desktop and then get into the path System_Disk Tools dcon_utility_pro to run the DCON_Utility_ Pro CE _200 exe Bs at jv Virtud cE l G auto_contig O cmd _confg G language G log_report G remote_config G system CE PlatfornBase_ _arm He CrdParser cll Commu cll ef OCON Utility Pro CE 200 exe t 1OModule cll PACNET all a 3 Platform Protocol dll as Utility cl 3 Click the COM Port button to set the COM Port as COMO set the Baud Rate as 115200 and set the Format as N 8 1 and then click OK DCON Utility Pro 7 0 0 0 for CE7 ami WwPrs2731 PORN o End Address Timeout oo jms CON 8 2 OE 8 1 0 8 1 Win GRAF User Manual V 1 01 Oct 2014 by ICP DAS 5 16 4 After clicking the Search button the XV Board e g XV308 will show in the window Then double click this item to get into the setting window DCON Utility Pro 2 0 0 0 for CE arm WP5231 E Start Address o End Address w laa pee pers lae eea ee
187. ae es eee 16 6 16 31 lO Board SCUUING S accusisostieciese a ENE 16 6 16 3 2 Declaring Variables demo RDN 2 seritsin aii a 16 9 16 3 3 Introduction of the demo _RDN_2 Demo Program cccssseceesseeeeeseeeeeeees 16 10 Test Demo POST AIS errenneren aE EEVEE NRE 16 12 What Kinds of Data Can be Automatically Backed up to the Passive PAC 06 16 18 Schedule Control cocaecsnsids caicuctiaccecatetuiicuns ia diestcen a a 17 1 Install the Schedule Control Utility and Restore the Win GRAF Demo Project 17 2 Introduction of the demo _ schedule Proje ct ccsccccsssccecssececesececeesceeseneeeeeecesseeeeees 17 4 Edit schedule configurations by the Schedule Control Utility ec eeccseseseeeeseeeees 17 7 OS UINIE LOIS G MOn a e a a a a 17 10 Configurations of the Schedule Control Utility oseeeoseenssensssensseeresrersseesssersseersseerss 17 12 17 5 Address TORCACH Target Variables nirani E T E 17 12 17 5 2 Target Configuratii O Neies AEAEE E 17 13 IAS SCASONCONMBUNALION usisa E ER 17 15 17 5 4 Normal Day Holiday Special Day Configuration esccceeeeeeeeereeererrrrrrrren 17 17 17 5 5 Sched le CONTIGULATION susine en cede ie ees Soran came ae 17 19 17 520 Save and Send tothe PAC ersari aini A AT 17 21 Ta TME Sy MONZA UON anaa E 17 22 17 5 8 Schedule Control Utility in PAC Site sseeseeessenseserssrsessseessereseerssssesessesereessereses 17 23 17 5 9 Using Schedule Control in th
188. again to make it become Large Mode Large Mode Using a Win GRAF Dongle The start screen will show as below after running the Win GRAF Workbench Win GRAF Starter Win GRAF User Manual V 1 01 Oct 2014 by ICP DAS 1 11 1 2 2 Win GRAF Operating Environment Run the Win GRAF and then the main screen will show as below Win GRAF Ex AVERE Ele Yow Took Winfov Hep Nom Menu Toolbar fo ae RE SSS Oe eee x Right click oi ta e oA E ia ee Workspace Ho iP DO RAEE x RBC AlHFA B Show Hide menu P rogram Area A C Runtime Callstack Breakpoints Digital sampling trace Frompt Hdl No project Note Mouse right click on the top of the Window to Show Hide the menu bar A The Workspace It allows users to create project lists and add open the Win GRAF program as well as the related settings Moreover the new project can be created by using a project template B The Program Area It used to show edit the program and can be divided into more function area Refer the Section 2 2 1 C The Message Area It used to show compiler messages and provides more diagnostic tools Tips 1 To resize a window click and drag the side or corner of the window to change its size 2 Press the F1 key to open the user manual i e HTML Help Hind or Show the window If you carelessly closed the Variables pane or the Message Area during the programming you can click the menu bar View and
189. al Move Up Move Down Help Close Close this window Open the I O selecting window Hot Key Enter to open Hot Key ESC to exit Delete Virtual Real Delete this I O board Rename Rename this I O board Help Look up the usage of this I O board Swith the I O board to a Virtual I O for testing or a Real I O Hot Key Space Move up this I O board Move down this I O board To see the description on I O devices Win GRAF User Manual V 1 01 Oct 2014 by ICP DAS 4 2 4 1 DI DO Boards Here use the I 8055W as an example users can refer the Chapter 4 P4 1 to add this I O board 1 Double click the i 8055 DI or the i_ 8055 DO to open the Properties window Note A mouse over showing the details on the i_ 8055 DI or the i_8055 DO SEE 170 Boards _ ja 1 i8055 0 eaa 10 i 8055 Properties 1 i 8055_D0 N EEEE j _3 Reserved 0 0 Reserved i i 4 Reserved 10 Reserved 0 5 Reserved 2 0 Reserved 3 0 G Res rved3 0 EE 8 10 W 12 13 14 8 Ch Digital Inputs 8 Ch Digital Outputs Nov 01 2013 ICP DAS Taiwan 2 After linking the i_ 8055 I O board it will auto add 8 Input and 8 output variables in the Variables window that can be used in the program Variables He Y Name Type Dim Attrib Syb
190. al as DINT and Dim at least 10 for this example end_if end_if Test Program In this example when the Write_File is set to TRUE the values will be written into the file System_Disk Real_data1 txt in the PAC 1 Please set up IP configurations Refer P12 1 compile and download the program to the PAC Click on Project gt Build All Projects On Line if not familiar with the operation refer to Section 2 3 4 Section 2 3 5 2 Click NewSpy1 to open a Spy List and fill in the values to be written and then set the Write_File become TRUE to Write data If OK File Status will show Open file ok File Edit View re Help jill E FS Ek Workspace OO0OD HewSpyt spl gt demo_filel RUN BR Name Eh Jj Exception programs Fai a REAL_val Programs REAL val 0 it Main g REAL valf Watch for debugging REAL_val 2 Soft Scope REAL_val 3 st Initi Bs REAL_val 4 s i a Binding Contiguyti FEAL_val 6 gq Global defin REAL_val 7 2 Variables REAL_val 9 A Types REAL_vall9 Write File ALS set TRUE to write data to the file File_Status Open file ok 4 gt Main NewSpy1 Variables 3 Inthe PAC open the file Real_data1 txt can see the values filled in the step 2 ERE RHE BAW BEG 4 gt 0X Er eee eo aw BAO TAO SU BG sytem Ok D 1 23 C Drivers 39 C External_device_driver 17 E ISAGRAF r3 tools sae 5 Win GRAF oe
191. al V 1 01 Oct 2014 by ICP DAS 5 36 5 2 Enabling the Win GRAF PAC as a Modbus TCP UDP Master Application Diagram Win GRAF PAC Modbus TCP UDP Master ET 7000 Series 1 0 Modules VP 25W8 XPAC XP 9xx8 CE6 XP 8xx8 CE6 Support Max 100 Slave Devices WinPAC WP 8xx8 WP 5xx8 Win GRAF PAC Modbus TCP Slave Other ViewPAC VP 25W8 Modbus TCP Slave VP 4138 Device Support Max 32 Slave Devices Refer P1 1 to see the PAC model numbers The Setting Steps 1 Click the tool icon Open Fieldbus Configuration to open the I O Drivers window UA Win GRAF Test_01 EX File Edit View Insert Project Tools Window Help EEE EERE eN Workspace l ma ex 5 Test 01 T None Type Exception programs fat Global variables GLa Programs la RETAIN variables _ T 1 Mair E Wain 7 Se Watch for debuggi 22 pOnBadindex Soft Scope ta nOnDivZero i aea Initial values gi Jo ae Ya Binding Configuration ne me H Sg Global defines PE fat Variables z eS tl on BL Types Build X 2 Click Insert Configuration icon in the left side of the I O Drivers window and then click MOSBUS Master then click OK to enable a Modbus Master Note One Modbus Master can set up multiple Ports see the next step can set as a Modbus Master RTU ASCII Port Refer Section 5 1 or a
192. alue will use the default value 00 RR Range definition of signals 05 means physical input signal is 2 5 to 2 5 Volt 06 means physical input signal is 20 to 20 mA 07 means physical input signal is 1 25 to 1 25 Volt 08 means physical input signal is 10 to 10 Volt 09 means physical input signal is 5 to 5 Volt Setting RR as other value will use the default value 08 Win GRAF User Manual V 1 01 Oct 2014 by ICP DAS 4 6 2 Double click the item and fill in a value then press the Enter key to complete the setting For example 16 08 means the physical input signal is 10 to 10 V Channel value 5 67 means the input signal is 5 67 V For example 16 209 means the physical input signal is 5 to 5 V with the scaling function 2 Signal 5 67 V will be scaled to an engineering value by the scaling function 2 For example 16 1709 means the physical input signal is 5 to 5 V with the scaling function 17 Signal 5 67 V will be scaled to an engineering value by the scaling function 17 1 4 8017_16ch Properties Key 6 A Ref 16 501716 ChO type 16 1709 Chi _type 16408 Ch 2_ type 16 05 Ch3_type 16 08 Ch4_type 16 08 Ch5_type 16 08 Noise_Filter_Max The max of the physical value to be considered as noise The filter will filter out the signal value beyond it default setting is 9999 9 For example set as 7 9 signal larger than 7 9 V or 7 9 mA will be filtered
193. and then later both the status of is Main _LAN1 and is Passive LAN1 variables will become TRUE demo_RDN_3 Two XP 8xx8 CE6 PACs using their LAN1 to connect a ET 7050 Modbus TCP I O module through the Ethernet switch RS 408 Win GRAF NS 408 i hih Alive Port Active IP RS 232 EX 192 168 71 37 z 255 255 255 0 Main 7 Active iP 1 EX 192 168 71 38 ET 7050 I O F 255 255 255 0 12 ch Di 6 ch DO Addr 1 EX 192 168 71 128 255 255 255 0 Backup 9 Win GRAF PAC 1 Refer the ET 7000 manual to set up the IP address and required settings refer Section 5 2 1 Manual http ftp icodas com pub cd 6000cd napdos et7000 et7200 document 2 Open and download the demo_RDN_ 3 project Before downloading set the communication IP refer Section 2 3 5 Communication Parameters to the current LAN1 IP of the Active PAC refer Section 16 4 Test demo programs step 2 to 4 Win GRAF User Manual V 1 01 Oct 2014 by ICP DAS 16 15 In the I O Drivers window here we enable a Modbus TCP Master to connect an ET 7050 module Modbus TCP Slave Addr 1 and create some data blocks to read write the DI and DO data refer Section 5 2 Users can open this demo _RDN_ 3 project for more details File Edit View Insert Project Tools Window Help z Wea is ye Gt amp So Gy ee All Workspace IO Drivers C demo_rdn_3 t MODBUS Master To enable a Modbus TCP Master to
194. aneous PID Plus PRP we Library Manager ICP DAS XP WP P File Wizard Help gt Retain_ or Retain a single variable Gj Time_Get Function Block Get date and time of the PAC a P Si al Gis I maa Tite ota s N NATY e TT E TS bo rN N a a MI Parameters Description Retain Var Retain a variable A The Retain Var can work only in the lst PAC cycle or in the cycle when on line change Call this function in other cycles will return FALSE lt gt Win GRAF User Manual V 1 01 Oct 2014 by ICP DAS 1 13 1 3 Setting the Win GRAF PAC s IP Address For connecting with the PAC the Win GRAF Workbench needs to know the PAC IP The following will show you how to set up the PAC IP Using the XPAC XP 8xx8 CE6 XP 9xx8 CE6 and the WinPAC WP 8xx8 WP 5xx8 as the example Hardware Wiring Diagram Power Supply DP 665 Monitor PC Win GRAF IP 192 168 1 20 Mask 255 255 255 0 RS 408 Mask 255 255 255 0 PAC Side Using the USB mouse that connected to the PAC and click Start gt Settings gt Network and Dial up Connections on the lower left corner of the monitor then double click the LAN1 or LAN2 then fill in a proper IP address File Edit Vi Sl Make Mew LANZ Connection IP Address An IF address can be 4 Obtain an IP address via DHCP automatically assigned to this computer If your
195. area ST Program Declare START_tmr STOP_tmr RESET _tmr LED1 LED2 as BOOL Declare TMR1 as TIME Set START_tmr as TRUE to start ticking Timer TMR1 IF START tmr THEN START _ tmr FALSE TSTART TMR1 END_IF Set STOP_tmr as TRUE to stop ticking Timer TMR1 IF STOP _ tmr THEN STOP_tmr FALSE TSTOP TMR1 END_IF Set RESET_tmr as TRUE to reset TMR1 to a value T 0s IF RESET tmr THEN RESET tmr FALSE TMR1 THOs END_IF Let LED1 LED2 ON during TMR1 3 10 second LED1 FALSE LED2 FALSE IF TMR1 gt T 3s and TMR1 lt T 10s THEN LED1 TRUE LED2 TRUE END_IF Reset TMR1 as 0 when reachs 15 second IF TMR1 gt T 15s THEN TMR1 THOS END_IF Win GRAF User Manual V 1 01 Oct 2014 by ICP DAS 12 2 12 1 2 Periodic Operations Refer P12 1 to open the project demo_tmr2 zip and can view add variables in the variable area Function BLINK plus Function Block F_TRIG can produce a Pluse TRUE at regular intervals so it can be applied in the periodic operations LD Program Inst_BLINK Inst_F_ TRI pulse CLK F TRG l Type BOOL ST Program IF pluse THEN do periodic operations here END IF The BLINK and F_TRIG above will produce a Pluse TRUE every two seconds but this method has a drawback pluse1 2 Sec 2 Sec If the interval time of the period is shorter e g 100 ms per
196. art Timer If set ET 7050 Dox as TRUE the ET 7050_DOx_ReadBack will return TRUE If disconnect the Ethernet cable from the ET 7050 module the ET 7050 COM _ error will return a non zero value that means communication error Win GRAF User Manual V 1 01 Oct 2014 by ICP DAS 16 16 5 Make sure the Passive PAC is ready i e is_ Passive Ready is TRUE remove the LAN1 cable from the Main PAC or turn it off and on restart and wait a short time refer the RDN_control program the Main PAC will automatically reboot and give control right to the Backup PAC OOO0 HewsSpyi spl Mame Value Description is Main Active FALSE gt a is Backup Active TRUE j j ge is Main ready TALE Now the Backup PAC is Active is Backup ready TRUE is first cycle just ater swatch FALSE is Main LAN ok is Backup LAN ok TRUE is Alive portok TRUE Plug in the Main PAC s LAN1 DET TUE i Active LANT ok is Passive LANT ok TRUE g 3700 After switching control right to the 3 9 Backup PAC all retains value are not 3 8 changed and the timer is still ticking tHamds52bms To tick TMA FALSE Set TRUE to start ticking timer To stop TMA_1 FALSE Set TRUE to stop the ticking of timer ETFO50 COM err ETFO50 DO 0 ReadBack ETFO50 DO 1 ReadBack ETFO50 DO 2 ReadBack FALSE ETFO50 DO 3 ReadBack ETVO50 D0 4 ReadBack ALS Set ET 7050 Dox as TRUE ET 050_D0_5 ReadBac
197. assive PAC it will be automatically set as Active_IP 1 e g if the Active_IP is set as 192 168 71 37 the Passive _IP will automatically set as 192 168 71 38 Mask The most common settings are either 255 255 255 0 or 255 255 0 0 depends on the network environment Win GRAF User Manual V 1 01 Oct 2014 by ICP DAS 16 6 After linking the i_ redundancy in the I O Boards window it will auto add 12 BOOL input channels in the Variables window that can be used to display the current state of the redundant system FY M Type Dim Attrib Syb Init value User Tag Description BO 10 i redundancy A YolAIO O is Main Active olAIO A is_first_cycle just aft olATO 5 15 hain LANT ok YolAIO b is Backup LAN ok BOOL Input LI ECOL Input E BOOL Input i 1 Double click it to add a variable name to each channel olIO Y is Alive port_ok BOOL Input E YolAILO is Passive ready BOOL Input E J wlx10 59 is_Active_LAM1_ok BOOL Input LJ olATIO 10 is_Passive_L4N1_ ok BOOL Input LJ 1 10 11 BOOL Input LI v lt gt 4 F lO Drivers New Spy Ch O is_Main_ Active Ch 1 is _Backup_ Active Ch 2 is_Main_ready Ch 3 is_Backup_ ready REN control Wariables Retain and timer Is the Main PAC rotary switch 7 active now TRUE Active FALSE Passive Is the Backup PAC rotary switch 9 active now TRUE Active FALSE Passive Is
198. atest document on FTP http ftp icodas com pub cd win graf workbench cd tutorials Technical Service Win GRAF Web site htto www icodas com root product solutions softplc based on pac win graf win graf html New Win GRAF workbench Lib and PAC driver htto www icodas com root product solutions softplc based on pac win graf download win graf driver html Please contact local agent or email problem report to service icpdas com Copyright Jun 2014 by ICP DAS CO LTD All Rights Reserved Win GRAF User Manual V 1 01 Oct 2014 by ICP DAS 1 1 Table of Contents Win GRAF User Manuales sorunca sinnet i EE TRO ETT ON 1 1 EU ANO IRE cira TE E AEEA 1 1 Trademark amp CODY MENT NOUCEmsunronanicnni n a a a a a aA 1 1 Ere al ai iere meio lt E EN E A AOO 1 1 Table of COMECIES osorno E E EA AAT oveoncausesencseeesss 1 2 Chapter 1 Software Installation amp Hardware Setting cccccscscsssccscscecsccscsccccccscscescccscsceseececs 1 7 1 1 Installing the Win GRAF Workbench ccccsssccccssececesececesceceeseceeeuecessenceseeeeeseaecesseeeesees 1 7 1 2 R n the Wim GRAF Workbenciivenisrenunnin snr oecetha ns Solute et nas aca Souenwehavns aa ocaeaeas 1 10 1 2 1 WiIn GRAF Operating MOde cccccsssccsssscccsssscccsssscnnsseseusseccessceneueseneusseseesseess 1 11 1 2 2 Wih GRAF Operating Environment Corano E T 1 12 123 Win GRAF Library Manager sicsccssssisdccticccvcnesivaclaiteaeszies T a undead 1 13
199. ation state is TRUE If OK returns TRUE 5 Referring Chapter 12 click the menu bar File gt Add Existing Project gt From Zip to restore the demo project CD ROM Napdos Win GRAF demo project DEMO_D_87084 C8 zip in the shipping CD and see the program and descriptions Supposition Use PAC s COM2 to connect the I 87084W Addr 7 to measure 8 ch counters Al T Name Type Inst_D_87084_CNT8 i ii AS DINT A Al 6 DINT Al 7 DINT 3 Al 8 DINT COM BOOL v lt gt a Toread write operate TE D_87064_CNT4 remote A counter refer Section 4 9 0 a 37084 FPEO Pre remote ESU TE blocks ooit Defne ENUM ai Main arisbles F is Input Parameters EN Data type BOOL TRUE enable it FALSE disable it Port Data type DINT COM port number can be 1 to 37 depends on PAC Must use a constant value cannot be a changed value Addr Data type DINT The Net ID address of the module can be 1 to 255 Must use a constant value not a changed value Output Parameters OK Data type BOOL TRUE Communication is Ok FALSE Communication failed Win GRAF User Manual V 1 01 Oct 2014 by ICP DAS 8 11 8 2 7 DL_100T485 Function Block DL_100T485 Connect a remote DL 100T485 module to get humidity and temperature value Product website http www icodas com root product solutions remote io rs 485 dl series dl 100t485 html Note 1 Please use DL
200. ay item 2 gt gt I Put array item 1 d LJ K gt gt Get array item _ LJ gt gt Get array item 2 I gt gt Get array item 1 d ABS Absolute value PAC_Second ie T F ABSL Absolute value LREAL m x eA E EN PAC_Hour Blocks Panel HAS HIN FEN SO SN SENS 2 Se E a SENS Or A L a a A OS PA amp C_Minute G U Ut UF UF UF UF UF UF UF UF UF UF UF UF UF UF l si tot PAC Time Build 4 gt Build Crossreferences Runtime Callstack Breakpoints Diaqital samplingtrace Prompt HMI Offline 192 168 71 19 502 0 0 233x18 0 0 165 g Setting Steps 1 Make sure the PAC is powered on and connected with a PC via an Ethernet cable 2 In the Win GRAF Workbench right click on the project name e g Demo01 and then select Configuration and click on the Upload button in the Select tab to open the setting window Configurations Workspace PAC_Time J i a Ce ros Right click Lad Progr ara e A Dl On Line EL be Simulate Ga Wate o a E lt Click Upload j Remove Project ag Build Froject Clean Project Win GRAF User Manual V 1 01 Oct 2014 by ICP DAS 11 11 3 Configure Select the IP address of the PAC and click on OK button the PAC will upload the configuration file Next key in the file name e g test cfg and click Save to save t
201. azy due to the wrong settings 2 When installing the Win GRAF redundant system at the application field make sure the following three cables are connected properly connect all required cables such as RS 485 before power up PACs If user power up PACs before connecting these three communication cables the redundant system will be out of control A Connect both PAC s Alive ports by using a crossover cable B Connect both PAC s LAN2 ports by using an Ethernet crossover cable Do not use any Ethernet Switch Hub between LAN2 ports C Connect both PAC s LAN1 ports to an Ethernet switch by using a normal Ethernet cable 3 If only one healthy PAC of the redundant system is working properly at the application field do not power off or shut it down Before user power up the other PAC that will be installed into the system follow the step1 and step2 as mentioned above to set up it first Win GRAF RS 408 NS 408 Win GRAF PAC Active IP 1 Passive A j ie Alive Port RS 232 Connect tO aa Active IP Replication Port LAN2 Only the Active PAC i e PAC got the control right can run the Win GRAF application The Passive PAC will not run the Win GRAF application It simply receives the redundant data from the Active PAC and wait for getting control right in the future Win GRAF User Manual V 1 01 Oct 2014 by ICP DAS 16 5 16 3 Description of Demo Programs The shipping CD of the Win GRAF PAC provides th
202. ble XV308 05 2 5 V 20 mA 07 4 mA 20 mA 10 V 5 V OA 1V 20 mA l 1A 0 mA 20 mA Note 1 For easy to use recommended to use the data format Engineering E g 2 5 V will show as 25000 to 25000 and 4 mA to 20 mA will show as 4000 to 20000 2 When using these Type Code 06 07 OD 1A please check if the position of eight hardware jumpers on the XW board are correct www icpdas com root product solutions datasheet hmi touch monitor XV308 pdf Win GRAF User Manual V 1 01 Oct 2014 by ICP DAS 5 18 Note When using the XV308 you need to click the Set Power On and Set Safe Value button do not choose any DO Status in the DO Alarm tab X 308 Firmwvare A102 Confi iguration ALAI Alarm DO Alarm Host WOT DI DI About DO Status Read DO Set Power On Set Safe value Do not choose any DO Status Read Power ON value Then click the Set Power On Read Safe Value and Set Safe Value button Alarm Status a H 5 H 6 Hi _ _ L 5 L 6 7 Finally back to the Configuration tab and click the Set Module Configuration button Step5 to finish the Al AO configuration and then close the DCON_Utility_ Pro _CE_200 exe In addition click the Win_GRAF_WP_5238 on the desktop to run the Win GRAF driver like Step 1 Follow the similar way like the steps above to configure the Al AO
203. bool EEP_Read 1 New_Val end _if Safe Coding Way write to the EEPROM only when the value is changed if New_Val lt gt Old_Val then Old_Val New_Val tmp_bool EEP_Write 1 New Val Dangerous Coding Way EEPROM may be destroyed very soon Declare FIRST CYCLE as BOOL variable and has an initial value TRUE Declare tmp_bool as BOOL variable Declare New_Val and Old_Val as DINT variables Read the EEPROM once in the first Cycle if FIRST CYCLE then FIRST CYCLE FALSE means it is not the first Cycle any more tmp_bool EEP_Read 1 New_Val end_if Dangerous Coding Way Write the New_Val value to the EEPROM one time in every Cycle tmp_bool EEP_Write 1 New_Val Win GRAF User Manual V 1 01 Oct 2014 by ICP DAS 6 11 6 3 1 EEP_READ Read a Value from the EEPROM EEP_READ Press F1 key to see the detailed setting descriptions Addr Data Type DINT Address can be 1 to 1200 If the variable type of the Name parameter is a 64 bit data e g LINT or LREAL the Addr can be 1001 to 1200 only Name A variable name to store the value from the EEPROM DO NOT use string variable Variable type can be BOOL SINT USINT BYTE INT UINT WORD DINT UDINT DWORD REAL TIME LINT or LREAL Q Data Type BOOL TRUE Ok FALSE Error If the type of the Name parameter is REAL or LREAL will return
204. bus address for variables is equal to the Offset value plus 1 Base address Moreover if you set the Operation as Error report the Offset value for the mapping variable Date Type DINT must set to 0 MODBUS Master Request Request Description slave Unit 1 5 The Net ID fixed to 1 of the HODBUS Request Slave device i e XV board lt 1 gt Read Coil Bits K Data block z Base address 4 Nb items 5 Start from addr 1 and 7 read five data Activation i A E P Periodic 50 ms 0 On call z On change Read every 50 ms Misc p i Timeout 100 5 D An exception occurrs if no Nb trials 1 respond for 100 ms Win GRAF User Manual V 1 01 Oct 2014 by ICP DAS 5 26 2 Mouse double click the 2nd data block i e lt 15 gt Write Coil Bits to open the setting window Workspace demo_X 116 El C Exception programs H E Programs at Main i E Watch for debugging lf Soft Scope H EN Initial values 95 Binding Configuration g Global defines 3 fat Variables Types lt 5 Write single coil bit _ lt 6 gt Write single holding lt 15 gt Write Coil Bits Data block Base address Start from addr 1 and Nb items write six data oo oe Activation Periodic on call On change Misc Timeout An exception occurrs if no f Nb tria
205. bytes data after the data is TMP_DINT COM_send Port_number ByteAry 0 20 ready Max 500 Bytes End_ Action GS3 T gt T 5s wants to send String can use the Function _send_str Max 255 Bytes and can not After 5 seconds has 0 in the Byte of the String because 0 return to the step 1 to means the end of the String but it can be the 1 send the next data Character 0 Win GRAF User Manual V 1 01 Oct 2014 by ICP DAS 12 13 12 3 Read Write Data from to a File in The PAC The Win GRAF Workbench provides the following Functions to enable sequential read write operations in disk files of the Win GRAF PAC Fumetons Dering Please click the menu bar Help gt Topics and type the searching key word File to see more detail lt 3 Topics information in the topic of the File Management functions Language Copy all files in a directory to another directory exclude files F_cp_dir in sub directories E del dir Delete a directory and all files inside it exclude a sub directories and files inside sub directories Note The Win GRAF PAC of ICP DAS does not support Functions F_SAVERETAIN and F_LOADERETAIN Win GRAF User Manual V 1 01 Oct 2014 by ICP DAS 12 14 12 3 1 Write Data to a File in the PAC Refer P12 1 to open the project demo_file1 zip and can view add variables in the variable area ST Program This program can be used to write 10 REAL values t
206. c_DINT n 4 Public WORD LJ Port GEM EX TERN 1 192 169 1 100 200 168 1 100 9000 pe Destination Exchange data 7 PAC1_DINT Exchange data P4C1_REAL 3 Exchange data Error_Status 4 Exchange data Binding variables Win GRAF User Manual V 1 01 Oct Name Value Name EXTERN Addr Hi ARS Y Name Type REAL A Public REAL PAC1 BOOL PAC1 DINT PACI REAL 192 168 1 3000 2014 by ICP DAS 7 3 8 As the picture below Error Status variable is used to determine the communication status of the PAC please set this ID to 0 and then double click Destination field and set it to Connection error status Binding a 4 X a J PUBLIC 9000 Name Yale ei oe 1 Public_BOOL Name EXxXTERN 1 A 2 Public_INT Addr 192 168 1 Public_BOOL BOOL g4 AQ 3 Public_DINT Port 9000 PACT REAL REAL m 4 Public WORD PAC1_DINT DINT 5 Public_REAL PAC1_ BOOL BOOL gs EXTERN 1 192 168 1 100 200 168 1 100 9000 y Error_ Status DINT y Name Identifier Destination gt PAC1_BOOL Exchange data Name Value PACT DINT 2 Exchange data PACT REAL 3 Evchanne dats 0 c Exchange data Error Stat Of status Variable error status 4 gt Binding Variables Variable date stamp Build EOT x fLonnection error status 4 gt Build Crossreferences Runtime italsamplingtrace Prompt HMI Note a If EXTERN set up t
207. ceseeecesseseeeeees 3 1 3 2 To Enable the Win GRAF PAC as a Modbus RTU Slave ccccccssscccesseeeeeeceeeeeceseeeeeeeees 3 7 Chaptera Linking l O Boards cccessceacecacesdesccsiacecsacitsw due siesascudeaseceatontecsadasseeusioxaecevectecestewuacuseees 4 1 4 1 DyV4 BY G15 c go ieee eeee ements Sarit E E E E E SnD Sone ee Rn es 4 3 4 2 1 Sale CONVENSIOM Tale sess coaren de dine T E a T neece es 4 4 4 3 P2801 FW 8 16 channe All enir a jena weaiesbeeniansseassasenn panei 4 6 4 4 COZ HAC Mae an eaaa aa aN acctatuatste acamteaceareatioas acai T 4 8 4 5 1 8 7018W O CHANMOV tAos ea E salons es uicdsida sd dtustbeceed dai iad aw E 4 10 4 6 l exist Testit the l O module OxISES 2 arniran E E E 4 13 Win GRAF User Manual V 1 01 Oct 2014 by ICP DAS 1 2 4 7 4 8 4 9 4 10 4 11 Chapter 5 5 1 5 2 5 3 Chapter 6 6 1 6 2 i_8084 Frequency UP Down Counter UP Counter sssessssseereeeeeeeeeseesssrrrrrrrrrrrrrereeees 4 14 4 7 1 i 8084 freg 8 channel Frequency ccccccssseccccesseccceeeseceeeeeseceeseeecesseeeceseeees 4 14 4 7 2 i 8084 cnt_ch04 4 channel UP Down Counter cccceceeeeeeceeccesseeseeeeeeeeeees 4 17 4 7 3 18084 cnt_ch08 8 channel UP Counter ceccccccessecceceeseceeeeeseceeeeeseceeeenes 4 19 i 8093 3 axis High Speed Encoder Module cccccccssseccccesseccceeesececeeeseceeseeeceesauaeess 4 21 Using the Count Function for 8084W I 8093W I 8708
208. communication aor Win GRAF User Manual V 1 01 Oct 2014 by ICP DAS 5 5 5 1 2 Write DO Data 1 Using the same way in the Section 5 1 Step 4 to create the second data block and completing all the following settings in the MODBUS Master Request window and then click OK MODBUS Master Request In this example ates p a Slave Unit ikiii o Enter the Net ID of the Slave device slave Unit 2 lt a e g the Net ID is 2 MODBUS Request b MODBUS Request lt 35 gt Read Holding Registers L Select lt 5 gt Write single coil bit z4 gt Read Input Registers c Base address Page ice aera Kabia nonicbae pl Start from 1 by default Data block Refer the Section 5 1 1 to change it lt Base address 1 j d On call Nb items i The request is activated when a program call to send it Pina 4 Refer the Section 5 1 1 for details Brioadic ms on call e e Timeout Set a timeout value A z gt On change sia When time out occurred it will show e the defined error code The e Timeout 250 ms recommended value for the Modbus P RTU ASCII device is 200 to 1000 ms Nb trials In this case the value is 250 ms 2 Next open the Variables window and then declare variables that are available for the program Workspace lO Drivers Test_01 E Mg MODBUS Master Name Value ni L Exception pro
209. d saved the LD program For the Win GRAF project can function properly in the PAC we need to compile the programs To begin follow these steps 1 Onthe menu bar click Project gt Build All Projects to compile all programs Win GRAF Demoli Clean All Projects an Download ll Projects mete 2 Ifa No error detected message is appear that means the project was successfully compiled Note If you modify and save the program after compiling it click the Clean All Projects to clean the previous results and then do the step1 again Win GRAF Demolli File Edit View Insert Project Tools Window Help Bells an X s 5 9 a 28 6 OO Sal A e a PAC_Time Gx L uuaa amp x AF Name Type Z _ PAC Time Get Set FA RA Get current t HEn TIME_GET Eno Inst_TIME GET Time Inst_TIME SET Time Current time of th fa Global variables Gigi ual PAC Year DINT UA Soft Scope PAC Month DINT z Initial values Month PAC Month zi i Sj m miie ee Wg Binding Configuration Fa fA 3g Global defines fat Variables Used Froject 9 Advanced Arithmetic Qa Arrays 0g AS interace z 4 HH A way PPAC_ WWeekDay 5 lt Hour PAC Hour e A 4 Blocks Sovlist Define ENUM Build Relocating code Code CRC d1b4ae39 File CRC e6e6ea7f Size 2984 gt Check to see if there is any error message here Runtime Callstack OffLine 192 168
210. d set their values as 6 and 8 then press Enter key to complete the settings Note One 32 bit data requires two Modbus addresses For instance the Offset value of Long 1 is 6 and the next Offset value must be set to 8 i e Real_ 1 Symbol Operation Offset Mask Storage Word 4 Data exchange 3 FFFF Default A Word 5 Data exchange 4 FFFF Default Word_6 Data exchange 5 FFFF Default Data exchange Data exchange Status 2 p 4 gt 10 Drivers Variables Error report EJ Win GRAF User Manual V 1 01 Oct 2014 by ICP DAS 5 10 5 1 4 Write AO Data 16 bit 1 Using the same way in the Section 5 1 Step 4 to create the 4th data block and completing all the following settings in the MODBUS Master Request window and then click OK MODBUS Master Request i ehiccorample in this example Request a p a Slave Unit Description Enter the Net ID of the Slave device Slave Unit 3 e g the Net ID is 3 q MODBUS Request b MODBUS Request Select kets Read Input Registers FT Le lt 6 gt Write single holding register 1 lt 6 gt Write single holding register i a oe hs Lats Wika nil Dib Start from 1 by default Data block Refer the Section 5 1 1 to change it c Vis address 1 d On change In case of a write request Nb teme means that the request is activated each time any variable changed
211. d the Boolean data This configure way is similar to the step 4 to 8 1 Click the Server item and click the Insert Slave Data Block button at the left side to open the settings window 2 In the MODBUS Slave Request window enter a simple note and select the Input bits option then set Base address to 1 and set Nb items to 2000 IO Drivers EI H E hN Registers 1 2000 Read Value _ MODBUS Slave Request Ed F Request F Description Read Boolean Enter a simple note For the Modbus Master to Read data Data read or Forced by the master Option Data Type BOOL Coil Bits Input Registers BYTE INT DWORD O Holding Registers a REAL LINT etc Data block Refer Appendix A to see more data type Bare adea Nb items z000 Data read by the maste Input Bits i Input Registers 3 Mouse drags the Boolean variables i e LED1 LED2 data type BOOL one by one and drop them to the Symbol area and then set the Offset to O and to 1 IO Drivers Ege Server Slave number 1 A T Name a it Input Registers 1 2000 Read Vale Request Input Bits a 1 ts 1 200 Address B Nb item 2000 I RETAIN variables Description Read _Boolean in 7 z P m zMame Value H Default Ea ay LEZ __ Defaut 77 A n 4 ii gt Gms FAC Time Wariables LD1 10 Drivers You have co
212. dded HMI BB Soft Scope PG ij i Shortcuts esa Ca Insert New Folder Others vow HD Mh gee oct Mew J e G nert New Program MR Insert HMI Device 3g G e o ET shortcuts oo Ti SEIT NEW MENL Properties Cancel Description 2 Double click NewRecipe1 on the left side to open the setting window and drag the variables you want to put into the window NewRecinet rop E c Test a Name Value Y Name Type nj LI Exception programs Ex Water Elf j E L Programs Soft_Flour os W FBDI Strong_Flour Soft_Flour ae Main Salad_oll Wy Strang_Flour st ST1 Data Conversi A Cream s A Salad_oil ELE Watch for debugging g Egg Wi Cream Soft Scope Cook_time T pia Eqg E Initial values Ee Plain_Flour a a aia gh aa I Cook_time a Lemon _Juice Plain_Flour e Gd NewSpyl Suger Lemon Juice j Binding Configuration at Suger 3g Global defines l A Variables 4 Variables NewRecipe i Win GRAF User Manual V 1 01 Oct 2014 by ICP DAS 11 9 3 Click on the Insert Column icon to add the new Recipe and then fill in the suitable Values HewRecipet rcp a a Caramel Pudding Lemon Pudding Pie D 7 Hame Type 125 Global variables Soft_Flour 50 50 Water DINT E Strong_Flour 50 50 Soft Flour DINT E Salad_oil 35 0 strong Flour DINT i Cream 40 40 Salad_oil DINT F Egg 180 180 Cream DINT Cook_t
213. double click the 1st data block i e lt 4 gt Read Input Registers to open the setting window Workspace IO Drivers i 7 Xx 3 C demo_X 308_1 E SM MODBUS Master j TY Name Type H C Exception programs a Sg ATU COMO 115200 N 8 1 fa Global variables J L Programs E g a i lt 4 gt Read Input Reaisters 1 1 8 AY3S06 ALO INT 3 a Main B H B lt 2 gt Read Input Bits 1 33 40 XY308_ Al 1 INT a eg n debugging Symbol inei Offset Storage XY306 Al 2 INT 2 ane lt 3058_Al_ 0 Data exchange 0 Default AVS08_ALS INT E ssid Ge xVv308_AL1 Data exchange 1 FFFF Default AYI ALA INT Ya Binding Configuration 9 308 Al_2 Data exchange 2 FFFF Default AYSU AS INT megg aoa dome SBI 0308_Al_3 Data exchange 3 FFFF Default Re G Variables gy lt v308_AL4 Data exchange 4 FFFF Default RVI IT ETs XV308_AI_5 Data exchange 5 FFFF Defaut LO NT Th XV308_Al_6 Data exchange 6 FFFF Defar Th xv308_ Al 7 Data exchange ri FFFF Default Value V308_ status Error report 0 F Default f gt Note The Offset value is starting from 0 and the Modbus address for variables is equal to the Offset value plus 1 Base address Moreover if you set the Operation as Error report the Offset value for the mapping variable Date Type DINT must set to O MODEHUS Master Request Ed Request Sere itn 1o The Net ID fixed to 1 of the MODBUS Request Slave device i e
214. e 0 9 Ch2_Filter 0 40 Ch3_Mode 0 Ch4_ Filter 0 ti Signal Inverted 0 12 Reserved 0 13 Reservedl 0 44 Reserved 0 15 Reserved 3 0 16 _ Setting Description 47 8084 W Setup 4 Ch Counter Inputs Note Please use the i_ 8084 Start i_8084 Stop 1_8084 Get 8084_ State and i_8084_ Reset functions to operate counter channles in an B084 W Parameters Parameters Ch_Mode Input mode can be 0 1 and 4 Set other value will use 0 0 Pulse DIR mode 1 UP DOWN mode 4 A B phase Quard mode Ch_Filter The unit is 0 000001 second us the value can be O to 200 The default setting is O without filter The Ch_ Filter is for filtering out some noise signals with smaller signal width Recommend O if there is no noise consideration or need a real time measurement The following setting is recommended Max Input Signal Hz Recommend Filter Value 200 O without filter Win GRAF User Manual V 1 01 Oct 2014 by ICP DAS 4 17 Signal_Inverted 0 Input signal is normal no inverted 1 Input signal is inverted means voltage HIGH will be processed as LOW and voltage LOW will be processed as HIGH For example If setting Signal_ Inverted as 0 no inverted and Ch_ Mode is O Pulse DIR the counter value will count up if DIR signal is High If setting Signal_ Inverted as 1 inverted and Ch_Mode is O Pulse DIR the counter value will count down if DIR signal is High Double click the it
215. e Status offset 0 symbol ERROR_STATUS2 nbword 1 mask ffff RangeHi RangeLo SigHi SigLo gt lt fmodbusreg gt lt modbusport gt lt MOQDUS gt Win GRAF User Manual V 1 01 Oct 2014 by ICP DAS 5 50 7 Click the Win GRAF menu bar Tools gt Import File Edit View Insert Project BOS Window Help dd amp 25 8 BR Options BWEBAEs FHA Customize 7 Send to Watch as La Exception programs roger ee 38 1 100 502 E A Global variables a i omame Go to Yanable Definition gt 1 1 3 boo 1 BOOL ow a Main Edit Variables as Text boo 2 BOOL 5 al sy for debuggin Generis fini focas boo 3 BOOL feast Soft Scope oie ar DINT_1 DINT f g B toring A tion Hd Binding Configuration History gisters 1 1 5 DINT_3 DINT gt 3g Global defines 3 Global Binding Editor DINT 4 DINT 7 oft Variables g Compare Project DINT_5 DINT E Types Ei Generate HTML Graphic ERROR_STATUS1 DINT a j ERROR STATUS2 DINT v OPC Client r ean i tai IEC61850 Client pee TF ame alue Goose Client T Slave Unit Address Communication Parameters 1 Runtime Parameters gt 1 epee Export gt 8 In the Import Assistant window click Import project items XNL and Next 9 Select the file you want to import e g Master_2 xml and click Open button Import Assistant Welcome to the Import Assistant What do
216. e e g DINT refer the Appendix A it requires two Modbus addresses as the table below the Offset values are O 2 4 6 etc Spmbol Mask Storage PAC Year 0 FFFF Default PAC_Month 2 FFFF Default PAC Day 4 FFFF Default PAC Hour b FFFF Default PAC Minute U fe 6t FFFF Default PAC Second 0 FFFF Default PAC WeekDay 0 FFFF Default Tips Mouse click the Offset field and press the keyboard Ctrl A to select all items and then click the Iterate Property button at the left side to open the settings window F Symbol Storage q PAC Year Default S PAC Month Default g4 PAC Day Default PAC Hour Default PAC Minute Default C Second Default PAC weekDay DO FFF O Defaut OOOO Win GRAF User Manual V 1 01 Oct 2014 by ICP DAS 3 3 Keep the Name setting enter O into From field and enter 2 into By field then click OK If setting the Name to it will show OO 22 44 66 88 1010 1212 in this example To modify it depends on the required settings and then check the value in the Results area Mame From Results A Mask Storage FAC Year FFFF Default PAC Month FFFF Default PAC Day FFFF Default PAC Hour FFFF Default PAC Minute FFFF Default PAC Second FFFF Default Ca PAC WeekDay FFFF Default lt gt F amp C Time Wariables LE 10 Drivers 9 Click Storage to select entire columns and then press
217. e Passive PAC s RS 485 port can receive data Parameters ChoO_Port_No Ch15 Port_No The used RS 485 port number of the Passive PAC Can be 0 or 1 to 33 depends on the PAC model Set O means disable it Ch00_Timeout Ch15_ Timeout The unit is second Can be 1 to 60 seconds If there is no data received in the timeout interval of the related RS 495 port the status will reset as FALSE 16 ch Boolean Inputs It used to represent state of RS 485 ports in the passive PAC TRUE The related RS 485 port open ok and can receive data FALSE The related RS 485 port open fail or receive no data in the timeout interval Win GRAF User Manual V 1 01 Oct 2014 by ICP DAS 16 8 16 3 2 Declaring Variables demo_RDN_2 Users can view or add variables in the Variable window refer Section 2 3 name state verion BOOL Set it as TRUE to set up new system time Used in the PAC_Time program They are used to set the PAC s system time Used in the Retain_and_timer program Set them as retain variables TMR_1 TIME Timer TMR_2 TIME TRUE Retain variables are well set up retain _done BOOL randone soot FALSE Not set up yet N hi he fi f Li on _line_change_cycle DINT ee means this is the first cycle just after On Line It It used to return the Retain status 0 to return the Retain status Used in the PAC Time program They are used to get the PAC s system time Win GRAF User Manual V 1 01 Oct 2014 b
218. e Soft GRAF ssssssssssseessseesssersseereseresseerssereseereses 17 25 Data types ANG RANGES siisecosreiccso rinine i a a a a a aai 1 Troubleshooting while On Line the PAC sesessesessecessecessececoscessscecssoesessecssoesesoeseeseo 2 Enable the Screen Saver Of WinCE PAC scsscsscsccscsscsccscsscsccscnscsscscescssoscsscnsossesones 4 Using Expansion RS 232 485 422 sscssccssccssccsscssccssscesccscccsscccssesccsscessssscessseseeceussees 5 Enabling a Serial Port for Connecting the Win GRAF Workbench cscsscscsecscsccsceees 7 Pin Assignment of PAC s Serial Ports cscsccccscsccccccscsccccccscsccccccscscescccscsceseccscsceseccecs 9 Win GRAF User Manual V 1 01 Oct 2014 by ICP DAS 1 6 Chapter1 Software Installation amp Hardware Setting 1 1 Installing the Win GRAF Workbench Before installing the Win GRAF Workbench check the installation environment on your PC System requirements O S Windows XP Windows Vista Windows 7 Windows 8 32 bits or 64 bits Microsoft Net Framework 3 5 Download it on the Microsoft web site http www microsoft com zh tw download details aspx id 22 RAM 1 GB minimum Recommended 2 GB or more Available hard disk space 200 MB minimum Installation Steps 1 Double click the Win GRAF setup ver x xx exe file in the Win GRAF installation CD or download the latest version of the Win GRAF Workbench on the website http www icpdas com root
219. e as 2 Setting greater than 30 will use as 30 Note The Interval_ xx value should be at least triple of the Timeout_x value Or the PAC will use the Interval_x value as a triple of the Timeout_x value For example if Timeout_00 is set as 10 however Interval OO is set as 20 then PAC will use Interval 00 as 30 2 Double click the item and fill in a value then press the Enter key to complete the setting 9 0 Ping ip Properties Keys 6 OA Ref 16764 IP_0 192 168 1 100 i 192 168 78 88 y IP_2 NiA Interval_2 15 Timeout_2 3 Interval 4 15 I 3 After linking the Ping ip in the I O Boards window it will auto add 50 BOOL input variables in the Variables window When the Win GRAF connects the PAC it will display the online status True The connection is ok FALSE Connection failed or cable problem Dim Attrib Syb Initvalue User Tag Description A 0 pace You can change the variable 9 02 name by double clicking it 03 See the Section 4 1 1x9 0 4 a 1x9 0 5 BOOL Input a 1x9 0 6 BOOL Input L x9 0 7 BOOL Input LI olX9 0 8 BOOL Input 3 1x9 0 9 BOOL Input E J a W IX9 1 Ping_ip_10_19 a IX9 2 Ping_ip_20_29 a 9 3 Ping_ip_30_39 w B x9 4 Ping ip 40 49 lt Win GRAF User Manual V 1 01 Oct 2014 by ICP DAS 4 30 4 11 1 8088W 8 channel PWM Output Module The I 8088W is an 8 channel PWM Pulse Widt
220. ect settings x CWin GRAF ProjectsiTest Name Value EH Auntine system Little endian Cycle time T G4 Code Generation Release Exchange lOs while stepping Yez dEr General Compiler Debugging Advanced all Example LD Program Using division REAL_VAL 25 5 Bool 1 FBD Program Call a function ANY _TO_BYTE to convert the type from SINT to BYTE MAKE WORD ANY TO_BYTECSIMNT_ Hi Lo byte WORD VAL 1 Win GRAF User Manual V 1 01 Oct 2014 by ICP DAS 11 8 11 7 Apply a Recipe in the PAC Some applications use the pre defined Recipe and Value for processing different products and this Recipe can be mapped to a combination of variables within a Win GRAF PAC When one day want to change the PAC process to produce a different product you can use the Win GRAF Workbench to connect with the PAC and select a new Recipe you want to replace and then apply it to the PAC Steps 1 Mouse right click on the project name e g Test and select Insert New Item then click on Watch gt Recipe and Next button fill in the Recipe name e g NewRecipe1 and then click OK Workspace See UER _ cae E pet as piartup Project A Insert New Item Eg a j E a P Communication Paramet Categories Available Items Bl OnLine All ad Spy fi deve 3 Pro rams ar tecinpe Eh Simite l a Resources Pey aw Mc Embe
221. eecesanscesaenees 11 18 How to Protect Your Win GRAF Program to Avoid Unauthorized Copied 6 11 19 DEMO Project DESCHIPUIONS esasen a E ENE EA 12 1 Win GRAF User Manual V 1 01 Oct 2014 by ICP DAS 1 4 12 1 12 2 12 3 Chapter 13 13 1 13 2 13 3 13 4 13 5 Chapter 14 14 1 14 2 14 3 14 4 14 5 Chapter 15 TME Opera oa hcieeenrrerme eset T rere rere 12 2 T211 Stake SLOP and Resetthe TIMET roreir ctscirests ccs ina aN R ec aise tie EAEE 12 2 TAL Penodic Operation uraninan tp avisaseeucoetian aueeenine tees 12 3 12 1 3 Detect the Steady ON or Steady OFF Signal cccssccccssececesseeceeseeeeeeceseeeeeees 12 5 12 1 4 Keep Outputting ON for Some Time after Triggering ccccsscccssseceeeseceeeeseeees 12 6 Operations ol Serial POr COmmMuUNi catio Nasien aa E me daveewece 12 7 1221 Senda stine DY COM PON wa ieccercaccanii it nin en ia RE ROO EA EEE 12 8 12 2 2 Request Answer the Device by COM Port cssseseeeeeeccecccsscsseeeeeeeeeeeeeeesseeeess 12 9 12 2 3 Wait Data Coming from Remote Device by COM Poft ccccccsssececesseeeeeeees 12 11 12 2 4 Report Data Periodically to Remote Device by COM Port cccseccesseeeeeeeees 12 13 Read Write Data from to a File in The PAC asessesssessssessssessssessssessseressersssresssrrsssresseresne 12 14 123 1 Write Data toa Filen the PAC rosseninironnn aeni a tereseeetis 12 15 123 2 Read Data roma Filen the PAC creeren a a
222. eger value 1234 to the Win GRAF INT variable with address 2 UserShare Set_INT Convert ToUInt16 3 Convert Tolnt16 1234 Set a 64 bit Integer value 123456789012345 to the Win GRAF LINT variable with address 3 UserShare Set_LINT Convert ToUInt16 3 Convert ToInt64 123456789012345 Set a 8 bit Integer value 125 to the Win GRAF SINT variable with address 4 UserShare Set_SINT Convert ToUInt16 3 Convert ToSByte 125 Demo Program CD ROM 1 napdos Win GRAF demo project vb net_2008 demo demo_vb02 for R W analog I O 2 napdos Win GRAF demo project vb net_2008_ demo demo_vb03 for R W internal long integer Timer and Real floating point values Win GRAF User Manual V 1 01 Oct 2014 by ICP DAS 13 10 Mi Get SINT W Get_INT W Get DINT W Get_LINT Description These functions are to get 8 bit integer 16 bit integer 32 bit integer amp 64 bit integer value from Win GRAF integer variables Syntax UserShare Get_SINT ByVal iUserAddress As System UInt16 ByRef iStatus As SByte As Byte UserShare Get_INT ByVal iUserAddress As System UInt16 ByRef iStatus As Short As Byte UserShare Get_DINT ByVal iUserAddress As System UInt16 ByRef iStatus As Integer As Byte UserShare Get_LINT ByVal iUserAddress As System UInt16 ByRef iStatus As long As Byte Parameter iUserAddress Address of Variable 1 to 8192 iStatus Get the 8 bit integer 16 bit integer 32bit integer or 64
223. em and fill in a value then press the Enter key to complete the setting 1 1 8084 cnt B4ch Properties Key 6 Ref 16 8084C4 ChO Mode 0 ChO Filter 0 Chi_Mode 0 Chi Filter 0 Ch Mode 0 Ch Filter 0 Ch3_Mode 0 Ch4 Filter 0 Signal Inverted 1 ReservedO 0 Reservedl 0 Reserved 0 Reserved3 0 signal Inverted After linking the i_8084 cnt_ch04 in the I O Boards window it will auto add one BOOL Input variable no meaning always FALSE in the Variables window Variables i 7 X T Name Type Dim Attrib Syb Init value User Tag Description B IxX1 i 8084_cnt_D4ch wo olX1 0 BOOL Input LJ W gt SS After linking the I O board refer the Section 4 9 to use COUNTER_START COUNTER_STOP COUNTER _GET COUNTER_STATE and COUNTER_RESET functions in the LD or ST program to operate the Counter channel of the I 8084W Win GRAF User Manual V 1 01 Oct 2014 by ICP DAS 4 18 4 7 3 i_8084_cnt_ch08 8 channel UP Counter Note Using the COUNTER_START COUNTER_STOP COUNTER _GET COUNTER_STATE and COUNTER_RESET functions in the Win GRAF Workbench to operate counter channels in an I 8084W 1 Mouse double click the i_8084_ cnt_ch08 to open the Properties window and then to see the setting description SEE 170 Boards S08 4 cnt O8ch Ae i _ S084 cnt Ouch P
224. en Project List r bave Froject List j Destination folder C Wwin GRAF Projects v Name demo_trmrl 2 Double click Main to open the ST program and can view add variables in the variable area 3 Mouse right click on the project name demo_tmr1 and select Communication Parameters to set up the IP Address of your PAC Refer Section 2 3 5 A Win GRAF demo tmrl File Edit View Insert Project Tools Window Help i ee a 6 NK GF Oo OD He HEE OE so BBA F Wor Communication Settings a demo_tmri ro is Set S J Exception programs START th BOOL d C Progans eo FFO START Ee i pal vatabiee z E tStart 492 O FN2 se Ca Mind E debugging i 192 168 71 19 502 il BOOL end if WA Soft Scope 192 168 255 1 502 E Initial values set ST 192168 71 18502 BOOL H d NewSpyl if STOP 1192 168 71 19 502 BOOL AfA Binding Configuration E STOP t 3 Global defines t5topi a Ga a f Variables end_if a g Project Types Z Build 4 gt Build Crossteferences Runtime Callstack Breakpoints Digitalsamplingtrace Prompt HMI Offline 192 168 71 18 502 ini chi 0x1 Ln 1 Chi 100 Win GRAF User Manual V 1 01 Oct 2014 by ICP DAS 12 1 12 1 Timer Operations 12 1 1 Start Stop and Reset the Timer Refer P12 1 to open the project demo_tmr1 zip and can view add variables in the variable
225. ent the Win GRAF project and schedule configuration in the Win GRAF PAC Then testing the schedule control 1 Download the demo_ schedule project to the PAC by the Win GRAF workbench For more information refer the Section 2 3 5 2 Download the schedule configuration to the PAC by the Schedule Control Utility 1 Click Send to Controller 2 Assign the PAC s IP address remember to fill in your PAC s IP address Set a password This demo uses 0 Check Remember Password can remember this password Click OK to send the schedule setting to the PAC 3 If success it will pop up a Send file success window a Schedule Control Utility aaam n Sento Contller to Controller EO Controller time gaia Open from PC Get from Controller Help about Target 1 Target 2 Target 3 a Controller info IP 192 168 75 101 Password 5 J Remember password Target 10 Win GRAF User Manual V 1 01 Oct 2014 by ICP DAS 17 10 3 Test the Win GRAF project Click On Line to connect the PAC by the Win GRAF workbench then open the NewSpy1 window If the connection is fine we can see variables Target_01 xxx Target_10 xxx are controlled properly by the schedule configurations which is set by the Schedule Control Utility The user may use the Schedule Control Utility to modify the schedule configurations and then download to the Win GRAF PAC to see if those
226. er When the ET 7000 shipping from the factory the settings are IP address 192 168 255 1 Mask 255 255 0 0 Please set the IP of your PC in the same network e g set the IP to 192 168 255 100 Mask 255 255 0 0 then open the browser such as IE and enter the IP of the ET 7000 to connect it Notice The Dip Switch on the rear of the ET 7000 must stay in the Normal position gt PET 7000 Web page Windows Internet Explorer m a in tthe PET 70182 BaARSS 192 168 2551 Rip AKAH EWIE es HEIDAR ae eak RRA A SBR EET EAHA l Piss GRASS O TST S5BAR Username Admin Password Admin Case sensitive i F252 88 0 REP G Admin Ecoss sche Peay ISR BUA Win GRAF User Manual V 1 01 Oct 2014 by ICP DAS 5 42 Click Configuration gt Module I O Settings to set up the range of channels as below and then click Submit gt PET 7000 Web page Windows Internet Explorer el jo e 192 168 255 1 AIE ve RARE PET 7000 Web page O fe D oh aD FEO TBO ICP DAS http www icpdas com quae er EJ Main Menu Overview HE Configuration Range 40427 Enable 00595 7 er Network oettings OSTA ASN OFA ON 2 Basic Settings 04 iv OFF ON OF T C K type 270 C 1372 C ore C lon i u T sOrammenea Set as ON to OF T C K type 270 C 1372 C ofr on 4 Ween 057 2 5V e enable It I Pair Connect
227. ese three demo programs demo_RDN_1 zip demo _RDN_2 zip and demo_RDN_3 zip related to the redundant system Refer Chapter 12 to restore these files into the Win GRAF Workbench demo _RDN_1 _ Two XP 8xx8 CE6 PACs using their COM3 to connect three DCON 1 0 modules demo _RDN 2 Two XP 8xx8 CE6 PACs without connecting any I O module Two XP 8xx8 CE6 PACs using their LAN1 to connect a ET 7050 Modbus TCP I O demo_RDN_3 module through one Ethernet switch The following sections will describe the demo_RDN_2 program 16 3 1 I O Board Settings demo_RDN_2 demo_RDN_3 To use redundancy in the PAC first link the i_redundancy in the I O Board window Refer Chapter 4 FE 1 0 Boards Eg a Clase 10 1_redundancy Properties a r Active IP 192 168 7147 Passive TP aio Mask 255 255 255 0 aa a Note DO NOT set the last digit value eseryedO U SES air of the Active_IP as 0 or 254 or 10 redundancy medal Reserved a 255 It should be in 1 to 253 Or 02 2 ee l ea i redundancy Enable Redundancy in the PAC The following PAC support redundancy eoP oeeo CE 6 AP dexe LCEB WwP 5246 Parameters Active_IP The redundant system provides a public IP address for some HMI SCADA to communicate Note DO NOT set the last digit value of the Active _IP as O or 254 or 255 It should be in 1 to 253 Passive_IP Auto means the LAN1 IP address of the current P
228. ets Target 1 to Target 10 Each Target contains one BOOL one DINT and one REAL variable Settings in the I O boards window To enable schedule control in the Win GRAF PAC first click the Open I Os to add one Schedule add it in the slot number 8 or bigger number There is a Password parameter in its Properties window The Password is for the Schedule Control Utility running in PC to identify the authorization when connecting the Win GRAF PAC It is set as 0 in this demo project After adding the Schedule in the I O boards we can find 10 BOOL input channels in the variables window These 10 channels return the state of the schedule control of the Target 1 to 10 TRUE means the Target has the schedule control enabled by the Schedule Control utility FALSE means not enabled Window Help Sc e iule Name Hourt 1 eeserved 0 I O Board Schedule has 10 BOOL T Reserved 0 Minute1 inputs They indicate if the released Rara of Secondi Target 1 10 has enable the workennce ae ne schedule control or not a domo_schedwe A RETAIN variables EA Exception programs MB 1X10 Schedule tall Programs IX10 0 Target01 i i Main 1X10 1 Target02 E waten or debugging IK10 2 Target3 Soft Scope IX10 3 TargetO4 EH Initial values 6IX10 4 Target05 Sd NewSpyl 1X10 5 TargetO6 ig Binding Configuration IX10 6 Target07
229. etup Win GRAF Aela Select Destination Location Where should Win GRAF be installed Setup will install Win GRAAF into the Following Folder To continue click Neck IF you would like to select a different Folder click Browse Browse At least 77 4 MB of Free disk space is required 4 Click Next to add a Win GRAF folder shortcut in the Start menu and then select Create a desktop icon to add a desktop shortcut then click Next to continue setup Win GRAF Select Start Menu Folder Where should Setup place the program s shortcuts ie FA Setup will create the program s shortcuts in the Following Start Menu Folder To continue click Mest IF vou would like to select a different Folder click Browse setup Win GRAF Select Additional Tasks Which additional tasks should be performed Select the additional tasks you would like Setup to perform while installing Win GRAF then click Mex Cancel Additional icons Cancel Win GRAF User Manual V 1 01 Oct 2014 by ICP DAS 1 8 5 Click Install to begin installing the Win GRAF Workbench Setup Win GRAF Alka Ready to Install Setup is now ready to begin installing Win GRAF on your computer Click Install to continue with the installation or click Back iF you want to review or change any settings Destination location Cr Win GRAF Stark Menu Folder wWin aR AF Additional tasks Addit
230. f File ID O then open file in read mode fail File status Can not open File File path I else Win GRAF User Manual V 1 01 Oct 2014 by ICP DAS 12 17 open file in read mode ok read REAL 0 9 from file each row contains 1 REAL value and end with lt CR gt lt LF gt File status Open File File_ path Ok for ii 0to9 by1 do test if the end of file is reached in a file open for read if F_EOF File ID then reach the end of file exit for loop exit end_if read one row in the file as a string Tmp_string FM_READ File_ID convert the string to become REAL value REAL_valfii Any_to_REAL Tmp_ string end_for close the file If want to read Integer use the code below F_close File_ID DINT_valf ii Any_to_DINT Tmp_ string and declare Variable DINT_val as DINT and end_if Dim at least 10 for this example end _if end _if Note In this example when the Read_File is set to TRUE it will read the file in the PAC System_Disk Real_data2 txt please make sure the file already exists in the PAC GRE RHE RAW BEG 2 xa By FEO System _Disk gt Drivers C9 External_device_driver IE RPE tm taOl THII tar led i gt ISAGRAF 1 05 GS tools 2 i0 gt Win GRAF 46 45 2 penmount_usb_touch_v20100526 41 5 a IEC61131 User and Reference Mant 52 675 Backup_Real_2 txt l F
231. fer P12 1 to open the project demo_com_port3 zip and view add variables in the variable area ST Program operations in first PAC cycle Declare INIT as BOOL and has initial value TRUE if INIT then Port_OK as BOOL INIT FALSE edict NUM1 as DINT T1 as TIME TL THOs ByteAry as BYTE and Dim 200 STEP1 0 Port_number as DINT and has initial value 3 end_if if port is not open open it if COM_status Port_number FALSE then Port_OK COM_open Port_number 9600 N 8 1 end_if If open port fail exit this ST program if Port_OK FALSE then return end_if CASE STEP1 OF if there is at least 1 byte coming 0 if COM_test Port_number then STEP1 1 T1 THOs STEP1 0 means waiting and will test if COM3 has data Tstart T1 If returns TRUE means COM3 has data end_if Then set STEP1 to 1 T1 to 0 and start timing Win GRAF User Manual V 1 01 Oct 2014 by ICP DAS 12 11 wait 250 ms then receive all bytes form COM port E T1 gt T 250ms then STEP means the data is SENE in and will wait ie ms to receive all data and put them into an array The waiting Tstop T1 time concerns the device specifications and the Baud Rate T1 THOS If set the time too short may receive data incompleted STEP1 0 Remember to set STEP1 to 0 to wait for the data coming next time receive max 200 bytes NUM1 CO
232. ffset 0 symbol ERROR STATUS nbword 1 mask ffff RangeHi RangelLo SigHi SigLo gt lt modbusreg gt lt modbusreg name mode Read Input Registers a lt modbusitem ope Data offset 0 e n wore 30 770 mas ask FFF Rangetic Rangelo a Sighi Siglo gt lt modbusitem ape Bata offset 2 symbol DINT_2 nbword 32770 mask ffff RangeHi RangeLo SigHi SigLo 7 gt lt modbusitem ope Data offset 4 symbol DINT_3 nbworc mask ffff RangeHi RangeLo SigHi SigLa gt lt modbusitem ope Data offset 6 symbol DINT_4 nbworc mask ffff RangeHi RangeLo SigHi SigLo gt lt modbusitem ope Data offset 3 eymbol DINT_ 5 noword 32770 mask ffff RangeHi RangeLo SigHi SigLo gt lt modbusitem ope Status offset 0 symbol ERROR STATUS2 nby word 1 mask ffff RangeHi Rangelo SigHi SigLo gt lt modbusreq gt lt modbusport gt lt fieldbus gt Copy lt fieldbus gt 6 Paste the copied content above the lt modbus gt and change the address to the second IP address of the Modbus Slave device e g 192 168 1 101 then save and close the file DP Master 2 0ml PE E ES PELI RRE EAO RA SAH HAN Ctr N Ai BARS Eta 0 CtHO master address 192 168 1 100 port 502 sdiags 1 reconnect 1 disabled 0 reqdelay 10 rtu 0 gt ATERRO ORJ 2 mode Read Input Bits address 0 nbitem 3 slave 1 call Periodic 1000 8000
233. figured once e g Address Baudrate etc by the DCON Utility see P8 1 Please must configure the data format of Al modules to 2 s complement by DCON utility or the Win GRAF PAC can not read them well 2 Please use DCON Section 8 1 in the I O boards window and set proper settings Port baud_rate etc on it 3 All values of Al channels are meaningful only when the returned communication state is TRUE If OK returns TRUE 4 Referring Chapter 12 click the menu bar File gt Add Existing Project gt From Zip to restore the demo project CD ROM Napdos Win GRAF demo project DEMO_D_7018z zip in the shipping CD and see the program and descriptions Supposition Use PAC s COM2 to connect the I 7018Z Addr 3 to measure the Celsius temperature F EE n CNP Name l Type Dim lll i o ati j fa Global variables A Al 1 REAL p _ Al 2 REAL If OK returns TRUE Al_3 REAL Si afa Al 4 REAL Al 5 REAL TH apas Al 6 REAL 5 Al REAL e _3pAl_4 Al 8 REAL Al 9 REAL ar ALS Al 10 REAL Declare 10 REAL variables COM BOOL z t 5446 Al of the I 7018Z B HKH gt AL D_70172_20 remote i A p h D_7018 temote i 701 mt 7FLAL8 D_ 70182 temote 1 70 i D_7O19R remote i 70 BbALS D_ 7021 remote i 702 D_ 7022 remote i 702 4 Al_10 v D_7024 remote i 702 lt gt EE Blocks Sovlist Define ENUM gt Main Variables j dal alae aot e In
234. functions in the UserShareNet dll Win GRAF User Manual V 1 01 Oct 2014 by ICP DAS 14 4 14 4 Compiling the Application Program When you have finished writing a program you can build compile an application by the following steps 1 Remember to save at any time for safety project Microsoft Visual Studio File Edit View Project Build Debug D a Co PandineSanree 2 Then compile Build the project The result is listed in the Error List windows at the bottom project Microsoft Visual Studio File Edit Miew Project Debug Data Form G p3 g K Al wae Buld project Febuild project Deploy riS CE Ereren EA E td BindingSource ee pro Build succeeded 3 You can find the execution file in lt Your C net Project folder gt bin Release lt project_name gt exe Please copy this execution file to the WP 8xx8 s System_Disk Win GRAF path to run it Note The user may copy the C net execution file to another path to run it but there should contain at least two DLL files with it or it cannot run correctly For ex the project1 exe can run in the Micro_SD path if there are three files in it The project1 exe UserShareNet dll and Quicker dll The UserShareNet dll and Quicker dll can be copied from the Win GRAF PAC s System_disk Win GRAF path Win GRAF User Manual V 1 01 Oct 2014 by ICP DAS 14 5
235. g a change should not be used Pulse P or N contacts and coils edge detection 4S Instead you must use declared instances of R_TRIG and F_TRIG function blocks Rising Pulse Detection Before Enable After Enable Suit Inst_F_TRIG p CLR TRIG Gi False gt True OUT Inst_R_TRIG P I CLKR TRIG G Decreased Pulse Detection ra Inst_F TRIG CL F TRIG Gl True gt False OUT nast _F_TRIG H l CLEF TRIG a Loops in FBD with no declared variable linked You need to explicitly insert a variable in the loop Win GRAF User Manual V 1 01 Oct 2014 by ICP DAS 9 2 9 2 Using On Line Change Enable The On Line Change Function 1 Mouse click Project gt Settings from the menu bar then double click On Line Change item to set it Enabled Win GRAF Test File Edit View Insect Steam Tools Window Help Build All Projects Clean All Projects ji i E Download All Projects Project setings fx Citin hath A ties ee Ee Name Value Runtime s Communication parameters 192 166 71 18 502 Compiler Debugging BW Cycle time 0 Advanced Code Generation Release All ae Enabled Op versto Libraries Use external objects Double click to disable or enable and configure On Line Change OK capabilities 2 Click Project gt Build All Projects from the menu bar Must compile the program first then can set up the following steps A Win GR
236. get the data from other external PAC 5 Click the Insert Master Port icon in the left side it will show the Group window Follow the descriptions below to set up this window and then click OK button Binding ts dt i Name Identifier PAC1_B00L 1 5 38 Network pees PUBLIC 9000 Hame Address Fort Nal EXTERN 1 Address Address 192 168 1 100 200 168 1 10 Port go00 Can be modified to the desired name Enter the IP address of the PAC which data will be obtained e g 192 168 1 100 User can enter two IP Addresses e g 192 168 1 100 200 168 1 100 that PAC must use two Ethernet Ports so that when one IP address occurs any problem it will try to link the second IP address Fixed to use 9000 do not change it Name Address Port In the variable area set up the data type you want to get Refer Step 3 Right click on Global variables and press Ins key to add the variables The variables that listed in the table are used for this example You can set up your own After finished the screen is as below Hame Value PUBLIC S000 Please drag the variables you need into the Name area of the EXTERN 1 Note Identifier field will automatically generate numbers please change them to the same as the opened IDs of the PAC that you want to get data from Sj PUBLIC 9000 h 1 Public_BOOL 2 Public_INT 3 Publi
237. grams 3 Gl ATU COM2 9600 N 8 1 Request lt 5 gt Write single coil bit E L Programs a lt 2 gt Read Input Bits 1 1 16 Slave Unit 2 7 H Main B 5 gt Write single coil bit 2 1 1 Address 1 d E Watch for debuggi Nb Item 1 i BB Soft Scope g Activation On Call EJ Initial values Tips Period ms 0 Ajd Binding Configuration Press F1 key to view the details Period omenor 0 Xg Global defines c5 on the MODBUS Master settings Timeout ms 250 3 Variables Number of trials 1 fy Types BY Description Double click it to open the window Add two boolean variables in the Variables window refer the Section 2 3 1 for declaring variables poo BOOL Used to Write digital output data In this case choose the On call way to write data that means Act_0 BOOL using a variable to call it Win GRAF User Manual V 1 01 Oct 2014 by ICP DAS 5 6 After completing the settings the defined variables show as below Y Name Type D S Attrib Syb Initvalue User Tag Description poo BOOL C Act 0 BOOL L v lt B 4 gt 10 Drivers Variables 3 Inthe IO Drivers window drag variables DO_0 Act_0 and Status that created in the Section 5 1 1 from the Variables Area to the Symbol Area in the second data block Note The Status is an array variable When you drag Status into the Symbol Area it will show Status 0
238. gt Read Input Bits 1 18 xV107 DIO1 BOOL ee ae Main B B lt 15 gt Write Coil Bits 1 1 8 RF xv107_DI_ 02 BOOL A 1 A ST T T M y m a e T a _ Symbol Operation Offset Mask Storage aortas Sai E Initial values wa XV107_DI_00 Data exchange 0 FFFF Default yr 07 D Os BOOL RIA Binding Cocfiguiation xv 107_DI_01 Data exchange 1 FFFF Default AA 07 DI OG BOOL B Sq Global defines as x 107_DI_02 Data exchange 2 FFFF Default A 07 DI a BOOL f Variables a 107 _DI_03 Data exchange 3 FFFF Default Types g xv 107_DI_04 Data exchange 4 FFFF Default AA TA om Boo Y eV 107_DI_05 Data exchange 5 FFFF Default 107_Dl_06 Data exchange 6 FFFF Defa lt V107_DI_OF Data exchange 7 FFFF A aiant itame patie V 107_status Error report 0 F Default F lt gt Note The Offset value is starting from 0 and the Modbus address for variables is equal to the Offset value plus 1 Base address Moreover if you set the Operation as Error report the Offset value for the mapping variable Date Type DINT must set to O MODBUS Master Request Request Description l SlavejUnit 1 _ The Net ID fixed to 1 of the Slave device i e XV board MODBUS Request E gt ae Cail Bits Ta rr are Holding Registers NY as PAS Man Tree Naniokavn_ Data block Base address 1 Start from addr 1 and Nb items 8 L nu read eight data Activation
239. h Modulation output module The duty range Duty High High Low of the PWM output signal can be from 0 1 to 99 9 Its output frequency in the Win GRAF PAC is from 1 Hz to 500 KHz The I 8088W support two PWM output modes one is the Continuous mode It outputs always The other one is the Burst mode It outputs the required pulse count and then stop Please visit http www icpdas com products Remote_ 10 i 8ke i 8088w htm for other specifications Hardware Connection Diagram This example uses the I 8084W Slot 2 to measure the frequency of the I 8088W Slot 1 PWM output signal the 8084W is not necessary in the actual application Then connect the I 8088W s PWM output channel O PWO to the I 8084W s frequency input channel O COA Power Supply DP 665 Monitor PC Win GRAF GND ee _ _ _ _ jt 2 en RS 408 l 8088W J J I 8084W The demo program demo_8088w zip that we will describe below is located in the shipment CD Napdos Win GRAF demo project refer the Chapter 12 to restore open this project and set up the current PAC s IP address A Win GRAF demo_8088w File Edit View Insert Project Tools Window Help Ne TE wee tee reer ee 8 Ha We QS so gee Workspace Main demo_8088 E i E Exception pro Ali Programs Right click set the IP a l 3 f Global variables i e Main Set as Startup Project i8088 _State0
240. hanged Nb trials t z Refer the Section 5 1 1 for details e Timeout Set a timeout value When time out occurred it will show the defined error code The recommended value for the Modbus RTU ASCII device is 200 to 1000 ms In this case the value is 250 ms 2 Next open the Variables window and then declare variables that are available for the program Workspace IO Drivers Test_01 E Mm MODBUS Master H Exception programs 2 ge ATU COM2 9600 N 8 1 Request lt 16 gt Write Holding R E L Programs J lt 2 gt Read Input Bits 1 1 16 Slave Unit 4 T Main B e lt 5 gt Write single coil bit 2 1 1 Address 1 a Watch for debugai kani B lt 4 gt Read Input Registers 3 1 10 Nb Item 2 ia AS Soft Scope z H A lt 6 gt Write single holding register 3 1 1 Activation On Change L 5 Initial values rE sedi CM ahs eee ee Seed Period ms 0 9 4 Binding Configuration i Period on error O 3g Global defines 5 Timeout ms 250 t Variables Tips Number of trials 1 Press F1 key to view the details on the MODBUS Master settings Description Double click it to open this window Win GRAF User Manual V 1 01 Oct 2014 by ICP DAS 5 13 Declaring a Real variable Refer the Appendix A for details on data type and ranges refer the Section 2 3 1 for operations Real Write _1 REAL Used to write AO data 32 bit After completing the setting the defined va
241. hareNet Public Class Forml ed Class Then you can design all required objects and actions inside your VB Forms Refer the Chapter 13 5 for more information about using functions in the UserShareNet dll Win GRAF User Manual V 1 01 Oct 2014 by ICP DAS 13 6 13 4 Compiling the Application When you have finished writing a program you can build compile an application by the following steps 1 Remember to save at any time for safety project Microsoft Visual Studio File Edit View Project Build Debug D aa ga als aele b Potnter LU RindinoSirmree 2 Then compile Build the project The result is listed in the Error List windows at the bottom project Microsoft Visual Studio File Edit Miew Project Debug Data Form aul Se Gr A a Build projectl Febuild projectil Deploy p Error List CE Eeer aR Sess ae b Pointe i BindingSource Clean pre Build succeeded 3 You can find the execution file in lt Your VB net Project folder gt bin Release lt project_name gt exe Please copy this execution file to the WP 8xx8 s System_Disk Win GRAF path to run it Note The user may copy the VB net execution file to another path to run it but there should contain at least two DLL files with it or it cannot run correctly For ex the project1 exe can run in the Micro_SD folder if there are three files in it The orojectl exe
242. he Device Application and Windows CE and NET Compact Framework Version 3 5 then click OK Target platform 2 NET Compact Framework Version 3 5 lt NET Compact Framework Version 2 0 Tammy BLES NET Compact Framework Version 3 5 NET Compact Framework version Device Clas Librar Console Control Empty Project R Application Library Demripton A project for creating a NET Compact Framework 3 5 forms application for Windows CE Platform Download additonal emulator images and smart device SDEs Win GRAF User Manual V 1 01 Oct 2014 by ICP DAS 13 4 13 3 1 Add Project Reference The UserShareNet dll library contains all functions of data exchange with Win GRAF variables Before you use the UserShareNet keyword in the program you must add the UserShareNet dll into the reference list of your project 1 Copy the UserShareNet DLL from Win PAC s shipment CD napdos Win GRAF WP 8xx8 vb net_2008_demo wp_vb01 vb01 to your project folder e g C project1 2 Right click on the project name e g project1 in the Elx Solution Explorer window and then select Add Reference Solution Explorer pr v 1 X Right click i Febuild Deploy Clean Add Add Eeference Add Web Feference 3 Click the Browse tab and select the UserShareNet dll from your project location NET Projects
243. he configuration file Communication Sethngs x Upload the configuration 192 168 71 19 502 Configurations Browse 192 168 255 1 502 192168 71 18 502 192 168 71 19 502 Setup the IP addr of the PAC T5 Runtime vii Uploading runtime configuration Please wait faire D O CONFIG P HARAJAT Save file under C Win GRAF DATA CONFIG Give the file name amp save it be i A Hans FAITE tgt5AU T 4 Back to the Configurations window the configuration file test will show in the list and then click OK to leave this window Configurations Select Description Data tynes i Standard OEM Win GRAF User Manual V 1 01 Oct 2014 by ICP DAS 11 12 5 Win GRAF Demoli File Edit View Insert Project Tools Window Help ay g gt an Workspace PAC Time lt Demoli C Exception programs Programs le PAC Time Get Set 32 LD1 Blinking H E Watch for debugging lg Soft Scope bene F NewStructure Initial values o Ss NewRecipel NewSpy1 Ag Binding Configuration 9g Global defines Variables Types F EEEE 2 diamal Jh 5 4 rs JEB 4f Inst_TIME_GET R1 Get current time HEn TIME_GET 3 wu Eno In the Blocks panel the red Functions and Function Blocks are not supported by this PAC fei
244. he 2nd data block i e lt 1 gt Read Coil Bits to open the setting window ure E demo_X 111 H Exception programs ct LJ Programs at Main SL Watch for debugging All Soft Scope L E Initial values Binding Configuration 3g Global defines fat Variables aan Types WEE aN MODBUS Master lO Drivers X111 D010 BOOL A gh dip RTU COMO 115200N 81 E Hee lt 15 gt Write Coil Bits 1 1 16 xv111_D0_11 BOOL LE y 9 lt 1 gt Read Coil Bits 1 1 1 t xXv111_ D0 12 BOOL E g Error report V 111_status re x 111_DO 13 BOOL F Symbol Operation Offset Mask Storage aa soins XV111_status Error report 0 FFFF Default en ee l 111_status DINT v gt z z Sia I Note The Offset value is starting from 0 and the Modbus address for variables is equal to the Offset value plus 1 Base address MODBUS Master Request Request Description Slave Unit ry The Net ID fixed to 1 of the Slave device i e XV board MODBUS oie arises Pts heats ot lt 2 gt Read nput Bits lt 3 gt Read Holding Registers L PA ai Masd Tem Ik Maniek ve Data block Base address 1 Start from addr 1 and A pa Nb items I read one data Activation Periodi 50 O On call On change Misc BE saat An exception occurrs if no tb trials respond for 100 ms Win GRAF User Manual V 1 01 Oct 2014 by ICP DAS 5 25
245. he Counter Encoder module it can be set to 0 1 and so on depends on the module For example when using the l 8093W module 0 means the X axis 1 means the Y axis and 2 means the Z axis Value The data type can be DINT UDINT DWORD LINT and ULINT The new Counter or Encoder value wish to set Q Data type BOOL TRUE OK FALSE Error Win GRAF User Manual V 1 01 Oct 2014 by ICP DAS 4 28 4 10 Ping ip Test an Ethernet Internet Connection The Ping _ip function is used to test if the connection of the remote Ethernet Internet device is working properly It supports a max of 50 IP settings If not familiar with the way to add this I O board see the Chapter4 P4 1 1 Mouse double click the Ping ip to open the Properties window and then to see the setting description Note Using the slot 8 or above No because the slot 0 to 7 are reserved for the real I O module HEE 1 0 Boards ja C 9 0 Ping ip Properties f i e laln FREER Ee REE EERE EEE EEE EE EEE EEE EEE EEE EERE EEE EEE EEE EERE EEE EEE EEE EEE EEE EERE HEHE EEE EEE EEE EEE EEE EE EEE EET EEE EEE EEE ETE EEE EEE EET ETH HOO IP_ 0 192 168 1 100 Interval_0 15 Timeout_0 3 IP 1 N A n Interval 1 15 9 Ping_ip ered 3 aek Interval 2 15 sree R N ae E Timeout_2 3 _2 Ping ip 20 25 IP_3 N A _3 Ping ip 301 39 Interval 3 15 SBS imeout 3
246. he PAC effectiveness H Merea E gg O Al RUN u HOOD NewsSpyit spi E Name Value Description Save_file_counter 0 My REAL O00 0 0 it My REAL_O1 0 0 AE PERE My REAL_02 0 0 Vi4 01072014 15 59 40 My REAL 03 00 CRC 16 5f76ealc Target applicatio My REAL 04 0 0 pe ifs Gitai 4 15 59 40 ealc My_REAL_0S a RAM 507864 bytes My REAL_O6 0 0 Elapsed lms My REAL OF 0 0 My_DINT_0OO 0 _ ee My_DINT_O1 0 He ME GE jo OHA My DINT_02 0 dong HewSpyt spl My_DINT_O3 0 ire Na Description My DINT_O4 0 Fe Save file counter 7 My DINT_OS 0 My REAC UD 5 599998 My BOOL_O0 B4 My REAL 01 TE My BOOL 01 PEATE It increases 1 if it writes once Loeder iion Mu BOOL 02 in 14 01072014 15 59 40 i wan My REAL 03 TT LRC 1 685 7 bealec My_Timer_00 tHOs My REAL_04 a0 Target application My Timer 01 Hts My REAL 05 335 14 0107014 15 59 40 Mu Timer 02 HDs CRC 16 5fTbealc yna My REAL_O6 0 0 RAM 507664 bytes My Timer _03 tHHOs My REAL 07 o0 Elapsed Gimes My Timer_04 tHOs eee sees Os pane OSER My_DINT_00 i My DINT_01 0 My DINT_02 0 My DINT_O3 2014 My DINT_04 0 My DINT_O5 0 My BOOL_O0 TRUE My BOOL_O1 My BOOL_02 My Timer_00 t Os 15 a 7 0 My Timer_01 t 1h33m50s CORAM SeOOOROM My Timer_02 t Os My Timer_03 Os SA Mecoodss Eocene My Timer_04 t Os My Timer_05 t Os HE ARE MI BEG 2 Eh a a License bin retain_real txt e w dll QuickerNet all
247. he Win GRAF redundancy 1 Better safety There are three communication cables LAN1 LAN2 and Alive Port connected between two PACs The redundant system will still control the process well even if one or two cables are broken or disconnected As long as one of the three communication cables is fine the Win GRAF redundant PACs can still work well with the process 2 Unique Public IP The Win GRAF redundant system provides a unique public IP address for SCADA HMI to access it without needing to determine which one is the Active IP 3 Easy maintenance If one of the redundant PACs is damaged someday after starting the process you can remove the damaged one Note Do not shutdown or dismounting the other healthy PAC keep it running And then take another spare Win GRAF PAC with the same model or a repaired PAC without downloading the Win GRAF application simply adjust its rotary switch to a proper position and then connect all required communication cables e g LAN1 LAN2 Alive port and I O Make sure that the original healthy PAC is still working properly and then power up the spare PAC Then the healthy PAC will automatically copy the Win GRAF app and all its redundant data to that new PAC which is just online It is easier for maintenance and installation the operator don t have to worry about whether to install the Win GRAF app because the healthy PAC will automatically do it for the new online PAC Exception Except the Win GRAF a
248. he lower area to change a function block Win GRAF User Manual V 1 01 Oct 2014 by ICP DAS 2 13 Important Notice When programming users may copy amp paste an existing function block to create a new one But this way will cause a function exception due to the same function instances Therefore users must create a new name for the function instance 1 Mouse double click the function block and enter a new name e g Inst_BLINK1 then click the button to complete the setting ee I AIT Name e E et E La LD test a Es Inst_ BLINK blink 4 Global variables v s SHEENI gt Inst BLINK piamen R BLINK C a La All ie a Used wi B s E Project we Tg E Blocks Soviist Define ENUM 5 Variables all a Inst BLINK eee fe g B LEDI Variables all we Local variables only Hide FE instances 2 In the Inst_BLINK1 window click Yes to create this function instance Inst BLINK1 This symbol does not exist Do you want to Tips You can also use the same way to double click on the right side of the Coil to create or assign a variable See Step7 Rename the vanable Declare a new variable rn ee ee ee Type Where LD1 y Care 3 Now there is an Inst_BLINK1 function instance added in the Variables Area LD test 4 In
249. he project source code from missing or incomplete handover from the previous worker you can still get the project source code inside the PAC Enable Download The Project Source Code 1 Click on the menu bar Project gt Settings to open the setting window 2 Double click on the Download procedure of the Debugging and select Send source code for later project upload and then click OK Win GRAF Test File Edit View Insert gam Tools Window Help S We a Bvid All Projects F7 Workspace Clean AD Projects El Test Download All Projects Eo Exception pre rE LO Le 9 Programe Project setings C Win GRAF Projects Test General Name Vatu Runtime 192 168 71 19 502 Compiler l Debugging Downoad procedure Edit Advanced All J Communication parameters Always start simulator in cold start mode Cycle time in microseconds during debug Prompt before it pyran het f Prompt before Prompt before Items to be downloaded Propose to sta Log user actio Show log file Double clickto con Note When the Upload is enabled Add BONES it means to store the source code in the PAC If someone gets this PAC he may have the opportunity to get your source code soplication cade gt 3 Click on the menu bar Project gt Build All Projects to compile the program and then click on the
250. iables item to open the Variables window The following screenshot shows all the needed and defined variables in this Demo01 project Sle st4 Be m i a t E tes Sel Workspace Variables HL es il Demoli Hame im Attrib Syb Init value User Group Description Exception programs PAC Year DINT E Current time ofthe PAC A Programs PAC Month DINT T ae PAC Time Get 5 PAC Day a Watch for debugging PAC WeekDay Click it to sort by name ME Soft Scope PAC Hour 2 Initial values PAC Minute DINT a 4 Binding Configuration PAC Second DINT E bo Global define new Year DINT LI new time for the PAC Variables new Month DINT T new Day DINT T new Hour DINT LJ new Minute DINT T new Second DINT T set new time BOOL LJ set TRUE to set new time la RETAIN variables _ PAC Time Get Set PAC Time a a niin Aadland lt Lit gt Pac Tm varamies ye Tips Inthe Variables window users can click any title field e g Name for sorting If you want to go back to the original sort order mouse right click anywhere and select the Cancel Sorting option Enable Change Space swap Global gt Retain Field description Press the F1 key to look up the details Mouse double click any field item to set or modify the data Name Type Dim Attrib Syb Init value User Group Tag Description A valid variable name starts with a letter e g A
251. ication failed 8 2 5 D 87084 CNT4 Function Block D_ 87084 _CNT4 Connect a remote I 87084W in an I O Expansion Unit e g 87K4 5 8 9 or RU 87P4 or RU 87P8 to measure 4 ch counters Note 1 Please MUST configure the 87084W s counter data format as Hex format by DCON utility see P8 1 when using the I 87084W to measure counters Or it will not work 2 Please use DCON Section 8 1 in the I O boards window and set proper settings Port baud_rate etc on it 3 To get the 4 ch counter value from the remote 87084W first using D_ 87084 _cnt4 Function Block Then using the Counter_ Start Counter_Stop Counter_Get Counter State and Counter_Reset Functions refer Section 4 9 to operate counter channels 4 All values of Al channels are meaningful only when the returned communication state is TRUE If OK returns TRUE 5 Referring Chapter 12 click the menu bar File gt Add Existing Project gt From Zip to restore the demo project CD ROM Napdos Win GRAF demo project DEMO_D_87084_ C4 zip in the shipping CD and see the program and descriptions Supposition Use PAC s COM2 to connect the I 87084W Addr 6 to measure 4 ch counters Al T Name Type Inat _D 6 7084 _CN T4 Al 5 DINT Al 6 DINT Al 7 DINT 3 Al B DINT COM BOOL v lt gt 3 To read write operate T u Ee FREQ a remote A counter refer Section 4 9 FD D_ 37084 ENTI remote T N 87084
252. ill auto change the frequency mode It will auto change to High mode when the input frequency is larger than 3500 Hz while auto change to Low mode if input frequency is less than 1000 Hz DO NOT set as 1 High frequency mode if the input signal is normally less than 1000 Hz or the frequency value will be incorrect frequently Recommended don t set as O Low frequency mode if the input signal is normally larger than 3500 Hz Min_Update_Interval The unit is 0 001 second ms the value can be 0O or 20 to 1000 Default value O means Update frequency every PAC cycle Other means Update frequency when each Interval time reached The frequency update time also depends on the Win GRAF PAC cycle time If the PAC cycle time is big for example 200 ms then the real frequency update time will become 200 ms when setting the Min _Update_Interval less than 200 Setting bigger Min _Update_Interval will get smooth frequency curve value however the frequency value is updated slowly Signal_Inverted O input signal is normal no inverted 1 input signal is inverted means voltage HIGH will be processed as LOW and voltage LOW will be processed as HIGH Win GRAF User Manual V 1 01 Oct 2014 by ICP DAS 4 15 2 Double click the item and fill in a value then press the Enter key to complete the setting l i 8084 _freq Properties x Key 6 5 Ref 16 8084F Ch0 1 Filter 0 ChO 1 Freg timeout 100 Ch0O_1 Low High Auto
253. ime TH30M TH25M Egg DINT Ed Plain Flour 0 0 Cook time TIME z Lemon_Juice 0 5 Plain Flour DINT Suger 100 25 Lemon Juice DINT H Salt 2 1 Suger DINT Salt DINT v Gi B E 3 Variables NewRecipei 4 Click on the On Line button to connect the PAC At first the Values are all 0 please select the product column and then click the icon Send Recipe to apply this Recipe into the PAC i h E E EE EEE te T Workspace OOO HewRecipet rep S P Test RUN eq Name Y Name Value q Gi C Exception programs Bs Water 0 5 Global variables A G L Programs Soft_Flour 0 Water 0 oo A FBD pe Strong Flour 0 Soft Flour 0 H aE Main Salad oil 0 Strong Flour 0 st ST1 Data Conversi g Cream 0 Salad_ail 0 E Watch for debugging F Egg 0 Cream 0 Ag Soft Scope Cook_time HtOs Egg 0 o E Initial values Plain_Flour O Cook_time tis w NewRecipel LemonJuice 0 Plain Flour O n Sd NewS py Ngger 0 WUER Ooo Lemon Juice O z 95 Binding Configuration gt e ESTRA 2O lp al a y gt i r ta i i A 3 g Global defines it gt Variables NewRecipel OOO HewRecipei rcp Mame Value E4 Lemon Pudding Fie SE Water 125 oft Flour zi Note If want to save the Values in Strong Flour zi the PAC e g Power off and restart Salada 0 the PAC the Recipe can still retain F Cream 40 the previous Values please refer F Eog l the method of using the retain E EN
254. ing variable The String type has to convert to byte array According your NET program Encode Ex UTF 8 If you need to read Win GRAF String variable Then you have to convert byte array to String There is an C example to show how to convert each other Example Encode is UTF 8 Convert String to byte array private byte unicode_to_byte_array string msg byte tmpbuf if msg Length gt 255 return null tmpbuf Encoding GetEncoding UTF 8 GetBytes msg return tmpbuf byte array to string private string byte_array_to_unicode byte buf string tmpmsg if buf Length gt 255 return null tmpmsg Encoding GetEncoding UTF 8 GetString buf O buf Length return tmpmsg Win GRAF User Manual V 1 01 Oct 2014 by ICP DAS 14 14 Chapter 15 Using Soft GRAF HMI in the Win GRAF PAC This chapter list the way to run Soft GRAF HMI in the Win GRAF PAC The Soft GRAF is a software which allows user to create colorful HMI User can easily edit HMI screen by mouse dragging and dropping the object and run both HMI and Win GRAF softlogic in the same Win GRAF PAC X Note Please refer the ISaGRAF FAQ 146 to get more information about using Soft GRAF ISaGRAF FAQ146 http www icodas com faq isagraf 146 htm 15 1 Restore the Win GRAF Project Please copy all demo programs into your PC CD ROM of Win GRAF PAC napdos Win GRAF demo project Soft GRAF demo Demo project for both Win GRAF and Soft GRAF Demons
255. ings Win GRAF PAC 7 Il 87K4 I O Expansion Unit COMx RS 485 I 7017R I 87017ZW Data j Data Data Data Data Data 1 First connect i_scale in the I O Boards window and double click on i_scale_x to open the Properties window refer the Section 4 2 for detail steps Note I O Boards supports ONLY ONE i_scale DO NOT connect 2 or more i_ scale 2 Set up the number and value of the Conversion Function that need to be enabled E g Use Function 1 to convert 4 to 20 mA into 0 to 10000 ChO1 XO Min_Physical_ Val 4 0 ChO1 X1_ Max_Physical_ Val 20 0 Ch0O1 YO Engineering Val For _X0 0 0 ChO1 Y1 Engineering Val For_X1 10000 0 EE 170 Boards Key 6 A 0 Ref 16 24 ChOO X0 reserved 0 0 aA Choo Xl 2 retier E 0 0 L TChOO Fi gore pa 0 0 H Ch011 XO Min Physical Fal 40 4 chol SEI Max x Physical al 20 0 i 5 Yal gt neering Yal For Z1 00 6 Ch02_x0 tin Fral al 0 0 Ch01 Yi Engineering Yal For X1 a Ch02 X1 Max Physical Yal 0 0 Ch022 Y0 Engineering Fal For x0 0 0 100000 0 jewo Yl e eT rat For X1 00 z Setup the scaling function No 01 to 29 for scaling 170 variables Notice 1 If setting both value of Ch_0 and Ch X1 to 0 0 it means the relative scaling function No is d 2 If Ch_X0 is greater than or equal to Ch_ gt 1 the setting is wr
256. ion LOSS 57S ICLON C More Information 05 2 5V lon 05 2 5V ON C 05 2 ov amp ON ie 0 5 2 5V E ON C 05 2 5V Set Al Data Format to ON Engineer Modbus Address Function Action means 90923 50 60 Hz rejection for Al OFF C ON 6 50 2 60 Hz defeuit 1 2 5 25000 25000 eS Al Data Format C oN odtex 1 Engineeer default 0 1 1000 as 1000 00632 recover Al Calibration Values to Factory Setting 1 Clear 258 25 8 C Submit Users can set the ET 70182Z s Al Data Format to ON Engineering for more convenient usage For example 04 1 1V 2 s comp HEX 8000h 7FFFh 05 2 5 2 5 V 2 s comp HEX 8000h 7FFFh 18 Thermocouple T HEX h 4000h 200 100 C AO jii Restore Open the Demo Project The Win GRAF demo projects in the following sections can be found on the shipping CD please refer Chapter 12 Click the menu bar File gt Add Existing Project gt From Zip can restore open check the demo programs CD ROM Napdos Win GRAF demo project Demo Projet FileName Descriptions ET 7060 demo_ET7060 zip Read 6 Dls write 6 DOs ET 7018Z demo_ET7018z zip Read 10 Als Win GRAF User Manual V 1 01 Oct 2014 by ICP DAS 5 43 1 Click the tool icon Open Fieldbus Configuration to open the I O Drivers window Ie ee ee we ee ee Workspace IO Drivers PS Tg E Mo MODELS Ma Y Nae Type RCeption programs 5
257. ion from the Win GRAF Workbench again H E OE So 5 LG No aplication Download TEST Win GRAF User Manual V 1 01 Oct 2014 by ICP DAS 11 17 11 11 Using Function Block in the ST Program It is easy to use the Function in the ST program just call the Function and assign the corresponding parameters The example below will open COM3 at the beginning and then send a String Hello from COM3 every 5 seconds Declare INIT1 as BOOL and has initial value TRUE Declare TMP_BOO as BOOL TMR1 as TIME IF INIT1 THEN INIT1 FALSE TMR1 THOs TSTART TMR1 END IF IF COM_Status 3 FALSE THEN TMP_BOO COM_open 3 19200 N 8 1 END IF IF TMR1 gt T 5s THEN TMR1 THOs COM_send _str 3 Hello END IF To use a Function Block in the ST you must first declare an Instance Variable of the Function Block in the variable region after that the using steps are similar to the steps of using the Function as follows The following code can unpack one Byte to become 8 BOOLSs 1 Declare MyUnpack variable as UNPACK8 FB Instance and IN variable as BYTE Variables i 4 X Dim Attrib Syb Inityalue U Y Tag Description o ft eee nei IN BYTE LI MyUnpack UNPACKS v 2 Edit an ST program MyUnpack IN QO MyUnpack QOo Q1 MyUnpack Q1 Q2 MyUnpack Q2 Q3 MyUnpack Q3 Q4 MyUnpack Q4 Q5 MyUnpack Q5 Q6 MyUnpack Q6
258. ion protocol The following Functions can be used to directly operate the serial port Functions Deseriptions COM_send Command a serial COM port to send 1 500 bytes COM_send_str Command a serial COM port to send a String Receive bytes from the input buffer of a serial COM port and save COM _recv them in a byte array COM_ status Get the current status of a serial COM port Please refer Section 1 2 3 to open the Library Manager and find the detail Function descriptions VA Library Manager ICP DAS XP WP P File Wizard Help Function and FBs Os Profiles l S Types COM clear Clear the input buffer of a serial COM port mCOM close Clos a serial COM port mCOM_open Open a serial COM port For ex TMP_BOO COM_open 2 9600 N 5 1 mCOM_ recy Receive bytes form the input buffer of a serial COM port and save them in a byte array mCOM_ send Command a serial COM port to send 1 500 bytes mCOM_send_str Command a serial COM port to send a string ejCOM_test Test if any data received in the mput buffer of a serial COMM port mat nwnesnet n AI wet DL erana l inmsst wlan A Ta PAES P PAA e wala XA Parameter Description COM clear Clear the input buffer of a serial COM port Function Input parameters Port DINT serial COMM port number to open can be 1 to 37 depends on PAC means COMI to COM37 Output paramete
259. ion status and i AL en Variable status in the Networked applications Dual i sits aia i I re binding on redundant ETHERNET of the HTML Help that oie 3 l 1 i Conriec ion 1 fails i i l l l l l Win GRAF User Manual V 1 01 Oct 2014 by ICP DAS 7 4 Chapter 8 Connecting DCON I O Modules The Win GRAF PAC can connect the ICP DAS I 7000 and I 87KW remote DCON I O modules via the COM Port RS 485 Each PAC can enable up to 16 DCON Ports and each Port can connect up to 50 remote DCON I O modules not recommended over 32 If select the I 87KW series I O modules it must be used with the RS 485 I O Expansion Unit e g I 87K4 5 8 9 or RU 87P4 8 You can view the detailed product information on the ICP DAS website http www icpdas com root product solutions remote io remote io products html WP 8xx8 n AAs 1 7000 RU 87P4 1 87KW i 8142iW i 8144iW 2 4 RS 422 RS 485 Port Before connecting I 7000 or I 87KW remote DCON I O modules you must use DCON Utility software to configure each module for the Protocol choose DCON mode Address 1 255 Baudrate the same with the Win GRAF PAC recommended set to 9600 Checksum usually Disable Data format and other Input Output settings set according to demand Note A When using the Al module of l 7000 and I 87KW set the Data format to 2 s Complement E g l 7005 l 7013 I 7014D l 7015 l 7016 I 7017R I 7018Z I 7019R l 7033 I
260. ional icons Create 4 desktop icon Install Cancel 6 Before the end of the installation you will see a pop up window and it displays a The legal Win GRAF Workbench is delivered with a legal Win GRAF Dongle distributed by ICP DAS Please always plug the Win GRAF Dongle in your PC while running it b To run the Win GRAF require Microsoft Net FrameWork 3 5 installed in your PC setup Win GRAF Installing Please wait while Setup installs Win GRGF on your computer Extracting Files Cr Win GRLGFIESHelpGr chmi setup Win GRAF Information Please read the Following important information before continuing When you are ready to continue with Setup click Mex Thank you For installing the Win GRAF software The legal Win GRAF software is delivered with a legal Win GRAF Dongle distributed by ICP DAS Please always plug the Win GRA4F Dongle in your PC while running it To run the Win GRAF require MicroSoft Met Framework 3 5 installed in your PC For technical support and sales service contact servicem icpdas com TP DAS CO LTD WIM ic pdas com servicei icodas com Win GRAF User Manual V 1 01 Oct 2014 by ICP DAS 1 9 7 By now you have completed the Win GRAF installation then click Finish to exit this window Select Launch Win GRAF to auto run the Win GRAF after completing the setup If there is no Win GRAF Dongle in your PC the Wi
261. it to the Win GRAF PAC Refer the Section 2 3 4 Section 2 3 5 Note Users can enable multiple Modbus RTU Slave ports for each PAC recommend not over 16 Ports the way is to add multiple MBSLAVERTU function blocks and set the different Port value Win GRAF User Manual V 1 01 Oct 2014 by ICP DAS 3 8 SCADA HMI Win GRAF PAC ingiSor gt COM2 RS 232 lt ty N 8 1 InduSoft _ gt Slave number WP 5xx8 WP 8xx8 Modbus RTU Master Modbus RTU Slave Refer the P1 1 to view all PAC models Add the MBSLAVERTUEX function block If you have added multiple Server settings recommend to set one in the IO Drivers window the MBSLAVERTUEX function block must be used l Drivers Mame Value Slave number 1 Slave number 1 i el nput Registers 1 UUU Read Value Server IL Sy H H B Input Bits 1 2000 Read Boolean gE Request Address Nb Item Description z Input Registers 2000 Read Value Input Bits 2p0 Read Boolean liga EE iE PAC Time Wariables LEC 10 Drivers 1 Follow the step1 to 4 described above to add the MBSLAVERTUEX function block If you want to change the usage for existing function block mouse double click the MBSLAVERTU and change it to the MBSLAVERTUEX and then click the OK button Inst_MBSLAVERTU R2 IN MBSLAVERTU G COM2 S600 N84 T LOADSTRING Get a st
262. j n ater IX10 7 Target08 t Variables x IX10 8 Target09 olX10 9 Targeti0 Win GRAF User Manual V 1 01 Oct 2014 by ICP DAS 17 4 Variable declaration Click the Variables to view all variables in this demo project OES Win GRAF demo schedule File Edit View Insert Project Tools Window Help Bae Pe ape ee ee eee ee Se eee a E Workspace Variables og Exception programs ERA Globa 5 Programs Target_01_BOOL H Main Target_02_BOOL Lj Watch for debugging Target_03_BOOL BB Solt Scope Target_04 BOOL Initial values Target_05 BOOL d NewSpyl Target 06 BOOL 4 Binding Configuration Target_07_BOOL 37g Global defines Target 08 BOOL Target_09 BOOL Target_10_ BOOL Target_01_DINT Target 02 DINT Target_03_DINT Target 04 DINT Target_05 DINT Target_06 DINT Target 07 DINT Target_08_DINT Target_09 DINT Target_10_DINT Target_01_REAL Target_02_REAL somos SF FI os The above variables Target_01 BOOL Target_10 BOOL Target_01 DINT Target_10 DINT and Target_01 REAL Target_10 REAL will be controlled by the Win GRAF PAC They represent these variables belong to the 10 Targets Win GRAF User Manual V 1 01 Oct 2014 by ICP DAS 17 5 To be controlled correctly by the schedule configurations these variables that described as above should be dragged into the Punlic area of the Binding window and then be assigned with correct Identifier numbe
263. k the ET 7050_DOx_ReadBack ET 0S0 DOU will return TRUE if the ET 0S0 DOI FALSE ET 7050 communication is ok ET F050 DO 2 FALSE ET7050_00_3 ET 050 DO_4 ET AO50_D0_5 0 Mo error comm ok Communication error of the ET 7060 Non zero means error Relay_0 5 of the ET 060 Relay 0 5 of the ET 060 Relay U7 5 of the ET 7060 Relay U7 5 of the ET 060 IE 10 Drivers PAC Time RON control Retain and timer Sfariables A demo_RDN_1 Two XP 8xx8 CE6 PACs using their COM3 to connect three DCON I O modules Win GRAF RS 408 NS 408 Win GRAF PAC Public IP Port LAN1 Na 7 RS 485 Replication Port LAN2 l 87064W 1 87018ZW 9600 8 N 1 No Checksum Addr 2 9600 Addr 3 9600 Data format 2 s compliment Backup 9 l 7065D Alive Port RS 232 Addr 4 9600 Win GRAF User Manual V 1 01 Oct 2014 by ICP DAS 16 17 In the demo_RDN_1 demo program as the figure above before linking I 7000 and I 87KW DCON remote I O modules users need to configure each of I O modules by using DCON Utility Refer the descriptions in Chapter 8 and visit the DCON Utility web page to download the software and user manual www icpdas com products dcon introduction htm Please restore and open this demo program for more details and refer Section 16 3 1 for I O Board settings 16 5 What Kinds of Data Can be Automatically Backed up to the
264. l AO The I 8024W is a 4 channel analog output module Data type REAL that can be used to output 10 V or 0 to 20 mA signal See the Chapter4 P4 1 to add this I O board 1 Mouse double click the i_ 8024 AO to open the Properties window and then to see the setting description SEE 140 Boards ve Close 1 1 8024 AO Properties Eje 3 EA 4 5 ChO_type 16 33 5 Chl _type 16 33 Ch2_type 16 33 i Ch3_type 16 33 8 ReservedO 0 g Reservedl 0 40 Reserved 47 Reserved 3 0 12 13 14 15 16 r Setting Description 4 Ch Analog Outputs Value type is REAL Parameters Chtype 16 SSAR SS Scaling function is defined by the virtual board scale 00 means No scaling 01 to 29 means Appling a scaling function No 07 to 29 Parameters Ch_type 16 SSRR SS Scaling function is defined by the i_ scale I O board see the Section 4 2 00 means No scaling 01 to 29 means Appling a scaling function No 01 to 29 Setting SS as other value will use the default value 00 RR Range definition of signals 30 means physical output signal is O to 20 mA 33 means physical output signal is 10 to 10 Volt Setting RR as other value will use the default value 33 2 Double click the item and fill in a value then press the Enter key to complete the setting For example 16 33 means the physical output
265. le to use the Schedule Control Utility refer the Section 17 5 for details 1 Execute the Schedule Control Utility Schedule_in_PC exe in the PC Click New and click Target 1 to open the Schedule setting window for the Target 1 Target 3 Target 2 arge 3 Target 4 Target 5 Target 6 Target 7 Targat 8 Tact 9 2 Enable Set the Season and Schedule Date 1 Check Target 1 box to enable and set Target 10 the Target 1 2 Click Season Always 3 Check Season Always box to enable it 4 Click Normal Day item Normal day is usually used for Monday Friday 5 Check Normal Day box to enable it and then set proper settings e g Monday Friday 6 Click Schedule 1 to set the schedule period for the Schedule 1 a Schedule Control Utility arget 1 gt Season Always gt Norma day Y _ a h l Back Save to PC Boolean V Target 1 Default Value OFF The means that item Is enabled V Season Always Always Season Always Season Season 2 Season 3 Season 4 schedule 1 Normal day Schedule 1 1 Schedule 2 6 Sunday Holiday 1 iv Monday o s cate Schedule 3 Apply Schedule 1 Tuesday Holiday 2 ae J Wednesday 5 Special day V Thursday Schedule 4 J Friday Saturday schedule 5 Win GRAF User Manual V 1 01 Oct 2014 by ICP DAS 17 7 3 Set the Schedule Period After selecting Schedule 1
266. left of the CYCLE and enter T 2S to blink every two seconds and then click to finish the setting 960001 41 0 Output HAK 14 Outputz R KER Outputs Varables all ka Local variables only Hide FB instances 4 kS im p PAC Time Wariables LD1 lw 10 Finally click the Save button to save the LD1 program Win GRAF Demoll File Edit View Insert Project Tools Window Help S a saax 256 9 A Ha WE AEs Gea Workspace yyy Lo ae HEX Ej Demoli ee AT Name Type Dim Exception programs of T ne LED BOOL fa in Inst_BLINkK j Programs I la RETAIN variables RQ PAC Time Get Set 2 B 6IX1 0 i 8055 DI oa 42 LD1 PBlinking g LED El as 1 i 6055 DO B Watch for debugging a 1x1 1 0 0utputi BOOL ffl Soft Scope i WAKI 1 0 OX1 1 1 Output2 BOOL set T Initial values iH Output Sola 1 2 Outputs BOOL We ssn Ag Binding Configuration S gt 7 3g Global defines W ONT A E Ga AIN A Sed Va Variables ie Used m P Types 4 LOA Project Outputs Advanced a Arithmetic ij kal TA S v E E iil gt 4 gt Blocks Sovlist Define ENUM A gt PAC Time varies 01 Seca eee 4 gt Build Crossreferences Runtime Callstack Breakpoints Digitalsamplingtrace Prompt HMI SE Ready Offline 192 168
267. les TMP_BOOL Counter_Start 0 2 8084 5 Start1 TMP_BOOL in the END IF Variables Area LD program Start1 boolean set it to TRUE to start counting and then reset Start1 to FALSE Main ES ee eee J JE Start be R1 E COUNTER_START t y Set it to TRUE to start counting Tips Press the F1 key for F the details on settings T Click to set a Coil to R a084 gt Reset it to FALSE H 5 HEH i mjnnjninyminje miming Sinn kh E Starti R fbe R Win GRAF User Manual V 1 01 Oct 2014 by ICP DAS 4 23 Port Data type DINT For a module in the slot O to 7 of the PAC set it as 0 Fora DCON module connected to a serial COM port can be 1 to 37 depends on PAC means COM1 to COM37 Addr Data type DINT For a module in the slot 0 to 7 of the PAC set it as the slot number 0 to 7 For a module connected to a serial COM port set it as the Net ID address of the module 1 to 255 lO_Name Data type DINT The name of relative Counter Encoder module it can be set to 8084 8093 87084 87082 7083 and 7080 Channel Data type DINT The channel No of the Counter Encoder module it can be set to 0 1 and so on depends on the module For example when using the I 8093W module 0 means the X axis 1 means the Y axis and 2 means the Z axis Q Data type BOOL TR
268. ls 1 respond for 100 ms Win GRAF User Manual V 1 01 Oct 2014 by ICP DAS 5 27 lO Drivers Ll Ae BG Mp MODBUS Master TY Name Type D CE ATU COMO 115200 N 8 1 116 DIL 04 BOOL ad B H tB lt 2 gt Read Input Bits 1 1 5 xXv116_status DINT eE ER f lt 15 gt Write Coil Bits 1 1 6 X 116 RL_OO BOOL CE n Symbol Operation Offset Mask Storage ATG REDT BOOL x 116 RL_O2 BOOL 116_RL_O00 Data exchange 0 FFFF Default W116 RL 03 BOOL a z 116_RL_O1 Data exchange 1 FFFF Default 14 ER Lo 4 BOOL a 116_RL_02 Data exchange 2 FFFF Default AA 6 RL os BOOL z SP 116_RL_O3 Data exchange 3 FFFF Default Poa f g 4 V 116_RAL_04 Data exchange 4 FFFF Default p 8 V116_RL_05 Data exchange 5 FFFF Defaut _Name VYaue e m x MODBUS Master Request 4 Request Description alave Unit The Net ID fixed to 1 of the MODBUS Request Slave device i e XV board 5 1 11 Connecting the XV308 8 Al 8 DIO The XV308 is a 8 channel analog input and 8 channel digital input output board This section provides three Win GRAF demo programs demo_XV308_1 zip demo _XV308_2 zip and demo_XV308_3 zip First go to Section 5 1 6 to view the XV Board instructions and then configure each Al channel by using DCON_Utility_ Pro _CE_200 exe Demo description demo_XV308_ 1 This demo added two data blocks one is used to read 8 Al data and the other is used to write 8 DI data 1 Mouse
269. ls respond for 100 ms Win GRAF User Manual V 1 01 Oct 2014 by ICP DAS 5 30 2 Mouse double click the 2nd data block i e lt 15 gt Write Coil Bits to open the setting window Workspace 10 Drivers EAX B E demo_X 308_2 E a Mp MODBUS Master Aj Y Name Type k H C Exception programs 3 G r ATU COMO 115200 N 8 1 XY308_ status DINT c Programs E fs lt 4 gt Read Input Registers 1 1 8 3 xV308_DO 0 BOOL a Main aa 8 lt 15 gt Write Coil Bits 1 1 8 3 308_ DO 1 BOOL H O Watch if i e a O aa Ta i Seh or PebugG Symbol Operation XK Offset Mask Storage Oe OEA Ieee A Soft Scope zi o Xv3086_D0 3 BOOL r 25 308_D0_0 Data exchange 0 FFFF Default E EJ Initial values AV308 DO 4 BOOL ba ei z xv 308_D0_1 Data exchange 1 FFFF Default BRR 3 Binding Configuration V308 DOS BOOL fg a amp 308_DO_2 Data exchange 2 FFFF Default En D 3g Global defines c5 Xv306_D0 6 BOOL ts a Variables 308_DO_3 Data exchange 3 FFFF Default W308 D 07 BOOL A Tubes as x 308_DO_4 Data exchange 4 FFFF Default pe xe bai E xVv308_D0_5 Data exchange 5 FFFF Defaut ta 308_D0_6 Data exchange 6 FFFF Default Name Value xv 308_D0_7 Data exchange FFFF Default MODBUS Master Request x lt Request Description Slave Unit The Net
270. more Functions or new I O Board Please follow the steps below 1 First close all Win GRAF Workbench windows BRDO RE MAY RRB AN Q i s r F 3 i 2 You can compress the original ICP DAS XP WP VP HEAL D CQ CAWin GRAFIDATA H WDEF folder and back it up to the other directory e g D temp xxx zip and then delete the folder Nba Embedded Ethernet Files HMI Powerlink 3 Copy the new ICP DAS XP WP VP folder into the 2 a g eJ directory C Win GRAF DATA HWDEF and execute the Win GRAF Workbench again ICF DAS Maths Miscellaneous XP WP P zip ICP DAS XP WP P Note If you want to know the version number of the Win GRAF library As the figure below open the ee E an gi Library Manager and click A_Version in the I Os lend Lal E m tab and then click Description to see the version a a ee e number e g 1 01 fen Win GRAF T Google Chrome fan ICPDAS i ba Outlook Express Mozila Firefox is iss E SS Library Manage il Toole Wizard mae Labraacy Library Manager ICE DA xr wWPF F Open Library Embedded HMI Ethernet Powerlink i Version is only for identification The FAC s Win GRAF driver can not recognize it DO NOT connect this A Version in the Win GRAF project Jul 25 2014 ICP DAS Talwan f Win GRAF User Manual V 1 01 Oct 2014 by ICP DAS 11 1 11 2 Upgrade Win GRAF Driver F
271. mple it writes the string COM1 19200 N 8 1 Ajd Binding Configuration ces alobal defri Set TRUE to d into the file which means to enable the COM1 and its a ri ST eri ZR Baud Rate is 19200 bps Change the COM Port number ypes pri and baud rate to whatever you want to use and compile this program again Win GRAF User Manual V 1 01 Oct 2014 by ICP DAS AP 7 Test the program 1 After connecting the Win GRAF PAC set the variable Create_extra_port as TRUE in the Spy list In this example it will add a file Extra_Ports txt into the path System_Disk Win GRAF and the content is COM1 19200 N 8 1 2 Set the Reset_PAC variable as TRUE and then the PAC will auto reboot and apply the setting al RUN SD eK Sg 05 EKER Workspace f OUD HewSpyt spl gt gt demo_extra_port RUN Name Value O Create_extra_port H Exception programs f Yearl 2014 Programs Month Fi vow 8 Main a Dat 25 En ST1 Hourl 4 dE Watch for debugging tinute 37 U Soft Scope Second Initial values filet 1324688 filel name System Disk Win GRAF in GRAFSExtra_Ports txt Create_extra_port Ports tet Delete_extra_port i Reset PAC S Ports tet Reset_PAC oao 4 gt STi NewSpyi Variables Main In the Win GRAF Workbench if you want to connect to the Win GRAF PAC through the serial port Refer the Section 2 3 5 Step 1 to 2 and select the Serial link option for connecting
272. mpleted the settings for the Modbus Slave Finally follow the way below to re compile the program and download it to the Win GRAF PAC Win GRAF User Manual V 1 01 Oct 2014 by ICP DAS 3 5 11 Click Project gt Build All Projects from the menu bar to compile this program again refer the Section 2 3 4 If a message informs you No error detected that means this process is successful On Line Change is disabled A MODBUS 5 4H PAC Year Warming 32 bit word orderning not supported By runtime 7 4 and older CT Segment 55 byte s gt This version information can be ignored _Callstack Breakpoints Relocating code Code CRAC 323797fc File CRC ebsd0c16 Size 3672 gt renee Digital sampling trace Prompt HMI 12 Mouse right click the project name i e Demo01 and select the Communication Parameters to set the PAC IP e g 192 168 71 19 502 and then click the menu bar Project gt On Line or A to establish a connection and download this project to the Win GRAF PAC Refer the Section 2 3 5 File Edit View Insert Project Tools Window Jala 4asXx 2 Worksnare Edit View Insert fyon Tools Window Help e TE SRS ES Build All Projects F7 space Clean Al Projects EC Download All Projects ve ception pro Dee petting Bj Programs ile PAC TI SCADA HM
273. n Name Tyre Description BOOL Set the initial value as TRUE TRUE Binding succeeds m FALSE Binding fails STRING Length is 100 String variable for demo purpose 2 TRING L h is 32 Speen NOTE The String length could be 1 to 255 STRING Lengthis60 ST program If init then Init false add address 1 for share string val Tmp_val pub_string 1 msg1 add address 2 for share string val Tmp_val pub_string 2 msg2 add address 3 for share string val Tmp_val pub_string 3 msg3 End_if Win GRAF User Manual V 1 01 Oct 2014 by ICP DAS 13 3 13 3 Create a new VB NET project 1 First run Microsoft Visual Studio NET 2008 software and then choose File gt New Project amp Start Page Microsoft Visual Studio New Web Site ShifttAlttN New File Open Project Ctrl 0 Open Web Site ShiftrAlt O Microsoft Visual Studio 2008 2 Click Smart Device on the left and then select NET Framework 3 5 and Smart Device Project Entering a proper project name and click OK E Templates HET Femework 25 E E Yisual Studio installed templates mart Device Project 6 My Templates meee bh Templates Other Project Types H Test Projects A project for Smart Device applications Choo target platform Framework version and template im the next dialog box Name project 3 Select t
274. n Periodic 50 on call On change Misc 7 Timeout 100 a An exception occurrs if no Nb trials t j respond for 100 ms Win GRAF User Manual V 1 01 Oct 2014 by ICP DAS 5 23 5 1 9 Connecting the XV111 XV111A 16 DO The XV111 XV111A is a 16 channel digital output board This section provides a Win GRAF demo program demo_XV111 zip First go to Section 5 1 6 for the information of the XV Board before using It Demo description This demo added two data blocks One is used to write 16 DO data and the other is used to read the DO Status 1 Mouse double click the 1st data block i e lt 15 gt Write Coil Bits to open the setting window va Win GRAF demo Z I111 File Edit View Insert Project Tools Window Help a J i Workspace jl demo_X 111 H G Exception programs S E Programs aE Main Watch for debugging BE BE Soft Scope E Initial values z 84 Binding Configuration lt 3g Global defines fa Variables n Types x 33 we 10 Drivers B iis B E Mo MODBUS Master 5 ts RATU COM0 115200 N 8 1 eee lt 15 gt Write Coil Bits 1 1 16 4 Symbol 5 4 as gt xV111_DO_O4 111_D0_00 111_D0_01 amp 111_D0_02 amp 111_D0_03 4 111_D0_05 amp 111_D0_06 V 111_DO_07 MODBUS Master Request 4 111_D0_08 111_B0_093 111_D0_10 111_D0_11 111_D0_12 amp 111_B0_13 amp 111_D0_14 e 111
275. n the Variables window that are available for programming ChO Z index of X axis Chi Z index of Y axis Ch2 Z index of Z axis T Name Type Dim Attrib Syb Init value User Tag Description 5 B IX1 i 8093 IX1 0 BOOL Input 3 1x1 1 BOOL Input EJ J 1x1 2 BOOL Input O v lt gt 4 After linking the I O Boards refer the Section 4 9 to use COUNTER START COUNTER_STOP COUNTER _GET COUNTER_STATE and COUNTER_RESET functions in the LD or ST program to operate the Encoder channel of the I 8093W Win GRAF User Manual V 1 01 Oct 2014 by ICP DAS 4 22 4 9 Using the Count Function for I 8084W I 8093W I 87082W I 87084W l 7083 and l 7080 Modules This section lists the way to use the COUNTER_START COUNTER_STOP COUNTER _ GET COUNTER_STATE and COUNTER_RESET functions in the LD or ST program to operate the Counter and Encoder modules If not familiar with the way to create a program or a function block see the Section 2 3 3 Note 1 In the following content we use I 8084W and I 8093W modules as examples 2 Before using these function blocks first go to Section 4 7 2 UP Down Counter Section 4 7 3 UP Counter and Section 4 8 Encoder to link I O Boards 4 9 1 COUNTER_START For example Using the I 8084W module in the PAC s slot2 and start counting the channel 5 ST program IF Startl TRUE THEN Note pret Waleed First add two BOOL variab
276. n GRAF Test 01 File Edit View Insert Project Tools Window Help pan NE ANE IE eee ee ae Se we A Workspace dlio Drivers m m ps A 4 Sp Testo vee Exception programs Ai Global variables Ca A Programs ial RETAIN variables woe SE Main Main E pa Watch for debugai Ta oOnBadindex Soft Scope ta oOnDivZero 4 s E Initial values gi ao a Ya Binding Configuration N mm tesla oo Sg Global defines tree fa Variables Sia im La Types Build Ox le gt Build Cross references Runtime F te Win GRAF User Manual V 1 01 Oct 2014 by ICP DAS 5 1 2 Click the Insert Configuration button on the left of the IO Drivers window then click the MOSBUS Master and OK to enable the Modbus Master setting IO Drivers Name Value OF Name Ai Global variables la RETAIN variables gt Add Confiruration Choose a configuration E Al MODBUS MODELS Master MODBUS Slave Cancel Ps
277. n GRAF Workbench will run in Demo mode setup Win GRAF Completing the Win GRAF Setup Wizard Setup has Finished installing Win GRAF on your computer The application may be launched by selecting the installed icons Click Finish to exit Setup 1 2 Run the Win GRAF Workbench Before running the Win GRAF Workbench make sure the Win GRAF Dongle is plugged into your PC Without using a Win GRAF Dongle the Win GRAF Workbench will run in Demo Mode Open the Windows Start menu click on Win GRAF folder and Win GRAF to open this software aie i Win GRAF Libraries gt FR Google Chrome Handbook fe ICPDAS t E History fa Outlook Express 3 Manual ReadMe Win GRAF Pe Mozilla Firefox Bes oO Opera 18 Description of the Win GRAF folder Libraries For users to create their own function or modify an exist function Handbook The manual details the software interface programming environment programming languages and so on provided by COPALP Or click the Help gt Topics from the Win GRAF menu bar History The modification history and features added of the Win GRAF Workbench Manual The Win GRAF manual provided by ICP DAS Or click the Help gt Tutorials from the Win GRAF menu bar the manual is located in the path C Win GRAF Tutorials ReadMe The notice for the Win GRAF Workbench Language Win GRAF User Manual
278. n Value will be wrong 64 bit data type LINT or LREAL can use only the Addr No from 10 001 to 12 000 Other data type BOOL SINT USINT BYTE INT UINT WORD DINT UDINT DWORD REAL or TIME can use the Addr No from 1 to 12 000 Win GRAF User Manual V 1 01 Oct 2014 by ICP DAS 6 4 6 1 3 RETAIN FLAG SET GET CLR Set Get Clear the Retain Flag How to Use The Retain Flag is a flag TRUE FALSE stored by users in the retain memory Users can set this retain flag to indicate All retain data has been assigned a proper value before When a PAC starts without setting a proper value to retain variable before the data of the retain variable read from the retain memory is not correct it is normally a strange value So users have to assign proper value to all retain variable at least once to let the application work well Then after user can call the Retain Flag Set to set the retain flag It means All retain data has been assigned a proper value To get the state of the Retain Flag please call Retain Flag Get To clear the state of the Retain Flag please call Retain Flag Clr ST Program on_line_change_ cycle is declared as DINT nonezero means it is in the cycle just after doing on line change retain _ done is declared as BOOL and inited as FALSE tmp_bool retain_ flag and to_set_flag are declared as BOOL on_line_change_cycle GetSysInfo _SYSINFO_CHANGE_CYCLE if retain done FAL
279. n them otherwise it may cause an error or timeout The LAN2 ports are based on fast Ethernet and dedicated Ethernet ports in order to avoid collisions So don t connect any external devices Switches and Hubs to these two PAC s LAN2 wai A he The LAN2 port uses an Ethernet crossover A TAE cable connected directly between two PAC Do not use a normal Ethernet cable 3 Public IP Port The Win GRAF redundant PAC s Ethernet Port LAN1 must connect an Ethernet Switch via a normal Ethernet cable After that it can be used to communicate with SCADA HMI or connect and control external Modbus TCP I O modules devices or other Ethernet devices The LAN1 port can switch its IP address automatically If the PAC is Active the LAN1 IP address will switch to the Active_IP address which defined in the user s Win GRAF project And if the PAC is Passive the LAN1 IP address will switch to the Active_IP 1 address automatically The SCADA HMI can use the Active_IP address to communicate with the Win GRAF redundant system AN 1 When HMI RS 408 Alive Port switching SCADA NS 408 wa Passive Po RS 232 co ae Active Passive mo ET 7000 I O EX 192 168 71 128 255 255 255 0 Win GRAF PAC Win GRAF User Manual V 1 01 Oct 2014 by ICP DAS 16 4 PAC Installation Notes Very Important 1 Before power up PACs make sure one PAC s rotary switch is set to 7 and the other one is set to 9 The redundant system will be cr
280. n_done TRUE just do it one time tmp_bool Retain_Var DINT_1 1 retain a DINT variable tmp_bool Retain Var DINT_ 2 2 tmp_bool Retain_Var REAL_1 3 retain a REAL variable tmp_bool Retain Var REAL 2 4 Win GRAF User Manual V 1 01 Oct 2014 by ICP DAS 16 10 if Retain variables havn t been inited yet use default value if DINT_1 lt 1000000 or DINT_1 gt 1000000 or DINT_2 lt 2000000 or DINT_2 gt 2000000 or REAL 1 lt 9 9E10 or REAL_1 gt 9 9E10 or REAL 2 lt 9 9E10 or REAL_2 gt 9 9E10 then DINT 1 0 DINT 2 0 REAL_1 0 0 REAL 2 0 0 end _if end_if is_first_cycle_just_after_switch TRUE just in the cycle after switching FALSE other cycle if is_first_cycle just_after_switch then The Timer ticking state is not auto redundant So we have to process them here Ticking timer in the cycle just after switching if its last state is ticking if TMR_1 last_state then tStart TMR_1 end_if if TMR_2_last_state then tStart TMR_2 end_if end_if Timer operation if To_tick_TMR_1 then To_tick_TMR_1 FALSE tStart TMR_1 TMR_1_last_state TRUE end _if if To_tick_TMR_2 then To_tick_TMR_2 FALSE tStart TMR_2 TMR_2_last_state TRUE end_if if To_stop TMR_1 then To_ stop TMR_1 FALSE tStop TMR_1 TMR_1_last_state FALSE end_if if To stop TMR_2 then To_ stop TMR_2 FALSE tStop TMR_2
281. nds of variables users do not need to look for them just simply switch to the pre created Spy List window to see the wanted information Steps 1 Right click on the project name e g Demo01 and select Insert New Item 2 Select Spy List of the Watch then click Next to the next step 3 Then key ina list name e g NewSpy1 and press OK Workspace f C n Ig i i SF a lt Ta TIT PYY Va a8 DIN mp Jei a j Communication Parameters 7 OnLine n FE es Seii w y Monitor Wi Insert New Item l a HOKE EN ENAN Categories Available Items G Insert New Program mt A All Spy list 3 dg e Ins rt HMI Device Ee e a Graphics af Resources Sal Sho ae Embedded HMI Soft Scope Ai y asert New Ltem Shortcuts Peo toes others FL J Cancel Properties Name Description Cancel Win GRAF User Manual V 1 01 Oct 2014 by ICP DAS 11 3 4 Double click NewSpy1 on the left side to open the setting window and drag the variables you want to put into the window Workspace HewSpyt spl C Demoli H Name Value Description Name Type H C Exception programs g PAC ear Current time of the PAC 5 4 Global variables G L Programs PAC Month PAC Year DINT LoSB PAC_Time Get SetP 9 PAC_Day PAC Month DINT Pe LD1 Blinking PAC_WeekDa WR PAC Day DINT EI
282. nge 4 gt a 10 Drivers Variables xX Cancel The setting steps of Modbus Master Request for both Modbus Master RTU ASCII Port Section 5 1 and Modbus Master TCP UDP Port are the same Now we have finished the setting to read Al data Please click the item number link to the Section 5 1 1 5 1 5 in the table below for the setting steps to read write other data 1 2 Read Input Bits Read DI data 5 Read Input Registers Read Al data Write single holding register Write one AO data 16 bit Write single coil bit Write DO data 5 Write Holding Registers Write multiple AO data 16 32 bits Win GRAF User Manual V 1 01 Oct 2014 by ICP DAS 5 41 5 2 1 Connecting ET 7000 Series I O Module ICP DAS ET 7000 is a series of I O module supporting Modbus TCP Slave protocol The Win GRAF PAC can enable the Modbus TCP Master to connect the ET 7000 modules The maximum recommend amount of the connecting ET 7000 modules depends on the PAC model such as the XP 8xx8 CE6 XP 9xx8 CE6 WP 5238 and WP 5248 recommends a maximum of 200 the WP 8xx8 VP 25W8 and VP 4138 is recommended that no more than 32 For more information about the ET 7000 series products please visit the website http www icodas com root product solutions remote io ethernet io ethernet io selection html Use Internet Browser to Set the ET 7000 Modules Before the first time using the ET 7000 you must set up the ET 7000 by using the Internet Brows
283. o a file in the PAC This demo_file1 project will save 10 REAL value to a file in the System_Disk Real_data1 txt File Format Each row contains one REAL value and ends with lt CR gt lt LF gt characters Like 1 08 2 786 38 45 41 5 59 875 60 76 71 23 80 5 99 8 100 7 Variables declaration Because the size of System_Disk is small recommend you may change the directory Write_File BOOL to below Depends on your application T tri String len 255 siege ne ing WP 8xx8 WP 5xx8 VP 25W8 VP 4138 Ne Micro_SD or REAL_val 0 9 REAL ii DINT XP 8x48 CE6 XP 9xx8 CE6 File Status System_Disk2 String len 128 Set Write_File as TRUE to write data to the file if Write_File then Write File FALSE File ID F_Wopen System_Disk Real_data1 txt if File ID O then Can not open file in write mode File Status Can not open file in write mode else open file in write mode ok save REAL O 9 to file each row contains 1 REAL value and end with lt CR gt lt LF gt File Status Open file ok for ii 0to9 by1 do Win GRAF User Manual V 1 01 Oct 2014 by ICP DAS 12 15 Tmp_string Any_to_string REAL_vall ii FM_write File_ID Tmp_ string end_for If want to save data to Integer use the code Tmp_ string Any_to_string DINT_vallfii close the file F close File ID and declare Variable DINT_v
284. of the XV310 XV310 Analog Input 2 5 V l 20 mA 07 4 mA 20 mA 10 V 5 V OA 1 V l 20 mA i 1A 0 mA 20 mA Win GRAF User Manual V 1 01 Oct 2014 by ICP DAS 5 19 Note 1 For easy to use recommended to use the data format Engineering E g 2 5 V will show as 25000 to 25000 and 4 mA to 20 mA will show as 4000 to 20000 2 When using these Type Code 0 1 06 07 OD 1A please check if the position of eight hardware jumpers on the XW board are correct www icodas com root product solutions datasheet hmi_ touch monitor XV310 pdf XV310 Analog Output 0 mA 20 mA 4 mA 20 mA OV 10V 3 10 V OV 5V 5 5 V l Win GRAF User Manual V 1 01 Oct 2014 by ICP DAS 5 20 5 1 7 Connecting the XV107 XV107A 8 DI 8 DO The XV107 XV107A is an 8 channel digital input and 8 channel digital output board This section provides a Win GRAF demo program demo_XV107 zip First go to Section 5 1 6 for the information of the XV Board before using it Demo description This demo added two data blocks One is used to read 8 DI data and the other is used to write 8 DO data 1 Mouse double click the 1st data block i e lt 2 gt Read Input Bits to open the setting window Workspace J 0 Drivers HA 5 demo_X 107 Ig me MODBUS Master A Y Name Type Exception programs 3 r ATU COM0 115200 N 8 1 xV107_DLOO BOOL Programs a agi lt 2
285. oft GRAF studio can not download the demo_soft_graf_schedule to that PAC Win GRAF User Manual V 1 01 Oct 2014 by ICP DAS 17 25 Appendix A Data types and Ranges Users can specify the data type of variables in the Variables Area refer the Section 2 2 1 or in the Variables window refer the Section 2 2 2 fay Global variables PAL Year PAC Month PAC Day PAC VeekDay PAC Hour PAC Minute PAL Second 3 Below are the available basic data types and ranges Data types Sizein bits Range of Values SINT 8 bits Small int signed 128 to 127 USINT 8 bits Unsigned small int O to 255 BYTE INT 16 bits Int signed 32768 to 32767 UINT 16 bits Unsigned int O to 65535 WORD DINT 32 bits Double int signed 2147483648 to 2147483647 UDINT 32 bits Unsigned double int O to 4294967295 DWORD LINT 64 bits Large int signed 2 to 2 1 ULINT ay 64 bits Unsigned large int O to 2 1 LWORD Note All the Win GRAF PAC does not support the ULINT and LWORD data type REAL 3 4x108 to 3 4x108 LREAL 1 7x103 to 1 7x10 8 STRNGT Amex of255 ances sn The commonly used data type Win GRAF User Manual V 1 01 Oct 2014 by ICP DAS AP 1 AppendixB Troubleshooting while On Line the PAC If the error message is showing up as the screenshot below after connecting to the Win GRAF PAC refer the following content to solve the problem The Bad version
286. oject ein ith ead 9 Bom Dit ma e E Print Setup 4 brow Pi i 1 CAWin GRAF Projectsemo_schedule w51 From Target 2 C Win GRAFProjectsMemo _8088w w51 From XML Export file BID O demo project Pdemo_XY310 2ip YNdemo_vbO1 zip demo_file zip A demo_X 308_3 zip PY demo_v r_C zip demo_filel zip 4 pese jo idemo _XY308_2 2ip Widemo_tnr3 zip P demo_extra_port zip demo X 308_1 zip PA demo_tmr2 zip Widemo_ET7060 zip Ydemo_X 116 2ip E demo_tmrl zip demo _ET7018z zip EENT F demo _X 111 2ip demo schedule zip DEMO _DL_100T485 zip pe KAN demo_XY110 zip F demo_retain zip RU DEMO_D_87084_FR zip ro demo_XV107 zip WM idemo_rdn_3 zip QQDEMO_D_87084_C8 zip HAIXE a Ademo_wp5_retain zip Pdemo_rdn_2 zip DEMO _D_870384_C4 zip gt demo_vb04 zip Ge zip DEMO_D_7083 zip demo_vb03 zip demo_passwd zip Wdemo_4_7065 zip demo_vb02 zip PA demo_my_sp zip Wdemo_d_70182 zip 4 HAJAS i demo_schedule Bip Open From ZIP x 7 en The archive includes library elements Do you want to add them to the library Add to ibrary User Win GRAF User Manual V 1 01 Oct 2014 by ICP DAS 17 3 17 2 Introduction of the demo_schedule project This demo_ schedule project shows the way to do schedule control Please prepare one Win GRAF PAC like VP 25W8 or WP 8448 One PAC can control schedules of max 10 Targ
287. on to download the program again Allowed 0 Maximum 9 Overflow 0 Local application OF M4201 4 15 56 11 n btd4ce fed Target application Cierna 4 12 46 53 rnC 1 btd45e ced RAM 75176 bytes Elapsed 2h11m268 3 The RUN message means that the program is working properly ll RUN Magney Win GRAF User Manual V 1 01 Oct 2014 by ICP DAS AP 2 The Communication error error message A communications failure has occurred between the PC and the PAC Win GRAF Demolli File Edit View Insert Project Tools Window Help rae BE p adii n i Workspace seee PAC_Time g P Demoli Communication g Da Exception programs 5 Programs allie PAC Time Get Set oo E LD1 Blinking i Watch for debugging R1 Get current t Ha t fl E yg qEn TIME_GET Enof Current time ot th PAC Year BEE ax ANT Name Value E Fl O PAC Time Get Set FA Inst_TIME_GET Inst_TIME SET J E fa Global variables PAC Year Soft Scope z Initial values 7 Hg Binding Configuration 3g Global defines z All Variables EPAC_Day E C Used Oa Project H Advanced g Arithmetic OE Aray 9 AS interface z aml 4 F Blocks Solist Define ENUM Demoli 192 166 255 1 502 x l me Event description Communication error PAC Month PAC Month m ii ePATC VWeekDay PAC_ Hour lt Build Cross references Runtime Call stack Breakpoints Bad version 192 168
288. one DINT to 2 INT you must first use an ST program ANY TO DWORD to convert DINT to DWORD and then use an ANY_TO_INT FB to convert the unpacked WORD into INT type a En HiWORD Eno D OO a AMY TO DYVORD DINT VAL 13 im Q Temp WORD Temp MORD Hi_int En LOW ORD Ena En AMY _TO_IMT Ena OO Os ANY _TO_DWORDIDINT_ VAL AIN ab Temp WORD Temp WORD IN afLoint Win GRAF User Manual V 1 01 Oct 2014 by ICP DAS 10 10 10 7 Unpack Variable to Byte Array or Pack Byte Array into Variable SerializeOut Function can unpack a Win GRAF Variable value to a Byte Array or USINT Array Serializeln Function can pack a Byte Array or USINT Array into a Win GRAF Variable value Note 1 The Dim of Array must be set as at least 8 2 This Serialize Function can not use the STRING variable You can open the HTML Help from the menu bar and enter the searching key word to see the detail setup instructions E HIML Help fi ERRE SE H E T B28 S ASQ 20 20880 FRA ARPA SW serializeout v ia Frid 88 L ea is EE SernalizeOut IEC 61131 3 Advanced operations IEC 61131 3 2 Serializeln IEC 61131 3 3 If the SerializeOut and Serializeln return 0 it means the saving location is wrong or the Array s Space is not enough Note Declare TMP_DINT asa DINT buf as a BYTE Array Dim 10 DINT_Val as a DINT ene nner PUNT LREAL 8 Example 1 To unpack one DINT_Val to 4 Bytes and save
289. ong y ig 5 Win GRAF User Manual V 1 01 Oct 2014 by ICP DAS 10 1 3 Edit an ST Program to convert a physical value e g Phy _V O to 7 to an engineering value e g Eng V O to 7 Refer the Section 2 3 3 for detail setting steps ST1 i x 5 iit ii is declared as DINT Name Type Dim Att a Phy V is declared as REAL array with Dim 6 E E a ST1 Data Conversion Eng V is declared as REAL array with Dim 6 i DINT IF t a Phy V REAL 0 7 for ii 0 to 7 do Eng_ REAL 0 4 o f Global variables _ Using conversion function 1 to convert a OUTI BOOL v Ct physical valuean to an engineering value lt gt Eng V ii Convert to Eng 1 Phy V ii j p cal end for iiis declared as DINT variable l Eiin Phy_V is declared as REAL array with Dim 8 E Er T Eng_V is declared as REAL array with Dim 8 for ii O to 7 do Using conversion function 1 to convert a physical value to an engineering value Eng V ii Convert_to_Eng 1 Phy_V ii end_for 10 2 AO Data Conversion If you are using AO modules in the PAC s Slot 0 to 7 for example 1l 8024W and want to convert the engineering value to the AO output signal e g convert 0 to 20000 to 0 to 10 V refer the Section 4 4 However if you are using the DCON remote AO modules e g through PAC s RS 485 Port to connect to the l 7024 module you can refer to the following se
290. or updating add on functions I O boards or other purposes ICP DAS will release a new version of Win GRAF drivers in the future Users can get the latest driver on the website http www icpdas com root product solutions softplc_ based on _pac win graf download win graf driver html and follow the steps below to upgrade the new driver into the PAC Note The Win GRAF Driver of the XPAC XP 8xx8 CE6 XP 9xx8 CE6 WinPAC WP 8xx8 WP 5xx8 and ViewPAC VP 25W8 VP 4138 will be placed in the directory System_Disk Win GRAF inside the PAC 1 On the desktop of a PAC use WP 8xx8 in this example double click on the Win GRAF_WP_ 8000 icon and then click End Driver to stop the currently running driver cs Win GRAF WP 8000 Internet Explorer WP 6x88 driver Version 1 01 Jun 06 2014 This product is licensed WordPad A hae mr 2 On the PC copy the new driver into the PAC s directory Temp by using FTP method On the PAC copy the new driver from Temp into the System_Disk Win GRAF directory to replace the old one and then reboot the PAC HEU OU System Diskwin grat a License bin Ayin GRAF WP_S000 exe A Win_GRAF_ WP_S8000 Ink Quicker dl a t5 cod a t5 upd Win GRAF User Manual V 1 01 Oct 2014 by ICP DAS 11 2 11 3 Spy List When a program is running the Spy List lets users quickly know the variable s value or status Sometimes a program may declare hundreds or thousa
291. ost_watchdog Enabled 1 enable host watchdog O disable it Set a nonzero value will use the value 1 Watchdog timeout Unit ms can be 3000 25500 Set larger than 25500 will use 25500 ms 25 5 sec Win GRAF User Manual V 1 01 Oct 2014 by ICP DAS 8 2 Set smaller than 3000 will use 3000 ms 3 sec Ignore this setting when Host_watchdog Enabled is O Checksum_enabled 0 disabled 1 enabled Set a nonzero value will use the value 1 Delay_ms_between_polls Unit ms default is O ms Valid range is O 1000 Set smaller than O will use O ms Set larger than 1000 will use 1000 ms If there is no wireless module connected set a smaller value For instance set as 0 10 If there are wireless modules e g ICP DAS ZigBee Products ZigBee Converters or ZigBee O modules connected set a bigger value For instance set a value between 30 100 or other values Set larger value will get slower polling efficiency 3 Double click the item to be set and then fill in the value 8 DCON Properties Key 6 Ref 16 5 Port 2 Baud_rate 9600 Host_watchdog Enabled 1 Watchdog timeout 3000 Checksum enabled 0 4 After setting up the DCON in the I O Boards window it will automatically add a BOOL input variable in the Variables window When the Win GRAF links to the PAC it will show the COM Port communication status TRUE OK FALSE error T N ame 2 Type Dim Attrib Syb Initvalue
292. otected from the unauthorized access RUE OW FA password ok This example uses only one i RETURN LD2 program if your for demo purpose onl application as well as other Inst_BLINK r programs please add the password _ok checking code for each program Win GRAF User Manual V 1 01 Oct 2014 by ICP DAS 11 22 Chapter12 Demo Project Descriptions There are some demo projects in the Win GRAF shipping CD CD ROM Napdos Win GRAF demo project which some of them will be introduced in the following sections Before using the demo projects follow the steps below 1 Click on the menu bar File gt Add Existing Project gt From Zip to open a project e g demo_tmr1 zip pew Tools Window Help oe New Project List Open Project List b Add New Project Ddemo_com _portl zip Ddemo_com _port2 zip i Ddemo_com _port3 zip CI demo_com _port4 zip Ddemo_file Zip Ddemo_file zip D demo_retain zip Note Please close the current project List before restoring the demo projects in the CD ROM Click on the menu bar File gt Close Project List CD ROM Napdos Win GRAF demo project Ddemo_tnr zip Ddemo_tnr3 zip Win GERAF Demoli Fil Edit View Insert Project Tools Window Help cm Mew Project List e200 demo_tmrl zip J O BRAUD Zip file zip Op
293. oul 2 Schedule Control Utitty m a eee _ a a Sew y PC Sead o Qoetrolier CommaDer tier yoran Open from PC Ge fron Gontrdlin Help shout Take TO Target Target 2 Target 3 Target 4 Target 5 Target 6 Target 7 Target 8 Target 9 Target 10 Change the Target Name to meet the needs of the field User can change the name of the Target Season or other items to fit for the equipment at the application field Please create a text file named Label_ Name txt as the figure below and save it in the same folder with the Schedule Control Utility Schedule_in_PC exe Such as D Schedule Control Station1 Label_ Name txt Win GRAF User Manual V 1 01 Oct 2014 by ICP DAS 17 13 Notes for creating the file Label_ Name txt 1 If this file does not exist the Target will show an English default name e g Target 1 Target 2 2 In this file the text after is the Target name that you want to change E g LI the spaces will be erased 3 This file must save as the Unicode format User can create and edit it by the MS Notepad or other editors but must select the Unicode format when save it 4 In the PAC copy this file into the same folder with the Schedule Control Utility That is System_Disk Win GRAF 5 User can change the Season Normal day Holiday Schedule and other item s name by the same Way io E amp Ce om BEF ERE E
294. our own algorithm for the PAC password PAC password No _O No 1 No 2 12345 No 3 No 4 No 5 No_6 No 7 04 a bow j i wuts v E sm IE gt Main LD2 NewSpyl Note Refer the Section 2 1 2 to arrange the programs in the execution order Variable Declaration Workspace Vartebles J demo_my_ap Y Lj E nceplion progran aij Pogam H Man w LD2 aj Walch lor debuggi BD Sot Scope EF India volves bd NewSey MW Binding Configuati Puai e Ca ene gt ST Program Main a EAX T iome Type 3 s a Arithrmotie INIT BOOL C TRUE int as TRUE NOO DINT C B byte hardware sana number NOI DINT NO 2 DINT O NO3 DINT LJ NO4 DINT a NOS DINT NO 6 DINT a NO DINT a password DINT LJ PAC password DINT O password ok BOOL TRUE OK FALSE fail LED BOOL a LED BOOL C Mem LD ewiow VWaertebles f Global variables INIT BOOL NO D DINT F NO1 DINT NO 2 DINT NA 3 NINT w S ia a Ga aN a 39 Project pe E Advanced z EEX for demo purpose only Il password ok blink per secord Ea This demo_my_ap example can read the password from the EEPROM of the PAC and check if match with the result that calculated from the user s own algorithm Declare No_0 No_7 password and PAC_password variables as DINT Declare INIT variable as BOOL and has initial value TRU
295. out Noise_Filter_Min The min of the physical value to be considered as noise The filter will filter out the signal value beyond it default setting is 9999 9 For example set as 1 5 signal smaller than 1 5 V or 1 5 mA will be filtered out Note If setting Noise_Filter_Min gt Noise_Filter_Max filter is disabled If setting Noise Filter_Min lt 1000 and Noise_Filter_Max gt 1000 the filter is disabled Sample_Number The number of sampled data to be averaged as one data Default is 1 range 1 to 500 Set a bigger value will reduce the sampling rate however the signal curve is smoother than setting a small value 3 After linking the i_8017_16ch in the I O Boards window it will auto add 16 REAL input variables in the Variables window These variables can be used in the program TY Name Type Dim Attrib Syb Initvalue User Tag Description W ID1 i 8017_16ch 1D1 0 REAL Input 3 1D1 1 Input L You can change the variable eae han a L name by double clicking it olD1 nput O i ID1 4 REAL Input g See the Section 4 1 1D1 5 REAL Input LI 1D1 6 REAL Input E ID1 7 REAL Input LI 1D1 8 REAL Input LI ID1 9 REAL Input LI 1D1 10 REAL Input E 1D1 11 REAL Input LI ID1 12 REAL Input LJ ID1 13 REAL Input LI 1D1 14 REAL Input E a v 1D1 15 REAL Input lt li e al Win GRAF User Manual V 1 01 Oct 2014 by ICP DAS 4 7 4 4 i 8024 4 channe
296. ow Workspace IO Drivers HRs a demo_ET7018z iB E e MODBUS Master Al T Name Type G C Exception programs ce E l Open MODBUS 192 168 255 1 502 Minute DINT A Programs B agy 8 lt 4 gt Read Input Registers 1 1 10 g Secondi DINT aE M z a ae Main lt gt Symbol Operation nee Offset Mask Storage Penne Ue LI Watch for debugging ET 018z_Al_01 INT ET7018z2_4l1_00 Data exchange 0 FFFF Default BS Soft Eres Ca oa cmon G ET70182_Al_01 Data exchange 1 FFFF Default iene aire aa ae i fF ET 018z_Al_02 Data exchange 2 FFFF Default eM 4 Binding Configuration ET7016z_Al 04 INT eae a ET 018z_Al_03 Data exchange 3 FFFF Default ET70182 Al OS INT oo ET 0182_A _ 04 Data exchange 4 FFFF Default Tsar GJ Variables ET7018z_Al 06 INT as ET 018z_Al_05 Data exchange 5 FFFF Default a E Types ET7016z Al O INT ET 0182_Al_ 06 Data exchange 6 FFFF Default ETA ALO 5 INT ET 018z_Al_O Data exchange ti FFFF Default EA ha Aerts ET 0182z_Al_08 Data exchange 8 FFFF Default ET70192_Al_09 Data exchange 9 JFFFF Det ee ee ET 0182_status Error report 0 F Default Name Value lt SSS Notice 1 The value of the Offset starts from 0 but the Modbus address of the variable is the Offset value plus 1 Base address 2 If set the Operation to Error report the Offset value of the variable Data Type DINT must set to 0 3 If Al range is 32768 32767 please declare
297. ows 5 Refer the Section 5 1 1 for derails Periodic ms 0 gt Gi E m e Timeout Set a timeout value J On call fon error E O On change When time out occurred it will show fice the defined error code The e Nir 250 ms recommended value for the Modbus S z RTU ASCII device is 200 to 1000 ms In Nb trials t this case the value is 250 ms 2 Next open the Variables window and then declare variables that are available for the program SESAN lO Drivers Ba Test_01 i sie MODBUS Master Name Value Ce C Exception programs a a RATU COM2 9600 N_ 8 1 Request lt 6 gt Write single holding H Programs d lt 2 gt Read Input Bits 1 1 16 Slave Unit 3 7 1 Main B AB lt 5 Write single coil bit 2 1 1 Address 1 Watch for debuggi UH B lt 4 gt Read Input Registers 3 1 10 Nb Item 1 W Soft Scope E A PE an eaa a aa AA ERR Activation On Change L E Initial values PE Period ms 0 9 4 Binding Configuration Period on eror 0 3g Global defines s Tps Timeout ms 250 4 Variables Press F1 key to view the details Rl eeriaer oF inalec 14 Types g on the MODBUS Master settings Description Double click it to open this window Declaring a WORD variable Refer the Appendix A for details on data type and ranges refer the Section 2 3 1 for operations Word_Write_1 WORD Used to write AO data 16 bit Win GRAF User Manual V 1 01 Oct 2014 by ICP DAS 5 11
298. period or less or the PAC Cycle Time is larger such as 20 50 ms generally 3 15 ms then the period operations will be inaccurate For example to do a periodic operation every 50 ms as compared to 250 ms or 2 seconds the interval time of 50 ms is very close to the PAC Cycle Time if using Function Blocks BLink plus F_TRIG it is easy to accumulate the output delay time therefore the final operation time will become inaccurate C Cycle time Delay 5 ms 10 ms 3 15 ms pluse 50ms 50ms Tolerance will increase Win GRAF User Manual V 1 01 Oct 2014 by ICP DAS 12 3 To improve the situation above the following coding method will be more accurate Tolerance will not increase Refer P12 1 to open the project demo_tmr3 zip and can view add variables in the variable area ST Program Declare INIT as BOOL and has initial value TRUE Declare TMR1 TMR1_next as TIME IF INIT THEN INIT FALSE TMR1 THOS TMR1_next TMR1 T 50 ms TSTART TMR1 END_IF When the timer reach T 23h59m59s999ms the value will overflow IF TMR1 gt TMR1i_next THEN gt IF TMR1 gt T 10h THEN Therefore please reset it automatically to TMR1 T HOs O after 10 or 18 hours TMR1_next THOs END_IF TMR1_ next TMR1_next T 50 ms Do periodic operations here END IF Win GRAF User Manual V 1 01 Oct 2014 by ICP DAS 12 4 12 1 3 Detect the Steady ON or Steady
299. ple note in the Description field and then select the LD Ladder Diagram as the programming language and click the OK button Hew program Properties Advanced Description SFC pequential Function Chart Grid editor SFC Sequential Function Chart Free form editor FEL Function Block Diasra LD Ladder Dis evan oT stoctired Text IL Tnshouction List PACEML PACEML State Machine Execution style Main program O Sub proeram CO UDFB ser Defined Function Block Child SFC program ci ot 3 Double click the LD1 program to open the editor window E i Demoli sree Se PAC Time Get Set PAC Time Sa Win GRAF User Manual V 1 01 Oct 2014 by ICP DAS 2 12 4 Click the Insert FB button on the left of the LD1 window to add a function block File Edit aew Insert Project Toole Window Help S ne SB 4 58 2151 9 BREWED E so Bee Workspace LD1 H i S i Demot CO E F Name ee Be LY Exception programs ni _ LD1 Blinking 4 Ep i E coe E LORE PAC_Time Get Set PAC Time Tips g Sie LDT Blinking a El Watch for debugging You can also drag and drop Soft Scope the BLINK function block v cow 28 Initial values heal A j 7 4 Binding Configuration ry into the LD1 window F 2 see 3g Global defines m GY Variables 7 on EL Types gt a Fi HECH a S ENT a BLINE Blink signal ge BLIN
300. pp if there are a few apps such as the C VB net C app or Soft GRAF HMI app running in the redundant system these apps need to pre installed to the spare Win GRAF PAC or a repaired PAC before installing this PAC to the redundant system 4 Easy to design the application The user has to do is design the application program Not necessary to specify what data should be redundant between two PACs The Win GRAF redundant system will automatically deliver them to the other PAC 5 Users can design some safety in the app For example if the Active PAC s LAN1 is disconnected causes the SCADA unable to connect to ora RS 485 Port is disconnected or damaged and so on The user s app can test these events and then switch control right to the other healthy PAC 6 1 O Redundancy If the user chooses iDCS 8830 series I O both the PAC and I O modules can support redundancy Win GRAF User Manual V 1 01 Oct 2014 by ICP DAS 16 1 The architecture of the Win GRAF redundant system using XP 8xx8 CE6 as an example Note The Win GRAF redundant PACs support RS 485 RS 422 expansion boards I 8142i I 8144i plugged into their local slot Please don t use other kinds of I O modules aa 1 Two PACs without I O modules Rotary switch HMI SCADA RS 408 NS 408 COM4 RS 232 485 Win GRAF PAC COM2 RS 232 COM3 RS 485 7 Alive Main Port Backup LAN2 Rotary switch 7 J RS 232 Rotary switch 9 Note LAN1 No
301. put Data type REAL The value can be from 0 001 to 0 999 i e 0 1 to 99 9 In this case the initial value is 0 5 i e 50 Cnt The output mode Data type DINT Continuous mode set it as 1 in this case to output PWM pulse continuously Burst mode it can be from 1 to 65535 to output the required pulse count and then stop Run Using a BOOL variable to trigger the PWM output True Start False Stop State The current working status Data type BOOL True working False stopped Win GRAF User Manual V 1 01 Oct 2014 by ICP DAS 4 33 Test the program Before testing make sure you have set the PAC s IP address and then compile and download this program to the PAC If not familiar with the operation refer the Section 2 3 4 and Section 2 3 5 When connecting with the PAC the SPY List refer the Section 11 3 will show that the I 8088W s PWM initial frequency i8088 FreqO is 100 Hz the initial duty cycle i8088 Duty0 is 50 using the Continuous mode i8088_ CntO 1 and the currently measured frequency of the I 8084W is O Hz Hm WE GB oo GA 3 eee MAB NAD Workspace OOOO NewSpyt spl H gt demo_8088w RUN FE Name Value Description OY Name Value Type H Exception programs g i8088_Freg0 100 Init 100 Hz 3 t Global variables A Programs i8088_DutyO 0 5 Init 0 5 50 io086 Freqd 100 DINT Sie Main a i8088_Crto 1 Init 1 Continuous mode
302. put Parameters EN Data type BOOL TRUE enable it FALSE disable it Port Data type DINT COM port number can be 1 to 37 depends on PAC Must use a constant value cannot be a changed value Addr Data type DINT The Net ID address of the module can be 1 to 255 Must use a constant value not a changed value Tmp_F Data type DINT Temperature Format can be 1 or 2 1 temperature unit in Degree Celsius 2 temperature unit in Degree Fahrenheit Other value use it as 1 temperature unit in Degree Celsius Win GRAF User Manual V 1 01 Oct 2014 by ICP DAS 8 6 Output Parameters OK Data type BOOL TRUE Communication is Ok FALSE Communication failed VO V_9 Data type REAL 10 Ch Al value If the channel range type is configured as mV or Volt by DCON utility the unit of the returned channel value is Volt For example 0 85421 means 0 85421 V or 854 21 mV If the channel range type is configured as mA by DCON utility the unit of the returned channel value is mA For example 1 5567 means 1 5567 mA If the channel range type is configured as temperature the value unit is degree For example 25 75 means 25 75 degrees Open wire Detection If the returned temperature is greater than 9000 0 it means that 1 The temperature sensor may be broken line 2 The temperature sensor may be damaged 3 The DCON module is not configured well to fit the connected temperature sensors 4 The ohm measured b
303. r 3g Global defines A PAC Hour 13 a Variables in caer obey F PAC Minute a5 EL Types x PAC Second 23 Er Ac eekDay 1 It shows the current time of the PAC E Hour PAC Hour 13 Advanced Minute PAC Minute 55 Arithmetic Lg Arrays 45 interace SecondePAc Second 23 v Ga BACnet Zz aq Is lil W PAC Time Variables 4 Blocks Soviist Define ENUM Win GRAF User Manual V 1 01 Oct 2014 by ICP DAS 2 20 Note If there is any error message show up during the download process refer the Appendix B to get the solution Cycle time When on line with the PAC move your mouse over the RUN position on the toolbar to view the current cycle time of the program in the PAC You can also view the cycle time in the bottom right corner of the message area Win GRAF Demoli File Edit View Insert Project Tools Window Help PAR RE MEE Me Meet a 6 a E g G Al aan gy Workspace 0000 PAC Time m gt DemoO1 RUN LL mr G Exception programs E Al A Programs l Curent tim i Tl eee nae me YearLPAC Year Lowell ennie ee LD1 Blinking Val OOM42014 08 57 05 Watch for debugging PAC Mont Fa eee s at Solt Scope N PA Val 0910412014 06 5705 tilt betes PA DEK A ee Ya Binding Configuration way PAC Week lt Elapsed 1 5m 3s 3 39 Global defines Ga ll F Ya Variables Hour FAC Hour fy Used E E Types Lj Project
304. r RS 485 for doing these operations follow the way as below Method 1 When the Win GRAF PAC is turned on it will try to read a Extra_Ports txt file in the path System_Disk Win GRAF and the contents are shown like below COM1 19200 N 8 1 It means to enable the COM1 and the Baud Rate is 19200 bps If you want to enable the COM2 and its Baud Rate is 9600 bps modify the contents as below COM2 9600 N 8 1 So put this text file to the path System_Disk Win GRAF by FTP and then reboot the PAC Disable the COM Port If you want to cancel this COM Port setting simply delete the Extra _Ports txt file in the PAC System_Disk Win GRAF Extra_Ports txt and then reboot the PAC Method 2 Users can find out a demo_extra_port demo program in the shipment CD First restore this zip file refer the Chapter 12 and then mouse double click ST1 to modify this program Finally compile and download this program to the PAC refer the Section 2 3 5 Wor pace ST1 i y i Create extra port FALSE Y Name Type LG ERCeption programs E file1 DINT Programs 7 ORE TAIR SE See eee filel_name STRING 128 38 Main THEN ican eee F openi fileli name Create extra port BOOL Sar E i Ex Se eet eee Se ee Delete extra port BOOL Stall Watch for deDigging c F close filel close file s gM Soft Scope end if Ca AN F Initial values bat bd NewSpyt end if In this exa
305. r example when using the I 8093W module 0 means the X axis 1 means the Y axis and 2 means the Z axis Q Data type BOOL TRUE OK FALSE Error Win GRAF User Manual V 1 01 Oct 2014 by ICP DAS 4 27 4 9 5 COUNTER_RESET For example Using the I 8093W module in the PAC s slot5 and reset the Encoder value of the Y axis as o sT program E Reset1 TRUE THEN Note Reset1 FALSE First add two BOOL variables Reset1 TMP_BOOL in the TMP_BOOL Counter_Reset 0 5 8093 1 0 Variable Area END IF LD program Main jaooo M o JE JFE Reset ba R1 fEnCOUNTER_RESET Reset1 BOOL set it to lac 1 TRUE to reset the value Press the F1 key for T i the details on settings Cay gt CH HEH Reset it to FALSE Reset R2 R l Port Data type DINT For a module in the slot O to 7 of the PAC set it as 0 For a DCON module connected to a serial COM port can be 1 to 37 depends on PAC means COM1 to COM37 Addr Data type DINT For a module in the slot O to 7 of the PAC set it as the slot number 0 to 7 For a module connected to a serial COM port set it as the Net ID address of the module 1 to 255 IO_Name Data type DINT The name of relative Counter Encoder module it can be set to 8084 8093 87084 87082 7083 and 7080 Channel Data type DINT The channel No of t
306. r from 5001 to 5030 n Window Help gt Fate a E j eal HM etwiork E Binding ah Open Binding Configuration Name Value p El _ Mame PUBLIC even Address d m 2 Month Fort 9000 a Ey 3D ay 4 wWweekD ap Babia Z Month EB Minute ol Second eed User may select the i oT 4 WeekDayl _ Fe 11T arget a 5 Hourt Identifier field of Larger Iterite property 6 Minute Target_0O1 Ey 13 TargetO3 l DSa m Second Target_10_ variables Ey 14 7 argetl4 atu My 15 Target05 A ThTargetOT Then click Iterate Tae A 12 Target2 i pee 3 roperty to assign Name identifi Po 12 Targetda PTOPENY i Target 01 BOO 14Target4 continuous number Target _01_DINT D aa Target _01_REAL Target 2 BOD Target U2 DINT Target 02 REAL Target U3 BOO Target_03_DINT Target US REAL Tamek Oa AO Target U1 BOUL pail Target_O1_DINT WNIK Target_U1_REAL Be Target_U2_BUOL NIE Target_U2 DINT Wis Target_02_REAL Balle Fae Main variables d Binding amp ail Target U3 BOOL fli Build Sa Target 03 DINT IE Target_ 03 REAL 003 eee Tamet ma Ron E n al gt gt Main Variables J Binding Fom fon f oo By T Results CO Win GRAF User Manual V 1 01 Oct 2014 by ICP DAS 17 6 17 3 Edit schedule configurations by the Schedule Control Utility Here shows a simple examp
307. res This option is time consuming L A Cancel Note The Code Generation must be set to Release Win GRAF User Manual V 1 01 Oct 2014 by ICP DAS 2 4 2 2 Introduction of the Project 2 2 1 Demo01 LD Program This program is used to read write the Win GRAF PAC s system time In the Workspace double click the LD program name i e PAC Time to open all relevant windows As the screenshot below the Program Area has three main parts Win GRAF Demoli File Edit View Insert Project Tools Window Help k Program Area ahd ala aa K kaa mathe Ges Sea 8 Workspace PAC Time afd E Demoli 4 A T Name Type Di 9 Exception programs ee E _ PAC Time Get Set PAC Time SFERA Inst_ TIME GET Time Get Current timga 7 s i Set PAC Time sie ail Xo Inst_TIME_SET Time Set TIn z a 5 ft Global variables UA Soft Scope PAC Month PAC Year DINT Initial values PAC Month DINT Wd Binding Configuration ii PAC Day PAC Day DIMT h g Global defines 4 Wl tal Varlables PAC WWeekDay All B Va riables Types G Used Area E PAC Hour Project 40H 9 Advanced PAC Minute 0I Arithmetic HHCH iw La Arrays lt i A Program Editor Blocks 9s C Function Note means the Build Area LD Slacks Area program is locked and cannot be deleted l l 4 Build Cross references Runtime Call stack Breakpoints Digital sampling trace Prompt Htl Ready OffLine 192 1
308. riable shows as below T Name Type S Atti Syb Init value User Tag Description Real Vvrite_1 REAL T mimi bivas_ Variables ig 3 Inthe IO Drivers window drag variables Real_Write_1 and Status that created in the Section 5 1 1 from the Variables Area to the Symbol Area in the 5th data block Note The Status is an array variable When you drag Status into the Symbol Area it will show Status 0 to Status 4 simply press Del key to delete Status 0 to 3 4 Set the Operation field of the Status 4 as Error report that means this variable will be set to an error code when a read error occurs or reset it to 0 when a read request is successful Press the F1 key to see the description of the Modbus Master Configuration and move to the title Status and command variables to know related commands and error codes 5 The Real_Write_1 is a 32 bit data and required two Modbus addresses So set its Storage field as DWORD Low High IO Drivers i 7 Xx ig E 1 MODBUS Master Name Value TY Name _ Type a jg ATU COM2 9600 N 8 1 Request lt 16 gt Write Holding A Bool 15 BOOL A J H I lt 2 gt Read Input Bits 1 1 16 Slave Unit 4 Bool_16 BOOL E H B lt 5 gt Write single coil bit 2 1 1 Address 1 DO O BOOL Li lt 4 gt Read Input Registers 3 1 10 Nb Item 2 Long 1 DINT g H H lt
309. riables Win GRAF User Manual V 1 01 Oct 2014 by ICP DAS 5 8 Word_1to Word 6 WORD Used to Read Al data 16 bit DINT Used to Read Al data 32 bit REAL Used to Read Al data 32 bit Refer the Appendix A for details on data type and ranges After completing the settings the defined variables show as below Variables ALAR Ff Name Type D Y Attrib Syb Initvalue User Tag Description Long 1 DINT T A Word 1 WORD LJ Word 2 WORD LJ Word 3 WORD E Word 4 WORD LJ Word 5 WORD E Word 6 WORD LJ Real_1 REAL E F lt s gt Drives Variables 3 Inthe IO Drivers window drag variables Word_1 to Word_6 Long_1 Real_1 and Status that created in the Section 5 1 1 from the Variables Area to the Symbol Area in the third data block Note The Status is an array variable When you drag Status into the Symbol Area it will show Status 0 to Status 4 simply press Del key to delete Status 0 to 1 and Status 3 to 4 4 Set the Operation field of the Status 2 as Error report that means this variable will be set to an error code when a read error occurs or reset it to O when a read request is successful Press the F1 key to see the description of the Modbus Master Configuration and move to the title Status and command variables to know related commands and error codes 5 Both the Long 1 and Real 1
310. ring from a table h T LOBYTE Low part of a word T LOG Logarithm base 10 LOGFILECSY Generate log file in CS format T LOGL Logarithm base 10 LHEAL T LOGMESSAGE send a LOG message T LOWORD Low part of a double word ese MAREDWORG FPack words to double word Function AKEWORD Rack bytes to word F HAX Maximum MBMASTERRTU MODBUS Master ATU T MESHIFT Multibyte shiftrotate T MBSLAVEIDENT Set MODBUS Slave Device Identification EE MB SLAVE WIDE Aa MESLAVERTUES MODBUS Slave ATU eri Function Block MBMASTERTCP MODBUS Master TCP hail Nb Inputs ae Ok Win GRAF User Manual V 1 01 Oct 2014 by ICP DAS 3 9 2 The MBSLAVERTUEX has a SrvID setting Double click the left side of the SrvID and enter a needed Server ID using a string format e g Svr1 Note Using the MBSLAVERTU function block means the first Mobus Slave setting will be enabled Using the MBSLAVERTUEX function block means to enable the Modbus Slave setting depends on the Server ID Inst _ MAS m R2 JI MBSLAVERTUEX G i Chd 3600 A 5 1 PORT T S Press the F1 on this function block to show A ENOAR up the related Help Inst_MBSLAYERTU R2 MBSLAVERTUEX COM2 S600 N51 Now you have finished the settings for the MBSLAVERTUEX function block and then re compile the program and download it to the Win GRAF PAC
311. rmal Ethernet Cable LAN2 Ethernet Crossover Cable Alive Port RS 232 Crossover Cable 2 Two PACs are equipped with DCON I O modules Win GRAF PAC COM4 RS 485 i ine I 87K8 9 1 7000 I O u l 87xxxW 1 0 m i RS 408 HMI SCADA COM3 in I 87K8 9 1 7000 I O RS 485 I 87xxxW 1 0 Note LAN1 Normal Ethernet Cable LAN2 Ethernet Crossover Cable Alive Port RS 232 Crossover Cable COM3 COM4 RS 485 Data to Data Data to Data 3 Two PACs are equipped with Modbus TCP I O modules HMI SCADA RS 408 NS 408 Win GRAF PAC a Alive Port RS 232 Other Modbus TCP Devices ET 7000 series I O Note LAN1 Normal Ethernet Cable LAN2 Ethernet Crossover Cable Alive Port RS 232 Crossover Cable Win GRAF User Manual V 1 01 Oct 2014 by ICP DAS 16 2 4 Two PACs are equipped with iDCS 8830 I O modules This type of achievement provides both CPU and I O module redundancy HMI SCADA RS 408 NS 408 Win GRAF PAC a Alive Port moy RS 232 iDCS 8830 series 1 0 Z iDCS 8830 series 1 0 ryYyvT y ty ti LAN1 LAN2 EN EF ES ET Be LAN1 LAN2 Note LAN1 PAC LAN1 iDC 8830 LAN2 iDC 8830 Normal Ethernet Cable LAN2 PAC Ethernet Crossover Cable Alive Port RS 232 Crossover Cable Note Each pair of redundant I O modules that plugged into the iDCS 8830 must have the same model numbers 5 Two PACs are equipped with other Modbus RTU A
312. roject Win GRAF Demolli E m fx File Edit View Insert Project Tools Window Help ae See See Reece eee eee ee ee A T E E Workspace Bj Ho selection E g Demoli tig Binding Configuration og Global defines fat Variables Build Build Cross references Runtime Call stack Breakpoints Digital sampling trace Prompt Hble OffLine 192 168 255 1 502 Note In the demo01 we use a From template way to create this project If you select Project in the step2 click the Release in the Compiling options setting The others setting can be done in the following sections just click Next and then OK button to end the settings Programs Language LD Ladder Diagram v Compiling options O Debug Communication options Stings 192 168 7119 502 Ne PAC IP 502 Protocol See Section 2 3 5 _ Other V Edit initial values with the Recipe editor Win GRAF User Manual V 1 01 Oct 2014 by ICP DAS 2 2 2 1 2 Important Project Settings There are two important settings must be done after creating the project 1 In the Workspace mouse right click the project name e g Demo01 and then uncheck the Alphanumeric Sorting option the last one If unchecked means the programs are in execution order If checked means the programs are in alphanumeric order e g FBD1 LD1 ST1 Contisuration Libraries Build Project Clean Project Ff Test0l c Da Exception programs i Da E
313. roject to the Win GRAF PAC If download success you can see HMI on the Win GRAF PAC screen File Project Wie Help Project Yiew Win GRAF User Manual V 1 01 Oct 2014 by ICP DAS 15 2 15 2 How to Develop Soft GRAF HMI Before user develops Soft GRAF HMI users have to publish Win GRAF project variables Then Soft GRAF HMI could read write the Win GRAF variables Please refer the Section 13 2 to get information about publishing Win GRAF variables BH Network Sj PUBLIC 3000 One 11 LED_0 x The left example shows a Win GRAF variable LED_01 with address 11 is published NetWork Address Message when false If user wish to use Soft GRAF Luo Mus Weesp Glan Li to read write this variable Input TF color A Shape Cirle w Then user has to set NetWork Soft GRAF Sine ag id Font Address to 11 in Soft GRAF Studio object This Soft GRAF Location so y 3 a Using bool addr to hide HMI object is g_B_Led There is another setting in the Win GRAF workbench before user develops Soft GRAF HMI User needs to add Soft GRAF in the Win GRAF IO boards The following steps demonstrate how to add it Click Open I Os on Win GRAF toolbar w t Gh B zg Click Slot 8 or larger slot NO suggest value is 9 position Then click Select button Finally mouse double click Soft GRAF in the dialog EEE IO Boards Jeo co afen ene fea ra lo
314. roperties FORE EERE EEE EEE EEE E EERE EERE EERE EEE EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE EEE M w ra o peyrrorve TI iri errr rrr rrr rir 4 Rar ir tte 5 ChO_1_ Filter 0 a Ch2 3 Filter 0 Ch4_5 Filter 0 i Ch6_7_ Filter 0 8 Signal Inverted 0 9 Reserved0 0 40 Reserved 1 0 Reserved 0 11 Reserved3 0 12 13 14 15 16 n Setting Description 47 8084 W Setup 8 Ch Counter Inputs Note Please use the i_8084 Start i_8084 Stop _8084 Get _8084_ State and i_8084_ Reset functions to operate counter channles in an B084 W Parameters Parameters Ch_Filter The unit is 0 000001 second us the value can be O to 200 The default setting is O without filter The Ch_ Filter is for filtering out some noise signals with smaller signal width Recommend O if there is no noise consideration or need a real time measurement The following setting is recommended Max Input Signal Hz Recommend Filter Value 200 5K O without filter Signal_Inverted 0 Input signal is normal no inverted 1 Input signal is inverted means voltage HIGH will be processed as LOW and voltage LOW will be processed as HIGH Win GRAF User Manual V 1 01 Oct 2014 by ICP DAS 4
315. ror Periodic Section 2 1 4 On change Sending the request periodically This option can not apply 7 to the Read request Timeout on error means the next sending Misc In this case to send once per second time when an exception occurred Nb trials e g 15 seconds e Timeout Set a timeout value When time out occurred it will show the defined error code The recommended value for the Modbus RTU ASCII device is 200 to 1000 ms In this case the value is 250 ms 2 Next open the Variables window and then declare variables that are available for the program Workspace IO Drivers i Test_01 f Mg MODBUS Master H Exception programs ge ATU COM2 9600 N 8 1 Request lt 4 gt Read Input Registers Sy Programs lt 2 Read Input Bits 1 1 16 Slave Unit 3 T Main B lt 5 gt write single coil bit 2 1 1 Address 1 5 0 Watch for debuggi BD BES Sea liaet eee Nb item 10 W Soft Scope Activation Periodic Initial values Period ms 1000 id Binding Configuration etiod on error 95 Binding Cont Ls Period 15000 3g Global defines 6 Press F1 key to view the details Timeout ms 250 j 4 Variables on the MODBUS Master settings Number of trials 1 E Types Double click it to open this window Follow the table below to add six Word 16 bit one Double integer 32 bit and one Real 32 bit variables Refer the Section 2 3 1 for declaring va
316. rs Q BODL TRUE clear successfully FALSE something wrong for example port number is incorrect Jun 18 2014 ICP DAS Taiwan Win GRAF User Manual V 1 01 Oct 2014 by ICP DAS 12 7 12 2 1 Senda String by COM Port Refer P12 1 to open the project demo_com_port1 zip and view add variables in the variable area ST Program This program can send a String every 2 seconds by the PAC COM 1 parameters 9600 N 8 1 e g lt CNT1 1 gt or lt CNT1 25 gt Operations in the first PAC cycle if INIT then Declare INIT as BOOL and has initial value TRUE INIT FALSE No more first cycle Port_OK as BOOL CNT1 0 CNT1 as DINT TMR1 TMR1_next as TIME TMR1 T Os Port_number as DINT and has initial value 1 TMR1_next TMR1 T H2s start ticking TMR1 tStart TMR1 end_if if the status of COM port becomes FALSE not open open it if COM_Status Port_number FALSE then open a serial COM port Port_OK COM_open Port_number 9600 N 8 1 end if when time reached if TMR1 gt TMR1_next then to prevent TMR1 overflow means reach T 23h59m59s999ms if TMR1 gt T 10h then TMR1 T Os TMR1_ next T Os end_if Set new TMR1_next TMR1_ next TMR1_next T 2s Send a string from COM port COM_send_str Port_number lt CNT1 Any_to_STRING CNT1 gt reset CNT1 when reach
317. rties window Note The Slot 0 to Slot 7 are reserved for real I O modules that plugged into the PAC and the slot 8 or above are for other usage htt 140 Boards eke Ei 5 D Fa lOd M s 7 Tene eee e Ue e eee e eee EEE EEE HEHEHE EEEEEEEEEEEEEEE EERE EEE EEEE EEE EEE EEE EEE EEE EES TEESE EEE ESSER SEER ESSE EEEEEEEEEE EEE EEE EERE SEER STEER EERE EEE E EERE EEE EEE EEE EERE EEE SEER SETH ESTE SEEEEEEEEEEEEEEEE TEESE TEETER SEER ETERS EERE EEE E SEER EOD man Host_watchdog Enabled 0 Watchdog timeout 5000 E DCON Checksum_enabled 0 Delay_ms_between_polls 0 ReservedO 0 10 11 12 Reserved3 13 14 15 EE Setting Descriptions 16 DCON 17 Enable one serial port AS 485 to connect remote DCON I Os 1 7000 series modules RU 87PE Note 1 This DCON supports only the communication properties N 8 1 That is No parity 8 character size and 1 stop bit So please must configure all DCON 1 0 modules to N81 rer Ed A Parameters Note This DCON supports only the communication properties N 8 1 That is No parity 8 character size and 1 stop bit So please must configure all DCON I O modules to N 8 1 Port COM port number 1 37 depends on the PAC Baud_rate Communication baudrate in bps can be 1200 2400 4800 9600 19200 38400 57600 115200 bps Set a wrong value will use the default value 9600 H
318. rved0 0 Sy Reservedl 0 10 Reserved 0 11 Reserved3 0 12 EE 14 15 16 Setting Description 17 B093W Setup 3 Ch Encoder module Note Please use the 8093 Start i_8093 Stop _8093_ Get _8093_ State and i 9093_Reset functions to operate encoder channles in an l 8093 Parameters Parameters X_ Mode Y_Mode Z_Mode The input mode of X Y Z axis can be 1 2 and 3 Set other value will use 1 1 CW CCW counting mode 2 Pulse Directioncounting mode 3 A B phase quadrant counting mode Signal_Inverted 0 Input signal is normal no inverted 1 Input signal is inverted means voltage HIGH will be processed as LOW and voltage LOW will be processed as HIGH For example If setting Signal_ Inverted as O no inverted and X_Mode is 2 Pulse Direction the encoder value will increase if Dirextion signal is High If setting Signal_ Inverted as 1 inverted and X_Mode is 2 Pulse Direction the encoder value will decrease if Dirextion signal is High Win GRAF User Manual V 1 01 Oct 2014 by ICP DAS 4 21 2 Double click the item and fill in a value then press the Enter key to complete the setting 1 1 8093 Properties Key 6 Ref 16 8093 Z Mode Z Mode 1 Signal Inverted 0 ReservyedO 0 Reservedl 0 Reserved 0 Reserved3 0 3 After linking the i_8093 in the I O Boards window it will auto add 3 BOOL input variables i
319. s Single Dim double_val As Double Get 64 bit double value from the Win GRAF LREAL variable with address 7 UserShare Get_LREAL Convert ToUInt16 7 double_val Get 32 bit REAL value from the Win GRAF REAL variable with address 8 UserShare Get_REAL Convert ToUInt16 8 float_val Demo program CD ROM 1 R W analog I O napdos Win GRAF demo project vb net_2008 demo demo_vb02 2 R W internal long integer Timer and Real floating point values napdos Win GRAF demo project vb net_2008 demo demo_vb03 Win GRAF User Manual V 1 01 Oct 2014 by ICP DAS 13 12 ME Set REAL J Set_LREAL Description These functions are to set 32 bit REAL and 64 bit double value to the Win GRAF REAL LREAL variable Syntax UserShare Set_REAL ByVal iUserAddress As System UInt16 ByVal iStatus As Single As Byte UserShare Set_LREAL ByVal iUserAddress As System UInt16 ByVal iStatus As Double As Byte Parameter iUserAddress Address of Variable 1 to 8192 iStatus Set the 32 bit REAL or 64 bit double Example Set a 64 bit double value 11234 234567 to the Win GRAF LREAL variable with address 1 UserShare Set_LREAL Convert ToUInt16 7 Convert ToDouble 11234 234567 Set a 32 bit REAL value 123 12 to the Win GRAF REAL variable with address 8 UserShare Set_REAL Convert ToUInt16 8 Convert ToSingle 123 12 Demo program CD ROM 1 R W analog I O napdos Win GRAF demo project vb net_
320. s project declares the following variables for demo purpose only Please re declare your own variables My REAL_OO My_REAL_07 Data Type REAL My_DINT_0O0 My_DINT_0O5 Data Type DINT My BOOL_00 My _BOOL_02 Data Type BOOL My_Timer_00 My_Timer_05 Data Type TIME You can see more variables in the Variables window Variables Y Name _ _ _ _ _ i Type Dim Attrib Syb Init value Description A slobal variables MAX VAR REAL DINT Read Only e Max amount of REAL variables x VAR RIN Read On The Dim must Max amount of Integer Bool Timer vai REAL VAR_now REAL 0 99 va be the same Dim must MAX_VAR_REAL REAL VAR_aold REAL 0 99 C Dim must MAX_VAR_REAL OTHER_VWAR_now DINT 0 99 CI Dim must MAX_VAR_OTHER OTHER_VAR_old DINT 0 99 T Dim must MAX_VAR_OTHER File Path oT RING b4 O System_Disk Win GRAF retain_real txt File Path2 STRING 64 C System_Disk Win GRAF etain_other txt My REAL 00 REAL O My REAL 01 REAL CI My REAL 02 REAL E The directory and files for all Retain variables My REAL 03 REAL C My REAL 04 REAL LJ v lt gt Go_retain sub program is used to do the retain operation Remember to modify this sub program There are 4 sections should to be modified in it Please search Add your REAL variables for retain here and Add your integer BOOL Timer variables for retain here and depend on your re
321. se 10 LAEALJ T LOGMESSAGE send a LOG message T LOWORD Low part of a double word T MAKEDWORD Pack words to double word E LF MAKEWDAD Pack bytes to word Tips HAX H aximum ii 3 EF MEMASTERATU MODEUS Master ATU Press MBSL key to quickly MBMASTEARTCP MODBLUS Master TCP find out the function name MBSHIFT Multibyte shift ratate mae Let Rall Ue ub Mb Inputs Cancel Win GRAF User Manual V 1 01 Oct 2014 by ICP DAS 3 7 3 Inthe MBSLAVERTU function block mouse double click the left side of the PORT and enter a string COM2 9600 N 8 1 it means using the Win GRAF PAC s COM2 to communication with the Modbus Master and then click to complete the settings Inst_MBSLAVERTU Tips Press the F1 key on this function block to show up the related Help i Variables all aL Inst BLINK aL Inst MBSLAYERTU Variables all s Local variables only Hide FB instances 4 Double click the left side of the SLV and then enter 1 the value set in the Section 3 1 Step 3 then click to finish the setting Inst_MBSLAVERTU i Variables all E Inet BLINK aL Inst MBSLAYERTU Ey LED E IFM Variables all w P eee ree Rn eee ee Inst_MBSLAVERTU IM MBSLAVERTU Fa Now you have completed the setting of the MBSLAVERTU function block then re compile the program and download
322. select the following options to open this window again 3 p Local Defines Infos Tabl pE Infos Tab2 Output It means the Message Area Infos Tab1 It means the Program Area Variables pane refer the Section 2 2 1 Infos Tab2 It means the Program Area Function Blocks pane refer the Section 2 2 1 Win GRAF User Manual V 1 01 Oct 2014 by ICP DAS 1 12 1 2 3 Win GRAF Library Manager Win GRAF Workbench provides a Library Manager that can be used to look up all descriptions for Functions Function Blocks and I O Boards The user can refer Section 11 1 to upgrade the Win GRAF Lib 1 To begin this click the Start button and click All Programs gt Win GRAF gt Libraries gt OEM fm Win GRAF er Google Chrome mm ICPDAS 3 Outlook Express Mozilla Firefox HS Wy Win GRAF 2 Inthe Library Manager window click the menu bar File gt Open Library and select ICP DAS XP WP VP then click OK 3 Select any title in the Function and FBs tab and click the Description to view the usage of this Function or Function Block Select any title in the I Os tab and click the Description to view the usage of this I O Boards Library Manager User e Open Library Es Profies As Exit ICP DAS XPWP P OK Embedded HMI A Ethernet Powerlink Files ICP DAS XPA PAP Maths Miscell
323. set FALSE flag is not set RETAIN _FLAG_CLR Clear the retain flag to_clr_flag Ta E RETAIN FLAG CLA i to_clr_ flag R ST Program if to_clr_flag then to_clr_flag FALSE Q Data Type BOOL Always return TRUE See TMP_BOOL Retain_Flag_Clr end_if Win GRAF User Manual V 1 01 Oct 2014 by ICP DAS 6 6 6 2 Retain Variable for WP 5xx8 Only You can refer the following demo project demo_wp5_retain zip to use retain variables with files in the System_disk Win GRAF In the shipping CD Napdos Win GRAF demo project you can find the demo project for this section demo_wp5_retain zip please refer Chapter 12 to restore this project Execute File gt Add Existing Project gt From Zip and set the current IP address of your PAC This project includes an ST main program Main and 3 ST sub programs load_ retain save_retain and Go_retain F Edt Yew Inst Poorct Jocob Window Heb n MaN DE ie Ge phiol The demo wpd retain project has the tolloving Cot TF s default value Please set your own proper initial y ue Bilan GS Giobal vanables MAX VAR REAL aye oa ac ROL re we MAX VAR REAI DINT ies HAR VAR HEF ipi EAX Wh unrt retai L Hy PRE PRI Me 3 ibad mlan Get retai Per OPAL WAR na eal conte nt 00 4 fO 9 MAX VAR_O HER DINI ts bave_letien Save oe iim of OTHE R zt now rnd THER VAR old 200 re 25 REAL VAR_now REAL 0 Ta Go_reten irelemert J REAL VAR old RE
324. sil aa E Pi 2193 Chute D Symbol Operation Offset Mask Storage Range le Name Value Word _Write_1 Data exchange D FFF T Default Status 3 Erre o FFFF Default lt gt 4 gt 10 Drivers Variables Win GRAF User Manual V 1 01 Oct 2014 by ICP DAS 5 12 5 1 5 Write AO Data 32 bit 1 Using the same way in the Section 5 1 Step 4 to create the 5th data block and completing all the following settings in the MODBUS Master Request window and then click OK MODBUS Master Request x In this example in this example a a Slave Unit Description Enter the Net ID of the Slave device D C Slave Unit 4 Xa e g the Net ID is 4 Request MODBUS Request b MODBUS Request lt 6 gt Write single holding register zl Select lt 16 gt Write Holding Registers lt 15 gt Write Coil Bits a Lo mols gt Write Holding Reaisters i c Base address lt Saha Hie Start from 1 by default 5 Base address 1 Refer the Section 5 1 1 to change it Nb items Nb items 2 E The number of AO signals to write Activation In this case the number is 2 ALO 1 ma LE lii 2 _ el because the REAL type requires two AON es on error Modbus address On change Misc d On change In case of a write request Timeout 250 ms means that the request is activated 8 each time any variable c
325. sscccssscccessccceneseceusseceeseseneuesessussessens 14 5 WSN SUIS IN OO areata acetate aaa ea E eananns aca T nana ean 14 6 14 5 RW Boolean FUNCHON S x iccceshexeecednszieussaseseractacssthantereansasemonsaeeeareauaennsserss 14 6 145 2 R W Integer Functions crissu E E T E 14 8 14 5 3 R W Real variable FunctionS esssessssesssensesensssrrsssensssrssseressrressresserreseressrresse 14 10 145 4 R W String variable FUNCHUON Secr 14 12 14 5 5 How to Use C to Convert Win GRAF String Variable cccccccssececeseeeeeeeees 14 14 Using Soft GRAF HMI in the Win GRAF PAC csscscsscsscsccscsscsccscsscsscscescnsoscnscnes 15 1 Win GRAF User Manual V 1 01 Oct 2014 by ICP DAS 1 5 15 1 15 2 Chapter 16 16 1 16 2 16 3 16 4 16 5 Chapter 17 17 1 17 2 17 3 17 4 17 5 Appendix A Appendix B Appendix C Appendix D Appendix E Appendix F Restore the WINMGRAFRPTOJeC enura n tstencsnina dear esaawen aes teen ne ene 15 1 15 11 WnStall The Son GRAF Stu Gl isceecaceawea E nna TNN RONA EEA EEE 15 1 15 1 2 Download the Soft GRAF HMI Project to the Win GRAF PAC ssscceseseeees 15 2 HOW to Develop SoN GRAF HM iierrceiiuanarainaa a a a 15 3 Red ndaNn yaesir E Ea siwaiecandisteetie weasesesuns 16 1 Features ANG ArCHItOctUrE nirre TEA 16 1 Important Communication Ports and Installation NOteS ccceccccssseeeeeseeeeeseceeeeeeeees 16 4 Description Or Demo Progra aamuin slacer aie hides aaa e
326. ssrrssrresrrresrrrssrressrrserrresrereses 5 28 5 1 12 Connecting the XV310 4 Al 2 AO 4 DI 4 DO J sssessessrseserrssrrrerrrserrrserrreerrresns 5 34 Enabling the Win GRAF PAC as a Modbus TCP UDP Master cccceeccescsssseeeeeeeeeeeeeess 5 37 5 2 1 Connecting ET 7000 Series I O Module ccccccccccccccccceeseeeeeeeeeeesesseeeeeeeeesseeeess 5 42 5 2 2 Connecting the ET 7060 6 DI 6 Relay cceccccccsssececcesseceeeeeeeceeeeeeeceseeaeeeeees 5 45 5 2 3 Connecting the ET 7018Z 10 Al cccscssscscccaverenausucccacasavavarcuaueusucacasevavarauans 5 47 Connecting the Modbus TCP Slave device has two IP addresses cccssseccesseceeeeeeeeeees 5 48 Retain Variable and Data Storage csccscscsssscscsccccccscsccccccscsccccecscncescccecscesescecscesess 6 1 Retan V ALAC pasted 2c ottet aden cies deact aeseu wise aecenetetecaetles ceadeat ac austidsaaateede idan teaseadtamieteeehaeattn 6 1 SLT RETAIN VARIRELaIn a Variable h icsiscecsaciccsschcascten cade cacseianaebavatranamiaawm adenoid 6 3 6 1 2 RETAIN ARY Retain an Array Variable ccccccccsssecceceesecceceeseceeseeeeceeseeeeceeees 6 4 6 1 3 RETAIN FLAG _SET GET CLR Set Get Clear the Retain Flag 6 5 Retain Variable TOP WP 5XX8 ON IVini ainra an hanes a a o a kA 6 7 Win GRAF User Manual V 1 01 Oct 2014 by ICP DAS 1 3 6 3 Chapter 7 Chapter 8 8 1 8 2 Chapter 9 9 1 9 2 Chapter 10 10 1 10 2 10 3 10 4 10 5 10 6 10
327. st BLINK aE R BLINK Le E CY C A CH Inst BLINK4 k R2 Se i SB saaspeosesneetenrusaniesscnsasoeane I a iS All N H Used a Ga Proiect o S gs KANN gt 4 gt Blocks Sovlist Define ENUM Win GRAF User Manual V 1 01 Oct 2014 by ICP DAS 2 14 6 Click the Coil on the right of the BLINK function block and continuously click the Insert Coil button to add four Coil Tips press the key to zoom in the content Inst_ BLINK 7 Mouse double click the first Coil and double click LED1 to assign it Follow the same way to assign the LED2 variable to the second Coil LD1 ne p E Inat _BLIMEK ffi Variables all LJ Inst BLINK B new Hour D new Minute B new Month B new Second Variables all w Local variables only Hide FB instances pha a g O11 fg me 8 As the screenshot below mouse drag and drop the Output1 Output2 and Output3 variables to the 3th 4th and 5th Coil LD1 E E E D ee a T Name Type Dir HF Inst_BLINK LED LED BOOL 5 LED BOOL E a RETAIN variables a BM 10 1 8055 DI oH T a E W 30x1 1 i 6055 DO L S6OK1 1 0 Output BOOL i OLA 1 Outpute BOOL oA 1 2 Outputs BOOL E Ti aes gt H A HKH Project 5 Win GRAF User Manual V 1 01 Oct 2014 by ICP DAS 2 15 9 Mouse double click on the
328. st build Displayed used numbers are according to the last build Allacate Value 30 7 3 O Value re S Margin 2 10 Margin 2 10 6 Click Project gt Build All Projects from the menu bar compile the program again Then click On Line or click the tool icon A to link to the PAC Refer the Section 2 3 5 o E GE jo BF aa a mr A Sena Tools Window Help Build All Projects Clean All Projects Download All Projects Inst_ BLINK OUT1 4RUN BLINK Q d Win GRAF User Manual V 1 01 Oct 2014 by ICP DAS 9 4 7 After successfully link to the PAC click the tool icon Download changes to download the program to the PAC Note On Line Change is only suitable for the program that just has a little change Do not need to stop the application If the program name is different from the running one in the PAC the user has to stop and download the program again refer the Appendix B ET SS a a ey oT ee see iif mw E A E 3g i CARN Y 4 ER n a ma a a Main Pree Download changes TEST X A Y Name Yalue Type Inst_ BLINK OUTI TRUE 3 _ Main n JRUN BLINK a O f Global variables i SA BC OUTI TRUE BC eun 2i a Gen Used 3 Ma Ga Proiect Bree fy 3 gt 4 gt Blocks Sovlist Define ENUM iA Variables Main 8 Click on the tool icon Do On Line change to execute the program Note After e
329. st first complete all the Modbus Slave settings in Section 3 1 and then refer the Section 3 2 To begin follow these steps 3 1 To Enable the Win GRAF PAC as a Modbus TCP Slave 1 Click the Open Fieldbus Configuration tool button to open the IO Drivers window Win GRAF Demoli File Edit View Ineert Project Tools Window Help m BE STS ee ee ee oe es ee aka ff Bog Oe A Workspace 10 Drivers 5 Demoli T Name Type fa Global variables PAC Year DINT PAC Month OINT PAC Day DINT Ma iiasal MlkIT U Soft Scope 2 a Initial values Mame Aj Binding Contig g Global defines Variables 4 gt PAC Time Variables LD Build Cwn GRAF Projects4 D emo Ho eror detected cn Build Cross references A Runtime Call stack 4 Breakpoints d Digital sampling trace Frompt Hbl OffLine 192 168 255 1 502 Fa 0 0 2 Click the Insert Configuration button on the left side of the IO Drivers window and then select the MOSBUS Slave and click OK to enable a Modbus TCP Slave IO Drivers Name Value Add Configuration Choose a configuration E all z H MODBUS Cancel F MODBUS Master F amp C Time Variables L I IO Drivers Win GRAF User Manual V 1 01 Oct 2014 by ICP DAS 3 1 3 Click the Insert Master Port button on the left side to set the Slave number In this case the value is 1 and click the
330. the PAC via COM Port Communication Settings Ethemet TCPAP OK IP adress Cancel nan Help Serial link PC port i Select the available COM Port Ei number on your PC In this Parity i BA example Baudrate 19200 bps Stop bits i Baudrate Disable the COM Port If you want to cancel this COM Port setting simply set the Delete_extra_port variable as TRUE it will delete the Extra_Ports txt in the path PAC System_Disk Win GRAF Then set the Reset_PAC variable as TRUE to auto reboot the PAC Win GRAF User Manual V 1 01 Oct 2014 by ICP DAS AP 8 Appendix F Pin Assignment of PAC s Serial Ports WP 8448 8848 Pin assignment of COM1 to COM4 COM1 RS 232 COM2 RS 485 COM3 RS 232 485 COM4 RS 232 PWRI GND PWR2 GND R COM R NO D 9 f Note WP 8148 has no COM3 COM4 XP 8048 CE6 8348 CE6 8748 CE6 Pin assignment of COM1 to COMS COM1 RS 232 External COM1 for XP 8048 CE6 only The COM1 of XP 8348 CE6 8748 CE6 is for internal communications with I 87KW modules in slots only COMS RS 485 COM4 RS 232 485 COMS RS 232 Win GRAF User Manual V 1 01 Oct 2014 by ICP DAS AP 9 VP 25W8 VP 4138 Pin assignment of COM2 and COMS3 VP 25W8 VP 4138 COM 2 RS 485 COMS RS 232 COM 2 RS 485 COMS RS 232 Win GRAF User Manual V 1 01 Oct 2014 by ICP DAS AP 10
331. the data type as INT for the variable MODBUS Master Request Request Description The Net ID of the Slave Unit Slave Unit ET 7000 is fixed to 1 MODBUS Request lt 2 gt Read Input Bits A lt 3 gt Read Holding Registers 1 lt 4 gt Read Input Reaisters Read DI data WO vika nimala mil bib Data block Start from the address 1 Base address 1 to read 10 items Hb items 10 Activation Read once every 50 ms Periodic 50 ms s000 If error occurs wait 5 s to fy C2 On cal on error send the next commend On change Misc Timeout 500 ms r If no responds in 500 ms means error Nb trials p Win GRAF User Manual V 1 01 Oct 2014 by ICP DAS 5 47 5 3 Connecting the Modbus TCP Slave device has two IP addresses The previous section lists the way to enable the Win GRAF PAC as a Modbus TCP Master device and lists the way to read write Modbus TCP Slave device This section will list the way to create the redundant Modbus Master Request when one IP of the Modbus TCP Slave devices is disconnected the other IP can still normally to be read written data Application Diagram Intelligent Remote Redundant Ethernet I O Expansion Unit iDCS 8830 F 8K Series O Modules Win GRAF PAC WP 8xx8 LAN1 LAN2 Modbus TCP Slave Modbus TCP Master Follow The Steps 1 Click the Open MODBUS and then click the menu bar Tools gt
332. the following will describe how to test the program The PAC_Time Program 1 Mouse double click the variable name e g new_Year in the TIME_SET function block or the Variables Area one by one to change the PAC s system time e g to change it as January 1 2015 12 30 35 OOOO PAC_Time p a Ban a E imer DB PAC Month 4 R2 Set TRUE to p Set TIME_SET PAC Day E PAC WeekDay 1 PAC Hour 14 PAC Minute 16 PAC Second 41 new Year 0 new Wonth new Day new Hour new Minute newy time for the new Year O04 Year 2014 Se ad A Lack gt A Unlock 15 a7 0 E OOOOH MRORMEMO e advanced 7 4 23 16 Arithmetic Set TRUE to set DOOOOOOO OCOOO0O000 0 Arays set new time F Lg AS interface ae i w BACnet gt 4 Blocks Sovlist Define ENUbd 2 Set the Set_new_time variable to TRUE to write the new system time OOOO PAac_Time i E B J en Set TRUE to set n 7 Set_new time Inst_TIME_SET PAL _VWeekDay R2 Set TRUE to Set TIME_SET G PAC Hour m PAC Minute newy time for the PAC Second new ear 2015 peel new Year new Wonth new Month 1 A ilonth new Day new Hour new Minute new_Day 1 iis new Second set new time news Hour 12 Hour new Minute 30 4 Minute nev Second 354Second Set TRUE to set n R3 i ii
333. tivation i A EN pai pam please use mouse to right click the Periodic 1000 ms 15000 a 7 oO i ___ MODBUS Master and then select J On cal fon error On change l MODBUS Master Addresses to oe It s not suitable for Read commend change the value e Timeout 1000 ms 10 Drivers Ew rp MODBUS Master Nb trials b MODBUS Master addresses Eg d Activation the sending way of Modbus Request a cla Periodic Send request periodically In this case it pee sends request every 1 Sec on error Coil bits means that when an error occurs the next Input registers sending time in this case 15 seconds Holding registers On call It will send the request once when a program calls it On change It will send the request once when data is changed e Timeout Setup the max time to wait for the response If exceeds it that means an error For Modbus TCP UDP recommended 1000 3000 ms this example is 1000 ms Win GRAF User Manual V 1 01 Oct 2014 by ICP DAS 5 39 6 Open the Variables window set up the variables want to use Workspace IO Drivers Ep Test 2 E My MODBUS Master Name Value E aj LJ Exception programs g G p Open MODBUS 192 168 1 100 502 Request lt 4 gt Read Input Registers E I Programs 3 lt 4 gt Read Input Registers 1 7 4 Slave Unit 1 oe ak Main B Address 1 La Watch for debuggi GS Nb Item 4 t ie BB Soft Scope ir Tips Acti
334. to Z or a to z followed by any 1 number of letters numbers e g O to 9 or an underscore i e _ Data type Refer the Appendix A for the value range To specify the range of an array E g enter 10 means the use of the Counter 0 to 9 Double click this field item to set it to Read Olny that means users can only read this variable but cannot modify it If checked the variable name will also be downloaded into the PAC To set the initial value of the variable All the variables can be divided into some groups e g Group1 Group2 and it is convenient for users to look up or search these variables To enter a nickname for the variable To enter a simple note for the variable Win GRAF User Manual V 1 01 Oct 2014 by ICP DAS 2 7 AT x 2 3 GiveitaTry As mentioned before we have described the LD program Section 2 2 1 and variables Section 2 2 2 in the Demo01 project The following sections will show you how to declare variables and add an LD program with the blinking function in this project Note All the Win GRAF PAC does not support the ULINT and LWORD data type 2 3 1 Declaring the Win GRAF Project Variables First we will declare two boolean variables i e LED1 and LED2 that used in the program 1 In the Variables window mouse right click any item in the Name field and select Add Variable T tool button to add a variable
335. to add an I O link to correspond to the real I O module 1 Click the Open I Os tool button to add an I O link File Edit View Insert Project Tools Window Help Sib sl Glkeas xX 4 5 9 lige te 6 OE 30 ae a 2 Mouse double click on Slot 1 and then double click the i_8055 to select this I O board x ddl ICP DAS P P F Standard i x ch DT i 6060_D0 i 5060W 6 ch Relay outputs B05 5 8 Ch Digital Inputs 8 Ch Digital Outputs Now 01 2013 ICF DAS Tawan 3 Click the Close button to exit the I O Boards window Note Click the Virtual Real button to change to the Virtual I O for testing or the Real I O The Real I O is used in this example FREE 140 Boards 0 1 0 1 8055 Dl 1 18055 DO Co Virtual I O It shows in blue Properties VirtualReal 0 i 8055 Win GRAF User Manual V 1 01 Oct 2014 by ICP DAS 2 10 After linking the i_ 8055 I O board it will automatically add 8 input amp output variables in the Variables window Variables i ex Ti Type Dim Attrib Syb Initvalue User Group Tag Description a a a AFART BOOL Input L 9610 1 BOOL Input LI walis 0 2 BOOL Input L 4611 0 3 BOOL Input LI 2610 4 BOOL Input LI 6010 5 BOOL Input L 9601 0 6 BOOL Input L IX1 0 7 BOOL Input L MB 01 1 i 8055 DO J was 1i BOOL Output LI 461121 BOOL Output LI w112 BOOL Ou
336. to modify its name or data type then click Enter to complete the setting Refer the Section 2 3 1 for the details about variable declaration Note For the function block can work correctly the Inst TIME GET Time Get Inst_xxx FB instance variable will be automatically nef Me Ser wine ce added when using one function block For the safety fa Global variables reasons this FB instance variable will not be automatically PAC Year _ s deleted even if the function block has been removed in the PAC Month PAC Day editor area So users can right click the unwanted variable PAN aeey and select Clear to manually remove it PAC Hour PAC Minute E Time Get E PAC Second TRUD Get A 2 Inst TIME Ai Global LEDI a Seem gu S alc TIME a 7 j TIME Maths C Function Blocks Area In the Blocks tab it provides many types of the function block for users to drag and drop them to the editor area a Si Sy BACnet Ca oa A oS IN Booleans Gy GANbus CANopen Lg Clock Tips me OA TIME Get current day and time After selecting the function DTAT Pulse at a date time block press F1 key to open F DTCURDATE Get current date stamp PST CURDATETIME Get current date the HTML Help 4 Cocks Sowlist Define ENUM Win GRAF User Manual V 1 01 Oct 2014 by ICP DAS 2 6 2 2 2 Demo01 Variables In the workspace mouse double click the Var
337. tool icon A to connect the PAC and next download the current project to the PAC Refer the Section 2 3 5 for the detail steps After downloading the source code will be stored in the file of the directory Systen_Disk Win GRAF t5 upl of the PAC This file will be larger when the project increases If the project becomes very large and complex the file size may reach several hundreds K Bytes or even more than 1 MB Win GRAF User Manual V 1 01 Oct 2014 by ICP DAS 11 14 Upload the Porject Source Code Please close all opened Win GRAF windows Click on the menu bar File gt Close Project List 4 Click on the menu bar File gt Add Existing Project gt From Target then select the PAC s IP address and set up the upload file name e g UPL_project1 and then click OK to upload the file si View Tools Window Help Open Project List Add New Project Print Setup Sy From Zip 1 CA Wm GRAFProjects Test w51 om Targe 2 CAWin t Open project from target ve Select PAC IP Settings OK Pathnames Help Destination folder C win GRAF Projects Name UPL_project J me alse Set up the upload file name 5 After uploading click on OK button and then the Win GRAF will open the project automatically Open project from tarzet From 192 168 71 19 502 t5 upl To C DOCUME 1 WaniceSLOCALS 14T emp ZIP103 tmp 100 Win GRAF UPL project BX File Edit View Insert Project
338. tput O 4 ON1 1 3 BOOL Output O n 4601 14 BOOL Output O 46 0IM1 1 5 BOOL Output LI 96 C0K1 1 6 BOOL Output O ee BOOL Output O A we UII 1X1 0 i 8055 DI i QX1 1 i 8055 DO means Input Q means Output X means Boolean 1 means Slot 1 X means Boolean 1 means Slot 1 ID or QD D means Integer Real There are three output variables are used in this example and you can modify the name for easy use Mouse double click the item and fill in a name then press Enter key to finish the setting BW 0X11 i 8055 DO W a1 i 8055 DO AAN BANI Output 6CK1 1 040utputl BOOL Output Output Clutput Cc OM 1 14 Output ECOL Output WOM 12 BOOL Output 9 OM1 1 250utput3 BOOL Output 26 CK1 1 3 BOOL Output 26 CK1 1 3 BOOL Output Win GRAF User Manual V 1 01 Oct 2014 by ICP DAS 2 11 2 3 3 Creating an LD Program In the Demo01 project we want to create a LD1 program to show the blinking To begin follow these steps 1 In the workspace mouse right click the Programs folder and select Insert New Program Workspace PAC _Time E E DemoD1 i T i Programs Renae F2 a watch fo jg m n New Folder Faer Soft So nan New Drogram y nota E Initial valu horteuts a tia uele Insect New Item ow ag Global del 2 Fillin a program name in the Name field and enter a sim
339. trate Soft GRAF basic HMI object You may restore the demo_soft_graf01 zip to your Win GRAF workbench to get familiar with it Then download to the Win GRAF PAC If you have no idea how to restore the Win GRAF project Please refer the Section 13 1 15 1 1 Install the Soft GRAF Studio Please download the faq146_ demo zip from the IsaGARF FAQ146 web page http www icpdas com fag isagraf 146 htm Q Soff GRAF Studio Create a Colorful HMI in the AP 8xx CE6 8xx Atom CE6 amp WP 8xx amp VP 2xWi7 PAC Ver 1 11 Ans 1 Please refer to fagi46 pdf 2 Download Sof GRAF Studuio software demo programs and document About 25MB 3 View tutorial video of the Soff GRAF Studio Click here to download dd Written by Raven Liu Date 2011 12 30 After unzip the file please copy the Soft GRAF Studio folder into D Then it becomes D Soft GRAF Studio Win GRAF User Manual V 1 01 Oct 2014 by ICP DAS 15 1 15 1 2 Download the Soft GRAF HMI Project to the Win GRAF PAC Executes the Soft GRAF Studio exe from the D Soft GRAF Studio Then click the open project on the upper left screen Open the demo01 sof E 4 B PeARVTA OZ IF B Fi LY HAZI HASIE PEERS gee y Demo 1 sof v PARO BRAUT SoftGraf files sof v RH Click project gt IP Setting Setup the IP address of the Win GRAF PAC Password Dowload Click download to download HMI p
340. ttings 1 Connect i_scale in the I O Boards window and double click i_scale_x to open the Properties window refer the Section 10 1 for detail steps Note I O Boards supports ONLY ONE i_scale DO NOT connect 2 or more i_ scale EEE 170 Boards oo Ea Ee lect 3 4 Delete Ly 6 Fi 6 9 i scale Tisclei1 N O E Move Up 10 11 Move D Dwn 12 rr 14 Win GRAF User Manual V 1 01 Oct 2014 by ICP DAS 10 2 2 Set up the number and value of the Conversion Function e g use Function 2 to convert 0 to 20000 to O to 10 V 9 0 i scale Properties x Key 6 Ref 16 24 Ch0O2_X0O_Min_Physical_ Val is set as 0 0 ChO0 XO reserved 0 0 Ch00 1 reserved 0 0 ChOO YO reserved 0 0 ChOO 1_ reserved 0 0 ChO2_X1_ Max_Physical_ Val is set as 10 0 ChO2_ YO Engineering Val_For_X0O is set as 0 0 Ch01 X0 Min Physical _ al ChO2 Y1 Engineering Val For_X1 is set as 20000 0 Ch01_X1 Max Physical_ al ar _ 0 Engineering_ al_ or 2 awineerins 71 innn xi 0 I hysical azii Ch002 Xi Wax _Physical_Fal 10 0 ChO2_ YO Engineering Fal For_X0 0 0 ae Engineering Yal _For _X1 20000 0 Cho3 X1 Ma aS Yal 0 0 y 3 Edit an ST Program to convert an engineering value to a physical value e g Eng _V O0 to 7 Refer the Section 2 3 3 for detail setting steps ST1 i M x aN ii is declared as DINT Al Y Name Type Dim
341. ue Y Name Type sl Sd ATU COM2 9600 N 8 1 Request lt 2 gt Read Input Bits A Bool 01 Read Input Bits 1 1 16 Plave Unit 1 5 Bool_02 B addr Bool_03 Operation Storage Range Li Bool 04 A Bool_01 Data exchange Default Bool 05 F Bool_02 Data exchange FFFF Default Bool _06 7 Bool_03 Data exchange FFFF Default Boer Ti g5 Bool_04 Data exchange Default Bool 08 Bool_05 Data exchange Bool 09 q ee Data exchange Data exchange Data exchange Data exchange Data exchange Default FFFF Default FFFF Default FFFF Default FFFF Default FFFF Default FFFF Default FFFF Default FFFF Default Defa Bool_10 Bool_11 Bool 12 Bool 15 Bool_14 Bool 15 Bool 16 Status Bool 14 Data exchange Bool 15 Data exchange Bool 16 Data exchange Status 0 Data exchange lt The Offset must be O when o rivers selecting the Error report A col E Results Error report B E On going request 4 10 Drivers Wariat SUCCESS counter Fall Courter Build Retry counter Command one shot Command enable Reset counters You can also press F1 in this IO Drivers window to see details on Modbus Master Configuration o ooo The communication is OK PB Data Parity Error MODBUS function not supported Invalid gateway path Ta mooaussenertaiue 12o feae 6 seneris busy O aa 252
342. unication state is TRUE If OK returns TRUE Referring Chapter 12 click the menu bar File gt Add Existing Project gt From Zip to restore the demo project CD ROM Napdos Win GRAF demo project DEMO_D_87084 _FR zip in the shipping CD and see the program and descriptions Supposition Use PAC s COM2 to connect the I 87084W Addr 5 to measure 8 ch frequency Main TE R1 Al Al 2 If OK returns TRUE 2 Al 4 Al 5 Al 6 Al 7 Al 8 COM D_87084_CNT4 temote A Declare 8 DINT variables D_ 87084 CNTS remote frequency inputs of the D_87084_FREG remote 87084W DL_100T 485 temote DL h EEP_READ Read a val i Ms Xx j f Global variables A DINT DINT DINT DINT DINT DINT DINT DINT BOOL v w TF EEP WRITE write a va Y gt Blocks Sovlist Define ENUM Main variables Input Parameters Addr EN Data type BOOL TRUE enable it FALSE disable it Port Data type DINT COM port number can be 1 to 37 depends on PAC Must use a constant value cannot be a changed value Data type DINT The Net ID address of the module can be 1 to 255 Must use a constant value not a changed value Output Parameters OK Freq_0 Freq_7 Datatype DINT 8 Ch frequency value unit is Hz Win GRAF User Manual V 1 01 Oct 2014 by ICP DAS 8 9 Data type BOOL TRUE Communication is Ok FALSE Commun
343. variables No lt All BD Keep case of embedded symbols No Check multiple calls to FB instances No Check duplicated profiles No Enable forcing of initial values during debug No Gi Update extern POUs before build No NO Cancel Cancel aw password Set a password 3 Click on the menu bar Project gt Build All Projects to compile the program again and then download the current project to the PAC Refer the Section 2 3 5 for detail steps When the next time to click the On Line icon for connection it will require the password 7 amp GB 3g 5 Password Password If click On Line it need the password Win GRAF User Manual V 1 01 Oct 2014 by ICP DAS Bes 11 16 Note After enabling the password please remember your password or you will not connect the PAC The Only Solution 1 Connect the PAC with a USB mouse and screen 2 Inthe PAC execute the Win GRAF Driver and then click on End Driver button Refer the Section 11 2 Win GRAF WP 8000 WP 88x8 driver Version 1 01 Jun 06 2014 This product is licensed 3 Rename the file t5 cod in the directory System_Disk win graf e g t5 cod1 or delete it Then reboot the PAC RSD System Diskwin grat a License bin 5 Quicker cll a t5 cod aa tou Ain GRAF WP_S000 exe i Win_GRAF_ WP_8000 Ink Then it will become No application in the PAC Now you can connect and download the applicat
344. vation Periodic o SS Initial values F press F1 key to see the setting Period ms 1000 9 4 Binding Configuration method for MODBUS Master Period on error 15000 sen g Global defines a Timeout ms 1000 fa Variables E Number of trials 1 E Types B Description Double click to open Please follow the table to set up 4 WORD 16 bit variables refer Section 2 3 1 Variable Name Data Type Word_1 Word_4 WORD Used to read the Al data 16 bit Used to record the read write status DINT Refer the Appendix A to see the data types and range of the variables After setting up it is as the picture below Variables T Name Type Dim Attrib Syb Initvalue User Tag Description Status DINT 0 4 T Word_1 WORD Ol Word 2 WORD 3 Word 3 WORD LI Word 4 WORD a ES gt 10 Drivers Variables a 7 Inthe I O Drivers window drag the variables Word_1 Word_4 and Status from the Variables area to the Symbol area of the Data Block Notice This example shows Status is an Array variable When drag it to the Symbol area it will become Status O Status 4 please press Delete key to delete Status 1 4 IO Drivers fg 2 Mp MODBUS Master T Name L Type Dim z G a Open MODBUS 192 168 1 100 502 Request lt 4 gt Read Input Regis A DINT 0 4 wall H B lt 4 gt Read Input Registers 1 1 4 Slave Unit 1 a 5 WORD
345. wd into the PAC and runs it once to generate a unique password for that PAC Then downloads the project demo_my_ap into the same PAC and then can ship the PAC to the customer After that if someone copies the Win GRAF application in this PAC to another same type of PAC and the operation will fail because of the password validation failure There are two example projects demo_passwd zip and demo_my_ap zip in the shipment CD Napdos Win GRAF demo project please refer the Chapter 12 to restore the projects Execute File gt Add Existing Project gt From Zip and set up the IP address of the current PAC A Wm GRAF demo passwd SE File Edit View Insert Project Tools Window Help m Me ME ME EEEE i im a Ha WE ODEs GBA Workspace i AA E Cj demo_passwd z INIT is declareds as BOOL and has initial value TRUE 4 Mane JE H I Exception programs i gt mis Progra m operations in the first PAC cycle 5 t Global variables a if INIT then INIT BOOL INIT FALSE No more first cycle NO_0 DINT A Soft Scope NO 1 DINT E Initial values get the hardware serial number NO_2 DINT SI NewSpy PAC SN No_O No 1 No 2 No_ 3 No 4 No_5 No_6 No 7 al poli Afd Binding Configuration 2g Global defines t Please use your own algorithm to generate a password E Variables Area y Variables This example generate only one password You may chaw Types lt gt 4 gt Blocks Soviist Define E 4 gt Main
346. with smaller signal width Recommend O if there is no noise consideration or need a real time measurement The following setting is recommended Max Input Signal Hz Recommend Filter Value 2K 100 sk Win GRAF User Manual V 1 01 Oct 2014 by ICP DAS 4 14 Ch_Freq_Timeout The unit is 0 001 second ms the value can be 20 to 1800 Set as other value will use the default value 1800 If there is no signal wave input to the I 8084W in the Ch_Freq_Timeout interval the frequency value of the related channel will be assigned as 0 For example if set it as 100 ms and the input is 500 Hz that means one signal wave takes about 2 ms to happen the frequency is updated normally When the input frequency drop to 9 Hz that means one signal wave take about 111 ms to happen this 111 exceeds the setting 100 ms Freq_Timeout So the frequency value will be assigned as O because there is no signal wave coming in this 100 ms interval When setting as 20 ms the frequency value below 50 Hz is not detectable become 0 When setting as 100 ms the frequency value below 10 Hz is not detectable become 0 When setting as 1800 ms the frequency value of O Hz 1 Hz to 450 KHz is detectable Ch_Low_High_Auto recommend setting as 2 Auto O means a Low frequency mode 1 means a High frequency mode 2 means Auto switching between Low and High frequency mode Set as other value will use the default value 2 Auto Mode 2 w
347. wo IP addresses step 5 then the Error Status will return two communication status As the following table use 8 bits to indicate the connection status The bit O 3 represents the first IP connection status If all bits are 1 the value is 15 the bit 4 7 represents the second IP connection status If all bits are 1 the value is 240 As long as the value is not equal to O it means that there are connection errors ee rAEAENEA Connection OK a ee 0 1 15 IP1 Connection error 0 16 240 IP2 Connection error IP1 and IP2 Connection error b The return value of the Error_Status is an integer value The following division operation provides a way to determine this value Dividing this value by 16 the quotient represents the IP2 connection status and the remainder represents the IP1 connection status If the values are not equal to 0 it means that there is any connection error For example If Error Status 16 divided by 16 the quotient 1 0 IP2 Connection error and the remainder 0 IP1 Connection OK If Error Status 3 divided by 16 the quotient 0 IP2 Connection OK and the remainder 3 0 IP1 Connection opened when press F1 key That explanation is wrong and does not comply with the ICP DAS Win GRAF PAC Please ignore it Connection fails 2 aa Both connections fail error oee el e a l Notice i tabe eoe ee Nn Please ignore the descriptions of the Connect
348. xception program S a Programs ei Programs iY By FEDI a LOW st ST1 Unchecked Checked In execution order In alphanumeric order Change the execution order of programs Note If you want to change the execution order of programs mouse right click the project name e g Demo01 and click Cycle as the screenshot above to open the settings window then click the Move Up or Move Down button to change the order eae PAC Time 1 T aT ELET 0 st pShutDown 1 0 2 If using the Project way to create a new project in this example we use the From template way refer the Section 2 1 1 Step 2 click the Project gt Settings from the menu bar to open the Project settings window Click the General option and set the Complex variables in a separate segment to Yes to allow the using of complex data structures such as arrays Finally click OK to exit the window Win GRAF User Manual V 1 01 Oct 2014 by ICP DAS 2 3 Project Build 40 Projects Fi Clean AU Projects I Download All Projects EEFE ro LOU Lets Project settings Eg Cr in GRAF Projects Demat 1 Mame Value ff Communication parameters 192 168 255 1 502 Cycle time ag Code Generation Disabled Jfa Version WE 2014 02 25 12 17 EI Libraries Edit EI Use external objects Edit On Line Change Enables complex data such as arrays of structu
349. xecuting the On Line Change there are some using restrictions for protecting the system normal operation refer the Section 9 1 So make sure the program is correct then perform this function File Edit View Insert Project Tools Window Help Tee eee ee L8H 8 98 GB So 09 as j sees Main os X 5 AA Workspace D Test RUN i Name E Exception programs Inst_BLINK OUT1 TRUE 3 J Main i gt amp CI Programs Global variables on Main hd ale EI Watch for debugagin i T 2s ICYCLE OUT1 TRUE BCF BB Soft Scope Ik iT aj oo E Initial values E a All gy z ti Binding Configuration E Gay Used r 39 Global defines HI Ml a faa Projecti 7 B Gi Variables Be gt 4 gt Blocks Sovtist Define ENUM E Types 4 Variables Main 3 Build x l Build in progress Please wait me io error detected f Win GRAF User Manual V 1 01 Oct 2014 by ICP DAS 9 5 Chapter 10 Data Type Conversion and Using the PAC Time 10 1 Al Data Conversion If you are using Al modules in the PAC s Slot 0 to 7 for example I 8017HW and want to convert the Al input signal for example 4 to 20 mA or O to 10 V to the user engineering value for example O to 10000 refer the Section 4 3 However if you are using the remote Al modules e g through PAC s RS 485 Port to connect to the I 87017ZW or I 7017R module you can refer the following sett
350. y ICP DAS 16 9 16 3 3 Introduction of the demo_RDN_2 Demo Program LD Program PAC_Time It used to get set the system time of PAC FGetcretineTrEarrts ss set Set_new_time to TRUE to set new time to PAC Inst_TIME_GET Set new time Inst_TIME_SET st TIME _G R1 HE TIME_GET Year to set Year pear Month_toa_set Wonth Month1 Day to set Day Day Hour_to_ set vw Day ei VeekDay Minute to set Hour Hour1 Second to_set tinute Minute Reset Set_ne_time toFSLSE Set_nevy_time R3 R LD Program RDN_control When an error occurs on the Active PAC s LAN1 and if the Passive PAC is ready and its LAN1 is healthy then the Active PAC will wait for a short time to reboot and then the other PAC will take the control right Switch to Passive PAC if Passive is ready and ts LANT is ok however Active LAN1 communication has problem is Active LAN ok Inst_Tor iz_ Passive ready iz Passive LAN ok l TON Cl En PAC REBOOT G I T 1 0s 1 ET ST Program Retain_and_timer on_line_change_cycle is declared as DINT nonezero means it is in the cycle jsut after doing on line change retain_done is declared as BOOL and inited as FALSE tmp_bool is declared as BOOL on_line_change_ cycle GetSysInfo _SYSINFO_CHANGE_CYCLE if retain done FALSE or is_first_cycle_just_after_switch TRUE or on_line_change_cycle lt gt 0 then retai
351. y the connected sensor is not correct Win GRAF User Manual V 1 01 Oct 2014 by ICP DAS 8 7 8 2 3 D_ 7083 Function Block D_7083 Connect a remote l 7083 I 7083D I 7083B or 7083BD module that is a 3 axis 32 bits encoder counter Note 1 To get the Encoder value of the l 7083 I 7083D I 7083B and I 7083BD module first using D_ 7083 Function Block Then using the Counter_ Start Counter_Stop Counter_Get Counter_State and Counter_Reset Functions Refer Section 4 9 to operate encoder channels in an l 7083 7083D I 7083B and I 7083BD module All connected DCON I O modules should be configured once e g Address Baudrate etc by the DCON Utility see P8 1 Please must configure the data format of Al modules to 2 s complement by DCON utility or the Win GRAF PAC can not read them well Please use DCON Section 8 1 in the I O boards window and set proper settings Port baud_rate etc on it All values of Al channels are meaningful only when the returned communication state is TRUE If OK returns TRUE Referring Chapter 12 click the menu bar File gt Add Existing Project gt From Zip to restore the demo project CD ROM Napdos Win GRAF demo project DEMO_D_7083 zip in the shipping CD and see the program and descriptions Supposition Use PAC s COM2 to connect the l 7083 Addr 4 with 3 DI channels SOSA F Name Type Dim

Download Pdf Manuals

image

Related Search

Related Contents

Istruzioni per l`uso  UNE SITUATION-PROBLEME EN GEOLOGIE : UN DÉTOUR  Installation Manual 07/18/2007  SIAM AST Administration Console Manual  Greenway Home Products VWD9956BLS User's Manual  dvr hm-l 4/8/16 canais manual do usuário    VXI 320222-01 Network Card User Manual  IR DOME CAMERA USER MANUAL  Fernsteueranlage Razor 2Z Telecontrol System Razor 2Z  

Copyright © All rights reserved.
Failed to retrieve file