Home

User`s Manual of ISaGRAF Embedded Controllers

image

Contents

1. B Q Set a Boolean variable as Redundant synchrous data Set a REAL variable as Redundant synchrous data Set an Integer variable as Redundant synchrous data Set a Timer variable as Redundant synchrous data 1 The ISaGRAF program for redundant Master amp Slave controllers are the same 2 All 7K amp 1 87K function blocks shold be located on the top of the ISaGRAF project Please refer to Example program Wdmo_ 18 3 Befor using RDN_B RDN_N RDN_F amp RDN_T functions please make sure the below IO complex equipment is well connected in the ISaGRAF IO connection window rdn set this controller as Redundant controller OS Ores RDN_B RDN_N RDN_F amp RDN_T must be called only in the 1st PLC scan RDN_B Set a Boolean variable to be a Redundant data RDN_N Set an Integer variable to be a Redundant data RDN_F Set a REAL variable to be a Redundant data RDN_T Set a Timer variable to be a Redundant data Max number of synchronous bytes is 6000 Boolean 1 byte Interger amp Real amp Timer is 4 byte sum of RDN_B RDN_N RDN_F RDN_T 10 Please refer to Chapter 20 for more information Example Wdmo_18 located at 1 W 8x37 8x36 8x47 8x46 CD ROM napdos isagraf wincon demo 2 ftp icpdas com tw pub cd winconcd napdos isagraf wincon demo User s Manual Of ISaGRAF Embedded Controllers Mar 2006 Rev 5 0 Copyright By ICP DAS Appendix 58 REAL_INT Real Int m 8417 8817 m 1 8437 8837 m I 7188EG m
2. The flow is broken each time an item action decision is encountered that has already been reached in the same cycle In such a case the flow will continue on the next cycle Note Contrary to SFC an action is not a stable state There is no repetition of instructions while the action symbol is highlighted E 4 4 FC checking Apart of attached ST LD or IL programming some other syntactic rules apply to flow chart itself Below is the list of main rules All connection points of all symbols must be wired connection to End symbol may be omitted All symbols must be linked together no isolated part should appear All connectors should have valid destination Other minor syntax errors can be reported Empty actions no programming are considered as steps during run time scheduling Empty tests no programming are considered as always true User s Manual Of ISaGRAF Embedded Controllers Mar 2006 Rev 5 0 Copyright by ICP DAS Appendix 140 E 5 FBD language The Functional Block Diagram FBD is a graphic language It allows the programmer to build complex procedures by taking existing functions from the ISaGRAF library and wiring them together in the graphic diagram area E 5 1 FBD diagram main format FBD diagram describes a function between input variables and output variables A function is described as a set of elementary function blocks Input and output variables are connected to blocks by connection
3. Example See GFREEZE function described above GSTATUS statement Name GSTATUS Meaning returns the current status of an SFC program Syntax lt ana_var gt GSTATUS lt child_program gt Operands the specified SFC program must be a child of the one in which the statement is written Return value 0 program is inactive killed 1 program is active started 2 program is frozen Note GSTATUS is not in the IEC 1131 3 norm User s Manual Of ISaGRAF Embedded Controllers Mar 2006 Rev 5 0 Copyright by ICP DAS Appendix 169 Example 1 tl Run_cmd 1 2 _JACTION P 201 JACTION N GSTART Schild if GSTATUS Schild O then END_ACTION Mstat Stopped else Mstat Running NOT Run_cmd end_if 2 END_ACTION 3 HACTIONP GKILL Schild END_ACTION Run cmd 3 i V 2 User s Manual Of ISaGRAF Embedded Controllers Mar 2006 Rev 5 0 Copyright by ICP DAS Appendix 170 E 8 IL language Instruction List or IL is a low level language Instructions always relate to the current result or IL register The operator indicates the operation that must be made between the current value and the operand The result of the operation is stored again in the current result E 8 1 IL main syntax An IL program is a list of instructions Each instruction must begin on a new line and must contain an o
4. ST Equivalence output1 input1 AND NOT input2 AND input2prev input2prev is the value of input2 at the previous cycle Direct coil Direct coils enable a boolean output of a connection line boolean state boo_variable PES Left connection ae Right connection The associated variable is assigned with the boolean state of the left connection The state of the left connection is propagated into the right connection The right connection may be connected to the right vertical power rail The associated boolean variable must be OUTPUT or INTERNAL The associated name can be the name of the program for sub programs only This corresponds to the assignment of the return value of the sub program Example using DIRECT coils input tput1 input ou tpu S output2 O ST Equivalence output1 input1 output2 input1 Inverted coil Inverted coils enable a boolean output according to the boolean negation of a connection line state User s Manual Of ISaGRAF Embedded Controllers Mar 2006 Rev 5 0 Copyright by ICP DAS Appendix 149 boo_variable E A Right connection Left connection The associated variable is assigned with the boolean negation of the state of the left connection The state of the left connection is propagated into the right connection Right connection may be connected to the right vertical power rail The associated boolean variable must be OUTPUT or
5. ST program using WHILE statement this program uses specific C functions to read characters on a serial port string empty string nbchar 0 WHILE nbchar lt 16 amp ComlsReady DO string string ComGetChar nbchar nbchar 1 END_WHILE REPEAT statement Name REPEAT UNTIL END _ REPEAT User s Manual Of ISaGRAF Embedded Controllers Mar 2006 Rev 5 0 Copyright by ICP DAS Appendix 163 Meaning iteration structure for a group of ST statements the continue condition is evaluated AFTER any iteration Syntax REPEAT lt statement gt lt statement gt UNTIL lt boolean_condition gt END_REPEAT Warning Because ISaGRAF is a synchronous system input variables are not refreshed during REPEAT iterations The change of state of an input variable cannot be used to describe the ending condition of a REPEAT statement Example ST program using REPEAT statement this program uses specific C functions to read characters on a serial port string empty string nbchar 0 IF ComlsReady THEN REPEAT string string ComGetChar nbchar nbchar 1 UNTIL nbchar gt 16 OR NOT ComlsReady END REPEAT END_IF FOR statement Name FOR TO BY DO END _FOR Meaning executes a limited number of iterations using an integer analog index variable Syntax FOR lt index gt lt mini gt TO lt maxi gt
6. m 8417 8817 m1 8437 8837 m l 7188EG m 1 7188XG m W 8XX7 W 8XX6 Description Function Display a string on MMICON Arguments X_ integer Y integer LEN_ integer STR_ message PASSWD_ boolean Q_ boolean Demo X position 1 30 Y position 1 8 Max number of characters to display 1 240 The string to display If the number of characters exceeds LEN_ only the first LEN_ of char will be displayed TRUE display as password all char are replaced as FALSE displayed as string Ok return TRUE else return FALSE Please refer to Chapter 16 amp demo_38 demo_ 39 User s Manual Of ISaGRAF Embedded Controllers Mar 2006 Rev 5 0 Copyright By ICP DAS Appendix 55 MSGARY_R msgary_r 1 8417 8817 o 1 8437 8837 no 1 7188EG o l 7188XG m W 8XX7 W 8XX6 Description Function Read a string from message array Arguments ADDR_ integer which address 1 1024 Msg_ message the string returned Len is between 0 to 255 Example Please refer to Chapter 11 Wincon 8xx7 s demo wdemo_06 MSGARY_W 1 8417 8817 no l 8437 8837 01 7188EG 01 7188XG m W 8XX7 W 8XX6 Description Function Write a string to message array Arguments ADDR_ integer which address 1 1024 Msg_ message the string to write Len is between 0 to 255 Q_ boolean True Ok False Fail Example Please refer to Chapter 11 Wincon 8xx7 s demo wdemo_06
7. result OR NOT 1X12 The parenthesis modifier indicates that the evaluation of the instruction must be delayed until the closing parenthesis operator is encountered User s Manual Of ISaGRAF Embedded Controllers Mar 2006 Rev 5 0 Copyright by ICP DAS Appendix 171 The C modifier indicates that the attached instruction must be executed only if the current result has the boolean value TRUE different than O for non boolean values The C modifier can be combined with the N modifier to indicate that the instruction must be executed only if the current result has the boolean value FALSE or 0 for non boolean values Delayed operations Because there is only one IL register current result some operations may have to be delayed so that the execution order or the instructions can be changed Parentheses are used to indicate delayed operations is a modifier indicates the operation to be delayed Y isan executes the delayed operator operation The opening parenthesis modifier indicates that the evaluation of the instruction must be delayed until the closing parenthesis operator is encountered For example following sequence AND 1X12 OR 1X35 is interpreted as result result AND 1X12 OR IX35 E 8 2 IL operators The following table summarizes the standard operators of the IL language tor Variable constant Loads operand Stores current result S R NES BOO variable Sets to TRUE
8. 7188EG by a RS232 cable 5 Power off the I 8417 8817 8437 8837 or 7188EG connect pin INIT to INIT COM then power it up 6 If the connection is Ok messages will appear on the 7188x screen 8000 gt 7 Type isa f 1 to free COM1 set COM1 as none Modbus Slave port For 7188EG type isa7188e f 1 8000 gt isa f 1 8 Press ALT_X to exit 7188x or COM1 COM2 of the PC will be occupied 9 Remove the connection between INIT INIT COM recycle the power of the controller Important Note If user wants COM1 to be back to a Modbus RTU Slave port again follow the same step 1 to 6 amp then type isa f 0 as below For 7188EG type isa7188e f 0 8000 gt isa f 0 User s Manual Of ISaGRAF Embedded Controllers Mar 2006 Rev 5 0 Copyright By ICP DAS Appendix 98 Appendix D Table of The Analog IO Value 1 87013 1 7013 1 7033 eal 32767 32768 l 2 s complement HEX a o00385 PecimalValue 32767 o e o00385 PecimalValue 32767 o Platinum 100 2 000385 Decimal Vale 32767 o Input Range Celsius 100 0 1100 0 ie 32767 32768 l 2 s complement HEX ei 100 Decimal Vaue kazzer bo Pana ooste PecimalValue 82767 0 0003016 Decimal Vae 32767 bo ickel 120 100 0 00 ickel 120 Decimal Value 32767 o Input Range Celsius 600 0 2000 ss 32767 10922 2 s complement HEX User s Manual Of ISaGRAF Embedded Controllers Mar 2006 Rev 5 0 Copyright By ICP DA
9. Achild of a program cannot have more than one father Achild program can be called only by its father A program cannot call the children of one of its own children The same sub program may appear several times in the father chart A Flow Chart sub program call represents the complete execution of the sub chart The father chart execution is suspended during the child chart is performed The sub program calling blocks must follow the same connection rules as the ones defined for action FC I O specific action An I O specific action symbol represents actions to be performed As other actions an I O specific action is identified by a number and a name The same semantic is used on standard actions and I O specific actions The aim of I O specific actions is only to make the chart more readable and to give focus on non portable parts of the chart Using I O specific actions is an optional feature Below is the drawing of an I O specific action symbol nn Name I O specific blocks have exactly the same behaviour as standard actions This covers their properties ST LD or IL programming and connection rules FC connectors Connectors are used to represent a link between two points of the diagram without drawing it A connector is represented as a circle and is connected to the source of the flow The drawing of the connector is completed on the appropriate side depending on the direction of the data flow by the identification of
10. User s Manual Of ISaGRAF Embedded Controllers Mar 2006 Rev 5 0 Copyright By ICP DAS Appendix 56 PID_AL m 83417 8817 m 1 8437 8837 m1 7188EG m1 7188XG m W 8XX7 W 8XX6 Example Please refer to Chapter 11 Demo_18 and ICP DAS CD ROM Napdos ISaGRAF 8000 English_Manu PID_AL Complex PID algorithm implementation htm PWM_DIS m 8417 8817 m1 8437 8837 m I 7188EG m1 7188XG m W 8XX7 W 8XX6 Description Function Disable PWM output PWM_EN m 8417 8817 m1 8437 8837 m I 7188EG m1 7188XG m W 8XX7 W 8XX6 Description Function Enable PWM output PWM_EN2 Description Function Enable PWM output to output some pulse Please refer to Section 3 7 PWM_ON Description Function Set parallel D O to TRUE immediatelly PWM_OFF Description Function Set parallel D O to FALSE immediatelly PWM_SET Description Function Dynamically change the ON_ OFF_ 8 NUM_ setting PWM_STS Description Function Get PWM status PWM_STS2 Description Function Get the pulse number which has been output by pwm_en2 or pwm_en Please refer to Section 3 7 User s Manual Of ISaGRAF Embedded Controllers Mar 2006 Rev 5 0 Copyright By ICP DAS Appendix 57 RDN_B Description Function RDN_F Description Function RDN_N Description Function RDN_T Description Function Notes rdn_b 8417 8817 8437 8837 o l 7188EG 01 7188XG m W 8XX7 W 8XX6
11. refer to Appendix C 1 If Target is W 8xx7 please make sure its COM2 amp COM3 is not Modbus RTU port before using them Please refer to W 8xx7 s Getting Started Manual For 8xx7 ComPort No on slot 0 Com5 Com8 ComPort No on slot 1 Com9 Com12 ComPort No on slot 2 Com13 Com16 ComPort No on slot 3 Com17 Com20 ComPort No on slot 4 7 is not available Example SW1 and TMP are declared as boolean variables VAL as integer variable To test this example given VAL a value 0 255 then turns SW1 to TRUF Action F Write VAL to COM4 TMP COMWRITE 4 VAL End_action User s Manual Of ISaGRAF Embedded Controllers Mar 2006 Rev 5 0 Copyright By ICP DAS Appendix 26 CRC_16 m 8417 8817 m1 8437 8837 m l 7188EG m l 7188XG m W 8XX7 W 8XX6 Description Function Block Calculate checksum CRC 16 Argument NUM_ integer byte array ID to be operated Valid range for l 8xx7 amp l 7188EG XG is 1 to 24 for W 8xx7 is 1 to 48 ADR_ integer starting address in the array which is to be calculated SIZE_ integer the number of bytes to be calculated CR_H_ integer the returned high byte of the CRC 16 after calculation CR_L_ integer the returned low byte of the CRC 16 after calculation Example TMP is declared as a boolean ii CR_H_ and CR_L_ as integers CRC16_1 is declared as FB instance of type CRC_16 TMP ARRAY _W 5 5 1643 Save 4 hexadecimal values of 41 42 to 6 of
12. 1 12 for I 8xx7 8 I 7188EG XG 1 36 for W 8xx7 which is to write NUM_ integer the number of short integers starting from the POS_ address in the array to write POS_ Integer start position inside the array to write 1 256 if POS_ NUM_ gt 257 only 257 POS_ integer will be written for ex if POS_ 255 NUM_ 3 only 2 integers written They are Pos 255 amp Pos 256 Q_ boolean OK return TRUE Note If using I 8xx7 8 7188EG s COM1 please set COM1 as non Modbus RTU port in advance before it can work refer to Appendix C 1 If Target is W 8xx7 please make sure its COM2 amp COM3 is not Modbus RTU port before using them Please refer to W 8xx7 s Getting Started Manual For l 8xx7 ComPort No on slot 0 Com5 Com8 ComPort No on slot 1 Com9 Com12 ComPort No on slot 2 Com13 Com16 ComPort No on slot 3 Com17 Com20 ComPort No on slot 4 7 is not available The long int array use the same memory as short interger array Be careful if use both of them at the same time User s Manual Of ISaGRAF Embedded Controllers Mar 2006 Rev 5 0 Copyright By ICP DAS Appendix 19 COMCLEAR comclear m 8417 8817 m1 8437 8837 m1 7188EG m1 7188XG m W 8XX7 W 8XX6 PORT a Description Function Clear receiving buffer of a COM PORT Argument PORT_ integer l 8xx7 1 3 20 l 7188EG 1 8 l 7188XG 2 8 W 8xx7 2 3 or Q_ boolean OK return TRUE COMCLOSE comclose m 8417 8817 m1 8437 8837 m1 7188EG m1 7188XG m W 8XX7
13. 12 255 6 256 12 256 2 The datas stored in array are cleared after power off Example Refer to the ARRAY_R example User s Manual Of ISaGRAF Embedded Controllers Mar 2006 Rev 5 0 Copyright By ICP DAS Appendix 15 BCD_V BCD Y m 8417 8817 m I 8437 8837 m1 7188EG m I 7188XG m W 8XX7 W 8XX6 IN Q Description Function Convert BCD value to decimal value Arguments IN_ integer the BCD value to be converted Q_ integer the returned value For ex 16 12345 gt 12345 16 3490 gt 3490 18 gt 12 BIN2ENG bin2eng m 8417 8817 m1 8437 8837 m1 7188EG m1 7188XG m W 8XX7 W 8XX6 Description Function Transfer 2 s complement value to Engineering format value Arguments IN_ integer 2 s complement value to be converted HI_2s_ integer upper limit of 2 s complement 32768 to 32767 LO_2s_ integer lower limit of 2 s complement 32768 to 32767 HI_EN_ integer upper limit of engineering format 32768 to 32767 LO_EN_ integer lower limit of engineering format 32768 to 32767 OUT_ integer the returned engineering format value for ex HI_2s_ 32767 LO_2s 32768 HI EN 1000 LO_EN_ 1000 IN 16383 gt OUT_ 500 IN_ 12345 gt OUT 377 BIT_WD m 8417 8817 m 8437 8837 m1 7188EG m l 7188XG m W 8XX7 W 8XX6 Description Function Convert 16 boolean values to a word value Arguments B1_ B16_ boolean the 16 boolean values to be converted VAL_ integer the word value after the conversion For ex If B1_
14. 32768 8000 O 0000 gt 32768 0000 8000 100 0064 4103 1007 gt 268 894 308 1007 0064 User s Manual Of ISaGRAF Embedded Controllers Mar 2006 Rev 5 0 Copyright By ICP DAS Appendix 92 W_MB_Adr m 8417 8817 m1 8437 8837 m1 7188EG m 1 7188XG m W 8XX7 W 8XX6 Description Function write boolean or integer variable by using its Network address No Arguments TYPE_ Integer 0 boolean variable 1 integer variable ADR_ Integer write to which Network address 8xx7 8 I 7188EG XG 1 to 4095 W 8xx7 1 to 8191 DATA_ Integer the integer or boolean 0 False 1 True to be written return Q_ boolean TRUE means Ok FALSE means fail W_MB_Rel m 8417 8817 m1 8437 8837 m 7188EG m l 7188XG m W 8XX7 W 8XX6 Description Function write REAL variable by using its Network address No Arguments ADR_ Integer write to which Network address l 8xx7 amp l 7188EG XG 1 to 4095 W 8xx7 1 to 8191 DATA_ Real the Real value to be written return Q_ boolean TRUE means Ok FALSE means fail Note Please refer to Section 11 3 5 for a demo description 1 Please use W_MB_REL function to write REAL variable Please also refer to R_MB_Adr 8 R_MB Rel 2 If no variable defined with the given modbus address no write action 3 If TYPE_ is given as integer however the related variable is Real typed the related 32 bit is written It is better to use W_MB_ REL to write Real variable 4 If TYPE_ is given as in
15. 4 RETURN gt input1 input2 result ey input3 ST Equivalence If Not manual_mode Then RETURN End_ if result input1 OR input3 AND input2 E 6 5 Jumps and labels Labels conditional and unconditional JUMPS symbols can be used to control the execution of the diagram No connection can be put on the right of the label and jump symbol The following notations are used gt gt LAB jump to label named LAB LAB definition of the label named LAB If the connection on the left of the jump symbol has the TRUE boolean state the program execution is driven after the label symbol Example using JUMP and LABEL symbols manual_mode OTHER input result O END OTHER input2 result CA Z END User s Manual Of ISaGRAF Embedded Controllers Mar 2006 Rev 5 0 Copyright by ICP DAS Appendix 153 IL Equivalence Idn manual_mode jmpc_ other Id input st result jmp END OTHER ld input2 st result END end of program E 6 6 Blocks in LD Using the Quick LD editor you connect function boxes to boolean lines A function can actually be an operator a function block or a function As all blocks do not have always a boolean input and or a boolean output inserting blocks in an LD diagram leads to the addition of new parameters EN ENO to the block interface The EN ENO parameters are not added if you use the FBD LD editor as you can co
16. BOO variable Resets to FALSE N m i BOO boolean AND BOO boolean OR BOO exclusive OR variable constant Addition variable constant Subtraction variable constant Multiplication variable constant Division rs BOO boolean AND e N N N N N N User s Manual Of ISaGRAF Embedded Controllers Mar 2006 Rev 5 0 Copyright by ICP DAS Appendix 172 variable constant variable constant variable constant variable constant variable constant variable constant Function block Calls a function block instance name Jumps to label Label Returns from sub program Executes delayed operation In the next section only operators which are specific to the IL language are described other standard operators can be found in the section standard operators function blocks and functions LD operator Operation loads a value in the current result Allowed modifiers N Operand constant expression internal input or output variable Example EXAMPLES OF LD OPERATIONS LDex LD false result FALSE boolean constant LD true result TRUE boolean constant LD 123 result integer constant LD 123 1 result real constant LD t 3ms result time constant LD boo_var1 result boolean variable LD ana_var1 LD tmr_var1 LDN boo var2 ST operator Operation stores the current result in a variable the current result is not modified by th
17. Rev 5 0 Copyright By ICP DAS Appendix 45 LONG_WD m 8417 8817 m1 8437 8837 m1 7188EG m I 7188XG m W 8XX7 W 8XX6 Description Function block Convert one integer to two words Arguments LONG_ integer the 32 bit integer to be converted LO_ integer the low word value after the conversion from 32768 to 32767 HI_ integer the high word value after conversion from 32768 to 32767 MBUS_B_R mbus_b r m 8417 8817 m1 8437 8837 m1 7188EG m l 7188XG m W 8XX7 W 8XX6 Q Description Bi_ Function block Read 8 bits booleans from the Mdobus device B2 Use Modbus function code 1 Arguments B3_ SLAVE_ integer slave No of the Modbus device valid range from 0 B4_ to 255 should be constant value not variable B5 ADDR_ integer the starting Modbus address to read 0 65535 a should be constant value not variable B6_ boolean Ok return TRUE else return FALSE ISLAVE B7_ B1_ B8_ boolean the 8 boolean values that have been read JADDR__ B8 Note The total number of MBUS_B_R that can be used in one ISaGRAF project is up to I 8xx7 8 1 7188EG XG 64 W 8xx7 256 MBUS_BR1 m 8417 8817 m 1 8437 8837 m 7188EG m 1 7188XG m W 8XX7 W 8XX6 Description Function block Read 8 bits booleans from the Mdobus device with period time Use Modbus function code 1 Arguments SLAVE_ integer slave No of the Modbus device valid range from 0 to 255 should be constant value not variable ADDR_ integer the starting Modbus address t
18. The hierarchy of programs is divided into four main sections or groups Begin programs executed at the beginning of each target cycle Sequential programs following SFC or FC dynamic rules End programs executed at the end of each target cycle Functions set of non dedicated sub programs Programs of the Begin or End sections describe cyclic operations and are not time dependent Programs of the Sequential section describe sequential operations where the time variable explicitly synchronises basic operations Main programs of the Begin section are systematically executed at the beginning of each run time cycle Main programs of the End section are systematically executed at the end of each run time cycle Main programs of the Sequential section are executed according to either the SFC or the FC dynamic rules Programs of the Functions section are sub programs that can be called by any other program in the project A program of the Function section can call another program of this section User s Manual Of ISaGRAF Embedded Controllers Mar 2006 Rev 5 0 Copyright by ICP DAS Appendix 108 Main and child programs of the sequential section must be described with SFC or FC language Programs of cyclic sections begin and end cannot be described with SFC or FC language Any program of any section may own one or more sub programs Any program of the sequential section may own one or more SFC or FC child programs according to its
19. User s Manual Of ISaGRAF Embedded Controllers Mar 2006 Rev 5 0 Copyright By ICP DAS Appendix 60 Retain_T retain t m 8417 8817 m 1 8437 8837 m I 7188EG m Il 7188XG m W 8XX7 W 8XX6 Description Function Seta Timer variable to be as retained variable Arguments T_ Timer T_ should be a Timer variable name not a constant value ADR__ Integer Set retained address for this Integer variable I 8xx7 8 1 7188EG XG 1 to 256 W 8xx7 1 to 1024 return Q_ Boolean Ok return True Error return False retain_x Retain_X m 8417 8817 m1 8437 8837 m 7188EG m l 7188XG m W 8XX7 W 8XX6 Description Function Set a variable to be as retained variable by using its Network address No Arguments X_ Message B boolean N Integer F Real T Timer NetW_ Integer Network address No for the related variable I 8xx7 amp 1 7188EG XG 1 to 4095 W 8xx7 1 to 8191 ADR__ Integer Set retained address for this Integer variable I 8xx7 amp 1 7188EG XG 1 to 1024 W 8xx7 1 to 4096 return Q Boolean Ok return True Error return False Note 1 Befor using Retain_X Retain_N Retain_B Retain_F amp Retain_T functions please make sure the below IO complex equipment is well connected in the ISaGRAF IO connection window Il 7188EG XG X607_608 1 8417 8817 8437 8837 amp W 8XX7 W 8XX6 S256 _ 512 2 Please refer to Chapter 10 for detail information User s Manual Of ISaGRAF Embedded Controllers Mar 200
20. User s Manual Of ISaGRAF Embedded Controllers Mar 2006 Rev 5 0 Copyright By ICP DAS Appendix 75 S MV m 8417 8817 m1 8437 8837 m I 7188EG mg 7188XG Description Function Move some bytes inside the volatile SRAM Arguments ADR1_ Integer destination start position 256 1 249856 1 16 3D000 S512 1 512000 1 16 7D000 X607 1 118784 1 16 1D000 X608 1 512000 1 16 7D000 W 8XX7 W 8XX6 NUM_ Integer how many bytes to move 0 512 000 ADR2_ Integer Move from which starting position return Q boolean Ok TRUE Fail FALSE User s Manual Of ISaGRAF Embedded Controllers Mar 2006 Rev 5 0 Copyright By ICP DAS Appendix 76 SNR S_N_R m 8417 8817 m 1 8437 8837 m1 7188EG m1 7188XG o W 8XX7 W 8XX6 Japp N Description Function Read one integer from the volatile SRAM Arguments ADR_ Integer read which address one Integer occupy 4 bytes S256 1 249 856 1 16 3D000 512 1 512 000 1 16 7D000 X607 1 118 784 1 16 1D000 X608 1 512 000 1 16 7D000 return N_ Integer The integer value been read 32 bit signed The integer written in the SRAM is Lowest byte 2nd byte 3rd byte High byte for ex a integer of 16 01020304 it will be saved in the SRAM as 04 03 02 01 S NW m 8417 8817 m 1 8437 8837 m I 7188EG m I 7188XG o W 8XX7 W 8XX6 Description Function Write up to 4 integers to the volatile SRAM Arguments ADR_ Inte
21. is to declare a global boolean variable in the dictionary which will represent the step activity to be tested for example ref_step_X Then you insert in the step the variable with the N qualifier ref_step X N Then in the program which wants to test the activity of the step you use the variable Prog program the other program which needs step activity of Prog program 1 2 tref_step_ X N ref_step_X GS2 prog X 1 TSTART statement Name TSTART Meaning starts the counting of a timer variable timer value is not modified by the TSTART command i e the counting starts from the current value of the timer Syntax TSTART lt timer_variable gt Operands any inactive timer variable Return value none User s Manual Of ISaGRAF Embedded Controllers Mar 2006 Rev 5 0 Copyright by ICP DAS Appendix 166 Example SFC program using TSTART and TSTOP statements 10 _ ACTION P bo100 TRUE boolean output tm_ctrl t 0s TSTART tm_ctrl END_ACTION F bi100 OR tm_ctrl gt time_out 11 H ACTION P TSTOP tm_ctrl alarm not bi100 END_ACTION Time diagram if bi100 is always FALSE GS10 X GS11 X timeout tm ctrl 0 The timer keeps the same value during one cycle TSTOP statement Name TSTOP Meaning stops updating a timer variable timer value is no
22. 4 Action P Instruction List IL programming may be directly entered in an SFC action block based on the following syntax ACTION P or N info IL lt instruction gt lt instruction gt endinfo END_ACTION The special info IL and endinfo keywords must be entered exactly this way and are case sensitive Space or tab characters cannot be inserted into after or before the keywords Below is an example of an IL program in an action block SFC program with an IL sequence in an action block User s Manual Of ISaGRAF Embedded Controllers Mar 2006 Rev 5 0 Copyright by ICP DAS Appendix 131 4 Action P info IL LD False ST Led1 ST Led2 endinfo End_action E 3 6 Conditions attached to transitions At each transition a boolean expression is attached that conditions the clearing of the transition The condition is usually expressed with ST language or using the LD language Quick LD editor This is the Level 2 of the transition Other structures may however be used ST language convention LD language convention IL language convention Calling function from a transition Warning When no expression is attached to the transition the default condition is TRUE E 3 6 1 ST convention The Structured Text ST language can be used to describe the condition attached to a transition The complete expression must have boolean type and must b
23. 44 5 5 9 25 P 45 6 6 A 26 O 46 7 7 b 27 r 47 8 8 C 28 n 48 9 9 d 29 y 49 A 10 E 30 h 50 b 11 F 31 L 51 C 12 32 U 52 d 13 33 P 53 E 14 34 O 54 F 15 _ 35 55 0 16 H 36 gt 56 1 17 h 37 57 2 18 H 38 r Others 3 19 39 User s Manual Of ISaGRAF Embedded Controllers Mar 2006 Rev 5 0 Copyright By ICP DAS Appendix 10 Appendix A 4 Function Blocks For The Controller The following function blocks have been developed specifically for the I 8xx7 7188EG XG amp W 8xx7 controller system A4 20 to m 8417 8817 m1 8437 8837 m I 7188EG m1 7188XG m W 8XX7 W 8XX6 Description Function Convert Analog Input from 4 20 mA to User s Engineering Value Real format Arguments Analn_ Integer the integer variable related to the Analog input board or module The variable value is usally from 32768 to 32767 depends on the range setting of the lO board Range_ Integer Range setting of the Analog input board or module 1646 20 to 20 mA 16 D 20 to 20 mA HiVal_ Real User s related High Eng value when analog input signal is 20 mA LoVal_ Real User s related Low Eng value when analog input signal is 4 mA For example Convert l 8017H s input signal from 4 20 mA to become 0 100 psi please set HiVal_ 100 0 LoVal_ 0 0 and Range_ 16 6 depeneds on range setting of the related IO board return Q_ Real The Engineering value after conversion if given incorrect Range _ returns
24. 7D000 1 16 1D000 1 16 7D000 PN NUM_ Integer how many words to write O 4 N1_ N4_ Integer the word value 32768 32767 to write The word written in the SRAM is Low byte High byte for ex a integer of 1640102 it will be saved in the SRAM as 02 01 return Q Boolean Ok TRUE Fail FALSE User s Manual Of ISaGRAF Embedded Controllers Mar 2006 Rev 5 0 Copyright By ICP DAS Appendix 79 STR_REAL m 8417 8817 m 1 8437 8837 m1 7188EG mI 7188XG m W 8XX7 W 8XX6 str_real STR REAL Description Function Convert a string to Real value Arguments STR_ message Forex 123 456 0 2345 2 13E10 15 2345E 2 REAL _ real The real value retured If REAL_is 1 23E 20 it means STR_isa wrong setting For ex if STR_ 123 AB or 23 45 17 or 1 2 345 REAL_ will return 1 23E 20 Note REAL_STR can be used to convert real value to a string User s Manual Of ISaGRAF Embedded Controllers Mar 2006 Rev 5 0 Copyright By ICP DAS Appendix 80 SYSDAT_R m 8417 8817 m1 8437 8837 m1 7188EG m1 7188XG m W 8XX7 W 8XX6 Description Function block Read system year month day and date Arguments YY_ Integer Year Returned Example 2002 2003 2010 Etc MM_ Integer Month Returned 1 Jan 3 March 10 October Etc DD_ Integer Day Returned Valid Range From 1 To 31 WW_ Integer Date Returned 1 Monday 4 Thursday 7 Sunday Etc Example refer to demo_03 Y1 M1 D1 and W1
25. BY lt step gt DO lt statement gt lt statement gt END_FOR Operands index internal analog variable increased at any loop mini initial value for index before first loop maxi maximum allowed value for index step index increment at each loop The BY step statement is optional If not specified the increment step is 1 Warning Because ISaGRAF is a synchronous system input variables are not refreshed during FOR iterations This is the while equivalent of a FOR statement User s Manual Of ISaGRAF Embedded Controllers Mar 2006 Rev 5 0 Copyright by ICP DAS Appendix 164 index mini while index lt maxi do lt statement gt lt statement gt index index step end_while Example ST program using FOR statement this program extracts the digit characters of a string length mlen message target empty string FOR index 1 TO length BY 1 DO code ascii message index IF code gt 48 amp code lt 57 THEN target target char code END_IF END_FOR EXIT statement Name EXIT Meaning exit from a FOR WHILE or REPEAT iteration statement Syntax EXIT Operands none The EXIT is commonly used within an IF statement inside a FOR WHILE or REPEAT block Example ST program using EXIT statement this program searches for a character in a string length mlen message found NO FOR index 1 TO length BY 1 DO co
26. COM1 COM2 of the PC will be occupied 14 Remove the connection between INIT INIT COM reset the l 8437 8837 or 7188EG controller User s Manual Of ISaGRAF Embedded Controllers Mar 2006 Rev 5 0 Copyright By ICP DAS Appendix 95 Appendix C Update The 1 8417 8817 8437 8837 Controller to New Hardware Driver The ISaGRAF embedded driver is firmware burned into the flash memory of the 8417 8817 8437 8837 controller It can be easily upgraded by the user Please refer to the respective Getting Started Manual for Updating driver of the I 7188EG I 7188XG amp Wincon 8xx7 Our newly released driver can also be obtained from the following website http Awww icodas com products PAC i 8000 isagraf htm Warning The copyright of the firmware and the ISaGRAF embedded driver belongs to ICP DAS CO LTD Only the l 8417 8817 8437 and 8837 have registered a legal ISaGRAF Target license To burn an ISaGRAF embedded driver into other controllers is absolutely illegal and may be punished by law Make sure of your current OS amp driver version before you upgrade it 1 Create a file folder named 8000 in your hard drive For example c 8000 We use driver 3 09 as an example in this document 2 Copy Napdos ISaGRAF 8000 Driver 2 50 7188xw exe 7188xw ini isa exe autoexec bat amp 8k031105 IMG from the CD_ROM into your 8000 folder 3 Run 8000 7188xw exe in your hard drive A 7
27. Com8 ComPort No on slot 1 Com9 Com12 ComPort No on slot 2 Com13 Com16 ComPort No on slot 3 Com17 Com20 ComPort No on slot 4 7 is not available Example Refer to Chapter 11 Demo_21 22 amp 23 Refer to function ARRAY_R 8 ARRAY_W User s Manual Of ISaGRAF Embedded Controllers Mar 2006 Rev 5 0 Copyright By ICP DAS Appendix 17 COMAY_NW m 8417 8817 m 1 8437 8837 m I 7188EG m I 7188XG m W 8XX7 W 8XX6 Description Function Write one long integer array to COM PORT Each long integer is composed of 4 bytes And the format is a signed long Each integer written is composed of 4 bytes in the below INTEL formate lowest byte highest byte For ex if there is 3 integers to write the first one is 16 04030201 67 305 985 the second one is 16 08070605 134 678 021 and the last one is 16 FFFFFFFE 2 The 12 bytes been written will be 01 02 03 04 05 06 07 08 FE FF FF FF Argument PORT_ integer 8xx7 1 3 20 1 7188EG 1 8 I 7188XG 2 8 W 8xx7 2 3 or ARY_NO_ integer array ID 1 6 for I 8xx7 8 I 7188EG XG 1 18 for W 8xx7 which is to write NUM_ integer the number of long integers starting from the POS_ address in the array to write POS _ Integer start position inside the array to write 1 256 if POS_ NUM_ gt 257 only 257 POS_ integer will be written for ex if POS_ 255 NUM_ 3 only 2 integers written They are Pos 255 amp Pos 256 Q_ bool
28. DAS Appendix 23 COMREADY comready m 8417 8817 m1 8437 8837 m1 7188EG m l 7188XG m W 8XX7 W 8XX6 PORT Q Description Function Test a COM port for data Argument PORT_ integer 1 8xx7 1 3 20 I 7188EG 1 8 I 7188XG 2 8 W 8xx7 2 3 or Q_ boolean If there is data coming return TRUE Else return FALSE Note If using 8xx7 amp I 7188EG s COM1 please set COM1 as non Modbus RTU port in advance before it can work refer to Appendix C 1 If Target is W 8xx7 please make sure its COM2 amp COM3 is not Modbus RTU port before using them Please refer to W 8xx7 s Getting Started Manual Forl 8xx7 ComPort No on slot 0 Com5 Com8 ComPort No on slot 1 Com9 Com12 ComPort No on slot 2 Com13 Com16 ComPort No on slot 3 Com17 Com20 ComPort No on slot 4 7 is not available Call COMREADY to test data coming or not If there is data COMREAD amp COMARY R can be used to read the data If no data comimg do not call COMREAD amp COMARY_R or COM port will block Example Refer to Chapter 11 Demo_21 22 8 23 Open COM3 baud is 19200 Test is there datas coming from COM3 Read one byte from COM3 Action P VAL COMREAD 3 End_action goto step 2 to prepare to read another hvte User s Manual Of ISaGRAF Embedded Controllers Mar 2006 Rev 5 0 Copyright By ICP DAS Appendix 24 COMSTR_W comstr_w Argument PORT m 8417 8817 m1 8437 8837 m1 7188EG m1 7188
29. Negative coils enable boolean output of a connection line boolean state This type of coils are only available using the Quick ladder editor boo variable aa N Left connection e is Right connection The associated variable is set to TRUE when the boolean state of the left connection falls from TRUE to FALSE The output variable resets to FALSE in all other cases The state of the left connection is propagated into the right connection Right connection may be connected to the right vertical power rail The associated boolean variable must be OUTPUT or INTERNAL Example using a Positive coil input output l N ST Equivalence IF NOT input1 and input1 prev THEN output1 TRUE ELSE output1 FALSE END_IF input1prev is the value of input1 at the previous cycle User s Manual Of ISaGRAF Embedded Controllers Mar 2006 Rev 5 0 Copyright by ICP DAS Appendix 152 E 6 4 RETURN statement The RETURN label can be used as an output to represent a conditional end of the program No connection can be put on the right of a RETURN symbol RETURN If the left connection line has the TRUE boolean state the program ends without executing the equations entered on the following lines of the diagram Note When the LD program is a sub program its name has to be associated with an output coil to set the return value returned to the calling program Example using RETURN symbol manual mode
30. Open existing file for Read amp Write 2 Please refer to F_creat F_copy F_append F_dir F_end F_seek F_writ_b F_writ_f F_writ_s F_writ_w F_writ_s User s Manual Of ISaGRAF Embedded Controllers Mar 2006 Rev 5 0 Copyright By ICP DAS Appendix 36 F_EOF I 8417 8817 o 8437 8837 01 7188EG oI 7188XG m W 8XX7 W 8XX6 F_EOF ID ok Description Function Tests if End Of File has been reached ISaGRAF Standard Function Argument ID_ integer File ID No returned by FLROPEN F_CREAT or F WOPEN OK boolean True reach End Of File False not yet F READ B _READ_B 1 8417 8817 o 1 8437 8837 01 7188EG no l 7188XG m W 8XX7 W 8XX6 ID Q Description Function Read one byte from current position of an open file Argument ID_ integer File ID No returned by FLROPEN F_CREAT or F_WOPEN Q_ integer the returned byte 0 255 F_ READ _F f_read_f 1 8417 8817 o 8437 8837 01 7188EG oI 7188XG m W 8XX7 W 8XX6 ID Q Description Function Read one float value from current position of an open file Argument ID_ integer File ID No returned by FLROPEN F_CREAT or F WOPEN Q_ real the returned float value 32 bit float format Note 1 This function may cause Local Controller fault if the REAL value hasn t been well set yet 2 Please refer to Section 10 6 for Controller Fault Dete
31. W 8XX6 PORT O Description Function Close COM PORT Argument PORT_ integer I 8xx7 1 3 20 1 7188EG 1 8 I 7188XG 2 8 W 8xx7 2 3 or Q_ boolean OK return TRUE Note If using 8xx7 8 I 7188EG s COM1 please set COM1 as non Modbus RTU port in advance before it can work refer to Appendix C 1 If Target is W 8xx7 please make sure its COM2 amp COM3 is not Modbus RTU port before using them Please refer to W 8xx7 s Getting Started Manual Forl 8xx7 ComPort No on slot 0 Com5 Com8 ComPort No on slot 1 Com9 Com12 ComPort No on slot 2 Com13 Com16 ComPort No on slot 3 Com17 Com20 ComPort No on slot 4 7 is not available Example Refer to the COMOPEN example User s Manual Of ISaGRAF Embedded Controllers Mar 2006 Rev 5 0 Copyright By ICP DAS Appendix 20 COMOPEN comopen m 8417 8817 m1 8437 8837 m1 7188EG m l 7188XG m W 8XX7 W 8XX6 nee Description TBAUD_ Function Open COM port CHAR Argument PARI PORT_ integer 1 8xx7 1 3 20 I 7188EG 1 8 I 7188XG 2 8 he Qf W 8xx7 2 3 or 5 to 14 BAUD_ integer baud rate can be 2400 4800 9600 19200 38400 57600 115200 CHAR__ integer character size can be 7 or 8 PARI_ integer parity can be 0 none 1 even 2 odd 3 mark 4 space 3 8 4 is only for 1 8xx7 COM3 20 I 7188EG XG COM3 8 While COM2 or for Wincon 8xx7 STOP _ integer stop bit can be 1 or 2 Q_ boolean OK return TRUE Note If using I 8xx7 8 I 7188EG
32. and B2_ are TRUE and others are all FALSE VAL_ will be 3 If only B4_ is TRUE and others are all FALSE VAL_ will be 8 User s Manual Of ISaGRAF Embedded Controllers Mar 2006 Rev 5 0 Copyright By ICP DAS Appendix 16 COMARY_R comary_r m 8417 8817 m1 8437 8837 m1 7188EG m l 7188XG m W 8XX7 W 8XX6 Description Function Read all of the ready data of a COM PORT to a byte array Argument PORT _ integer 8xx7 1 3 20 1 7188EG 1 8 I 7188XG 2 8 W 8xx7 2 3 or ARY_NO_ integer Byte array ID 1 24 for l 8xx7 8 I 7188EG XG 1 48 for W 8xx7 which is used to store the read bytes NUM_ integer return the number of bytes been read COMARY_W m 8417 8817 m1 8437 8837 m1 7188EG m l 7188XG m W 8XX7 W 8XX6 Description Function Write a byte array to a COM PORT Argument PORT _ integer I 8xx7 1 3 20 I 7188EG 1 8 I 7188XG 2 8 W 8xx7 2 3 or ARY_NO_ integer Byte array ID 1 24 for I 8xx7 amp I 7188EG XG 1 48 for W 8xx7 which is used to store the read bytes NUM_ integer the number of bytes starting from the first address in the byte array to write Q_ boolean OK return TRUE Note If using 8xx7 8 I 7188EG s COM1 please set COM1 as non Modbus RTU port in advance before it can work refer to Appendix C 1 If Target is W 8xx7 please make sure its COM2 amp COM3 is not Modbus RTU port before using them Please refer to W 8xx7 s Getting Started Manual Forl 8xx7 ComPort No on slot 0 Com5
33. are declared as integer variables SYSDAT_R gt ST equivalence DAT_R1 call DAT_R1 Y1 DAT_R1 YY_ get year M1 DAT_R1 MM_ get month D1 DAT_R1 DD_ get day W1 DAT_R1 WW_ get date DAT_R1 is declared as FB instance with typed SYSDAT_R User s Manual Of ISaGRAF Embedded Controllers Mar 2006 Rev 5 0 Copyright By ICP DAS Appendix 81 SYSDAT_W 8417 8817 m1 8437 8837 wI 7188EG m1 7188XG W 8xx7 w 8xx6 S Sdat_w JIN Description 1003 Function block Set system year month and day bd e Arguments TMM_ IN_ Boolean Set System Date When Rising From 1DD or FALSE To TRUE YY_ Integer Year To Write Example 2002 2003 2010 Etc MM __ Integer Month To Write 1 Jan 3 March 10 October Etc DD_ Integer Day Returned Valid Range From 1 To 31 Q Boolean If OK Returns TRUE Example refer to demo_03 SW1 is declared as a boolean variable Y1 M1 D1 are declared as integer variables Sw SYSDAT_W INL am St equivalence DAT_W1 SW1 Y1 M1 D1 call DAT_W1 OUT1 DAT_W1 Q_ get return value DAT_W1 is declared as a FB instance with type SYSDAT_W OUT1 as a boolean variable User s Manual Of ISaGRAF Embedded Controllers Mar 2006 Rev 5 0 Copyright By ICP DAS Appendix 82 SYSTIM_R m 8417 881 Description Function blo Arguments HH_ MM_ SS_ Example systim_r 7 m l 8437 8837 m1 7188EG m l 7188
34. be called first 2 S_FL_RST can be called to reset the status to 1 reset to PC hasn t load it yet Please refer to section 10 3 User s Manual Of ISaGRAF Embedded Controllers Mar 2006 Rev 5 0 Copyright By ICP DAS Appendix 69 SMS_GET SMS get m 1 8417 8817 m 1 8437 8837 m l 7188EG m 1 7188XG m W 8XX7 W 8XX6 E Ref N Description Function Get message date and time from controller s date amp time Arguments REF_ Integer to getwhat 1 7 1 get year N_ 2000 2099 2 get month N_ 1 12 3 getdate N_ 1 31 4 get week date N_ 1 7 7 means Sunday 5 gethour N_ 0 23 6 get minute N_ 0 59 7 get second N_ 0 59 others return N_ 1 error return N_ Integer Return associated with Ref_ If return 1 it may be No message or Ref_ out of range of 1 7 Note 1 SMS_gets amp SMS_ get can be called to get message 2 After SMS_gets 1 is called get message data the message buffer will reset to No message So if the orther information are need please call SMS_get 1 7 amp SMS_gets 2 amp SMS_gets 3 before calling SMS_gets 1 Example demo_43 User s Manual Of ISaGRAF Embedded Controllers Mar 2006 Rev 5 0 Copyright By ICP DAS Appendix 70 SMS_GETS SMS_ gets m 1 8417 8817 m 1 8437 8837 m l 7188EG m 1 7188XG m W 8XX7 W 8XX6 a Ref M Description Function Get message data and other information Arguments REF_ Integer to getwhat 1 3 1 get message data 2 get phone No of sender 3 get
35. byte is written Q_ boolean True Ok False fail Note 1 Using ISaGRAF Standard Function FA_READ 8 FA_WRITE to R W long integer 2 Using ISaGRAF Standard Function FM_READ F_WRIT_S 8 FM_WRITE to R W message string 3 The FM_WRITE writes lt CR gt lt LF gt at the end of the message while F_WRIT_S doesn t Example Refer to Wincon CD napdos isagraf wincon demo wdemo_01 8 wdemo_02 User s Manual Of ISaGRAF Embedded Controllers Mar 2006 Rev 5 0 Copyright By ICP DAS Appendix 38 F_WRIT_F f writ f 1 8417 8817 01 8437 8837 o I 7188EG no I 7188XG m W 8XX7 W 8XX6 Description Function Write one float value 32 bit format to current position of an open file Arguments ID_ integer File ID No returned by FLROPEN F_WOPEN or F_CREAT IN_ real The float value to write 32 bit format Q_ boolean True Ok False fail F_WRIT_W f_writ_w 1 8417 8817 o 1 8437 8837 01 7188EG no l 7188XG m W 8XX7 W 8XX6 Description Function Write one word value signed 16 bit integer to current position of an open file Arguments ID_ integer File ID No returned by FLROPEN F_WOPEN or F_CREAT IN_ integer The word value to write 32768 32767 Q_ boolean True Ok False fail f writ_s F_WRIT_S ns 1 8417 8817 o 1 8437 8837 01 7188EG oI 7188
36. date amp time in string format others return M_ error return M_ Message Return associated with Ref_ If return error it may be No message or Ref_ out of range of 1 3 Note 1 SMS_gets amp SMS_ get can be called to get message 2 After SMS_gets 1 is called get message data the message buffer will reset to No message So if the orther information are need please call SMS_get 1 7 8 SMS_gets 2 8 SMS_gets 3 before calling SMS_gets 1 Example demo_43 User s Manual Of ISaGRAF Embedded Controllers Mar 2006 Rev 5 0 Copyright By ICP DAS Appendix 71 SMS_SEND m 8417 8817 m1 8437 8837 m 7188EG m I 7188XG m W 8XX7 W 8XX6 Description Function Trigger the controller to send a new message Arguments No_ message to which phone No fro ex 886920119135 max len is 31 digits M_ message the message to send return Q_ Boolean True ok False wrong phone No or message sending status is not O or 21 Note 1 Please call SMS_sts to get the Message Sending status before calling SMS_send SMS_send only works when status is not 1 busy 2 A successfully SMS_send request will reset the Message sending status to 1 busy and after that by the time it will set to the associate status For ex 21 successfully sent Example demo_43 User s Manual Of ISaGRAF Embedded Controllers Mar 2006 Rev 5 0 Copyright By ICP DAS Appendix 72 SMS_STS SMS sts m 8417 8817 m 1 8437 8837 m I 7188EG mg I 718
37. own programming language Sub programs cannot be described with SFC or FC language Programs of the Begin section are typically used to describe preliminary operations on input devices to build high level filtered variables Such variables are frequently used by the programs of the Sequential section Programs of the End section are typically used to describe security operations on the variables operated on by the Sequential section before sending values to output devices E 1 3 Child SFC and FC programs Any SFC program of the sequential section may control other SFC programs Such low level programs are called child SFC programs A child SFC program is a parallel program that can be started killed frozen or restarted by its parent program The parent program and child program must both be described with the SFC language A child SFC program may have local variables and defined words When a parent program starts a child SFC program it puts an SFC token activates into each initial step of the child program This command is described with the GSTART statement When a parent program kills a child SFC program it clears all the tokens existing in the steps of the child Such a command is described with the GKILL statement When a parent program freezes a child SFC program it suspends its execution The suspended program can then be restarted using the GRST statement Any FC program of the sequential section may control other FC sub program
38. place in the project Called at 2 or more places will work fail To input a real value please use MI_INP_S STR_REAL 8 REAL_STR and refer to demo_ 39 MI_INT m 8417 8817 m1 8437 8837 m1 7188EG m l 7188XG m W 8XX7 W 8XX6 Description Function Display an Integer value on MMICON Arguments X_ integer X position 1 30 gt integer Y position 1 8 LEN__ integer Max number of digits to display 1 11 INT_ integer integer value to display Q_ boolean Ok return TRUE else return FALSE Demo Please refer to Chapter 16 8 demo_38 demo_39 User s Manual Of ISaGRAF Embedded Controllers Mar 2006 Rev 5 0 Copyright By ICP DAS Appendix 54 MI_REAL m 8417 8817 m1 8437 8837 m1 7188EG m l 7188XG m W 8XX7 W 8XX6 mi_real Description Function Display a real value on MMICON Arguments X_ integer X position 1 30 Y_ integer Y position 1 8 LEN_ integer Max number of digits to display 1 13 LEN1_ integer number of digit after 0 4 and less than LEN_ For ex if LEN_ 7 LEN1_ 2 123 4567 will be displayed as 123 45 REAL_ real real value to display If the number of digits exceeds LEN_ will be displayed Q_ boolean Ok return TRUE else return FALSE Note If abs of the real value gt 1 000 000 or gt 0 amp lt 0 0001 please give LEN_ as 13 to display for ex 123 456 789 please set LEN_ to 13 and it is displayed as 1 23457e 008 And 0 0000123456 please set LEN_ to 13 and it is displayed as 1 23456e 005 MI_STR
39. rising edges of a boolean input Bi120 is an input boolean variable Edge_Bi120 is the memory of the Bi120 variable state If REDGE Bi120 Edge_Bi120 Then Counter Counter 1 End_if Note this operator is not in the IEC1131 3 norm You may prefer the use of R_TRIG standard block It has been kept for compatibility reasons FEDGE operator Name FEDGE Meaning evaluates the falling edge of a boolean expression Syntax lt edge gt FEDGE lt boo_expression gt lt memo_variable gt Operands first operand is any boolean variable or complex expression second operand is an internal boolean variable used to store the last state of the expression Return value TRUE when the expression changes from TRUE to FALSE FALSE for all other cases The falling edge of an expression cannot be detected more than once in the same execution cycle using the REDGE operator The operator can be used to describe the condition attached to an SFC transition Warning The memory boolean variable used to store the last state of the expression cannot be used as a trigger for edges of different expressions User s Manual Of ISaGRAF Embedded Controllers Mar 2006 Rev 5 0 Copyright by ICP DAS Appendix 159 When the expression is a boolean variable named xxx a unique internal variable named EDGE_xxx should be declared and used it in the FEDGE expressions for this variable This method ensures that the memory variable is not o
40. s COM1 please set COM1 as non Modbus RTU port in advance before it can work refer to Appendix C 1 If Target is W 8xx7 please make sure its COM2 amp COM3 is not Modbus RTU port before using them Please refer to W 8xx7 s Getting Started Manual For 8xx7 ComPort No ComPort No ComPort No ComPort No ComPort No Example Refer to Chapter 11 Demo_21 22 8 23 on slot 0 Com5 Com8 on slot 1 Com9 Com12 on slot 2 Com13 Com16 on slot 3 Com17 Com20 on slot 4 7 is not available Open COM3 baud rate is 19200 The return is TRUE if open OK COMOPEN 3 19200 8 0 1 Write one byte 16 35 to COM3 Close COM3 Action P TMP COMWRITE 3 16 35 4 End_action COMCLOSE 3 User s Manual Of ISaGRAF Embedded Controllers Mar 2006 Rev 5 0 Copyright By ICP DAS Appendix 21 COMOPEN2 1 8417 8817 o 1 8437 8837 m1 7188EG m1 7188XG m W 8XX7 W 8XX6 Description Function Open COM port with flow control for RS232 port only Argument PORT_ integer 1 7188EG XG 3 8 W 8xx7 2 or 5 to 14 BAUD_ integer baud rate can be 2400 4800 9600 19200 38400 57600 115200 CHAR__ integer character size can be 7 or 8 PARI_ integer parity can be 0 none 1 even 2 odd 3 mark 4 space 3 8 4 is only for 1 8xx7 COM3 20 I 7188EG XG COM3 8 While COM2 or for Wincon 8xx7 STOP _ integer stop bit can be 1 or 2 FLOW_ boolean True flow control by ha
41. times Example refer to demo_17 User s Manual Of ISaGRAF Embedded Controllers Mar 2006 Rev 5 0 Copyright By ICP DAS Appendix 32 EEP_PR m 8417 8817 m 1 8437 8837 m1 7188EG m I 7188XG m W 8XX7 W 8XX6 Q Description Function Set the EEPROM write protection Argument Q_ Boolean Ok return TRUE Fail return FALSE After writing to an EEPROM it is better to turned off the write protection The EEP_B_W EEP_BY_W EEP_WD_W and EEP_N_W functions should not be used to write to the EEPROM more than 100 000 times EEP_WD_R m 8417 8817 m l 8437 8837 m1 7188EG m1 7188XG m W 8XX7 W 8XX6 eep wd r Description ADR Q Function read a word signed 16 bit integer value from the EEPROM Argument ADR_ integer address in the EEPROM where the word value is stored 8xx7 7188EG XG 1 756 W 8xx7 1 7136 Q_ integer the word value returned 32768 32767 EEP_WD_W m 8417 8817 m1 8437 8837 m 7188EG m l 7188XG m W 8XX7 W 8XX6 Description Function write a word signed 16 bit integer value to the EEPROM Arguments ADR_ integer address in the EEPROM where the word value is to be written to l 8xx7 7188EG XG 1 756 W 8xx7 1 7136 DATA_ integer the word value to be written to range from 32768 to 32767 Q_ Boolean Ok return TRUE Note If you are using this function with the EEP_N_R EEP_N_W EEP_BY_R and EEP_BY_W functions simultaneously you must be careful to arrange the ADR_ because they all occupy t
42. to the following rules name cannot exceed 16 characters first character must be a letter following characters can be letters digits or the underscore character E 2 3 1 Reserved keywords A list of the reserved keywords is shown below Such identifiers cannot be used to name a program a variable or a C function or function block A ANA ABS ACOS ADD ANA AND AND_MASK ANDN ARRAY ASIN AT ATAN User s Manual Of ISaGRAF Embedded Controllers Mar 2006 Rev 5 0 Copyright by ICP DAS Appendix 115 B BCD TO BOOL BCD_TO_INT BCD TO REAL BCD _TO STRING BCD _TO_TIME BOO BOOL BOOL_TO BCD BOOL_TO_INT BOOL_TO REAL BOOL_TO_ STRING BOOL_TO_TIME BY BYTE CAL CALC CALCN CALN CALNC CASE CONCAT CONSTANT COS DATE DATE_AND_TIME DELETE DINT DIV DO DT DWORD ELSE ELSIF EN END_CASE END_FOR END_FUNCTION END_IF END_PROGRAM END_REPEAT END_RESSOURCE END_STRUCT END_TYPE END_VAR END_WHILE ENO EQ EXIT EXP EXPT FALSE FEDGE FIND FOR FUNCTION GE GFREEZE GKILL GRST GSTART GSTATUS GT IF INSERT INT INT_TO_BCD INT_TO_BOOL INT_TO_REAL INT_TO_STRING INT_TO_TIME JMP JMPC JMPCN JMPN JMPNC LD LDN LE LEFT LEN LIMIT LINT LN LOG LREAL LT LWORD MAX MID MIN MOD MOVE MSG MUL MUX NE NOT OF ON OPERATE OR OR_MASK ORN PROGRAM R REDGE READ_ONLY READ_WRITE REAL REAL_TO_BCD REAL_TO_BOOL REAL_TO_INT REAL_TO_STRING REAL_TO_TIME REDGE REPEAT REPLACE RESSOUR
43. 0 AND bi23 OR x_cmd E 5 3 Jumps and labels Labels and jumps are used to control the execution of the diagram No other object may be connected on the right of a jump or label symbol The following notations are used gt gt LAB jump to a label label name is LAB LAB definition of a label label name is LAB If the connection line on the left of the jump symbol has the boolean state TRUE the execution of the program directly jumps after the corresponding label symbol User s Manual Of ISaGRAF Embedded Controllers Mar 2006 Rev 5 0 Copyright by ICP DAS Appendix 142 Example of an FBD program using labels and jumps manual b1 gt NOMODIF gt 1 input input2 result NOMODIF gt 1 result valid cmd10 IL Equivalence ld manual and b1 jmpc NOMODIF Id input or input2 st result NOMODIF Id result or valid st cmd10 E 5 4 Boolean negation A single connection line with its right extremity connected to an input of a function block can be terminated by a boolean negation The negation is represented by a small circle When a boolean negation is used the left and right extremities of the connection line must have the BOOLEAN type Example of an FBD program using a boolean negation input input2 ne output ST equivalence output1 input AND NOT input2 E 5
44. 0_10 to m 8417 8817 m1 8437 8837 m I 7188EG m I 7188XG m W 8XX7 W 8XX6 v0O_10_ to Description Function Convert Analog Input from 0 10 V to User s Engineering Value Real format Arguments Analn_ Integer the integer variable related to the Analog input board or module The variable value is usally from 32768 to 32767 depends on the range setting of the lO board Range_ Integer Range setting of the Analog input board or module 160 15mV to 15 mV 1641 50mV to 50 mV 1642 100mV to 100 mV 1643 500mV to 500 mV 164 1to 1V 165 2 5 to 2 5 V 16 7 1 25 to 1 25 V 16 8 10 to 10 V 16 9 5to 5V 16 A 1to 1V 16 B 500mV to 500 mV 16 C 150mV to 150 mV HiVal_ Real User s related High Eng value when analog input signal is 10 V LoVal_ Real User s related Low Eng value when analog input signal is 0 V For example Convert I 8017H s input signal from 0 10 V to become 0 100 psi please set HiVal_ 100 0 LoVal_ 0 0 and Range_ 16 5 or 16 7 or 16 8 or 16 9 depeneds on the range setting of the related IO board return Q_ Real The Engineering value after conversion if given incorrect Range_ returns 1 23E 20 Example Please refer to example of A4_10_ to User s Manual Of ISaGRAF Embedded Controllers Mar 2006 Rev 5 0 Copyright By ICP DAS Appendix 89 VAL_HEX m 8417 8817 m1 8437 8837 m 7188EG m1 7188XG m W 8XX7 W 8XX6 Description Function Convert an
45. 1 23E 20 Example Scale I 8017H s current input with range setting as 6 20 to 20 mA to user s engineering format of 0 to 100 psi 4 mA means 0 psi 20 mA means 100 psi AA 20_TO _ 8017_1_01 Psi_val 1 8017_1_01 is declared as integer input Psi_val is declared as Real internal Note Please refer to similiar functions to A4 20 to VO 10 A4 20 to VO _10 to User s Manual Of ISaGRAF Embedded Controllers Mar 2006 Rev 5 0 Copyright By ICP DAS Appendix 11 ARRAY_R array I m 8417 8817 m1 8437 8837 m1 7188EG m l 7188XG m W 8XX7 W 8XX6 NUM Description ADRE DATA Function Read one byte from a byte array Arguments NUM __ integer array ID to be operated valid range values for the I 8xx7 amp 7188EG XG is from 1 to 24 For W 8xx7 is 1 to 48 ADR__ integer address in the array where the byte is to be stored for the I 8xx7 8 7188EG XG is from 1 to 256 For W 8xx7 is 1 to 512 DATA_ integer the byte value returned Example i eon er Save 4 hexadecimal on O a 16842 values of 41 42 TMP ARRAY W 5 3 16 43 43 44 to address 1 TMP ARRAY W 5 4 16844 to 4 of No 5 array End_action TMP is declared as COMOPEN 3 19200 8 0 1 FOR ii 1 TO 4 DO TMP COMWRITE 3 ARRAY R 5 ii array No 5 and END_FOR A write them to COM3 li is declared as an intanar variahla Read 4 bytes from address 1 to 4 of Goto step 2 after 1 sec to write to COM3 again ARRAY_W m 8417 8817
46. 188xw screen will appear Press F1 for help 4 Link COM1 or COM2 of your PC to COM1 of the I 8xx7 controller through a RS232 cable 5 Power off the I 8xx7 controller connect pin INIT to INIT COM and then power it up 6 Ifthe connection is Ok messages will appear on the 7188x screen 8000 gt 7 Type ver to see the current OS version 8000 gt ver 8 Type isa p to see the version No amp COMM setting of the ISaGRAF driver 8000 gt isa p To upgrade an ISaGRAF embedded driver follow the following steps 9 Power off the I 8xx7 controller connect pin INIT to INIT COM and then power it up User s Manual Of ISaGRAF Embedded Controllers Mar 2006 Rev 5 0 Copyright By ICP DAS Appendix 96 10 11 The OS image should upgrade first Type upload to load the OS image 8000 gt upload press at ALT E and type in the image name for version 2 50 8k031105 IMG and then type bios1 8000 gt bios1 WAIT ABOUT 30 SEC DO NOT REMOVE THE POWER IN THESE 30 SEC To upgrade the ISaGRAF driver Type del and reply y to delete the current driver 8000 gt del Total File number is 2 do you really want to delete y n y Type load then press ALT_E and then type isa_data exe 8000 gt load File will save to 8000 0000 StartAddr gt 7000 FFFF Press ALT_E to download file Input filename isa_data exe Please type isa_data to run isa_data exe and then type del to delete isa_dat
47. 5 Calling function or function blocks from the FBD The FBD language enables the calling of sub programs functions or function blocks A sub program or function or function block is represented by a function box The name written in the box is the name of the sub program or function or function blocks User s Manual Of ISaGRAF Embedded Controllers Mar 2006 Rev 5 0 Copyright by ICP DAS Appendix 143 In case of a sub program or a function the return value is the only output of the function box A function block can have more than one output Example of an FBD program using SUB PROGRAM block Weighing mode l net_weight mode delta delta RETURN __ tare weight weight ST Equivalence net_weight Weighing mode delta call sub program If net_weight 0 Then Return End_if weight net_weight tare_weight User s Manual Of ISaGRAF Embedded Controllers Mar 2006 Rev 5 0 Copyright by ICP DAS Appendix 144 E 6 LD language Ladder Diagram LD is a graphic representation of boolean equations combining contacts input arguments with coils output results The LD language enables the description of tests and modifications of boolean data by placing graphic symbols into the program chart LD graphic symbols are organized within the chart exactly as an electric contact diagram LD diagrams are connected on the left side and on the right side to vert
48. 535 should be constant value not variable the number of words to write valid range values from 1 to 4 should be constant value not variable Set true to write set FALSE to do nothing words to write 32768 32767 Ok return TRUE else return FALSE Note The total number of MBUS_N_W blocks that can be used in one ISaGRAF project is up to 8xx7 amp I 7188EG XG 64 W 8xx7 256 Example Refer to Chapter 8 User s Manual Of ISaGRAF Embedded Controllers Mar 2006 Rev 5 0 Copyright By ICP DAS Appendix 49 MBUS_R m 8417 8817 m1 8437 8837 m 7188EG m l 7188XG m W 8XX7 W 8XX6 Q Description N1_ Function block Read Modbus code 1 4 from the Modbus device N2_ ISaGRAF controller is the Master remote equipment is Slave NL adapt Modbus function code 1 or 2 or 3 or 4 N _ please make sure the remote device support the associated Modbus function N5_ code NE _ Arguments N _ SLAVE_ integer slave No of the Modbus device valid range from 0 to N8_ 255 should be constant value not variable Ng ADDR_ integer the starting Modbus address to read 0 65535 should be constant value not variable N10_ CODE_ integer Request which Modbus function codes 1 4 should _ NW be constant value not variable NUM_ integer Request how many bits 1 192 for code 1 amp 2 or How many words 1 12 for code 3 amp 4 should be constant value not variable Q boolean Ok return TRUE else return FALSE N1_ N12_ i
49. 6 2 Data stored in array is cleared after power off Example Refer to the ARRAY_R example User s Manual Of ISaGRAF Embedded Controllers Mar 2006 Rev 5 0 Copyright By ICP DAS Appendix 14 ARY_W_R ary W_I m 8417 8817 m1 8437 8837 m 7188EG m1 7188XG m W 8XX7 W 8XX6 NUM Description ADR DATA Function read short integer signed 16 bit from array Arguments NUM __ integer ADR__ integer DATA_ integer ARY_W_W m 8417 8817 m1 8437 8837 m 7188EG m1 7188XG m W 8XX7 W 8XX6 Function write 1 short integer signed 16 bit to array of I 8xx7 controller Description Arguments NUM_ integer ADR__ integer DATA_ integer Q_ boolean Note array ID to be operated for the I 8xx7 8 I 7188EG XG is from 1 to 12 For W 8xx7 is 1 to 36 address in the array where the integer is to be stored valid range values from 1 to 256 the integer value returned ranging from 32768 32767 array ID to be operated for the I 8xx7 amp I 7188EG XG is from 1 to 12 For W 8xx7 is 1 to 36 address in the array where the integer is to be stored valid Range values from 1 to 256 the integer value to be saved to 32768 32767 if OK return TRUE else return FALSE 1 The long integer array use the same memory as short integer array Be careful if use both of them at the same time Word array ID ADR Integer array ID ADR 1 1 1 1 1 2 1 3 1 2 A 2
50. 6 Rev 5 0 Copyright By ICP DAS Appendix 61 R_MB_Adr m 8417 8817 m 1 8437 8837 m I 7188EG m I 7188XG m W 8XX7 W 8XX6 ADR Description Function Read boolean or integer variable by using Network address No Arguments TYPE_ Integer 0 boolean variable 1 integer variable ADR__ Integer read which Network address 8xx7 amp 1 7188EG XG 1 to 4095 W 8xx7 1 to 8191 return DATA_ Integer the read value if TYPE is boolean 1 means True 0 means False R_MB_Rel r_mb_rel m 8417 8817 m1 8437 8837 m1 7188EG m1 7188XG m W 8XX7 W 8XX6 ADR DATA Description Function Read REAL variable by using Network address No Arguments ADR__ Integer read which Network address 8xx7 amp I 7188EG XG 1 to 4095 W 8xx7 1 to 8191 return DATA_ Real the real value been read Note Please refer to Section 11 3 5 for a demo description 1 Please use R_MB_REL function to read REAL variable Please also refer to W_MB_Adr amp W_MB Rel 2 If no variable defined with the given modbus address this function returns 0 3 If TYPE_ is given as integer however the related variable is Boolean typed the returnd value is 0 False 1 True 4 lf TYPE_ is given as integer however the related variable is Real typed the related 32 bit is copied to DATA_ User can use int_real function to map this 32 bit integer to a Real value It is better to use R_MB_REL to read Real variable 5 If TYPE_ is given as boolean however the related variable
51. 8417 8817 o 1 8437 8837 01 7188EG oI 7188XG m W 8XX7 W 8XX6 nanie Q Description Function Delete a file Argument NAME_ message File name for ex CompactFlash Temp HTTP Data alarm txt Q_ boolean True Ok False fail or file doesn t exists User s Manual Of ISaGRAF Embedded Controllers Mar 2006 Rev 5 0 Copyright By ICP DAS Appendix 35 F_DIR 1 8417 8817 o 8437 8837 01 7188EG oI 7188XG m W 8XX7 W 8XX6 f_dir DIR Q Description Function Create a directory Argument DIR_ message directory name For example 1DATA111 Q_ boolean TRUE ok FASLE error happens For ex path is not correct or the directory already exists Example init is declared as an internal boolean variable with initial value True tmp is declared as an internal boolean variable if init then init False tmp f_dir DATA111 end_if F_END f end 1 8417 8817 o 8437 8837 01 7188EG oI 7188XG m W 8XX7 W 8XX6 ID Q Description Function Move file position to End Of File Argument ID_ integer File ID No returned by FLROPEN F_CREAT or F WOPEN Q_ boolean True Ok False fail Note Please use F_SEEK to move to a specified file position Example Wdemo_11 8 Wdemo_12 in W 8x37 CD ROM napdos isagrafiwincon demo Note 1 Please refer to SaGRAF standard function F_wopen F_ropen F_close F_eof Fa_read Fa_write F_wopen
52. 8437 8837 4 Please refer to Section 19 2 for more information UDP_send I 8417 8817 01 8437 8837 01 7188EG 01 7188XG m W 8XX7 W 8XX6 Description Function Send message to remote UDP IP connection via ethernet Parameters ID_ Integer send to which connection can be 1 to 4 The related ip address and port No is defined in udp_ ip Msg_ Message The message to send return Q_ Boolean True send OK False sending buffer is full or parameter error For example setting ID_ as 8 Note 1 Please connect udp_ip in the lO connection windows before using udp_send 8 udp_recv functions 2 The sending buffer for Wincon is 2048 bytes That means max 2048 bytes in one PLC scan can be send to remote IP 3 1 7188EG 4 1 8437 8837 can only activate one of udp_ip or ebus_m or ebus_s or ebus_s2 They can not be active at the same time in 7188EG 4 I 8437 8837 4 7188EG 4 I 8x37 doesn t support udp_send 5 The controller driver will send only one message out each PLC scan when there is message in the sending buffer For example if there is 100 messages in the sending buffer the controller will send over these 100 message in 100 PLC scan cycle 6 Please refer to Section 19 2 for more information Example Wdemo_19 amp Wdemo_20 Wincon CD_ROM napdos isagraf wincon demo User s Manual Of ISaGRAF Embedded Controllers Mar 2006 Rev 5 0 Copyright By ICP DAS Appendix 88 V
53. 8XG m W 8XX7 W 8XX6 T N Description Function Get Message Sending status return N_ Integer 0 waiting for a new sending request 1 busy One message is processing now 21 The message is sent successfully 1 SMS system is not available Check GSM Modem 8 SIM card 2 Timeout No response It May be no such a phone No Note 1 Please call SMS_sts to get the Message Sending status before calling SMS_send SMS_send only works when status is not 1 busy 2 A successfully SMS_send request will reset the Message sending status to 1 busy and after that by the time it will set to the associate status For ex 21 successfully sent Example demo_43 User s Manual Of ISaGRAF Embedded Controllers Mar 2006 Rev 5 0 Copyright By ICP DAS Appendix 73 SMS_TEST SMS test m 8417 8817 m 1 8437 8837 m I 7188EG mg I 7188XG m W 8XX7 W 8XX6 Q Description Function Test if message coming or not return Q_ Boolean TRUE A message is coming FALSE No message Note 1 SMS_gets amp SMS_ get can be called to get message 2 After SMS_gets 1 is called get message data the message buffer will reset to No message So if the orther information are need please call SMS_get 1 7 8 SMS_gets 2 amp SMS_gets 3 before calling SMS_gets 1 Example demo_43 User s Manual Of ISaGRAF Embedded Controllers Mar 2006 Rev 5 0 Copyright By ICP DAS Appendix 74 SMR S_M_R m 1 8417 8817 m1 8437 8837 m1 7188EG m l 7188XG o W 8XX7 W 8XX6 ADR
54. AA Ed 91 WISE AAA AAA is 92 WIEN ES SA a nT 92 WEMBADE cia 93 MEMBER delta meen weal 93 APPENDIX B SETTING THE IP MASK 8 GATEWAY IN THE 8437 8837 amp 1 7188EG 94 APPENDIX C UPDATE THE l 8417 8817 8437 8837 CONTROLLER TO NEW HARDWARE A A AASR 96 APPENDIX C 1 SETTING I 8xx7 8 7188EG S COM1 As NONE MODBUS SLAVE PORT coccoccccconno 98 APPENDIX D TABLE OF THE ANALOG IO VALUE cccceeeeeeeeeeeeneeeeeeeeeeeeeeeeeeeeeeeeeeeeees 99 BLOTS AETOTS ETORRI EA A AR RA A DARA A AR ATA RRA E AAA RARA 99 SORA a A TAS AAA SA AA A Aa 100 STOUT AON A SAA aie enedude 101 87018 EFOTA EPO MG iii aia 102 ADA AT Nate yao Meeps rene toe Iria TA AAA SIND MENT ee MD TOME MOORE NIP eye E 104 POLLS AA AREA AAA AAN ela ak Ak St tN NS AN ae uae etek dn 104 OA A cin 105 187024 MN POPA AS AAA AAA AA AR wees 105 APPENDIX E LANGUAGE REFERENCE oooccccccccccnooocccccncncnnnnnnnnnnnannnnnnnnnnnnnennnananannnerererennnnnanns 106 ISAGRAP nta lia E E S 107 LANGUAGE REFERENCE 0 a id 107 ALTERSYS N C A a a anaE aiak 107 EN PROJECT ARCHITECTURE ne nenei reles AAA EEES 108 ETA Programs a ATREA A NE E GRA AA ARI 108 E 1 2 Cyclic and sequential operations AAA AAA 108 E 1 3Child SFC ANG FO POTASA A a Da 109 User s Manual Of ISaGRAF Embedded Controllers Mar 2006 Rev 5 0 Copyright By ICP DAS Appendix 4 E 1 4 FUACHONS ANG SUD DIOGTAINS ii A A dieu AAA ia 109 ENS UN CHOMDIOCKS hs AAA AAA AAA 110 E 1 6 Descripton languages s A A 111 ENS Ex
55. By ICP DAS Appendix 41 GET_SN m 8417 8817 m 8437 8837 m1 7188EG m 1 7188XG m W 8XX7 W 8XX6 Description Function block get hardware unique serial No Arguments Sn_1_ 8 Integer the returned serial No 8 bytes 128 to 127 User s Manual Of ISaGRAF Embedded Controllers Mar 2006 Rev 5 0 Copyright By ICP DAS Appendix 42 INP10LED 8417 8817 m1 8437 8837 o 1 7188EG o 1 7188XG o W 8xx7 w exxe INnp10led Description Function input an decimal integer from the S_MMI Arguments RUN__ Boolean When TRUE Process amp Display Value To SMMI VAL_I_ Integer Initial Value Displayed On S MMI Minimum Value Is 0 maximum is 99999 NUM_ Integer Number Of Digits To Display Valid Range From 1 To5 U1_ Boolean When Rising From FALSE To TRUE Add 1 To The Currently Displayed Digit D1_ Boolean When Rising From FALSE To TRUE Subtract 1 From The Currently Displayed Digit L1_ Boolean When Rising From FALSE To TRUE Shift Left 1 Position From Currently Displayed Digit R1_ Boolean When Rising From FALSE To TRUE Shift Right 1 Position VAL_O_ integer From Currently Displayed Digit The Displayed Integer Value After Operation Example refer to demo_08 demo_ 11a inp10led TRUE RUN a ARA DD FALSE ST equivalence A INP10LED TRUE 100 4 UU DD LL FALSE A is declared as an integer variable UU DD LL are declared as boolean variables can be linked to
56. CE RET RETAIN RETC RETCN RETN RETNC RETURN RIGHT ROL ROR S S SEL SHL SHR SIN SINT SQRT ST STN STRING STRING_TO_BCD STRING_TO_BOOL STRING _TO_INT STRING _TO_REAL STRING_TO_TIME STRUCT SUB SYS_ERR_READ SYS_ERR_TEST SYS_INITALL SYS_INITANA SYS_INITBOO SYS_INITTMR SYS_RESTALL SYS_RESTANA SYS_RESTBOO SYS_RESTTMR SYS_SAVALL SYS_SAVANA SYS_SAVBOO SYS_SAVTMR SYS_TALLOWED SYS TCURRENT SYS_TMAXIMUM SYS_TOVERFLOW SYS_TRESET SYS_TWRITE SYSTEM TAN TASK THEN TIME TIME_OF_DAY TIME_TO_BCD TIME_TO_BOOL TIME_TO_INT TIME_TO_REAL TIME_TO_STRING TMR TO TOD TRUE TSTART TSTOP TYPE UDINT UINT ULINT UNTIL USINT VAR VAR_ACCESS VAR_EXTERNAL VAR_GLOBAL VAR_IN_OUT VAR_INPUT VAR OUTPUT WHILE WITH WORD XOR XOR_MASK XORN Q QT moO DvoOzgre xg e H All keywords beginning with an underscore _ character are internal keywords and must not be used in textual instructions E 2 3 2 Directly represented variables ISaGRAF enables the use of directly represented variables in the source of the programs to represent a free channel Free channels are the ones which are not linked to a declared I O variable The identifier of a directly represented variable always begins with character Below are the naming conventions of a directly represented variable for a channel of a single board s is the slot number of the board c is the number of the channel IXs c free channel of a boo
57. Contents of Appendix CONTENTS OF APPENDIX ccccccscccscccnsscnssccseccnseccsecnseensecseconssenseccaeeenesenseeseeonssenseenaesoness 1 APPENDIX A FUNCTIONS amp FUNCTION BLOCKS FOR ICP DAS CONTROLLERS 6 APPENDIX A 1 STANDARD ISAGRAF FUNCTION BLOCKS ccccceccceeceeeceeeeeeueceeeceseueeueeeeeeeeaeeeuees 6 APPENDIX A 2 ADDING NEW FUNCTION BLOCKS TO ISAGRAF cccceccceecececececeeeeeeueeeeeeesaeeeuees 8 APPENDIX A 3 1 8xx7 8 I 7188EGD XGD s 7 SEGMENT LED REFERENCE TABLE 0 0000008 10 APPENDIX A 4 FUNCTION BLOCKS FOR THE CONTROLLER ccccceceeececeeeeeeeeeceeeeeeeueeueeeueesuneeues 11 PA e o ata te 11 ARA aise an eet stu Bobet ss Sod sel sspears e ea erat 12 PARRA dos 12 A etree ERT ree aan 13 ARY UY A nsec atu teases biel ed anu les alu he een at see et ocd Sutin uted tue atta ud 13 FRY I A an 14 ARY BE WV sie eh tet cee a eh Nes oh dd ld ee 14 ARY MS ees sa aes aeassstaa anana A re aA 15 ARY WM Vta 15 BR e eee den dl 16 BIN E N G iii 16 BIT Wc ee ae O oink ke ine 16 COMARY Rosi ge re lye tee Sd 17 COMAR Y Wisin ais 17 COMAY IV a o do ds ds E 18 COMAY WW ees SE E aE E E RE E AR iia 19 COMELEAR cdt 20 COMES E aio 20 COMOREN ot SS cd 21 COMOPENZ acccscictosss eras ta sn o a A a a A 22 C OOM REA D cana NN eros gsc tT oooO 23 COMREAD Y astilla liada iodo 24 COMSTR o ao ea dl beard Mca 25 COMARES ao TEE ENERO oe 26 CRES Tm A aun a den Genco 27 MA A e nO 28 EBUS DR dd
58. INTERNAL The associated name can be the name of the program for sub programs only This corresponds to the assignment of the return value of the sub program Example using INVERTED coils i t1 tout input n lee output2 amp ST Equivalence output1 NOT input1 output2 input SET coil Set coils enable a boolean output of a connection line boolean state boo variable s Left connection e A A Right connection The associated variable is SET TO TRUE when the boolean state of the left connection becomes TRUE The output variable keeps this value until an inverse order is made by a RESET coil The state of the left connection is propagated into the right connection Right connection may be connected to the right vertical power rail The associated boolean variable must be OUTPUT or INTERNAL Example using SET and RESET coils input1 output input2 outputs R ST Equivalence IF input THEN User s Manual Of ISaGRAF Embedded Controllers Mar 2006 Rev 5 0 Copyright by ICP DAS Appendix 150 output1 TRUE END IF IF input2 THEN output1 FALSE END_IF RESET coil Reset coils enable boolean output of a connection line boolean state boo_variable E LR Left connection S ES Right connection The associated variable is RESET TO FALSE when the boolean state of the left connection becomes TRUE The output variable keeps this value unt
59. Il 7188XG m W 8XX7 W 8XX6 Real Long Description Function Map a Real value to a long integer The algorithm in C language is Long_ long amp Real_ Arguments Real_ real the real value to map Long_ integer the 32 bit integer after mapping Note Int_Real can be used to map a long integer to a Real value If you just want to convert one real value to integer value please use ANA function REAL_STR real_str m 8417 8817 m l 8437 8837 m1 7188EG m1 7188XG m W 8XX7 W 8XX6 REAL STR Description Function Convert a Real value to a string Arguments REAL _ real the real value to convert STR_ message the string returned Max length is 13 For ex 1 234 gt 1 234 123456789 0 gt 1 23457E 008 0 00001234 gt 1 234E 005 Note STR_REAL can be used to convert a string to a Real value m 8417 8817 m 1 8437 8837 m1 7188EG m1 7188XG m W 8XX7 W 8XX6 REAL Description DEC STR Function Convert a Real value to a string with fixed digit number Arguments REAL _ real the real value to convert DEC_ Integer The digit number after the dot symbol 0 5 STR_ message the string returned Max length is 13 For ex For ex if DEC_ 2 1 236 gt 1 24 123456 0 gt 123456 00 0 00001234 gt 0 00 User s Manual Of ISaGRAF Embedded Controllers Mar 2006 Rev 5 0 Copyright By ICP DAS Appendix 59 Retain_B m 8417 8817 m1 8437 8837 m1 7188EG m l 7188XG m W 8XX7 W 8XX6 retain_b Description Fun
60. Integer Value Of Position Display 1 LED2_ Integer Value Of Position Display 2 LED3_ Integer Value Of Position Display 3 LED4_ Integer Value Of Position Display 4 LED5_ Integer Value Of Position Display 5 LED6_ Boolean Value Of Position Display 6 LED7_ Boolean Value Of Position Display 7 Refer to section A 3 to see the display char of LED1 LED5 LED6 LED7 Example set_led TRUE 1000110 t 500ms TRUE TRUE OUT 1 ST equivalence OUT1 SET_LED TRUE 1000110 t 500ms 1 2 3 4 5 TRUE TRUE OUT1 is declared as a boolean variable User s Manual Of ISaGRAF Embedded Controllers Mar 2006 Rev 5 0 Copyright By ICP DAS Appendix 66 S FL_AVL m 8417 8817 m 1 8437 8837 m I 7188EG m I 7188XG o W 8XX7 W 8XX6 Description Function Set one file s current available byte No for the volatile SRAM Arguments ID_ Integer File identifier No 1 8 HEAD _ Integer The current available starting byte No TAIL_ Integer The current available ending byte No HEAD_ TAIL_ must resides inside the area of the associate file Please refer to S_FL_INI or Q_ will return FALSE 1 or 256 1 249 856 S512 1 512 000 X607 1 118 784 X608 1 512 000 For ex A file of ID_ 1 resides at byte No of 1 20000 it can store up to 20000 bytes 1 if setting one of HEAD_ and TAIL_ to 1 no data of the file is available It means when you load this file from PC its size is 0 byte 2 if setti
61. Mar 2006 Rev 5 0 Copyright By ICP DAS Appendix 29 EEP BR m 8417 8817 m 1 8437 8837 m 1 7188EG m l 7188XG m W 8XX7 W 8XX6 pep par ADR Q Description Function read a boolean value from the EEPROM Argument ADR_ integer address in the EEPROM where the boolean value is stored l 8xx7 7188EG XG 1 256 W 8xx7 1 1024 Q_ boolean the boolean value returned Read operation of the EEPROM can be used freely without to remove the protection Be careful to use EEP_B_W EEP_BY_W EEP_WD_W and EEP_N_W the EEPROM can only to be written up to 100 000 times Example refer to demo_17 EEP_B_W m 8417 8817 m1 8437 8837 m 7188EG m l 7188XG m W 8XX7 W 8XX6 Description Function write a boolean value to the EEPROM Arguments ADRES_ integer address in the EEPROM where the boolean value is to be written to l 8xx7 7188EG XG 1 256 W 8xx7 1 1024 DATA_ Boolean the boolean value to be written to Q_ Boolean Ok return TRUE To write to the EEPROM the protection must be removed in advance Be careful to use EEP_B_W EEP_BY_W EEP_WD_W and EEP_N_W EEPROM can only to be written up to 100 000 times Example refer to demo_17 User s Manual Of ISaGRAF Embedded Controllers Mar 2006 Rev 5 0 Copyright By ICP DAS Appendix 30 EEP_BY_R b m 1 8417 8817 m1 8437 8837 m l 7188EG m1 7188XG m W 8XX7 W 8XX6 eeP_OY_t ADR Q Description Function read a byte 8 bit integer value from the EEPROM Argument ADR_ integer addr
62. Micro IDE la Microsoft NET Framework SDK la WINRAR a Microsoft Developer Network a WinZip Documents A Microsoft Office Tools la WS_FTP Pro Microsoft Press A Acrobat Read Settings Microsoft Visual Studio 6 0 GR Crystal Repo Microsoft Web Publishing E Direct LinQ C A Morpheus i I Chess 1 2 Help a MSDN HelpDesk Sample D Image Experi lA nest amp Installshield A a NetZero Internet e Internet Expl A New Visio Drawing EN Keil uvision2 la Norton AntiVirus Corporate Edition PAstart G B MES NT service Toolkit Windows Update Programs Search Run Shut Down When you click on Libraries the ISaGRAF Libraries window will open To add a new function block or function select Tools from the menu bar and then click on Archive s ISAGRAF Libraries E z ol xj File Edit Tools Options Help to remote I O modules i 7033 or ith COM3 4 of l 8xx7 controller 2 ISAGRAF Libraries iol xj File Edit Tools Options Help C tunction REI Standard note format i_7013d WIN32 integration 0 0 modules i 7033 or i 7033d with COM3 4 of I 8xx7 controller Channels 3 A D amaaa SET 7033 to 2 s Complement by 7000 utility User s Manual Of ISaGRAF Embedded Controllers Mar 2006 Rev 5 0 Copyright By ICP DAS Appendix 8 Click on the file name you want to Archive and then click Browse button to select the sub directory to where CD_ROM Napdos IS
63. NR1 m 8417 8817 m1 8437 8837 m1 7188EG m1 7188XG m W 8XX7 W 8XX6 Description Function block Read 8 words 16 bit integer from the Mdobus device with period time Use Modbus function code 3 Arguments SLAVE_ integer slave No of the Modbus device valid range from 0 to 255 should be constant value not variable ADDR_ integer the starting Modbus address to read 0 65535 should be constant value not variable PERIOD__ integer read data depends on period time default is 1 sec The value should be 1 600 sec Q_ boolean Ok return TRUE else return FALSE N1_ N8_ integer the 8 word values that have been read valid range values from 32768 to 32767 Note The total number of MBUS_N_R MBUS_R MBUS_NR1 blocks that can be used in one ISaGRAF project is up to I 8xx7 amp 7188EG XG 64 W 8xx7 256 User s Manual Of ISaGRAF Embedded Controllers Mar 2006 Rev 5 0 Copyright By ICP DAS Appendix 48 MBUS_N_W m 8417 8817 m1 8437 8837 m l 7188EG m l 7188XG m W 8XX7 W 8XX6 Description Function block write 1 to 4 words booleans to the Mdobus device Use Modbus function code 6 when NUM _ W 1 Use Modbus function code 16 when NUM_W 2 to 4 Arguments SLAVE_ integer ADDR_ integer NUM_W__ integer ACTION__ boolean N1_ N4_ integer Q boolean slave No of the Modbus device valid range from 0 to 255 should be constant value not variable the starting Modbus address to write 0 65
64. No 5 array 1 Action P TMP ARRAY_W 5 3 16 41 TMP ARRAY W 5 4 16 42 43 44 to address 3 TMP ARRAY W 5 6 1644 End_action Action F COMOPEN 3 19200 8 0 1 Read 4 bytes from address 3 to 6 of array No 5 and write FOR ii 3 TO 6 DO them to COM3 TMP COMWRITE 3 ARRAY R 5 ii Then call CRC16_1 to END_FOR calculate the CRC16_1 5 3 4 checksum starting TMP COMWRITE 3 CRC16_1 C TMP COMWRITE 3 CRC16_1 C End_action R_H_ form address 3 of se No 5 array total 4 bytes been calculated Write high and low byte of this checksum to COM3 Goto step 2 after 1 sec to write to COM3 again User s Manual Of ISaGRAF Embedded Controllers Mar 2006 Rev 5 0 Copyright By ICP DAS Appendix 27 DI_CNT m 8417 8817 m 1 8437 8837 m1 7188EG m I 7188XG m W 8XX7 W 8XX6 Description Function Get parallel D I counter at 8xx7 amp I 7188EG XG s slot 0 W 8xx7 slot 1 Please refer to Section 3 8 EBUS BR 1 8417 8817 m 1 8437 8837 m1 7188EG oI 7188XG m W 8XX7 W 8XX6 Description Function block Read a boolean package from the Ebus device Arguments PACK_ integer which package No to read 1 128 B1_ B8_ boolean the 8 boolean values contained in the package Example Refer to Section 7 5 EBUS_B_W 1 8417 8817 m 1 8437 8837 m1 7188EG o l 7188XG m W 8XX7 W 8XX6 Description Function block Write a boolean pa
65. OUTPUT or an INTERNAL The following SFC programming leads to the following behaviour GS10 X step activity f Bdirect Bdirect N Binvert Binvert Bset S Breset R Bset Breset Example of boolean actions User s Manual Of ISaGRAF Embedded Controllers Mar 2006 Rev 5 0 Copyright by ICP DAS Appendix 127 SFC program using BOOLEAN actions 1 led1 R led4 S group12 R a 2 led1 N group12 S gt GS2 t gt tH1s 3 lled2 3 GS3 t gt t 2s 4 led3 group12 R y GS4 t gt ts 2 E 3 5 2 Pulse actions A pulse action is a list of ST or IL instructions which are executed only once at the activation of the step Instructions are written according to the following SFC syntax ACTION P ST statements END_ACTION The following shows the results of a pulse action Step activity Execution Example of pulse action 4 Action P ME nb_edge 0 End_action Cmd 4 5 Action P nb_edge nb_edge 1 End_action User s Manual Of ISaGRAF Embedded Controllers Mar 2006 Rev 5 0 Copyright by ICP DAS Appendix 128 E 3 5 3 Non stored actions A non stored normal action is a list of ST or IL instructions which are executed at each cycle during the whole active period of the step Instructions are written a
66. RON TR Te RTE re eet eN Teer Ten erent oy fren 65 S B S sl reer epee erat Perc erey perc en n cer ere reer cere er er erry prey merry reer eres ery rere ae oer aren ores eet Once 65 SL RS adi ad 65 SDE SS AAA AA AA ent ae 65 A valeversnuhavurs sus A E E E E 66 S FLSA VE lia i e ott E nin at i nt E ah ti E E ESA 67 nS gt N EE E E E E E 68 SAFE RS T O AA AAA AAA AAA denen aires 68 SALES TS A ASS AA 69 SMS GETS tanda datada tics 70 SMS GETS A A AAA AAA Nado 71 SMS SEND AA a AO a 72 SMS Pra A AAA AAA 73 SMSTES TS SAI AA Ae 74 Vanidad cansa 75 A tas buvanhebaiatevs nla taatuvabey tule ti Vabalatan tenoN sn aay eas 75 O 76 SN AAA ARTE 77 INN da 77 E TAN 78 E Vane tcoates tals A E I E E AIE E E A 78 MO a i SE E E ESEA A A E ewe an EEES A 79 User s Manual Of ISaGRAF Embedded Controllers Mar 2006 Rev 5 0 Copyright By ICP DAS Appendix 3 SIR REA tt AAA AAA AAA AAA 80 LOAN DL RN Ana 81 SISDAT WES A riada 82 A tan evavened shee tat unavequnevaletab anv alrnavende vara cal sien etdienunassaa cane E EE 83 SYSTIM Vi encase ieee ti aig ei ose ea a eich a al Sits la Sint ia a et 84 TIME STR a A nd aca adan 85 TWN EEE diia 85 A Poe ap SSA A Tern DRT IPN Sk 86 TOVO TO ee tes ata olay uals swe ee eG ena op a ate ataa oa 87 UDP CV icici alii nila ue la tia wate a Dd sitar asta ind doa n sai 88 UDP SOTTO A A O 88 VO TO TO RA AAA AA AAA A AAA AAA AREA AAA A A 89 VAL AE A a Sao 90 VAETOLE ta A NENAS 90 VAL TOLLED dia licd 91 BCD a A A hi AE E AE
67. S Appendix 99 1 8017H Each channel can be configured to different range ID Range Code f Ea Data Format ax value in value 32767 32768 2 s Complement HEX 7FFF Ka IN Ear KM 2 s Complement HEX DecimalValue 32767 2 s Complement HEX 2 og MputRange Doray Pecimal Value pe327er s Complement HEX Decimal Value 32767 2 s Complement HEX 7FFF f TI TI TI TI TI TI TI TI TI TI T T T T T User s Manual Of ISaGRAF Embedded Controllers Mar 2006 Rev 5 0 Copyright By ICP DAS Appendix 100 1 87017 l 7017 Range Code Data Format ax value in value Hex E InputRange oov 32767 32768 Default s Complement HEX 8 2 32767 2 s Complement HEX 7FFF isi 32767 2 2 2 s Complement HEX 7FFF 32767 s Complement HEX 7FFF i sysS Cd d 32767 s Complement HEX 7FFF 32767 2 s Complement HEX 7FFF f e de User s Manual Of ISaGRAF Embedded Controllers Mar 2006 Rev 5 0 Copyright By ICP DAS Appendix 101 1 87018 1 7011 1 7018 Range Code MR Data Format ax value in value 32767 32768 2 s Complement HEX FFF 01 32767 32768 2 s Complement HEX FFF 02 32767 32768 2 s Complement HEX FFF 03 32767 32768 2 s Complement HEX FFF 04 32767 32768 2 s Complement HEX FFF m Input Range EV 100 00 100 00 Default 2 s Complement HEX FFF 32767 32768 2 s Complement HEX Range Code Thermocouple E Data Format ax Value in Value Type 32767 9054 2 s Com
68. XG m W 8XX7 W 8XX6 Description Function Write one string to current position of an file without lt CR gt lt LF gt at the end Arguments ID_ integer File ID No returned by FLROPEN F_WOPEN or F_CREAT STR_ message Message String to write Q_ boolean True Ok False fail Note 1 Using ISaGRAF Standard Function FA_READ 8 FA_WRITE to R W long integer 2 Using ISaGRAF Standard Function FM_READ F_WRIT_S 8 FM_WRITE to R W message string 3 The FM_WRITE writes lt CR gt lt LF gt at the end of the message while F_WRIT_S doesn t Example Refer to Wincon CD napdos isagraf wincon demo wdemo_01 8 wdemo_02 User s Manual Of ISaGRAF Embedded Controllers Mar 2006 Rev 5 0 Copyright By ICP DAS Appendix 39 FBUS B R m 1 8417 8817 m1 8437 8837 m1 7188EG m I 7188XG o W 8XX7 W 8XX6 Description Function block Read a boolean package from the Fbus device Arguments PACK_ integer which package No to read 1 128 B1_ B8_ boolean the 8 boolean values contained in the package Example Refer to Chapter 7 or demo_11a FBUS_B_W m 8417 8817 m1 8437 8837 m1 7188EG m l 7188XG o W 8XX7 W 8XX6 Description Function block Write a boolean package to the Fbus device Arguments PACK_ integer write to which package No 1 128 B1_ B8_ boolean the 8 boolean values contained in the package Q boolean always TRUE Example Refer to Chapter 7 or d
69. XG m W 8XX7 W 8XX6 HH E MM_T ck Read system hour minute and second ss Integer Hour Returned Valid Range From 0 To 23 Integer Minute Returned Valid Range From 0 To 59 Integer Second Returned Valid Range From 0 To 59 refer to demo_03 demo_15b H1 M1 and S1 are declared as integer variables SYSTIM_R en eno II ST equivalence TIM_R1 is declared as FB instance with type SYSTIM_R TIM_R1 Call TIM_R1 H1 TIM_R1 HH_ get hour M1 TIM_R1 MM_ get minute S1 TIM_R1 SS_ get second User s Manual Of ISaGRAF Embedded Controllers Mar 2006 Rev 5 0 Copyright By ICP DAS Appendix 83 SYSTIM_W m 8417 8817 m 1 8437 8837 m I 7188EG m I 7188XG m W 8XX7 W 8XX6 Description Function block Set system hour minute and second Arguments IN_ Boolean Set System Date When Rising From FALSE To TRUE HH_ Integer Hour To Write 0 23 MM_ Integer Minute to Write O 59 ss_ Integer Second to write O 59 Q Boolean If OK Returns TRUE Example refer to demo_03 systim_w IN_ JHH_ JMM _ JSS SW1 is declared as a boolean variable H1 M1 S1 are declared as integer variables Sw SYSTIM_W m IN_ Q_ A St equivalence TIM_W1 Sw1 H1 M1 S1 call TIM_W1 OUT1 TIM_W1 Q_ get return value TIM_W1 is declared as a FB instance with type SYSTIM_W OUT1 as a boolean variable User s Manual Of ISaGRAF Embedded Controllers Mar 2006 R
70. XG m W 8XX7 W 8XX6 STR Description Function Write one string to a COM port PORT_ integer I 8xx7 1 3 20 1 7188EG 1 8 I 7188XG 2 8 W 8xx7 2 3 or STR_ Message the string to be written max length is 255 Q_ boolean Ok return TRUE else return FALSE Note If using 8xx7 8 I 7188EG s COM1 please set COM1 as non Modbus RTU port in advance before it can work refer to Appendix C 1 If Target is W 8xx7 please make sure its COM2 amp COM3 is not Modbus RTU port before using them Please refer to W 8xx7 s Getting Started Manual Forl 8xx7 ComPort No on slot 0 Com5 Com8 ComPort No on slot 1 Com9 Com12 ComPort No on slot 2 Com13 Com16 ComPort No on slot 3 Com17 Com20 ComPort No on slot 4 7 is not available Example To test this example turns SW1 to TRUE Write Hello to COM4 TMP COMSTR_W 4 Hello End_action User s Manual Of ISaGRAF Embedded Controllers Mar 2006 Rev 5 0 Copyright By ICP DAS Appendix 25 COMWRITE comwrite m 8417 8817 m1 8437 8837 m 7188EG m l 7188XG m W 8XX7 W 8XX6 Description Function Write one byte to a COM port Argument PORT_ integer l 8xx7 1 3 20 l 7188EG 1 8 l 7188XG 2 8 W 8xx7 2 3 or DATA_ integer the byte to be written valid range values from O 255 Q_ boolean Ok return TRUE else return FALSE Note If using 8xx7 amp I 7188EG s COM1 please set COM1 as non Modbus RTU port in advance before it can work
71. _ Description LEN STR Function Read one string from the volatile SRAM Arguments ADR_ Integer read which address 256 1 249 856 1 16 3D000 512 1 512 000 1 16 7D000 X607 1 118 784 1 16 1D000 X608 1 512 000 1 16 7D000 LEN_ Integer Max length of the string to read 0 255 return STR_ Message The string value been read For ex data in memory is 16 31 16432 16 33 16 34 16 35 0 16437 16 38 LEN O gt STR_ empty string LEN 3 gt STR 123 LEN 5 gt STR 12345 LEN 6 gt STR 12345 LEN 7 gt STR 12345 LEN 100 gt STR_ 12345 SMW m 8417 8817 m l 8437 8837 m I 7188EG m l 7188XG o W 8XX7 W 8XX6 Description Function Write one string to the volatile SRAM Arguments ADR_ Integer write to which address S256 1 249 856 1 16 3D000 512 1 512 000 1 16 7D000 X607 1 118 784 1 16 1D000 X608 1 512 000 1 16 7D000 LEN_ Integer Max length of the string to write 0 255 STR_ Message the string value For ex LEN_ 0 STR 12345 gt no data written LEN 1 STR 12345 gt 16 31 1 byte written LEN 3 STR 12345 gt 16 31 16 32 16 33 3 bytes written LEN _ 7 STR 12345 gt 16 31 16432 16 33 16 34 16 35 0 0 7 bytes written LEN 100 STR 12345 gt 16 31 16 32 16433 16 34 16 35 0 0 O 100 bytes written Return Q_ boolean Ok TRUE Fail FALSE
72. _level ELSE level Iv16 100 scale END_IF IF structure without ELSE If overflow THEN alarm_level true END_IF CASE statement Name CASE OF ELSE END_CASE Meaning executes one of several lists of ST statements selection is made according to an integer expression Syntax CASE lt integer_expression gt OF lt value gt lt statements gt lt value gt lt value gt lt statements gt ELSE lt statements gt User s Manual Of ISaGRAF Embedded Controllers Mar 2006 Rev 5 0 Copyright by ICP DAS Appendix 162 END_CASE Case values must be integer constant expressions Several values separated by comas can lead to the same list of statements The ELSE statement is optional Example ST program using CASE statement CASE error_code OF 255 err_msg Division by zero fatal_error TRUE 1 err_msg Overflow 2 3 err_msg Bad sign ELSE err_msg Unknown error END_CASE WHILE statement Name WHILE DO END_WHILE Meaning iteration structure for a group of ST statements the continue condition is evaluated BEFORE any iteration Syntax WHILE lt boolean_expression gt DO lt statement gt lt statement gt END_WHILE Warning Because ISaGRAF is a synchronous system input variables are not refreshed during WHILE iterations The change of state of an input variable cannot be used to describe the condition of a WHILE statement Example
73. a 45 PRONG VAUD A A asa EO 46 MET o e SR ean E 46 ET A iia Min ba Nan aha inhibi ahha 46 II A ete S A OO 47 WS a hee oe et A es eed ant ee ore 47 ABO S A E ER 48 Es eee mae ee a IND SAIS O oer fired 48 EA AA A R esse St Moc 49 A Sabla elite A decid dal 50 NAS RG cat A A A O kan dasd geeteed aaasaad odes tee 51 AE ae eer a one EEN Ov eo OP eon ev Oey PIR NTA 52 A le IA Ree RA A A RARELY IN ACTA Petar OO 53 MINE conta taa RE IO lao BRET oe rt 53 A I Sra naa an io e cada 54 A A A TOUCS AU SU SPOIL AEE OD 54 A AREA AAA AAA conten aden Oona ome Mae ncaa 55 A te opsobat enon clad 55 A heh ce NIN IA A NA alates 56 TA AA 56 User s Manual Of ISaGRAF Embedded Controllers Mar 2006 Rev 5 0 Copyright By ICP DAS Appendix 2 PWM DOES tai AAA AAA AAA ANA meee 57 EWMEEN ninas 57 PWM SEIN 200 AAA A aida cacaos 57 PWM AAA A E Oe 57 PWM OEA AR ADA AAA AAA adn ais AA TA 57 PIVME SET a EE E 57 BPWMSS ES AS ici 57 ah AW heed ESV SEA ASA ri 57 R N Brasilia 58 RDN AN 58 PRIN IN EE EEE E RO 58 RON Titania a AA AAA AAA AAA AR AAA E ae 58 REALIN Ta NR 59 REALE STR ae a A AA RRE 59 REA STRZ ls 59 Retain Bore RN A 60 ROSITA AA a e rera ene a EREA 60 ROCES SNA EN AE 60 ROI AAA 61 Retain A ear ara eee eee 61 EMBA Ma a cui eae eda A EA E AAA da AA DOE 62 PRE IIB O ana wish hatiba aa uals ee e E 62 SODA AAA AAA AAA AAA IA 63 A Vos 63 DB SANA ri OA 64 A svavetavcnusstauanavetaeverwoayanasatatenay AT EE E et 64 DE DIS eee moet Paneer ar ome AA T
74. a exe 8000 gt isa_data 8000 gt del Total File number is 1 do you really want to delete y n y Type load then press ALT_E and then type autoexec bat 8000 gt load File will save to 8000 0000 Press ALT_E to download file Input filename autoexec bat Type load again then press ALT_E and then type isa exe Wait util it finished 8000 gt load File will save to 8003 0002 StartAddr gt 8000 0031 Press ALT_E to download file Input filename isa exe Type dir to make sure autoexec bat and isa exe are well burned 8000 gt dir Press ALT_X to exit 7188x Remove the connection between INIT INIT COM reset the I 8xx7 controller User s Manual Of ISaGRAF Embedded Controllers Mar 2006 Rev 5 0 Copyright By ICP DAS Appendix 97 Appendix C 1 Setting I 8xx7 I 7188EG s COM1 As None Modbus Slave port COM1 of the 1 8417 8817 8437 8837 7188EG supports Modbus RTU Slave protocol by default User may change it to a None Modbus Slave port for other usage For example user may write his own defined protocol on COM1 or use COM1 as a Modbus Master port 1 Create a file folder named 8000 in your hard drive For example c 8000 2 Copy CD ROM Napdos ISaGRAF 8000 Driver 7 188xw exe 7188xw ini from the CD_ROM into your 8000 folder 3 Run 8000 7188xw exe in your hard drive A 7188xw screen will appear 4 Link from COM1 or COM2 of PC to COM1 of the 8417 8817 8437 8837 or
75. aGRAF ARK you want to archive the function block library to 7 Archive C function blocks x Backup Restore Close Help Workbench Archive l Compress Archive location CADOCUME ISCOTTIDESKTOPNCPDAS Archive location k xl File name Folders WEEZER c scott desktop icpdas 1 Do Cancel Eck 2 DOCUME 1 Network gt SCOTT P gt ICPDAS 1 T Read only gt DESKTOP List files of type Drives ne Ec Select the new function block in the Archive window that you want to add and then click on the Restore button When you click on the Restore button the function block will be added to the ISaGRAF Workbench window x Backup Close Help Workbench Archive Compress Archive location C DOCUME 1 SCOTT DESKTOPSICPDAS Browse User s Manual Of ISaGRAF Embedded Controllers Mar 2006 Rev 5 0 Copyright By ICP DAS Appendix 9 Appendix A 3 1 8xx7 1 7188EGD XGD s 7 Segment LED Reference Table The following table provides the reference definitions for programming the 7 LED indicators on the 8xx7 8 I 7188EGD XGD controller system LED 6 Set to TRUE to display colon LED 7 Set to TRUE to display period above LED 4 Display Table LED 1 Through LED 5 Displayed Given Displayed Given Displayed Given Char Value Char Value Char Value 0 0 4 20 r 40 1 1 5 21 L 41 2 2 6 22 n 42 3 3 7 23 y 43 4 4 8 24 U
76. able res Calling sub programs or functions A sub program or a function written in any of the IL ST LD FBD or C language is called from the IL language using its name as an operator Operation executes a sub program or a function the value returned by the sub program or function is stored into the IL current result Allowed modifiers none Operand The first calling parameter must be stored in the current result before the call The following ones are expressed in the operand field separated by comas Example Calling program converts an analog value into a time value Main LD bi0 SUBPRO _ bi1 bi2 call sub program to get analog value ST result result value returned by sub program GT vmax test value overflow RETC return if overflow LD result MUL 1000 converts seconds in milliseconds TMR converts to a timer ST tmval stores converted value in a timer Called sub program named SUBPRO evaluates the analog value given as a binary value on three boolean inputs in0 in1 in2 are the three boolean input parameters of the sub program User s Manual Of ISaGRAF Embedded Controllers Mar 2006 Rev 5 0 Copyright by ICP DAS Appendix 176 LD in2 ANA result ana in2 MUL 2 result 2 ana in2 ST temporary temporary result LD in1 ANA ADD temporary result 2 ana in2 ana in1 MUL 2 result 4 ana
77. active separators may be freely entered between active separators constant expressions and identifiers ST inactive separators are Space blank character Tabs and End of line character Unlike line formatted languages such as IL end of lines may be entered anywhere in the program The rules shown below should be followed when using inactive separators to increase ST program readability Do not write more than one statement on one line Use tabs to indent complex statements Insert comments to increase readability of lines or paragraphs E 7 1 Expression and parentheses ST expressions combine ST operators and variable or constant operands For each single expression combining operands with one ST operator the type of the operands must be the same This single expression has the same type as its operands and can be used ina more complex expression For example boo_var1 AND boo_var2 has BOO type not boo _var1 has BOO type sin 3 14 0 72 has REAL ANALOG type t 1s23 1 78 is an invalid expression User s Manual Of ISaGRAF Embedded Controllers Mar 2006 Rev 5 0 Copyright by ICP DAS Appendix 156 Parentheses are used to isolate sub parts of the expression and to explicitly order the priority of the operations When no parentheses are given for a complex expression the operation sequence is implicitly given by the default priority between ST operators For example 2 3 6 equals 2 18 20 because multiplication operator h
78. as a higher priority 2 3 6 equals 5 6 30 priority is given by parenthesis Warning A maximum number of 8 levels of parentheses can be nested within an expression E 7 3 Function or function block calls Standard ST function calls may be used for each of following objects Sub programs Library functions and function blocks written in IEC languages C functions and function blocks Type conversion functions Calling sub programs or functions Name name of the called sub program or library function written in IEC language or in C Meaning calls a ST IL LD or FBD sub program or function or a C function and gets its return value Syntax lt variable gt lt subprog gt lt par1 gt lt parN gt Operands The type of return value and calling parameters must follow the interface defined for the sub program Return value value returned by the sub program Sub program calls may be used in any expression They also may be used in an SFC transition Example1 Sub program call Main ST program gets an analog value and converts it into a limited time value ana_timeprog SPlimit tprog_cmad appl_timer tmr ana_timeprog 100 Called FBD program named SPlimit PGA Input_value max_value Example2 Function call A functions used in complex expressions min max right mlen and left are standard C functions User s Manual Of ISaGRAF Embedded Contr
79. aw the connection line The jump symbol must be referenced with the number of the destination step Jump to step 102 Ao 102 A jump symbol cannot be used to represent a link from a step to a transition Example of jumps the following charts are equivalent E 3 3 Divergences and convergences Divergences are multiple connection links from one SFC symbol step or transition to many other SFC symbols Convergences are multiple connection links from more than one SFC symbols to one other symbol Divergences and convergences can be single or double E 3 3 1 single divergences A single divergence is a multiple link from one step to many transitions It allows the active token to pass into one of a number of branches A single convergence is a multiple link from many transitions to the same step A single convergence is generally used to group the SFC branches which were started on a single divergence Single divergences and convergences are represented by single horizontal lines User s Manual Of ISaGRAF Embedded Controllers Mar 2006 Rev 5 0 Copyright by ICP DAS Appendix 123 Single divergence r A Single convergence Warning The conditions attached to the different transitions at the beginning of a single divergence are not implicitly exclusive The exclusivity has to be explicitly detailed in the conditions of the transitions to ensure that only one token progresses in one branch of the divergence at run time Below is an e
80. bility E 2 2 3 Real analog constant expressions Real analog constant expressions can be written with either decimal or scientific representation The decimal point separates the integer and decimal parts The decimal point must be used to differentiate a real constant expression from an integer one The scientific representation uses the E or F letter to separate the mantissa part and the exponent Exponent part of a real scientific expression must be a signed integer value from 37 to 37 Below are examples of real analog constant expressions 3 14159 1 0E 12 1 0 1 0F 15 789 56 1 0E 37 The expression 123 does not represent a real constant expression Its correct real representation is 123 0 E 2 2 4 Timer constant expressions Timer constant expressions represent time values from 0 second to 23h59m59s999ms The lowest allowed unit is a millisecond Standard time units used in constant expressions are Hour The h letter must follow the number of hours Minute The m letter must follow the number of minutes Second The s letter must follow the number of seconds Millisecond The ms letters must follow the number of milliseconds The time constant expression must begin with T or TIME prefix Prefixes and unit letters are case insensitive Some units may not appear These are examples of timer constant expressions T 1H450MS 1 hour 450 milliseconds time 1H3M 1 hour 3 minutes The expression 0 does not rep
81. cable 5 Power off the I 8437 8837 or 7188EG controller connect pin INIT to INIT COM GND for I 7188EG and then power it up 6 If the connection is Ok messages will appear on the 7188x screen kkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk 7188x Ver 1 01 0 02 23 2000 EEN Press F1 for help EA ICP_DAS MiniOS7 for 8000 485 Ver 1 03 build 014 May 09 2001 14 30 36 SRAM 512K FLASH MEMORY 512K Serial number 5A 5A 5A 5A 5A 5A 5A 5A 8000 gt 7 Type ip to see the current IP address of the I 8437 8837 or 7188EG 8000 gt ip IP 192 168 255 255 8000 gt 8 Type setip xxx xxx xxx xxx to set to a new IP address 8000 gt setip 192 168 1 200 User s Manual Of ISaGRAF Embedded Controllers Mar 2006 Rev 5 0 Copyright By ICP DAS Appendix 94 Set IP 192 168 1 200 ReadBack IP 192 168 1 200 8000 gt 9 Type mask to see the current address mask of the 8437 8837 or 7188EG 8000 gt mask MASK 255 255 0 0 8000 gt 10 Type setmask xxx xxx xxx xxx to set to a new address mask 8000 gt setmask 255 255 255 0 Set MASK 255 255 255 0 ReadBack MASK 255 255 255 0 8000 gt 11 Type gateway to see the current gateway address 8000 gt gateway Gateway 192 168 0 1 8000 gt 12 Type setgateway xxx xxx xxx xxx to set to a new gateway address 8000 gt setgateway 192 168 1 1 Set GATEWAY 192 168 1 1 ReadBack Gateway 192 168 1 1 8000 gt 13 Press ALT_X to exit 7188x and close the DOS SHELL or
82. ccccccncccnnnnocnnnnnnnnnnnnnnns 143 AAN A II O las suit Sut buted tee Ss day 145 E 6 1 Power rails and connection INE Sia AAA aes 145 E 6 2 MUTIDISCOA aa ais 146 E 6 3 Basic LD contacts and coils ssicisisisiaistsiadedsiedsie AAA ii dis 147 E 6 4 RETURN SEMEN A A ii 153 E050 JUMPS ANG TADOS A AAA AA RADA III IAEA 153 A A A OO 154 E S T LANGUAGE pt A DA A rs col 156 ESTATUS A A is 156 E 7 1 Expression and PATERNO SOS AAA 156 E 7 3 Function Or function block CANS ut A A a aaa ei 157 E 7 4 ST specific boolean ODGTAIOMS A a Ec 158 Eds T DASIC SIGICMIONIS y ad 160 ELISTAS A AAA A A AAA AAA tie 165 Ec TE LANGUAGE Gu OS 171 E8eTIE man Syna St A Ea 171 E 3 Pia ag OPA TOES RA AAA A 172 APPENDIX F HOW TO ENABLE DISABLE W 8X47 S LAND2 sssssscosscsscnsscsscnscssssnscasscnscnsssuscuscescenseasccusensesuscascessenesnees 179 User s Manual Of ISaGRAF Embedded Controllers Mar 2006 Rev 5 0 Copyright By ICP DAS Appendix 5 Appendix A Functions amp Function Blocks For ICP DAS Controllers Appendix A 1 Standard ISaGRAF Function Blocks The following details the standard ISaGRAF function blocks that can be programmed with the 8xx7 1 7188EG XG amp W 8xx7 controller however labeled with amp is not supported by 1 8xx7 amp I 7188EG XG while W 8xx7 doesn t support items with A label only y HARWRITE F_ROPEN MSG SHR amp AND ASCII F_TRIG MUX4 SIG_GEN ASIN F WOPEN MUX8 SIN ATAN FA READ Ne
83. ccording to the following SFC syntax ACTION N ST statements END_ACTION The following is the results of a non stored action Step activity Execution Example of non stored action 4 Action P nb_edge 0 End_action _ Cmd 4 5 Action N lt If nb_egde lt 10 then nb_edge nb_edge 1 End_if End_action E 3 5 4 SFC actions An SFC action is a child SFC sequence started or killed according to the change of the step activity signal An SFC action can have the N Non stored S Set or R Reset qualifier This is the syntax of the basic SFC actions lt child_prog gt N starts the child sequence when the step becomes active and kills the child sequence when the step becomes inactive lt child_prog gt same effect N attribute is optional lt child_prog gt S starts the child sequence when the step becomes active Nothing is done when the step becomes inactive lt child_prog gt R kills the child sequence when the step becomes active Nothing is done when the step becomes inactive User s Manual Of ISaGRAF Embedded Controllers Mar 2006 Rev 5 0 Copyright by ICP DAS Appendix 129 The SFC sequence specified as an action must be a child SFC program of the program currently being edited Note that using the S Set or R Reset qualifiers for an SFC action has exactly the same effect as the GSTART and GKILL statements programm
84. ces and convergences Actions and Tests can be described with ST LD or IL languages Functions and Function blocks of any language except SFC can be called from actions and tests A Flow Chart program can call another Flow Chart program The called FC program is a sub program of the calling FC program E 4 1 FC components Below are graphic components of the Flow Chart language Beginning of FC chart A begin symbol must appear at the beginning of a Flow Chart program It is unique and cannot be omitted It represents the initial state of the chart when it is activated Below is the drawing of a begin symbol The Begin symbol always has a connection on the bottom to the other objects of the chart A flow chart is not valid if no connection is drawn from Begin to another object Ending of FC chart An end symbol must appear at the end of a Flow Chart program It is unique and cannot be omitted It is possible that no connection is drawn to the End symbol always looping chart but End symbol is still drawn anyway at the bottom of the chart It represents the final state of the chart when its execution has been completed Below is the drawing of an end symbol End The End symbol generally has a connection on the top to the other objects of the chart A flow chart may have no connection to the End object always looping chart The End object is still visible at the bottom of the chart in this case FC f
85. ckage to the Ebus device Arguments PACK_ integer write to which package No 1 128 B1_ B8_ boolean the 8 boolean values contained in the package Q boolean always return TRUE Example Refer to Section 7 5 User s Manual Of ISaGRAF Embedded Controllers Mar 2006 Rev 5 0 Copyright By ICP DAS Appendix 28 EBUS NR 1 8417 8817 m 1 8437 8837 m l 7188EG o l 7188XG m W 8XX7 W 8XX6 Description Function block Read a integer package from the Ebus device Arguments PACK_ integer which package No to read 1 128 N1_ N8_ integer the 8 integer values contained in the package Example Refer to Section 7 5 EBUS_N W 1 8417 8817 m 1 8437 8837 m1 7188EG oI 7188XG m W 8XX7 W 8XX6 Description Function block Write a integer package to the Ebus device Arguments PACK_ integer write to which package No 1 128 N1_ N8_ boolean the 8 integer values contained in the package Q boolean always return TRUE Example Refer to Section 7 5 EBUS_STS ebus sts 1 8417 8817 m 1 8437 8837 m1 7188EG no l 7188XG m W 8XX7 W 8XX6 ID Description PACK Function Get Package Status of Ebus Arguments ID_ Integer to get what 0 Boolean package 1 Integer package PACK_ Integer get which package No 1 128 return Q_ boolean TRUE package is alive FALSE dead communication break Example Please refer to demo_49a amp demo_49b User s Manual Of ISaGRAF Embedded Controllers
86. code 3 amp 4 should be constant value not variable read data depends on period time default is 1 sec The value should be 1 600 sec Ok return TRUE else return FALSE The bits or words received If CODE_ is 1 8 2 N1_ returns bit 1 to 16 N2_ returns bit 17 to 32 N12_ returns bit 177 to 192 If CODE_is3 amp 4 N1_toN12_ returns the associated words 32768 to 32767 N1_ to N12_ is absolutly correct Only when Q return TRUE comm ok Note The total number of MBUS_N_R MBUS_R MBUS_R1 blocks that can be used in one ISaGRAF project is up to 8xx7 8 I 7188EG XG 64 W 8xx7 256 User s Manual Of ISaGRAF Embedded Controllers Mar 2006 Rev 5 0 Copyright By ICP DAS Appendix 51 MBUS_WB m 8417 8817 m 8437 8837 m1 7188EG m I 7188XG m W 8XX7 W 8XX6 Description Function block write 1 to 16 bits booleans to the Mdobus device Use Modbus function code 15 Arguments SLAVE_ integer slave No of the Modbus device range from O to 255 should be constant value not variable ADDR_ integer the starting Modbus address to write 0 65535 should be constant value not variable NUM_W__ integer the number of bits to write valid range from 1 to 16 should be constant value not variable ACTION_ boolean Set true to write set FALSE to do nothing B1_ B16_ boolean bits to write Q_ boolean Ok return TRUE else return FALSE Note The total number of MBUS_B_W MBUS_WB blocks that can be
87. ction Note 1 Please refer to SaGRAF standard function F_wopen F_ropen F_close F_eof Fa_read Fa_write F_wopen Open existing file for Read amp Write 2 Please refer to F_creat F_copy F_append F_dir F_end F_seek F_writ_b F_writ_f F_writ_s F_writ_w F_writ_s User s Manual Of ISaGRAF Embedded Controllers Mar 2006 Rev 5 0 Copyright By ICP DAS Appendix 37 F_READ W f_read_w 1 8417 8817 o 1 8437 8837 01 7188EG no l 7188XG m W 8XX7 W 8XX6 Pe ID Q Description Function Read one word signed 16 bit integer from current position of an open file Arguments ID_ integer File ID No returned by FLROPEN F_WOPEN or F_CREAT Q_ integer the returned word 32768 32767 F_SEEK f seek 1 8417 8817 o 1 8437 8837 01 7188EG no l 7188XG m W 8XX7 W 8XX6 ID Description POS Q Function Move file position to Arguments ID_ integer File ID No returned by FLROPEN F_WOPEN or F_CREAT POS_ integer position unit is byte 1 to Q_ boolean True Ok False fail F_WRIT_B f_writ_b 1 8417 8817 o 8437 8837 01 7188EG oI 7188XG m W 8XX7 W 8XX6 Description Function Write one byte to current position of an open file Arguments ID_ integer File ID No returned by FLROPEN F_WOPEN or F_CREAT IN_ integer The byte value to write 0 255 if value gt 255 or lt 0 the lowest
88. ction Seta Boolean variable to be as retained variable Arguments B_ Boolean B_ should be a boolean variable name not a constant value ADR__ Integer Set retained address for this boolean variable I 8xx7 8 1 7188EG XG 1 to 256 W 8xx7 1 to 1024 return Q_ Boolean Ok return True Error return False Retain_F retain f m 8417 8817 m1 8437 8837 m 7188EG m1 7188XG m W 8XX7 W 8XX6 Description Function Seta Real variable to be as retained variable Arguments F_ Real F_ should be a Real variable name not a constant value ADR__ Integer Set retained address for this Real variable 8xx7 amp I 7188EG XG 1 to 1024 W 8xx7 1 to 4096 return Q_ Boolean Ok return True Error return False Retain_N retain n m 8417 8817 m1 8437 8837 m 7188EG m1 7188XG m W 8XX7 W 8XX6 Description Function Set an Integer variable to be as retained variable Arguments N_ Integer N_ should be a Integer variable name not a constant value ADR__ Integer Set retained address for this Integer variable I 8xx7 8 1 7188EG XG 1 to 1024 W 8xx7 1 to 4096 return Q_ Boolean Ok return True Error return False Note 1 Befor using Retain_X Retain_N Retain_B Retain_F amp Retain_T functions please make sure the below IO complex equipment is well connected in the ISaGRAF IO connection window I 7188EG XG X607_608 I 841 7 881 7 8437 8837 amp W 8XX7 W 8XX6 S256 512 2 Please refer to Chapter 10 for detail information
89. d Range_ Integer Range setting of the Analog output board or module 1642 Oto10V 16432 Oto10V 16433 10 to 10 V 16434 Oto5V 16 35 5 to 5 V HiVal_ Real User s related High Eng value when analog ouput signal is 10 V LoVal_ Real User s related Low Eng value when analog output signal is 0 V For example Convert 0 100 psi to become 8024 s AO value please set HiVal_ 100 0 LoVal_ 0 0 and Range_ 16 33 depeneds on the range setting of the related IO board return Q_ Integer The AO value after conversion value is usually in 0 to 32767 depends on which Range setting of the lO board If given incorrect Range_ or HiVal_ LoVal_ returns 1 Example Please refer to example of To_A4 20 User s Manual Of ISaGRAF Embedded Controllers Mar 2006 Rev 5 0 Copyright By ICP DAS Appendix 87 UDP_recv udp_recv 1 8417 8817 m 1 8437 8837 m1 7188EG oI 7188XG m W 8XX7 W 8XX6 Meo Description Function Receive message from remote UDP IP connection via ethernet Returns Msg_ Message the received message If Msg_ empty message it means no message coming Note 1 Please connect udp_ip in the lO connection windows before using UDP_recv 8 UDP_send 2 The receiving buffer size is Wincon 8096 bytes I 7188EG amp I 8x37 2048 bytes 3 1 7188EG amp 8437 8837 can only activate one of udp_ip or ebus_m or ebus_s or ebus_s2 They can not be active at the same time in I 7188EG amp 1
90. d are typically used in time expressions A timer value cannot exceed 23h59m59s999ms and cannot be negative Timer variables are stored in 32 bit words The internal representation is a positive number of milliseconds Timer variables can have one of the following attributes Internal memory variable managed by the program refreshed by ISaGRAF system Constant read only memory variable with an initial value Warning Timer variables cannot have the INPUT or OUTPUT attributes Timer variables can be automatically refreshed by the ISaGRAF system When a timer is active its value is automatically increased according to the target system real time clock The following statements of the ST language can be used to control a timer TSTART starts automatic refresh of a timer TSTOP stops automatic refresh of a timer E 2 3 6 Message string variables Message or string variables contain character strings The length of the string can change during process operations The length of a message variable cannot exceed the capacity maximum length specified when the variable is declared Message capacity is limited to 255 characters Message variables can have one of the following attributes Internal memory variable updated by the program Constant read only memory variable with an initial value Input variable connected to an input device refreshed by the system Output variable connected to an output device String variables can contain any characte
91. de ascii message index IF code searched_char THEN found YES EXIT END_IF END_FOR E 7 6 ST extensions The following functions are extensions of the ST language TSTART TSTOP timer control User s Manual Of ISaGRAF Embedded Controllers Mar 2006 Rev 5 0 Copyright by ICP DAS Appendix 165 The following statements and functions are available to control the execution of the SFC child programs They may be used inside ACTION END ACTION blocks in SFC steps GSTART starts an SFC program GKILL kills an SFC program GFREEZE freezes an SFC program GRST restarts a frozen SFC program GSTATUS gets current status of an SFC program Warning These functions are not in the IEC 1131 3 norm Easy equivalent can be found for GSTART and GKILL using the following syntax in the SFC step child_name S equivalent to GSTART child_name child_name R equivalent to GKILL child_name The following fields can be used to access the status of an SFC step GSnnn x boolean value that represents the activity of the step GSnnn t time elapsed since the last activation of the step nnn is the reference number of the SFC step It is also possible to test the activity of a step declared in another SFC program by using the following syntax GSnnn progname x Warning referencing a step of an other program using this syntax is not in the IEC 1131 3 norm An easy way to do the same respecting IEC rules
92. ded Controllers Mar 2006 Rev 5 0 Copyright By ICP DAS Appendix 63 S BYR S BY_R m 8417 8817 m1 8437 8837 m 7188EG m I 7188XG o W 8XX7 W 8XX6 ADR N Description Function Read one byte from the volatile SRAM Arguments ADR_ Integer read which address one Byte occupy 1 byte S256 1 249 856 1 16 3D000 512 1 512 000 1 16 7D000 X607 1 118 784 1 16 1D000 X608 1 512 000 1 16 7D000 return N Integer The byte value been read 0 255 S BY W m 8417 8817 m 1 8437 8837 m1 7188EG m I 7188XG o W 8XX7 W 8XX6 Description Function Write up to 4 bytes to the volatile SRAM Arguments ADR_ Integer start from which address one byte occupy 1 byte 256 1 249 856 1 16 3D000 512 1 512 000 1 16 7D000 X607 1 118 784 1 16 1D000 X608 1 512 000 1 16 7D000 NUM_ Integer how many bytes to write O 4 N1_ N4_ Boolean the byte value 0 255 to write return Q Boolean Ok TRUE Fail FALSE Please refer to section 10 3 User s Manual Of ISaGRAF Embedded Controllers Mar 2006 Rev 5 0 Copyright By ICP DAS Appendix 64 S DL_DIS m 8417 8817 m 1 8437 8837 m I 7188EG m I 7188XG o W 8XX7 W 8XX6 Description Function Disable the download permission so that PC can not download data to the SRAM return Q_ Boolean TRUE ok FALSE fail S DE EN s dl en m 8417 8817 m 8437 8837 m1 7188EG m l 7188XG o W 8XX7 W 8XX6 SES i Descr
93. e The algorithm in C language is Real_ float amp Long_ Long Real Arguments Long_ integer the 32 bit integer Real_ real the real value after mapping Note Real_Int can be used to map a Real value to a long integer If you just want to convert one integer value to real value please use REAL function Warnning The int_real L1 may cause controller un stable if the parameter L1 is not generated by a previous L1 real_int R1 command section 10 6 If this suitation happens for ex controller may automatically reset please delete the ISaGRAF program inside controller isa7188e d for 7188EG at INIT mode isa7188 d for 7188XG at INIT mode please refer to 1 3 7 for 1 8417 8817 8437 8837 RESET m 8417 8817 m 1 8437 8837 m 7188EG m1 7188XG m W 8XX7 W 8XX6 i reset Description Q Function Reset the controller return Q_ boolean The return value has no meaning since the controller will reset Note Please use this function very careful If the controller is always reset please refer to section 1 3 7 to delete the project inside the l 8xx7 controller Example if OK1 TRUE then OK1 is declared as boolean input TMP as boolean internal TMP _reset end_if 17000_EN m 8417 8817 m1 8437 8837 m 7188EG m l 7188XG m W 8XX7 W 8XX6 Description Function Enable Disable Bus7000 communication Please refer to Section 6 4 User s Manual Of ISaGRAF Embedded Controllers Mar 2006
94. e EEPROM the EEPROM write protection must be turned off The EEP_B_W EEP_BY_W EEP_WD_W and EEP_N_W functions should not be used to write to the EEPROM more than 100 000 times EEP NR m 8417 8817 m1 8437 8837 m1 7188EG m1 7188XG m W 8XX7 W 8XX6 eep n T Description ADR O Function read an signed 32 bit integer value from the EEPROM Argument ADR_ integer address in the EEPROM where the 32 bit integer value is stored 8xx7 7188EG XG 1 378 W 8xx7 1 3568 Q_ integer the signed 32 bit integer value returned EEP_N W m 8417 8817 m1 8437 8837 m1 7188EG m1 7188XG m W 8XX7 W 8XX6 Description Function write a signed 32 bit integer value to the EEPROM Arguments ADR_ integer address in the EEPROM where the 32 bit integer value is to be written to 8xx7 7188EG XG 1 378 W 8xx7 1 3568 DATA_ integer the 32 bit integer value to be written to Q_ Boolean Ok return TRUE Note If you are using this function with the EEP_WD_R EEP_WD_W EEP_BY_R and EEP_BY_W functions simultaneously you must be careful to arrange the ADR_ because they all occupy the same memory area For example ADR_2 of EEP_N_R occupies 4 bytes and it uses the same memory area as ADR_3 and ADR_4 of EEP_WD_R and the same address of ADR_5 6 7 and 8 of EEP_BY_R Read operation of the EEPROM will work without removing the EEPROM protection The EEP_B_W EEP_BY_W EEP_WD_W and EEP_N_W functions should not be used to write to the EEPROM more than 100 000
95. e several child programs A child of a program cannot have more than one father A child program can only be controlled by its father A program cannot control the children of one of its own children The basic actions that a father SFC program can take to control its child program are Start GSTART Starts the child program activates each of its initial steps Children of this child program are not automatically started Kill GKILL Kills the child program by deactivating each of its active steps All the children of the child program are also killed Freeze GFREEZE Suspends the execution of the program deactivates actions of each of the active steps and suspend transition calculation and memorises the status of the program steps so the program can be restarted All the children of the child program are also frozen Restart GRST Restarts a frozen SFC program by reactivating all the suspended steps Children of the program are not automatically restarted Get status GSTATUS Gets the current status active inactive or frozen of a child program User s Manual Of ISaGRAF Embedded Controllers Mar 2006 Rev 5 0 Copyright by ICP DAS Appendix 135 E 4 Flow Chart language Flow Chart FC is a graphic language used to describe sequential operations A Flow Chart diagram is composed of Actions and Tests Between Actions and test are oriented links representing data flow Multiple connection links are used to represents divergen
96. e starting Modbus address to write 0 65535 should be constant value not variable NUM_W_ integer the number of bits to write valid range from 1 to 4 should be constant value not variable ACTION_ boolean Set true to write set FALSE to do nothing B1_ B4_ boolean bits to write Q boolean Ok return TRUE else return FALSE Note The total number of MBUS_B_W MBUS_WEB blocks that can be used in one ISaGRAF project is up to I 8xx7 8 I 7188EG XG 64 W 8xx7 256 Example Refer to Chapter 8 or demo_ 16 User s Manual Of ISaGRAF Embedded Controllers Mar 2006 Rev 5 0 Copyright By ICP DAS Appendix 47 MBUS_N_R mbus_n_r m 1 8417 8817 m 1 8437 8837 m1 7188EG m1 7188XG m W 8XX7 W 8XX6 Q Description N1_ Function block Read 8 words 16 bit integer from the Mdobus device N2 Use Modbus function code 3 NS Arguments N4_ SLAVE_ integer slave No of the Modbus device valid range from 0 N5 to 255 should be constant value not variable ADDR_ integer the starting Modbus address to read 0 65535 N6_ should be constant value not variable ISLAVE N7 Q_ boolean Ok return TRUE else return FALSE N1_ N8_ integer the 8 word values that have been read valid range values from 32768 to 32767 JADDR__ N8 Note The total number of MBUS_N_R MBUS_R blocks that can be used in one ISaGRAF project is up to I 8xx7 8 I 7188EG XG 64 W 8xx7 256 Example Refer to Chapter 8 or demo_15a MBUS_
97. e statement is written Return value none Children of the child program are automatically killed with the specified program Note As GKILL is not in the IEC 1131 3 norm prefer the use of the R qualifier with the following syntax to kill a child SFC Child_name R Example See GSTART function described above GFREEZE statement Name GFREEZE Meaning Suspends the execution of a child SFC program Frozen program can be restarted by the GRST statement User s Manual Of ISaGRAF Embedded Controllers Mar 2006 Rev 5 0 Copyright by ICP DAS Appendix 168 Syntax GFREEZE lt child_program gt Operands the specified SFC program must be a child of the one in which the statement is written Return value none Children of the child program are automatically frozen along with the specified program Note GFREEZE is not in the IEC 1131 3 norm Example Suspend_cmd mb IACTION P GFREEZE Schild END_ACTION NOT Suspend_cmd leal N 3 ACTION P GRST Schild END_ACTION GRST statement Name GRST Meaning Restarts a child SFC program frozen by the GFREEZE statement Syntax GRST lt child_program gt Operands the specified SFC program must be a child of the one in which the statement is written Return value none Children of the child program are automatically restarted by the GRST statement Note GRST is not in the IEC 1131 3 norm
98. e terminated by a semicolon according to the following syntax lt boolean_expression gt The expression may be a TRUE or FALSE constant expression a single input or an internal boolean variable or a combination of variables that leads to a boolean value Below is an example of ST programming for transitions SFC program with ST programming for transitions A Run amp not Error E 3 6 2 LD convention The Ladder Diagram LD language can be used to describe the condition attached to a transition The diagram is composed of only one rung with one coil The coil value represents the transition value Below is an example of LD programming for transitions User s Manual Of ISaGRAF Embedded Controllers Mar 2006 Rev 5 0 Copyright by ICP DAS Appendix 132 Run Error HENO E 3 6 3 IL convention Instruction List IL programming may be directly used to describe an SFC transition according to the following syntax Finfo IL lt instruction gt lt instruction gt endinfo The value contained by the current result IL register at the end of the IL sequence causes the resulting of the condition to be attached to the transition current result 0 gt condition is FALSE current result lt gt 0 gt condition is TRUE The special info IL and endinfo keywords must be entered exactly this way and are case sensitive Space or tab characters cannot be inserted into after or be
99. e to be saved to Q_ boolean if OK return TRUE else return FALSE Note The datas stored in array are cleared after power off User s Manual Of ISaGRAF Embedded Controllers Mar 2006 Rev 5 0 Copyright By ICP DAS Appendix 13 ARY_N_R ary nr m 1 8417 8817 m 1 8437 8837 m l 7188EG ml 7188XG m W 8XX7 W 8XX6 4 Description las la Function Read one integer signed 32 bit from an integer array Arguments NUM_ integer array ID to be operated valid range values for the I 8xx7 amp l 7188EG XG is from 1 to 6 For W 8xx7 is 1 to 18 ADR__ integer address in the array where the integer is to be stored valid range DATA_ integer values from 1 to 256 the integer value returned ARY_N W m 8417 8817 m1 8437 8837 m1 7188EG m l 7188XG m W 8XX7 W 8XX6 Description Function Save one integer to an integer array Arguments NUM_ integer array ID to be operated valid range values for the l 8xx7 amp l 7188EG XG is from 1 to 6 For W 8xx7 is 1 to 18 ADR_ integer address in the array where the integer is to be stored valid range values from 1 to 256 DATA_ integer the integer value to be saved to Q_ boolean if OK return TRUE else return FALSE Note 1 The long integer array use the same memory as short integer array Be careful if using both of them at the same time Please refer to Section 4 5 Word array ID ADR Integer array ID ADR 1 1 1 1 1 2 1 3 1 2 1 4 12 255 6 256 12 25
100. ean OK return TRUE Note If using I 8xx7 8 I 7188EG s COM1 please set COM1 as non Modbus RTU port in advance before it can work refer to Appendix C 1 If Target is W 8xx7 please make sure its COM2 amp COM3 is not Modbus RTU port before using them Please refer to W 8xx7 s Getting Started Manual For l 8xx7 ComPort No on slot 0 Com5 Com8 ComPort No on slot 1 Com9 Com12 ComPort No on slot 2 Com13 Com16 ComPort No on slot 3 Com17 Com20 ComPort No on slot 4 7 is not available The long int array use the same memory as short interger array Be careful if use both of them at the same time please refer to Ary_n_r Ary_n_w Ary_w_r Ary_w_w User s Manual Of ISaGRAF Embedded Controllers Mar 2006 Rev 5 0 Copyright By ICP DAS Appendix 18 COMAY_WW m 8417 8817 m 1 8437 8837 m1 7188EG m I 7188XG m W 8XX7 W 8XX6 Description Function Write one short Integer Word array to COM PORT Each short integer is composed of 2 bytes And the format is a signed short int 32768 32767 Each short integer written is composed of 2 bytes in the below INTEL formate low byte high byte For ex if there is 3 short integers to write the first one is 16 0403 1 027 the second one is 16 0807 2 055 and the last one is 16 FFFE 2 The 6 bytes been written will be 03 04 07 08 FE FF Argument PORT_ integer 1 8xx7 1 3 20 I 7188EG 1 8 I 7188XG 2 8 W 8xx7 2 3 or ARY_NO_ integer array ID
101. ece 28 EBUS BM OS 28 EBUS IN A a ant oe A oleae a eiii 29 EBUS INV A A WS NG BSE ERG RES 29 BS Tomos 29 FER sees ete o eben toe ese o 30 EEP BOW aac de hace o O ESE 30 PEP BY Mee ie ae do e lado otha e lado lots sado 31 EPI Se 31 EEP EN it A TA ia 32 PEIN PR A al do 32 EEN oo 32 User s Manual Of ISaGRAF Embedded Controllers Mar 2006 Rev 5 0 Copyright By ICP DAS Appendix 1 A NN eR ONE RT NE RE EEN SOUR RAEI ANTE EOE 33 SIE oe oe RCC Re PU OU a at WOE wT 33 T ARAN NON UNO UN AA TUM SA Ade 34 A OR ER ret UR ener ER KIO R BPO Oe SEL 34 HS ena ee Ae A nL RR RRS niet we 34 e Dene aE VIP PE PIONS YG EP AN PONT PEPER EDD 35 FDELE NN 35 PD UR A A INN 36 A A DUNNO TONNiSere 36 A a hig ste E whan aie chia aber ed Ah A N aha landlines 37 TI I r a soli oh Mca A hao dis Saath 37 AN eNom eee re A A HON PONE AN een Pi 37 NARA cans eee tag ere alate tar ete A seg ee N 38 E O 38 A A nD elt Re Re Re TCR nee N PREETI IE hte 38 FV TE i atc at estar ea ect E choy ea da deds doc sacey TEA 39 E APO A A Rn uP ORES GRR PA ECA ur aN O NORE PTO 39 A A AAS nck E A 39 A E RAN A A A 40 A A A A AR AOS 40 E AN A MEU eh MAN ti lara E ls ciatathaaiaia 41 FS NW E e patie aac e ed de 41 A O MO EA 41 ES Ree RRR ER RCT E E Wiener 42 INTO 2b SAORI SIREN ECORI NOEL CAEN AAA AN 43 EIA A A an URI eR et aR On NCR EN 44 A Da A E IE A RIC Nt Neat 45 EE A A a 45 P7000 E esterase carats cna tanasle cast casts casks ena ttitas bh packs eet uote hia sisca nadi
102. ecution TUS SAA 112 E2 COMMON OBJECTS ai 2 pla mda EE A ASE Dabs ERE SS ERRE A A AAA 113 E21 Basie ypo S haa el aa wt as ars aed aes as Ved A A AA A iiel sale 113 E 2 2 Constant expressions ss ici cciaisiecads is dadsisiadedoied ia dada AAA AAA dia i n dai 113 EZ MANDOS Ae D NOTRE TETRA ER RR NEED RATS NER T IMR a RIOT MRR NTI MR TONES frome 115 FDA COMMON Soc cac tassel ldt ds 119 FZ D tined WONG S data 119 E 3 SEC LANGUAGE ds md loa meee nd loin mand nied Rite a Ra baled AAA 121 ESA SPC CHAM IAIN formata ereenn a e A AAA E AREAS Eaa 121 E352 SEG Dasie C mpon ents ta A AA E A AAA ads 121 E 3 3 Divergences and CONVELGENCES cccccccceeccceceeeeeeeeeseaanececeeeeeesseesaneeseeeeesssssaaaaaaees 123 E34 Macro Steps A cea 125 EJ ACHONS WIIN tAE Stop Sci ee 126 E 3 6 Conditions attached to transitions it AA 132 EST SFC DINARS iaa 134 ESO program Merarehy renesansna AT RAS AAA 134 E 4 FLOW CHART LANGUAGE lt ouicadra cal ae ta Ri AA INE ERA AA TARA AAA A AER EEEE 136 EATS COMDON E Sto 136 E 4 2 FC complex structures nacion noia ii dada tele Ea ia 139 E 4 3 FC dynamic behaviour 3 A AA A AA A Sip eee AAA 140 EAPC CHOCRING di AAA AAA A A Aia 140 EN FBD LANGUAGE inana AAA A a eee 141 E 5 1 FBD diagram INUATO DA AAA ARA A AAA A AAA 141 E 5 2 RETURN statement a ii AAA DA ADA a eee ess 142 E SUMS ANG IADES A A A AA aa Ea 142 EDA BOOIEAN RC III ANA AAA ERA AAA AA 143 E 5 5 Calling function or function blocks from the FBD oooooococcccococcccc
103. ed in an ST pulse action Below is an example of an SFC action The main SFC program is named Father It has two SFC children called SeqMlx and SeqPump The SFC programming of the father SFC program is SFC program using SFC actions 1 Start 1 2 _ Seqmix N 101 SeqPump S Full 102 SeqPump R 2 1 E 3 5 5 Calling function and function blocks from an action Sub programs functions or function blocks written in ST IL LD or FBD language or C functions and C function blocks can be directly called from an SFC action block based on the following syntax For sub programs functions and C functions ACTION P result sub_program END_ACTION or ACTION N result sub_program END_ACTION For function blocks in C or in ST IL LD FBD ACTION P Fbinst in1 in2 result1 Fbinst out1 User s Manual Of ISaGRAF Embedded Controllers Mar 2006 Rev 5 0 Copyright by ICP DAS Appendix 130 result2 Fbinst out2 END_ACTION ACTION N Fbinst in1 in2 result1 Fbinst out1 result2 Fbinst out2 END_ACTION Detailed syntax can be found in the ST language section Example of a sub program call in action blocks SFC program with a sub program call in an action block init SPInit End_action ae Init OK E 3 5 6 IL convention
104. ed in section A 4 are created by ICP DAS exclusively for the I 8xx7 l 7188EG XG amp W 8xx7 controller system After installing the ICP DAS Utilities For ISaGRAF please refer to section 1 2 these blocks in section A 4 can be found in the ISaGRAF Workbench program Please refer to section A 4 for the List Of Blocks created for the controller system ICP DAS continually strives to improve the functionality of the 8xx7 7188EG XG 8 W 8xx7 controller system and the ISaGRAF Workbench program Please visit the ICP DAS web site at http www icpdas com products PAC i 8000 isagraf ntm for updates and additions of new function blocks and functions created for the controller system Please refer to section A 2 for more information on how to Add New Blocks one by one To The ISaGRAF Workbench program Section 1 2 is to install all of them at once User s Manual Of ISaGRAF Embedded Controllers Mar 2006 Rev 5 0 Copyright By ICP DAS Appendix 7 Appendix A 2 Adding New Function Blocks To ISaGRAF To add or update functions or function blocks one by one for the SaGRAF Workbench program click on the Windows Start menu select Programs select ISaGRAF 3 4 or ISaGRAF 3 5 then click on Libraries to begin installing or updating ISaGRAF functions or function blocks la Jasc Software Diagnosis a Logitech MouseWare ES 15 Matrikon OPC Projects la MCSD Training Read Me a Microangelo EX Report a Microcim E Window Was
105. ek F_writ_b F_writ_f F_writ_s F_writ_w I 8417 8817 01 8437 8837 o I 7188EG no l 7188XG m W 8XX7 W 8XX6 SRC Description DES Q Function Copy one file to another one Argument SRC_ message File path of source file For ex data txt DES_ message File path of destination file For ex CompactFlash data1 dat Q_ boolean True Ok False error Note 1 Copy SRC_toDES_ 2 SRC must exist 3 If there is an old DES _ file existing it will be replaced by new contents 4 SRC_ amp DES_ file should be closed User s Manual Of ISaGRAF Embedded Controllers Mar 2006 Rev 5 0 Copyright By ICP DAS Appendix 34 F_CREAT f creat 1 8417 8817 o 8437 8837 01 7188EG oI 7188XG m W 8XX7 W 8XX6 PATH iD Description Function Creat an empty file for Reaing amp Writing Argument PATH_ message File path and name For ex CompactFlash data txt ID_ Integer file ID returned if error happens it returns O Note 1 If file is already exist it will be destroyed 2 Please refer to ISaGRAF standard function F_wopen F_ropen F_close F_eof Fa_read Fa_write F_wopen Open existing file for Read amp Write 3 Please refer to F_creat F_copy F_append F_dir F_end F_seek F_writ_b F_writ_f F_writ_s F_writ_w Example Wdemo_11 8 Wdemo_12 in W 8x37 CD ROM napdos isagrafiwincon demo 1
106. emo_11b User s Manual Of ISaGRAF Embedded Controllers Mar 2006 Rev 5 0 Copyright By ICP DAS Appendix 40 FBUS_N_R m 8417 8817 m1 8437 8837 m 7188EG m I 7188XG o W 8XX7 W 8XX6 Description Function block Read an integer package signed 32 bit from the Fbus device Arguments PACK_ integer which package No to read 1 128 N1_ N8_ integer the 8 integer values contained in the package Example Refer to Chapter 7 or demo_11b FBUS_N_W m 8417 8817 m1 8437 8837 m 7188EG m l 7188XG o W 8XX7 W 8XX6 Description Function block Write an integer package signed 32 bit to the Fbus device Arguments PACK_ integer write to which package No 1 128 N1_ N8_ boolean the 8 integer values contained in the package Q boolean always TRUE Example Refer to Chapter 7 or demo_11a FBUS_STS m 8417 8817 m1 8437 8837 m 7188EG m l 7188XG o W 8XX7 W 8XX6 Description Function Get Package Status of Fbus Arguments ID_ Integer to get what 0 Boolean package 1 Integer package PACK_ Integer get which package No 1 128 return Fbus_n_r N1_f N2_ N3_ N4_T N5_f N6_T N7_T PACK__N8 f Fbus_n_w Eo IN1_ JN2_ JN3_ ng _ IN5_ JN6_ IN7_ 1N8 af Q boolean TRUE package is alive FALSE dead communication break Example Please refer to demo_49a amp demo_49b User s Manual Of ISaGRAF Embedded Controllers Mar 2006 Rev 5 0 Copyright
107. ess in the EEPROM where the byte value is stored l 8xx7 7188EG XG 1 1512 W 8xx7 1 14272 Q_ integer the byte value returned 0 255 EEP_BY_W m 8417 8817 m1 8437 8837 m 7188EG m l 7188XG m W 8XX7 W 8XX6 Description Function write a byte 8 bit integer value to the EEPROM Arguments ADR_ integer address in the EEPROM where the byte value is to be written to l 8xx7 7188EG XG 1 1512 W 8xx7 1 14272 DATA_ integer the byte value to be written to valid range values from 0 to 255 Q_ Boolean Ok return TRUE Note If you are using this function with the EEP_WD_R EEP_WD_W EEP_N_R and EEP_N_W functions simultaneously you must be careful to arrange the ADR_ because they all occupy the same memory area For example ADR_2 of EEP_N_R occupies 4 bytes and it uses the same memory area as ADR_3 and ADR_4 of EEP_WD_R and the same address of ADR_5 6 7 and 8 of EEP_BY_R Read operation of the EEPROM will work without removing the EEPROM protection The EEP_B W EEP_BY_W EEP_WD_W and EEP_N_W functions should not be used to write to the EEPROM more than 100 000 times Example refer to demo_17 User s Manual Of ISaGRAF Embedded Controllers Mar 2006 Rev 5 0 Copyright By ICP DAS Appendix 31 EEP_EN m 8417 8817 m 8437 8837 m1 7188EG m 1 7188XG m W 8XX7 W 8XX6 O Description Function Remove the EEPROM write protection Argument Q_ Boolean Ok return TRUE Fail return FALSE BEFORE writing to th
108. ev 5 0 Copyright By ICP DAS Appendix 84 TIME_STR m 8417 8817 m1 8437 8837 m 7188EG m I 7188XG m W 8XX7 W 8XX6 Description Function Convert date amp time to string format Arguments YEAR_ integer year 2000 MON_ integer month 1 12 January December MDAY_ integer mday 1 31 WDAY_ integer wday 1 7 Monday Sunday HOUR_ integer hour 0 23 MIN_ integer minute 0 59 SEC_ integer second 0 59 If given wrong input parameters will return M_ empty string For ex give MON_ 14 return M_ message length is 24 characters For ex Feb 18 2003 13 25 45 Tue Note Please use sysdat_r amp systim_r to get system date amp time TWIN_LED twin_led m 83417 8817 m 1 8437 8837 m1 7188EG m1 7188XG o W 8XX7 W 8XX6 TRUN ahd Wi Description Function show a 2 screen values to the S MMI v2 Arguments pa RUN_ boolean to show if TRUE plai AE it V1i_ integer value displayed on the 2 digits on left of 1st screen 0 99 V2_ integer value displayed on the 2 digits on right of 1st screen 0 99 VAL__ integer value displayed on the 2nd screen 99999 99999 CLK_ timer the blinking period of these 2 screens Q_ boolean always TRUE Example refer to demo_10 User s Manual Of ISaGRAF Embedded Controllers Mar 2006 Rev 5 0 Copyright By ICP DAS Appendix 85 To _A4 20 m 8417 8817 m 8437 8837 m1 7188EG m 1 7188XG m W 8XX7 W 8XX6 Description Function Convert User s Engineering Val
109. fore the keywords Below is an example of IL programming for transitions SFC program with an IL program for transitions A nS Hinfo IL LD Run amp N Error endinfo E 3 6 4 Calling functions from a transition Any sub program or a function written in FBD LD ST or IL language or a C function can be called to evaluate the condition attached to a transition according to the following syntax lt sub_program gt The value returned by the sub program or the function must be boolean and yields the resulting condition return value FALSE gt condition is FALSE return value TRUE gt condition is TRUE Example of a sub program called in a transition User s Manual Of ISaGRAF Embedded Controllers Mar 2006 Rev 5 0 Copyright by ICP DAS Appendix 133 SFC program with sub program call for transitions 1 EvalCond E 3 7 SFC dynamic rules The five dynamic rules of the SFC language are amp Initial situation The initial situation is characterised by the initial steps which are by definition in the active state at the beginning of the operation At least one initial step must be present in each SFC program ES Clearing of a transition A transition is either enabled or disabled It is said to be enabled when all immediately preceding steps linked to its corresponding transition symbol are active otherwise it is disabled A transition cannot be cleared un
110. g SQRT AVERAGE FA WRITE NOT_MASK SR lt BLINK FIND ODD STACKINT lt BOO FM_READ OPERATE SYSTEM lt gt CAT FM_WRITE OR MASK TAN CHAR HYSTER POW TMR 1 XOR CMP INSERT R_TRIG TOF gt cos INTEGRAL RAND TON gt CTD LEFT REAL TP gt 1 OR CTU LIM_ALRM REPLACE TRUNC 1 gain CTUD LIMIT RIGHT XOR_MASK ABS DAY_TIME LOG ROL ACOS DELETE MAX ROR ANA DERIVATE MID RS AND_MASK EXPT MIN SEL ARCREATE F CLOSE MLEN SEMA HARREAD F EOF MOD SHL 3 ISaGRAF Project Management File Edit Project Tools Options Help Be beo me bottlef i same impleme User s guide Please refer to the on line help from the ISaGRAF workbench 10 x ISAGRAF BRO SEO RLM MIRAD SHB REAZSUSRO ISaGRAF RAO 12318 101 x Language reference Flow Chart S F roject architecture m demo demo with Qu Lommon objects Em rfarray demonstatre ommon objects fm r bars FC language Reference Author demonstrates graphic bra graphs blinker CJ International Date of creation 08 07 98 Version number ISaGRAF 3 30 Description Sequence between 4 leds D language Ea ST language Pre O orld ein language Standard operators function blocks and funy ons 20 Gm Wy Microsoft BseGRaF Gisscrar HB DA User s Manual Of ISaGRAF Embedded Controllers Mar 2006 Rev 5 0 Copyright By ICP DAS Appendix 6 The function blocks list
111. g state continue rung with eno state value User s Manual Of ISaGRAF Embedded Controllers Mar 2006 Rev 5 0 Copyright by ICP DAS Appendix 155 E 7 ST language ST Structured Text is a high level structured language designed for automation processes This language is mainly used to implement complex procedures that cannot be easily expressed with graphic languages ST is the default language for the description of the actions within the steps and conditions attached to the transitions of the SFC language E 7 1 ST main syntax An ST program is a list of ST statements Each statement ends with a semi colon separator Names used in the source code variable identifiers constants language keywords are separated with inactive separators space character end of line or tab stops or by active separators which have a well defined significance for example the gt separator indicates a greater than comparison Comments may be freely inserted into the text A comment must begin with and ends with Each statement terminates with a semi colon separator These are basic types of ST statements assignment statement variable expression sub program or function call function block call selection statements IF THEN ELSE CASE iteration statements FOR WHILE REPEAT control statements RETURN EXIT special statements for links with other languages such as SFC In
112. ger start from which address one Integer occupy 4 byte 256 1 249 856 512 1 512 000 X607 1 118 784 X608 1 512 000 1 16 3D000 1 16 7D000 1 16 1D000 1 16 7D000 AO AO O NUM_ Integer how many integers to write 0 4 N1_ N4_ Integer the integer value 32 bit signed to write The integer written in the SRAM is Lowest byte 2nd byte 3rd byte High byte for ex a integer of 16 01020304 it will be saved in the SRAM as 04 03 02 01 return Q_ Boolean Ok TRUE Fail FALSE User s Manual Of ISaGRAF Embedded Controllers Mar 2006 Rev 5 0 Copyright By ICP DAS Appendix 77 SRR SRR m 8417 8817 m1 8437 8837 m 7188EG m l 7188XG o W 8XX7 W 8XX6 ADR R Description Function Read one real value from the volatile SRAM Arguments ADR_ Integer read which address one Real value occupy 4 bytes S256 1 249 856 1 16 3D000 512 1 512 000 1 16 7D000 X607 1 118 784 1 16 1D000 X608 1 512 000 1 16 7D000 return R_ Real The real value been read 32 bit float The real value written in the SRAM is Lowest byte 2nd byte 3rd byte High byte For ex Real Value of 1 23 is consists of 4 bytes gt 16 A4 16 70 16 9D 16 3F S RW m 8417 8817 m 1 8437 8837 m1 7188EG m l 7188XG o W 8XX7 W 8XX6 Description Function Write up to 4 real values to the volatile SRAM Arguments ADR_ Integer start from which address one Real occupy 4 by
113. gnment of the return value for the sub program returned to the calling program User s Manual Of ISaGRAF Embedded Controllers Mar 2006 Rev 5 0 Copyright by ICP DAS Appendix 141 Input and output variables inputs and outputs of the function blocks are wired together with connection lines Single lines may be used to connect two logical points of the diagram An input variable and an input of a function block An output of a function block and an input of another block An output of a function block and an output variable The connection is oriented meaning that the line carries associated data from the left extremity to the right extremity The left and right extremities of the connection line must be of the same type Multiple right connection can be used to broadcast an information from its left extremity to each of its right extremities All the extremities of the connection must be of the same type E 5 2 RETURN statement The lt RETURN gt keyword may occur as a diagram output It must be connected to a boolean output connection point of a function block The RETURN statement represents a conditional end of the program if the output of the box connected to the statement has the boolean value TRUE the end remaining part of the diagram is not executed Example of an FBD program using RETURN statement gt 1 RETURN ST equivalence If auto_mode OR alarm Then Return End_if bo67 bi1
114. gram must be explicitly defined with a type and a unique name for each of its calling or return parameter In order to support the ST language convention the return parameter must have the same name as the sub program The following table shows how to set the value of the return parameter in the body of a sub program in the different languages ST assign the return parameter using its name the same name as the sub program subprog_name lt expression gt IL the value of the current result IL register at the end of the sequence is stored in the return parameter LD 10 ADD 20 return parameter value 30 FBD set the return parameter using its name subprog_name LD use a coil symbol with the name of the return parameter subprog_name LH E 1 5 Function blocks Function blocks can use the languages LD FBD ST or IL Function blocks are instantiated It means local variables of a function block are copied for each instance When calling a block in a program you actually call the instance of the block the same code is called but the data used are the one which have been allocated for the instance Values of the variables of the instance are stored from one cycle to the other User s Manual Of ISaGRAF Embedded Controllers Mar 2006 Rev 5 0 Copyright by ICP DAS Appendix 110 ST ing ST programming Function Block FB1 is a declared instance map ication of the SAMPLE function block FB1 h
115. he SRAM return Q_ boolean TRUE ok FALSE fail S_FL_RST s_fl_rst m 8417 8817 m 8437 8837 m1 7188EG m I 7188XG o W 8XX7 W 8XX6 ID Q Description Function Reset file s Status to Not been load by PC yet for the volatile SRAM Arguments ID_ Integer File identifier No 1 8 return Q_ Boolean TRUE ok FALSE fail Note 1 S_FL_INI should be called first 2 S_FL_STS can be called to get file s status Please refer to section 10 3 User s Manual Of ISaGRAF Embedded Controllers Mar 2006 Rev 5 0 Copyright By ICP DAS Appendix 68 S_FL_STS s_fl_sts m 8417 8817 m 1 8437 8837 m I 7188EG m 1 7188XG o W 8XX7 W 8XX6 ID END Description Function Get file s Status end byte No that has been load by PC for the volatile SRAM Arguments ID_ Integer File identifier No 1 8 return END_ Integer The end byte No that has been load by PC Not been load 1 S256 1 249 856 512 1 512 000 X607 1 118 784 X608 1 512 000 For ex A file of ID_ 1 is located at byte No of 1 20000 it can store up to 20000 bytes And its current available data is setting at 1001 10000 inside the volatile SRAM 1 If return END_ is 1 it means PC hasn t load it yet 2 If return END_ is 10000 Normally the value is equal to the current available ending byte No it means PC has load it from 1001 10000 3 If return END_ is 8000 it means PC has load it from 1001 8000 Note 1 S_FL_INI should
116. he same memory area For example ADR_2 of EEP_N_R occupies 4 bytes and it uses the same memory area as ADR_3 and ADR_4 of EEP_WD_R and the same address of ADR_5 6 7 and 8 of EEP_BY_R Read operation of the EEPROM will work without removing the EEPROM protection The EEP_B W EEP_BY_W EEP_WD_W and EEP_N_W functions should not be used to write to the EEPROM more than 100 000 times Example refer to demo_17 User s Manual Of ISaGRAF Embedded Controllers Mar 2006 Rev 5 0 Copyright By ICP DAS Appendix 33 EMAIL m 8417 8817 m l 8437 8837 o l 7188EG 01 7188XG o W 8XX7 W 8XX6 Description Function Block Send an email Please refer to Chapter 12 Sending Emails F_APPEND f_append l 8417 8817 o l 8437 8837 01 7188EG no l 7188XG m W 8XX7 W 8XX6 SRC_ Description DES Function Append one file to the other file Argument SRC_ message File path of source file For ex CompactFlash data txt DES_ message File path of destination file For ex CompactFlashidata1 txt Q_ boolean True Ok False error Note 1 If one of thses two files is not found return FALSE 2 Source and Destination file should be close not open 3 Please refer to ISaGRAF standard function F_wopen F_ropen F_close F_eof Fa_read Fa_write F_wopen Open existing file for Read 8 Write 4 Please refer to F_creat F_copy F_append F_dir F_end F_se
117. ical power rails These are basic graphic components of an LD diagram viis Left vertical power rail AAA Right vertical power rail Horizontal connection line Vertical connection line Multiple connection lines all connected together EU Contact associated with a variable Coil associated to an output or to an internal variable E 6 1 Power rails and connection lines An LD diagram is limited on the left and right side by vertical lines named left power rail and right power rail respectively Left power rail Right power rail s Jae CN NY LD diagram graphic symbols are connected to power rails or to other symbols by connection lines Connection lines are horizontal or vertical Je Horizontal connection lines ad El Q Vertical Vertical connection connection line with OR meaning User s Manual Of ISaGRAF Embedded Controllers Mar 2006 Rev 5 0 Copyright by ICP DAS Appendix 145 Each line segment has a boolean state FALSE or TRUE The boolean state is the same for all the segments directly linked together Any horizontal line connected to the left vertical power rail has the TRUE state E 6 2 Multiple connection The boolean state given to a single horizontal connection line is the same on the left and on the right extremities of the line Combining horizontal and vertical connection lines enables the building of multiple connections The b
118. igh value low 1 0 INSTANCE high alarm FB1 QH DATA low_alarm FB1 QL any_alarm FB1 Q Warnings A function block written with one of the IEC languages can not call other function blocks the instantiation mechanism only manages the local variables of the block itself Here is the list of standard function blocks that you cannot use inside an IEC function block SR RS R_Trig F_Trig SEMA CTU CTD CTUD TON TOF TP CMP StackInt AVERAGE HYSTER LIM_ALRM INTEGRAL DERIVATE BLINK SIG_GEN For the same reason you can not use Positive or Negative contact or coils or Set and Reset coils TSTART and TSTOP functions to start and stop timers cannot be used in a function block for 3 0x targets It works since the 3 20 target When you need loop in your function block you must use local variable before doing the loop See the example below This will not work This is OK Rest E 1 6 Description language A program can be described with any of the following graphic or literal languages Sequential Function Chart SFC for high level operations Flow Chart FC for high level operations Function Block Diagram FBD for cyclic complex operations Ladder Diagram LD for boolean operations only Structured Text ST for any cyclic operations Instruction List IL for low level operations User s Manual Of ISaGRAF Embedded Controllers Mar 2006 Rev 5 0 Copyright by ICP DAS Appe
119. il an inverse order is made by a SET coil The state of the left connection is propagated into the right connection Right connection may be connected to the right vertical power rail The associated boolean variable must be OUTPUT or INTERNAL Example using SET and RESET coils input output input2 outputi RH ST Equivalence IF input4 THEN output1 TRUE END_IF IF input2 THEN output1 FALSE END_IF Coil with rising edge detection Positive coils enable boolean output of a connection line boolean state This type of coils are only available using the Quick ladder editor boo_variable N GPa Left ened ad NX Right connection The associated variable is set to TRUE when the boolean state of the left connection rises from FALSE to TRUE The output variable resets to FALSE in all other cases The state of User s Manual Of ISaGRAF Embedded Controllers Mar 2006 Rev 5 0 Copyright by ICP DAS Appendix 151 the left connection is propagated into the right connection Right connection may be connected to the right vertical power rail The associated boolean variable must be OUTPUT or INTERNAL Example using a Positive coil input output pu fpi Loa U ST Equivalence IF input1 and NOT input1prev THEN output1 TRUE ELSE output1 FALSE END_IF input1prev is the value of input1 at the previous cycle Coil with falling edge detection
120. in2 2 ana in1 ST temporary temporary result LD ind ANA ADD temporary result 4 ana in2 2 ana in1 ana in0 ST SUBPRO return current result to calling program Calling function blocks CAL operator Operation calls a function block Allowed modifiers CN Operand Name of the function block instance The input parameters of the blocks must be assigned before the call using LD ST operations sequence Output parameters are known if used Example1 Calling function block SR SR1 is an instance of SR LD auto_mode AND start_cmd ST SR1 set1 LD stop_cmd ST SR1 reset CAL SR1 LD SR1 Q1 ST command FBD equivalent amp auto_mode SR start_cmd sem stop cmd RESET at command Example 2 We suppose R_TRIG1 is an instance of R_TRIG block and CTU1 is an instance of CTU block LD command ST R_TRIG1 clk CAL R_TRIG1 LD R_TRIG1 Q ST CTU cu User s Manual Of ISaGRAF Embedded Controllers Mar 2006 Rev 5 0 Copyright by ICP DAS Appendix 177 LDN auto mode ST CTU1 reset LD 100 ST CTU1 pv CAL CTU1 LD CTU1 Q ST overflow LD CTU1 cv ST result FBD equivalent command auto_mode overflow 100 result User s Manual Of ISaGRAF Embedded Controllers Mar 2006 Rev 5 0 Copyright by ICP DAS Appendix 178 Appendix F How to Enable Disable W 8x47 s LAN2 Important 1 Please always set LAN2 as di
121. integer to a fixed length hexa message Arguments VAL__ integer the value to be converted DIGIT_ integer number of digits of HEX_ valid values are 1 8 Given others will do no conversion and force HEX_to empty message HEX_ message the hex message after conversion Example val_hex 100 3 gt 064 val_hex 192 4 gt 00CO val_hex 4589 2 gt ED 11ED DIGIT_ is 2 force 11 trucated val_hex 4589 9 gt DIGIT_ gt 8 output val_hex 2 8 gt FFFFFFFE VAL10LED m 8417 8817 m1 8437 8837 m 7188EG m l 7188XG o W 8XX7 W 8XX6 Description Function disply an decimal integer on the S MMI Arguments RUN_ Boolean if TRUE display it FLASH_ Boolean if TRUE blink it CLK_ Timer the blinking period VAL_I_ Integer the integer to be displayed Range from 9999 to 99999 Q_ Boolean always returns TRUE Example refer to demo_07 demo_11b val10led t 500ms ST equivalence out1 VAL10OLED TRUE TRUE t 500ms 9875 out1 is declared as a boolean variable User s Manual Of ISaGRAF Embedded Controllers Mar 2006 Rev 5 0 Copyright By ICP DAS Appendix 90 VAL16LED m 8417 8817 m1 8437 8837 m 7188EG m l 7188XG o W 8XX7 W 8XX6 val l6led Description Function display an hexadecimal integer on S MMI Arguments RUN_ Boolean if TRUE display it FLASH_ Boolean if TRUE blink it CLK_ Timer the blinking period VAL_I_ integer the value to be displayed Valid range fro
122. iption Function Enable the download permission for PC to download data to the volatile SRAM return Q_ Boolean TRUE ok FALSE fail Note The default setting is Disable S_DL_EN sholud be called then PC download data to the volatile SRAM is possible S_DL_RST m 8417 8817 m1 8437 8837 m1 7188EG m1 7188XG o W 8XX7 W 8XX6 s dl rst Description Function Reset the Download Status to 1 No action for the volatile SRAM return Q_ Boolean TRUE ok FALSE fail S DL_STS m 8417 8817 m 1 8437 8837 m I 7188EG m I 7188XG o W 8XX7 W 8XX6 s dl sts Description STS Function Get PC s Download Status for the volatile SRAM return STS_ Integer 1 No action 1 PC is Downloading data to the SRAM now 2 download accomplishment Note S_DL_RST can be called to reset the status to 1 reset to No action Please refer to section 10 3 User s Manual Of ISaGRAF Embedded Controllers Mar 2006 Rev 5 0 Copyright By ICP DAS Appendix 65 SETLED set_led m 8417 8817 m 8437 8837 m1 7188EG m l 7188XG o W 8XX7 W 8XX6 zi Description Function Displays A Message To The S MMI Arguments RUN_ Boolean Set To TRUE To Display Message FLASH_ Integer Set each digit To 1 To blink each Message Example Set To 11 0000011 Means The 6 amp 7 Display Positions Will Blink Set To 100001 0100001 Means The 2 amp 7 Display Positions Will blink CLK__ Timer Amount Of Time For Display To blonk LED1_
123. irectory to change User s Manual Of ISaGRAF Embedded Controllers Mar 2006 Rev 5 0 Copyright by ICP DAS Appendix 179
124. is an example of ST programming using defines If OK Then angle PI 2 0 isdone YES End_if Defined words can be LOCAL to one program GLOBAL or COMMON Local defined words can be used by only one program Global defined words can be used in any program of the project Common defined words can be used in any program of any project Note that common defined can be stored separately with the Archive manager Warning When the same identifier is defined twice with different ST equivalencies the last defined expression is used For example Define OPEN is FALSE OPEN is TRUE User s Manual Of ISaGRAF Embedded Controllers Mar 2006 Rev 5 0 Copyright by ICP DAS Appendix 119 means OPEN is TRUE Naming defined words must conform to following rules name cannot exceed 16 characters first character must be a letter following characters can be letters digits or underscore _ character Warning A defined word can not use a defined word in its definition for example you can not have Pl is 3 14159 PI2 is PI2 write the complete equivalence using constants or variables and operations PI2 is 6 28318 User s Manual Of ISaGRAF Embedded Controllers Mar 2006 Rev 5 0 Copyright by ICP DAS Appendix 120 E 3 SFC language Sequential Function Chart SFC is a graphic language used to describe sequential operations The process is represented as a set of well defined steps linked by transitions A boolean co
125. is not Boolean typed returns 0 6 If long integer value 32 bit integer is to be delivered to HMI via Modbus protocol it should occupy 2 Modbus address No Please refer to section 4 2 of User s Manual Of The ISaGRAF Embedded Controllers Example Wincon Wdemo_24 4 I 8xx7 demo_70 User s Manual Of ISaGRAF Embedded Controllers Mar 2006 Rev 5 0 Copyright By ICP DAS Appendix 62 SBR m 8417 8817 m1 8437 8837 m1 7188EG m l 7188XG o W 8XX7 W 8XX6 SBR Description ADR BOO Function Read one boolean from the volatile SRAM Arguments ADR__ Integer read which address one Boolean occupy 1 byte 256 1 249 856 1 16 3D000 512 1 512 000 1 16 7D000 X607 1 118 784 1 16 1D000 X608 1 512 000 1 16 7D000 return BOO _ Boolean The boolean value been read is O FALSE not 0 TRUE Ss BW m 8417 8817 m1 8437 8837 m 7188EG m I 7188XG o W 8XX7 W 8XX6 Description Function Write up to 4 boolean to the volatile SRAM Arguments ADR_ Integer start from which address one boolean occupy 1 byte 256 1 249 856 512 1 512 000 X607 1 118 784 X608 1 512 000 1 16 3D000 1 16 7D000 1 16 1D000 1 16 7D000 SS ae NUM_ Integer how many booleans to write 0 4 B1_ B4_ Boolean the boolean value to write return Q_ Boolean Ok TRUE Fail FALSE The boolean value will be stored is FALSE 0 TRUE 1 Please refer to section 10 3 User s Manual Of ISaGRAF Embed
126. is operation Allowed modifiers N Operand internal or output variable result analog variable result timer variable result NOT boolean variable AO AO O Example EXAMPLES OF ST OPERATIONS STboo LD false ST boo_var1 boo_var1 FALSE STN boo_var2 boo_var2 TRUE STana LD 123 User s Manual Of ISaGRAF Embedded Controllers Mar 2006 Rev 5 0 Copyright by ICP DAS Appendix 173 ST ana_var1 ana_var1 123 STtmr LD t 12s ST tmr_var1 tmr_var1 t 12s S operator Operation stores the boolean value TRUE in a boolean variable if the current result has the boolean value TRUE No operation is processed if current result is FALSE The current result is not modified by this operation Allowed modifiers none Operand output or internal boolean variable Example EXAMPLES OF S OPERATIONS SETex LD true current result TRUE S boo_var1 boo_var1 TRUE current result is not modified LD false current result FALSE S boo_var1 nothing done boo_var1 unchanged R operator Operation stores the boolean value FALSE in a boolean variable if the current result has the boolean value TRUE No operation is processed if current result is FALSE The current result is not modified by this operation Allowed modifiers none Operand output or internal boolean variable Example EXAMPLES OF R OPERATIONS RESETex LD true c
127. is started User s Manual Of ISaGRAF Embedded Controllers Mar 2006 Rev 5 0 Copyright by ICP DAS Appendix 121 Initial step Start motor 1 An SFC program must contain at least one initial step These are the attributes of a step Such fields may be used in any of the other languages GSnnn x activity of the step boolean value GSnnnt activation duration of the step time value where nnn is the reference number of the step E 3 2 2 Transitions Transitions are represented by a small horizontal bar that crosses the connection link Each transition is referenced by a number written next to the transition symbol A main description of the transition is written on the right side of the transition symbol This description is a free comment not part of the programming language The above information is called the Level 1 of the transition Reference number A NAS O command E 3 2 3 Oriented links Single lines are used to link steps and transitions These are oriented links When the orientation is not explicitly given the link is oriented from the top to the bottom Explicit orientation from transition 11 to setp 100 100 Implicit orientation from step 100 to transition 10 101 11 User s Manual Of ISaGRAF Embedded Controllers Mar 2006 Rev 5 0 Copyright by ICP DAS Appendix 122 E 3 2 4 Jump to a step Jump symbols may be used to indicate a connection link from a transition to a step without having to dr
128. lean input board IDs c free channel of an integer input board User s Manual Of ISaGRAF Embedded Controllers Mar 2006 Rev 5 0 Copyright by ICP DAS Appendix 116 ISs c free channel of a message input board QXs c free channel of a boolean output board QDs c free channel of an integer output board SQSs c free channel of a message output board Below are the naming conventions of a directly represented variable for a channel of a complex equipment s is the slot number of the equipment b is the index of the single board within the complex equipment c is the number of the channel free channel of a boolean input board free channel of an integer input board free channel of a message input board free channel of a boolean output board free channel of an integer output board free channel of a message output board IXs IDs ISs QXS QDs QSs corer ers o aQaaaaa Below are examples QX1 6 6th channel of the board 1 boolean output ID2 1 7 7th channel of the board 1 in the equipment 2 integer input A directly represented variable cannot have the real data type E 2 3 3 Boolean variables Boolean means logic Such variables can take one of the boolean values TRUE or FALSE Boolean variables are typically used in boolean expressions Boolean variables can have one of the following attributes Internal memory variable updated by the program Constant read only memory variable with an initial value Inp
129. less itis enabled and the associated transition condition is true E Changing of state of active steps The clearing of a transition simultaneously leads to the active state of the immediately following steps and to the inactive state of the immediately preceding steps e Simultaneous clearing of transitions Double lines may be used to indicate transitions which have to be cleared simultaneously If such transitions are shown separately the activity state of preceding steps GSnnn x can be used to express their conditions e Simultaneous activation and deactivation of a step If during operation a step is simultaneously activated and deactivated priority is given to the activation E 3 8 SFC program hierarchy The ISaGRAF system enables the description of the vertical structure of SFC programs SFC programs are organised in a hierarchy tree Each SFC program can control start kill other SFC programs Such programs are called children of the SFC program which controls them SFC programs are linked together into a main hierarchy tree using a father child relation FATHER program CHILD program User s Manual Of ISaGRAF Embedded Controllers Mar 2006 Rev 5 0 Copyright by ICP DAS Appendix 134 The basic rules implied by the hierarchy structure are SFC programs which have no father are called main SFC programs Main SFC programs are activated by the system when the application starts A program can hav
130. lines An output of a function block may also be connected to an input of another block Function A Hoy MN An entire function operated by an FBD program is built with standard elementary function blocks from the ISaGRAF library Each function block has a fixed number of input connection points and a fixed number of output connection points A function block is represented by a single rectangle The inputs are connected on its left border The outputs are connected on its right border An elementary function block performs a single function between its inputs and its outputs The name of the function to be performed by the block is written in its rectangle symbol Each input or output of a block has a well defined type Name of the function f fF a Input variables of an FBD program must be connected to input connection points of function blocks The type of each variable must be the same as the type expected for the associated input An input for FBD diagram can be a constant expression any internal or input variable or an output variable Output variables of an FBD program must be connected to output connection points of function blocks The type of each variable must be the same as the type expected for the associated block output An Output for FBD diagram can be any internal or output variable or the name of the program for sub programs only When an output is the name of the currently edited sub program it represents the assi
131. low links A flow link is a line that represents a flow between two points of the diagram A link is always terminated by an arrow Below is the drawing of a flow link Two links cannot start from the same source connection point User s Manual Of ISaGRAF Embedded Controllers Mar 2006 Rev 5 0 Copyright by ICP DAS Appendix 136 FC actions An action symbol represents actions to be performed An action is identified by anumber and a name Below is the drawing of an action symbol nn Name Two different objects of the same chart cannot have the same name or logical number Programming language for an action can be ST LD or IL An action is always connected with links one arriving to it one starting from it FC conditions A condition represents a boolean test A condition is identified by a number and a name According to the evaluation of attached ST LD or IL expression the flow is directed to YES or NO path Below are the possible drawings for a condition symbol YES YES YES YES NO NO Two different objects of the same chart cannot have the same name or logical number The programming of a test is either an expression in ST or a single rung in LD with no symbol attached to the unique coil or several instructions in IL The IL register or current result is used to evaluate the condition When programmed in ST text the expression may optionally be followed by a semicolon When programmed in LD
132. m 16 0 to 16 FFFFF Q_ Boolean always return TRUE Example val16led t 500ms 16 A20E6 ST equivalence OUT1 VAL1O0OLED TRUE FALSE t 500ms 16 A20E6 OUT1 is declared as a boolean variable V_BCD V_BCD m 8417 8817 m1 8437 8837 m 7188EG m I 7188XG m W 8XX7 W 8XX6 I Q Description Function Convert value to BCD value Arguments IN_ integer the value to be converted Q_ integer the returned BCD value For ex 12345 gt 16 12345 16 gt 22 16 16 User s Manual Of ISaGRAF Embedded Controllers Mar 2006 Rev 5 0 Copyright By ICP DAS Appendix 91 WD_BIT m 8417 8817 m1 8437 8837 m1 7188EG m l 7188XG m W 8XX7 W 8XX6 Description Function block Convert a word value to 16 boolean values Arguments VAL_ integer the word to be converted ENO boolean no usage don t care about it B1_ B16_ boolean the 16 boolean values after converted For ex If VAL_ is 4 B3_ will be TRUE and others will be FALSE If VAL_ is 3 B1_ and B2_ will be TRUE and others will be FALSE WD_LONG m 8417 8817 m1 8437 8837 m 7188EG m1 7188XG m W 8XX7 W 8XX6 Description Function Convert two words to one long integer Arguments Lo_ integer Low word only the lowest 16 bit is used Hi integer High word only the lowest 16 bit is used Long_ integer the 32 bit integer composed by Lo_ and Hi_ word Example Lo_ Hi_ gt Long_ 32768 8000 1 FFFF gt 32768 FFFF 8000 4 FFFF 4 FFFF gt 1 FFFF FFFF
133. m1 8437 8837 m1 7188EG m 1 7188XG m W 8XX7 W 8XX6 Description Function Save one byte to a byte array Arguments NUM_ integer array ID to be operated valid range values for the 8xx7 amp 7188EG XG is from 1 to 24 For W 8xx7 is 1 to 48 ADR_ integer address in the array where the byte is to be stored for the I 8xx7 amp 7188EG XG is from 1 to 256 For W 8xx7 is 1 to 512 DATA_ integer the byte value to be saved to valid range values from 0 to 255 Q_ boolean if OK return TRUE else return FALSE User s Manual Of ISaGRAF Embedded Controllers Mar 2006 Rev 5 0 Copyright By ICP DAS Appendix 12 ARY_F_R 1 8417 8817 o 8437 8837 01 7188EG oI 7188XG m W 8XX7 W 8XX6 ary_f_r Description NUM_ Function Read one float value 32 bit format from an float array ADR DATA Arguments NUM_ integer array ID to be operated valid range values is from 1 to 18 ADR__ integer address in the array where the integer is to be stored valid range values from 1 to 256 DATA_ real the float value returned ARY_F_W 1 8417 8817 o 8437 8837 01 7188EG oI 7188XG m W 8XX7 W 8XX6 Description Function Save one float value 32 bit format to an float array Arguments NUM_ integer array ID to be operated valid range values is from 1 to 18 ADR__ integer address in the array where the integer is to be stored valid range values from 1 to 256 DATA_ real the float valu
134. ndition is attached to each transition Actions within the steps are detailed by using other languages ST IL LD and FDB E 3 1 SFC chart main format An SFC program is a graphic set of steps and transitions linked together by oriented links Multiple connection links are used to represent divergences and convergences Some parts of the complete program may be separated and represented in the main chart by a single symbol called macro steps The basic graphic rules of the SFC are A step cannot be followed by another step A transition cannot be followed by another transition E 3 2 SFC basic components The basic components graphic symbols of the SFC language are steps and initial steps transitions oriented links and jumps to a step E 3 2 1 Steps and initial steps A step is represented by a single square Each step is referenced by a number written in the step square symbol A main description of the step is written in a rectangle linked to the step symbol This description is a free comment not part of the programming language The above information is called the Level 1 of the step Reference number Comment At run time a token indicates that the step is active Active step Inactive step Start motor 1 The initial situation of an SFC program is expressed with initial steps An initial step has a double bordered graphic symbol A token is automatically placed in each initial step when the program
135. ndix 111 The same program cannot mix several languages The language used to describe a program is chosen when the program is created and cannot be changed later on The exception is that it is possible to combine FBD and LD in a single program E 1 7 Execution rules ISaGRAF is a synchronous system All the operations are triggered by a clock The basic duration of the clock is called the cycle timing Cycle timing Programmed Used Free Basic operations processed during a target cycle are Scan INPUT variables Process Begin section programs ISaGRAF Process Sequential section programs target cycle according to SFC FC evolution rules Process End section programs Update OUTPUT devices This system makes it possible to guarantee that an input variable keeps the same value within a cycle guarantee that an output device is not updated more than once in a cycle work safely on the same global variable from different programs estimate and control the response time of the complete application User s Manual Of ISaGRAF Embedded Controllers Mar 2006 Rev 5 0 Copyright by ICP DAS Appendix 112 E 2 Common objects These are main features and common objects of the ISaGRAF programming database Such objects can be used in any program written with any of the SFC FC FBD LD ST or IL languages E 2 1 Basic types Any constant expression or variable used in a program written in any language must be cha
136. ng HEAD _ 1 TAIL_ 1000 the current available data of the file will be at 1 1000 inside the volatile SRAM It means when you load this file from PC its size is 1000 bytes 3 if setting HEAD_ 10001 TAIL_ 5000 the current available data of the file will be at 10001 20000 and then continued with 1 5000 inside the volatile SRAM It means when you load this file from PC its size is 15000 bytes 4 if setting HEAD_ 1000 TAIL_ 1000 no data of the file is available It means when you load this file from PC its size is O byte return Q_ boolean TRUE ok FALSE fail Note S_FL_INI should be called once before S_FL_AVL is called User s Manual Of ISaGRAF Embedded Controllers Mar 2006 Rev 5 0 Copyright By ICP DAS Appendix 67 S FL_INI m 8417 8817 m 1 8437 8837 m I 7188EG m I 7188XG o W 8XX7 W 8XX6 Description Function Init one file s name amp location for the volatile SRAM Arguments ID_ Integer File identifier No 1 8 NAME _ Message File name up to 8 char for the name amp up to 3 char for the extension For ex data1 txt A1234567 bin Valid char are A Z a z _ 0 9 and the 1st should be A Zora z BEGIN_ Integer The begin byte No of the file BEGIN _ must less than END_ END_ Integer The end byte No of the file BEGIN _ must less than END __ S256 1 249 856 512 1 512 000 X607 1 118 784 X608 1 512 000 For ex BEGIN_ 101 END_ 5000 the file resides at 101 5000 inside t
137. nnect the variable with the required type The EN input On some operators functions or function blocks the first input does not have boolean data type As the first input must always be connected to the rung another input is automatically inserted at the first position called EN The block is executed only if the EN input is TRUE Below is the example of a comparison operator and the equivalent code expressed in ST IF rung _ state THEN a valuel gt value 2 valued ELSE q FALSE END IF waluez continue rung with q state The ENO output On some operators functions or function blocks the first output does not have boolean data type As the first output must always be connected to the rung another output is automatically inserted at the first position called ENO The ENO output always takes the same state as the first input of the block Below is an example with AVERAGE function block and the equivalent code expressed in ST AVERAGE rung _state Signal 100 OutSignal AVERAGE XOUT OutSignal eno rung state continue rung with eno state The EN and ENO parameters User s Manual Of ISaGRAF Embedded Controllers Mar 2006 Rev 5 0 Copyright by ICP DAS Appendix 154 On some cases both EN and ENO are required Below is an example with an arithmetic operator and the equivalent code expressed in ST IF rung _state THEN result valuel value2 resut END_IF eno run
138. nteger The bits or words received If CODE_is 1 amp 2 N1_ returns bit 1 to 16 N2_ returns bit 17 to 32 N12_ returns bit 177 to 192 If CODE_is3 amp 4 N1_toN12_ returns the associated words 32768 to 32767 N1_ to N12_ is absolutly correct Only when Q return TRUE comm ok Note The total number of MBUS_N_R MBUS_R MBUS_R blocks that can be used in one ISaGRAF project is up to I 8xx7 amp I 7188EG XG 64 W 8xx7 256 User s Manual Of ISaGRAF Embedded Controllers Mar 2006 Rev 5 0 Copyright By ICP DAS Appendix 50 MBUS_ R1 m 8417 8817 m l 8437 8837 mI 7188EG m l 7188XG m W 8XX7 W 8XX6 mbus_ Description Function block Read Modbus code 1 4 from the Modbus device with period time ISaGRAF controller is the Master remote equipment is Slave adapt Modbus function code 1 or 2 or 3 or 4 please make sure the remote device support the associated Modbus function code Arguments SLAVE_ integer ADDR_ integer CODE_ integer NUM_ integer PERIOD__ integer Q_ boolean N1_ N12_ integer slave No of the Modbus device valid range from 0 to 255 should be constant value not variable the starting Modbus address to read 0 65535 ri Q NIL N2_ N3_ N4_ NSL NGL N7_ NBL Ng_ should be constant value not variable N10 Request which Modbus function codes 1 4 should be constant value not variable Request how many bits 1 192 for code 1 8 2 or How N12 many words 1 12 for
139. nual Of ISaGRAF Embedded Controllers Mar 2006 Rev 5 0 Copyright By ICP DAS Appendix 107 E 1 Project architecture An ISaGRAF project is divided into several programming units called programs The programs of the project are linked together in a tree like architecture Programs can be described using any of SFC FC Flow Chart FBD LD ST or IL graphic or literal languages E 1 1 Programs A program is a logical programming unit which describes operations between variables of the process Programs describe either sequential or cyclic operations Cyclic programs are executed at each target system cycle The execution of sequential programs follows the dynamic rules of either the SFC language or the FC language Programs are linked together in a hierarchy tree Programs placed on the top of the hierarchy are activated by the system Sub programs lower level of the hierarchy are activated by their father A program can be described with any of the available graphic or literal following languages Sequential Function Chart SFC for high level programming Flow Chart FC for high level programming Function Block Diagram FBD for cyclic complex operations Ladder Diagram LD for boolean operations only Structured Text ST for any cyclic operations Instruction List IL for low level operations The same program cannot mix several languages except LD and FBD can be combined in one diagram E 1 2 Cyclic and sequential operations
140. o read 0 65535 should be constant value not variable PERIOD__ integer read data depends on period time default is 1 sec The value should be 1 600 sec Q_ boolean Ok return TRUE else return FALSE B1_ B8_ boolean the 8 boolean values that have been read Note The total number of MBUS_BR1 MBUS_B_R that can be used in one ISaGRAF project is up to l 8xx7 amp 7188EG XG 64 W 8xx7 256 User s Manual Of ISaGRAF Embedded Controllers Mar 2006 Rev 5 0 Copyright By ICP DAS Appendix 46 Mbus_EN 1 8417 8817 no l 8437 8837 01 7188EG 01 7188XG m W 8XX7 W 8XX6 mbus_en Description Function This function can EnablelDisable Mbus or Mbus_asc Arguments EN_mbus_ boolean TRUE Enable FALSE Disable PORT_ integer 2 COM2 3 COM3 5 COM5 to 9 COM9 or 10 MSP1 11 MSP2 12 MSP3 13 MSP4 14 MSP5 Q_ boolean False PORT_ Number error TRUE Ok Note 1 Default status is Enable 2 Only work when I O complex equipment mbus or mbus_asc is connected MBUS_B_W m 8417 8817 m 1 8437 8837 m1 7188EG m I 7188XG m W 8XX7 W 8XX6 Description Function block write 1 to 4 bits booleans to the Mdobus device Use Modbus function code 5 when NUM_W 1 Use Modbus function code 15 when NUM_W 2 to 4 Arguments SLAVE_ integer slave No of the Modbus device valid range from 0 to 255 should be constant value not variable ADDR_ integer th
141. ollers Mar 2006 Rev 5 0 Copyright by ICP DAS Appendix 157 limited_value min 16 max 0 input_value rol_msg right message mlen message 1 left message 1 Calling function blocks Name name of the function block instance Meaning calls a function block from the ISaGRAF library or from the user s library and accesses its return parameters Syntax call of the function block lt blockname gt lt p1 gt lt p2 gt gets its return parameters lt result gt lt blockname gt lt ret_param1 gt lt result gt lt blockname gt lt ret_paramN gt Operands parameters are expressions which match the type of the parameters specified for that function block Return value See Syntax to get the return parameters Consult the ISaGRAF library to find the meaning and type of each function block parameter The function block instance name of the copy must be declared in the dictionary Example ST program calling a function block declare the instance of the block in the dictionary trigb1 block R_TRIG rising edge detection function block activation from ST language trigb1 b1 return parameters access If trigb1 Q Then nb_edge nb_edge 1 End_if E 7 4 ST specific boolean operators The following boolean operators are specific to the ST language REDGE rising edge detection FEDGE falling edge detection Other standard boolean operators such a
142. oolean state of the extremities of a multiple connection follows logic rules A multiple connection on the left combines more than one horizontal lines connected on the left side of a vertical line and one line connected on its right side The boolean state of the right extremity is the LOGICAL OR between all the left extremities Example of multiple LEFT connection vl v2 vB right extremity state is v1 OR v2 OR v3 A multiple connection on the right combines one horizontal line connected on the left side of a vertical line and more than one line connected on its right side The boolean state of the left extremity is propagated into each of the right extremities Example of multiple RIGHT connection input output Reso 3 output ST equivalence output1 input1 output2 input1 A multiple connection on the left and on the right combines more than one horizontal line connected on the left side of a vertical line and more than one line connected on its right side The boolean state of each of the right extremities is the LOGICAL OR between all the left extremities Example of multiple LEFT and RIGHT connection User s Manual Of ISaGRAF Embedded Controllers Mar 2006 Rev 5 0 Copyright by ICP DAS Appendix 146 input output P input2 output ae owpnts ST Equivalence output1 input1 OR input2 output2 input1 OR input2
143. output3 input1 OR input2 E 6 3 Basic LD contacts and coils There are several symbols available for input contacts Direct contact Inverted contact Contacts with edge detection There are several symbols available for output coils Direct coil Inverted coil SET coil RESET coil Coils with edge detection The name of the variable is written above any of these graphic symbols Direct contact A direct contact enables a boolean operation between a connection line state and a boolean variable boo_variable gt Lar connection Left connection The state of the connection line on the right of the contact is the LOGICAL AND between the state of the left connection line and the value of the variable associated with the contact Example using DIRECT contacts input1 input2 output et A D ST Equivalence output1 input1 AND input2 Inverted contact User s Manual Of ISaGRAF Embedded Controllers Mar 2006 Rev 5 0 Copyright by ICP DAS Appendix 147 An inverted contact enables a boolean operation between a connection line state and the boolean negation of a boolean variable boo_variable a ie Right connection Left connection The state of the connection line on the right of the contact is the LOGICAL AND between the state of the left connection line and the boolean negation of the value of the variable associated with the contact Example using INVERTED contacts inpu
144. perator completed with optional modifiers and if necessary for the specific operation one or more operands separated with commas A label followed by a colon may precede the instruction If a comment is attached to the instruction it must be the last component of the line Comments always begin with and ends with Empty lines may be entered between instructions Comments may be put on empty lines Below are examples of instruction lines Label Operator Operand Comments Start LD 1X1 push button ANDN MX5 command is not forbidden ST QX2 start motor Labels A label followed by a colon may precede the instruction A label can be put on an empty line Labels are used as operands for some operations such as jumps Naming labels must conform to the following rules name cannot exceed 16 characters first character must be a letter following characters must be letters digits or _ character The same name cannot be used for more than one label in the same IL program A label can have the same name as a variable Operator modifiers The available operator modifiers are shown below The modifier character must complete the name of the operator with no blank characters between them N boolean negation of the operand delayed operation C conditional operation The N modifier indicates a boolean negation of the operand For example the instruction ORN 1X12 is interpreted as result
145. plement HEX 2 s Complement HEX_ 7FFF_ E6DO Type 32767 22118 2 s Complement HEX A99A User s Manual Of ISaGRAF Embedded Controllers Mar 2006 Rev 5 0 Copyright By ICP DAS Appendix 102 32767 8847 2 s Complement HEX 32767 HO 2 s Complement HEX 32767 fo 2 s Complement HEX 32767 HO 2 s Complement HEX 32767 6805 2 s Complement HEX 32767 HO 2 s Complement HEX 32767 8192 2 s Complement HEX 16384 32768 2 s Complement HEX 32767 7281 2 s Complement HEX User s Manual Of ISaGRAF Embedded Controllers Mar 2006 Rev 5 0 Copyright By ICP DAS Appendix 103 l 7021 Range Code Data Format ax Value in Value Hex 32767 o o 2 s complement HEX 31 32767 2 s complement HEX 3 2 Decimal Value 32767 bo o oS O Default 2 s complement HEX l 7022 Range TYPE ly ata Format ax Value in Value Hex 32767 po o 2 s complement HEX 32767 o o 2 s complement HEX Output Range H00v Default 32767 o o 2 s complement HEX User s Manual Of ISaGRAF Embedded Controllers Mar 2006 Rev 5 0 Copyright By ICP DAS Appendix 104 l 8024 Each channel can be configured to different range ID 32767 bo 32767 32768 l 87024 l 7024 EP A 32767 o o 32767 o o 32767 bo MiS _ Default A o o uuu ammm Saree ay m a User s Manual Of ISaGRAF Embedded Controllers Mar 2006 Rev 5 0 Copyright By ICP DAS Appendix 105 Appendix E LANGUAGE REFERENCE copyright AlterS
146. push4key board User s Manual Of ISaGRAF Embedded Controllers Mar 2006 Rev 5 0 Copyright By ICP DAS Appendix 43 INP TGLED inp l6led m 8417 8817 m1 8437 8837 01 7188EG no I 7188XG o W 8XX7 W 8XX6 Description Function input an hexadecimal integer from the S_MMI Arguments RUN_ Boolean When TRUE Process 8 Display Value To S MMI VAL_I_ Integer Initial Value Displayed On S MMI Minimum Value Is 0 maximum is 16 FFFF NUM_ Integer Number Of Digits To Display Valid Range From 1 To5 U1_ Boolean When Rising From FALSE To TRUE Add 1 To The Currently Displayed Digit D1_ Boolean When Rising From FALSE To TRUE Subtract 1 From The Currently Displayed Digit L1_ Boolean When Rising From FALSE To TRUE Shift Left 1 Position From Currently Displayed Digit R1_ Boolean When Rising From FALSE To TRUE Shift Right 1 Position From Currently Displayed Digit VAL_O_ integer The Displayed Integer Value After Operation Example inp16led TRUE 16 2F04 UU FALSE LL FALSE ST equivalence A INP16LED TRUE 16 2F04 4 UU FALSE LL FALSE A is declared as an integer variable UU LL are declared as boolean variables can be linked to push4key board User s Manual Of ISaGRAF Embedded Controllers Mar 2006 Rev 5 0 Copyright By ICP DAS Appendix 44 m 8417 8817 m1 8437 8837 m1 7188EG m I 7188XG m W 8XX7 W 8XX6 Description Function Map a long integer to a Real valu
147. r of the standard ASCII table ASCII code from 0 to 255 The null character can exist in a character string Some C functions of the standard ISaGRAF library will not correctly operate messages which contain null 0 characters User s Manual Of ISaGRAF Embedded Controllers Mar 2006 Rev 5 0 Copyright by ICP DAS Appendix 118 E 2 4 Comments Comments may be freely inserted in literal languages such as ST and IL A comment must begin with the special characters and terminate with the characters Comments can be inserted anywhere in a ST program and can be written on more than one line These are examples of comments counter ivalue assigns the main counter this is a comment expressed on two lines c counter you can put comments anywhere base_value 1 Interleave comments cannot be used This means that the characters cannot be used within a comment Warning The IL language only accepts comments as the last component of an instruction line E 2 5 Defined words The ISaGRAF system allows the re definition of constant expressions true and false boolean expressions keywords or complex ST expressions To achieve this an identifier name has to be given to the corresponding expression For example YES is TRUE PI is 3 14159 OK is auto_mode AND NOT alarm When such equivalence is defined its identifier can be used anywhere in an ST program to replace the attached expression This
148. racterised by a type Type coherence must be followed in graphic operations and literal statements These are the available basic types for programming objects BOOLEAN logic true or false value ANALOG integer or real floating continuous value TIMER time value MESSAGE character string Note Timers contain values less than one day and cannot be used to store dates E 2 2 Constant expressions Constant expressions are relative to one type The same notation cannot be used to represent constant expressions of different types E 2 2 1 Boolean constant expressions There are only two boolean constant expressions TRUE is equivalent to the integer value 1 FALSE is equivalent to the integer value O True and False keywords are case insensitive E 2 2 2 Integer analog constant expressions Integer constant expressions represent signed long integer 32 bit values from 2147483647 to 2147483647 Integer analog constants may be expressed with one of the following bases Integer constants must begin with a prefix that identifies the bases used Base Prefix Example DECIMAL none 908 HEXADECIM 167 16 1A2B3C4D AL OCTAL 8 8 1756402 BINARY 2 2 1101_0001_0101_110 1 User s Manual Of ISaGRAF Embedded Controllers Mar 2006 Rev 5 0 Copyright by ICP DAS Appendix 113 The underscore character _ may be used to separate groups of digits It has no particular significance and is used to increase constant expression reada
149. rdware CTS RTS 7188EG XG 3 5 False by software XON XOF 7188EG XG 3 8 Q boolean OK return TRUE If Target is W 8xx7 please make sure its COM2 is not Modbus RTU port before using them Please refer to W 8xx7 s Getting Started Manual User s Manual Of ISaGRAF Embedded Controllers Mar 2006 Rev 5 0 Copyright By ICP DAS Appendix 22 COMREAD comread m 8417 8817 m1 8437 8837 m1 7188EG m l 7188XG m W 8XX7 W 8XX6 PORT_ DATA Description Function Read one byte from a COM port Argument PORT_ integer I 8xx7 1 3 20 1 7188EG 1 8 I 7188XG 2 8 W 8xx7 2 3 or Q_ integer the data returned Note If using 8xx7 amp I 7188EG s COM1 please set COM1 as non Modbus RTU port in advance before it can work refer to Appendix C 1 If Target is W 8xx7 please make sure its COM2 amp COM3 is not Modbus RTU port before using them Please refer to W 8xx7 s Getting Started Manual Forl 8xx7 ComPort No on slot 0 Com5 Com8 ComPort No on slot 1 Com9 Com12 ComPort No on slot 2 Com13 Com16 ComPort No on slot 3 Com17 Com20 ComPort No on slot 4 7 is not available Call COMREADY to test data coming or not If there is data COMREAD amp COMARY R can be used to read the data If no data comimg do not call COMREAD amp COMARY R or COM port will block Example Refer to COMREADY example User s Manual Of ISaGRAF Embedded Controllers Mar 2006 Rev 5 0 Copyright By ICP
150. resent a time value but an analog constant E 2 2 5 Message string constant expressions String or message constant expressions represent character strings Characters must be preceded by a quote and followed by an apostrophe For example THIS IS A MESSAGE Warning The apostrophe character cannot be used within a string constant expression A string constant expression must be expressed on one line of the program source code Its length cannot exceed 255 characters including spaces User s Manual Of ISaGRAF Embedded Controllers Mar 2006 Rev 5 0 Copyright by ICP DAS Appendix 114 Empty string constant expression is represented by two apostrophes with no space or tab character between them this is an empty string The special character dollar followed by other special characters can be used in a string constant expression to represent a non printable character Sequen Meaning ASCII Example ce hexa 6 24 I paid 5 for ae ter YES carriage Tae llo R He return 16 0d This is a line N Oa PR 16 0c lastline P first line 16 09 l name Tsize Td ate Shh any 16 hh ABCD charac o ter hh is the hexadecimal value of the ASCII code for the expressed character E 2 3 Variables Variables can be LOCAL to one program or GLOBAL Local variables can be used by one program only Global variables can be used in any program of the project Variable names must conform
151. ro step is described separately elsewhere in the same SFC program It appears as a single symbol in the main SFC chart This is the symbol used for a macro step User s Manual Of ISaGRAF Embedded Controllers Mar 2006 Rev 5 0 Copyright by ICP DAS Appendix 125 Reference number Comment Process A The reference number written in the macro step symbol is the reference number of the first step in the body of the macro step The macro step body must begin with a beginning step and terminate with an ending step The chart must be self contained A beginning step has no upper link no backward transition An ending step has no lower link no forward transition A macro step symbol may be put in the body of another macro step Warning Because macro step is a unique set of steps and transitions the same macro step cannot be used more than once in an SFC program Example of macro step SFC program with macro step Main chart Body of the macro step 1 _ Initialize 201 Fill WUnit unit full 1201 Error _ Run amp not Error 202 Weigh 1 101 2 Alarm 201 _ Weighing _ weighing done 202 Ack _ true 203 Empty WUnit 2 102 unit empty 1203 204 Store weight 1 E 3 5 Actions within the steps The level 2 of an SFC step is the detailed description of the actions executed during the step activi
152. s NOT boolean negation AND amp logical AND OR logical OR XOR logical exclusive OR can be used Their description is to be found in the section Standard operators function blocks and functions REDGE operator Name REDGE Meaning evaluates the rising edge of a complete boolean expression User s Manual Of ISaGRAF Embedded Controllers Mar 2006 Rev 5 0 Copyright by ICP DAS Appendix 158 Syntax lt edge gt REDGE lt boo_expression gt lt memo_variable gt Operands first operand is any boolean variable or complex expression second operand is an internal boolean variable used to store the last state of the expression Return value TRUE when the expression changes from FALSE to TRUE FALSE for all other cases The rising edge of an expression cannot be detected more than once in the same execution cycle using the REDGE operator This operator can be used to describe the condition attached to an SFC transition Warning The memory boolean variable used to store the last state of the expression cannot be used as a trigger for edges of different expressions When the expression is a boolean variable named xxx a unique internal variable named EDGE_xxx should be declared and used it in the REDGE expressions for this variable This method ensures that the memory variable is not overwritten during other REDGE evaluations Example ST program using REDGE operator this program counts the
153. s An FC father program is blocked waits during execution of an FC sub program It is not possible that simultaneous operations are done in father FC program and one of its FC sub programs E 1 4 Functions and sub programs A sub program or a function execution is driven by its parent program The execution of the parent program is suspended until the sub program or the function ends main sub programs Any program of any section may have one or more sub programs A sub program is owned by only one father program A sub program may have local variables and defines Any language but SFC or FC can be used to describe a sub program Programs of the Functions section are sub programs that can be called by any other program in the project Unlike other sub programs they are not dedicated to one father program A User s Manual Of ISaGRAF Embedded Controllers Mar 2006 Rev 5 0 Copyright by ICP DAS Appendix 109 program of the Function section can call another program of this section A function can be located in the Library Warning The ISaGRAF system does not support recursive function calls A run time error will occur if a program of the Functions section is called by itself or by one of its called sub program Warning A function or sub program does not store the local value of its local variables A function or sub program is not instantiated and so can not call function blocks The interface of a sub pro
154. sabled if not using it 2 Please always set a fixed IP to LAN1 or LANZ if it is enabled The default setting of LAN2 port of W 8047 8347 8747 amp W 8046 8346 8746 is disabled User must enable it before using LAN2 port Please open Start Setting Control Panel and then click on Network and Dual up Connections to set as LAN2 DM9CE1 Enable or Disable O 2 e 9 gt Deg aired ES B gt A Y 2 ES Certificates Date Time Dialing Display Input Panel Internet Keyboard Mouse Options 22 9 O MH xX see Y Password PC Power Regional Remove Storage System Volume amp Connection Settings Programs Manager Sounds File Edit View Advanced gt lt les fa a Make New DMSCEO Connection Right Click on DM9CE1 and then set as Enable or Disable Rename Properties Then run Start Programs Wincon Utility click Save and Reboot to save the setting WinCon Utility 1 Save Registry system Config Auto execute Version Update About Wincon Utility 1 Testing It will take several seconds to save your settings to registry and settings you changed will take effect after system reboot y Any setting changed could be pre viewd View Registry Change all settings to factory default settings Recover to Factory Settings Change FTP default E directory to S Change Change HTTP default d
155. t booleans Test is equal to 0 is made with the JMPC operator JMPex LD selector selector is O or 1 or 2 BOO conversion to boolean JMPC test1 if selector O then LD true ST bo0 boO true RET end return O decrease selector test1 LD selector SUB 1 selector is now 0 or 1 BOO conversion to boolean JMPC test2 if selector O then LD true ST bo1 bo1 true LD 1 load real selector value RET end return 1 last possibility test2 RETNC returns if the selector has an invalid value LD true ST bo2 bo2 true LD 2 load real selector value end return 2 User s Manual Of ISaGRAF Embedded Controllers Mar 2006 Rev 5 0 Copyright by ICP DAS Appendix 175 operator Operation executes a delayed operation The delayed operation was notified by Allowed modifiers none Operand none Example The following program interleaves delayed operations res a1 a2 a3 a4 a5 a Delayed LD a1 result a1 ADD a2 delayed ADD result a2 MUL a3 delayed MUL result a3 SUB a4 result a3 a4 execute delayed MUL result a2 a3 a4 MUL a5 result a2 a3 a4 a5 execute delayed ADD result a1 a2 a3 a4 a5 ADD a6 result a1 a2 a3 a4 a5 a6 ST res store current result in vari
156. t modified by the TSTOP command Syntax TSTOP lt timer_variable gt Operands any active timer variable Return value none Example See TSTART the function is described above GSTART statement Name GSTART Meaning starts a child SFC program by putting a token into each of its initial steps User s Manual Of ISaGRAF Embedded Controllers Mar 2006 Rev 5 0 Copyright by ICP DAS Appendix 167 Syntax GSTART lt child_program gt Operands the specified SFC program must be a child of the one in which the statement is written Return value none Children of the child program are not automatically started by the GSTART statement Note As GSTART is not in the IEC 1131 3 norm prefer the use of the S qualifier with the following syntax to start a child SFC Child_name S Example Use of GSTART and GKILL Sequence Sfather Sequence Schild 1 1 _ Bo100 Run_cmd GS1 t gt t 2s 7 2 ACTION P 2 Bo101 GSTART Schild END_ACTION l GS2 t gt t 2s NOT Run_cmd Se ACTION P GKILL Schild END_ACTION Run_cmd lt GKILL statement Name GKILL Meaning kills a child SFC program by removing the tokens currently existing in its steps Syntax GKILL lt child_program gt Operands the specified SFC program must be a child of the one in which th
157. t4 input2 output1 HA H ST Equivalence output1 NOT input1 AND NOT input2 Contact with rising edge detection This contact positive enables a boolean operation between a connection line state and the rising edge of a boolean variable boo_variable e k va Ms Right connection Left connection The state of the connection line on the right of the contact is set to TRUE when the state of the connection line on the left is TRUE and the state of the associated variable rises from FALSE to TRUE It is reset to FALSE in all other cases Example using RISING EDGE contacts input1 input2 output H p a E Ny ST Equivalence output1 input1 AND input2 AND NOT input2prev input2prev is the value of input2 at the previous cycle Contact with falling edge detection This contact negative enables a boolean operation between a connection line state and the falling edge of a boolean variable User s Manual Of ISaGRAF Embedded Controllers Mar 2006 Rev 5 0 Copyright by ICP DAS Appendix 148 boo_variable ae Left connection Right connection The state of the connection line on the right of the contact is set to TRUE when the state of the connection line on the left is TRUE and the state of the associated variable falls from TRUE to FALSE It is reset to FALSE in all other cases Example using FALLING EDGE contacts input1 input2 output1 H IN ES po IN Ne
158. te S256 1 249 856 1 16 3D000 512 1 512 000 1 16 7D000 X607 1 118 784 1 16 1D000 X608 1 512 000 1 16 7D000 NUM_ Integer how many real values to write O 4 R1_ R4_ Real the real value 32 bit float to write The real value written in the SRAM is Lowest byte 2nd byte 3rd byte High byte For ex Real Value of 1 23 is consists of 4 bytes gt 16 A4 16 70 16 9D 16 3F return Q_ Boolean Ok TRUE Fail FALSE User s Manual Of ISaGRAF Embedded Controllers Mar 2006 Rev 5 0 Copyright By ICP DAS Appendix 78 S_WD_R S WD R m 8417 8817 m1 8437 8837 m1 7188EG m l 7188XG o W 8XX7 W 8XX6 ADE N Description Function Read one word from the volatile SRAM Arguments ADR_ Integer read which address one Word occupy 2 bytes 256 1 249 856 512 1 512 000 X607 1 118 784 X608 1 512 000 1 16 3D000 1 16 7D000 1 16 1D000 1 16 7D000 AO AO O return N_ Integer The word value been read 32768 32767 The word written in the SRAM is Low byte High byte for ex a integer of 16 0102 it will be saved in the SRAM as 02 01 S WD_W m 8417 8817 m 1 8437 8837 m I 7188EG m I 7188XG o W 8XX7 W 8XX6 Description Function Write up to 4 words to the volatile SRAM Arguments ADR_ Integer start from which address one Word occupy 2 bytes 256 1 249 856 512 1 512 000 X607 1 118 784 X608 1 512 000 1 16 3D000 1 16
159. teger however the related variable is Boolean typed no write action 5 If TYPE_ is given as boolean however the related variable is not Boolean typed no write action 6 If long integer value 32 bit integer is to be delivered to HMI via Modbus protocol it should occupy 2 Modbus address No Please refer to section 4 2 of User s Manual Of The ISaGRAF Embedded Controllers Example Wincon Wdemo_24 amp I 8xx7 demo_70 User s Manual Of ISaGRAF Embedded Controllers Mar 2006 Rev 5 0 Copyright By ICP DAS Appendix 93 Appendix B Setting The IP Mask amp Gateway In The 1 8437 8837 amp 1 7188EG This document describe the proper way to set the IP address address mask and gateway address of the I 8437 8837 8 I 7188EG controllers kkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk EACH l 8437 8837 or l 7188EG USES TCP IP PORT NO 502 TO TALK TO THE HMI AND ISAGRAF WORKBENCH A MAX NUMBER OF 4 PCS CAN TALK TO THE 8437 8837 or l 7188EG THROUGH MODBUS TCP IP PROTOCOL kkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk 1 Create a file folder named 8000 in your hard drive For example c 8000 2 Copy Napdos ISaGRAF 8000 Driver 7188xw exe 7188xw ini from the CD_ROM into your 8000 folder 3 Run 8000 7188xw exe in your hard drive A 7188xw screen will appear 4 Link from COM1 or COM2 of your PC to COM1 of the I 8437 8837 or I 7188EG controller by a RS232
160. the target point generally the name of the target symbol Below is the standard drawing of a connector User s Manual Of ISaGRAF Embedded Controllers Mar 2006 Rev 5 0 Copyright by ICP DAS Appendix 138 nn Name A connector always targets a defined Flow Chart symbol The destination symbol is identified by its logical number FC comments A comment block contains text that has no sense for the semantic of the chart It can be inserted anywhere on an unused space of the Flow Chart document window and is used to document the program Below is the drawing of a comment symbol comment text can S be on several lines E 4 2 FC complex structures This section shows complex structure examples that can be defined in a Flow Chart diagram Such structures are combinations of basic objects linked together NO IF THEN ELSE 1 place for THEN actions to be inserted 2 place for ELSE actions to be inserted O REPEAT UNTIL 3 place for repeated actions to be inserted WHILE DO 3 place for repeated actions to be inserted User s Manual Of ISaGRAF Embedded Controllers Mar 2006 Rev 5 0 Copyright by ICP DAS Appendix 139 E 4 3 FC dynamic behaviour The execution of a Flow Chart diagram can be explained as follows The Begin symbol takes one target cycle The End symbol takes one target cycle and ends the execution of the chart After this symbol is reached no more actions of the chart are executed
161. the unique coil represents the condition value A condition equal to 0 or FALSE directs the flow to NO 1 or TRUE directs the flow to YES A test is always connected with an arriving link and both forward connections must be defined FC sub program The system enables the description of the vertical structure of FC programs FC programs are organised in a hierarchy tree Each FC program can call other FC programs Such a program is called a child program of the FC program which calls them FC programs which call FC sub programs are called father program FC programs are linked together into a main hierarchy tree using a father child relation User s Manual Of ISaGRAF Embedded Controllers Mar 2006 Rev 5 0 Copyright by ICP DAS Appendix 137 FATHER program CHILD program A sub program symbol in a Flow Chart represents a call to a Flow Chart sub program Execution of the calling FC program is suspended till the sub program execution is complete A Flow Chart sub program is identified by a number and a name as other programs functions or function blocks Below is the drawing of a sub program call symbol IE Two different objects of the same chart cannot have the same logical number The basic rules implied by the FC hierarchy structure are FC programs which have no father are called main FC programs Main FC programs are activated by the system when the application starts A program can have several child programs
162. tion call limited_value min 16 max 0 input_value RETURN statement Name RETURN Meaning terminates the execution of the current program Syntax RETURN Operands none In an SFC action block the RETURN statement indicates the end of the execution of that block only Example FBD specification of the program programmable counter ST implementation of the program using RETURN statement If not CU then Q false CV 0 RETURN terminates the program end_if if R then CV 0 else if CV lt PV then CV CV 1 end_if end_if Q CV gt PV IF THEN ELSIF ELSE statement User s Manual Of ISaGRAF Embedded Controllers Mar 2006 Rev 5 0 Copyright by ICP DAS Appendix 161 Name IF THEN ELSIF THEN ELSE END_IF Meaning executes one of two lists of ST statements selection is made according to the value of a boolean expression Syntax IF lt boolean_expression gt THEN lt statement gt lt statement gt ELSIF lt boolean_expression gt THEN lt statement gt lt statement gt ELSE lt statement gt lt statement gt END IF The ELSE and ELSIF statements are optional If the ELSE statement is not written no instruction is executed when the condition is FALSE Example ST program using IF statement IF manual AND not alarm THEN level manual_level bx126 bi12 OR bi45 ELSIF over_mode THEN level max
163. ty This description is made by using SFC literal features and other languages such as Structured Text ST The basic types of actions are Boolean actions Pulse actions programmed in ST Non stored actions programmed in ST SFC actions User s Manual Of ISaGRAF Embedded Controllers Mar 2006 Rev 5 0 Copyright by ICP DAS Appendix 126 Several actions with same or different types can be described in the same step The special features that enable the use of any of the other languages are Calling sub programs Instruction List IL language convention E 3 5 1 Boolean actions Boolean actions assign a boolean variable with the activity of the step The boolean variable can be an output or an internal It is assigned each time the step activity starts or stops This is the syntax of the basic boolean actions lt boolean_variable gt N assigns the step activity signal to the variable lt boolean_variable gt same effect N attribute is optional I lt boolean_variable gt assigns the negation of the step activity signal to the variable Other features are available to set or reset a boolean variable when the step becomes active This is the syntax of set and reset boolean actions lt boolean_variable gt S sets the variable to TRUE when the step activity signal becomes TRUE lt boolean_variable gt R resets the variable to FALSE when the step activity signal becomes TRUE The boolean variable must be an
164. ue Real format to Variable s AO value Integer format Analog output signal is 4 to 20mA Arguments EngVal_ Real the Engineering value to be converted Range_ Integer Range setting of the Analog output board or module 16 0 Oto20mA 16 1 4 to 20 mA 16 30 Oto 20mA 16 31 4 to 20 mA HiVal_ Real User s related High Eng value when analog ouput signal is 20 mA LoVal_ Real User s related Low Eng value when analog output signal is 4 mA For example Convert 0 100 psi to become l 8024 s AO value please set HiVal_ 100 0 LoVal_ 0 0 and Range_ 16 30 depeneds on the range setting of the related IO board return Q_ Integer The AO value after conversion value is usually in 0 to 32767 depends on which Range setting of the IO board If given incorrect Range_ or HiVal_ LoVal_ returns 1 Example Scale 0 to 3000 rpm to I 8024 s current output with range setting of 30 0 to 20 mA 0 rpm should output 4 mA 3000 rpm outputs as 20 mA TO A4 20 l 8024_2_01 is declared as integer output Rpm_val is declared as Real internal User s Manual Of ISaGRAF Embedded Controllers Mar 2006 Rev 5 0 Copyright By ICP DAS Appendix 86 To V0 10 m 1 8417 8817 m1 8437 8837 m I 7188EG m1 7188XG m W 8XX7 W 8XX6 Description Function Convert User s Engineering Value Real format to Variable s AO value Integer format Analog output signal is 0 to 10V Arguments EngVal_ Real the Engineering value to be converte
165. urrent result TRUE R boo_var1 boo_var1 FALSE current result is not modified ST boo_var2 boo_var2 TRUE LD false current result FALSE R boo_var1 nothing done boo_var1 unchanged JMP operator Operation jumps to the specified label Allowed modifiers C N Operand label defined in the same IL program Example the following example tests the value of an analog selector 0 or 1 or 2 to set one from 3 output booleans Test is equal to 0 is made with the JMPC operator JMPex LD selector selector is O or 1 or 2 BOO conversion to boolean User s Manual Of ISaGRAF Embedded Controllers Mar 2006 Rev 5 0 Copyright by ICP DAS Appendix 174 JMPC test1 if selector O then LD true ST bo0 boO true JMP JMPend end of the program test1 LD selector SUB 1 decrease selector is now 0 or 1 BOO conversion to boolean JMPC test2 if selector O then LD true ST bo1 bo1 true JMP JMPend end of the program test2 LD true last possibility ST bo2 bo2 true JMPend end of the IL program RET operator Operation ends the current instruction list If the IL sequence is a sub program the current result is returned to the calling program Allowed modifiers C N Operand none Example the following example tests the value of an analog selector 0 or 1 or 2 to set one from 3 outpu
166. used in one ISaGRAF project is up to I 8xx7 8 7188EG XG 64 W 8xx7 256 User s Manual Of ISaGRAF Embedded Controllers Mar 2006 Rev 5 0 Copyright By ICP DAS Appendix 52 MI_BOO m 8417 8817 m 1 8437 8837 m1 7188EG m 1 7188XG m W 8XX7 W 8XX6 Description Function Display a boolean value on MMICON Arguments X_ integer X position 1 30 Y_ integer Y position 1 8 BOO_ boolean boolean value to display TRUE display ON FALSE display OFF Q_ boolean Ok return TRUE else return FALSE MI_INP_N mi inp n m 8417 8817 m1 8437 8837 m1 7188EG m l 7188XG m W 8XX7 W 8XX6 EN Description INIT INT Function Input an integer value from MMICON Arguments EN_ boolean TRUE enable INIT_ integer Initial value to input INT_ integer The integer value been input If EN_ is FALSE it returns 0 Note MI_INP_N 8 MI_INP_S Can be used only at one place in the project Called at 2 or more places will work fail Demo Please refer to Chapter 16 8 demo_38 demo_39 User s Manual Of ISaGRAF Embedded Controllers Mar 2006 Rev 5 0 Copyright By ICP DAS Appendix 53 MI_INP_S m 1 8417 8817 m 1 8437 8837 m 1 7188EG m 1 7188XG m W 8XX7 W 8XX6 mi_inp_s EN_ Description INIT STR Function Input an string from MMICON Arguments EN_ boolean TRUE enable INIT_ message Initial string value to input STR_ message The string been input If EN_ is FALSE it returns empty string Note MI_INP_N amp MI_INP_S Can be used only at one
167. ut variable connected to an input device refreshed by the system Output variable connected to an output device Warning When declaring a boolean variable strings can be defined to replace true and false values during debug Those strings cannot be used in the programs unless entered as defined words for the language E 2 3 4 Analog variables Analog means continuous Such variables have signed integer or real floating values Available formats for an analog variable are Integer 32 bit signed integer from 2147483647 to 2147483647 Real standard IEEE 32 bit floating value single precision 1 sign bit 23 mantissa bits 8 exponent bits User s Manual Of ISaGRAF Embedded Controllers Mar 2006 Rev 5 0 Copyright by ICP DAS Appendix 117 REAL analog exponent value cannot be less than 37 or greater than 37 Analog variables can have one of the following attributes Internal memory variable updated by the program Constant read only memory variable with an initial value Input variable connected to an input device refreshed by the system Output variable connected to an output device Note When a real variable is connected to an I O device the corresponding I O driver operates the equivalent integer value Warning Integer and real analog variables or constant expressions cannot be mixed in the same analog expression E 2 3 5 Timer variables Timer means clock or counter Such variables have time values an
168. verwritten during other FEDGE evaluations Example ST program using FEDGE operator this program counts the falling edges of a boolean input Bi120 is an input boolean variable Edge_Bi120 is the memory of the Bi120 variable state If FEDGE Bi120 Edge_Bi120 Then Counter Counter 1 End_if Note this operator is not in the IEC1131 3 norm You may prefer the use of F_TRIG standard block It has been kept for compatibility reasons E 7 5 ST basic statements The basic statements of the ST language are Assignment RETURN statement IF THEN ELSIF ELSE structure CASE statement WHILE iteration statement REPEAT iteration statement FOR iteration statement EXIT statement Assignment Name Meaning assigns a variable to an expression Syntax lt variable gt lt any_expression gt Operands variable must be internal or output variable and expression must have the same type The expression can be a call to a sub program or a function from the ISaGRAF library Example ST program with assignments variable lt lt variable bo23 bo10 User s Manual Of ISaGRAF Embedded Controllers Mar 2006 Rev 5 0 Copyright by ICP DAS Appendix 160 variable lt lt expression bo56 bx34 OR alrm100 amp level gt over_value result 100 input_value scale assignment with sub program return value rc PSelect assignment with func
169. xample of single divergence and convergence SFC program with single divergence and convergence 1 Run 4 not Error Error 1 1101 2 Start Motor M1 101 Alarm M started _ Acknowledge 2 102 3 Start timer timer gt t 3s al 4 Stop motor M1 a M1 stopped 1 E 3 3 2 Double divergences A double divergence is a multiple link from one transition to many steps It corresponds to parallel operations of the process A double convergence is a multiple link from many steps to the same transition A double convergence is generally used to group the SFC branches started on a double divergence Double divergences and convergences are represented by double horizontal lines User s Manual Of ISaGRAF Embedded Controllers Mar 2006 Rev 5 0 Copyright by ICP DAS Appendix 124 T Double divergence NX Double convergence Example of double divergence and convergence SFC program with double divergence and convergence 1 Initialize Run 1 2 _ Process1 1 01 __ Process2 End of Process 1 ke End of Process 2 2 1101 3 Wait for process 2 102 Wait for process 2 pal true 3 1 E 3 4 Macro steps A macro step is a unique representation of a unique group of steps and transitions The body of the mac
170. ys printed with permission User s Manual Of ISaGRAF Embedded Controllers Mar 2006 Rev 5 0 Copyright By ICP DAS Appendix 106 ISAGRAF Version 3 46 LANGUAGE REFERENCE AlterSys Inc Information in this document is subject to change without notice and does not represent a commitment on the part of AlterSys Inc The software which includes information contained in any databases described in this document is furnished under a license agreement or nondisclosure agreement and may be used or copied only in accordance with the terms of that agreement It is against the law to copy the software except as specifically allowed in the license or nondisclosure agreement No part of this manual may be reproduced in any form or by any means electronic or mechanical including photocopying and recording for any purpose without the express written permission of AlterSys Inc 1994 2002 AlterSys Inc All rights reserved Published in Canada by AlterSys Inc ISaGRAF is a registered trademark of AlterSys Inc MS DOS is a registered trademark of Microsoft Corporation Windows is a registered trademark of Microsoft Corporation Windows NT is a registered trademark of Microsoft Corporation OS 9 and ULTRA C are registered trademarks of Microware Corporation VxWorks and Tornado are registered trademarks of Wind River Systems Inc All other brand or product names are trademarks or registered trademarks of their respective holders User s Ma

Download Pdf Manuals

image

Related Search

Related Contents

Notice d`emballage produits DexSIl  Philips InStyle Table lamp 66729/48/16      "取扱説明書"  ESP - setgad.com  HP 400GB 12G SAS HE SFF 2.5-in SC EP 3yr Wty  Cornelius REMCOR TJ400 User's Manual  V7 USB 2.0 Extension Cable USB A to A (m/f) black 5m  取扱説明書を読む(PDF  

Copyright © All rights reserved.
Failed to retrieve file