Home
        USER`S GUIDE
         Contents
1.                                              ST Equivalence      selected    MUX4   RAND  4   1  4  8  16       random selection of 1 of 4 pre defined values   the value issued of RAND call is in set  0  3     so  selected  issued from MUX4  will get  randomly  the value  1 if 0 is issued from RAND    or 4 if 1 is issued from RAND    or 8 if 2 is issued from RAND    or 16 if 3 is issued from RAND              IL Equivalence           LD 4   RAND   MUX4 1 4 8 16   ST selected   B 300 ICS Triplex ISaGRAF Inc     Language Reference          SEL  Arguments   SEL BOO indicates the chosen value  IN1  IN2 INT any integer analog values  Q INT   value  if SEL is FALSE    value2 if SEL is TRUE  Description     Binary selector  selects a value between 2 integer values        FBD program using  SEL  block                                  AutoMode SEL  ManuCmd m1  InpCmd m2 Q ProCmd                            ST Equivalence      ProCmd    SEL  AutoMode  ManuCmd  InpCmd       process command selection          IL Equivalence           LD AutoMode  SEL ManuCmd InpCmd  ST ProCmd  ASCII  Arguments   IN MSG any non empty string  Pos INT position of the selected character  in set  1   len   len is the length of the IN message   Code INT code of the selected character   in set  0    255    returns 0 is Pos is out of the string  Description     Gives the ASCII code of one character in a message string        ICS Triplex ISaGRAF Inc  B 301    Language Reference          FBD program using  ASCII  b
2.                  complete_string                                                                   Pos q sub_string                         ST Equivalence      complete_string     ABCD     EFGH      complete_string is  ABCDEFGH      sub_string    DELETE  complete_string  4  3      sub_string is  ABGH           IL Equivalence        LD   ADD   ST  DELETE  ST    FIND       ABCD      EFGH     complete_string    4 3  sub_string    find       ICS Triplex ISaGRAF Inc     B 303    Language Reference       Arguments   In  Pat  Pos    Description     MSG any message string  MSG any non empty string  Pattern   INT   0 if sub string Pat not found      position of the first character of the first occurrence of  the sub string Pat    first position is 1    this function is case sensitive    Finds a sub string in a message string  Gives the position in the string of the sub string        FBD program using  FIND  block       CAT          ABCD                     EFGH                       complete_string                                                           CDEF    P Po found             ST Equivalence      complete_string     ABCD     EFGH      complete_string is  ABCDEFGH      found    FIND  complete_string   CDEF       found is 3          IL Equivalence              LD    ABCD   ADD    EFGH   ST complete_string  FIND  CDEF   ST found  INSERT  insert  Arguments   IN MSG initial string  Str MSG string to be inserted  Pos INT position of the insertion  the insertion is done before the p
3.                Base q rest_of_division          ST Equivalence      division_result     value   divider      integer division     rest_of_division    MOD  value  divider      rest of the division          IL Equivalence        LD    Arguments   SEL  IN1  IN4    value   divider  division_result  value   divider  rest_of_division       INT selector integer value  must be in set  0  3    INT any integer analog values       ICS Triplex ISaGRAF Inc  B 297    Language Reference       Q INT   value1 if SEL   0    value2 if SEL   1    value3 if SEL   2    value4 if SEL   3    0 for all other values of the selector    Description   Multiplexer with 4 entries  selects a value between 4 integer values        FBD program using  MUX4  block          choice          10  100  1000                                                    range                ST Equivalence      range    MUX4  choice  1  10  100  1000       select from 4 predefined ranges  for example  if choice is 1  range will be 10          IL Equivalence           LD choice   MUX4 1 10 100 1000   ST range   MUX8   Arguments   SEL INT selector integer value  must be in set  0  7    IN1  IN8 INT any integer analog values  Q INT   value if selector   0      value2 if selector   1      value8 if selector   7    0 for all other values of the selector       B 298 ICS Triplex ISaGRAF Inc     Language Reference       Description   Multiplexer with 8 entries  selects a value between 8 integer values        FBD program using  MUX8  block
4.                LD register  ROL 1  ST result  ROR  ror  IN  NbR Q  Arguments   IN INT any integer analog value  NbR INT number of 1 bit rotations  in set  1  31    Q INT right rotated value  no effect if NbR  lt   0  B 292 ICS Triplex ISaGRAF Inc     Language Reference       Description   Make the bits of an integer rotate to the right  Rotation is made on 32 bits    gt              FBD program using  ROR  block       ror       register m  1R a result                                              ST Equivalence       result    ROR  register  1        register   24 0100_1101_0011_0101        result  2 1010_0110_1001_1010          IL Equivalence        LD register  ROR 1  ST result  SHL  shl  IN  NbS Q  Arguments   IN INT any integer analog value  NbS INT number of 1 bit shifts  in set  1  31    Q INT left shifted value  no effect if NbS  lt   0  0 is used to replace lowest bit  Description     Make the bits of an integer shift to the left  Shift is made on 32 bits           FBD program using  SHL  block     shl             register IN  1s a result                                                 ST Equivalence           ICS Triplex ISaGRAF Inc  B 293    Language Reference       result    SHL  register  1       register   2 0100_1101_0011_0101        result  2 1001_1010_0110_1010          IL Equivalence        LD register  SHL 1  ST result  SHR  shr  IN  NbS Q  Arguments   IN INT any integer analog value  NbS INT number of 1 bit shifts  in set  1  31    Q INT right shifted value 
5.            eeeeeee ACOS  ASIN   ATAN  COS  SIN   TAN  Register control                0e ROL  ROR  SHL  SHR  Data manipulation               00  MIN  MAX   LIMIT  MOD  MUX4  MUX8  SEL  ODD  RAND  Data conversion                000000 ASCII    String management                   MLEN    FIND   REPLACE    Absolute value  Exponent  Power calculation  Logarithm   Square root   Truncate decimal part  Arc cosine  Arc sine    Arc tangent   Cosine  Sine    Tangent   Rotate Left  Rotate Right  Shift Left  Shift Right  Minimum  Maximum   Limit   Modulo   Multiplexer  4 or 8 entries    Binary selector   Odd parity   Random value  Character  gt  ASCII code  ASCII code  gt  Character  Get string length   Delete sub string    Insert string   Find sub string    Replace sub string       ICS Triplex ISaGRAF Inc     B 283    Language Reference       LEFT  MID  RIGHT  DAY_TIME  Array manipulation                     ARCREATE  ARREAD  ARWRITE  Binary file management             F_ROPEN  F_WOPEN  F_CLOSE  F_EOF  FA_READ  FA_WRITE  FM_READ  FM_WRITE    Arguments   IN REAL  Q REAL    Description     Extract left  middle   or right of a string   Time of day   Create array of integer values   Read     Write array element   Open a binary file in Read mode  Open a binary file in Write mode  Close a binary file   Test the end of a binary file   Read an analog value in a binary file  Write an analog value to a binary file  Read a message string in a binary file  Write a message string to a binary file   
6.           c ccesceeseesseesseeseeeeeeseeeeeeeteeeeneenseenseenaes C 409   C 10 Appendix  Error list and description              ccccsscssessssssessseseeesees C 411   D  GLOSSARY gassscsccasecsccectecssccissacirentenatecaseccsceteeanects D 422   E  GENERAL INDEX                ccccceeeeeeeeeeeeeeeeeeeeeeeeeeeeeaes E 430       x ICS Triplex ISaGRAF Inc     User s Guide       A  User s Guide       ICS Triplex ISaGRAF Inc  A 11    User s Guide       A 1 Getting started    A 1 1    This chapter covers the installation of the ISaGRAF workbench  It also includes a  short example of an ISaGRAF application  giving the user a brief outline of its main  features and enabling the immediate use of ISaGRAF     Installing ISaGRAF    This chapter covers the installation of the ISaGRAF Workbench and how to set up  the computer for application development     Hardware and software requirements    The ISaGRAF Workbench can be installed on any computer meeting the minimum  qualifications for Windows Version 3 1  However  the following hardware is  recommended for application development     e A personal computer using an 80486 or higher microprocessor   Pentium processor recommended    e 8 megabytes of conventional and extended memory   16 megabytes recommended    e One 3 5 inch  1 44 megabyte  disk drive   e One hard disk with at least 20 megabytes of available space   e A graphic VGA or SVGA adapter and compatible monitor   e A mouse  required for graphic development tools    e A parallel LPT
7.          choice                10                   100          500             1000                            5000    SEL    IN    IN2    IN3    INn4    INS    ING    IN7          INS    mux8                   ql range                ST Equivalence      range    MUX8  choice  1  5  10  50  100  500  1000  5000       select from 8 predefined ranges  for example  if choice is 3  range will be 50          IL Equivalence        LD  MUX8  ST    ODD    Arguments     IN  Q    Description   Tests the parity of an integer  result is odd or even     choice    1 5 10 50  100 500  1000 5000    range    INT  BOO    odd    any signed integer analog value  TRUE if input value is odd  FALSE if input value is even       FBD program using  ODD  block               value       IN    odd    a lt  RETURN  gt                                         value                         ST Equivalence      If Not  ODD  value   Then Return  End_if   value    value   1      makes value always even          ICS Triplex ISaGRAF Inc     B 299    Language Reference          IL Equivalence      LD value  ODD   RETNC   LD value  ADD 1   ST value    RAND    rand    base Q    Arguments     base INT defines the allowed set of number    Q INT random value in set  0  base 1     Description   Gives a random integer value in a given range        FBD program using  RAND  block     rand mux4  4 base aj     seL                                        IN1             IN2       IN3        Co  A               ING Q selected 
8.          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     B 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 a ST program to  replace the attached expression  This is an example of ST programming using defines     If OK Then  angle    PI   2 0   is done    YES   Endive     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  means  OPEN is TRUE    Naming defined words must conform to following rules      name cannot
9.         Complete example  Below is the complete programming of a  sample  function block  which is an up counter     Below is the technical note of the function block     name  SAMPLE  description  Up counter    creation date  01 February 1994  author  ICS Triplex ISaGRAF    call  CU   counting input  R   reset command  PV   maximum programmed value  Q   max detection  CV   counting result    SAMPLE   count  reset_command  maximum_value    max_detect    SAMPLE Q   count_result    SAMPLE CV        Below is the interface of the function block     cu  sample R  PY  a  cv    Below is the  C  source header of the function block        function block interface   name  SAMPLE        definition of standard ISaGRAF data types       typedef long T_BOO   typedef long T_ANA   typedef float T REAL   typedef long T_TMR   typedef char  T_MSG        definition of the calling parameters structure       typedef struct    T_BOO cu        C 390 ICS Triplex ISaGRAF Inc     Target User s Guide       T BOO r   T_ANA pv     str_arg        identifiers used to access the calling parameters        define CU  arg  gt _cu    define R  arg  gt _r    define PV  arg  gt _pv        return parameters logical numbering        define FBLPNO Q 0   define FBLPNO_CV 1     end of file       Below is the  C  source code of the function block  Only the C programmer manually entered  the lines printed with bold characters        function block   name  SAMPLE        include  lt tasyOdef h gt     required for data types
10.       ICS Triplex ISaGRAF Inc  A 163    User s Guide       A 26 3    A 26 4    PC PLC link validation    Most of the problems related to poor communication between the ISaGRAF  workbench and the target PLC are represented in the debugger window by the   disconnected  status message  Before any diagnostic tests are performed  the  communication should be validated when no application is active in the target  PLC  This way the serial communication link can be validated on its own  isolating it  from execution related effects    The  C  language  used for description of the conversion functions and C functions   allows direct access to the target system  A programming error in such a software  component may generate system errors or incorrect ISaGRAF system behavior   Such problems may occur when I O drivers are developed with the ISaGRAF I O  toolkit  System errors  for example  may be caused if an I O board is connected on  an invalid bus address  The following table gives a synthetic summary of error  diagnostics        status context Diagnostic   disconnected    target is not running   before   no cable   invalid cable  download    invalid link parameters    ISaGRAF target badly installed   disconnected  cycle to cycle     invalid I O configuration   after download    starting mode     system crash  real time   invalid I O configuration  starting mode     system crash  due of  C  programming    no application    application not downloaded    application not started   due of 
11.       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     B 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  auto_mode  alarm  lt  RETURN  gt                                bi10  bi23  x cmd C r             ST equivalence       If auto_mode OR alarm Then  Return    End_if    bo67     bi10 AND bi23  OR x_cmd     B 5 3 Jumps and labels    Labels and jumps are used to control the execution of the d
12.       a  Q   gt   D  O  x      gt   D     O  Q      5  5  D  O  o  fa   5    38  cannot input analog board application    5  z   gt   D   lt           gt    amp   fo   3  fa   a  D  3  a  on  lo   D  a  5  23  D  3  D  2       gs  v    An error has been detected while refreshing an analog input board  Check the I O connection  in the workbench as well as board parameters     39  cannot input message board application    5  gt   z9     2  3  gS    a 2  AD  Ton  D  50  Oo 0  38  So  on  S Q  2 o  aa  oZ  eRe  o oO  23  ae a  oa  D o  Gao  2   5  a  i   3  Oo  a  7   i   Q  D  5       a   gt   o  O  D  a  Q  F  o   O  Q  Ak  F   o      O  Q  le   2  3  o   O     fe   5       C 416 ICS Triplex ISaGRAF Inc     Target User s Guide       40  cannot output boolean output variable application    41  cannot output analog output variable application    42  cannot output message output variable application    43  cannot operate boolean variable application    fe   U  m  x  S  o  m  ge   o  D  w  3  oO  Q  3  n  o      fo  oO  O  o  Qa  jag  n  oO  5  n     O  e   oO     gt  Q D 29 gt  Q9D gt   5 95 Q5 95  0  5 5 5  3 2S D 2 a2  3 oa QR o3  3 oO me  ne   o o 7 o  D a gt  3  3s  D 59 5 58  g So  gt  So  D    o oo 28  2 z2  o  o  a io  65 fo   0  xo x xo  D So oe S o  O oo oe O  gt     36 30 53 0  z a8 20 ag  50 ae so  g es a6       as a lt  as  T  os a2     Oo Oo   oD  z D Do D  Q as Qe ac  v De coins  38  5    oa D 5  Soh      at st  Oo 95 or oe     9 30a 35 3a  m    o aQ           pa pa 
13.       to specify that there are no storage unit     Example   TSK_FUNIT    host name  C  ISaGRAF target apl      Specify ISaGRAF target apl   on root of C  unit  on the host_name PC  as application file  backup directory  Be careful not to forget the last slash  otherwise the backup is done on  ISaGRAF target  directory with apl prefixed file names     If needed  this variable can be set to different path units  for each target to start  before each  kernel spawn    You will find more detailed information on application backup files  in the specific features    application backup chapter      a End of Cycle control    The TSK_NBTCKSCHED  uint 32  variable can be set to a value specifying a delay in tick  used by the ISaGRAF target at the end of the cycle    The default value is 0  same priority task scheduling     If needed  this variable can be set to different value  for each kernel  before each kernel  spawn    You will find more detailed information  in the specific features  Cycle duration  task behaviors  and task priorities chapter        ICS Triplex ISaGRAF Inc  C 343    Target User s Guide         ISaGRAF kernel spawning    Once the configuration environment has been set  one of the last steps consists in spawning  the ISaGRAF kernel s   isa_main     uchar isa_main         uchar slave     Slave number     char  com    NOT USED Empty string is OK          Description   Starts an ISaGRAF kernel task    return value   return a value different from zero if errors occur  
14.       where        ICS Triplex ISaGRAF Inc  C 407    Target User s Guide           SYS_SAVxxx can be     SYS_SAVBOO to ask for all Boolean variables backup     SYS_SAVANA to ask for all analog variables backup     SYS_SAVTMR to ask for all timer variables backup     SYS_SAVALL to ask for all Boolean  analog and timer variables backup        lt error gt  gets an error status different from zero when operation has failed  SYS_INITxxx has  not been called      Finally you may want to restore variables  This procedure can be called at any time in the  application  the restoration will be done at the end of the current cycle and once only  To  ensure the data backed up are valid  an analog variable should be set to a constant value  used as a signature     lt error gt     SYSTEM SYS_RESTxxx 0    where       SYS_RESTxxx can be      SYS_RESTBOO to restore all Boolean variables      SYS_RESTANA to restore all analog variables      SYS _RESTTMR to restore all timer variables      SYS_RESTALL to restore all Boolean  analog and timer variables        lt error gt  gets an error status different from zero when operation has failed  SYS_INITxxx has   not been done      The following is a sum up of commands of the SYSTEM function to manage backup  variables      SYS_SAVxxx zero ifOK S    OE   SYS_RESTox zero ifOK S          C 408 ICS Triplex ISaGRAF Inc     Target User s Guide         Customized implementation    Finally  using C functions or function blocks  you may develop specific user  
15.      INT REAL MSG both inputs must have the same type  BOOLEAN TRUE if IN1  gt   IN2    Test if one value is GREATER THAN or EQUAL TO another one  on analog  or    messages        FBD example with  Greater or Equal to  blocks                       gt                                                      ST Equivalence        aresult     10  gt   25      aresult is FALSE     mresult        ab   gt    ab       mresult is TRUE                      10 m1   25 Ina aresult   gt     p m1    ab  Ina mresult                ICS Triplex ISaGRAF Inc     B 257    Language Reference          IL equivalence        LD 10  GE 25  ST aresult  LD    ab     GE    ab     ST mresult  IN4  IN2 Q  Arguments   IN1 INT REAL MSG  IN2 INT REAL MSG both inputs must have the same type  Q BOOLEAN TRUE if IN1   IN2  Description     Test if one value is EQUAL TO another one  on analog  or messages        FBD example with  Is Equal to  blocks     25  25 2 q aresult     ab  InI   ab  ig ol mresult                                                                         ST Equivalence      aresult     10   25      aresult is FALSE     mresult        ab     ab       mresult is TRUE          IL equivalence        LD 10   EQ 25   ST aresult  LD  ab    EQ  ab    ST mresult       B 258 ICS Triplex ISaGRAF Inc     Language Reference        lt  gt    lt  gt   IN4  IN2 Q  Arguments   IN1 INT REAL MSG  IN2 INT REAL MSG both inputs must have the same type  Q BOOLEAN TRUE if first  lt  gt  second  Description     Test if on
16.      strcpy  name   XX X       name of the f block      initproc    IBP FBINIT_xxx     initialization service      readproc    RBP FBREAD_xxx     read service     return   ABP FBACT_ xxx      activation service             xxx is the name of the function block       The name of the function block  used for strcpy statement must be written in uppercase   Lowercase must be used for the name of the implemented services and in the name of the  declaration service     Using the  FBACT_    FBINIT_    FBREAD_  and  fbldef_  prefixes for implemented  services and definition service enables the user to name a function block with a reserved       C 388 ICS Triplex ISaGRAF Inc     Target User s Guide       keyword of the  C  language  or the name of an existing function of the  C  ISaGRAF libraries   No other statement should be added to the declaration service     The declaration service is called for any integrated  C  function block  even if it is not used in  the programs of the ISaGRAF application  The ISaGRAF kernel will detect a fatal error if a  C   function block used in the application is not integrated to the kernel     Before linking new function blocks with the kernel  the user must write another  C  source file   named  GRFBOLIB C   and insert it  with the retained function blocks  in the list of files for the  link  The  GRFBOLIB C  only contains an array of declaration services  This array is read  during application initializations  to create a dynamic link with the  C 
17.      xxx  is the name of the f  block            return  sizeof  str_data            The  hinstance  argument is the logical number of the instance  It is reserved for ISaGRAF  internal operations  and should not be used in the programming of the service  The  initialization service returns the number of memory bytes required for the data of one  instance  The amount of required memory  return value  cannot exceed 64 Kbytes  No other  operation should be performed in this service  The ISaGRAF Library Manager automatically  generates the  C  source code of this service when the function block is created     e The activation service   The  activation  service is called on each target cycle  for each function block instance used  in the application  This service processes the calling parameters and runs the main function  block algorithm  in order to update the hidden static data and the value of return parameters   Below is the standard frame of the activation service     void FBACT_ xxx         ICS Triplex ISaGRAF Inc  C 383    Target User s Guide       uint16 hinstance      xxx  is the name of the function block         logical number of the instance     str_data  data     data  pointer to the instance data structure     str_arg  arg    pointer to the calling parameters structure                The  hinstance  argument is the logical number of the instance  It is reserved for ISaGRAF  internal operations  and should not be used in the programming of the service  The  data   a
18.     file_id         nb written             file_id         nb written             file_id         nb written      file_id                                Ana IN a  C daim   2  nb written   F_CLOSE    file id _   o jl ok     z NOERROR    nb written   m   CI e o RETURN   ERR FILE I   ERROR         ST Equivalence      file_id    F_WOPEN    voltramp bin     nb_written    0        B 318 ICS Triplex ISaGRAF Inc     Language Reference       nb_written    nb_written   ana FA_WRITE file_id vstart     nb_written    nb_written   ana FA_WRITE file_id vend     nb_written    nb_written   ana FA_WRITE file_id vinc     nb_written    nb_written   ana FA_WRITE file_id ana delta_tim      ok    F_CLOSE  file_id    IF  nb_written  lt  gt  4  THEN   ERROR    ERR_FILE     END_IF      IL Equivalence      L  voltramp bin   F_ROPEN  ST file _id  LD 0  ST nb_written  LD file_id    write vstart     FA_WRITE vstart  ANA  ADD nb_written  ST nb_written  LD file_id    write vend     FA_WRITE vend  ANA  ADD nb_written  ST nb_written  LD file_id    write vinc     FA_WRITE vinc  ANA  ADD nb_written  LD    write delta_tim     ANA    convert it to an integer     ST ana_delta_tim  LD file_id  FA_WRITE ana_delta_tim  ANA  ADD nb_written  ST nb_written  F_CLOSE  ST ok  LD nb_written  EQ 4  RETC    return if equal 4     LD ERR_FILE    else error     ST ERROR  FM_READ  FM_READ  ID Q        ICS Triplex ISaGRAF Inc  B 319    Language Reference       Arguments   ID INT file number  returned by FLROPEN   Q MSG message val
19.     voltramp  Path 19  file_id    FA_READ   file_id I ql vstart  FA_READ   file _id D ql vend  FA_READ   file _id p q vinc    FA_READ Tmr  file_id I ql N a delat_tim                                                                                        F_CLOSE  file_id D ok ok                                                 ST Equivalence       file_id    F_LROPEN    voltramp bin       vstart    FA_READ file_id     vend    FA_READ file_id     vinc    FA_READ file_id    delta_tim    tmr FA_READ file_id     ok    F_CLOSE  file_id         IL Equivalence      LD       voltramp bin   F_ROPEN  ST file_id  FA_READ    read vstart     ST vstart  LD file_id  FA_READ    read vend     ST vend  LD file_id  FA_READ    read vinc     ST vinc  LD file _id  FA_READ    read delta_tim     TMR    conversion into a timer     ST delta_tim  LD file _id  F_CLOSE  ST ok  FA_WRITE  FA_WRITE  D  N ok       ICS Triplex ISaGRAF Inc  B 317    Language Reference       Arguments   ID INT file number  returned by F_WOPEN   IN INT integer analog value To be written in the file  OK BOO execution status  TRUE if ok   Description     Writes ANALOG variables to a binary file    This procedure makes a sequential access to the file  from the previous position   The first call after F_WOPEN writes the first 4 bytes of the file    each call pushes the writing pointer    This function is not included in the ISaGRAF simulator        FBD program          F_WOPEN     data bin   Pan o   L__file ia    Lo  nb written        
20.    A 15 5 Display the lock state and device value    When Boolean and analog I Os are locked  the workbench reads their  lock  state  and actual device value  Actual device values include forced values  The  lock   state of I Os is displayed in the following editors      FBD editor     LD editor  Quick LD      Dictionary     List of variable  spy list     In the FBD and LD editor  when an   O is locked  its name is marked with the  a   symbol  The following LD example shows the MainPw I O marked with the locked  symbol       Control light command according to both left and right switches        1  x MainPyy SwLett SwRight CmcLight  HH o   l  SwLeft SwRight   H               H    MainPw is locked    The following FBD example shows the counter I O marked with the locked  symbol     counter is locked       In the Dictionary and List of variables  Spy list   in addition to displaying the  lock   state and the application value for an I O  the actual device value is also displayed   This information is displayed using the following syntax    AppValue     Device value      The following example  in the dictionary  shows the locked counter variable having  an application value of 3 and a forced device value of 127        ICS Triplex ISaGRAF Inc  A 115    User s Guide              ISaGRAF   BLINKALL  untitled    List of variables      OF x   File Edit Options Help  AA a  EAA    Name Value Comment    FBDO FALSE first FBD variable  counter  ProgFBD            lt end of    Counter is lo
21.    An FBD program can call any  C  function block  A function block is used as a standard  function box  Its calling parameters are connected to the left hand side of the function box  Its  return parameters are connected to the right hand side of the box  A standard format for a  function box appears as follows    Name of the function block    Calling XXX Return  parameters parameters    Function blocks used in FBD language do not have to be declared  because the ISaGRAF  FBD editor automatically declares the instances of the used blocks  Function block instances  automatically declared by the FBD editor are always LOCAL to the edited program  Below is  the previous example  programmed in FBD language      _ Command _        Defining the interface of a  C  function block    The  Parameters  command of the  Edit  menu is used to define the calling and return  parameters of a new function block  A function block can have up to 32 parameters  freely  arranged as calling or return parameters  Unlike a  C  function  a function block may have  several return parameters         boo_input1      boo_input2    The list in the upper side of the window shows the parameters of the  C  function block  based  on the order of the function calling prototype  first the calling parameters  then return  parameters  The lower part of the window shows the detailed description of the parameter  currently selected in the list      the name of the parameter     the direction  call return  of the par
22.    Output     Labels    Meaning     Syntax     Arguments     Notes     Example     Suspends the execution of the script until a delay is elapsed   Wait  lt delay gt      lt delay gt  delay expressed according to IEC conventions for time  constant expression  The  T   or  TIME   prefix can be omitted   Delay value must between 10 milliseconds and 1 hour     Accuracy of the  Wait  instruction is not precise as it depends on the  host Windows system  Also  the delay should be considered with an  accuracy of plus or minus one ISaGRAF cycle  When a  Wait   instruction is reached  ISaGRAF cycles are performed until the delay  is elapsed and before continuing the script execution     PrintTime  Wait 2s  PrintTime    15 45 27  15 45 29    Labels can be placed anywhere in the script  They are used as a  destination by  Goto  instructions and allow flow control for script  instructions      lt labelname gt       lt labelname gt  unique name according to ISaGRAF variable naming  conventions  limited to 16 characters  beginning with a letter  followed  by letters  digits or underscore characters  When defined  label name  should be followed by a     character     No instruction should be placed on the line where a label is defined   Label name should not be the same as a declared ISaGRAF variable  symbol       example of a script with an infinite loop     loop    PrintTime   Wait 1s   Goto loop       ICS Triplex ISaGRAF Inc  A 141    User s Guide       Goto    Meaning     Syntax     Argu
23.    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    Out Signal eno    rung state      continue rung with eno state            The  EN  and  ENO  parameters    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    END_IF   eno    rung state      continue rung with eno state       value1 f     value           ICS Triplex ISaGRAF Inc  B 219    Language Reference       B 6 7    In Line  Blocks in LD     In Line  function blocks have the same definition as other function blocks according to the   IEC syntax and common ISaGRAF 3 implementation    In Line  function blocks have input and output parameters  Each input or output  parameter has a well defined data type  The total number of inputs and outputs  together   cannot exceed 32    O  In Line  function blocks have local variables  declared in the ISaGRAF dictionary   that  are instanciated  duplicated  on each use of the function block in a diagram        The 
24.    The above information is called the Level  1 of the transition     Reference number  102    Comment       Weighing command             B 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 t ition 11  rom transition 100    to setp 100  N Implicit orientation    10 from step 100 to  t transition 10  101             B 188 ICS Triplex ISaGRAF Inc     Language Reference       B 3 2 4 Jump toa step    Jump symbols may be used to indicate a connection link from a transition to a step  without  having to draw the connection line  The jump symbol must be referenced with the number of  the destination step     Jump to step 102    a    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                             B 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     B 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 f
25.    The slave number is the same as discussed in the slave registration chapter   More than one kernels can be started as long as their slave number are different       ISaGRAF communication task spawning    Once the configuration environment has been set  one of the last steps consists in spawning  the ISaGRAF communication task s   tst_main_ex     uchar tst_main_ex    char  com     Communication device name     uchar  slave     Location of a 4 Bytes field specifying kernel s  slave  to link to       uchar com_id    communication task identifier          Description   Starts an ISaGRAF communication task    return value   return a value different from zero if errors occur     The 4 Bytes field specifies the kernel slave s   the communication task is linked to  If less  than 4 kernel slaves are needed  the field must be completed with zero  Once the task has  started  this filed is not needed any more    The communication device name corresponds to the serial device name to be used for the  communication link    More than one communication tasks can be started as long as their task identifier are  different    When using the workbench debugger  make sure the workbench communication link  parameters  see user   s guide  Managing programs  match with an existing target  kernel and  communication tasks        Example     This example shows how to start   An ISaGRAF kernel task with slave number 1        C 344 ICS Triplex ISaGRAF Inc     Target User s Guide       An  ISaGRAF commu
26.    for integrated functions     uspdef_fcl   uspdef_fc2   uspdef_fc3   uspdef_fc4     NULL          end of file       A NULL pointer must terminate the USPDEF array  Some clashes may occur when this  condition is not met  Unresolved references will occur when linking the new ISaGRAF kernel if  the USPDEF array is not defined  By writing this file  a new kernel can be built  including all  the existing functions  A kernel dedicated to one project can also be built  by inserting in the  USPDEF array only the functions used in the project  The ISaGRAF Code Generator  automatically generates the  GRUSOLIB C  file when the code of an application is built  The  file is placed in the ISaGRAF project directory  and groups only the functions used in the  project       Limits  The ISaGRAF library may contain up to 255  C  functions  Any type of operation may be  processed in a function  It should be remembered that the functions are called in the    ISaGRAF cycle synchronously  so that the execution of the function has a direct effect on  the cycle timing       Complete example    Below is the complete programming of a  sample  function  which just performs an addition   Below is the technical note of the function     name  SAMPLE  description  just performs an integer analog addition    creation date  1st July 1992  author  ICS Triplex ISaGRAF    call  par1  par2  integer operands  return  integer sum       prototype  sum    sample  par1  par2         ICS Triplex ISaGRAF Inc  C 375   
27.   B 290 ICS Triplex ISaGRAF Inc     Language Reference          sin             angle                         asin       ST Equivalence      sine    SIN  angle    result    ASIN  sine      result is equal to angle          IL Equivalence        LD  SIN  ST  ASIN  ST    TAN    Arguments   IN  Q    Description     angle  sine    result    REAL  REAL    sine                      result       tan    cannot be equal to PI 2 modulo PI  tangent of the input value    1E 38 for invalid input    Calculates the Tangent of a real value        FBD program using  TAN  and  ATAN  block       tan             angle                      IN o        tangent                atan                      ql result             ST Equivalence      tangent    TAN  angle    result    ATAN  tangent      result is equal to angle         IL Equivalence        LD  TAN  ST  ATAN  ST    angle  tangent    result       ICS Triplex ISaGRAF Inc     B 291    Language Reference       ROL    Arguments   IN  NbR  Q    Description     INT  INT  INT    rol    any integer analog value   number of 1 bit rotations  in set  1  31    left rotated value   no effect if NbR  lt   0    Make the bits of an integer rotate to the left  Rotation is made on 32 bits              FBD program using  ROL  block          register                            rol                ST Equivalence       result    ROL  register  1       register   2 0100_1101_0011_0101       result   2 1001_1010_0110_1010         IL Equivalence              result 
28.   B 312  ASCII  B 301  Assignment  B 245  Assignment  in ST        B 226  ATAN  B 289  Attribute  D 422  AVERAGE  B 278    B    Background picture  A 124   Backup  A 26  A 146  A 152  A 153  A   159   Backup file unit  VxWorks   C 340  C   343   Bargraph  A 124   Base  B 179   Baud rate  A 35   Begin  A 27  B 201   Begin section  D 422       E 430    ICS Triplex ISaGRAF Inc     General Index       Beginning step  A 39  A 41  B 192  D   422   Binary selector  B 301   BinaryFile  A 103   Bit field  A 125   Bitmap  A 124   BLINK  B 282   Board  A 91  A 92   Board parameter  A 93  A 148   Board type  A 92   Body of a macro step  B 192   BOO  B 259   Boolean  A 84  B 183  D 422   Boolean action  A 44  B 192  D 422   Breakpoint  A 112  A 114  D 422   BY  B 230    C    C code  A 101  A 146   C compiler  C 364  C 393   C function  A 151  C 364  C 370  D 422   C function block  A 151  C 364   C language  C 364  C 366  C 368  C   372  C 380  C 382  C 393  D 422   C source code  C 368  C 373  C 382  C   393  D 422   C source header  C 366  C 372  C 380   C 393  D 422   CAL operator  IL   B 243   CASE  B 228   Cat  B 263   Cell  D 422   Channel  A 92  A 93  A 94  A 148  A   160   Channel comment  A 93   CHAR  B 302   Child  A 28  B 175   Child SFC program  B 200  D 422   Clearing a transition  B 199  D 423   CLKRATE  C 339   CMP  B 275   Code generation  A 32  A 98   Coil  A 54  A 63  B 212  D 423   Coil direct  B 214    Coil inverted  B 214   Coil negative  B 217   Coil positive  B 216 
29.   Coil reset  B 216   Coil set  B 215   Coil type  A 58   Comment  B 184  B 204  B 222  B 237   D 423   Comment  SFC   B 187  B 188  D 423   Common  A 152  D 423   Communication  A 35  A 113  A 129   A 164  C 326  C 330  C 331  C 332   C 335  C 339  C 344  C 351  C 360   C 362   Communication logical number  C 332   C 333  C 343   Comparison  B 275   Compile  A 32  A 98  A 145  A 149   Compiler message  A 101   Compiler option  A 32  A 130   Compiler options  A 99   Compression  A 153   Condition  B 202   Condition  for a transition   B 197  B   198  D 423   Connection  A 64  A 65  A 66   Connector  A 49  B 204  D 423   Constant expression  B 179  D 423   Contact  A 54  A 63  B 212  D 423   Contact direct  B 212   Contact inverted  B 213   Contact negative edge  B 213   Contact Positive edge  B 213   Contact type  A 58   Control panel  A 110   Convergence  A 38  A 40  B 189   Conversion  A 96  D 423   Conversion ASCII   gt  character  B 302   Conversion character   gt  ASCII  B 301   Conversion function  A 151  C 364  C   365  D 423   Conversion table  A 96  A 97  D 423   Convert to boolean  B 259   Convert to integer  B 260   Convert to message  B 262       ICS Triplex ISaGRAF Inc     E 431    General Index       Convert to real  B 261   Convert to timer  B 262   Copy FBD  A 66   Copy FC  A 51   Copy LD  A 59   Copy library  A 145   Copy program  A 31   Copy SFC  A 41   Copy text  A 73   Copy variable  A 83   Corner  A 64   COS  B 290   Cosine  B 290   Counter down  B 271   
30.   Declared function block instances may be GLOBAL  known by any program in the  project   or LOCAL to one program  Function blocks used in FBD or LD languages  do not have to be declared  because the ISaGRAF FBD editor automatically  declares the instances of the used blocks     b1 R_TRIG  b2 R_TRIG two_edges       The function blocks always have the name of the block defined in the  library  The ISaGRAF FBD and Quick LD editors automatically declare an  instance each time a block is inserted in the diagram       Function block instances automatically declared by the FBD and Quick LD editors  are always LOCAL to the edited program        ICS Triplex ISaGRAF Inc  A 81    User s Guide       A 10 1    G    A 10 2       Network addresses    Network addresses are optional  A variable with a non zero network address can  be spied by an external system  for example a process visualisation system  at run  time  More generally  the network address provides an identifying mechanism for  each run time communication system that cannot handle symbolic names  A  network address may be entered for each variable  during its complete description   when the variable is created or modified     The dictionary main window    The dictionary editing window shows a list of variables with same type and range   The type and range of edited variables is always displayed in the title bar       The editing window shows only main fields of variable description  name   attribute and network address  and te
31.   ICS Triplex ISaGRAF Inc     User s Guide       T    w    RET    Contacts    A contact modifies the Boolean data flow  according to the state of a Boolean  variable  The name of the variable is displayed upon the contact symbol  ISaGRAF  FBD LD editor supports the following types of contacts        deasewedeacaeuniees Direct contact    tH EAE Negated contact    H ET  Contact with positive  rising  edge detection  4H ERTE Contact with negative  falling  edge detection  Coils    A coil represents an action  It must be connected on the left to a Boolean symbol  such as a contact  The name of the variable is displayed upon the coil symbol   ISaGRAF FBD LD editor supports the following types of coils     Maesa olasan Direct coil     e E Negated coil     E EE  Set  action coil     ieee  Reset  action coil    Function blocks    A block in an FBD diagram can represent a function  a function block  a sub   program or an operator  Inputs and outputs must be connected to variables   contacts or coils  or other block inputs or outputs  Formal parameter names are  displayed inside of the block rectangle     Labels    Labels can be placed everywhere in the diagram  Labels are used as targets for  jump instructions  to change the execution order in the diagram  Labels are not  connected to other elements  It is highly recommended to place labels on the left of  the diagram  in order to increase the diagram readability     Jumps    A jump symbol always refers to a label placed elsewhere in 
32.   LANGUAGE REFERENCE                  cccccssssseeeeeeees B 173   B 1 Project architectUre            csscssccssccssessscssssssesssesssssssssscsssssesssssseseees B 174  B 1 1 PLOSTAMS eric sctvavescdsseaeiestosiinasicataae tekaeevede haue ton shea E A B 174  B 1 2 Cyclic and sequential operations            cccceeseeceeseeeteeeteceeeneeeeeenes B 174  B 1 3 Child SFC and FC programs            ccccsccsceesseeeceeseeeeeeseceseenseenseenaes B 175  B 1 4 Functions and sub programs         cccccccsceesseessceeeceseceeceseceseenseeneeenes B 175  B 1 5 Punction DLO CKS it sistas ese apis AR AER Nn la ads B 176  B 1 6 Description language            cccccesceescssscesceesceeecesceeeeeeeeseeeenseensenseens B 177  B 1 7 Execution rule senene eiiiai E E EK E ens B 178   B 2 COMMON ODjCCHS           cscccscssecsscesecssscsscsesssscsssessessseesssesssesseeesesseess B 179  B 2 1 Basic  ty pests scsi ested oh ek eS Re E E B 179  B 2 2 Constant EXPIreSSiONS           ccsccesecesecseecsceeseeseeececeeeeeeeeeeenseeeseecneeenes B 179  B 2 3 Maral EE E dei cease de settcycs scestucest E tuctanensts B 181  B 2 4 COMMENDS AO AEE S EEEE E EO B 184  B 2 5 Defined words eres rerceniorenii i ei B 185   B 3 SEC ETITA ae 50 553 EEE ETTE TTTS B 187  B 3 1 SFC chart main format         esesesesesseseeeseseosersreressesersserersorsessesersosses B 187  B 3 2 SFC basic compon  ntsi casen e e a E E E E B 187  B 3 3 Divergences and COnVergences          ee seeseesessreesstseesresresersreressesees B 189  B 3 4 
33.   Modifying a point   To modify the values of an existing point  first select it from the list  The new  electrical  external  and the physical  internal  values of the point can then be  entered  Values are stored as simple precision floating point numbers  When both  values are entered  pressing the  Store  button updates the point in the table     Clearing a point    Selecting it from the list and pressing the  Clear  button clears an existing point   Remember that at least two points must be entered to define a table     Rules and limits    The rules shown below must be followed when defining a conversion table  The  table can be used to convert both input and output analog variables    e Two points cannot be defined with the same electrical value   e The curve must be continuously increasing or decreasing   e Two points cannot be defined with the same physical value    The following limits apply when defining conversion tables for a project   e No more than 127 conversion tables can be defined in the same project  e No more than 32 points can be defined for the same conversion table        ICS Triplex ISaGRAF Inc  A 97    User s Guide       A 13 Using the code generator    A 13 1    The  Verify  and  Make  commands of the other ISaGRAF Workbench windows  automatically open the code generation window  The code generation window is not  automatically closed when the requested code generation operation ends  so that  the user still has access to all the code generation comm
34.   Multiple connection links are used to represents divergences  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     B 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   Begin    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  
35.   N aH                                    trunc  y result   2 0891   n al                                              ST Equivalence      result    TRUNC   2 67    TRUNC   2 0891       means  result    2 0     2 0     0 0           IL Equivalence      LD 2 67  TRUNC       ICS Triplex ISaGRAF Inc  B 287    Language Reference       ST temporary    temporary result of first TRUNC     LD  2 0891  TRUNC  ADD temporary  ST result  ACOS  acos  IN Q   Arguments    IN REAL must be in set   1 0     1 0    Q REAL arc cosine of the input value  in set  0 0    Pl        0 0 for invalid input    Description   Calculates the Arc cosine of a real value        FBD program using  COS  and  ACOS  blocks     cos  angle In oj cosine                                              acos  n ol result                                  ST Equivalence      cosine    COS  angle    result    ACOS  cosine      result is equal to angle          IL Equivalence        LD angle  COS  ST cosine  ACOS  ST result  ASIN  asin  IN Q   Arguments   XE  ASIN    XE  Arc sine     IN REAL must be in set   1 0     1 0    Q REAL arc sine of the input value  in set   P1 2     P1 2        0 0 for invalid input    Description        B 288 ICS Triplex ISaGRAF Inc     Language Reference       Calculates the Arc sine of a real value        FBD program using  SIN  and  ASIN  blocks     sin  angle m q sine                                              asin  m o  result                                     ST Equivalence      sine    S
36.   PSelect            B 226 ICS Triplex ISaGRAF Inc     Language Reference          assignment with function 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 a 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  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       ICS Triplex ISaGRAF Inc  B 227    Language Reference        lt statement gt      lt statement gt       ELSE   lt statement gt      lt statement gt       ENDIF     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  
37.   R_TRIG       Input parameters  Algorithm  Output parameters   rising edge   boolean_value and    not previous_state    previous_state   boolean_value     oe eee    Hidden data     boolean_value           gt rising edge             previous_state             The hidden static variable  previous_state  is needed for the calculation of the edge  This  variable must be different for each use of the function block   TRIG  in the application  The  instances of the function blocks used in the ST language must be declared in the dictionary   Because a function block has internal hidden data  each copy  instance  of a function block  must be identified by a unique name  Naming the type of block is made by using the library  manager  Naming the instances is made by using the dictionary editor     Function blocks used in FBD language do not have to be declared  because the ISaGRAF  FBD editor automatically declares the instances of the used blocks  Function block instances  automatically declared by the FBD editor are always LOCAL to the edited program       Adding a function block to the ISaGRAF library    The ISaGRAF Library Manager must be used to add a new  C  function block to the ISaGRAF  library in the Workbench  The  New  command of the  Files  menu is used  when the  C   function blocks library is selected  When a new function block has been created  its technical  note must be written  The ISaGRAF Library Manager automatically generates the frame of  the  C  source code for 
38.   SCC nets  structured C source code  produces a structured  C  source  code  This style should be preferred if your target software is  based on ISaGRAF release 3 23 or later     The following two files are created in the project directory   APPLI C               common source code of the application  APPLI H               common  C  language definitions    In the case structured  C  source code generation  a   C  source file and a   H   definition file are created for each program of the application  in addition to common   APPLI C  and  APPLI H  files  These files must be compiled and linked to the  ISaGRAF target libraries in order to produce the final executable code  Refer to the   ISaGRAF I O development toolkit User s Guide  for further information about  recommended implementation techniques     Note  Some debugging features such as application downloading  on line    modification and breakpoints are no more available when the ISaGRAF application  is  C  compiled     A 13 4 Viewing information    The  Edit  menu contains the commands for viewing the different text files built  during code generation or syntax checking operations on the code generator       ICS Triplex ISaGRAF Inc  A 101    User s Guide       A 13 5    window  The code generation window is a text area that contains messages during  code generation or syntax checking operations  All information is stored on the disk  so it can be examined using the  Edit  menu commands     Editing commands    The  Clea
39.   SFC evolution rules  B 199   SFC gallery  A 46   Shift left  B 293   Shift right  B 294   SHL  B 293   SHR  B 294   SIG_GEN  B 282   Signal generator  B 282   Simulator  A 34  A 133  A 135  A 136   C 365  C 370  C 377   SIN  B 290   Sine  B 290   Slave number  A 35  C 326  C 330  C   331  C 332  C 333  C 340  C 342  C   351  C 360  C 362   SlavesLink  C 345   Slot  A 92  A 94   Software key  A 14   Sort  A 83   Source code  A 146    SpotLight  A 124   Spy  A 121  A 123  A 124   Spy variable  A 121   SQRT  B 286   Square root  B 286   SR  B 266   SSR x  1  space  C 348   ST  A 45  A 73  A 123  B 222  C 371   C 378  D 428   ST editor  A 75   ST operator  IL   B 239   Stack of integer analogs  B 276   STACKINT  B 276   Start  A 111   Statement  B 222  D 428   Step  A 37  A 42  A 114  B 187  D 428   Stop  A 111   String  B 180  D 428   String length  B 307   Structured Text  B 222  D 428   Style  A 70  A 126   Sub program  A 28  B 175  B 196  B   199  B 208  D 428   Sub Program  B 203   Sub program call  ST   B 223   Sub program call in IL  B 242   Sub string delete  B 303   Sub string extraction  left   B 305   Sub string extraction  middle   B 306   Sub string extraction  right   B 309   Sub string find  B 304   Sub string insert  B 304   Sub string replace  B 308   Subtraction  B 250   Symbol table  A 166   Symbols  application symbols   C 328   SYSTEM  B 264   System clock rate  VxWorks   C 339   SYSTEM function  C 407    T    Table of contents  A 155  TAN  B 291  Tangent  
40.   The  Delete  button removes the selected single  board from the list  The  Rename  and  Parameters  button are used to change the  name and the parameters of the selected single board  Refer to the following  section for a complete explanation of single board parameters  A complex I O  equipment can group up to 16 single I O boards  The name of a single board  within  an I O equipment  cannot exceed 8 characters        ICS Triplex ISaGRAF Inc  A 147    User s Guide       A 22 4    VO board    The ISaGRAF I O board library defines a standard interface between the application  variables and the target hardware  During the description of the application  all the  I O variables are connected to the channels of the target I O boards  A name and an   OEM key code  that identifies its supplier define an ISAGRAF I O board  Other I O  board parameters describe the I O board topology  number of channels  channel  direction and type   and its hardware or software configuration     I O board parameters    There are two different types of parameters for an I O board  common parameters  which are defined for any ISaGRAF library board  and OEM parameters which are  specific to the board implementation  provided by the hardware supplier  Common  parameters are entered in the upper part of the I O board parameters definition box   These parameters  plus the I O board name  identify the ISaGRAF standard I O  board interface    The  OEM key code  is a simple number that defines the hardware s
41.   User s Guide       RFDEMO   Cycle Profiler  iof x   View  INIT 12 06   GMAIN 41 76     DRIVE 7 09   LEAD 39 10     FLASH 0 00   RANDOM 0 00        When the  View   Average  option is set  displayed information is an average of  percentages calculated since the application has been started  or since the last time  the  View   Reset  command has been run    If the  View   Average  option is not set  displayed information shows  measurements done during the execution of the last cycle  You can also use this  feature when the application is in  Cycle to Cycle  mode to have a set of  measurements depending on the application context    Use the  View   Copy  command to copy program names and percentages to the  Windows Clipboard in ASCII format  Then  data can be pasted into text documents  or common spreadsheets     Important notes     These are not precise measurements  Percentage calculation is based on TIC  instructions counting  taking into account various instruction execution times   Calculation does not include the time spent in  C  functions and function blocks   The value displayed for a function or a function block is the sum of all the  calling  times  from the application programs in the same cycle    Time calculation is based on TIC code and does not provide reliable information if  the actual application code is generated in  C  language and built using a  C   compiler     A 21 7 Simulation scripts    ISaGRAF simulator includes a tool to build and run simulation sc
42.   WHILE  B 204  B 229  WISAKER EXE  NT   C 350    X    XOR  B 248  XOR MASK  B 254    Z  Zoom  A 53  A 60  A 68       ICS Triplex ISaGRAF Inc     E 439    
43.   You can insert the following  basic elements     E EE Action programmed in ST  IL or Quick LD   ee I O specific action  highlights a particular non portable action     gt  ee Test  decision  programmed in ST  IL or Quick LD   o eee Connector     ae Call to a FC sub program     eer Comment  description text    The ISaGRAF Flow Chart editor also proposes you a list of classical Flow Chart    structures  Such structures can only be inserted on an existing flow link  They  cannot be put in an empty area        A 48    ICS Triplex ISaGRAF Inc     User s Guide       oa EEEE If   Then   Else  binary selection   z alenia dueni Repeat until  waits for a condition   oF rrue ieda AR While  loops while a condition is true     N Selecting objects    Selecting graphic objects is needed for most of the editing commands  The  ISaGRAF FC graphic editor enables the selection of one or more objects existing in  the diagram area  To select objects  the  select   button with an arrow  choice must  be checked in the editor toolbar  To select one object  the user only has to click on  its symbol     To select a list of objects  drag the mouse in the diagram to draw a rectangle area   All graphic objects in the selection rectangle are marked as  selected      A selected object is drawn in dark blue color  with little black squares around its  graphic symbol  It is also possible to add or remove one object to a multiple  selection  by clicking on its symbol with Shift or Ctrl key pressed     By mak
44.   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     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         B 230 ICS Triplex ISaGRAF Inc     Language Reference       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    a 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  code    ascii  message  index    IF  code   searched_char  THEN  foun
45.   none   Operand  none     Example        ICS Triplex ISaGRAF Inc  B 241    Language Reference          The following program interleaves delayed operations         res    a1    a2    a3   a4    a5    a6        Delayed  LD al    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 variable 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    bid  bi1 bi2  result  vmax    result  1000    tmval       call sub program to get analog value         result    value returned by sub program        test value overflow         return if overflow          converts seconds in milli
46.   s 2     isaker Isatst  slave 2  isanet     logical Nb 2       Starts    An ISaGRAF kernel task with slave number 2    An ISaGRAF serial  Ethernet  communication task  on  t0 com Port  Port number 1100    linked to slave number 2  and with default logical number  last specified slave number   2      Isaker  s 1  amp     isaker  s 2  amp   isatst  t  t0  s 1  s 2  respectively isanet  t 1100  s 1  s 2     i saner Isatst  SAVE  isanet   logical Nb 2       isaker  slave 2       Starts    An ISaGRAF kernel task with slave number 1    An ISaGRAF kernel task with slave number 2    An ISaGRAF serial  Ethernet  communication task  on  t0 com Port  Port number 1100    linked to slaves number 1 and 2  and with default logical number  last specified slave number   2      Isaker  s 1  amp   isatst  t  t0  s 1  c 1  amp   respectively isanet  t 1100  s 1  c 1  amp    isatst  t  t1  s 1  c 2  respectively isanet  t 1101  s 1  c 2     isaker isatst  slave 1  isanet     logical Nb 1    isatst   isanet   logical Nb 2       Starts        C 334 ICS Triplex ISaGRAF Inc     Target User s Guide       An ISaGRAF kernel task with slave number 1    An ISaGRAF serial  Ethernet  communication task  on  t0 com Port  Port number 1100    linked to slaves number 1  and with logical number 1    An ISaGRAF serial  Ethernet  communication task  on  t1 com Port  Port number 1101    linked to slaves number 1  and with logical number 2    Note    Serial and Ethernet communication tasks can be mixed        C 4 3
47.   stop the application from the debugger or from the Stop Start push button  this will close the  IO boards      stop ISaGRAF target from the system menu        C 358 ICS Triplex ISaGRAF Inc     Target User s Guide       C 6 4 User interface    This is the user interface of the ISaGRAF NT target   Stop Start push button            Errors and messages output  Status Icon    W indow   s title      ISaGRAF   rfmatnew   Target     Options  Messags View Help     gt  1     gt  1100     gt  ISASRY1    Menus       a  D        Status bar    There are the main items   a window title  a menu bar  a running status icon  a Start Stop push button  an errors and messages output  and a status bar     The window title contains    ISaGRAF   name_of_appli   target     where name_of_appli is the    name of the running application  It contains only    ISaGRAF     Target    when there is no  running application       ISaGRAF NT target menu bar   The menu bar has four menus    Options   Messages   View   Help    e  Options  menu   see also first section on NT  General information on options   The  Options  menu gives access to the running options  It proposes the following options        ICS Triplex ISaGRAF Inc  C 359    Target User s Guide       Slave gives access to the slave number modification  The modified option will be  activated only after next start of the target  This feature isn   t available if the target has  been started with at least one option in the command line     Communication g
48.   the rest of the rectangle can be filled with color  A  bar graph can be either horizontal or vertical    Unipolar bar graphs can grow in any direction  to the top  to the bottom  to the left or  to the right    Bipolar bar graphs can grow either in positive or negative direction  according to the  value of attached variable  In case of a bipolar bar graph  the maximum allowed  value is the same for both negative and positive scales        A 124    ICS Triplex ISaGRAF Inc     User s Guide       Unipolar Bipolar   horizontal  vertical    Ps Curves    It is possible to insert a curve in a document  A curve shows the history of the  attached variable  Although it is not a precise measurement tool  it can give useful  debug information about synchronism between various variables    A curve stores the 200 last values of a variable  The number of samples is not  changed when the curve item is resized in the graphic layout     last registered point    Jil Boolean icons    A    Boolean icon    item is used to display a binary state  One icon   ICO  file is  defined for FALSE or 0 value  Another icon is defined for all other non zero values   As SpotLight does not include an icon editor  icon files should be prepared with    another tool     FALSE TRUE    Bit fields    A    bit field    item shows in a graphic panel the 32 bits of an integer value  The less  significant bit is always displayed on the right  It is not recommended to use bit field  for other data types such as real ana
49.   the variables which can be accessed via DDE      VARIABLE NAME    is the name of a variable     DDE advise loop rate for ISaGRAF NT target   d Option   The DDE client generally polls the variables each time it needs them  This can take a large  amount of time if there are a lot of variables  There is another mode which is called advise  mode  advise loop   in which the server itself will only send modified variables  So that  communications are minimized and efficient  In this mode the server periodically looks at the  variables marked as advised variables to know which should be sent  This period is called the  DDE advise loop rate     With this option  it is possible to specify the rate  in ms  for the DDE advise loop   Default value  The default value is 1000 ms or the one in the ISaGRAF INI file    Example   WISAKER  d 100    User interface  This window is displayed from the  Options DDE  command of the main  window of ISaGRAF NT target       DDE Setup    Set Timer Rate for DDE Efi l  advise loop refresh     eg      Error management and output messages    The ISaGRAF target software integrates an error detection management  You will find the  warning error list and their description in appendix              Error detection is processed as follows        An error is composed of an error and argument number sent to the ISaGRAF error routine       If the error detection flag is set in the workbench Make options  the error is processed  If  not  the information is lost and 
50.   which is not linked to an input or output device    SFC graphic component  which represents a link  from a transition to a step   The graphic symbol of a jump is an arrow  numbered with the reference of the  destination step     Reserved word of the language     Identifier put at the beginning of an IL instruction line  which identifies the  instruction  and can be used as an operand for the JMP operations     Graphic language mixing contacts and coils  for the design of Boolean  equations     Ladder Diagram language     Main description of a SFC program  Level 1 groups the chart  steps and  transitions   and the attached comments     Detailed description of a SFC program  It is the description of the actions within  the steps  and the Boolean conditions attached to the transitions        ICS Triplex ISaGRAF Inc  D 425    Glossary       the SFC  Library    Local    Locked I O    Macro step    Matrix    Message    Modbus    Modifier   IL     Network  address    Non stored  action    OEM key  code  I O  board     OEM  parameter   I O board     Operand   IL     Operation   IL     Output    Parameter    Set of hardware or software resources  which can be directly inserted in any  application     Range of variables or defined words  Such objects can be used in only one  program of one project     Input or output variable  disconnected logically from the corresponding I O  device  by a  Lock  command sent by the user from the debugger     SFC graphic component  A macro step is a 
51.  11  A l Getting started            ccscssscssscssecsssssscssscssscsesssessssscsecesecssesssssssseseessees A 12  A 1 1 Installing ISaGRAF 0 00    ceccececcseecessceeeceeeceeeeseceseeecnaeeseeceeeeeeneeees A 12  A 1 2 TIC ON sienne cet cere sceetd ote ces E E O E R E ee A 14  A 1 3 Using on line inforimation          ccceeceeseeeeceseeeseeeeceteceseesseeseeeeeeneeees A 18  A 1 4 A sample application            ccccecceeseessceseceseeeseceeceecaeeeseeneeseeeeerenseens A 18  A 2 Managing projects           csccccssecssessscsssssssssssssscsssssesssesssesesssssessssesees A 23  A 2 1 Creating and working with projects         c cccccescceseestecsseesecseeeseeeneeees A 23  A 2 2 Working with several groups of projects          cc cesceeseeteeeteeseeteeees A 25  A 2 3 QOPtlONS see  8 acdoe  Sgt ein eine er ee een eee n A 25  A 2 4 TOOLS gen e aE EOE ERREN E N anaes  A 26  A 3 Managing programs            csscssccssecsssssessssssssssssssssesssesscsssesssssessssesees A 27  A 3 1 The components of a Project           ssssesessssseeessreseesessteeessessesresersessee A 27  A 3 2 Working with programs            ccccsccesccsseesseeseeeeeeeeeeesceseeesseeeeeaeeeneenes A 29  A 3 3 Running the code generation tools           cccccsceseseeceteeseceteenseeeeeeseees A 32  A 3 4 Other ISaGRAF tools an naa iae anie A 33  A 3 5 Adding commands to the Tools menu            cecceeceesseeseeeeeeeeseeeereees A 34  A 3 6 Simulating and debugging the application    eceeeeeeseeeteetees A 34  A 4 Using the
52.  1101    Serial configuration   Some options can only be used if the  t COMx option is specified     Those are configuration options for the serial link        ICS Triplex ISaGRAF Inc  C 351    Target User s Guide       Option Values Meaning  baud 600 Baud rate  1200  2400  4800  9600  19200    parity n No parity   e Even   o Odd  stop 1or2 Length of the stop bit  flow h Hardware control   n No control       The defaults values are 19200  no parity  8 data bits  1 stop  no flow control    Example   WISAKER  t COM1 baud 1200 data 8 parity n stop 2    User interface  This window is displayed from the  Options Communication  command of the  main window of ISaGRAF NT target       Communication Setup          C 352 ICS Triplex ISaGRAF Inc     Target User s Guide       It is possible to choose the serial communication or the Ethernet communication  The  Ethernet communication gives the possibility to modify the port number  This port number  should be the same as in the workbench PC PLC Link specification       Communication Setup    Select               Ethernet             Serial Setup      Port Number     coM1      Baud Rate Speed  fiszoo      Data Bits   js      Parity    None      Stop Bits   i      Flow Control    None   gt      By choosing the serial communication  the configuration will appear  This configuration should  be the same as in the workbench PC PLC Link specification                      Graphic simulation of virtual boards   x Option    If this option is set  th
53.  74 68 69 73 20 69 73 20 6l 20 74 65 78 74 20 73 this is a text s  10  74 72 69 6E 67 tring  randprog       GS101 gmain      Dump  display is very useful for spying and understanding message strings  containing non printable characters        A 122 ICS Triplex ISaGRAF Inc     User s Guide       A 17 Debugging ST and IL programs    uk   ie          During simulation or on line debugging of ST and IL program  no modification can  be entered in the program text     IL For IL programs  instructions are formatted in a list view  Current value of  a variable used in an instruction is displayed on the same line  You can double click  on an instruction to change the value of the corresponding variable     ST For ST programs  a Spy List window is embedded in the editor window   You can resize views by dragging with the mouse the separation line between them     For each variable of the list  ISaGRAF displays its name  its current value and its  comment text  Columns can be resized by dragging separation lines with mouse in  the list title bar     Saving list on hard disk    The  File   Save list  command save the lists of variables on the disk  under the  same name as the edited program  This list will be automatically re loaded each  time ST or IL program is open in debug mode  This list can also be freely open and  modified using the Spy List tool run by the  Spy   Spy list  command of the  debugger window     Inserting variables in the list    The  Edit   Insert variable  command i
54.  A 76  A 9 4 Updating the program diafty         eeeseeeesseseessesersreseesessteessseseesreserseesee A 77  A 9 5 Selecting a variable from dictionary          seseeessseeeeseesersreseesersreresses A 77  A 9 6 The output Window  isce e E e EE A 78  A 10 Using the dictionary editor       e ssesesseeseeeesoeseseoeseseoeseeoesoeeeesoesesoeeessoesee A 80  A 10 1 The dictionary main Window           cccccceseesscesseeseceecesecseeeseeeneeeneenes A 82  A 10 2 Managing variables  0        cecceceeseeeessceesceeecesecesecaecnsecseceeeeeeneenes A 82  A 10 3 Description of ObDjects         cccccceesseescessceeseeesceeeceseceaesesecaeceeeaeeeaeenes A 84  A 10 4 Quick declaration        cc ce ccccccccccssseescecsseceeseecseseeseecseceeseecseeeeseees A 85  A 10 5 Modbus SCADA addressing map            ceccesseeseesseeeteesecseeeneeeseeees A 86  A 10 6 Exchanging information with other applications              eeseeeeeee A 87       iv ICS Triplex ISaGRAF Inc     User s Guide       A 11 Using I O connection editor              cccsscssscsssssesssesrsecssessescsecssessseesees A 91  A L1 1 Defining VO boards    ce ceccecceseeceeeceesceeecesecesecesecesecseeeneeeeeeneenes A 92  A 11 2 Setting board parameters           cccccceesceesceeeceeeceeeceecesecseeeseeeeeeneeses A 93  A 11 3 Connecting I O channels  0         eccecccesceeceeeceeeceseceeeceecseeeseeeneenneenes A 93  A 11 4 Directly represented variables             cccesceeseesseeseeeteeeeeeeeeneeeeeeneeees A 93  AWS Numbering i  scccce
55.  C  programming     Intel Motorola mismatch    Invalid target version                               ISaGRAF directories    The ISaGRAF Workbench works on a dedicated disk directory structure  The user  during the installation of ISaGRAF specifies the root directory of this architecture   The default name for the ISaGRAF root directory is ISAWIN  This is the standard  disk architecture created by the installation program        A 164    ICS Triplex ISaGRAF Inc     User s Guide       CREATION  PROJECT1       These are the standard ISaGRAF sub directories    DIRECTORY CONTENTS    APL    COM    EXE  LIB    LIB IOC  LIB FNC  LIB FBL  LIB SRC  LIB DEFS  LIB RELS  LIB DEV    TMP    root directory for the ISaGRAF projects   each project corresponds to one sub directory   which contains all the data of the project   other directories may exist for other project groups  ISaGRAF  installation program creates  SMP  directory where are stored  samples applications     common  range data   Data can be used by any project   ISaGRAF programs and help files   ISaGRAF libraries      lists of elements     parameters or interface for each element     technical notes   source code for I O configurations   source code of functions written in IEC languages   source code of function blocks written in IEC languages   source code for conversions and C functions   source header for conversions and C functions   Conversions and C functions object code   command files for developing  C  libraries   makef
56.  C  unit  on the host_name PC  as application file  backup directory  Be careful not to forget the last slash  otherwise the backup is done on  ISaGRAF target  directory with apl prefixed file names     If needed  this variable can be set to different path units  for each target  before each spawn   You will find more detailed information on application backup files  in the specific features   application backup chapter       End of Cycle control    The TSK_NBTCKSCHED  uint 32  variable can be set to a value specifying a delay in tick   used by the ISaGRAF target at the end of the cycle        C 340 ICS Triplex ISaGRAF Inc     Target User s Guide       The default value is 0  same priority task scheduling     If needed  this variable can be set to different value  for each target to start  before each  spawn    You will find more detailed information  in the specific features  Cycle duration  task behaviors  and task priorities chapter       ISaGRAF target spawning    Once the configuration environment has been set  the last step consists in spawning the  ISaGRAF target s   isa_main     uchar isa_main    uchar slave     Slave number     char  com    Serial device name     Description     Starts an ISaGRAF target task     return value   Returns a value different from zero if errors occur     The slave number is the same as discussed in the slave registration chapter    More than one target can be started as long as their slave number and communication port  are different    Wh
57.  Command variable  option is set  the user can modify the value of the linked  variable during debug by double clicking on the item graphic symbol     Commands of the  File  menu    The  File  menu contains commands that allow the user to manage the complete  document     b The  New  command of the  File  menu starts the editing of a new  document  The number of documents defined for a project is not limited by  ISaGRAF  Before editing the new chart  the previously opened chart is closed  The  SpotLight cannot be used to edit several charts at once  However  multiple  SpotLight windows can be opened simultaneously with each used to edit a different  document     The  Open  command of the  File  menu allows the user to close the  currently edited document and to start editing another document of the current  project  The new selected document replaces the current one in the editing window   When selecting the new document  the  Delete  button can be used to delete an  existing file  in order to clean up the project directory  Icon and bitmap files  referenced in a chart are not erased when the chart is deleted        ICS Triplex ISaGRAF Inc  A 127    User s Guide       A 18 5    eo  The  Save  command of the  File  menu stores the currently edited  document on the disk  If it is a new untitled document  the user must give it a name  before saving it  Naming a document must conform to the following rules    e The length of the name cannot exceed 8 characters   e The first chara
58.  File   Program comment text  command to enter or change the  comment attached to the selected program     Editing the contents of a program    This command allows the modification of a program s contents  The editor used to  enter a program depends on the language chosen for that program  Program editing       ICS Triplex ISaGRAF Inc  A 29    User s Guide       is carried out in individual windows  so that it is possible to edit more than one  program through parallel windows  Pressing the ENTER key allows the editing of  the highlighted program  The user can also double click with the mouse on the  name of the program to edit it     Editing the  diary  file   A diary file is attached to each program  This is a text file  which contains all the  notes about the modifications made to the program during its lifetime  The diary file  can be edited  freely modified or printed at any time  When leaving the editor used  to modify the source code of a program  a window is automatically opened to enter  notes for the diary list  Such notes are inserted with the correct date and time into  the diary file     The dictionary of variables    The  File   Dictionary  command runs the dictionary editor  where are declared the  variables of the project  Variables may be global  known by any program in the  project  or local to the selected program  The dictionary editor may also be used to  declare defined words  which are semantic aliases  used to replace a name or an  expression in the so
59.  Mbyte of free space on your disk  The install bat delivered  with the disk installs all needed files for a specified platform on your PC    Example  a  install a  c  path   will install files from disk drive a  to c  on path directory     The following directory architecture is used        the ROOT directory contains some tools and readme files   the CMDS directory contains executable files   the DEFS directory contains header definition files   the LIB directory contains libraries   the RELS directory contains relocatable  object  files   the USER directory contains user s    C    procedures for C functions  function blocks and  conversion functions  source and header files     Then just get started with the installed platform        ICS Triplex ISaGRAF Inc  C 325    Target User s Guide       C 3 Getting started with ISaGRAF DOS target    C 3 1 Running ISaGRAF  ISA EXE    In the MS DOS implementation  the target runs as a single program  ISA EXE  To get started  you can simply run the help command isa    from CMDS directory   In such a system  operations can be critical  It is for instance recommended not to overload  the communication link to guarantee good performance  The target program does not prevent  the running of interrupt driven routines       Communication link and configuration   t Option    The ISaGRAF target uses a serial link for debugger communication  The name of the port is  specified with the  t option  As the communication interface is designed to be com
60.  NULL          end of file       A NULL pointer must terminate the CNVDEF array  Some clashes may occur when this  condition is not met  Unresolved references will occur when linking the new ISaGRAF kernel if  the CNVDEF array is not defined     By writing this file  a new kernel can be built  including all the existing conversions  A kernel  can also be built customized for one project  by inserting in the CNVDEF array only the  conversions used in the project  The ISaGRAF Code Generator automatically generates the   GRCNOLIB C  file  when the code of an application is built  The file is placed in the ISaGRAF  project directory  and groups only the conversions used in the project       Limits   The ISaGRAF library may contain up to 128 conversion functions  Any type of operation may  be processed in a conversion function  It should be noted that the functions are called in the  ISaGRAF cycle in a synchronous way  so that the execution of the function has direct effect  on the cycle timing     C 7 3  C  Functions     C  functions are used to increase standard capabilities of ST and FBD languages  They can  be used to realize any specific calculations  system calls  communications  or to install a set  of services for dialog between an ISaGRAF application and other tasks  Functions are written  in  C  language  compiled and linked with the ISaGRAF kernel  The increased kernel must be  installed on the ISaGRAF target PLC before using new functions in ISaGRAF projects     New fu
61.  Not  locked    When an output variable is locked  the run time kernel and the output driver are  disconnected  In this case  access is still possible to the output device  via the  output driver  with the ISaGRAF debugger        Run time OUTPUTS  Kernel User OEM  application Not  user oem key   locked  Output  devices          Debugger       When setting the virtual attribute for an input the input database and the associated  input devices are disconnected  A virtual I O driver replaces the real one        A 162 ICS Triplex ISaGRAF Inc     User s Guide             Virtual OEM   oem key 0   INPUTS Run time  DATA  BASE Kernel  application  User OEM   user oem key     Input  devices    Debugger    Setting the virtual attribute follows the same rules for an input board or an output  board  For output boards  the ISaGRAF kernel updates the output database  This    database and the associated output devices are  however  disconnected  A virtual  I O driver replaces the real one     Virtual OEM   oem key 0   Run time OUTPUTS  Kernel  application  User OEM     user oem key   Debugger    To summarise all possibilities     Virtual OEM                                                                      Virtual OEM   oem key 0   oem key 0   meuts   Run time  gt   outputs  DATA Kernel DATA  BASE Fe BASE    application Not      aes o  User OEM User OEM   user oem key   user oem key   Input    devices H it Not X  OO Not Debugger virtual lout   i fog Output  virtual  devices  Not  locked 
62.  OPERATE  Operate  Arguments   IO ANY input or output variable  Funct INT action to be operated  Arg INT argument for I O action  Q INT return check  Description     Access to an I O channel  The meaning of OPERATE arguments depends on the I O interface implementation  Refer to    your hardware manual or corresponding I O board technical note to learn more about  OPERATE capabilities     B 9 2 Standard function blocks    These are standard function blocks supported by the ISaGRAF system  Such function blocks  are pre defined and do not have to be declared in the library     BOGIGAMS 1 s cssdveentesdi ate eee heels SR Set dominant bistable       ICS Triplex ISaGRAF Inc  B 265    Language Reference       RS Reset dominant bistable  R_Trig Rising edge detection  F_Trig Falling edge detection  SEMA Semaphore  Counting inaani paene eaea CTU Up counter  CTD Down counter  CTUD Up down counter  TME aeea a TON On delay timing  TOF Off delay timing  TP Pulse timing  Integer analogS              cceee CMP Full comparison function block  Stackint Stack of integer analogs  Real analog                 cceeeees AVERAGE Running average over N samples  HYSTER Boolean hysteresis on difference of reals    LIM_ALRM High low limit alarm with hysteresis   INTEGRAL Integration over time   DERIVATE Differentiation according to time  Signal generation                05 BLINK Blinking Boolean signal   SIG_GEN Signal generator    Note  When new  C  function blocks are created  they can be called from t
63.  SFC editor               csscsssssscssecesscssscssssssssesesscsssessssssssssesens A 37  A4 1 SFC language main topics          cecceceseceseceseeseceseceseeeensecnseceenaeenaes A 37  A 4 2 Entering asSEG charts  scott secsciseig E A 39  A 4 3 Working on an existing SFC chart        cccccecsesseeseeeseeeteeeeeeseeeeeeees A 41  A 4 4 Entering the level 2 programming         ssessseseseeseeeesseeeessrseesreserseesee A 42  A 4 5 Using the SFC gallery     cccsc0cccc  ionini core ntseeed A 46  AS Using the Flow Chart editor              sscsscssscsssssssssscssssssesssscsssesenesseeees A 47  A 5 1 Basics of the FC langages cer e AE EEA ek A 47  A 5 2 Entering a Flow Chatt soeiscsirsnsciesiisisirieis isrtri sisirin A 48  A 5 3 Working on an existing chart          sseeessseeesseseeseeseesssteresseseesresrrseesee A 51  A 5 4 Entering level 2 programs          sssssseeesssreessseserseesrsessesresseseesreserseesse A 51       ICS Triplex ISaGRAF Inc  iii    User s Guide       A 5 5 Programming level 2 with Quick LD        cceceeeeeeeseeeteeeeeeneeeneeees A 52  A 5 6 Display Options eee ee A 53  A 6 Using the Quick LD editor               cssssscsssssssccesscscssscsssssesesesesesssssens A 54  A 6 1 Basics of the LD language           ccceccceseeseeeeceseceteeeeceeeeeeeeneenseens A 54  A 6 2 Entering an LD diagram            ccececseesseeceesceeeceeeceeceseensecneeeeeeneeses A 56  A 6 3 Working on an existing diagram        cceeceeseesceseceseceseeeseeseeeseeeneeees A 59  A 6 4 Display  O
64.  ST aresult  LD zZ   LT  B    ST mresult       ICS Triplex ISaGRAF Inc     B 255    Language Reference           lt     Arguments   IN1 INT REAL MSG  IN2 INT REAL MSG both inputs must have the same type  Q BOOLEAN TRUE if IN1  lt   IN2   Description     Test if one value is LESS THAN or EQUAL TO another one  on analog  or messages        FBD example with  Less or equal to  blocks      lt                                       10 nt   25 n2 al aresult   lt  lt       ab    nt      ab  n2   mresult                         ST Equivalence      aresult     10  lt   25      aresult is TRUE     mresult        ab   lt    ab       mresult is TRUE          IL equivalence        LD 10  LE 25  ST aresult  LD    ab     LE    ab     ST mresult   gt    gt   IN4  IN2 Q  Arguments   IN1 INT REAL   TMR MSG  IN2 INT REAL   TMR MSG _ both inputs must have the same type  Q BOOLEAN TRUE if IN1  gt  IN2       B 256 ICS Triplex ISaGRAF Inc     Language Reference       Description     Test if one value is GREATER THAN another one  on analog  timer or messages        FBD example with  Greater than  blocks          10  25    o          aresult             ab     a                                  o                mresult                ST Equivalence        aresult     10  gt  25      aresult is FALSE     mresult        ab   gt   a       mresult is TRUE          IL equivalence        LD 10  GT 25  ST aresult  LD    ab     GT    a     ST mresult   gt    Arguments   IN1 INT REAL MSG  IN2  Q  Description   
65.  Specific features      Communication link    As OS 9 Serial Character Manager is very flexible  almost any bi directional physical device  supported by Microware may be used     Example   The serial link can be a network path to a physical port located on an another CPU     Then the  t option would be used for example as following   t  nr MASTER tO  Where the communication link is deported on a CPU called MASTER on a ramnet network   The physical port used is  t0       ISaGRAF start up    When the target is started  the following algorithm is executed     Look for application from disk  to load it into memory    Available application on memory               No available application on memory    wait for application download    Application OK     save application to disk  A  g Execute Application        Stop application                      e Definitions   The application code is the binary data base generated and downloaded by the workbench  and then  executed by the target  The symbol table may complete it    The application symbol table is an ASCII database generated and downloaded by the  workbench  This table makes the link between symbol objects and internal target objects  It is  not required on target except for user   s specific symbols management  For more information  on symbol table see user   s guide  Advanced programming techniques        ICS Triplex ISaGRAF Inc  C 335    Target User s Guide       e  ISaGRAF OS 9 objects and Multi application   Every ISaGRAF pub
66.  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  is only available using the Quick ladder editor     boo_ variable      P    Left connection w E 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 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        B 216 ICS Triplex ISaGRAF Inc     Language Reference          Example using a  Positive  coil       input1 output  P        ST Equivalence      IF  input  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     Negative  coils enable Boolean output of a connection line Boolean state  This type of  coils is only available using the Quick ladder editor     boo_variable  _    N j     Left connection ake eT NG 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
67.  Target User s Guide       Below is the interface of the function     sample par2    Below is the  C  source header of the function        File  GRUS0255 h   user C function definitions   Name  sample        definition of standard ISaGRAF data types      typedef long T_BOO    typedef long T_ANA    typedef float T REAL    typedef long T_TMR    typedef char  T_MSG        definition of the calling and return parameter structure       typedef struct      T_ ANA parl     calling parameter  1     T_ANA _par2     calling parameter  2     T_ANA sum     return parameter        str_arg        identifiers used to access call and return parameters        define PARI  arg  gt _parl    define PAR2  arg  gt _par2    define SUM  arg  gt _sum        end of file       Below is the  C  source code of the function  Only the C programmer manually entered the  lines printed with bold characters        File  GRUS0255 c   user C function   Name  SAMPLE        include  tasyOdef h     required for types definition      include  grus0255 h     C function source header          C 376 ICS Triplex ISaGRAF Inc     Target User s Guide          C main service  calculates the addition       void USP_ sample  str_arg  arg             SUM   PARI   PAR2        declaration service required for dynamic link with ISaGRAF kernel       UFP uspdef_sample  char  name        strepy  name   SAMPLE       return  USP_ sample            end of file       C 7 4  C  FUNCTION BLOCKS     C  function blocks associate operations 
68.  User s Guide       A 6 Using the Quick LD editor    The LD language enables graphic representation of Boolean expressions  Boolean  AND  OR  NOT operators are explicitly represented by the diagram topology   Boolean input variables are attached to graphic contacts  Boolean output variables  are attached to graphic coils  The ISaGRAF Quick LD editor provides easy LD  diagram entering using either keyboard or mouse  Elements are automatically  linked and arranged on rungs by the Quick LD editor  No connection is drawn  manually by the user  The Quick LD editor also arranges rungs in the diagram so  that the space filled by the diagram is always optimised     A 6 1 Basics of the LD language            An LD program is expressed as a list of rungs where contacts and coils are  arranged  Below are the basic components of an LD diagram     Rung head  left power rail     Each rung begins with a left power rail  which represents the initial  TRUE  state   ISaGRAF Quick LD editor automatically creates the left power rail when the first  contact of the rung is placed by the user  Each rung may have a logical name   which can be used as a label for jump instructions           dF Contacts  A contact modifies the Boolean data flow  according to the state of a Boolean  variable  The name of the variable is displayed upon the contact symbol  ISaGRAF  Quick LD editor supports the following types of contacts   Direct contact  Negated contact   H pilen pehini a eseei Contact with positive  ri
69.  ah4ini  min_value m2 a new_value                            ST Equivalence      new_value    MAX  MIN  max_value  value   min_value       bounds the value to the  min_value  max_value  set          IL Equivalence           LD max_value  MIN value  MAX min_value  ST new_value  LIMIT  Arguments   MIN INT minimum allowed value  IN INT any signed integer analog value  MAX INT maximum allowed value  Q INT input value bounded to allowed range  Description     Limits an integer value into a given interval  Whether it keeps its value if it is between  minimum and maximum  or it is changed to maximum if it is above  or it is changed to  minimum if it is below        FBD program using  LIMIT  block          min_value  value  max_value                                                 q new_value                   ST Equivalence      new_value    LIMIT  min_value  value  max_value       bounds the value to the  min_value  max_value  set          IL Equivalence        LD min_value  LIMIT value  max_value  ST new_value       B 296 ICS Triplex ISaGRAF Inc     Language Reference       MOD    Arguments   IN  Base  Q    Description     mod  IN  Base Q  INT any signed INTEGER analog value  INT must be greater than zero  INT modulo calculation  input MOD base     returns  1 if Base  lt   0    Calculates the modulo of an integer value        FBD program using  MOD  block     7          value                   divider                   n2 ql division_result             mod                         
70.  an integer analog variable  This means that the  same conversion can be used for both real or integer analog I O variables       Source code    Because the conversion function can be used for both input and output analog variables  the   C  source code of the function is divided into two main parts  the input conversion  and the  output conversion  The direction field of the interface structure is used to select the  conversion to be applied  The ISaGRAF Library Manager automatically generates the  complete frame of the function  when the conversion function has been created  This includes  the main selecting  IF  structure  Below is the standard frame of a conversion function       ok  conversion function  name  sample          include  lt tasyOdef h gt    include  lt tacnOdef h gt     void CNV_ sample  str_cnv  arg        if  DIRECTION    DIR_INPUT      INPUT CONV      j  else     OUTPUT CONV                 The following function shows the link with the ISaGRAF I O manager  using the  name of the conversion  This function is completely generated by the ISaGRAF  Library Manager        UFP cnvdef_sample  char  name       sys_strcpy  name   SAMPLE       gives the name of the conversion     return  CNV_ sample      returns the implementation function            The best way to complete the specific part of the function is to write two separate local  functions for input conversion and output conversion  These functions will be called by the  main algorithm  as shown in commen
71.  any signed real analog value  absolute value  always positive     Gives the absolute  positive  value of a real value        FBD program using  ABS  block                                                          abs  gt   delta m tint  range INZ o  over     ST Equivalence      over     ABS  delta   gt  range       IL Equivalence      LD delta  ABS  GT range  ST over  EXPT  expt  IN  EXP Q  B 284 ICS Triplex ISaGRAF Inc     Language Reference       Arguments   IN REAL any signed real analog value  EXP INT integer analog exponent  Q REAL  IN  amp        Description     Gives the real result of the operation   base   XPONENt     hase    being the first argument and     exponent    the second one        FBD program using  EXPT  block     expt   2 0 IN Ana  range EXP n tb_size                                                                      ST Equivalence      tb_size    ANA  EXPT  2 0  range           IL Equivalence      LD 2 0  EXPT range  ANA   ST tb_size    LOG    Arguments   IN REAL must be greater than zero  Q REAL logarithm  base 10  of the input value    Description   Calculates the logarithm  base 10  of a real value        FBD program using  LOG  block     abs  xval iN o xpos   log  n   xlog                                                                            ST Equivalence      xpos    ABS  xval    xlog    LOG  xpos         IL Equivalence      LD xval       ICS Triplex ISaGRAF Inc  B 285    Language Reference       ABS   ST xpos  LOG   ST xlog    POW    Argum
72.  are  generally not available on the Windows system  The ISaGRAF Simulator provides  the following standard behavior for any user defined conversion  function or function  block    e When the simulator processes a new conversion  it is replaced by a  null   conversion  This means that the physical value of the analog variables is always  equal to the electrical value  as entered or displayed on the Simulator panel     e When a new  C  function or function block is run by the simulator  it does not  process any operation  The result value is not set     A 21 4 Options    The commands of the  Options  menu enable the user to control the display of I Os  in the simulator panel  The user can set or remove these options at any time during  debug        A 134    ICS Triplex ISaGRAF Inc     User s Guide         When the  Color display  option is set  I O channels are displayed as  color bitmaps  If colors cannot be distinguished on some LCD screens  the user  should remove this option  to get pure black and white input and output graphics for  I O channels       When the  Variable names  option is set  a sticker is displayed beside  any I O channel  with the name of the connected I O variable  Removing this option  enables the user to reduce the size of the simulator panel       When the  Hexadecimal values  option is set  any input or output analog  channel is displayed or entered in hexadecimal format       When the  Always on top  option is set  the simulator window is always  vi
73.  are built when debugging the application  The lists can be stored on  the disk and opened again during other debug sessions  A list may contain up to 32  variables  Variables of different types may be mixed in the same list  Global and  local variables can be inserted in a list  A list of variables is dedicated to one  particular project  Lists of variables are very useful for the functional testing of an  application  They allow the user to watch the changes of a limited part of the  controlled process  independent of the corresponding source code in the application  programs  Lists of variables are also useful while debugging ST and IL text  programs  The user can easily group in a list the set of variables used in a program   in order to control or monitor the execution of the programmed instructions    For each variable of the list  ISaGRAF displays its name  its current value and its  comment text  Columns can be resized by dragging separation lines with mouse in  the list title bar     Saving lists on hard disk    The commands of the  File  menu are used to create  open and save the lists of  variables  ISaGRAF does not limit the number of lists for one project  While naming  the lists of variables to be saved on disk  the rules shown below have to be  followed    e name cannot exceed 8 characters   e the first character must be a letter   e the following characters can be letters  digits or underscore character   e naming of lists is case insensitive    The list edito
74.  be written according to ST conventions  between       and      characters   or prefixed by a     character    A 138 ICS Triplex ISaGRAF Inc     User s Guide           Assignment    Meaning     Syntax     Arguments     Notes     Warning     Example     Print    Meaning     Syntax     Arguments     Notes     Example     Force the value of an ISaGRAF variable  It can be an internal  variable  an input channel or an output channel      lt varname gt      lt constant_expression gt    lt varname gt     lt constant_expression gt      lt varname gt  is a valid symbol of a declared application variable  or a  directly represented I O variable using     writing conventions      lt constant_expression gt  is a valid constant expression that  matches the type of the specified variable  For Booleans   0  and  1   can be used instead of  FALSE  and  TRUE   For timers  the  T   or   TIME   prefix can be omitted     Input variable forced by a script does not need to be locked  The  drawing of the corresponding input channel is updated when a script  forces input variable     do not force input or output analog variable attached to a conversion   as script execution does not support conversion functions or tables     MyBooVar    1    same as TRUE     MyIntVar    1234   MyRealVar    1 2345   MyMsgVar     Hello    MyTmrVar    t 12s    Writes a string or the value of a variable in the output window  Text is  output as one new line at the end of text already written in output  window     Print  
75.  bi51 XOR bi52  XOR bi53        IL equivalence        LD bi101  XORN bi102  ST bo10  LD bi51  XOR bi52  XOR bi53  ST bo5       Note  For this operator  the number of its inputs can be extended to more than two     Arguments    inputs  INT REAL can be INTEGER or REAL   all inputs must have the same format   output INT REAL signed addition of the input terms  Description     Addition of two or more analog variables        FBD example with Addition Blocks                 ai101  ai102       aid1  ai52  ai53 ao5                                                    ICS Triplex ISaGRAF Inc  B 249    Language Reference          ST equivalence      ao10    ai101   ai102   aod     ai51   ai52    ai53        IL equivalence        LD    Arguments     IN1  IN2  Q    Description   Subtraction of two analog variables  first   second      ai101  ai102  ao10  ai51  ai52  ai53  ao5    INT REAL can be INTEGER or REAL    INT REAL  IN1 and IN2 must have the same format     INT REAL subtraction  first   second        FBD example with Subtraction Blocks                                                                ai101 m1  ai102 N2 q ao10  ai51 N1    1 IN2 fo  n1  ai53 IN2 a  ao5                                           ST equivalence      ao10    ai101   ai102   ao5     ai51   1    ai53        IL equivalence           LD ai101   SUB ai102   ST ao10   LD ai51   SUB 1   SUB ai53   ST ao5   B 250 ICS Triplex ISaGRAF Inc     Language Reference            Note  For this operator  the number of its inp
76.  bit to bit mask       FBD example with XOR_MASK blocks                                        xor_mask  preverc m  nextc Msk ol crc32  xor_mask  16 012 m  16 011 sk   result                               ST Equivalence      crc32    XOR_MASK  preverc  nextc    result    XOR_MASK  16 012  16 011      equals 16 003          IL equivalence        LD prevcrc  XOR_MASK nexte  ST crc32  LD 16 012  XOR_MASK 16 011  ST result  NOT_MASK  not_mask  IN Q   Arguments     IN INT must have integer format   Q INT bit to bit negation on 32 bits of IN  Description     Integer analog bit to bit negation mask       B 254 ICS Triplex ISaGRAF Inc     Language Reference          FBD example with NOT_MASK blocks     not_mask          16 1234 m o  result                                       ST equivalence      result    NOT_MASK  16 1234       result is 16 FFFF_EDCB          IL equivalence        LD 16 1234  NOT_MASK  ST result   lt    lt   IN4  IN2 Q  Arguments   IN1 INT REAL   TMR MSG  IN2 INT REAL   TMR MSG both inputs must have the same type  Q BOOLEAN TRUE if IN1  lt  IN2  Description     Test if one value is LESS THAN another one  on analog  timer or messages        FBD example with  Less than  blocks                                lt    10 m   25 ino ql aresult   lt    Pa N1    B  nz   mresult                                        ST Equivalence      aresult     10  lt  25      aresult is TRUE     mresult      z   lt   B       mresult is FALSE          IL equivalence        LD 10   LT 25  
77.  block before the selected symbol   FE peaagu dish insert a block in parallel with the selected symbol    You can also click on the function key bar at the bottom of the level 2 window  instead of hitting function keys     Hit RETURN when the selection is on a contact or a block I O parameter to select a  variable or enter a constant value  Hit RETURN when the selection is on a function  block to select the type of the function block  You can also double click on a symbol  for the same effect     Hit SPACE bar when a contact is selected to change the type of contact  direct   negated or with pulse detection   Refer to the chapter  Using the Quick LD editor  in  this document for more details about Quick LD capabilities        ICS Triplex ISaGRAF Inc  A 45    User s Guide       A 4 5 Using the SFC gallery    The ISaGRAF SFC editor manages a SFC gallery  it is a collection of SFC  structures that can be inserted in any SFC chart  Elements of the SFC gallery can  optionally embed the level 2 programming of steps and transitions  Use the  following commands of the  Tools  menu     Copy to SFC gallery copy selected elements to SFC gallery  Paste from SFC gallery paste a SFC gallery element at the current location    When copying to SFC gallery  i e  creating a new SFC gallery element   you can  optionally ask to embed level 2 programming of selected SFC symbols        A 46    ICS Triplex ISaGRAF Inc     User s Guide       A 5 Using the Flow Chart editor    The ISaGRAF Flow Chart g
78.  bx126    bi12 OR bi45    ELSIF over_mode THEN  level    max_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     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           B 228 ICS Triplex ISaGRAF Inc     Language Reference       fatal_error    TRUE     1  err_msg       Overflow   2 3   err_msg     Bad sign      ELSE  err_msg     Unknown error      END_CASE   eo 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 s
79.  call parameters of the function are written after the name of the function   between parentheses  and separated by commas  The expression represents the value  returned by the function  A  C  function call may be inserted into any assignment statement or  complex expression  This is an example of a  C  function call in an assignment statement     result    ProcName  par1  par2      parN      An FBD program can call any  C  function  A function is used as a standard function box  Its  call parameters are connected to the left hand side of the function box  The return parameter  is connected to the right hand side of the box  Here is the standard aspect of such a function  box    Name of the function       Calling XXX  parameters             return  parameter       A  C  function can be called from any SFC action block  or in any Boolean condition attached  to a transition       Defining the interface of a  C  function    The  Parameters  command of the  Edit  menu is used to define the call and return  parameters of a new function  A function can have up to 31 call parameters  and always has  one return parameter     The list in the upper side of the window shows the parameters of the  C  function  according  to the order of the function calling prototype  first the calling parameters  lastly the return  parameter  The lower part of the window shows the detailed description of the parameter  currently selected in the list      the name of the parameter     the direction  call
80.  channels are available using  standard OEM features and the  OPERATE  function     Run time operations    Modifying a running application consists of the following operations    e modify the application source code on the workbench   e generate the new application code   e download the new application code using  update  command instead of   download    e switch from the old application to the new one  in between PLC execution cycles  using the  Realise update  command     This procedure guarantees that the target PLC always has a complete and reliable  running application  and enables the user to control the timing of the sample  operations in a very safe and efficient way  It also enables the user to modify the  project as often as possible  Regardless to the process itself  the  on line  modification  is essentially the same as a normal  stop  start and download  set of  commands  The only differences are that no variable state is lost  and the switching  time is very short  usually 1 or 2 cycle duration   During the switch  no variable is  modified  and all internal  input or output variables keeps the same value  before and after the application modification  During the switch  no action is  performed  and SFC tokens are not moved     Memory requirements    In order to support the  n line modification  capability  the target PLC must have  free memory space to enable the storage of the modified version of the application  code  Both versions of the application code have
81.  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  oH       ST Equivalence      IF  NOT input1  and input1prev  THEN  output1    TRUE   ELSE  output1    FALSE   END_IF      input1prev is the value of input1 at the previous cycle       B 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       ICS Triplex ISaGRAF Inc  B 217    Language Reference       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    P          l input1 input2 result  1 I C     input3                         ST Equivalence      If Not  manual_mode  Then RETURN  End_if   result     input  OR input3  AND input2     B 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     POLAB or jump to label named  LAB   LAB iteu on ns definition of the label named  LAB     If the co
82.  corresponds to one instance  and one data structure  The following example  shows the correspondence between  C  data structures and the function block instances used  in an FBD program        C 382 ICS Triplex ISaGRAF Inc     Target User s Guide    R_TRIG  C  data  instance 1  R_TRIG  C  data  instance 2    GATE  C  code GATE  C  data  instance 1    The memory needed for data structure of each instance is allocated by the ISaGRAF system   when the application starts  A pointer to the associated instance data structure is passed to  the  activate  and  read  services               FBD program  C  implementation             R_TRIG  C  code                               The ISaGRAF Library Manager automatically generates the frame of the  C  source code for  data structure type definition  The type of the data structure is always called  str_data   The  programmer should not change this name  to ensure compatibility with service headers  The  hidden data generally groups internal variables with an image of the return parameters  The  function block  read  service is only used to access the return parameter  and should not be  used to perform other operations     e The initialization service   The ISaGRAF kernel calls the  initialize  service of a function block when the application  starts  It allows the  C  programmer to ask the system to allocate memory for an instance   Below is the standard programming of the initialization service     uintl6 FBINIT_xxx  uint16 hinstance  
83.  definition      include  lt grfb0255 h gt     function block C source header          definition of the structure which contains the data for one instance       typedef struct      T_BOO overflow     true  counting value  gt   programmed value     T_ANA value     counting current value       str_data        initialization service  requires memory for instance data       word FBINIT_ sample  uint16 hinstance             return  sizeof  str_data          activation service  up counting algorithm          ICS Triplex ISaGRAF Inc  C 391    Target User s Guide       void FBACT_ sample  uint16 hinstance  str_data  data  str_arg  arg     if  R  data  gt value   0    else if  CU  amp  amp  data  gt value  lt  PV   data  gt value       data  gt overflow    data  gt value  gt   PV     T_BOO 1    T_BOO 0           cast operation required to copy parameters to ISaGRAF buffer        define BOO_VALUE   T_BOO   value    define ANA VALUE   T_ANA   value    define REAL VALUE   T_REAL   value    define TMR_ VALUE   T_TMR   value    define MSG_ VALUE   T_MSG   value        read service  get the value of one return parameter       void FBREAD sample  uintl6 hinstance  str data  data  uintl6 parno  void   value      switch  parno     case FBLPNO_Q_    BOO_VALUE   data  gt overflow  break   case FBLPNO_CV   ANA_VALUE   data  gt value  break              declaration service used for dynamic link with the ISaGRAF kernel       ABP fbldef_sample  char  name  IBP  initproc  RBP  readproc       strepy 
84.  does not have to be used in  the programming     The  direction  field indicates whether the conversion must be applied on an input variable or  an output variable  It contains the DIR_INPUT value for an input conversion  or the  DIR_OUTPUT value for an output conversion     The  before  field points to the value before the conversion  This field has a different meaning  for an input or an output conversion  It represents the electrical value  read on the input  device  for an input conversion  when the direction field takes the DIR_INPUT value  It  represents the physical value  used in the programmed equations  for an output conversion   when the direction field takes the DIR_OUTPUT value     The  after  field points to the value after the conversion  This field has a different meaning for  an input or an output conversion  It represents the physical value  used in the programmed  equations  for an input conversion  when the direction field takes the DIR_INPUT value  It  represents the electrical value  sent to the output device  for an output conversion  when the  direction field takes the DIR_OUTPUT value     The programmer can use the  ARG_BEFORE  and  ARG_AFTER  definitions to directly  access the before and after field of the structure passed to the  C  conversion function        ICS Triplex ISaGRAF Inc  C 367    Target User s Guide       Processed values are single precision floating values  The result is converted to a long  integer when the conversion is applied to
85.  exceed 16 characters     first character must be a letter     following characters can be letters  digits or underscore   _   character       ICS Triplex ISaGRAF Inc  B 185    Language Reference       Warning  A defined word can not use a defined word in its definition  for example  you can not  have        PI is 3 14159  Pi2 is P  2   write the complete equivalence using constants or variables and operations   PI2 is 6 28318       B 186 ICS Triplex ISaGRAF Inc     Language Reference       B 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 condition is attached to each transition  Actions within the steps are detailed by  using other languages  ST  IL  LD and FDB      B 3 1 SFC chart main format    A 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    B 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     B 3 2 1 Steps a
86.  executed and other ISaGRAF applications  are not blocked  The ISaGRAF script interpreter decides to break script execution if  the same  label  is encountered more than once in the same target cycle  Script  execution can also be normally broken by  Cycle  or  Wait  instructions     Script description language          e  Script description language is a very simple text language similar to ST  but where  each instruction is entered on a separate text line  and does not need to be  terminated by a semicolon  Use the following button of the toolbar to know the list of  available instructions and to insert a keyword at the caret position      Insert instruction  keyword and help as comments   There are various types of instructions  First is the assignment  forcing  of a  variable   E a Assignment  Other instructions allow the output of messages to the output window   Print osiris outputs a text string or a variable value  PrintTime            outputs current time stamp  Other instructions are used to synchronise script instructions with ISaGRAF cycle   let ISaGRAF simulator execute one cycle  waits during a specified time   Other instructions are used to control instruction flow in the script   Labels                  can be placed anywhere in the script  Goto iais unconditional jump to a label  If goto    conditional jump to a label  Bnd    cee terminates script  Script language is not case sensitive  Comments can be inserted at the end of any  text line  Comments can either
87.  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                         SS 101                                              l  2  _lref_step_X N   Te ref_step_X       GS2 prog  X     i 102  2    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   Example        SFC program using TSTART and TSTOP statements          B 232 ICS Triplex ISaGRAF Inc     Language Reference          10  _JACTION P               END_ACTION     bo100    TRUE     boolean output     tm_ctrl    t 0s   TSTART tm_ctrl                bi100 OR  tm_ctrl  gt  time_out         11   JACTION P                     END_ACTION     TSTOP tm_ctrl    alarm    not bi100            Time diagram if bi100 is always FALSE     GS10 X    GS11 X    timeout  tm ctrl       The timer keeps the same value during one cycle       TSTOP statement  Name  TSTOP  Meaning  stops updating a timer variable    Syntax   Operands   Return value     timer value is not modified by the TSTOP command  TSTOP    lt timer_variable gt       any active timer variable    none     Exa
88.  g 5 D y D g  2 Ep aos a  m S o 2     S    O c Ss no     aa Z S  g 3 a w  v n J 8  D 2 D  ius  e   8 S   5  D  lt   g 5 5 5   i 3        D D D  5 CF en o     D D D  a      z Q Q Q  D  gt  a  gt   D    D  5 2 x x      h       os   gt   gt   gt   a D D D  Q        S O O O    44  cannot operate analog variable application    fe   U  m  D  S      m  Eci  o  D  o  3    gt    Q  z  n  o   j  Q  o  O  o  Qa     n  oO  ip   n     O  e    o      gt   5  fo   3  3        D  o  o  to   D  5  a  0       D  lal  Q   D  2  g  0   la   g         a      5  20  U  2     m  Q  D                 5  D      a   lt   o  Z   D  ox  D   lt   D  3    lt    lt   a   Z  5    45  cannot operate message variable application    fe   U  m  a  S      m  ge   Q       o  3  oO  Q  z  non              oO  O  D  Q  E  n  oO     n  je  O  fe    o      gt   5  0   3  3  5   gt   D  o  o  fo   D  5  a  o   LA  o   O  Q  o   a  0   x  O  la   c     5  a      5  O    U  a     m  Q  D  m   e   o  3  D  a  7   0  a  o    lt   S  a   D  kem  D   lt   D   y   lt    lt   O  fad  s    46  cannot open board application    a EY  PEE   5  5 0  Se  399  a  re   530  a      er  on       a   aa       oe  go  oF  O  pu   lt a  23  o  oO  Sa  25  PMT   o  S     SS           Oo a  gc  5  23  zo     a5      22   a    O  oF  30  os  O Q  a 0   oa  zo  Sa  SS  cnx  a   3     O   2o    47  cannot close board application    o  T  Oo      Ke   nok  5  o  a  O  j    D     a   D gt   Q  o  o  O  D  Q     3  S  oO   i  O  oO    z     O  A 
89.  ge   D  oO  a      eo      eg  oO  E   3  oO          o   pe   noe  O  feb      O        S  oJ  a SS  D go  3 33  re  ome   Qa  lt a     3  z a  QO  v O w  ke  35  gos oo  O DS   i g 2  S 38    cee  0 Fo  3 33  O  Q cg  ion cad     o gt    j  a  o  po 2s  D og    g2  530    O o 8  a  3g  C a  n oO  D D  n  e  8  3 3  D D    v  3 5  2 D  fe   5 a  5   lt   D S  ion      D    F  je N  a 5  8 x  o   g     D o  z g  v  a D  D 2  2 2  D  Q a        3       lt       2    76  cannot update  different set of message variables application    Q   o   3  mo   D  oO  a  a   e           oO  O    wa  3  oO  aa     o   ke   noe  O  feb   Er  O  a       a gt       3  fe   2         a  i   Kej  pes     S               QO  S       e       Q  o   o  n  a  5  a  D  a  loy       O      ae    n  530  n      3      3  D  n  n  D  Q  D   lt   S      D  Ss  D  n  a  D   lt       o  D  D            Q  Q     a      zi        3       lt   D  a       ICS Triplex ISaGRAF Inc  C 419    Target User s Guide       77  cannot update  cannot find new application application    The modified application cannot be found in memory  something wrong may have happened  during the download        C 420 ICS Triplex ISaGRAF Inc     Target User s Guide          ICS Triplex ISaGRAF Inc  C 421    Glossary       D  Glossary       Action List of statements or assignments executed when a step of a SFC program is  active    Action  FC  Symbol of a Flow Chart diagram  An action represents a list of instructions to  be performed
90.  if necessary the application  symbol table  from the PROM to the RAM as ISAx1  and if necessary ISAx6  memory  data module s   with your own tools     WARNING    The breakpoint management of the ISaGRAF debugger cannot run correctly if the  application code module is not accessible for writing  This is not a problem  as your  application has normally been fully tested before     On the PC host  if the ISaGRAF workbench is installed on the standard  ISAWIN directory   the application code file of the project MYPRO4J is     ISAWIN APL MYPROJ appli x6m  corresponding to isax1 on the target    the application symbols file of the project MYPRO4J is     ISAWIN APL MYPROJ appli tst  corresponding to isax6 on the target        Error management and output messages    The ISaGRAF target software integrates an error detection management  You will find the  warning error list and their description in appendix     Error detection is processed as follows        An error is composed of an error and argument number sent to the ISaGRAF error  routine        If the error detection flag is set in the workbench Make options  the error is processed  If  not  the information is lost and the error management ends     When processed        Error number  decimal value  and argument  hexadecimal value  are displayed on the  default stdout output        Error number and argument are pushed into a ring FIFO error buffer in order to be  retrieved at a later time  The error buffer size is set in the work
91.  implemented through the I O driver     e Application backup  When a new application is downloaded from the workbench debugger into the target  the  application code is saved on the target current directory with the file name    ISAx1 ISaGRAF application code backup file  where x is the slave number     Furthermore if the application symbol table has been downloaded before  it is also saved on  the target current directory with the file name        ICS Triplex ISaGRAF Inc  C 355    Target User s Guide       ISAx6 ISaGRAF application symbols backup file  where x is the slave number     When the ISaGRAF target is started  these application code and application symbols files are  searched on the current directory and loaded into memory    If no symbols file is available  then the target starts running the application code  with no  symbols loaded    If no application code is available  then the target is waiting for an application to be  downloaded     In order to start the target with a specific application at power up  without using the debugger  link  these files can be directly copied to the target current directory disk from the same disk if  the workbench is on the same PC  or using a floppy disk     If the ISaGRAF workbench is installed on the standard  ISAWIN directory    the application code file of the project MYPROJ is    ISAWIN APL MYPROJ appli x8m   the application symbols file of the project MYPRO4J is    ISAWIN APL MYPROJ appii tst    Example    From the directory
92.  kernel task associated to a communication task on  a serial  Ethernet  link        Kernel task Com task  slave 1 logical Nb 1    Kernel task  slave 2          An another configuration consists in 2 kernel associated to a communication task on a serial   Ethernet  link  In this case  SlavesLink   0x01020000     C 5 5 Specific features      ISaGRAF start up    When the target is started  the following algorithm is executed        C 346 ICS Triplex ISaGRAF Inc     Target User s Guide       Look for application from disk  to load it into memory    Available application on memory                      No available application on memory    E Wait for application download           Application OK    E Save application to disk          Execute Application    Stop application          e Definitions   The application code is the binary data base generated and downloaded by the workbench  and then  executed by the target  The symbol table may complete it    The application symbol table is an ASCII database generated and downloaded by the  workbench  This table makes the link between symbol objects and internal target objects  It is  not required on target except for user s specific symbol management  For more information on  symbol table see user   s guide  Advanced programming techniques    The path to the disk file unit is specified at the ISaGRAF target startup using the global  variable TSK_FUNIT  default value      to specify there are no disk file unit     e  ISaGRAF Multi applica
93.  lt text gt     Print  lt varname gt      lt text gt  is any text string expressed between single quotes     lt varname gt  is the valid symbol of a declared application variable  or a  directly represented I O variable using     writing conventions     Output of variable values is always formatted according to IEC  conventions     Print  Hello   Print MyBooVar       ICS Triplex ISaGRAF Inc  A 139    User s Guide          Output  Hello  MyBoovar   TRUE  PrintTime  Meaning  Writes the current time stamp in the output window  Text is output as  one new line at the end of text already written in output window   Syntax  PrintTime  Notes  Time stamp is formatted according to current setting of Windows  System  Example  Print  Time now is    PrintTime  Output  Time now is   15 45 22  Cycle  Meaning  Suspends the execution of the script until the next ISaGRAF cycle is  performed   Syntax  Cycle  Notes  Script instructions are executed at the beginning of an ISaGRAF  cycle  If the simulator is in  Cycle to Cycle  mode  the  cycle   instruction is immediately followed by a cycle  The following  instructions of the script will be performed on the next  Execute one  cycle  command from the debugger   Example     the ISaGRAF program copies A to B     A    0  Cycle  Print B  A Sh L  Print B    no cycle performed   B not set to 1     Cycle  Print B  Output  B  0  B  0  B 1  A 140 ICS Triplex ISaGRAF Inc     User s Guide       Wait    Meaning     Syntax     Arguments     Notes     Example  
94.  may be resized by dragging  the corners of its border when it is selected     Moving objects    To move objects in the diagram  you have to select them  and drag the mouse to  move the selected area in the diagram  To move connected objects  the user simply  has to move the graphic symbols put on the diagram  The ISaGRAF LD FBD editor  will automatically redraw the connection lines between the objects that were moved   based on their new location     Drawing links    Select one of these buttons in the toolbar to draw a link between connection points  of existing elements  If you draw a link from a connection point to an empty location  in the diagram  a user defined corner automatically terminates it  so that you can  continue drawing another segment     Changing link drawing    The  Tools   Move line  command is used when a link is selected in the diagram to  change its automatic routing  This command has no effect when the link is       ICS Triplex ISaGRAF Inc  A 65    User s Guide       T    connected to a user defined corner  When a link is drawn as three segments  this  command changes the position of the second segment  Below are examples                     gt  F    Changing the type of a link    You can easily change the type of link  with or without Boolean negation  by double  clicking with the mouse on its right extremity              Drawing LD rungs    To draw a new LD rung  first insert the left power rail  Then place a coil  it will be  automatically linked to
95.  mouse in the FBD drawing area  a popup  menu is displayed  It contains the following commands that can be used to insert or  remove free space at the location of the mouse cursor     Insert rows          This command inserts horizontal free space  made of 4 rows  according to the grid step  starting at the position of the mouse  cursor where popup menu is open        ICS Triplex ISaGRAF Inc  A 67    User s Guide       Delete rows         This command removes unused horizontal space  rows  starting  at the position of the mouse cursor where popup menu is open   This command cannot be used to remove FBD elements     When popup menu is open  a grey line in the FBD drawing area indicates where  empty space will be inserted or removed     A 7 4 Display options    The commands of the  Options  menu are used to customise the drawing of the  FBD diagram on the screen       Tooltips    Use the  Options   Tooltips  command to hide or display variable comments as  tooltips in the whole diagram  The comments appear as a tooltips when the cursor  moves over the corresponding variable block  This option is available in off line and  on line modes       Layout customisation    The  Options   Layout  command opens a dialog box where are grouped all the  parameters and options concerning the editor workspace and the drawing of the  graphic diagram  Use the check boxes in the  Workspace  group to display or hide  editor toolbars and status bar  Option of the  Document  group allows you to sho
96.  name   SAMPLE       initproc    IBP FBINIT_sample     readproc    RBP FBREAD sample    return   ABP FBACT_ sample            end of file          C 392 ICS Triplex ISaGRAF Inc     Target User s Guide       C 7 5 Compiling and linking techniques    The ISaGRAF Workbench does not include any  C  compiler or linker  However this chapter  explains the main techniques which can be applied to easily use the files created by the  ISaGRAF Library Manager  and pass them to other tools such as compilers and linkers        C  source files    The  C  source files of conversions  functions and function blocks are put by the ISaGRAF  Library Manager into the ISAWIN LIB DEFS and ISAWIN LIB SRC directories  The name of a  source file is built with the number of the corresponding conversion  function or function block  in the ISaGRAF library  These are the used filenames      isawin lib defs TACNODEF H definition file for any conversion functions   isawin lib src GRCNOnnn H source file of a conversion function   isawin lib defs GRUSOnnn H definition file of a function     isawin lib src GRUSOnnn C source file of a function   isawin lib defs GRFBOnnn H definition file of a function block   isawin lib src GRFBOnnn C source file of a function block   nnn is the number of the conversion  function or function block        Warning  When renaming or copying library elements  its text and programming lines are not  updated by the ISaGRAF Library Manager  according to new element name and logical  nu
97.  needed to distinguish slaves from each other when more than one target are  running  When using the workbench debugger  make sure the workbench slave parameter   see users guide  Managing programs  matches with an existing target  kernel and  communication tasks      Default value  The default slave number is 1  same as the workbench one        Communication task logical number   c Option    This option specifies the communication task logical number  It is used to manage more than  one communication task at a time  It can be from 1 to 255 and must be different for each  communication task     Default value  The last  s specified option is used  The default value ensure compatibility  with previous  3 0  ISaGRAF versions     C 4 2 4 Examples     isaker  amp   isatst  t  t0    isatst  logical Nb 1       Starts    An ISaGRAF kernel task with default slave number  1     An ISaGRAF serial communication task  on  t0 com Port  linked to default slave number  1    and with default logical number  last specified slave number   default   1      isaker  amp   isanet  t 1100    isaker isanet  slave 1 logical Nb 1       Starts        ICS Triplex ISaGRAF Inc  C 333    Target User s Guide       An ISaGRAF kernel task with default slave number  1    An ISaGRAF Ethernet communication task  on Port number 1100  linked to default slave  number  1   and with default logical number  last specified slave number   default   1      isaker  s 2  amp   isatst  t  t0  s 2  respectively isanet  t 1100
98.  no effect if NbS  lt   0  highest bit is copied at each shift  Description     Make the bits of an integer shift to the right  Shift is made on 32 bits                    4        FBD program using  SHR  block     shr          register IN  1 nbs al result                                                          ST Equivalence       result    SHR  register 1        register   2 1100_1101_0011_0101        result  2 1110_0110_1001_1010          IL Equivalence        LD register  SHR 1  ST result       B 294 ICS Triplex ISaGRAF Inc     Language Reference       MIN  min  IN4  IN2 Q  Arguments   IN1 INT any signed integer analog value  IN2 INT  cannot be REAL   Q INT minimum of both input values  Description     Gives the minimum of two integer values           FBD program using  MIN  and  MAX  block                      min  max_value m max   value m2 a  tint  min_value m2 al new_value                               ST Equivalence      new_value    MAX  MIN  max_value  value   min_value       bounds the value to the  min_value  max_value  set          IL Equivalence        LD max_value  MIN value  MAX min_value  ST new_value  MAX  max  IN4  IN2 Q  Arguments   IN1 INT any signed integer analog value  IN2 INT  cannot be REAL   Q INT maximum of both input values  Description     Gives the maximum of two integer values        FBD program using  MIN  and  MAX  block          ICS Triplex ISaGRAF Inc  B 295    Language Reference                            min  max_value m1 max  value ina
99.  not to overload the communication link to guarantee  good performance  On the OS 9 multitasking system  different ISaGRAF single task targets  can be run on the same CPU as long as their slave number and communication port are  different    This single task implementation has mainly been designed for poor hardware platform such  as low cost boards or MS DOS PC   s or to make a first prototype when porting on a new  platform  Therefore the multitasking ISaGRAF target implementation should be preferred    The ISaGRAF single task target does not prevent the running of background processes or  interrupt driven routines       Communication link and configuration   t Option    The ISaGRAF single task target uses a serial link for debugger communication  The name of  the descriptor is specified with the  t option     No Default value  If this option is not used  no communication with the target is possible  In  such a case  error number 7 may be displayed     Communication using an Ethernet link is not available with the single task implementation     The serial link device is opened in binary data transfer mode  no control characters  no  XON XOFF   Other communication parameters have to be set before starting ISaGRAF  so  that the user is totally free to use the parameters needed  When using the workbench  debugger  make sure the workbench communication parameters  see user   s guide  Managing  programs  match with the target ones    Example    xmode  t0 baud 19200   Sets up comm
100.  number  returned by FLROPEN or F_WOPEN   return status    ID    Q    CLOSE       file_id                error       TRUE if file close is OK  FALSE if an error occurred    LD    c  data data bin   F_WOPEN  ST file_id  EQ 0  ST error  F_CLOSE  D   Arguments    ID INT   ok BOO  Description     Closes a binary file open with functions F_ROPEN or F_WOPEN     This function is not included in the ISaGRAF simulator        FBD program using file management blocks           data bin     F_ROPEN       Path 10        file _id                file_id                F_CLOSE    ID       k                 ok             ST Equivalence        file _id    F_ROPEN  data bin       ok    F_CLOSE  file_id         B 314                ICS Triplex ISaGRAF Inc     Language Reference          IL Equivalence        LD  F_ROPEN  ST  F_CLOSE  ST    F_EOF       data bin     file_id    ok    Arguments     ID  ok    Description   Tests if end of file has been reached   This function is not included in the ISaGRAF simulator     INT  BOO       file_id is already in the current IL result       file number  returned by FLROPEN or F_WOPEN    end of file indicator   TRUE if end of file has been reached at the last read or  write procedure call    With FM_READ  the last message read from a file may  not be correct  if the last character is not a string  terminator        FBD program using file management blocks                not_eof                                                                    F_ROPEN     d
101.  object is still visible at the bottom of the chart in this case     a FC flow links    A flow link is a line that represents a flow between two points of the diagram  An arrow always  terminates a link  Below is the drawing of a flow link        ICS Triplex ISaGRAF Inc  B 201    Language Reference       Two links cannot start from the same source connection point       FC actions    An action symbol represents actions to be performed  A number and a name identify an  action  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 number and a name identify a condition  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     NO NO    YES YES    YES YES        O    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  a semicolon may optionally follow the expression  When  pr
102.  of a name is 8 characters   e the first character must be a letter   e the following characters must be letters  digits or  _  character   e the naming of a program is case insensitive    Next  select the editing language chosen to describe the new program     Sequential Function Chart   Flow Chart   Functional Block Diagram  may include parts in LD   Ladder Diagram entered with Quick LD editor  Structured Text   Instruction List       Finally  select an execution style for the program        Begin nikies top level of the  Begin  section  Sequential    top level of the  Sequential  section  End           top level of the  End  section       Function in the  Functions  section  Function block     in the  Function Blocks  section  Child of                 SFC or FC child or sub program of an existing program    By selecting one of the first five choices  the program is put at the top level of a  Begin  End  Sequential  Functions or Function Blocks section  The selection of  the latter indicates that the new program is a SFC child program or a FC sub   program or a sub program  Remember that a top level sequential program must be  described in the SFC or FC language  and that the SFC and FC languages cannot  be used for cyclic programs and their sub programs     Entering comments for each program    ISaGRAF allows you to attach a description text to each program of the project   This comment text is displayed with smaller character font beside the name of the  program  Use the 
103.  of data where are stored SFC step dynamic  attributes  its activity time and flag   Adding or removing SFC steps change the  application database and is denied for on line change       Hidden variables allocated by compilers    The ISaGRAF Compiler generates  hidden  temporary variables to solve complex  expressions  In some case  the change of an expression may lead to a different set  of non visible temporary variables  and that leads to an impossible on line change   To avoid this situation  you can add the following entries in ISA INI file  in order to  force a minimum number of temporary variables to be allocated for each program   even if not used for the compiling of the first application version  Values given here  are examples      DEBUG    MNTVboo 8   for Booleans   MNTVana 4   for integers and reals  MNTVtmr 4   for timers   MNTVmsg 2   for messages       When such a setting is written in ISA INI  the compiler outputs a warning message if  a new compiling of the application leads to a greater number of allocated temporary  variables        ICS Triplex ISaGRAF Inc  A 117    User s Guide       Inputs and outputs    As the ISaGRAF I O system is very open  required modifications should be  implemented by the OEM  using specific features of the corresponding hardware   The ISaGRAF system does not allow the user to add  connect or remove an I O  variable  or to modify the description of an I O board on line  Operations such  as modifying board parameters and locking I O
104.  or transition in a  SFC program     Current result of an IL sequence     Value returned by a sub program at the end of its execution  The return value is  used in the operations of the owner program     Application error detected by the ISaGRAF target system at run time     Group of programs executed with the same dynamic rules     Special character  or group of characters  used to separate the identifiers in a  literal language  A separator may represent an operation     Graphic language  the process is described as a set of steps  linked by  transitions  Actions are attached to the steps  Transitions are detailed as       ICS Triplex ISaGRAF Inc  D 427    Glossary          Chart Boolean conditions    Sequential Group of the programs of a project  The execution of those programs follows   section the dynamic rules of the SFC language    SFC Sequential Function Chart language    ST Structured Text language    Statement Basic ST complete operation    Step Basic graphic component of the SFC language  A step represents a steady  situation of the process  and is drawn as a square  A number references a step   The activity of a step is used to control the execution of the corresponding  actions    String Set of characters stored in a message variable    Structured High level structured literal language  combining assignments  high level   Text structures such as If Then Else  and function calls    Sub  Program written with any language but SFC  and called by another program    pr
105.  program  Note that such a link represents parallel operations     Programming languages    Each program is described in only one language  This language  selected when the  program is created  cannot be changed afterwards  However  FBD diagrams may  include parts in LD  and LD diagrams may include function block calls  Available  graphic languages are SFC  Sequential Function Chart   FC  Flow Chart  FBD   Functional Block Diagram  and LD  Ladder Diagram   Available literal languages  are ST  Structured Text  and IL  Instruction List   SFC and FC languages are  reserved for main and child programs of the sequential section  The language of  each program is shown as an icon beside the program name in the Program  Management window  Below are the icons used to represent the languages     Sequential Function Chart   Flow Chart   Functional Block Diagram   Ladder Diagram  entered with Quick LD editor   Structured Text   Instruction List       A 28    ICS Triplex ISaGRAF Inc     User s Guide       A 3 2 Working with programs    The  File  menu groups all the commands used to create  update or modify  programs  It also launches appropriate editors to enter the contents of application  programs     Creating a new program    The  New  function of the  File  menu allows the creation of top level  child or sub   programs into each program section  The first piece of information to be entered is  the name of the new program according to the following naming rules    e the maximum length
106.  programming syntax of the currently edited program  In case of SFC language   both level 1 and 2 are checked  When syntax verification is complete  the code  generator window must be closed to continue work on the program  If there is only  one program in the application  the edited one  the application code is generated if  no syntax error is detected  The  Options   Compiling options  command is used  to set compiling and optimising parameters  Refer to chapter  Using the code  generator  in this document for further information about compiling and code  generation       Simulate or debug the application    The  File   Simulate  and  File   Debug  commands run the ISaGRAF  graphic debugger either in simulation or real connected mode  and re opens the  edited SFC program in debug mode  Used in debug mode  no modification can be  entered in the program     m Editing the dictionary of variables    The  File   Dictionary  command is used to edit the dictionary of  variables for the current application and the current program  It also contains the  entry points to edit the user defined words  The local declarations or defined words  relate to the currently edited program     A 9 2 Parameters of the program    When the edited program is a function  a function block or a sub program   the  File   Parameters  command is used to define its calling and return  parameters  This command has no effect if the edited program is a SFC or top level  program from section Begin or End     Su
107.  project          cc eccecseecceesceesceeeceeeeceeeeeeeeeeeeeeeeeerens A 131  A 19 7 Compatibility issues 00 0    eececcecsceesceeeceeeceeeeeseeeecesecesecnseenseeeeeaees A 131  A 20 Using the Diagnosis tool                csscsssssccsscesseeccsecesseecccesscersceeesseeeees A 132  A 21 Using the ISaGRAF simulator              csscsssssccsscessescssseessersseeeeseeeees A 133  A 21 1 Links with the debugger    ccceceeccesceesceeeceseeeseeeeeeteeeeeneeneeneees A 133  A22  VO sulla   h    orr arnat E R a LE E Epa TEAR A 133  A 21 3 Library Component          cecceceeseessceeeceeeceseceseceecaeeeseeeeeeeeeeereeeens A 134  AZLA  OPONSE a E E nae ees E ieee A 134  A 21 5 Saving and restoring input states          0 cceeceseceecseeeseeeeeeeeeeeeeeeeees A 135  A 21 6 The cycle profiler okna a E E EEE A 135  A217 Simulation Scripts segonte nnar nnee aei is A 136  A 22 Using the Library Manager      e sseseeserseeeesoeseseorseeeeeseeoesoeeeeeoeseseoeseeeee A 144  A 22 1 Managing library elements        s sssseneeeseeeesseseesseeesseeresseseesreserseeseene A 144  A 22 2 WO configuration        ssseesesseesessesseeessseseesrestsresteresseeresseseeseeseesreseene A 146  A 22 3 VO  complex eqg  ipment eeen a i E A 147  AZLA  VO board  orasenesti EAER E E ER ER A 148  A 22 5 Functions and blocks written in IEC languages             cesses A 149  A 22 6  C  Functions and function blocks 20 0    ce eeseseeeeeceeeeeeneeeeeeseeetenes A 151  A 22 7 Conversion FUNCTIONS    eceteeeeeeecneeeecneeecce
108.  return  of the parameter     the type of the parameter    Any of the ISaGRAF data types may be used for a parameter  Boolean  Integer analog  Real  analog  Timer or Message  Integer and real analogs must be distinguished   Below is the correspondence between ISaGRAF types and  C  types        ICS Triplex ISaGRAF Inc  C 371    Target User s Guide       BOOLEAN unsigned long unsigned 32 bit word  1 true   O false  ANALOG signed integer 32 bit word    REAL single precision floating value  TIMER unsigned long unsigned integer 32 bit word  unit is 1 millisecond   MESSAGE character string        When a message value is passed onto a  C  function  it cannot contain null characters  The  string passed to the  C  code is null terminated  Do not forget that the return parameter must  be the last one in the list  The rules shown below must be followed while naming parameters     the length of the name cannot exceed 16 characters     the first character must be a letter     the following characters must be letters  digits or underscore character     naming is case insensitive    The same name cannot be used for more than one parameter of the function  A call  parameter cannot have the same name as the return parameter  The same name can be  used for parameters of different functions  The default name for return parameter is  Q   This  name can be freely modified  The name of a parameter is used to identify the parameter in  the  C  source code     The  Insert  command is used to insert 
109.  s procedures to  have access to a battery backed up memory  to store and restore variables at any moment in  the application     Examples   1  Procedure dedicated to an application   backup  restore_temp  restore_date  restore_cpt would be C user   s procedures        backup temperature  date  cnt   store 3 critical data    temperature    restore_temp    restore temperature  date    restore_date    restore date  cnt    restore_cnt    restore counter    2  General purpose procedures   backup_init  backup  backup_link  restore would be C user   s procedures        save_id    backup_init address  size   allocate a memory backed up array   backup save_id  cpt  3   save cpt1 as the 3rd element     rest_id    backup_link address  size  link backed up memory   cpt1    restore rest_id  3   restore backed up value of cpt1     C 9 3 Program state backup    It could be possible to store every state of every application program  but it seems dangerous  to restore every program in the state it was at the last backup  for at least 3 reasons         Some processes require specific operations before restarting       Dealing with every status of a complete application is tedious       Some external resources such as C programs  peripherals  etc  cannot be automatically  restarted    The best solution seems to backup analog or Boolean variables to describe the status of the  process when the programmer thinks the restart stages will be able to use these information   Then it should be possibl
110.  set of edited objects  and stores this text either in the Windows  clipboard or in a file  Such information is typically used by another application  The   Import text  command imports variable declaration description fields  described in  pure ASCII text format  stored either in the Windows clipboard or in a file  and  updates the currently edited list with imported fields  Such information is typically  produced by another application       Exporting data    The following dialog box appears when the  Export text  command is run   It enables the user to control the export mechanism     Export variables x   a     oi i  Selected variables Cancel    Send to      ____   __               _ Browse        Clipboard Keywords  ee                   Format  Tab separators Z        Checking the  Complete list  choice indicates that the complete edited  list has to be exported  The current selection is ignored in this case  Checking the   Selected variables  choice indicates that only highlighted variables will be  exported    If the  Clipboard  option is checked  the exported information is stored  in  pure ASCII text format  in the Windows clipboard  The text is then available for   paste  commands in other applications  If the  File  option is checked  the exported       ICS Triplex ISaGRAF Inc  A 87    User s Guide       text is stored in an ASCII file  The complete pathname of this file has to be entered   The  Browse  command may be used to find an existing pathname    Then the us
111.  siv  03  nbb  vH  vL     orc  erel      nbb corresponds to the number of vH  vL bytes       ICS Triplex ISaGRAF Inc  C 401    Target User s Guide       FUNCTION 5  write 1 bit    Write a bit  Boolean  at network address addH addL    Question  slv__ 05___JaddH JaddL_ vH _  00  orcH  crci     Answer__ slv__ 05___ addH JaddL_ vH _  00  orcH  crci      FUNCTION 6  write 1 word    Write a word at network address addH addL     Question  siv  o6 JaddH  add  vH  vL   orcH  cret     Answer_  siv  o6 JaddH  add  vH  vL Jorch  cret      FUNCTION 16  write N words    Write nbw words starting from network address addH addL  nbb   2nbw      Question _ siv_f10  adah  adat  o0 __  nbw  nbb  vH vif orc feret  Answer__ slv_ 10__JaddH  adat  00 _  nbw _ orcH  eret     Examples         Function 1  read 15 bits starting from network address 0x1020  on slave 1    Question  01  ot  10  20  o0  or  79  04     Answer  o1  01  02  oo  12  39  F1     The value read is 0x0012  which gives 00000000 00010010 as a bit field   In this example  variables 0x1029 and 0x102C are TRUE  all others are FALSE         Function 16  write 2 words at address 0x2100 on slave 1  values written are 0x1234 and  0x5678      Question  01  10  21  oo  oo  o2  o4  12  34   se  78   iC  cA    Answer_  01  10  21  oo  oo  o2  4B   F4        File transfer    Compared to modern field buses  Modbus protocol offers very poor services if it is not  extended by specific manufacturers functions codes     In our situation  running ISaG
112.  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    Inactive 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    B 7 2 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 in a 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       B 222 ICS Triplex ISaGRAF Inc     Language Reference       Parentheses are used to isolate sub parts of the expression  and to ex
113.  symbol  for the same effect     Hit Control   SPACE bar when a contact is selected to change the type of contact  or coil  direct  negated   Refer to the chapter  Using the Quick LD editor  in this  document for more details about Quick LD capabilities     A 5 6 Display options    The  Options   Layout  command opens a dialog box where are grouped all the  parameters and options concerning the editor workspace and the drawing of the  diagram  Use the check boxes in the  Workspace  group to display or hide editor  toolbars and status bar  Option of the  Document  group allow you to show or hide  points of the editing grid and to display chart either in black and white or with colors     Q Use the  Zoom  button of the toolbar to change current zoom ratio  This  command is also available when working on a Quick LD program attached to an  action or a test     3333 Use the  Grid  button of the toolbar to show or hide points of the editing  grid  This command is also available when working on a Quick LD program attached  to an action or a test     Use the  Options   Font  command to select the name of the character font to be  used in all ISaGRAF documents  When called from a ST or IL block  you can  specify size of the font  When selecting font for a graphic view  FC or Quick LD    font style and size are not relevant and do not need to be specified  ISaGRAF  graphic editors always calculate the font size according to the current zoom ratio        ICS Triplex ISaGRAF Inc  A 53   
114.  target basically uses a serial link for debugger communication  When opened   no configuration are performed on the specified serial link device by the ISaGRAF target  So  that  the user is totally free to use the parameters needed  Nevertheless a binary data transfer  mode  RAW mode  is required  In that way the  SAMOD    subroutine is provided     uchar ISAMOD    char  desc     Serial device name     uint32 baudrate    Baud rate         Description     Configure specified serial link device for binary data transfer with specified baud rate     return value   0 if successful  BAD_RET if errors occur     When using the workbench debugger  make sure the workbench communication parameters   see user   s guide  Managing programs  match with the target ones       System clock rate    The global variable CLKRATE  uint32  needs to be initialized to the VxWorks system clock  rate  In that way you can use    CLKRATE   sysClkRateGet     The default value of CLKRATE is 60Hz        ICS Triplex ISaGRAF Inc  C 339    Target User s Guide       C 5 3 Running the ISaGRAF single task  isa o    The ISaGRAF target can be run as single task  But in such a configuration operations can be  critical  It is for instance recommended not to overload the communication link to guarantee  good performance  On the VxWorks multitasking system  different ISaGRAF single task  targets can be run on the same CPU as long as their slave number and communication port  are different    This single task implementa
115.  technical note  user manual  of the element  currently selected on the element list  The menus of the library manager contain the  commands to create  define or modify elements of the active library  The  File    Other library  command allows the selection of one of the ISaGRAF libraries  The  combo box on the left of the toolbar can also be used to select a library     lO configurations  lO complex equipments  IO boards    Functions  Function blocks  C functions    C function blocks  Conversion functions       Managing library elements    Use the commands of the  File  menu to create elements and work on existing  ones in the open library    Creating a new element    The  New  command of the  File  menu creates a new element into the selected  library  The name of the new element is entered  based on the following naming  rules    e the maximum length of a name is 8 characters   e the first character must be a letter   e the following characters must be letters  digits or  _  character   e the naming of a library element is case insensitive     A text comment is associated to each library element  This comment is entered  while creating the element  When a new element is created  the following must be  entered    e its definition for an I O configuration    e its parameters for an I O board        A 144    ICS Triplex ISaGRAF Inc     User s Guide       e its user interface for a function or function block     When a  C  conversion   C  function or  C  function block is crea
116.  the  parameters  so that the return parameters are put at the end of the list     A 9 3 Other commands of the  File  menu    The following commands are available in the  File  menu of all program  editors     Open another program    The  File   Open  command allows the user to close the currently edited  program and start editing another program of the current project with the same  language  This function cannot be used to edit a program written in another  language  The new selected program replaces the current one in the editing  window        A 76    ICS Triplex ISaGRAF Inc     User s Guide            Printing the program    The  File   Print  command outputs the edited program on printer  This  command automatically runs the ISaGRAF document generator to printout the  edited program and attached local variables     For some graphic programs  SFC  FBD and Quick LD  You can also use  the  Edit   Copy drawing  command to copy in the clipboard the drawing of the  chart in metafile format  so that it can be pasted in other applications such as word  processors  For SFC programs  only the level 1 information  chart  numbering and  level 1 comments  appears on the copied metafile     A 9 4 Updating the program diary    The diary file attached to the edited program may be manually entered  using the  File   Diary  command  The diary file is automatically updated with  syntax checking output messages each time that the program is compiled   Compiling outputs are completed with t
117.  the interface  call and return  parameters   if the element is a function or a function block  The  C  source  header file is automatically generated     With the ISaGRAF Library Manager  enter the text of the detailed technical note   user s guide  of the element     With the ISaGRAF Library Manager  complete the  C  source file  by entering the   C  programming of the conversion  function or function block algorithm  The  source code of the element is now complete  Note that another editor may be  used    Select the  Show logical number  option of the Library Manager to know what  logical number is attached to the new element  This number is used in the  pathnames of the corresponding   C  and   H  source files    Copy   Download the  C and  H files to your target  if native compiler  or to the  corresponding environment  if cross compiler  where the ISaGRAF target libraries  and tasks have been installed    Run the  C  compiler on the new source file  and correct syntax errors if any     Insert the name of the new element declaration service in the  GR  0LIB C   source file  which defines the array of inserted elements     Run the  C  compiler to compile the  GR 7 0LIB C  file     Insert the name of the object module in the list of object files used to build the  corresponding library     Run the  C  library builder  Run the  C  linker to build the new kernel   Install the new created kernel on your target machine     Write a sample ISaGRAF application that tests the acti
118.  the power rail  Other contacts and vertical OR connections  may be directly inserted on the rung line  without drawing any new connection link   When a new LD contact or coil is inserted in an empty space of the editing area  the  new horizontal rung line is automatically drawn from the new inserted element to the  existing power rails on the left and on the right  This line is not automatically drawn if  the new contact or coil is not placed between power rails  The new inserted contact  or coil can then be freely moved on the drawn rung  The horizontal lines created by  the editor while inserting an LD contact or coil symbol can be selected and deleted   You can insert a new LD contact or coil symbol on the horizontal line of an existing  rung  The editor automatically cuts the rungs and connects it to the left and right  connection points of the new inserted contact or coil     Multiple connections    A multiple connection can be created on the right of any output point  It means that  the information is broadcasted to several other points in the diagram  The same  state is propagated on each extremity on the right  The number of lines drawn at the  right of an output connection point is not limited  Two connection lines cannot have  their right extremity connected on the same input point  except for the following LD  symbols     4 AT Right power rail    F EEE NTE Multiple connection on the left  OR  operator  These LD symbols can have an unlimited number of inputs     A 
119.  the source of conversions  functions and  function blocks can be system independent  Below are the names of these constant values     DOS      cee for DOS based systems  INTEL processor   ISAWNT            for Windows NT based systems  INTEL processor   OSS    enan for OS9 system  MOTOROLA processor     VxWorks          for VxWorks system  MOTOROLA processor     The utility command files  to compile and link  delivered with the ISaGRAF target software  show how to define the convenient constant value in the compiler command line       Supported compiler    The following compilers are supported for the development of conversions  functions and  function blocks  and the link with the ISaGRAF Kernel     Microsoft MSC 7 00 compiler for DOS based targets  Microsoft MSVC 4 00 compiler for Windows NT based targets    Microware ULTRA C compiler for OS 9 targets  Tornado 1 0  GNU Toolkit 2 6 for VxWorks targets       Contact ICS Triplex ISaGRAF for using other compilers       Summary    Below is the summary of the operations that have to be performed when developing a new  conversion  function or function block      gt 1  With the ISaGRAF Library Manager  create the new element  give it a name and a  comment text  The frame of the  C  source file is automatically generated        ICS Triplex ISaGRAF Inc  C 397    Target User s Guide        gt 2      gt 3      gt 4     95     6     7     8     9      gt 10      gt 11      gt 12      gt 13     With the ISaGRAF Library Manager  describe
120.  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 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 a 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 FEDG
121.  to be stored in PLC memory  during the switch operation     Limitations    As described before  only modifications to code sequences are allowed  Variable  definition  application parameters and I O connections cannot be modified  When  downloading a modified version of the application  ISaGRAF makes a comparison  between the modified application and the running one  in order to detect any unsafe  change  If the switch seems dangerous or impossible  a download error is  generated  One of the safeguards performed by ISaGRAF is to compare the symbol  table checksum  so that any variable  program  or SFC element name change is  detected  If a step is active when the switch occurs  its non stored  N  actions are  lost  The new step activation actions are not executed  Actions executed at the de   activation of the step are the ones carried over in the new application code  If a  transition is valid when the switch occurs  its receptivity equation is updated  The  new downloaded application code is not backed up on the PLC  The backup is the  version  which was previously downloaded with standard download commands        A 118    ICS Triplex ISaGRAF Inc     User s Guide         Operations    To update the code of a running application  the following operations have  to be performed   e Before making any change on a running application  it is highly recommended to  make a copy of the current project under another name  The modifications may be  performed on the copies   e Before e
122.  to give more time to ISaGRAF        use dynamic cycle duration modification to adapt the cycle duration to different process  stages        set cycle duration to zero to let the ISaGRAF kernel run as fast as possible  without any  overflow checking     63  user function not implemented application    A program is using a C function  which is unknown in the target  Your workbench library may  not correspond to your target version     64  integer divided by zero program    A program tries to divide an integer analog by zero  Your application should prevent such an  event  which may have unpredictable effects    When this occurs  ISaGRAF places the maximum analog value as the result    When the operand is negative  the result is inverted     65  conversion function not implemented application    A program is using a C conversion function  which is unknown in the target  Your workbench  library may not correspond to your target version   When this occurs   SaGRAF does not convert the value        C 418 ICS Triplex ISaGRAF Inc     Target User s Guide       66  function block not implemented application    A program is using a C function block  which is unknown in the target  Your workbench library  may not correspond to your target version     67  standard function not implemented application    A program is using a function block  which is unknown in the target  although it is supposed to  be available on most targets  Ask your supplier     68  real divided by zero  A program tr
123.  to the  Password  protection  section  at the end of the first part in this manual for further information  about password levels and data protection  Passwords are only relative to the  selected element  They have no influence on other elements of ISaGRAF libraries     Compiling functions and function blocks    When the library of functions or function blocks written in IEC languages is selected   the  Verify  compile   command of the  File  menu is used to check the syntax of  the selected element and create its object code  Functions and blocks written in IEC  languages have to be compiled without errors before they can be used in ISaGRAF  projects  This command has no effect if another library is selected     Technical notes    The  Edit   Technical note  command allows the user to enter the technical note of  the element selected in the active library  The technical note is entered with the  ISaGRAF text editor  The technical note of an element is its user guide  It will be  consulted by the user of the element during its integration in an ISaGRAF project   The technical note on how to use the element should contain the description of its       ICS Triplex ISaGRAF Inc  A 145    User s Guide       main function  the detailed explanation of its programming interface and  parameters  and its context and limits    The  Tools   Standard note format  command allows the user to define a standard  text format for all the elements of the currently selected library  When editing 
124.  when the dynamic flow encounters the action symbol    Activity of a Attribute of a step  which is marked by a SFC token  The actions attached to   step the step are executed according to its activity    Analog Type of variables  These are continuous integer or real variables    Attribute Class of variables  Available variable attributes are internal  input or output    Begin Group of cyclic programs executed at the beginning of each target cycle    section   Beginning First step of the body of a macro step  A beginning step is not linked to any   step preceding transition    Boolean Type of variables  Such variables con only take true or false values    Boolean SFC action  a Boolean variable is assigned with the activity signal of a step    action   Breakpoint Mark placed by the user at debug time  on a SFC step or transition  The target  system stops when a SFC token is moved on a breakpoint    C function Function written with the  C  language  called from the ISaGRAF programs   written with other languages   in a synchronous way  C functions are delivered  by ICS Triplex ISaGRAF  or developed by the user    C language High level literal language used to describe the computer operations  such as C  functions and conversion functions    C source Text file  which contains the  C  source code of a function or a conversion   code function    C source Text file which contains the  C  definitions and types required for the   header programming of a C function or a conversion func
125.  where WISAKER EXE is installed  if the following command is entered   copy  ISAWIN APL MYPRO J appli x8misa11   Then WISAKER EXE will find and execute    myproj    application     All these commands can be grouped for instance into a batch file and then started from the  workbench tool menu  see user   s guide  Managing programs       DDE specification    The ISaGRAF NT target is a DDE server  Dynamic Data Exchange   Any software that can be  a client  can be connected with the target to exchange variables  For example  MSEXCEL can  animate graphics with values coming from ISaGRAF target via DDE    The DDE feature requires on the target the application symbols table    DDE subjects are defined as follows                                            Server name   ISASRVs    Note      s    is the slave number    Se sameaa nma    ate  Topics   SYSTEM  lt APPLICATION NAME gt   Items   TOPICS TOPICITEMLIST                                lt VARIABLE NAME gt              ISASRVs    is the name of the DDE server     s    is the slave number       SYSTEM    is a standard topic  which gives access to the    TOPICS    item       TOPICS    gives the list of the topics currently defined  system and the name of the  application  which is running into the ISaGRAF NT target       APPLICATION NAME    is the name of the application        C 356 ICS Triplex ISaGRAF Inc     Target User s Guide          TOPICITEMLIST    is the list of items available under the current topic  this gives the list of
126.  written function blocks   This is an example of such a file        File  grfbOlib c   implemented function blocks      include  lt tasy0def h gt     extern ABP fbldef_fb1 char  name  IBP  init  RBP  read    extern ABP fbldef_fb2 char  name  IBP  init  RBP  read      FBL_LIST FBLDEF         foldef_fb1   foldef_fb2     NULL          end of file       A NULL pointer must terminate the FBLDEF array  Some clashes may occur when this  condition is not met  Unresolved references will occur when linking the new ISaGRAF kernel if  the FBLDEF array is not defined     By writing this file  a new kernel can be built  including all the existing function blocks  A kernel  dedicated to one project can also be built  by inserting in the FBLDEF array only the function  blocks used in the project  The  SaGRAF Code Generator automatically generates the   GRFBOLIB C  file  when the code of an application is built  The file is placed in the ISaGRAF  project directory  and groups only the function blocks used in the project       Limits  The ISaGRAF library may contain up to 255  C  function blocks  Any type of operation may be    processed in a function  Each type of function block may be copied  instanced  up to 255  times in the same project     It should be remembered that the function block services are called in the ISaGRAF cycle   synchronously  so that the execution of the function block has a direct effect on the cycle  timing        ICS Triplex ISaGRAF Inc  C 389    Target User s Guide 
127. 1 port  required for protection key     Before installing the ISaGRAF workbench  the following software should already be  included on the system     e Windows Version 3 1 running in 386 enhanced mode  e Windows 95  e Windows NT Version 3 51 or 4 00    Using the installation program    The ISaGRAF workbench is installed by using INSTALL  the ISaGRAF installation  program  This program copies the ISaGRAF software from the ISaGRAF CD ROM  or disks onto the user s hard disk  INSTALL also adds the group  ISaGRAF  to the  Program Manager window and creates an initialisation file named  ISA ini  in the  installed EXE sub directory     INSTALL is a Windows program  which must be run from the Windows Program  Manager or the Run command of the Start menu of Windows 95  To install  ISaGRAF  the following steps must be performed     e Insert ISaGRAF CD ROM or floppy disk  1 into the appropriate drives  e From the Program Manager or the Start menu  run  SETUP EXE  on the root  folder of the CD ROM  or  A  INSTALL EXE  in the case of floppy disks        A 12    ICS Triplex ISaGRAF Inc     User s Guide       e Follow the on line instructions to complete the installation  It is recommended that  the ISaGRAF Workbench be installed on a new directory to avoid confusing files  with files from other ISaGRAF versions     INSTALL will ask whether the following components are required     e ISaGRAF executable programs  e On line information and help files  e ISaGRAF standard libraries   e ISaGRAF 
128. 123  B 197  B 198  B 237   D 425   IL editor  A 75   Import  A 87   Import function  A 31   Import function block  A 31   Initial situation  B 188  B 199  D 425   Initial step  B 188  B 199  D 425   Input  A 91  A 109  A 133  A 135  A   148  B 178  D 425   INSERT  B 304   Insert coil  A 57   Insert contact  A 57   Insert FBD  A 67   Insert FBD element  A 65   Insert FC element  A 48   Insert file  A 73   Insert rung  A 59   Insert slot  A 91   Insert variable  A 43   Installation  A 12   Instance  A 81  A 84   Instruction  B 237  D 425   Instruction List  B 237  D 425   Integer  A 84  B 179  D 425   INTEGRAL  B 280   Interface  A 30  A 150   Internal  D 425   Inverted coil  B 214   Inverted contact  B 213   IO variable  C 365  C 366   Is equal  B 258   Is not equal  B 259   ISA task  OS9   C 330   ISA EXE  C 326   ISA O  VxWorks   C 339  C 340   isa_main  C 341  C 344   isa_register_slave  C 340   ISAGRAF INI  NT target   C 350   ISAKER task  OS9   C 331   ISAKERET O  VxWorks   C 339  C   342       E 434    ICS Triplex ISaGRAF Inc     General Index       ISAKERSE O  VxWorks   C 339  C 342  ISAMOD  VxWorks   C 339  ISAMOD EXE  C 326  ISANET task  OS9   C 332  ISASSR O  VxWorks   C 339  ISATST task  OS9   C 331  ISAx0  C 336   ISAx1  C 327  C 336   ISAx1  NT target   C 355  ISAx1  VxWorks   C 347  ISAx2  C 336   ISAx3  C 336   ISAx4  C 336   ISAx5  C 336   ISAx6  C 328  C 336   ISAx6  NT target   C 356  ISAx6  VxWorks   C 347    J    JMP operator  IL   B 240  Jump  A 55  A 63  
129. 3        IL equivalence       bi101  bi102  bo10  bi51  bi52  bi53  bo5       current result    bi101         current result    bi101 AND not bi102          bo10    current result         current result    bi51       current result    bi51 AND bi52         current result     bi51 AND bi52  AND bi53        bod    current result          ICS Triplex ISaGRAF Inc     B 247    Language Reference        gt  1 OR    Note  For this operator  the number of its inputs can be extended to more than two     Arguments      inputs  output         Description   Boolean OR of two or more terms     BOOLEAN  BOOLEAN Boolean OR of the input terms       FBD example with  OR  Blocks                          gt  1   bi101   bi102 me 4 bo10   gt  1   bi51   bi52   bi53 bod                                                       ST equivalence      bo10    bi101 OR NOT  bi102    bod     bi  1 OR bi52  OR bi53        IL equivalence              LD bi101  ORN bi102  ST bo10  LD bi51  OR bi52  OR bi53  ST bod   1 XOR  Arguments   IN1 BOOLEAN  IN2 BOOLEAN  Q BOOLEAN Boolean exclusive OR of the 2 input terms  B 248 ICS Triplex ISaGRAF Inc     Language Reference       Description   Boolean exclusive OR between two terms        FBD example with  XOR  Blocks                                                                                       bi101 m  bi102 onz al bo10     bi51 IN  1  bi52 IN2 o  n1  bi53 IN2 ql bo5                                     ST equivalence      bo10    bi101 XOR NOT  bi102    bod    
130. 3  D    a  ja    5     O  Z  S  5  as  a a   0   a  5  Q  Co   pe  O     oO  O  Q  a     oO     a    Q      S      O  Q  pr      5          y       e   S      o  D   j  Q  a    50  cannot overwrite boolean output variable program    located at the same level  the result is unpredictable        ICS Triplex ISaGRAF Inc  C 417    Target User s Guide       51  cannot overwrite analog output variable    Two SFC programs are writing the same analog output variable in the same target cycle  See  above comment     52  cannot overwrite message output variable    Two SFC programs are writing the same message output variable in the same target cycle   See above comment     61  unknown system request code program    A program is using the SYSTEM call with an invalid code     62  sampling period overflow program    The target cycle period is longer than specified in the workbench menu    On a multitasking system  this means that there is not enough CPU time to execute a cycle   even if the    current cycle duration    is less than the specified period    On a single task system  this always means that there are too many operations in one of the  target cycle     There are many possible ways to remove this warning        reduce the number of operations performed at the instant where the warning is detected        reduce number of tokens  of valid transitions  optimize complex processing  etc        reduce other tasks CPU load to give more time to ISaGRAF        reduce communication traffic
131. 427   REAL  B 261   Real board  A 92  D 427   Real time  A 32  A 112   Real time mode  D 427   REDGE  B 224   Reference number  B 187  B 188  B   189  B 192  D 427   Register  IL   B 237  D 427   Removing licensing  A 17   Rename library  A 145   Renumber  A 42  A 51   REPEAT  B 204  B 229   Replace  A 42  A 51  A 59  A 67  A 73   REPLACE  B 308   Resize FC  A 50   Resize SpotLight  A 126   Resource  A 33  A 102   Resource definition file  A 102   Restore  A 26  A 146  A 152  A 153  A   159   RET operator  IL   B 241   Retain  C 406   Return  A 55  A 63   RETURN  B 207  B 217  B 227   Return value  D 427   RIGHT  B 309   ROL  B 292   ROR  B 292   Rotation left  B 292   Rotation right  B 292   RS  B 267   Run time error  B 264  D 427   Rung  A 54  A 55  A 59  A 66   Rung comment  A 57  A 60  A 68   Tooltips  A 60   Rung label  A 57   Run time  A 32   Run time error  A 32  A 113       ICS Triplex ISaGRAF Inc     E 437    General Index       S    S  set  operator  IL   B 239   Save list  A 121   Scientific  B 180   Script  A 136  A 138   Section  A 27  D 427   SEL  B 301   Select FBD element  A 65   Select FC element  A 49   Select SpotLight  A 126   SEMA  B 269   SEMAPHORE  B 269   Sentinel driver  A 14   Separator  B 222  D 427   Sequential  A 27  B 174  B 187   Sequential Function Chart  B 187  D   428   Sequential section  D 428   Serial link  A 35   Set coil  B 215   SFC  A 37  A 99  A 114  A 157  B 187   C 371  D 428   SFC child  A 28  A 44  B 175   SFC editor  A 37  A 75 
132. 5  The higher access level is numbered 0   When a user knows a password  he can access all the items protected by the  corresponding access level  plus all the ones protected with lower levels  Each  elementary command or data of a project or library element can be separately  protected with an access level  For example  the  Make application code  command  from the ISaGRAF menus can be protected separately  Elementary data can be a  program  a list of options  the technical note of a library element  etc       Defining password protection    The  Set password  command of the ISaGRAF menus is used to define the  passwords and access levels for one project or one library element  This command  is called from the menus of the ISaGRAF Project Manager  for a project   or the  ISaGRAF Library Manager  for a library element   No password is required when  first running this command  If passwords are already defined  the user must enter  the highest level password he knows  before accessing this command  Upper level  passwords and protected items then cannot be modified  The  Set password   command enables the user to define the passwords corresponding to the different  access levels  and to protect elementary commands or data with the defined levels   Double clicking on a line of the upper list enters passwords  corresponding to  protection levels   The following box is used to enter a password     Enter password Ed    Level  00          Cancel         The list in the lower area sh
133. 7 3 Working on an existing diagram    The commands of the  Edit  menu are used to change or complete an existing  diagram  Most of these commands act on the elements currently selected in the  diagram     Correcting a diagram    The DEL key can be used to remove the selected elements  Pending links are  deleted with selected elements  Use  Edit   Undo  command to restore elements  after a DEL command  The DEL command can also be applied to a group of       A 66    ICS Triplex ISaGRAF Inc     User s Guide       elements selected in the diagram  The  Cut    Copy    Paste  commands of the   Edit  menu are used to move or copy selected elements       Find and replace    The  Edit   Find  and  Edit   Replace  menu commands are used to find and  replace texts in the diagram  Only complete names can be found  Research acts on  contacts  coils  block names  variables and labels  It cannot be used to find a string  in a comment text  The Replace command cannot be used to change the name of a  block  The research can be made upward or downward  starting at the current  selection position  It  loops  when the limits of the diagram are reached       Displaying the execution order    When an FBD diagram includes backward loops  the execution order cannot follow  the single left to right   top to bottom method  In order to avoid confusion  use the   Tools   Show execution order  command or press Control   F1 keys to display  the execution order that will be used at compiling time  Tags num
134. AF Inc  C 381    Target User s Guide         Source code    The  C  language implementation of a function block is divided into three different entry  points     U initialization service  Q activation service   processing of the calling parameters  O return parameters read service    The same code is used for each instance of a same function block  and is not duplicated  A  static data structure is associated to each instance  Such data cannot be accessed directly by  the ISaGRAF programming  and contain the function block instance  hidden variables      The  activation service  is called once for each instance of each used block  on each target  cycle  It processes the calling parameters  and updates the associated data  It represents the   main algorithm  of the function block     The  read service  is called by the ISaGRAF kernel to read the current value of one return  parameter for one instance  No special calculation has to be performed in such a service  It  only operates transfer between hidden data and the ISaGRAF application     Functional diagram                                   Calling Function block implementation Return  parameters parameters   gt  activate read  gt   Hidden data   f  Allocate   Initialize                                  e Function block static data   A function block associates operations and static data  A data structure is associated to each  instance of a same function block  Each time a function block is used in ST or FBD  programming  it
135. AF Project Management or Library  Management windows     To create and maintain reliable archives  it is suggested that the following  guidelines be used   e Write the name and description of the saved object on the disk sticker  e Do not save projects and libraries on the same diskette  e Do not save different projects on the same diskette    Calling the archive manager    The  Archive  dialog box can be called from the  Tools   Archive  menu of the  Project Management window  to save or restore either a project  or common data   The  Archive  dialog box can also be run from the  Tools   Archive  command of  the ISaGRAF Library Manager  to save or restore elements of the library currently  selected in the Library Management window     Projects    A project is always saved in its entire form  All the components of the project   program source files  object code and application executable code  are saved  together in the same archive file  Selection of the  compression  option reduces  the size of the project archive     Library elements    The elements of ISaGRAF libraries can be saved individually  All the components of  a library element  technical note  definition  interface  source code     are saved  together in the same archive file     Common data    The  Tool   Archive   Common data  command of the Project Management  window enables the user to backup or restore the  common range  data existing in  the ISaGRAF Workbench  This command does not act on the ISaGRAF librar
136. B 197    Language Reference       Warning  When no expression is attached to the transition  the default condition is TRUE   B 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 be 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        S     Run  amp  not Error     B 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                       1 Run Error             aba CH  B 3 6 3 IL convention    Instruction List  IL  programming may be directly used to describe a SFC transition  according  to the following syntax      info 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  curren
137. B 207  B 218  Jump to a step  A 39  B 189  D 425    K  Keyword  B 181  B 238  D 425    L    Label  A 63  A 141  B 207  B 218   Label  IL   B 237  D 425   Ladder Diagram  B 210  D 425   Language  A 28  B 177   LD  A 45  A 52  A 54  A 62  B 210  D   425   LD editor  A 54   LD operator  IL   B 239   LE operator  IL   B 256   LEFT  B 305   Less or equal  B 256   Less than  B 255   Level 1 of the SFC  B 187  B 188  D   425    Level 2  A 42  A 51   Level 2 of the SFC  B 192  D 426   Level of protection  A 158   Library  A 26  A 31  A 32  A 92  A 108   A 134  A 144  A 152  C 364  D 426   Library manager  A 144  C 364  C 366   C 370  C 378   Licensing  A 14   LIM_ALRM  B 279   LIMIT  B 296   Link  A 35  A 64  A 65  A 66  A 113   A 129  A 164  B 201  B 204  B 205   Link  FBD   B 207   Link  LD   B 210   Link  SFC   B 188   List of variables  A 121  A 123  A 126   Local  A 150  B 181  D 426   Lock  A 112  A 161   Locked I O  D 426   LOG  B 285   Logarithm  B 285   LT operator  IL   B 255    M    Macro step  A 39  A 41  B 191  D 426  Make  A 32  A 98   Mask on integer bits  and   B 252  Mask on integer bits  not   B 254  Mask on integer bits  or   B 253  Mask on integer bits  xor   B 254  Matrix  D 426   MAX  B 295   Maximum  B 295   Memory  A 12   Message  A 84  A 121  B 180  B 184   D 426   Message concatenation  B 263  Message length  B 307   Metafile  A 124   MID  B 306   MIN  B 295   Minimum  B 295   MLEN  B 307   MOD  B 297          ICS Triplex ISaGRAF Inc     E 435    General Ind
138. B 291       E 438    ICS Triplex ISaGRAF Inc     General Index       Target  A 99  A 104  D 428   Target architecture  C 325   Target cycle  D 428   Technical note  A 92  A 145  C 364  C   366  C 371  C 378  D 428   Terminal mode  C 338   Test  A 47  A 50  A 51  A 110  A 133   B 202  D 428   Text display  A 124   Text editor  A 73   TextFile  A 104   THEN  B 227   Time unit  B 180   Time out  A 35   Timer  A 84  B 180  B 184  D 428   TMR  B 262   To  A 105   TO  B 230   TOF  B 274   Token  SFC   B 187  D 428   Toolbox  D 428   Tools menu  A 34   Top level  A 27   Top level program  D 428   Touch  A 32  A 98   TP  B 275   Transferring licensing  A 16   Transition  A 37  A 42  A 114  D 428   Trial period  A 14   TRUE  A 84  B 179   TRUNC  B 287   Truncate decimal part  B 287   TSK_FUNIT  C 340  C 343   TSK_NBTCKSCHED  C 340  C 343  C   349   tst_main_ex  C 344   TSTART  B 232   TSTOP  B 233   Type  A 80  A 82  A 91  A 108  A 148   B 179  D 429    U    ULongData  A 102  Unlock  A 112   UNTIL  B 229   Update  A 112   Upload  A 129   Upload  options   A 130  Upload  prepare   A 130    V    Validity of a transition  D 429   Variable  A 30  A 43  A 58  A 64  A 67   A 73  A 80  A 108  A 109  A 113  A   150  A 160  B 181  B 206  D 429   Variable name  B 181   VarList  A 103   Verify  A 32  A 98  A 149   Version number  A 111   Virtual board  A 92  A 161  D 429   Virtual boards  simulation with NT  target   C 360  C 362   Virtual boards  simulation with NT   C   353    W    Wait  A 141
139. B 304   Flow  A 49  B 201  B 204  B 205   Flow Chart  A 47  B 201  D 424   Flow Chart editor  A 47   FM_READ  B 320   FM_WRITE  B 321   Font  A 157   FOR  B 230   From  A 105   Function  A 27  A 30  A 145  A 149  B   175   function block  B 224   Function block  A 27  A 30  A 55  A 63   A 67  A 81  A 84  A 145  B 176  B   206  C 377  D 424   Function block call in IL  B 243   Function block instance  C 377   Function call  ST   B 223   Function call in IL  B 242   Functional Block Diagram  B 206  D   424       ICS Triplex ISaGRAF Inc     E 433    General Index       G    gain 1  B 245   Gallery  A 46   GE operator  IL   B 257  GFREEZE  B 200  B 234  GKILL  B 200  B 234  Global  B 181  D 424   Go to  A 42  A 51  A 73  Goto  A 142   Graphic  A 124  A 128  Greater or equal  B 257  Greater than  B 256   Grid  A 56   Group  A 13  A 25  A 126  GRST  B 200  B 235  GSTART  B 200  B 233  GSTATUS  B 200  B 235  GT operator  IL   B 256    H    Hardware key  A 14   Hierarchy  A 27  A 30  B 174  B 200   D 424   History  A 24  A 33   HYSTER  B 279   Hysteresis  B 279    I    T O  A 33  A 91  A 92  A 93  A 109  A   112  A 133  A 146  A 147  A 148  A   160  A 161   T O board  A 148  D 425   T O channel  D 425   T O channel OPERATE  B 265   T O complex equipment  A 147   T O configuration  A 23  A 146   T O connection  A 91  D 425   I O specific  B 202  B 203   T O variable  D 425   1 O wiring  A 33   Icon  A 125   Icons  A 13    Identifier  D 425   If  A 142   IF  B 204  B 227   IL  A 73  A 
140. C  Flow Chart    FBD  Function Block Diagram   LD  Ladder Diagram     Although licenses are only valid on a single computer  you can transfer them from  one computer to another     To access the License Manager     gt  From the Start menu of Windows  choose Programs  then ISaGRAF 3 5  then  Licensing     A 1 2 1 Adding Licensing    You can obtain authorized licenses for ISaGRAF   To obtain authorized licenses for ISaGRAF    You need only one set of user codes and registration keys when licensing  ISaGRAF     1  On the Add Licensing tab  from the list of available components  select  ISaGRAF     2  Click     gt  to move your selection to the list of Selected Components     You will be prompted to select a feature set  Limited number of I Os  or Large  For  the limited number of I Os set  you need to indicate a specific number of I Os  ranging from 1 to 4095     A Setup Code  User Code 1  and User Code 2 appear in their respective fields     3  Send the licensing information   a  Click Send        ICS Triplex ISaGRAF Inc  A 15    User s Guide       A pre addressed email appears holding the setup code and both user codes  into which you need to include your contact information and purchase order  number  For additional purchases  you need to provide a credit card number     b  Include all required information then send the email     The original setup code and user codes as well as a Registration Key 1 and  Registration Key 2 will be returned via e mail     4  Upon reception  ma
141. CS Triplex ISaGRAF Inc     Language Reference       i Double divergence                                            L Double convergence    Example of double divergence and convergence        SFC program with double divergence and convergence                                                                                           1  IInitialize    Run  1  2  _ Process1 101 _ Process2  _  End of Process 1 EE End of Process 2  2  101  3  _ Wait for process 2 102 _ Wait for process 2  _  true  3  Y    ad    B 3 4 Macro steps    A macro step is a unique representation of a unique group of steps and transitions  The body  of the macro 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         Reference number    Comment          102 Process A                               ICS Triplex ISaGRAF Inc  B 191    Language Reference       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 th
142. CS Triplex ISaGRAF Inc     User s Guide       ok   UT    zE    Creating new variables    The  Edit   New  command allows the user to create new variables  function block  instances or defined words for the selected range and type  New variables are  inserted just before the variable currently pointed to by the selection bar  When this  command is run  an input box is opened to enter the variable description  When the  description is complete  pressing the  Store  button puts it onto the list  The input  box is automatically re opened  so the user can enter other variables with the same   Edit  command  Pressing the  Cancel  button of the dialog box breaks the variable  creation process     Modifying existing variables   The  Edit  command of the  Edit  menu allows the user to modify the description of  the variable currently pointed at by the selection bar  When this command is run  an  input box is opened to modify the variable description  When description is  complete  pressing the  Store  button enables modification  The user also can  press  Next  and  Previous  buttons to extend the modification command to  adjoining variables  Pressing the  Cancel  button closes the dialog box without  storing any modification     Cut and paste    The ISaGRAF dictionary editing tool enables multiple line selection  Many  commands are available to work on the currently edited list of variables  Below are  available  Edit  menu commands     COPY                Copy the selected group of 
143. Counter up  B 270   Counter up down  B 272   Cross reference  A 108   Cross references  A 33  D 423   CTD  B 271   CTU  B 270   CTUD  B 272   Current result  IL   B 237  B 238  D   423   Curve  A 124  A 125  A 128   Cut FBD  A 66   Cut FC  A 51   Cut LD  A 59   Cut SFC  A 41   Cut text  A 73   Cut variable  A 83   Cycle  A 140  B 174  B 178  C 324   Cycle profiler  A 135   Cycle time  C 329  C 338  C 349  C 358   Cycle timing  A 32  A 112  A 135  B   264  C 366  C 370  C 377  D 423   Cycle to cycle  A 32  A 112   Cycle to cycle mode  D 423   Cyclic  B 174  D 423    D    DAY_ TIME  B 309   DDE  A 119   DDE  NT target   C 356  C 360  C 362  Debug  A 34    Debug workspace  A 35   Debugger  A 110  A 132   Decimal  B 180   Decision  A 47  A 50  A 51  B 202  D   424   Declaration  A 30  A 80   Defined word  A 80  A 84  B 185  D   424   Delayed operation  IL   B 238  B 241   D 424   DELETE  B 303   Delete board  A 92   Delete FBD  A 66   Delete FC  A 51   Delete LD  A 59   Delete library  A 145   Delete program  A 31   Delete SFC  A 41   Delete text  A 73   Deleted style  A 71   DERIVATE  B 281   Descriptor  A 23  A 33   Diagnosis  A 132   Diary  A 30  D 424   Dictionary  A 30  A 75  A 80  A 108  A   150  C 366  C 377  D 424   Differentiation  B 281   Direct coil  B 214   Direct contact  B 212   Directly represented variable  A 93  B   182   Directory  A 164   Disabled transition  B 199   Disk  A 12   Dissociate  A 126   Divergence  A 38  A 40  B 189   Divergence  FBD   B 207   Divi
144. E _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    All keywords beginning with an underscore   _   character are internal keywords and must not  be used in textual instructions     B 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 Boolean input board    IDs c free channel of an integer input board    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    QSs c free channel of a message output board   B 182 ICS Triplex ISaGRAF Inc     Language Reference       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 ch
145. E expressions for this variable  This  method ensures that the memory variable is not overwritten during other FEDGE evaluations        ICS Triplex ISaGRAF Inc  B 225    Language Reference       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     B 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        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  
146. F Inc     User s Guide       B 9 3 Standard functions 0 0 0 0    ceeesesecesscsecesesecesecseteeeesecesaeeeseseseseeseneees B 283  C  TARGET USER S GUIDE                ccccceceeeeeeeeeeeeeees C 323  C 1 IN tPOMUCUON si ccccdsciccsscssetacscsctevessecestenee coeagesubeseccesesdescetesesdecueseevedetee    C 324  C 2 Dns tall ati Ons iis ices cssnccessisvsesvevsasensdisncessassosens dovdecevessese codges exes SES e SooS C 325  C 3 Getting started with ISaGRAF DOS target             csccssssssessseseeeees C 326   C 3 1 Running ISaGRAF  ISA  EXE       c ce cceceseeeeceseceeeeeeeeeceseeneenseens C 326   C 3 2 Specificteatures onenen e aie ee RRs C 327  C 4 Getting started with ISaGRAF OS9 target              sscsssssssrseseeesees C 330   C41 Running the ISaGRAF single task  isa          eeesecseeseeseeseeeteeeeeeeees C 330   C 4 2 Running the ISaGRAF multitasks  isaker  isatst  isanet                  C 331   C 4 3 Specific feature Sace nenei eni e E EE E E K C 335  C 5 Getting started with ISaGRAF VxWorks target             ssessssssseees C 339   C 5 1 The system resource Manager  ISASST O         cccceeseeeceeeeeteeeteeneenees C 339   C 5 2 Common features to isa o  isakerse o and isakeret o                00 C 339   C 5 3 Running the ISaGRAF single task  182 0        cceccecsesseeseeseeeteeeeeeeees C 340   C 5 4 Running the ISaGRAF multitasks  isakerse o and isakeret o          C 342   C 5 5 Specific features ec neinn kenaii e AEE E ERE E ets C 346  C 6 Getting started with ISa
147. GRAF Inc  B 239    Language Reference       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    current 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 CN  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 0 or 1 or 2     BOO    conversion to Boolean     JMPC test1    if selector   0 then     LD true  ST bo0    bo0    true     JMP JMPend    end of the program     t
148. GRAF NT target             scsscsssesesseseeeeeees C 350   C 6 1 Running TSaGRAF esscdscsesensss ies cet hovde nen kaa gator C 350   C 6 2 General information on Options              ccsceesseesceesceeeeeeeeeteeeteenseenees C 350   C 6 3 Specriic RELAKS AEE E E crtedica  tae eeeceseaes  C 355   C 6 4 Wser interface maa saat ene Gh oe eh koa Aoi C 359  C 7  CH Programmi          csccccccssccsscesscscecssscssssessssssssesesssssesesssssseeesees C 364   C 7 1 OVETVICW ie hit pe rat nice a A aalitir tienen heated C 364   C 7 2  C  Conversion fUNCtIONS          cece ceeecceteeeeeeceesecereeceeeeeeeaeeeeeaeens C 365   C 7 3  O Futictions  s2  s54scnewivsin e n a n ate C 370   C 7 4  CY FUNCTION BLOCKS 31 20 0Ge elec Said one aa esate C 377   C 7 5 Compiling and linking techniques              cccceeseesceseceteeeeeseeeeeenes C 393  C8 Modbus Vikas snic cecd csesivies covecdesceveessocenssetaeseas sovseece cosvcsuvcstsesteteveasuevensce C 399   C 8 1 MODBUS network and protocol          cceeceecseesseeseeeeeeeseeeeeeeenseenaes C 399   C 8 2 TSaGRAF implementation           cccccceesseesceceesceesceseceeeeeesseeneeeeees C 400       ICS Triplex ISaGRAF Inc  ix    User s Guide       C 9 Power fail management               cccccsessesssecssessecssssssscssssssssssesseessees C 405  C 9 1 Bales fecisesseivshecvege teeta ieigeaite teeta eae e ven eeediecieap ses C 405  C 9 2 Application variables backup             c cesccesesseeeceeeeeeeeeseeeeeeeeeeeeeees C 406  C 9 3 Program state backup 
149. I O variable     Conversion   auu E     Aucun        SCALE       Both conversion functions and tables appear in the list  This implies that the same name  cannot be used for a function and a table  A variable cannot be attached to a conversion  function that has yet to be defined or integrated into the ISaGRAF kernel     a Standard  C  interface    The interface of a conversion function always has the same format  Calling and return  parameters are passed through a structure  This structure is defined in the  TACNODEF h   file         Name  tacnOdef h       C 366 ICS Triplex ISaGRAF Inc     Target User s Guide       Target conversions definition file    sa   define DIR_INPUT 0    direction   input conversion      define DIR OUTPUT 1    direction   output conversion     typedef int32 T ANA     integer ANA type A   typedef float T REAL     real ANA type     typedef struct      conversion structure    uint 16 number     conversion number  reserved      uint16 direction     conversion direction     T_REAL  before     value before conversion      T_REAL    after     value after conversion       str_cnv      define ARG_BEFORE    arg  gt before     define ARG AFTER    arg  gt after     define DIRECTION  arg  gt direction        eof       The  str_cnv  structure completely describes the interface  The only parameter of a  C   conversion function is a pointer to such a structure  The  number  field is the logical number  of the conversion function  location in the ISaGRAF library  and
150. IN  angle    result    ASIN  sine      result is equal to angle          IL Equivalence        LD angle  SIN  ST sine  ASIN  ST result  ATAN  atan  IN Q   Arguments    IN REAL any real analog value   Q REAL arc tangent of the input value  in set   P1 2     PI 2       0 0 for invalid input   Description     Calculates the Arc tangent of a real value        FBD program using  TAN  and  ATAN  block     tan  angle in ql tangent                                              atan  n ql result                                     ST Equivalence      tangent    TAN  angle    result    ATAN  tangent      result is equal to angle         IL Equivalence        LD angle  TAN   ST tangent  ATAN   ST result       ICS Triplex ISaGRAF Inc  B 289    Language Reference       cos  cos  IN Q  Arguments   IN REAL any REAL analog value  Q REAL cosine of the input value  in set   1 0     1 0    Description     Calculates the Cosine of a real value        FBD program using  COS  and  ACOS  blocks     cos  angle m o  cosine                                           acos  N result                                     ST Equivalence      cosine    COS  angle    result    ACOS  cosine      result is equal to angle          IL Equivalence      LD angle  COS   ST cosine  ACOS   ST result    SIN    sin    Arguments   IN REAL any REAL analog value  Q REAL sine of the input value  in set   1 0     1 0      Description   Calculates the Sine of a real value        FBD program using  SIN  and  ASIN  blocks        
151. ISAGRAF    Version 3 5    USER S GUIDE    ICS Triplex ISGGRAF Inc     Information in this document is subject to change without notice and does not represent a  commitment on the part of ICS Triplex ISaGRAF 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 ICS Triplex  ISaGRAF Inc        1994   2004 ICS Triplex ISaGRAF Inc  All rights reserved   Published in Canada by ICS Triplex ISaGRAF Inc     ISaGRAF is a registered trademark of ICS Triplex ISaGRAF 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 Guide       Table of contents    A   USER S  GUIDE i eae ee iae aea eaaa iak A
152. KINT1 err_detect  acknowledge  manual_mode  err_code  max_err    appli_alarm    auto_mode AND NOT STACKINT1 EMPTY     err_alarm    STACKINT1 OFLO    last_error    STACKINT1 OUT        IL Equivalence        LD err_detect   ST STACKINT1 push  LD acknowledge   ST STACKINT1 pop  LD manual_mode   ST STACKINT1 r1   LD err_code   ST STACKINT1 IN   LD max_err   ST STACKINT1 N  CAL STACKINT1   LD auto_mode   ANDN STACKINT1 empty  ST appli_alarm   LD STACKINT1 OFLO  ST err_alarm   LD STACKINT1 0UT  ST last_error       ICS Triplex ISaGRAF Inc  B 277    Language Reference          AVERAGE  average   Arguments    RUN BOO TRUE run   FALSE reset   XIN REAL any real analog variable   N INT application defined number of samples   XOUT REAL running average of XIN value  Description     Stores a value at each cycle and calculates the average value of all already stored values   Only the N last values are stored     The number of samples N cannot exceed 128   If the  RUN  command is FALSE  reset mode   the output value is equal to the input value   When the maximum N of stored values is reached  the last one erases the first stored value        FBD program using  AVERAGE  block       amp                                                           auto_mode average  store_cmd RUN  sensor_value xmn  100 N xou ave_value                                                       ST Equivalence  AVERAGE1 instance of AVERAGE block     AVERAGE 1  auto_mode  amp  store_cmd   sensor_value  100    ave_value    A
153. LD program  It represents the status of an input  variable     Filter attached to an input or output analog variable  The conversion is  automatically applied each time the variable is input or output      C  written function which describes a conversion  Such a conversion can be  attached to any input or output analog variable     Set of points which defines a linear  by segment  conversion  Such a  conversion can be applied to any input or output analog variable     Information calculated by the ISaGRAF workbench about the dictionary of  variables  and where those variables are used in a project     Result of an instruction in an IL program  The current result can be modified by  an instruction  or used to set a variable     Duration of the target execution cycle   Execution mode  in this mode  cycles are executed one by one  according to  the orders given by the user of the debugger     Attribute of a program that is always executed        ICS Triplex ISaGRAF Inc  D 423    Glossary          Decision  Also called test  Flow chart symbol attached to a Boolean expression  The flow    FC  is directed to either YES or NO symbol output depending on the state of the  expression    Defined Unique identifier used to replace any expression in a program    word   Delayed Operation of an IL program  executed when the     instruction occurs  later in   operation the program     IL    Diary Text file that contains all the notes about the changes made to one program   Each note is comple
154. LEN  complete_string     If  nbchar  lt  3  Then Return  End_if    prefix    LEFT  complete_string  3        this program extracts the 3 characters on the left of the string and put the result in the prefix  message variable   nothing is done if the string length is less than 3 characters          IL Equivalence        LD complete_string  MLEN   ST nbchar   LT 3   RETC   LD complete_string  LEFT 3   ST prefix       ICS Triplex ISaGRAF Inc  B 307    Language Reference          REPLACE  Arguments   IN MSG any string  Str MSG string to be inserted  to replace NbC chars   NbC INT number of characters to be deleted  Pos INT position of the first modified character   first valid position is 1   Q MSG modified string     NbC characters are deleted at position Pos    then substring Str is inserted at this position  returns empty string if Pos  lt   0  returns strings concatenation  IN Str  if Pos is greater  than the length of the IN string  returns initial string IN if NbC  lt   0  Description     Replaces a part of a message string by a new set of characters        FBD program using  REPLACE  block     replace        Mr X JONES    Frank   1  4                                           MyName                   ST Equivalence      MyName    REPLACE     Mr X JONES   Frank   1  4       MyName is  Mr Frank JONES           IL Equivalence        LD    Mr X JONES   REPLACE    Frank  1 4  ST MyName  RIGHT  right  IN  NbC Q       B 308 ICS Triplex ISaGRAF Inc     Language Reference       Arg
155. MAChO SLEDS cise E EE E sec craseetatustctesencinyss B 191  B 3 5 Actions within the steps          cccccccssesscsseeeseceeceeecseeeseeeseeeeeeeeeeneeses B 192  B 3 6 Conditions attached to transitions           c ceccceeceseceteeeteeeeenseeseenees B 197       ICS Triplex ISaGRAF Inc  vii    User s Guide       B 3 7 SFG dynamic  rules 24  acces asecan wisi date E B 199  B 3 8 SFC program hierarchy            cccccsceesseeceeeceeseeeeeeseceaeessecseeeneeeneeses B 200  B 4 Flow Chart language            sscssssssssssssssssssssssssessescsessssssssnsesnsesseees B 201  B 4 1 FC COMPONEMIS eoe s e eae tesserae a SEE eae B 201  B 4 2 FC complex Structures           ccccsccesseesceeseeeseeeseeeceseceaeensecseeeneeeneeenes B 204  B 4 3 FC dynamic behavior            cccesccesecseesceeseeeeeeeeeeeseeeeeeeeeneenseenaeeenes B 205  B 4 4 BC cheChan e222  2  sciee  ahs Yoni ese el tlio ae eae B 205  B 5 FBD language           ccccssccsscssssssssssccscsssessssssssesssessnsesesssnsssnsesnsesssoes B 206  B 5 1 FBD diagram main forimat          ccccececsceesceeeeeeceeseeeeeeseceeenseenaeenaes B 206  B 5 2 RETURN statement  ncnion reis B 207  B 5 3 Jumps and label sci  sc  sec sccevccvs cescvtscecescxss cas leiabectesseateecviseacecckeesee cance B 207  B 5 4 Boolean negation             cccccescsseessecseecseeeseeeseeeeceeseessecsaeeaeeneeeaeeenes B 208  B 5 5 Calling function or function blocks from the FBD         eee B 208  B 6 DD VAN SWAG 6 sii  ccsecscvesntssssosesnesensedesesonnssosnnssan
156. Pressing the  Clear  button  resets the parameter description  and removes it from the parameter list  Warning   this command cannot be  undone      The name of a parameter is used to identify the corresponding input field during the  I O board connection if the automation operator must define the field  The name of  a parameter must conform to the following rules    e the maximum length of a name is 16 characters   e the first character must be a letter   e the following characters must be letters  digits or  _  character       A 148    ICS Triplex ISaGRAF Inc     User s Guide       The type of a parameter defines the internal format of the parameter  and its input  format during application I O connection  Below is the list of available internal          formats    word    unsigned 16 bit word   long unsigned 32 bit word   word hexa           unsigned 16 bit word   long hexa            unsigned 32 bit word   boolean unsigned 16 bit word  only lowest bit is used   character             unsigned 16 bit word  only lowest byte is used   string    array of 16 bytes containing a null terminated string  fl    t nni single precision 32 bit floating value    Below are available input formats           word    unsigned decimal word   Kela EET decimal long word   word hexa           unsigned hexadecimal word  long hexa    unsigned hexadecimal long word  boolean                true  or  false   character             single character   string    ascii string  15 characters max   float  
157. R  NOT operators are explicitly represented by the diagram topology   Boolean input variables are attached to graphic contacts  Boolean output variables  are attached to graphic coils  Contacts and coils are connected together and to left  and right power rails by horizontal lines  Each line segment has a Boolean state of  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     LD and FBD diagrams are always interpreted from the left to the right and from the  top to the bottom  Refer to the ISaGRAF Language reference Manual for more  details about LD and FBD languages  These are the basic graphic components of  the LD and FBD languages  such as supported by the FBD LD editor     Left power rail    Rungs must be connected on the left to a left power rail  which represents the  initial  TRUE  state  ISaGRAF FBD editor also allows connecting any Boolean  symbol to a left power rail     Right power rail    Coils may be connected on the right to a right power rail  This is an optional  feature when using the ISaGRAF FBD LD editor  If a coil is not connected on the  right  it includes a right power rail in its own drawing     LD vertical  OR  connection    LD vertical connection accepts several connections on the left and several  connections on the right  Each connection on the right is equal to the OR  combination of the connections on the left        A 62  
158. RAF on a powerful and flexible computer base  there are two  restrictions to the Modbus protocol        C 402 ICS Triplex ISaGRAF Inc     Target User s Guide           Itis only possible to access ISaGRAF variables      Itis difficult to execute fast transfer of a large amount of data    These are the reasons why ISaGRAF offers a set of file transfer    Modbus like    requests  or a     remote file management    protocol  These features have been implemented to enable        Binary or ASCII file download       Binary or ASCII file upload       Dynamic data exchange through virtual or physical shared file    Thus  with the ISaGRAF communication link  any application    independent from ISaGRAF     can easily communicate with a remote target     The protocol is based on the following concepts        The file on the ISaGRAF target side is called remote file       The file on the master computer is called local file       Each byte in a file is accessed with a 32 bit base address plus a 16 bit byte address    There are requests to select the remote file name  to select the base address  to read or write  data of the remote file using the 16 bits byte address     FUNCTION 17  write data    nbb correspond to the number of vH  vL bytes     Question  Sv  n_n Joao o e e PH oer Jor  Answer  sv  11 Jedd Joao o pe oor Joc      The meaning of this request differs according to the address range addH addL         OxF000  Initialize remote file name  nbb correspond to the number of character
159. RIG1 clk  CAL R_TRIG1  LD R_TRIG1 Q  ST CTU1 cu  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           ICS Triplex ISaGRAF Inc  B 243    Language Reference          command          auto_mode          overflow                100                         result                B 244    ICS Triplex ISaGRAF Inc     Language Reference       B 9 Standard operators  function blocks and functions    B 9 1 Standard operators    The following are standard operators of the IEC languages     Data manipulation                0  Assignment  Analog negation  Boolean operations                Boolean AND  Boolean OR  Boolean Exclusive OR  Arithmetic operations                 Addition  Subtraction  Multiplication  Division  Logic operations            0   008 Analog bit to bit AND mask  Analog bit to bit OR mask  Analog bit to bit Exclusive OR mask  Bit to bit negation  Comparison tests                68 Less than  Less or equal to  Greater than  Greater or equal to  Is equal to  Is not equal to  Data conversion s s s Convert to Boolean  Convert to Integer Analog  Convert to Real Analog  Convert to Timer  Convert to Message  Other iahon Message concatenation  System access  Operate I O channel    1 gain  1  IN Q  Arguments   IN any type  Q any type  Description     assignment of one variable into another one       ICS Triplex ISaGRAF Inc  B 245    Language Reference       This block is very useful to directly l
160. Reads an element in an array of integers        FBD program using array management blocks     array_error      RETURN  gt        arread  ident ID  index Pos al read_value                                              ST Equivalence       If  array_error  Then Return  End_if    read_value    ARREAD  ident  index        array_error comes from the ARCREATE call          ICS Triplex ISaGRAF Inc  B 311    Language Reference          IL Equivalence           LD array_error  RETC  LD ident  ARREAD index  ST read_value  ARWRITE  arwrite  Arguments   ID INT identifier of the array  must be in set  0  15    Pos INT position of the element in the array  must be in set  0    size 1   IN INT new value for the element  ok INT execution status  1   writing has succeeded  2   invalid array identifier  3   invalid index  Description     Stores  writes  a value in an array of integers        FBD program using array management blocks       array_error      RETURN  gt                                      arwrite  ident ID  index Pos  value N write_status                                     ST Equivalence       If  array_error  Then Return  End_if    write_status    ARWRITE  Ident  Index  value       array_error comes from the ARCREATE call          IL Equivalence        LD array_error  RETC   LD ident  ARWRITE index value  ST write_status       B 312 ICS Triplex ISaGRAF Inc     Language Reference       F_ROPEN    Arguments   Path    ID    Description     MSG    INT    F_ROPEN    Path ID    file n
161. Run the document generator    2 Select the printer   paper size  and orientation   3 Close the document generator without printing   4  Open the FBD program    5 Display the grid     Q Options of the  Zoom  group allow you to select a main zoom ratio  You  can also use the  zoom  button in the editor toolbar to swap between default zoom  ratios     Use the  Options   Font  command to select the name of the character font to be  used in all ISaGRAF graphic documents  When selecting font  font style and size  are not relevant and do not need to be specified  ISaGRAF graphic editors always  calculate the font size according to selected zoom ratio        ICS Triplex ISaGRAF Inc  A 69    User s Guide       A 7 5 Styles and modification tracking    The ISaGRAF LD FBD editor enables you to assign a graphic style to any  component of an LD FBD diagram  A style is mainly defined as a special diagram  coloring  But ISaGRAF also uses styles to enable modification tracking in diagrams  for version control purpose     Note that styles are visible during simulation or on line debug  as colors  red and  blue  are used in that mode to highlight TRUE   FALSE states of spied variables        A 70    ICS Triplex ISaGRAF Inc     User s Guide        a Predefined styles    The following styles are pre defined     Normal                 Default drawing  black   For modification tracking   normal  style  indicates that elements having that style are part of the original  diagram   Normal  style elem
162. S   starts the child sequence when the step  becomes active   nothing is done when the  step becomes inactive    lt child_program gt   R   kills the child sequence when the step  becomes active   nothing is done when the  step becomes inactive    The SFC sequence specified  as an action must be an existing child SFC program  of the currently edited program  created with the ISaGRAF program manager       Transitions written in ST    The level 2 of a transition is a Boolean expression  To program it in ST language   just enter the Boolean condition according to the ST syntax  Optionally  a semicolon  may be added at the end of the expression     a Transitions written in Quick Ladder    Quick LD editor is available to program the level 2 condition of a transition  In this  case  the diagram is made of just one rung  with only one coil  which represents the  transition  The name of the transition is not repeated with the coil symbol  Below is  an example of transition condition programmed in Quick LD     toggle Cmd100    HHI oo _       ManMode    When programming in Quick LD  use the keyboard arrows to move the selection in  the programming logical grid  and then use the following shortcuts to insert symbols           F2S Mise eieh law insert a contact after the selected symbol   initiate the rung  F3   insert a contact before the selected symbol   Fats Avance  insert a contact in parallel with the selected symbol  FOr ia insert a block after the selected symbol   F7     insert a
163. S Triplex ISaGRAF Inc  B 263    Language Reference          means  myname     Mr Jones           IL equivalence           LD  Mr    ADD s   ADD  Jones    ST myname   SYSTEM   Arguments   Mode INT identifies the system parameter and the access mode  Arg INT TMR new value for a  write  access  Param INT value of the accessed parameter   Description     Access to the system parameters    The following is the list of available commands  pre defined keywords  for the SYSTEM  function     command meaning    These are expected arguments for pre defined functions of the SYSTEM function        command argument return value    SYS_TALLOWED  o   allowed cycle timing  SYS_TCURRENT  0   current cycle timing  SYS TMAXIMUM  0   maximum detected timing  OU imi  itten ti     SYS_TRESET_ _ Jo     new allowed cycle timing    SYSERRTEST  0  Oifnoerrordetected    a    number of timing overflows    SYS_ERR_READ oldest error code          B 264 ICS Triplex ISaGRAF Inc     Language Reference          FBD example with  System  blocks                                                                                                                         System  SYS_TOVERFLO Mode  lt  gt   OL Aas Param  tint  n2 al alarm  alarm  RETURN  gt      nb_err  1 nb_err  System  SYS_TRESET     ode  0 larg Param rc                                              ST Equivalence      alarm     SYSTEM  SYS_TOVERFLOW  0   lt  gt  0    If  alarm  Then   nb_err    nb_err   1    rc    SYSTEM  SYS_TRESET  0         End_If  
164. SFC programs     Main SFC programs are activated by the system when the application starts    A program can have several child programs     Achild of a program cannot have more than one father     Its father can only control a child program     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        B 200 ICS Triplex ISaGRAF Inc     Language Reference       B 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
165. SaGRAF document  However  the  Document Generator provides the same features in both cases    The commands of the  Edit  menu are used to define the elements of the project  that must be inserted in the document  Doing this the user builds the  table of  contents  for the desired document  Any information about the project  programs   variables  options  I O connection     may be inserted in the project document  No  information from another project or from ISaGRAF libraries may appear in this  document      amp  The  File   Print  command generates the document and send it to the  printer  according to the specified table of contents  The  Print  job may take few  minutes to build and format the document  It is highly recommended to wait until   Printing Job  is done in the ISaGRAF Document Generator window  before running  other commands of the ISaGRAF Workbench  Building the whole document may  require a large space on the hard disk  An error message will be displayed if the  disk is full  In such a case  the user will have to either free up disk space by  removing files  or reduce the size of the print job  When the  Print  command is run   a dialog box appears  It allows the user to enter a note describing the actual print  command  Those notes are stored in a history file  and will be printed on the first  page of any future document  including the present one      Customising the table of contents    The  Edit  menu contains the commands to define the  Table of Content
166. SaGRAF editors     Real debugging    The  Debug  command opens the debugger main window  and closes the Program  Management window  The Program Management window is then re opened in  debug mode as soon as communication is established between the debugger and  the target application  The debugger cannot be started if the target code has not  been generated  The debugger cannot be started when child windows  editors  code  generation  I O connection     are opened  Each of them must be closed before  running this command  This command is also available from menus of ISaGRAF  editors        A 34    ICS Triplex ISaGRAF Inc     User s Guide         Preparing the debug workspace    The  Debug   Workspace  command enables you to define a list of documents for  initial workspace  Such documents can be programs  SpotLight graphics  and lists  of variables  Graphics and lists of time diagrams from previous ISaGRAF versions  are also listed with project documents  Documents defined in the initial workspace  are automatically opened when simulation or On line monitoring is launched     Debugging Workspace EI    Documents  Workspace     agitate  program  agitate  list    dtv1  time diagram  dtv2  time diagram   init  program  ilprog  program   soaptemp  list  simulate  program        The dialog box shows the existing documents of the project on the left  and  documents selected for the initial workspace on the right  Use   gt  gt   and   lt  lt   push  buttons to move documents from one 
167. 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    F FALSE  FEDGE  FIND  FOR  FUNCTION    G GE  GFREEZE  GKILL  GRST  GSTART  GSTATUS  GT     moO       ICS Triplex ISaGRAF Inc  B 181    Language Reference       AVOZserc    4o    xs  lt c    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  RESSOURCE  RET  RETAIN  RETC   RETCN  RETN  RETNC  RETURN  RIGHT  ROL  ROR    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  TIM
168. The standard default name of an I O channel  has the following format      lt direction gt  lt type gt  lt slot_number gt _ lt channel_number gt   The first character indicates the direction of the I O channel   AET input channel    VQ orinni output channel    The second character indicates the type of the I O channel     TARY E T Boolean  E DE ere analog    ena isasi message    Below are examples of a standard I O channel names   IXO  T orerar Boolean input   board  0   channel  7  QD2_4 oe  integer output   board  2   channel  4    The  Connect I O channels  command of the I O Connection Editor is used to  modify the default name attached to an I O channel     A 22 3 I O complex equipment    All the channels of a single board have the same type  Boolean  analog or  message  and direction  input or output   Complex I O equipment represents an I O  device with channels of different types or directions  Complex I O equipment is  represented as a list of single I O boards  It uses only one slot in the I O connection  rack list     2 To define complex I O equipment  the user has to define the list of single  boards  which define the I O equipment  He also has to enter the detailed  parameters of each single board  The list of single I O boards is entered through a  dialog box    Pressing the  Append  button allows the user to add a single board at the end of  the current list  The  Insert  button is used to insert a new single board before the  one currently selected in the list
169. The structure of the block used to describe the programs of the application  is  shown below      PROGRAMS    lt nbprg gt     lt va gt    lt name gt        ICS Triplex ISaGRAF Inc  A 167    User s Guide       CARLO SAAD number of programs defined in this block      virtual address of the program  eN Ah program name       The structure of the block used to describe the SFC steps of the application is  shown below  Note that there is one virtual step defined for each non SFC program      STEPS  lt nbsteps gt     lt va gt   lt name gt   lt father gt            nbsteps               number of steps defined in this block  Val E co ee  virtual address of the step  name    step name   father    virtual address of the father    The structure of the block used to describe the SFC transitions of the application  is  shown below      TRANSITIONS   lt nbtrans gt     lt va gt   lt name gt   lt father gt        Eosi   nbtrans                number of transitions defined in this block  va      Virtual address of the transition   name      transition name   father                   virtual address of the father    The structure of the block used to describe the Boolean variables of the application   is shown below      BOOLEANS    lt nb_boo gt     lt va gt   lt name gt   lt attr gt   lt program gt   lt eq false gt   lt eq_true gt     Eass  and if variable number exceeds 4095   X  1  lt varno gt      lt name gt    lt attr gt   lt program gt   lt eq_false gt   lt eq_true gt     number of varia
170. VATE1 instance of DERIVATE block     DERIVATE1 manual_mode  sensor_value  t 100ms    derivated_value    DERIVATE1 XOUT        IL Equivalence        LD manual_mode   ST DERIVATE1 run   LD sensor_value   ST DERIVATE1 XIN   LD t 100ms   ST DERIVATE1 CYCLE  CAL DERIVATE1       ICS Triplex ISaGRAF Inc  B 281    Language Reference          LD DERIVATE1 XOUT   ST derivated_value   BLINK   Arguments   RUN BOO mode  TRUE blinking   FALSE reset the output to false  CYCLE TMR blinking period  Q BOO output blinking signal   Description     Generates a blinking signal     Timing diagram           SIG_GEN  sig_gen  Arguments   RUN BOO mode  TRUE running   FALSE reset to false  PERIOD TMR duration of one sample  MAXIMUM INT maximum counting value  PULSE BOO inverted after each sample  UP INT up counter  increased on each sample  END BOO TRUE when up counting ends  SINE REAL sine signal  period   counting duration   Description     Generates various signal  blink on a Boolean  a integer counter up  and real sine wave     When counting reaches maximum value  it restarts from 0  zero   So END keeps the TRUE  value only during 1 PERIOD        B 282 ICS Triplex ISaGRAF Inc     Language Reference       Timing diagram   PERIOD       RUN    PULSE    MAXIMUM    UP    END    SINE    B 9 3 Standard functions    These are standard functions supported by the ISaGRAF system  Such functions are pre   defined and do not have to be declared in the library     EXPT  POW  LOG  SQRT  TRUNC  Trigonometric      
171. VERAGE1 XOUT        IL Equivalence        LD auto_mode  AND store_cmd   ST AVERAGE 1 run  LD sensor_value  ST AVERAGE1 xin  LD 100   ST AVERAGE1 N  CAL AVERAGE1   LD AVERAGE1 XOUT  ST ave_value  HYSTER          B 278 ICS Triplex ISaGRAF Inc     Language Reference       Arguments   XIN1  XIN2  EPS  Q    Description     REAL  REAL  REAL  BOO    any real analog value   to test if XIN1 has exceeded XIN2 EPS   hysteresis value  must be greater than zero    TRUE if XIN1 has exceeded XIN2 EPS and is not yet  below XIN2 EPS    Hysteresis on a real value for a high limit     Example of timing diagram     LIM_ALRM    Arguments    H   X   L   EPS  QH   Q   QL    Description           XIN2 EPS    XIN2  XIN2 EPS    REAL  REAL  REAL  REAL  BOO  BOO  BOO       lim_alrm       high limit value   input  any real analog value   low limit value   hysteresis value  must be greater than zero    high  alarm  TRUE if X above high limit H  alarm output  TRUE if X out of limits    low  alarm  TRUE if X below low limit L    Hysteresis on a real value for high and low limits     An hysteresis is applied on high and low limits  The hysteresis delta used for either high or  low limit is one half of the EPS parameter  Below is an example of timing diagram        ICS Triplex ISaGRAF Inc     B 279    Language Reference          INTEGRAL  integral  Arguments   RUN BOO mode  TRUE integrate   FALSE hold  R1 BOO overriding reset  XIN REAL input  any real analog value  X0 REAL initial value  CYCLE TMR sampling pe
172. _CLOSE  ST ok  FM_WRITE  FM_WRITE  Arguments   ID INT file number  returned by F_WOPEN   IN MSG message value to be written in the file  ok BOO execution status  TRUE if succeeded  Description     Writes MESSAGE variables to a binary file    To be used with F_WOPEN and F_CLOSE    A message is written in the file as a null terminated string    This procedure makes a sequential access to the file  from the previous position   The first call after F_WOPEN writes the first string to the file    each call pushes the writing pointer    This function is not included in the ISaGRAF simulator        FBD program using file management blocks          ICS Triplex ISaGRAF Inc  B 321    Language Reference             F_WOPEN  P  1D                                                           trace txt ath file _id  FM_WRITE  file _id p   First message  N ox ok  FM_WRITE  file _id p   Last message  N ok ok  F_CLOSE  file_id ID ok ok                         ST Equivalence        file_id    F_WOPEN    trace txt         ok    FM_WRITE file_id  First message       ok    FM_WRITE file_id  Last message         ok    F_CLOSE  file_id         IL Equivalence      LD    F_WOPEN    ST    ST  LD    ST  LD  F_CLOSE  ST       trace txt       file_id  FM_WRITE First message       file_id  FM_WRITE Last message       file_id       write first msg          write second msg          B 322    ICS Triplex ISaGRAF Inc     Target User s Guide       C  Target User s Guide       ICS Triplex ISaGRAF Inc  C 323    Targ
173. a complete data protection system based on  hierarchised passwords  Variable declaration and I O connection can be globally  protected by a password  Additionally  ISaGRAF enables you to set individual  protection to any variable or I O channel  This assumes that      passwords are already defined in the password definition system  use the  Project    Set password  command of the Project Management window  so that protection  levels are available for individual protection      you use protection levels with higher priority for individual protection compared to  global variable or I O protection     When a variable or an I O channel has individual protection  a small icon is draw  close to its name in dictionary or I O connection window    Use the  Set protection  and  Remove protection  commands of the  Edit  menu  in dictionary or I O connection windows to set or remove an individual protection for  selected variable or channel  Both commands ask you to enter a valid password so  that a protection level can be attached to the variable or channel  Then  each time  you want to change a variable or a connection to a channel having individual  protection you must enter a password with sufficient priority level     Warning  if a variable or channel is protected with a level  and the corresponding  password is removed from protection system  and if no higher level password is  defined  variable or channel cannot be changed anymore unless a new password  with sufficient level is de
174. a flow   by the identification of the target point  generally the name of the target  symbol   Below is the standard drawing of a connector          _  nn  Name    A connector always targets a defined Flow Chart symbol  Its logical number identifies the  destination symbol     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 A  be on several lines       B 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      lt  Tet Y IF   THEN   ELSE    YES  D     1  place for  THEN  actions to be inserted   2  place for  ELSE  actions to be inserted    REPEAT   UNTIL     3  place for repeated actions to be inserted       B 204 ICS Triplex ISaGRAF Inc     Language Reference       WHILE   DO   3  place for repeated actions to be inserted    B 4 3 FC dynamic behavior    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      The flow is broken each time an item  action  decision  is encountered that has already been  reache
175. a new parameter before the selected parameter  The   Delete  command is used to erase the selected parameter  The  Arrange  command  automatically rearranges  sorts  the parameters  so that the return parameter is put at the end  of the list  Pressing the  OK  button stores the definition of the function interface and closes  the dialog box  Pressing the  Cancel  button closes the dialog box  without changing the  definition of the function interface     a Function  C  interface    The interface of a function depends on the definition of its parameters  Calling and return  parameters are passed through a structure  This structure is defined in the  GRUSOnnn H   file  where  nnn  is the logical number of the function in the ISaGRAF library  This is an  example of the  C  interface  for the  SIN  function  sine calculation         File  GRUS0255 h   function  sample        typedef long T_BOO    typedef long T_ANA    typedef float T_REAL    typedef long T_TMR    typedef char  T_MSG    typedef struct       CALL    T_REAL _paraml      RETURN    T_REAL _param2      str_arg        C 372 ICS Triplex ISaGRAF Inc     Target User s Guide        define PARAM   arg  gt _param1    define PARAM2  arg  gt _param2        end of file       The relationship between ISaGRAF types and  C  types is shown below  The ISaGRAF types  are defined as  C  types in the definition file of the function     T_BOO long  32 bits   Integer analog T_ANA  Real analog T_REAL float  32 bits   single precision    lo
176. able a Boolean output of a connection line Boolean state   boo_variable        S j    Left connection  gt  ee 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 a  RESET  coil makes an inverse  order  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 output4  I R          ST Equivalence      IF input  THEN   output1    TRUE   END_IF        ICS Triplex ISaGRAF Inc  B 215    Language Reference       IF input2 THEN  output1    FALSE     END_IF     RESET coil   Reset  coils enable Boolean output of a connection line Boolean state   boo_ variable   R   Left connection a TA A 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 until a  SET  coil makes an inverse  order  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      S   input2 output4    R       ST Equivalence       IF input4 THEN  output1   
177. ailable to directly act on a Boolean variable according to  the step activity  Such actions consist of attaching the step activity signal to an  internal or output Boolean variable  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       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    SFC actions    Other text semantics are available to control the execution of a child SFC program   A SFC action is a child SFC sequence  started or killed according to the condition of  the step activity signal  A 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_program gt   N   starts the child sequence when the step  becomes active  and kills the child sequence  when the step becomes inactive    lt child_program gt   same effect as the preceding syntax  N  attribute is optional        A 44    ICS Triplex ISaGRAF Inc     User s Guide        lt child_program gt   
178. ak        ICS Triplex ISaGRAF Inc  C 385    Target User s Guide       Pea         The  hinstance  argument is the logical number of the instance  It is reserved for ISaGRAF  internal operations  and should not be used in the programming of the service  The  data   argument is a far pointer to the data structure associated to the instance     The  parno  argument is the logical number of the return parameter which value is required   Use the identifiers defined in the function block  C  header to identify return parameters  Such  identifiers begin with the  FBLPNO_  prefix  The  value  argument is a far pointer to the  buffer where to copy the current value of the accessed return parameter  The type of data  pointed to by this argument depends on the ISaGRAF type of the return parameter  The  following table gives the relationship between ISaGRAF types and buffer  C  data type     32 bit unsigned word  0 false   1 true    32 bit signed word oS O    32 bit signed word    The following macros are used to have access to the copy buffer  according to the type of the  accessed return parameter         define BOO_VALUE   T_BOO   value    define ANA_VALUE   T_ANA   value    define REAL_VALUE   T_REAL   value    define TMR_VALUE   T_TMR   value    define MSG_VALUE   T_MSG   value     These are commonly used programmed operations to copy the value or the parameter to the  ISaGRAF buffer        for a Boolean parameter       BOO_VALUE   parameter_value      for an integer analog paramete
179. alid    No application                 Connection is OK  but no ISaGRAF application currently  exists in the target system  Download an application    Application active           Connection is OK and an active application exists in the  target system  Debugger is now establishing the  communications with this application  if it is the same as  the one on the Workbench    RUN  aninion Target application is in  Real Time  mode    A 110 ICS Triplex ISaGRAF Inc     User s Guide       A 15 2    dhi    STOP fa Saiki Target application is in  Cycle to Cycle  mode    BreakPoint                      Target application is in  Cycle to Cycle  mode  because a  breakpoint is encountered    Fatal Error                    Target application failed because a serious error  occurred     Information on the run time cycle timing is as follows    Allowed                    05 programmed timing    Current     EE exact timing of the last complete execution cycle    Maximum         maximum timing detected since the application started    Overflow               0 8 number of execution cycles detected with timing greater  than the allowed timing    All time values are given in milliseconds  Time values are not displayed when   debugger is used in simulation mode         Controlling the application    The  File  and  Control  menus contain the commands for the installation and the  control of the currently edited ISaGRAF application on the ISaGRAF target system     Note  Some of these commands are no
180. alue  0   program is inactive  killed     1   program is active  started   2   program is frozen    Note  GSTATUS is not in the IEC 1131 3 norm     Example        ICS Triplex ISaGRAF Inc  B 235    Language Reference                                                                                        1  Run_cmd   1     2  _JACTION P   201  _JACTION N    GSTART Schild   if GSTATUS Schild    0 then  END_ACTION  Mstat       Stopped      else  Mstat       Running      NOT Run_cmd   end_if   R END_ACTION   3  _JACTION P    GKILL Schild    END_ACTION   Run_cmd   2  B 236 ICS Triplex ISaGRAF Inc     Language Reference       B 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     B 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 operator  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 
181. ame   It may include the access path to the file using the   or    symbol to specify a directory  To ease application  portability    or   is equivalent    file number   0 if an error occurs  file does not exists     Opens a binary file in read mode  To be used with FX_READ and F_CLOSE   This function is not included in the ISaGRAF simulator        FBD program using file management blocks           c  data data bin           file_id    ne             ST Equivalence      file_id    F_LROPEN  c  data  data bin     error     file_id 0         IL Equivalence        LD  F_ROPEN  ST  EQ  ST    F_WOPEN    Arguments   Path       c  data data bin     file_id  0  error    MSG    INT             F_ROPEN  Path ID file_id  IN2 Q error                   F_WOPEN    Path ID    file name   It may include the access path to the file using the   or    symbol to specify a directory  To ease application  portability    or   is equivalent    file number   O if an error occurs  If the file already exists  it is  overwritten        ICS Triplex ISaGRAF Inc     B 313    Language Reference       Description     Opens a binary file in write mode  To be used with FX_WRITE and F_CLOSE     This function is not included in the ISaGRAF simulator        FBD program using file management blocks               c  data data  bin             file_id             ST Equivalence        F_WOPEN    Path    ne    IN2    file _id    F_WOPEN    c  data  data bin       error     file_id 0         IL Equivalence        file
182. ameter     the type of the parameter       ICS Triplex ISaGRAF Inc  C 379    Target User s Guide       Any of the ISaGRAF data types may be used for a parameter  Boolean  Integer analog  Real  analog  Timer or Message  Integer and real analogs must be distinguished  Below is the  relationship between ISaGRAF types and  C  types     BOOLEAN unsigned long   unsigned 32 bit word  1 true   O false  ANALOG signed integer 32 bit word    REAL single precision floating value  TIMER unsigned long   unsigned integer 32 bit word  unit is 1 millisecond   MESSAGE character string     When a message value is passed onto a  C  function  it cannot contain null characters  The  string passed to the  C  code is null terminated  Do not forget that return parameters must be  the last ones in the list  The rules shown below must be followed while naming parameters      the length of the name cannot exceed 16 characters     the first character must be a letter     the following characters must be letters  digits or  _  character     naming is case insensitive       The same name cannot be used for more than one parameter of the function block  A calling  parameter cannot have the same name as a return parameter  The same name can be used  for parameters of different function blocks  The name of a parameter is used to identify the  parameter in the  C  source code     The  Insert  command is used to insert a new parameter before the selected parameter  The   Delete  command is used to erase the sel
183. ample     ANYTARGET    Specifies the name of a target code that has to include the resource   Refer to the previous section  compiler options  for further information  about handled targets  The  Target  statement can appear more than  once in the same resource block  in order to select several targets   This statement cannot be used if the  AnyTarget  statement is  specified     TARGET   lt target_name gt      BinaryFile  MYFILE   Begin   Target  ISA86M   Target  ISA68M        B   a     Meaning     Specifies that the resource must be merged to all the target codes  built by the Code Generator  The ISaGRAF Code Generator can  produce several target codes during the same  Make  command  This       A 104    ICS Triplex ISaGRAF Inc     User s Guide       statement cannot be used if one or several  Target  statements are  specified     Syntax  ANYTARGET    Example  ULongData  MYDATA   Begin  AnyTarget    End    Meaning  Specifies the source pathname  on the PC where the ISaGRAF  Workbench is installed  of a BinaryFile or TextFile resource  The  characters used to isolate the components of the pathname  drive   directory  prefix  suffix  must conform to the MS DOS system  conventions     Syntax  FROM   lt target pathname gt      Example  BinaryFile  MYFILE   Begin    From  c  user config dat   To   dd user appl config dat     End  Meaning  Specifies the destination pathname  on the target system  of a    BinaryFile or TextFile resource  The characters used to isolate the  componen
184. an once in a SFC program     Example of macro step      SFC program with macro step                                                                                              Main chart       Body of the macro step     1   IJInitialize 201  Fill WUnit  _  unit full  201    Error _  Run  amp  not Error 202   Weigh  1 101  2   Alarm 201  Weighing Siis weighing done  _  Ack _ __ true 203 _ Empty WUnit  2 102  _  unit empty  203    204 _ Store weight  1                      B 3 5 Actions within the steps    The level 2 of a SFC step is the detailed description of the actions executed during the step  activity  Using SFC literal features and other languages such as Structured Text  ST  makes  this description  The basic types of actions are      Boolean actions     Pulse actions programmed in ST     Non stored actions programmed in ST     SFC actions    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    B 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 
185. analog I O  conversion at run time on the ISaGRAF target PLC  This utility does not require any  C   development  as it is limited to strictly increasing or decreasing continuous functions  Refer to  the ISaGRAF User s Guide for a complete description of these tools     Conversion functions enable the user to apply any complex conversion  with specific  operations described in the  C  language  Basically  a conversion function is defined for both  inputs and outputs  Even if one direction is not used  implementation and tests have to be  made before integrating the conversion to the ISaGRAF kernel  to prevent any system crash  due to a wrong call     Conversion functions are written in  C  language  compiled and linked with the ISaGRAF  kernel  The increased kernel must be installed on the ISaGRAF target PLC before using new  conversion functions in ISaGRAF projects  New conversion functions cannot be integrated in       ICS Triplex ISaGRAF Inc  C 365    Target User s Guide       the ISaGRAF Simulator  The ISaGRAF applications have to be simulated before inserting the  non standard conversion functions     The  C  source code of the standard conversions written by ICS Triplex ISaGRAF are  installed with the ISaGRAF Workbench  They can be used as examples for creating new  functions  It is recommended not to modify the standard functions so they can be used in  any ISaGRAF application  The ISaGRAF simulator supports the standard conversions  delivered with the ISaGRAF Workbenc
186. and static data  They complete the set of  C   functions  by allowing the processing of static objects  They are commonly used to increase  standard capabilities of ST and FBD languages  Unlike functions  which process values   function blocks can process static data  This means that a function block algorithm can  manage the variations of data over time     Function blocks are written in  C  language  compiled and linked with the ISaGRAF kernel   The increased kernel must be installed on the ISaGRAF target PLC before using new function  blocks in ISaGRAF projects  New function blocks cannot be integrated in the ISaGRAF  Simulator  The ISaGRAF applications have to be simulated before using the non standard  functions     Warning  Function block calls are synchronous operations  activated at run time by the  ISaGRAF kernel  during the application cycle  Time spent for the execution of a function block  activation or read service is included in the ISaGRAF application cycle timing  The user has  to ensure that no  wait operation  is programmed in a function block  so that the ISaGRAF  cycle processing time does not exceed the max time allowed       Declaring function block instances    A function block is an object  which combines operations and static data  Below is the  example of the  R_TRIG  function block  which detects the rising edge of a Boolean  expression  Here is the functional description of the block        ICS Triplex ISaGRAF Inc  C 377    Target User s Guide     
187. ands and options from the  window menu     Main commands    The  Files  menu contains the commands for program syntax checking and code  generation     Make application code    The  Make  command constructs the entire code of the project  Before generating  anything  this command checks the syntax of the declarations and programs  Any  error that cannot be detected during single program compiling is detected during  code generation  This applies to tables of conversion  I O variable connections and  links with the libraries  The code generation halts the compiling of a program when  errors are detected  This program must be corrected before continuing the code  generation  Programs which have already been checked  with no error detected   and that have not been modified since their last  Verify  operation are not re   compiled  Variable declaration verification and application coherence checking are  always processed  During program checking  the  Make  operation can be aborted  by hitting the ESCAPE key     Note  If the declaration of a local variable of a program has been modified  this  program is verified  If a global variable has been modified  all the programs are  verified     Program syntax checking    The  Verify program  command allows the user to verify only one program  The  selected program is compiled even if it has not been modified since its last  verification  The  Verify dictionary  command allows the user to verify the  declarations of all the variables of 
188. ange of the address  within timer data type    PGi iig name of the variable       attribute of the variable  always  X  internal   Janie virtual address of the parent program   dati estecoesdiieey aed  or  10000  for a global variable       The structure of the block used to describe the message variables of the  application  is shown below                  MESSAGES   lt nb_msg gt     lt va gt   lt name gt   lt attr gt   lt program gt   lt max_len gt          and if variable number exceeds 4095     X  4  lt varno gt     lt name gt   lt attr gt   lt program gt   lt max_len gt        ICS Triplex ISaGRAF Inc  A 169    User s Guide       number of variables in this block   virtual address of the variable   range of the address  within message data type   name of the variable   attribute of the variable   virtual address of the parent program   or  10000  for a global variable   maximum length  declared capacity        The structure of the block used to describe the  C  functions used in the application   is shown below      USP  lt nb_usp gt     lt va gt   lt name gt     Hees   nb_usp                number of C functions in this block  Vaer aidea virtual address of the C function  name a name of the C function    The structure of the block used to describe the  C  function block instances used in  the application  is shown below      FBINSTANCES   lt nb_fb gt     lt va gt   lt inst_name gt   lt fb name gt           Nth    nals number of instances of a C function blocks in this bl
189. annel      IXs b c free channel of a Boolean input board   IDs b c free channel of an integer input board   ISs b c free channel of a message input board   QXs b c free channel of a Boolean output board   QDs b c free channel of an integer output board   QSs b c free channel of a message output board    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   B 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   Input  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     B 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  
190. ard   c  is the number of the channel     SILKS CLAN  free channel of a Boolean input board  SIDS  Coie free channel of an integer input board    SE C pesin free channel of a message input board       ICS Triplex ISaGRAF Inc  A 93    User s Guide       free channel of a Boolean output board  free channel of an integer output board  BOSS  Coes free channel of a message output board       Below are the naming conventions of a directly represented variable for a channel of  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        SIXA  bi Cunn free channel of a Boolean input board  VIDS  b  C    free channel of an integer input board   ISs b c    free channel of a message input board  VQXS  bo CG    free channel of a Boolean output board  SQDS D  C    free channel of an integer output board  VSS  bo C na free channel of a message output board    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     A 11 5 Numbering    Use the  Options   Numbering  command to set numbering conventions  You can  specify the number used for the first slot and the number used for the first channel  of each board in the following dialog box     First number for    ial CH Cancel  Channels  i as          As default  slot numberin
191. 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  Cc conditional operation    The  N  modifier indicates a Boolean negation of the operand  For example  the instruction  ORN 1X12 is interpreted as  result    result OR NOT  1X12      The parenthesis     modifier indicates that the evaluation of the instruction must be delayed  until the closing parenthesis     operator is encountered        ICS Triplex ISaGRAF Inc  B 237    Language Reference       The  C  modifier indicates that the attached instruction must be executed only if the current  result has the Boolean value TRUE  different than 0 for non Boolean values   The  C  modifier  
192. ariable of the group  results in network addresses of the variables of the  group being set with consecutive addresses  Entering a null basis address resets  to zero the network address of all the selected variables     Importing Boolean  true false  strings    When editing defined words  the  Tools   Import true false definitions  allows the  user to automatically define as language keywords the strings attached to Boolean  variables to represent TRUE and FALSE states  Such strings are normally defined  for debug formatting  They have to be specified as defined words if they are to be  used in programs  This command searches for Boolean true false strings in the  declarations with the same range as the one currently selected for the editing of the  defined words     A 10 3 Description of objects       A complete description must be entered for each variable  function block instance   or defined word  Description fields are different for each type of object  The following  fields are common for any type of variables     Name    ceceeeeeeseeeessseeeees Name of the variable  first character must be a letter   following characters must be letters  digits or  _   Network address             Hexadecimal network address  optional   When this field    is non zero  the variable can be spied by external systems  at run time    Comment          Free comment for variable description    Retains iisi This option indicates that the variable must be saved on  backup memory        These are 
193. arts of the process     m Single divergence  OR     4    Warning  following transitions are not  implicitely exclusive                         Pe e                    Single convergence  OR     Double divergences represent parallel processes     a                    __ Double divergence  AND                    These are parallel  processes                         4 Double convergence  AND           A 38 ICS Triplex ISaGRAF Inc     User s Guide         Jump to a step    The SFC editor only allows the user to draw links in the up to down direction  A  jump to a step can be used to represent a link to an upper part of the chart   Following charts are equivalent                             1    Jump to a transition is forbidden  and must be explicitly represented as a double   AND  convergence       Macro steps    A macro step is a unique representation of a stand alone group of steps and  transitions  A macro step begins with a beginning step and terminates with an  ending step     NG    The detailed representation of a macro step must be described in the same SFC  program  The macro step symbol must have the same reference number as the  macro beginning step  A macro step description may contain another macro step     A 4 2 Entering a SFC chart    To draw a SFC chart  the user simply has to introduce the significant components of  the chart  All the single lines joining two elements  horizontally or vertically  are  drawn automatically by the SFC editor  To place a SFC componen
194. as  The name of the  resource cannot exceed 15 characters     Syntax  VARLIST   lt resource_ name gt    BEGIN     target selection        list of variable names     END    Example  VarList  LIST   Begin    Var100  MyParameter  Command  Alarm  End    BINARYFILE    Meaning  Specifies a Binary File resource  The source data is stored in an MS   DOS file  The target resource definition is completed with a target  pathname  The ISaGRAF Resource Compiler does not convert ends  of line characters  The name of the resource cannot exceed 15  characters     Syntax  BINARYFILE   lt resource name gt    BEGIN     target selection     FROM   lt source pathname gt    TO   lt destination_pathname gt    END    Example  BinaryFile  MYFILE        ICS Triplex ISaGRAF Inc  A 103    User s Guide       TEXTFILE    Begin    From  c  user config bin   To   dd user appl config dat   End    Meaning     Syntax     Example     Specifies a Text File resource  The source data is stored in an ASCII  file  The target resource definition is completed with a target  pathname  The ISaGRAF Resource Compiler according to the target  host system conventions converts ends of line characters  The name  of the resource cannot exceed 15 characters     TEXTFILE   lt resource name gt    BEGIN      target selection      FROM   lt source pathname gt     TO   lt destination_ pathname gt    END    TextFile  MYFILE   Begin    From  c  user config bin   To   dd user appl config dat   End    TARGET    Meaning     Syntax     Ex
195. ata bin  Pan 10 file_id   FA_READ   file_id p al VAL   F_EOF  file_id ID oxf  lt  gt   gt   gt not_eof     last val      gt  CAT  Msg U   VAL n a message  F_CLOSE   file_id ID ok ok                                           ST Equivalence      file _id    F_LROPEN    data bin     WHILE not F_EOF file_id     VAL    FA_READ file_id    END_WHILE   MESSAGE       last val       msg VAL    ok    F_CLOSE  file_id         ICS Triplex ISaGRAF Inc     B 315    Language Reference          IL Equivalence      LD       data bin      F_ROPEN   ST file_id   LD file_id   F_EOF   JMPC END_OF_FILE  NOT_EOF  LD file_id   FA_READ   ST VAL   LD file_id   F_EOF   JMPNC NOT_EOF     if not eof  go on reading     END_OF_FILE LD VAL   MSG   ST val_msg    conversion of VAL into a message      LD    last val       ADD val_msg   ST MESSAGE   LD file_id   F_CLOSE   ST ok  FA_READ   FA_READ  ID Q   Arguments   ID INT file number  returned by F_ROPEN   Q INT integer analog value read from file   Description     Reads ANALOG variables from a binary file  To be used with F_ROPEN and F_CLOSE   This procedure makes a sequential access to the file  from the previous position    The first call after F_ROPEN reads the first 4 bytes of the file    each call pushes the reading pointer    To check if the end of file is reached  use F_EOF    This function is not included in the ISaGRAF simulator        FBD program using file management blocks          B 316 ICS Triplex ISaGRAF Inc     Language Reference       F_ROPEN 
196. b programs  functions or function blocks may have up to 32 parameters   input or output   A function or sub program always has one  and only one  return  parameter  which must have the same name as the function  in order to conform to  ST language writing conventions  The following dialog box is used to describe the  parameters of the sub program        ICS Triplex ISaGRAF Inc  A 75    User s Guide            Parameters      Filter    Lx   a  min_vyalue Cancel    Ama max_yalue    Filter       Name   ee Boolean   Imsen        C Analog   6 Call C Real Delete     Return    Timer Arrange         Message                   The list in the upper left side of the window shows the parameters  in the  order of the calling model  first the calling parameters  last the return parameters   The lower part of the window shows the detailed description of the parameter  currently selected in the list  Any of the ISaGRAF data types may be used for a  parameter  The return parameters must be located after calling parameters in the  list  Naming parameters must conform to the following rules    e the length of the name cannot exceed 16 characters   e the first character must be a letter   e the following characters must be letters  digits or underscore character  e naming is case insensitive    The  Insert  command is used to insert a new parameter before the  selected parameter  The  Delete  command is used to erase the selected  parameter  The  Arrange  command automatically rearranges  sorts 
197. bal variable is declared as an  str_ssr structure type  which is defined in tasyOssr h file     WARNING    The breakpoint management of the ISaGRAF debugger cannot run correctly if the  application code is not accessible for writing  This is not a problem  as your application  has normally been fully tested before     On the PC host  if the ISaGRAF workbench is installed on the standard  ISAWIN directory   the application code file of the project MYPRO4J is     ISAWIN APL MYPROJ appli x6m  corresponding to isax1 on the target    the application symbols file of the project MYPRO4 is     ISAWIN APL MYPRO J appli tst  corresponding to isax6 on the target        Error management and output messages    The ISaGRAF target software integrates an error detection management  You will find the  warning error list and their description in appendix     Error detection is processed as follows       An error is composed of an error and argument number sent to the ISaGRAF error routine       C 348 ICS Triplex ISaGRAF Inc     Target User s Guide           If the error detection flag is set in the workbench Make options  the error is processed  If  not  the information is lost and the error management ends     When processed        Error number  decimal value  and argument  hexadecimal value  are displayed on the  default stdout output       Error number and argument are pushed into a ring FIFO error buffer in order to be  retrieved at a later time  The error buffer size is set in the workben
198. be changed is  done by double clicking on its name or its drawing in an editing window  when the  debugger window is opened     Variables   A variable status is changed by double clicking on its name in one of the following  windows    e Dictionary   e Lists of variables or time diagrams       ICS Triplex ISaGRAF Inc  A 113    User s Guide       e LD or FBD Programs  e I O connection    The following commands are offered in the debug dialog box   e Write the variable to a new value   e Lock the variable  for I O variables only    e Unlock the variable  for locked I O variables only    e Start or stop a timer variable  set automatic refresh mode     Symbolic values used to represent Boolean FALSE and TRUE values are the  strings defined for that specific Boolean variable in the dictionary  The analog value  specified for a  Write  command must be entered in an integer or real format   according to the variable definition in the dictionary  The string specified for a   Write  command for a message cannot be longer than the message capacity  attached to that specific variable in the dictionary          SFC objects  To observe a control operation on a SFC program while debugging the application   commands of the  File  menu are used in the Program Management window  The  SFC program must be selected from the list of programs  The following commands  are available   Start SFC program          Enables the selected program by putting a SFC token into   each of its initial steps    K
199. bench Make options  When  the buffer is full  at each new incoming error  the oldest one is lost        Errors can be pulled either from the debugger or from the running application using the  SYSTEM call  see user   s guide      When the debugger detects an error  a message describing the error is displayed in the error  window  Depending on the context of the application  running or not  the debugger may  display the name of the object  variable or program  where the error comes from  or the  argument error  decimal value  into brackets  x  which has a different meaning for each error     A welcome message and error values are displayed on the default stdout output when the  target starts and when an error is detected  If the display is not wanted on the standard output  channel  a redirection command can be used such as    prog_name  options   gt  gt  gt I nil       ICS Triplex ISaGRAF Inc  C 337    Target User s Guide         Cycle duration  task behaviors  and task priorities        At the end of an ISaGRAF cycle  just before starting a new one  the following algorithm is  performed   If a cycle timing is specified  from the workbench  see user   s guide  Managing  programs  then the CPU is relinquished for the remained time period  specified cycle  time   current application one   If this remained time period is negative an overflow is  generated and the CPU is relinquished for 1 tick to force the scheduling     If no cycle timing is specified  or if the remained time i
200. ber     Furthermore if the application symbol table has been downloaded before  it is also saved on  the target current directory with the file name   ISAx6 ISaGRAF application symbols backup file  where x is the slave number     When the ISaGRAF target is started  these application code and application symbols files are  searched on the current directory and loaded into memory as data modules with same  names     Then  if no symbol table is available on memory  the target starts running the application  code  with no symbols loaded    If no application code is available on memory  then the target is waiting for an application to  be downloaded     In order to start the target with a specific application at power up  without using the debugger  link    e A first way may consists in directly copying these files to the target current directory disk  from the PC host where the workbench is installed  using any file transfer tool  You can  use the workbench tool menu  see user   s guide  Managing programs  to ease these  manipulations        C 336 ICS Triplex ISaGRAF Inc     Target User s Guide       e A second way may consists in storing the application code  and if necessary the  application symbol table  in a non volatile memory  like a PROM or EPROM   from files  from the PC host where the workbench is installed  with your own tools     Then at system power up  if required  for example because of faster access or breakpoint  management   you may load the application code  and
201. bered from 1 to N  are displayed close to symbols that lead to an action  coils  set variables and  function blocks      ly Entering symbols and texts    Double click with the mouse on an element to enter the associated symbol or text   This applies to variables  contacts and coils  comment texts and labels  When used  on acontact or coil  this also allows to change its type  direct  negated         Dialog boxes including variable or block selection lists are normally used for text  input  If the  Manual keyboard input  mode is checked in the  Options  menu   variable symbols and block names are entered directly in a single text edit box   Enter new text and hit  Enter  key to validate it  or hit  Escape  key to exit  modification and close the text editing box  The text edit box used in  manual  keyboard input  mode cannot be closed with the mouse     If the  Auto input  mode is checked in the  Options  menu  the variable symbol  must be entered immediately each time a new contact or coil is inserted  The  symbol must always be entered immediately when a variable or label is inserted     X Selecting function block type    Double click with the mouse on a block is used to change its type  The block type is  selected from the list of available operators  functions and function blocks  This  command also allows changing the number of input points in the case of a  commutative operator   E g  AND  OR  ADD  MUL          Getting free space    When you press the right button of the
202. bject  variable or program  where the error comes from  or the  argument error  decimal value  into brackets  x  which has a different meaning for each error     A welcome message and error values are displayed on the default stdout output when the  target starts and when an error is detected  If the display is not wanted on the standard output  channel  a redirection command can be used such as    isa  t COM1  s 1  gt NUL      System clock    As the ISaGRAF target is designed to run on any system  the time reference used for both  cycle synchronization and timer variables refresh is the standard tick  which is about 55  milliseconds     Thus  it is not possible to have an accuracy on timer variables better than 55 ms  For the  same reason  a specified cycle duration less or equal to 55 ms and different from zero will  generate an cycle duration overflow error  error 62  and no triggered cycles     The advantage of not modifying the system tick is that any of the resident applications  or C  functions and function blocks integrated into the application will never be disturbed by the  ISaGRAF execution     Ask your supplier for a special implementation if your application requires more accuracy       Exit key    While testing an application in non industrial conditions on a desktop PC  the user may wish  to stop ISaGRAF  pressing a complex combination of keys to prevent unexpected stops does  this  This key sequence is     shift   ctrl   alt    Of course  if the industrial app
203. bject cannot be found if it is not actually listed  when using a  selected display   It is recommended  before searching for an object  to activate the   All  selection in the toolbar     Open program   The list on the right contains the occurrences of the selected object in the source  files and I O connection of the open project  The  Edit   Open program  command  enables the user to directly open a program where the object appears  It is also  possible to double click the mouse on an occurrence  in the occurrence list  to open  the corresponding program        ICS Triplex ISaGRAF Inc  A 109    User s Guide       A 15 Using the graphic debugger    ISaGRAF includes a complete graphic and symbolic debugger  The  Debug   command of the program management window runs the debugger to control the  application downloaded in the target PLC  In this mode  the debugger  communicates with the target system via hardware link  The  Simulate  command  of the program management window simultaneously runs the debugger and a  complete target simulator  This enables the user to test his application when the  target s I O system is not yet complete  The debugger window contains the  commands to control the entire application    When the debugger starts  and if the application in the target PLC is the same as  the one on the workbench  it automatically opens the program management  window  in debug mode  Commands of this window may be used to open other  ISaGRAF windows  graphic and text edito
204. bles in this block      virtual address of the variable  range of the address  within Boolean data type   name of the variable     attribute of the variable       virtual address of the parent program      0r  10000  for a global variable  eee string used for false value  EE string used for true value          A 168    ICS Triplex ISaGRAF Inc     User s Guide       The structure of the block used to describe the analog variables of the application   is shown below      ANALOGS   lt nb_ana gt     lt va gt   lt name gt   lt attr gt   lt program gt   lt format gt   lt unit gt           and if variable number exceeds 4095   X  2  lt varno gt     lt name gt   lt attr gt   lt program gt   lt format gt   lt unit gt     Tease ais number of variables in this block  E cae ee virtual address of the variable      fange of the address  within analog data type   bhatt ate name of the variable  E NAE SEEN attribute of the variable       virtual address of the parent program      0r  10000  for a global variable        I  for an integer variable  do aherteh eae tier   F  for a real variable  UNG akn unit string       The structure of the block used to describe the timer variables of the application  is  shown below      TIMERS  lt nb_tmr gt     lt va gt   lt name gt   lt attr gt   lt program gt     Hees  and if variable number exceeds 4095   X  3  lt varno gt     lt name gt   lt attr gt   lt program gt     piua number of variables in this block        virtual address of the variable   E AA r
205. board  the board identification must be entered   A library of pre defined boards is available on the ISaGRAF workbench  One or  more I O device suppliers may have compiled this library  The  Edit   Set  Board Equipment  command is used to set up board identification  This command  can be used to select either a single board  or complex I O equipment from the  ISaGRAF library  It is also possible to double click on a slot to set the corresponding  board or equipment    All the channels of a single board have the same type  Boolean  integer real or  message  and direction  input or output   Real and integer variables are not  distinguished during I O connection  Complex I O equipment represents an I O  device with channels of different types or directions  Complex I O equipment is  represented as a list of single I O boards  It uses only one slot in the rack list     Removing a board    The  Edit   Clear slot  command is used to remove the currently selected board or  I O equipment  If variables are already connected to the corresponding channels   they are automatically disconnected when clearing the slot     Real boards and virtual boards    The  Edit   Real virtual board  command sets the validity of the selected board or  complex I O equipment  The following icons are displayed in the rack list to show  the validity of a board       re Real I O board  FB eee Virtual I O board    In Real Mode  I O variables are directly linked to the corresponding I O devices   Input or out
206. 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     x is a modifier indicates the operation to be delayed  Y is an operator executes the delayed 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 IX35         is interpreted as     result    result AND  1X12 OR IX35      B 8 2 IL operators    The following table summarizes the standard operators of the IL language     Modifiers  BOO variable Resets to FALSE  BOO Boolean AND  Boolean AND  Boolean OR  exclusive OR  variable  constant Addition  variable  constant Subtraction  variable  constant Multiplication  variable  constant Division  variable  constant Test   gt   variable  constant Test   gt    variable  constant Test     variable  constant Test  lt    variable  constant Test  lt   variable  constant Test  lt  gt           B 238 ICS Triplex ISaGRAF Inc     Language Reference       Calls a function block  Jumps to label    Returns from sub program    OCO Executes delayed operation    In the n
207. ce        LD start_cmd  ST RS1 set  LD stop_cmd  OR alarm  ST RS1 reset1  CAL RS1  LD RS1 Q1  ST command  R_TRIG  r_trig  CLK Q   Arguments    CLK BOO any Boolean variable   Q BOO TRUE when CLK rises from FALSE to TRUE   FALSE if all other cases   Description     Detects a rising edge of a Boolean variable       FBD program using  R_TRIG  block       r_trig Ana    cmd ax ofn a  nb_edge  i y         ST Equivalence  We suppose R_TRIG1 is an instance of R_TRIG block     R_TRIG1 cmd    nb_edge    ANA R_TRIG1 Q    nb_edge                                            IL Equivalence        LD cmd   ST R_TRIG1 clk  CAL R_TRIG1   LD R_TRIG1 Q  ANA   ADD nb_edge   ST nb_edge       B 268 ICS Triplex ISaGRAF Inc     Language Reference       F_TRIG  f_trig      CLK Q   Arguments    CLK BOO any Boolean variable   Q BOO TRUE when CLK changes from TRUE to FALSE   FALSE if all other cases   Description     Detects a falling edge of a Boolean variable       FBD program using  F_TRIG  block       f_trig    Ana    cmd ux   ol wl       ST Equivalence  We suppose F_TRIG1 is an instance of F_TRIG block     F_TRIG1 cmd    nb_edge    ANA F_TRIG1 Q    nb_edge                                nb_edge                  IL Equivalence           LD cmd   ST F_TRIG1 clk   CAL F_TRIG1   LD F_TRIG1 Q   ANA   ADD nb_edge   ST nb_edge   SEMA   Arguments   CLAIM BOOLEAN  test and set  command  RELEASE BOOLEAN releases the semaphore  BUSY BOOLEAN state of the semaphore   Description        x  is a Boolean variable in
208. ces  the size of data rows and files are not limited by  ISaGRAF  Resources are stored at the end of the generated code  with a resource  directory  Below is the format  using C notations  of the resource directory format     __RESOURCE   long nbres     number of defined resources     char name 16      resource name     long type     resource data type     long size     exact size of data block     uint32 data   uint32 path offset     points to a string           nb of records            Below are the possible values of the  type  field     e 1   binary file  e 2   text file    e 3   ulong data  path_offset field is not used in this case   e 4   variable list  path_offset field is not used in this case        ICS Triplex ISaGRAF Inc     User s Guide       For text files  end of line characters are translated by the resource  compiler  according to the target system conventions  All pointers are 32 bit offsets  from the address of the corresponding structure  All resource names and  pathnames are NULL terminated strings  Pathnames and data follow the resource  directory        ICS Triplex ISaGRAF Inc  A 107    User s Guide       A 14 Cross References    The ISaGRAF workbench includes a cross reference editor  which provides user  with a total view of the declared variables in the project s programs  and where they  are used  The aim of the cross reference is to list all the variables declared in the  project  and to localise  at the source of each program the parts of source c
209. ch Make options  When  the buffer is full  at each new incoming error  the oldest one is lost        Errors can be pulled either from the debugger or from the running application using the  SYSTEM call  see user   s guide      When the debugger detects an error  a message describing the error is displayed in the error  window  Depending on the context of the application  running or not  the debugger may  display the name of the object  variable or program  where the error comes from  or the  argument error  decimal value  into brackets  x  which has a different meaning for each error     On the target  when an error is detected  error values are displayed on the default stdout  output  Thus the display can be directed using VxWorks routines such as  ioGlobalStdSet    or ioTaskStdSet    In last case  not that either the kernel or the communication tasks can generate errors      Cycle duration  task behaviors  and task priorities        At the end of an ISaGRAF cycle  just before starting a new one  the following algorithm is  performed   If a cycle timing is specified  from the workbench  see user   s guide  Managing  programs  then the CPU is relinquished for the remained time period  specified cycle  time   current application one   If this remained time period is negative an overflow is  generated and the CPU is relinquished for TSK_NBTCKSCHED  variable set at  ISaGRAF startup  tick s  to force the scheduling     If no cycle timing is specified  or if the remained time is l
210. cked and forced to 127    A 15 6 On line modification    The  On line modification  feature enables the user to modify the application while  the process is running  This is sometimes necessary for chemical processes where  any interruption may jeopardise production or safety  This function should be used  very carefully  ISaGRAF may not be able to detect all possible conflicts generated  by user defined operations as a result of these on line changes     Code sequences    As ISaGRAF offers many possibilities for access to variables  programs or I O  boards from the debugger  the  On line modification  function described here  applies only to the code sequences modification  A sequence of code is a complete  set of ST  IL  LD or FBD instructions executed in a row  In a  beginning of cycle  or   end of cycle  program  a code sequence is the entire list of instructions written in  the program  In a SFC program  a code sequence is the Level 2 programming of  one step or transition  The  On line modification  consists of replacing one or more  code sequences  without stopping the PLC execution cycle  As the control of the  SFC tokens is very critical  it is not possible to modify a SFC structure  to add   renumber or remove a step  a transition or a SFC program     Variables    As the variable database is a very critical part of the application  it can be accessed  at any time by other processes  on multitasking PLC   It is also possible to modify  variable values from the debugg
211. clared objects  the combo box in  the editor toolbar is used to select the type of objects  which must be listed in the  window  This allows the user to have access to selected information   Each time the cross references are re calculated  the selection is reset to  All  objects  in order to present the complete list      Re calculate cross references  The  File   Re calculate  command can be used at any time to update the cross  references according to the modifications entered in other ISaGRAF editing  windows      Export cross references  The  Tools   Export  command is used to write the complete listing of the cross   references in an ASCII text file  This file can then be opened with other applications  such as Windows Notepad or word processors    B Dictionary errors  The  Edit   Dictionary errors  command displays in a dialog box the list of errors  detected when the project dictionary was loaded    A 108 ICS Triplex ISaGRAF Inc     User s Guide          Ml    Statistics    The  Tools   Statistics  command displays in a dialog box the number of objects  and variables declared in the project  according to variable types and attributes  A  particular application of this command is to know the number of I O variables  declared in the project  in order to ensure that it can be compiled  if a limited version  of the ISaGRAF Workbench is used     Search in object list    The  Edit   Search  command enables you to directly select an object in the editor  list  The searched o
212. code in the target  A general rough estimation is that minimum EZS  no  extra option selected for source embedding  has one and a half the size of the  executable code  This means that the embedding of EZS will multiply the size of  downloaded code by 2 5    Special limitation may appear on some target system based on segmented  memory  As EZS are stored as resources in generated code  they must be stored in  the same data segment as the application code     A 19 6 About uploaded project    The uploaded project contains all the files and data required for re compiling   Depending on the options selected during its previous compiling  it may also contain  auxiliary files such as project descriptor and program diary files    You have to compile  make  the project before debugging or monitoring it  Warning   as ISaGRAF uses the compiling date stamp to compare applications  you will be  informed when opening the debugger that workbench and target applications have  different version codes     Important note  Libraries are not downloaded with embedded source code  You  have to ensure that the appropriate library functions and function blocks are  installed with your ISaGRAF workbench before re compiling the uploaded  application     A 19 7 Compatibility issues    Upload is supported by ISaGRAF target and workbench version 3 22 or later   Extensions have been made to the communication protocol to support upload   There is no restriction in embedding zipped source code  EZS  in a ta
213. commands are used to find and  replace texts in the diagram  Only complete names can be found  Search acts on  contacts  coils  block names  block parameters and run labels  It cannot be used to  find a string in a rung comment  The Replace command cannot be used to change  the type of a block  The research can be made upward or downward  starting at  position of the current selection  It  loops  when the limits of the diagram are  reached  The following shortcuts are also available for quick research of variable  names        ICS Triplex ISaGRAF Inc  A 59    User s Guide       ALT F2 finds the next element with the same variable name as the element  currently selected  This feature can also be applied to function blocks and rung  labels     ALT F5 finds the next coil with the same variable name as the element currently  selected  This feature is mainly used in debug mode  to quickly find out the rungs   which forces a suspicious variable     A 6 4 Display options    The commands of the  Options  menu are used to customise the drawing of the LD  diagram on the screen  and to hide or display some types of information     Tooltips    Use the  Options   Tooltips  command to hide or display variable comments  appearing as tooltips in the whole diagram  The comment appears as a tooltip when  the cursor moves over the corresponding variable block  This option is available in  off line and on line modes     Rung comments    Use the  Options   Rung comments  command to hide or displa
214. csces  si nck ees genri ii i EE E R R A 94  A 11 6 Setting individual protections             cccceeceeseceseceseeeeceteeseecseeeeeeneeees A 95   A 12 Creating Conversion tables             sccsscssscssscssscssscsscsssssssssesssessseesees A 96  AJI    MainsCommands ceense i A N RARE A 96  A 12 2 Entering points of a table    eee ccceeseeseeesceeeeeeeceseceseceeeeeeeeeeneeses A 96  AJZ   Rulestaind  tS aenean a eestens a A 97   A 13 Using the code generator         seesereesseseeeoeseeeeroeeoesoesereorseseorseeoesoeeessoesee A 98  ATS  M  n commandS eain E baited eam A 98  AcI3 2   Compiler options eessen ene Gain A S A 99  A 13 3 Producing C source code         ssesseesseseesssessesreseeresseeresseseesresrrseeseene A 101  A 13 4 Viewing information           esssesessseserseeseeresersreseeresseeresseseeseesrrsesseene A 101  A 13 5 Defining resources          se seeseesesseeesseeeesresrtsresteressteressesresresersesseene A 102   A L4 Cross Reference   6    ccesesscssscessssceaseneses seasensesosnesdaseessbaecensescoseesnsoseasses A 108   A 15 Using the graphic debugger               cssssssssssssssscsssssssssssssesessesssesees A 110  A 15 1 The debugger window  0        ccecccesecssesseeeseceeeeeeeeeeeseeeseeneeeneeeerenrens A 110  A 15 2 Controlling the application            cccecceseeseeseeeseeeeeeeeseeeeeeeeeerens A 111  A T53 OPOS eee ee a aaar na n E ERE ARTE nS A 113  A1540  Wite  commands senienas ci ediavectiondiieniees A 113  A 15 5 Display the lock state and device 
215. cter must be a letter   e The following ones must be letters  digits or underscore characters   e Naming is case insensitive   The  Save as  command of the  File  menu allows the user to store the currently  edited document under another name     Note for ISaGRAF V3 2 users    Spotlight can read graphics and lists of time diagrams built with the tools of  ISaGRAF V3 0 or V3 2  Such files appear in the  Open  dialog box  with the  description of their origin  Files can be read and freely modified with SpotLight   When opening an ISaGRAF V3 2 graphic  the document is automatically marked as   Locked   Remove the  Lock  option from the  File  menu if you want to make  changes in the graphic    When an ISaGRAF 3 2 graphic or list of time diagram is open  SpotLight always  proposes to save it in native SpotLight format  The  Save As  dialog box is  systematically open when closing such a document        A 128    ICS Triplex ISaGRAF Inc     User s Guide       A 19 Uploading applications    A 19 1    ISaGRAF supports the uploading of the application stored in the target  The upload  procedure communicates with the target to load the embedded zipped source code   EZS  and then restore the loaded project in the workbench environment    The project running on the connected target system can be uploaded if the target  version is V3 22 or later  and if zipped source code have been embedded with the  application  Embedding source code for upload is an optional feature     Uploading a proj
216. cterizes a parameter        D 426    ICS Triplex ISaGRAF Inc     Glossary        C function   Parameter   I O board     Parent  program    Power rail    Program  Project  Pulse    action    Range    Real    Real board    Real time  mode    Reference  number   SFC     Register   IL   Return  value   of a sub   program    Run time  error    Section    Separator    Sequential  Function    User defined or constant parameter of a standard I O board  The programmer  during the I O connection enters a user defined parameter     Program written in any language  which controls  calls  another non SFC  program  called its sub program     Main left and right vertical rails at the extremities of an ladder diagram     Basic programming unit in a project  A program is described with one language   and is placed in the hierarchy architecture of the project     Programming area  which groups all the information  programs  variables   target code     for one ISaGRAF application     SFC action  it is a list of statements executed only once when the  corresponding step is activated     Set of programs that can use an object  Pre defined ISaGRAF ranges are  common  global and local     Class of analog variables  stored in a floating IEEE single precision 32 bit  format     I O board physically connected to an I O device on the target machine     Run time normal execution mode  the programmed cycle timing triggers the  target cycles     Decimal number  from 1 to 65535  which identifies a SFC step
217. ction  P      j nb_edge    0     End_action     nn Cmd    5   aston  P      nb_edge    nb_edge   1   End_action                                      B 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 according 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        B 194 ICS Triplex ISaGRAF Inc     Language Reference                                  Action  P    nb_edge    0   End_action           Cm             kr                Action  N    If  nb_egde  lt  10  then    nb_edge    nb_edge   1     End_if   End_action        B 3 5 4    SFC actions    A SFC action is a child SFC sequence  started or killed according to the change of the step  activity signal  A 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     lt child   lt child     lt child     _prog gt   N       _prog gt      _prog gt   S       _prog gt   R      starts the child sequence when the step becomes active  and  kills the child sequence when the step becomes inactive   same effect  N attribute is optional    starts the child sequence when the step becomes active   Nothing is done when the step becomes inactive   kills the child sequence w
218. curs in a request processing  the slave may issue an error message instead of  sending the expected answer frame     Modbus is a Modicon protocol but not an international standard  there are many different  implementations of  Modbus  compatible protocols  with many possible differences  such as        ICS Triplex ISaGRAF Inc  C 399    Target User s Guide           List of implemented function codes       Address mapping       RTU  binary codes  or ASCII protocol  etc       C 8 2 ISaGRAF implementation      Application Variables access  The ISaGRAF communication link recognizes five Modbus function codes     read N bits    write 1 bit   6   write 1 word _     ISaGRAF application variables can be accessed through their  network address   if  of course   they have been defined in the workbench dictionary  These variables can be        Boolean or Analog variables       inputs  outputs or internal variables       local or global variables        To write a Boolean variable  either function 5  6 or 16 may be used  A TRUE value for writing  is any non zero value     To read a Boolean variable  either function 1 or 3 may be used  With the function 1  values  are retrieved in a bit field  with function 3  they are retrieved in Bytes  a TRUE value  correspond to OxFFFF      To write an analog variable  either function 6 or 16 may be used  The value is a 16 bits integer  ranging from  32768 up to  32767  ISaGRAF target variable are 32 bits      To read an Analog variable  function 3 sh
219. d    YES   EXIT   END_IF   END_FOR     B 7 6 ST extensions    The following functions are extensions of the ST language     TSTART   TSTOP  timer control    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 a SFC program     GKILL kills a SFC program     GFREEZE freezes a SFC program     GRST restarts a frozen SFC program     GSTATUS gets current status of a 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             ICS Triplex ISaGRAF Inc  B 231    Language Reference       The following fields can be used to access the status of a 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  is to declare a global Boolean   variable in the dictionary which will represent the step activity to be tested 
220. d FBD program named  SPlimit        min_value  Input_value    max_value    Example2  Function call             SPlimit             functions used in complex expressions  min  max  right  mlen and left are standard  C   functions          ICS Triplex ISaGRAF Inc  B 223    Language Reference       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_e
221. d a new ISaGRAF kernel dedicated to  the project  which contains only the conversions  functions and function blocks used in the  project       Downloading source files to a native system    The  C  source and definition files created by the ISaGRAF Library Manager may be  downloaded to the target ISaGRAF system  if it supports a native compiling tool  To do that   the standard TERMINAL tool delivered with Windows can be used     When source files are managed on the target system  definition files have to be updated with  a new download operation each time a function interface is modified with the ISaGRAF  Library Manager     Commands lines to download files can be grouped for instance into a batch file and then  started from the workbench tool menu  see user   s guide  Managing programs       Using a cross compiler    Source files can also be managed directly on your PC  if the target is a PC  or a cross  compiler is available  running on the PC and generating code for the target system     In this case  the user can run the ISaGRAF Library Manager to complete and modify the  sources of conversions  functions or function blocks    Commands lines for running the compiler and the linker can be grouped for instance into a  batch file and then started from the workbench tool menu  see user s guide  Managing  programs     When conversions  functions and function blocks are compiled on the PC  the user simply  has to download the new generated ISaGRAF kernel  linked with new compo
222. d escapes from the import command  The names used to  identify the fields in the first imported line may be changed  by pressing the   Keyword  button  This command is described in further sections    The first line of the text must contain the name of the fields  according to  the order used in the following lines  Each object must be described on one line of  text  The  end of line  separator is the standard MS DOS sequence  0d 0a   Fields  can appear in any order  If some fields are missing  they are automatically filled in  the imported object description by default values  If an imported object already  exists in the edited list  the user has to confirm that it will be overwritten  The object  description is then updated with imported fields  If some fields are missing  they are  not updated in the object description                 A 88    ICS Triplex ISaGRAF Inc     User s Guide         Available text formats    Below is the list of available formats for export command  The import  command automatically recognises these formats     e tab separators    Description  Fields are separated by tab characters    Example  Name Attribute Comment  Level internal internal calculated water level  Alrm1 output main alarm output    e comma separators  Description  Fields are separated by commas     Example  Name Attribute  Comment  Level  internal internal calculated water level  Alrm1 output main alarm output    e semicolon separators  Description  Fields are separated by semicolon
223. d 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     B 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        ICS Triplex ISaGRAF Inc  B 205    Language Reference       B 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     B 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 lines  An output of a function block may also be    connected to an input of another block   Function    Inputs T Outputs             An entire function o
224. d 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      B 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 represent a time value  but an analog constant   B 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 c
225. d size  are not relevant and do not need to be specified  ISaGRAF graphic editors always  calculate the font size according to selected zoom ratio     A 6 5 On line help    To get help about function blocks from the Quick LD editor       Select an existing function block on the LD diagram      Press on F1    Help about the function block is displayed  In case of custom  C  or IEC function or  function block  the help displayed is the  technical note  entered in the library editor   text only         ICS Triplex ISaGRAF Inc  A 61    User s Guide       A 7 Using the FBD LD editor    The ISaGRAF FBD LD graphic editor allows the user to enter complete FBD  programs  which may includes parts in LD  It combines graphic and text editing  capabilities  so both diagrams and corresponding inputs and outputs can be  entered  As this editor is more dedicated to FBD language  pure LD diagrams  should rather be entered using the ISaGRAF Quick LD editor     A 7 1 Basics of the FBD LD languages    The FBD language is a graphic representation of many different types of  equations  Rectangular function boxes represent operators  Function inputs are  connected to the left side of the box  Function outputs are connected to the right  side  Diagram inputs and outputs  variables  are connected to the function boxes  with logical links  An output of a function box may be connected to the input of  another box     The LD language enables graphic representation of Boolean expressions  Boolean  AND  O
226. d table as a graphic curve  Using the box commands enters the  points  The user must comply with the number rules for the definition of points   described at the end of this chapter  The box on the left always contains the list of  existing points for the currently edited table  The column on the left shows the       A 96    ICS Triplex ISaGRAF Inc     User s Guide       A 12 3    electrical  external  value of the points  The column on the right shows the physical   internal  values  The user has to select a point on the list in order to modify its  values or to clear  remove  it  The last choice of the list      _       is used to define a  new point  The box on the lower right shows the currently edited table as a graphical  curve  No axes or co ordinates are shown  as this is a proportional representation of  the curve  This representation is useful as a quick check that the curve is properly  defined     Defining a new point   When defining a new point  select the last entry      _       on the list of points  This  is also the default mode when starting to define a new conversion table  The user  has to enter the electrical  external  and the physical  internal  values of each point   Values are stored as simple precision floating point numbers  Remember that at  least two points have to be entered to define a curve  When both values are  entered  pressing the  Store  button adds the point to the table  A maximum of 32  points can be defined for each conversion table   
227. d 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     B 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  Their father activates sub programs  lower level of the hierarchy    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     B 1 2 Cyclic and sequential operations    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  F
228. data  uintl6 parno  void  value          switch parno     case FBLPNO XX       VALUE       break   case FBLPNO YY       VALUE       break        ICS Triplex ISaGRAF Inc  C 387    Target User s Guide               The following function is used for the initialization of the function block and the  declaration of its implementation  It realizes the link with the ISaGRAF kernel   using the name of the function block  This service is completely generated by the  ISaGRAF Library Manager        ABP fbldef_xxx  char  name  IBP  initproc  RBP  readproc        strcpy  name   XXX      initproc    IBP FBINIT_xxx    readproc    RBP FBREAD_xxx   return   ABP FBACT_ xxx             end of file       The  TASYODEF H  include file from the ISaGRAF kernel is required for system dependent  definitions  It also contains the definition of data types representing far pointers to the  implemented services       Links between projects and  C  implementation    The logical link between the implementation of a  C  function block and its use in the  programs of an ISaGRAF project is accomplished by using the name of the function  A   declaration  service is added to the  C  source code of the function block  This service is  called only once when the application starts  and indicates to the ISaGRAF kernel the  C   function block name  which corresponds to the implemented services  This is the standard  format of such a declaration service     ABP fbldef_xxx  char  name  IBP  initproc  RBP  readproc   
229. data types        To select a variable  click on its name in the list  Its name and comment  are then displayed on the top of the list  Then press the  OK  button to confirm its  selection  It is also possible to directly enter a variable name in the edit control  without using the list     A 9 6 The output window    The following commands are available in the Tools menu of all language editors   They are used to display information in a small text list at the bottom of the editing  window  and use it for program browsing        Show compiler output  Displays in the output window the error  messages from the last compiling of the  edited program       Find in     Finds occurrences of a text in the whole  edited program  and list them in the output  window  For SFC and FC languages  this  command searches in all level 2 programs        A 78    ICS Triplex ISaGRAF Inc     User s Guide          Hide output window  Closes the output list window    When error messages or occurrences are displayed in the output window  double  click on a line to directly move selection to the corresponding location  For SFC and  FC languages  this command opens corresponding level 2 programming window        ICS Triplex ISaGRAF Inc  A 79    User s Guide       A 10 Using the dictionary editor    The ISaGRAF dictionary is an editing tool for the declaration of the internal  variables  I O variables  function block instances  and  defined words  of the  application  The dictionary groups together the 
230. de       Start                   TRUE           Wait  no special action     RunCmd                    QX1_1   NOT RunCmd            Running the ISaGRAF workbench    To run the ISaGRAF Workbench  run the  Projects  command  in the  ISaGRAF   group  from the Start menu of Windows     Creating the project    Create the project  called  RunStop   using the  New  command of the  File  menu  or the New button  In the open dialog box    Enter project name   RunStop    Select I O configuration   Sim_Boo    Press the  OK  button    The project has now been created     Opening the project  The programs of the project are defined by opening the ISaGRAF program    management window  Use the  Open  command of the Project management  window  or double click the mouse on the name of the project or use the Edit button     Creating the programs    The Program Management window is now open and empty  no programs defined    The first program is created using the  New  command of the  File  menu or the   New  button  In the open dialog box    Enter the name of the program   Command     Select the  Quick LD  language    Select the  Beginning of cycle  section    Press the  OK  button to create the program     The same operation must be repeated for the second program   Use the  New  command of the  File  menu  or the  New  button  In the open dialog  box    Enter the name of the program   RunStop     Select the  SFC  language    Select the  Sequential  section    Press the  OK  button to create t
231. declared variables and function  block instances of the application  and the words defined as constant strings   Variables  function blocks and defined words must be declared in the dictionary  before using them in source code  Variables and defined words can be used with  any of the automation languages  SFC  FBD  LD  ST and IL  Function blocks used  in FBD language do not have to be declared  because the ISaGRAF FBD and Quick  LD editors automatically declare the instances of the used blocks             Variables  The variables are sorted according to their range and type  Only variables of the  same type and the same range can be entered on the same input grid  These are  basic ranges for variables      GLOBAL        can be used by any program of the current project     LOCAL           can be used by only one program  These are basic types of variables    E  BOOLEAN     true false binary values  E  ANALOG        real or integer values     TIMER            time values  ea MESSAGE    character strings  A name  a comment  an attribute  a network address and other specific fields  identify a variable  Here are the basic variable attributes   memory variable  variable linked to an input device  variable linked to an output device  read only internal variable  with initial value   Note  Timers are always internal variables  Input and Output variables always  have the GLOBAL range   E Defined words  A defined word is an alias that can be used in any language to replace a text str
232. dge    nb_edge   1  End_if     B 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 as      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  Syntax   lt edge gt     REDGE    lt boo_expression gt   lt memo_variable gt           B 224 ICS Triplex ISaGRAF Inc     Language Reference       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 a 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
233. 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    ia   gt  1   amp   subprog_name   LD  use a coil symbol with the name of the return parameter     subprog_name       B 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        B 176 ICS Triplex ISaGRAF Inc     Language Reference         cake  CEST  programming    Function Block       FB1 is a declared instance implementation    of the SAMPLE function block                FB1  high  value  low  1 0      high alarm    FB1 QH   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 
234. diting any program  the user should check that the  update diary  option  of the editing tools is set  to ease future program maintenance   e When one or more sequences have been modified  without modifying SFC  structures and program hierarchy   the code of the new application must be  generated on the workbench before downloading   e Using the debugger  from within the old project  the user must connect the target  PLC and perform any operation which can make the application update faster or  more safety   e Using the debugger  from inside the new project  the user must connect the target  PLC  If the application name is changed  the target database cannot be accessed   The user must run the  File   Update  command   e The modified application is downloaded by selecting the  update later  option   This may slightly slow down the PLC during transfer   e When download is complete  the user can run the  File   Realise update   command to enable the switch at the most adequate moment  The switch will have  1 or 2 cycle duration   e When the switch has been correctly performed  the programs of the modified  running application are displayed  If not  the existing running application remains as  is     A 15 7 DDE exchanges    The ISaGRAF debugger includes a DDE  Dynamic Data Exchange  server  An  advice loop can be installed between the ISaGRAF debugger and other  applications  in order to dynamically display the current value of variables in non   ISaGRAF applications    Only  ad
235. done is call to LEFT       LD  12345678   LEFT 4  ST sub_string    intermediate result     LD  12345678   RIGHT 4  ADD sub_string  ST complete_string  MID  mid  IN  NbC  Pos Q  Arguments   IN MSG any non empty string  NbC INT number of characters to be extracted  cannot be greater than the length of the IN string  Pos INT position of the sub string  the sub string first character will be the one pointed to by  Pos   first valid position is 1   Q MSG middle part of the string  its length   NbC   empty string if parameters are not valid  Description     Extracts a part of a message string  The number of characters to be extracted and the  position of the first character are given        FBD program using  MID  block                                  mid     abcdefgh        2 nbc  4 Pos ol sub_string                                           ST Equivalence      sub_string    MID   abcdefgh   2  4       sub_string is  de           IL Equivalence      LD    abcdefgh   MID 2 4       B 306 ICS Triplex ISaGRAF Inc     Language Reference       ST sub_string  MLEN  mlen  IN NbC   Arguments    IN MSG any string message   NbC INT number of characters in the IN string  Description     Calculates the length of a message string        FBD program using  MLEN  block                                                                                        mien  complete_string m No nbchar   lt   3 m2 q RETURN  left  Mec   prefix                                     ST Equivalence       nbchar    M
236. e       Ty oe Analog outputs  An analog output channel is a numerical output field   The output value can be displayed as either a decimal or hexadecimal number  The  user on an output channel can perform no action     W4 Message inputs  A message input channel is a simple text field  where  the value of the corresponding input is entered  Clicking on the box displays the  caret  A new value for the channel can then be entered  It is not necessary to use  the ENTER key after input        WZ Message outputs  A message output channel is a text output field No  action can be performed by the user on an output channel     A 21 3 Library components    The ISaGRAF simulator fully supports the standard conversions  functions and  function blocks  delivered by ICS Triplex ISaGRAF  Below is the list of supported  objects       Conversion functions     bcd  scale      Functions     abs  acos  ArCreate  ArRead  ArWrite  ascii  asin  atan  char  cos  delete  expt  find   insert  left  limit  log  max  mid  min  mlen  mod  mux4  mux8  odd  rand  replace   right  rol  ror  sel  shl  shr  sin  sqrt  tan  trunc      Function blocks     average  blink  cmp  ctd  ctu  ctud  derivate  f_trig  hyster  integral  lim_alrm  r_trig   rs  sema  sr  stackint  tof  ton  tp    User defined conversions   C  functions and function blocks are commonly not  integrated with the ISaGRAF Simulator  Typically  such objects are designed to use  software and hardware resources of the target system  Such resources
237. e  Zoom  button in the toolbar to  increase size of cells and give space to display level 2 instructions  Here is the  chart   1  E  2 H   e  3 H  BR  2   lt  To enter the programming of transition  2   select it using the keyboard    arrows and press  Enter  key  The Level 2 programming window is open  Enter level  2 programming for transition 2    RunCmd   ATAB Press  Control   Tab  keys to move focus back to the SFC chart  move  selection on step 3  and press  Enter  key to edit its level 2 text    QX1_1    And do the same to enter text of transition 3    Not  RunCmd    AF4 Press  Control   F4  keys to close the level 2 window   The SFC program is now complete  Exit from the editor with Menu  File  and  Command  Exit   and save the modifications entered clicking on  YES      E Building the application code    Use the  Make  menu and command  Make Application  from the Program  Management window to build the application code or the button in the Toolbar     When the code generation is complete  a dialog box appears  which asks you to exit  the code generation now or to continue working with it  Press the button  Exit         ICS Triplex ISaGRAF Inc  A 21    User s Guide       Simulation    Use the  Debug  menu and command  Simulate  from the Program Management  window to run the ISaGRAF kernel simulator or the button in the Toolbar     When the Simulator window appears  the application can be tested  In this example   both inputs 1 and 2  green buttons  must be pressed to r
238. e  selected project  From this window  all the contents  programs  application  parameters     of the project  can be managed  It is also possible to double click on  a project name  to edit it     The history of modifications     The ISaGRAF system stores any modification relative to a component of a project  in a history file  Each modification is identified in the history by a title  a date and a  time  The history file contains the last 500 modifications  There is one history file for  each project  The history of modifications for the project is the complement of the   diary  files attached to the programs of the project  The  Project   History   command allows the user to view or print the history of modifications for the  selected project  The user can select one or more items in the main list  and press  the following buttons    ORe closes this window   sends the contents of the list to the printer       Help displays help about this dialog box    erase  Selected   removes  deletes  the selected lines from the list   erase  All             clears the complete list   Fines E yeetsa finds a pattern in the list    The input box above the  Find  button is used to enter a search pattern  This  function is case insensitive  When the search reaches the bottom of the list  it  continues from the top of the list to the starting position     Printing a complete document    The  Project   Print  command allows the user to build and print a complete  document about the selected p
239. e boards declared virtual  in the I O connection editor  See Part A   will  be simulated   Possible values are 0 or 1  0 means no simulation  and 1 means simulation on     Default value  The default value is 0 or the one in the ISaGRAF INI file     Example   WISAKER  x 1 will simulate virtual boards     User interface  The menu item will be checked or unchecked reflecting the state of the option   Simulated boards appear in a graphic panel        ICS Triplex ISaGRAF Inc  C 353    Target User s Guide         Priority of the ISaGRAF NT target   p Option    As the target is running under NT  it is very useful to specify a priority level  It is  for instance   possible to have a time critical ISaGRAF application running within a target with the higher  priority and one or more targets running in background with lower priorities     Possible values are 0  1  2 or 3  0 is the highest priority  and 3 is the lowest priority     Examples   WISAKER  p 0    WISAKER  p 1    User interface  This window is displayed from the  Options Priority  command of the main  window of ISaGRAF NT target       Setup priority    Bs asss    ity             High priority  C Normal priority  C Idle priority    The highest priority is the real time and the lowest is the idle priority   0  Real time priority   1  High priority   2  Normal priority   3  Idle priority               Examples     wisaker  t COM1 Starts the ISaGRAF target with default slave number  1  and with  COM1 as the communication port    w
240. e dictionary  Use the  Options   Contacts and coils    Update aliases  command to update all aliases in edited diagram  You can also set  the  Always update on Open  option from  Options   Contacts and coils  to ask  ISaGRAF to automatically update all used aliases each time a Quick LD program is  open  Warning  Setting this option may significantly increase the time spent to open  a program       Drawing options    The  Options   Layout  command opens a dialog box where are grouped all the  parameters and options concerning the editor workspace and the drawing of the  graphic LD diagram    Use the check boxes in the  Workspace  group to display or hide editor tool bar   status bar and LD toolbar  Options of the  Document  group allow you to show or  hide points of the editing grid  and to enable disable the use of colors for the  drawing     E Options of the  Zoom  group allow you to select a main zoom ratio  You  can also use the  zoom  button in the editor toolbar to swap between default zoom  ratios     E   You can also customise the X Y aspect ratio of cells in the editing grid   This last option can be used to reduce the default cell width  if you commonly use  short names for variables  You can also use the  width  button in the editor toolbar  to change the X Y aspect ratio without entering the Layout dialog box     Use the  Options   Font  command to select the name of the character font to be  used in all ISaGRAF graphic documents  When selecting font  font style an
241. e equivalent code expressed in ST     AVERAGE  rung state  Signal        100     OutSignal    AVERAGE  XOUT   eno    rung state       continue rung with eno  state       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    valuet    value2     END_IF   valued A  eno    rung state      continue rung with eno  state       H HH Limitations of Quick LD editor    The ISaGRAF Quick LD editor does not allow to continue a rung  insert other  contacts or coils  on the right of a coil  If several outputs have to be made on the  same rung  the corresponding coils must be drawn in parallel     A 6 2 Entering an LD diagram    All the editing commands of the Quick LD editor may be achieved either with the  keyboard or with the mouse     ie The editing grid   The LD diagram is entered in a logical matrix  Each cell of the matrix may contain  up to one LD symbol  Use the arrows of the keyboard  or click on a cell to move the  current selection  The selected cell is marked in reverse  For some cut copy paste  operations  it is possible to select several cells  To do that with the mouse  just drag  the mouse cursor in the diagram  With keyboard  use arrow keys with SHIFT key  pressed       Starting a new rung    To add a new rung to a diagram  move the selection after the last existing rung and  insert a contact  hit F2 or press the corresponding button in the LD 
242. e from an uncompleted but intelligent image    of the process to start   kill or freeze SFC programs and to initialize variables to put the application in the adequate  state  But ISaGRAF can provide no automatic start up procedure     Example        ICS Triplex ISaGRAF Inc  C 409    Target User s Guide               init backup       power fail   false power fail   true    restore only status    status   xx    restore all           status   yy    restore specified data    save all       C 410 ICS Triplex ISaGRAF Inc     Target User s Guide       C 10 Appendix  Error list and description    Error list     Type  system  application  system  system  system   6   time out waiting answer from kernel   system  system   8   cannot allocate memory for retained variables   application   9   application stopped i application  application  application  application  application  system  system  system  system  system  system  system  system  system  system  system  application  application  application  application  application  application  application  application  application  application  application  application  application  application  application  application  application       ICS Triplex ISaGRAF Inc  C 411    Target User s Guide       application  program  program  program  program  program  application  program  application   66 __  function block not implemented   application  application   68 _   real divided by zero program   69 ___   invalid operate parameters applicatio
243. e such variables  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     B 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 a 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 programs  A FC father    program is blocked  waits  during execution of a FC sub program  It is not possible that  simultaneous operations are done in father FC program and one of its FC sub programs     B 1 4 Functions and sub programs    Its parent program drives a sub program or a function executi
244. e value is NOT EQUAL TO another one  on analog  or messages           FBD example with  Is Not Equal to  blocks      lt  gt                                                           10 Nt   25 m2 a aresult   lt  gt       ab    Int      ab    n2 a mresult                               ST Equivalence      aresult     10  lt  gt  25      aresult is TRUE     mresult      ab   lt  gt   ab       mresult is FALSE          IL equivalence        LD 10  NE 25  ST aresult  LD    ab     NE    ab     ST mresult  BOO  Boo  IN Q  Arguments   IN ANY any non Boolean value  Q BOO TRUE for non zero numerical value  FALSE for zero numerical value  TRUE for  TRUE  message  FALSE for  FALSE  message  Description     Convert any variable to a Boolean one       ICS Triplex ISaGRAF Inc  B 259    Language Reference          FBD example with  Convert to Boolean  blocks                                              Boo   10 m al ares  Boo   t 0s I a tres  Boo      false    IN a mres                               ST Equivalence      ares    BOO  10    tres    BOO  t 0s    mres    BOO     false            IL equivalence        LD 10  BOO  ST ares  LD t 0s  BOO  ST tres  LD    false     BOO  ST mres  ANA  Arguments    IN   Q  Description     ANY  INT    any non integer analog value       ares is TRUE             tres is FALSE        mres is FALSE       0 if IN is FALSE   1 if IN is TRUE  number of milliseconds for a timer    integer part for real analog    decimal number represented by a string    Convert a
245. e window to use the full screen size     F2 F3 Press F2 and F3 key   a     a E E O       lt  Associate variables to the LD symbols  move the cursor using the  keyboard arrows  Place the cursor on each symbol and press Enter key  The  variable section dialog box is opened   For the first contact  type in the variable selection box  IX0_1 then Enter   For the second contact  type in the variable selection box  IX0_2 then       Enter   For the coil  type in the variable selection box  RunCmd then Enter     The program is now complete  Here is the result   x01 DO 2 RunCmd    m   E O l    Exit from the editor  and save the modifications entered  Menu  File    Command   Exit   Click on  YES  to save modifications           A 20    ICS Triplex ISaGRAF Inc     User s Guide       Editing the SFC program    To start editing the  RunStop  SFC program  double click on its name in the  Program Management window or use the Edit button     ME The SFC Editor window is now open  To increase the working area  resize  the window to use the full screen size     4 The initial step already exists and is selected  Press the  Down  keyboard  arrow to select the empty cell after the initial step  0 1    F4 F3 Press F4 then F3 to insert a step and a transition    F4 F3 Press F4 then F3 to insert one more step and transition                                                        F5 Press F5 to insert a jump to a step and select GS2 as the destination of  the jump   Q The chart is now complete  Press th
246. east one variable has the  retained  attribute  ISaGRAF looks for the retained   variables        If the same application has run before  ISaGRAF recognizes the stored values and assigns  them to every    retained    variables        If the previous application was a different one  or if no application has run before  ISaGRAF  recognizes that the    retained    values are not valid  and resets all the    retained    variables to  null     The specification of the memory area used to store the different types of variables is specified  in the workbench  in the Make menu  Application run time option   retained variables   The specified string must have the following format        boo_add  boo_size   ana_add  ana_size   tmr_add  tmr_size   msg_add   msg_size    with    boo_add  Hexadecimal address used to store Boolean variables  Need to be always  different from zero    boo_size  Hexadecimal size  in bytes  available at this address  One byte per Boolean  variable to store is required     ana_add  Hexadecimal address used to store analog variables  Need to be always different  from zero    ana_size  Hexadecimal size  in bytes  available at this address  Minimum of four bytes  always required plus four bytes per analog variable to store     tmr_add  Hexadecimal address used to store timer variables  Need to be always different  from zero    tmr_size  Hexadecimal size  in bytes  available at this address  Five bytes per timer variable  to store is required     msg_add  Hexadecima
247. ect    The  Upload  dialog box is run from the  Files  command of the ISaGRAF Project  Manager  Upload does not refer to an existing project on the Workbench  The  currently selected project in project management list has no relationship with upload  mechanism  To upload the application running on the target you must    1  ensure that the target is properly connected   2  set up the communication parameters according to the connection link   3  press the  Run  button    Uploading embedded zipped source  EZS  and decompressing them may take few  seconds  Messages in the dialog box will inform you when upload is complete  or in  case of error    The name used to create the ISaGRAF project is the one read in the target through  communication  If this name is already used for an existing project in the  workbench  you will be prompt to either overwrite it or select an unused name  You  cannot cancel the registration of loaded sources as a project when upload is  complete  The uploaded project is now ready and can be opened     Possible errors    The following errors may occur when uploading a project  You are informed of the  error in the  Upload  dialog box      Communication cannot be established with the target     Connected target is an ISaGRAF system before version 3 22     There is no application running in the target     There is no EZS embedded in the target    A 19 2 Communication settings    Pressing the  Set up  button enables the user to define the parameters of the l
248. ect Module     Kernel library   Kernel library   Kernel library     User library   User library   User library     tastOmai  tatsOcom    isaker  isaoem    isausp  isafbl  isacnv    isasys    user defined functions  user defined function blocks  user defined conversion functions     refer to your  C  compiler manual     tastOmai  tast0com    isaker  isatst  isaoem    isausp  isafbl  isacnv    user defined functions  user defined function blocks  user defined conversion functions          C 396    ICS Triplex ISaGRAF Inc     Target User s Guide       Kernel library  isasys       System libraries   refer to your  C  compiler manual     The programmer may have to follow the exact order of object modules and libraries shown in  the preceding figures  Object modules and libraries have standard extensions    lib     obj     I     r      according to the target system       Required compiling and linking options   Convenient options can be selected during compiling and linking  They depend on the type of  operations processed in conversions  functions and function blocks  Some operations require  other system libraries  math  graphics     during link     All the  C  source files of the ISaGRAF Kernel have been compiled with the LARGE memory  model  The programmer must use the same model for compiling conversions  functions and  function blocks     A special constant has to be defined for compiling  C  library components  It indicates the  type of target system and processors  so that
249. ected 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       vi  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     input1 output    O             D  output2    Saai          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       ICS Triplex ISaGRAF Inc  B 211    Language Reference          Example of multiple LEFT and RIGHT connection                      input output    input2 output2  O  outputs                ST Equivalence       output1    input1 OR input2   output2    input1 OR input2   output3    input1 OR input2     B 6 3 Basic LD contacts and coils    There are several symbols available for input contacts     Direct contact     Inverted contact     Contacts with edge detection    Th
250. ected parameter  The  Arrange  command  automatically rearranges  sorts  the parameters  so that the return parameters are put at the  end of the list  Pressing the  OK  button stores the definition of the function block interface  and closes the dialog box  Pressing the  Cancel  button closes the dialog box  without  changing the definition of the function block       Function block  C  interface    The interface of a function block depends on the definition of its parameters  Calling  parameters are passed through a structure  This structure is defined in the  GRFBOnnn H   file  where  nnn  is the logical number of the function block in the ISaGRAF library  Return  logical numbers  which are also defined in the  GRFBOnnn h  file  represents parameters   This is an example of the  C  interface  for the  LIM_ALRM  function block  alarm on limits         function block interface   name  sample          standard ISaGRAF data types       typedef long T BOO   typedef long T_ANA   typedef float T REAL   typedef long T_TMR   typedef char  T MSG        C 380 ICS Triplex ISaGRAF Inc     Target User s Guide          structure of calling parameters       typedef struct         CALL    T BOO _parl      CALL    T_BOO _par2     str_arg        access to fields of str_arg structure        define PARI  arg  gt _parl    define PAR2   arg  gt _par2        return parameter logical numbers        define FBLPNO QI 0   define FBLPNO Q2 1       end of file       The relationship between ISaGRAF typ
251. elected symbol   initiate the rung   FI orai ensada insert a contact before the selected symbol   insert a contact in parallel with the selected symbol     add a coil in parallel with the selected one  not for tests    Ge woni aias insert a block after the selected symbol   Piaam insert a block before the selected symbol     insert a block in parallel with the selected symbol   AEA EA TAE add a jump symbol in parallel with the selected coil  not for tests              A 52 ICS Triplex ISaGRAF Inc     User s Guide       A jump leads to a rung name  The name of a rung can be entered by hitting ENTER  when selection is on the rung head  The ISaGRAF editor keeps the memory of the  rung labels you already entered  whether it has been specified for a rung name or a  jump operation  The  Jump Label     dialog box gives you the possibility either to  enter a new label  or to select an existing one  If you enter a new name  it will  automatically be added to the list  The  Remove  button is used to remove the  selected name from the list  It does not remove the label on the rung you selected in  the diagram  To do this  just press OK when the edit box is empty     You can also press buttons in the LD toolbar instead of hitting function keys     Hit ENTER when the selection is on a contact or a block I O parameter to select a  variable or enter a constant value  Hit ENTER when the selection is on a function  block to select the type of the function block  You can also double click on a
252. em    This appears each time the connection is closed when the debugger is closed  the system is  working OK  Otherwise it means that an Ethernet communication error is detected  Check  connection and system configuration on both target and master sides    A second field is given  it can be    1  error while sending or receiving   2  error while creating the socket   3  error while binding or listening the socket   4  error while accepting a new client    25  communication synchro error system    Bad synchronization between the communication task on the target and the master  Check  connection and system configuration  communication parameters  on both target and master  sides     28  cannot allocate memory for application system    No memory available  Check the hardware  according to the size of the application     29  cannot allocate memory for application update system    No memory available  Check the hardware  according to the size of the application     30  unknown OEM key code application    The application is using a board which manufacturer code is not recognized by the target   Check the I O connection in the workbench and use  VIRTUAL  attribute to locate the incorrect  board  Your workbench library may not correspond to your target version        ICS Triplex ISaGRAF Inc  C 415    Target User s Guide       31  cannot init boolean input board application    32  cannot init analog input board application    no  5  BS p  35 3  35 36     D 2o  gS a  Tg T d  Go a gt   
253. en using the workbench debugger  make sure the workbench slave parameter  see user   s  guide  Managing programs  matches with an existing target       Example    This example shows how to start an ISaGRAF single task target with slave number 1 and with   tyCo 1 device for the serial link   The current host directory is the one where the target is installed     load isassr o module  Id  lt  RELS isassr o    load isa o module  Id  lt  CMDS isa o    serial communication configuration  ISAMOD    tyCo 1   19200     System clock rate  CLKRATE   sysClkRateGet       slave registration  isa_register_slave  1     File storage unit  could be skipped because default set   TSK_FUNIT        End of cycle control  could be skipped because default set        ICS Triplex ISaGRAF Inc  C 341    Target User s Guide       TSK_NBTCKSCHED   0    ISaGRAF target spawning  sp  isa_main  1    tyCo 1      C 5 4 Running the ISaGRAF multitasks  isakerse o and isakeret o    To improve the response time of the ISaGRAF target kernel and of the communication link   the target is split into two tasks separating communication job  communication task  from  application execution  kernel task     Such architecture is more flexible  It allows the user to run more than one communication task  linked with the same kernel task or to run up to 4 kernels with the same communication task   This makes easy some integration such as a process visualization link and the workbench  debugger link on the same application or a 
254. ent for further  information about how to use this box  To associate a function  function block or  operator to a block  hit ENTER when the selection is on the inside its rectangle  To  associate a variable symbol to input or output block parameter the selection must  be on the corresponding location  outside the rectangle of the block     Dialog boxes including variable or block selection lists are normally used for text  input  If the  Manual keyboard input  mode is checked in the  Options  menu   variable symbols and block names are entered directly in a single text edit box   Enter new text and hit  Enter  key to validate it  or hit  Escape  key to exit  modification and close the text editing box  The text edit box used in  manual  keyboard input  mode cannot be closed with the mouse     Changing the type of contacts and coils    The  Edit   Change coil contact type  changes the type of the selected contact or  coil  A contact may be direct  negated  with positive or negative edge detection  A       A 58    ICS Triplex ISaGRAF Inc     User s Guide       coil may be direct  negated  set or reset  with positive or negative edge detection   Hitting the SPACE bar has the same effect       Inserting a rung in a diagram    The  Edit   Insert rung  command insert a new rung in the diagram  before the  selected one  The rung is initiated with one contact and one coil     A 6 3 Working on an existing diagram    The commands of the  Edit  menu are used to change or complete an exi
255. ents   IN REAL  EXP REAL  Q REAL    Description     pow    real analog number to be raised   power  exponent     IN EXP    1 0 if IN is not 0 0 and EXP is 0 0   0 0 if IN is 0 0 and EXP is negative   0 0 if both IN and EXP are 0 0   0 0 if IN is negative and Y does not correspond to an  integer    Gives the real result of the operation   base   XPONENt     hase    being the first argument and     exponent    the second one  The exponent is a real value        FBD program using  POW  block                                                          xval m  power Exe q result     ST Equivalence      result    POW  xval  power       IL Equivalence      LD xval  POW power  ST result  SQRT  sqrt  IN Q  Arguments   IN REAL must be greater than or equal to zero   B 286 ICS Triplex ISaGRAF Inc     Language Reference       Q REAL square root of the input value    Description   Calculates the square root of a real value        FBD program using  SQRT  block                                                                   abs  xval in q xpos  sqrt  m ol xroot     ST Equivalence      xpos    ABS  xval    xroot    SQRT  xpos       IL Equivalence      LD xval  ABS  ST xpos  SQRT  ST xrout  TRUNC  trunc  IN Q  Arguments   IN REAL any REAL analog value  Q REAL if IN gt 0  biggest integer less or equal to the input  if IN lt O  least integer greater or equal to the input  Description     Truncates a real value to have just the integer part       FBD program using  TRUNC  block       trunc  2 67
256. ents are normally scanned during  execution    Modified              Elements marked as  modified  are painted in pink  For  modification tracking  the  modified  style is used to highlight  elements that have been added or changed after the original  release of the diagram   Modified  style elements are normally  scanned during execution    Deleted                Elements marked as  deleted  are painted in grey  with dashed  lines  Such elements are not taken into account for the execution  of the diagram  This style is used to keep a track of elements  removed after the original release when version control is  required    Custom                In addition to predefined style  ISaGRAF LD FBD editor allows  you to select any color to be applied to a part of the diagram   Such elements are considered as having a  Custom  style  The  use of  Custom  style has no effect on the diagram execution at  run time     Use the commands of  Style  sub menu in  Edit  menu to manually apply a style to  selected elements       Modification tracking    The use of styles and the availability of the  Deleted  style allow automatic  modification tracking in an existing diagram  Use the  Mark modifications   command in  Edit Style  menu to enable or disable modification tracking    When the  Mark modifications  option is set  all elements changed in or added to  the diagram are automatically set with  Modified  style  When an element is deleted   using  Delete  or  Cut  commands  they are not v
257. er   s guide   Note that here  the backup and the programmer at  application level manages the restoration     First of all you need to define the memory backup location for a specified type of variable or  all types of variables    lt new_address gt     SYSTEM SYS_INITxxx  lt address gt       where        lt address gt  is the memory backup address location  16  value for Hexadecimal format   It  must be an even address  otherwise the operation fails       SYS_INITxxx can be     SYS_INITBOO to define memory backup location for all Boolean variables     SYS_INITANA to define memory backup location for all analog variables     SYS_INITTMR to define memory backup location for all timer variables    SYS_INITALL to define memory backup location for all Boolean  analog and timer  variables        lt new_address gt  gets the next free address  that is to say  lt address gt    backed up variables  size  in bytes  according to SYS_INITxxx  This enable to check the required memory  backup size  If the operation has failed  lt new_address gt  gets zero     Then you may ask for a backup  This procedure can be called at any time in the application   the backup will be done at the end of the current cycle and once only  If the hardware delivers  a Boolean input  or a C function to inform the user when the power fail arrives  and allows at  least one ISaGRAF cycle delay before crash down  the backup might only be made when the  power fail is detected      lt error gt    SYSTEM SYS_SAVxxx 0
258. er  Therefore  ISaGRAF does not allow the user  to add  rename or remove a variable on line  Anyway  it is possible to modify the  way a variable is used in the application  It is also possible to reserve  unused   internal or I O variables in the first version of the application  so that future  modifications can make use of them    They are different styles of variables in ISaGRAF target database  Limitations act  on all of them       Declared variables       A 116    ICS Triplex ISaGRAF Inc     User s Guide       They are the ones declared using the ISaGRAF dictionary  They cannot be changed  and cannot be renamed for on line change  It is recommended that some extra  variables are declared and initialised in the application even if not used today  Such  extra variables will enable future modifications to work on without changing the  application data checksum       Instances of function blocks    Each instance of  C  or IEC written function block corresponds to data stored in  ISaGRAF target real time database  When function block instances are added or  removed  on line change is no more possible  So it is better to work in ST with FB  instances declared in dictionary  rather than adding blocks  that will correspond to  new automatically declared instances  in Quick LD or FBD diagrams  Also  any  modification in the definition of available function blocks in the ISaGRAF library will  lead to an impossible on line change       Steps    Each SFC step corresponds to a piece
259. er chooses a format for the exported text  The available  formats are described in further sections  Pressing the  OK  button runs the export  function  Pressing the  Cancel  button closes the dialog box and escapes from the  export command    All the fields of the selected objects are stored in the exported text  in the  standard declaration order  The first line of the exported text contains the name of  the fields  Each object is described on one line of text  The  end of line  separator is  the standard MS DOS sequence  0d 0a   The names used to identify the fields in  the first exported line may be changed  by pressing the  Keyword  button  This  command is described in further sections     Importing data    The following dialog box appears when the  Import text  command is run   It enables the user to control the import mechanism     Import variables xi    py  Cancel    Browse    Keywords      If the  Clipboard  option is checked  the imported information is taken  from the Windows clipboard  in pure ASCII text format  If the  File  option is  checked  the exported text is read in an ASCII file  The complete pathname of this  file has to be entered  The  Browse  command may be used to find an existing  pathname    The import function automatically recognises the format  separators  used  in the imported text  The available formats are described in further sections   Pressing the  OK  button runs the import function  Pressing the  Cancel  button  closes the dialog box an
260. ere 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    Left connection a AN Right 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 output1       HEIN CH                   ST Equivalence      output1    input1 AND input2        B 212 ICS Triplex ISaGRAF Inc     Language Reference         Inverted contact    An inverted contact enables a Boolean operation between a connection line state and the  Boolean negation of a Boolean variable     boo_ variable    a vA   Right 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        Left connection       Example using INVERTED contacts       input1 input2 output1  LON    HAEA O       ST Equivalence      output1    NOT  input1  AND NOT  input2           Contact with rising edge detection    This contact  positive  enables a Boolean operation between a connection 
261. es and  C  types is shown below  The ISaGRAF types  are defined as  C  types in the definition file of the function     T BOO long  32 bits   T_ANA  T_REAL float  32 bits   single precision     ong   2  lt  lt  S Oe    T_TMR long  T_MSG char    32 bits   char pointer        Each field of the  str_arg  structure corresponds to one calling parameter of the function  block  The parameters appear in the structure in the same order than the one established for  the function block definition  An uppercase identifier is defined to directly have access to one  parameter of the structure passed to the  C  implementation of the function block activation  service  Names of the identifiers are the ones entered during the definition of the function  block with the ISaGRAF Library Manager     The order used for return parameters numbering is the one established for the function block  definition  The logical number of the first return parameter is always 0     Defined identifiers should be used instead of numerical value to represent the return  parameters in the  C  source programming  This ensures that the source file can be easily re   compiled after a modification of the interface definition     The  C  definition file is updated each time the interface of the function block is changed by  using the ISaGRAF Library Manager  This ensures a complete coherence between the  implementation of the function block and its use in the programs of the ISaGRAF applications        ICS Triplex ISaGR
262. ess than 1 tick or equal to zero   then the CPU is relinquished for TSK_NBTCKSCHED tick s  to force the scheduling     The target timing accuracy correspond to the VxWorks system tick one     a specified cycle timing is commonly used to trig cycles or to yield the CPU to other tasks  running on the VxWorks system         The communication task is in sleep status while there are no incoming data through the  communication link  When needed  this task gets information on the running application  through a question answer protocol with the kernel task  The communication task asks for  a question to the kernel  At the end of the cycle  to have a synchronous application  image   the kernel gives the answer to the communication task     The ISaGRAF tasks do no modify the priority they have been given  The user is free to adjust  these priorities according to ISaGRAF task behaviors described above and its whole  application requirements        ICS Triplex ISaGRAF Inc  C 349    Target User s Guide       C 6 Getting started with ISaGRAF NT target    C 6 1 Running ISaGRAF    In the NT implementation  the target runs as a single program  WISAKER EXE  which can be  launched several times  This allows to have as many as ISaGRAF NT target you want as  each instance has a separate slave number    The target program does not prevent the running of interrupt driven routines     The WISAKER software is designed to run under Windows NT 3 51 or later     C 6 2 General information on options    O
263. est1  LD selector  SUB 1    decrease selector  is now 0 or 1     BOO    conversion to Boolean          B 240 ICS Triplex ISaGRAF Inc     Language Reference       JMPC test2    if selector   0 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 CN  Operand  none     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 0 or 1 or 2     BOO    conversion to Boolean     JMPC test1    if selector   0 then     LD true  ST bo0    bo0    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   0 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           operator  Operation executes a delayed operation  The delayed operation was notified by        Allowed modifiers
264. et User s Guide       C 1 Introduction    The ISaGRAF target is a real time software running an ISaGRAF application on your industrial  computer system or board according to the following well known scheme         Inputs Scan    Execution  of Begin Programs         ISaGRAF    Target Cycle Execution    of Sequential Programs    Execution  of End Programs    Outputs Update    The target cycle consists in scanning the physical inputs of the process to drive  processing    application data according to the ISaGRAF workbench 1 application programs and then  performing physical outputs update         First part of this section explains how getting started with a specific system target   Respectively DOS  OS 9  VxWorks and NT target  For each one you will find first how to run  the ISaGRAF target  Afterwards you will get information on specific features such as  target  start up at power up  error management  general behavior            Second part deals with users C functions  function blocks and conversion functions  implementation method to enhance the ISaGRAF target        Third part provides information on Modbus and the ISaGRAF implementation  It describes  the frames format of the different function codes        Fourth part gives some tools for managing power fail and target restart        1 This manual assumes the user is familiar with the ISaGRAF workbench       C 324 ICS Triplex ISaGRAF Inc     Target User s Guide       C 2 Installation    The installation requires about 1
265. ex       Modbus  D 426   MODBUS  A 86  C 399  Modification tracking  A 70  Modified style  A 71   Modifier  IL   B 237  B 238  D 426  Modify variable  A 83   Modulo  B 297   Move board  A 91   Move FBD  A 65   Move FC  A 50   Move program  A 30   Move project  A 23   Move SFC  A 41   Move SpotLight  A 126   MSG  B 262   Multi applications  C 336  C 347  C 355  Multiplexer with 4 entries  B 297  Multiplexer with 8 entries  B 298  Multiplication  B 251   MUX4  B 297   MUX8  B 298       N    N qualifier  A 43   NE operator  IL   B 259  NEG  B 246   Negated link  A 64  A 66  Negation  B 246   Negation  FBD   B 208  Negative coil  B 217  Negative contact  B 213  Network address  A 82  A 83  A 86  D   426   New function  A 29   New function block  A 29  New library element  A 144  New program  A 29   New project  A 23   New rung  A 56   New variable  A 83   Non stored  A 43  Non stored action  B 194  D 426  Normal style  A 71   NOT  A 64  A 66          NOT MASK  B 254    A 14    O    ODD  B 299   OEM key code  A 148  D 426   OEM parameter  A 148   OEM parameter  I O board   D 426   OF  B 228   Off delay timing  B 274   On Line  A 34  A 110   On line modification  A 112  A 116   Open program  A 29  A 109   Open project  A 24   Operand  IL   B 237  B 238  D 426   OPERATE I O channel  B 265   Operation  IL   B 237  B 238  D 426   Optimiser  A 100   OR  A 62  B 248   OR_MASK  B 253   OS 9 shell  C 338   Other program  A 76   Output  A 91  A 109  A 133  A 148  B   178  D 426   Output wi
266. existing in  the chart  The scrolling position is automatically adapted so that the element is  visible  The element  when reached  is selected     g Renumbering elements    The  Edit   Renumber  command is used to renumber elements of the Flow Chart   Any FC element put in the chart is identified with a unique reference number  The  editor each time new elements are inserted allocates reference numbers  The   Renumber  allows you to re adjust element numbering according to their location  in the chart  Growing numbering is performed from top to bottom and from left to  right    A 5 4 Entering level 2 programs    To enter the level 2 program  the user must double click on the action or test  symbol  The level 2 programming is displayed on the right of the FC window  The  separation line between FC chart and level 2 programming can be freely moved   You can open one or two level 2 areas at the same time  The following commands  are available from keyboard  mouse or the  Edit  menu     Keyboard Mouse  Edit  menu   Open in last default window Enter Double Click Edit level 2  Open in separate window Ctrl Enter Ctrl   Double click Edit Level 2 in a  separate window    When two level 2 windows are visible  the separation between them can be freely  moved  The button on the right of the level 2 title bar is used to close a level 2  window        ICS Triplex ISaGRAF Inc  A 51    User s Guide       The default language for Level 2 programming is ST  Structured Text   The  programming 
267. ext format is   YYYY MM DD   HH MM SS                                               IL Equivalence  First done is call to day_time 1           LD  DAY_TIME  ST hour_str     intermediate result     LD 0  DAY_TIME  ADD ae  ADD hour_str  ST Display  ARCREATE  arcreate  Arguments   ID INT identifier of the array  must be in set  0  15    Size INT number of elements in the array  ok INT execution status    1   if array has been successfully created  2   invalid array identifier or array already created  3   invalid size  4   not enough memory  Description     Creation of an array of integers        B 310 ICS Triplex ISaGRAF Inc     Language Reference       Warning  There are at most 16 arrays in an application  Arrays contain integer analog  values  As dynamic memory allocation is performed  this function may cause a system error if  the array size is too close to the size of the available memory        FBD program creating an array of integers                                                       arcreate  ident lo  lt  gt   16 size ok      IN1  N2 al array_error  a                   ST Equivalence      array_error     ARCREATE  ident  16   lt  gt  1          IL Equivalence        LD ident  ARCREATE 16  NE 1  ST array_error  ARREAD  arread  ID  Pos Q  Arguments   ID INT identifier of the array  must be in set  0  15    Pos INT position of the element in the array  must be in set  0    size 1   value INT value of the element read  0 if the arguments are not valid  Description     
268. ext 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    result    analog variable      LD tmr_var1    result    timer variable      LDN boo_var2    result    NOT   Boolean variable         ST operator  Operation stores the current result in a variable    the current result is not modified by this operation  Allowed modifiers N  Operand internal or output variable    Example        EXAMPLES OF ST OPERATIONS       STboo  LD false  ST boo_var1    boo_var1    FALSE     STN boo_var2    boo_var2    TRUE     STana  LD 123  ST ana_var1    ana_var1    123     STtmr  LD t 12s  ST tmr_var4   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       ICS Triplex ISa
269. fined        A 160    ICS Triplex ISaGRAF Inc     User s Guide       A 26 Advanced programming techniques    A 26 1    A 26 2    This chapter contains more information about the ISaGRAF Workbench and target  system  The user is advised to be familiar with the ISaGRAF tools and methods   before reading this section     More about ISaGRAF tools    When using the ISaGRAF editing tools  the user can press the right mouse button  to open a popup menu  which contains the main editing commands  The menu is  opened at the current position of the cursor  This is very useful to reduce mouse  operations during cut and paste commands    The ISaGRAF tools support multiple execution  Although same tool cannot be  opened twice to edit the same document  it is possible to open different windows  with the same tool and edit different objects as parallel operations    Other commands are available to find information about graphic buttons in toolbars   Double click an empty area of a toolbar to display the contents of the toolbar as a  popup menu  Stay with the mouse cursor on a graphic button displays the  corresponding text command     Locked I Os and virtual I Os    Defining an I O board as virtual disconnects the processing of the physical I O  channels  When a board is defined as virtual  the ISaGRAF kernel operations are  not changed  The only difference is that input sensors are not read and output  devices are not updated  In this mode  it is possible to use the ISaGRAF debugger  to mod
270. font  and  Title font  commands of the  Options  menu are used to  define the fonts of characters used when printing text  and titles for any item of the  document  The size and style of characters may also be selected for text and titles   The selection of a font is made with the standard dialog box defined by Windows   Any text  literal programs  names within diagrams     will be printed with the selected  size  style and font of characters  Only titles will be printed with the font selected for  titles    If the fonts of characters are not defined  the standard font of the printer will be used  for any text  with the following styles    e  Normal  style for texts and names within diagrams   e  Bold  style for titles       ICS Triplex ISaGRAF Inc  A 157    User s Guide       A 25 Password protection    The ISaGRAF Workbench includes a full data protection system  which enables the  user to protect with password projects and library elements  A library element can  be an I O configuration  an I O board or complex equipment  a function or function  block written in IEC languages  a  C  function  function block or conversion function   A password protection database is dedicated to one project or library element  and  cannot be shared between several ones     Protection levels    Within one project or library element  the user can define up to 16 access levels   corresponding to different passwords  Access levels are sorted in a hierarchy  system  They are numbered from 0 to 1
271. for all ISaGRAF variables that  must be controlled from the SCADA  The  Tools   Modbus SCADA addressing  map  is a powerful to quickly create a Modbus virtual map with variables of the  application    The mapping tools shows two lists  The upper one is a segment  4096 locations  of  the Modbus map  showing mapped variables  the ones having a network address    The lower list shows unmapped variables  without network address defined   The   0  address cannot be used to map a variable    Use the  Map  and  Remove  commands of the  Edit  menu to move a variable  from one list to another  and thus build the map  Same actions can be performed by  double clicking on a variable symbol in a list  to send it to the other list  At any       A 86    ICS Triplex ISaGRAF Inc     User s Guide       moment  you can use the  Segment  drop down list to view another segment of the  map    The commands of the  Options  menu can be used at any moment to display  addresses either in decimal or in hexadecimal    The  Edit   Find  commands is used to search for a declared variable  whether it is  already mapped or not     A 10 6 Exchanging information with other applications    The ISaGRAF dictionary editing tool offers import export functions in order  to exchange information with other applications  such as word processors   spreadsheets  data base managers    These commands are grouped in the  Edit   menu  The  Export text  command builds a pure ASCII text description of the fields  describing a
272. function or a function  block written in IEC language described in the library to the  Functions  or   Function blocks  section of the open project  Local variables and defined words  attached to the imported function are copied with it  When a function has been  correctly imported from the library  it can be placed in another section or another  location in the hierarchy tree  using the  File   Rename Move  command  In order  to avoid naming clashes  the imported function or function block must be renamed  when imported in the project area  Don t forget to rename also the return parameter  in the case of a function        ICS Triplex ISaGRAF Inc  A 31    User s Guide       Exporting function or function block to library    The  Tools   Export to library  command is used to send a program of the   Functions  or  Function blocks  section  in the open project  to the appropriate  library  Local variables and defined words  attached to the exported function or  function block  are copied with it  The exported function or block will have to be re   compiled  verified  from the ISaGRAF Library Manager  to ensure that it can be  used in a library environment  Functions and function blocks of the library cannot  use global variables     A 3 3 Running the code generation tools    ia    The commands of the  Make  menu are used to run the code generator  and to  enter options and additional data used when producing the application code  Refer  to the chapter  Using the code generator  
273. g starts at index  0   and channel numbering starts at  index  1      Warning  be very careful while changing numbering conventions as it has effect on  symbols used for directly represented variables and may lead to compiling errors if  directly represented I O variables are used in existing programs        A 94    ICS Triplex ISaGRAF Inc     User s Guide       A 11 6 Setting individual protections    The ISaGRAF workbench provides a complete data protection system based on  hierarchised passwords  I O connection can be globally protected by a password   Additionally  ISaGRAF enables you to set individual protection to any I O channel   This assumes that      Passwords are already defined in the password definition system  use the  Project  I Set password  command of the Project Management window  so that protection  levels are available for individual protection      You use protection levels with higher priority for individual protection compared to  global I O protection     When an I O channel has individual protection  a small icon is draw close to its  name in the I O connection window          wa ISaGRAF   PROTECT   1 0 connection ojx   File Edit Tools Options Help   aleBAM  tl Kia         bflash    flash animation selection    a  Q  blead    lead animation selection      z      l  brandom     random animation selection     x  Ol bstart start stop command             Ki    Use the  Set protection  and  Remove protection  commands of the  Edit  menu  to set or remove a
274. grams  in the entire  project  This function is very useful to detect an access to a variable or any global  resource  or to list all the occurrences of a global variable in the source code       Entering the project descriptor    The  Project descriptor  command is used to edit the project text descriptor  This  document fully identifies the project from the others on the project list  The project  descriptor can also be used to record any remarks during the project lifetime  The  project descriptor is the one displayed in the Project Manager window       Printing a complete document    The  Print project document  command allows the user to build and print a  complete document about the selected project  This document can group any  component  program  variable  and parameters     of the selected project  To build a  specific  non complete  document  the user only has to define its table of contents       History of modifications    This command opens a dialog box where is displayed the history of modifications  for the project  Refer to the chapter  Managing projects  in this document for more  explanations about this command        ICS Triplex ISaGRAF Inc  A 33    User s Guide       A 3 5 Adding commands to the Tools menu    ISaGRAF provides the way to insert other commands in the  Tools  menu  User  defined commands to be added are described in  ISAWIN COM ISA MNU  text file   You can add up to 10 commands  Comments may be inserted on any line   beginning with     charac
275. grams  then ISaGRAF 3 5   then Licensing     c  On the Transfer License tab  select the drive holding the transfer disk   then click Transfer Licenses to Disk     The license is removed from the computer and copied to the license transfer  disk    d  Remove the license transfer disk from the computer s drive    Install the license on the new computer     a  In the new computer s drive  insert the license transfer disk holding the  license     b  From the Start menu of Windows  choose Programs  then ISaGRAF 3 5   then Licensing     c  On the Transfer Licensing tab  select the drive holding the transfer disk   then click Complete Transfer     The license is transferred to the new computer and ISaGRAF 3 5 is activated     Removing Licensing    You can remove authorized licenses from a computer     To remove authorized licenses    1     From the Start menu of Windows  choose Programs  then ISaGRAF 3 5  then  License Manager     On the Remove Licensing tab  from the list of licensed components  select the  components for which you want to remove licensing     Click     gt  to move the components to the list of Selected Components     A Setup Code  as well as a User Code 1 and User Code 2 appear in their respective  fields     4     Send the licensing information   a  Click Send     A pre addressed email appears holding the setup code and both user codes  and into which you need to include your contact information and order number     b  Include all required information then send t
276. guage Reference       The code of  FB1  will be duplicated  according to the variables wired on its inputs and  outputs  Below is the ST equivalence of the code generated when compiling the parent    program      code of the first call     B2    B1 and not PREV1   PREVI     Bi      code of the second call     B4    B3 and not PREV2   PREV2    B37    As shown in this example  the compiler must allocate internal variables for FB local variables  for each call  PREV1 and PREV2 in this example   Due to the automatic re naming of internal  variables  there is no limitation in nesting  In Line  function blocks     When using  In Line  FBs instead of standard FBs  the size of the application code  TIC code   increases  Also   In Line  FBs provide better execution time as no function calling and  parameter passing instruction is required     The nesting of  In Line  FBs also supports the instanciation of edge detection contacts and  coils  P and N   the use of  C  and standard function blocks  and local jumps and labels     Limitations      In Line  FBs are available for Quick LD only  This means that       In Line  FBs must be written in Quick LD     All programs calling  In Line  FBs must be written in Quick LD     Pieces of Quick LD in SFCs and Flow Charts can call  In Line  FBs    The following restrictions apply when calling FBs       In Line  FBs can call other  In Line  FBs      normal  FBs cannot call  In Line  FBs      In Line  FBs cannot call  normal  FBs     Recursive call
277. h     Warning  Conversion functions are synchronous operations  activated at run time by the  ISaGRAF I O manager  during the input or output phases of the application cycle  Time spent  for the execution of a conversion function is included in the ISaGRAF application cycle  timing  The user has to ensure than no  wait operation  is programmed in a conversion  function  so that the ISaGRAF cycle processing is not unnecessarily extended       Adding a function to the  SaGRAF library    The ISaGRAF Library Manager must be used to add a new conversion function to the  ISaGRAF library  on the Workbench side  The  New  command of the  Files  menu is used   when the conversion function library is selected  No parameter has to be defined on the  Workbench  because conversion functions use a standard predefined interface     When a new conversion function has been created  its technical note must be written  The  ISaGRAF Library Manager automatically generates the frame of the  C  source code for the  new conversion function       gt  Using a conversion in an ISaGRAF project    Defined conversion functions can be used to filter values of any input or output analog  variable of the selected project  To attach a conversion function to a variable  the variables  declaration editor is run  an input or output analog variable selected and then its parameters  edited  The  conversion  field of the analog declaration dialog box is used to setup the  conversion function attached to an analog 
278. haracters  including spaces        B 180 ICS Triplex ISaGRAF Inc     Language Reference       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     Sequence Meaning ASCII Example   hexa     16 24  I paid   5 for this           apostrophe 16 27  Enter   Y   for YES   16 0a  next  L line        R___  carriage return   16 0d     lo RHe       P__   newpage   16 0c   _ lastline  P first line      hh_               hh  is the hexadecimal value of the ASCII code for the expressed character   B 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 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    B 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   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_
279. hardware     To enable a process control system to restart correctly after a power failure  3 problems must  be solved     ISaGRAF  Kernel    H  Data base Restore           Making a data backup      Detecting that a power failure has occurred when starting      Restoring the backed up data    The second problem cannot have a standard software solution  but the system supplier may  provide the necessary tools to have access to the hardware status from the ISaGRAF  application or from a C program     Furthermore  the important thing is to decide what data have to be stored and retrieved  Let s  define 2 kinds of data       Application variables   Such as process variables like number of items processed  date of the power failure  values  of application parameters  etc       Such as program variables like counters  timers  intermediate values and flags         Program state   Such as reference of active steps  status of each C program  etc         These 2 cases are studied in the following chapters to see how ISaGRAF can answer        ICS Triplex ISaGRAF Inc  C 405    Target User s Guide       C 9 2 Application variables backup      Retained variables    The workbench variable editor offers the possibility to select the    retain    attribute for each  internal variable  non IO variable      At the end of each target cycle  values of retained variables are copied to the specified  memory location  This memory location is generally a battery backed up RAM     At start up  if at l
280. hart  The whole selected area is marked in grey  The commands of the  Edit   menu can then used     aaa cut  copy   delete   paste commands    The following commands are available from the  Edit  menu when the  arrow   button is selected in the editor toolbar     G  teniaeve varh Move selected rectangle from the screen to the SFC clipboard  COPY      etceeeeeeeeeee Copy selected rectangle from the screen to the SFC clipboard  Delete                  Clear  delete  selected rectangle   Pasteis Insert contents SFC clipboard at the current position    The  Edit   Paste  copies SFC clipboard to the screen  Copy   Paste commands  work on both SFC chart and step transition level 2 programming  It is also possible  to copy a chart in a program and paste it in another SFC program  Elements are  inserted before the currently selected position     Move elements    When SFC elements are selected in the SFC chart  you can move them to another  location of the chart by dragging the selection with the mouse  While you drag the  selection  the initial location of selected elements is hatched        ICS Triplex ISaGRAF Inc  A 41    User s Guide       The destination area for moved elements must be empty  No insertion is possible  while moving SFC symbols     Renumbering steps and transitions    Each step or transition is identified by a logical number in the SFC chart  The  Edit    Renumber  command allows the user to automatically set up numerically  sequential reference numbers for any of 
281. he  C  language  or the  name of an existing function of the  C  ISaGRAF libraries     Other statements can be added to the declaration function to realize any specific initialization  operation relative to this conversion  The ISaGRAF system ensures the user that this function  is called only one time when the application starts     The declaration function is called for any integrated conversion function  even if it is not used  in the ISaGRAF application  The ISaGRAF kernel fails in a fatal error if a conversion used in  the application is not integrated to the kernel     Before linking new functions with the kernel  the user must write another  C  source file   named  GRCNOLIB C   and insert it  with the retained conversion functions  in the list of files  for the linker  The  GRCNOLIB C  only contains an array of declaration functions  This array is  read during application initializations  to make a dynamic link with the conversion functions  written in  C   This is an example of such a file        File  GRCNOLIB c    Example with conversions of standard library        include  lt tasyOdef h gt     required for types definition     extern UFP cnvdef scale  char  name      decl  function for SCALE conv     extern UFP cnvdef_bed  char  name      decl  function for BCD conv          ICS Triplex ISaGRAF Inc  C 369    Target User s Guide       UFP_LIST CNVDEF           array of declaration functions for        integrated conversion functions     cnvdef_scale   cnvdef_bed    
282. he FBD language        SR   Arguments   SET1 BOO if TRUE  sets Q1 to TRUE  dominant   RESET BOO if TRUE  resets Q1 to FALSE  Q1 BOO Boolean memory state   Description     Set dominant bistable  See True table below   Set1 Reset Q1 result Q1       0 0 0 0  0 0 1 1  0 1 0 0  0 1 1 0  1 0 0 1  1 0 1 1  1 1 0 1  1 1 1 1       FBD program using  SR  block          B 266 ICS Triplex ISaGRAF Inc     Language Reference                                                           amp   auto_mode SR  start_cmd ser  stop_cmd RESET a command                                        ST Equivalence  We suppose SR1 is an instance of SR block     SR1  auto_mode  amp  start_cmd   stop_cmd    command    SR1 Q1        IL Equivalence           LD auto_mode   AND start_cmd   ST SR1 set1   LD stop_cmd   ST SR1 reset   CAL SR1   LD SR1 Q1   ST command   RS   Arguments   SET BOO if TRUE  sets Q1 to TRUE  RESET1 BOO if TRUE  resets Q1 to FALSE  dominant   Q1 BOO Boolean memory state   Description     Reset dominant bistable  See True table below   Set Reset  Q1 result Q1                                              0 0 0 0  0 0 1 1  0 1 0 0  0 1 1 0  1 0 0 1  1 0 1 1  1 1 0 0  1 1 1 0     FBD program using  RS  block     RS  start_cmd ser   gt  1 RESET a command  stop_cmd    alarm                            ST Equivalence  We suppose RS1 is an instance of RS block          ICS Triplex ISaGRAF Inc  B 267    Language Reference       RS1 start_cmd   stop_cmd OR alarm     command    RS1 Q1        IL Equivalen
283. he caret  Below is the format of a  Pulse action block     Action  P    ST statement     End Action     Pulse actions are instructions  which are executed only once when the step  becomes active  Refer to the ISaGRAF language reference for further details on  SFC programming     N Inserting a Non stored action block in step    When programming the level 2 of a step  press this button to insert the template of  a Non stored action block at the current position of the caret  Below is the format of  a Non stored action block     Action  N    ST statement     End Action        ICS Triplex ISaGRAF Inc  A 43    User s Guide       Non stored actions are instructions which are executed on every PLC cycle when  the step is active  Refer to the ISaGRAF language reference for further details on  SFC programming     New P0 and P1 action qualifiers    ISaGRAF supports new PO and P1 action qualifiers  When programming the level 2  of a step  press these buttons to insert the template of a PO or P1 action block at  the current position of the caret  Below is the format of such blocks     Action  P0   Action  P1    ST statement  ST statement     End Action  End Action     P1 actions are instructions which are executed only once when the step becomes  active  same as Pulse   PO actions are instructions  which are executed only once  when the step becomes inactive  Refer to the ISaGRAF language reference for  further details on SFC programming     Boolean actions    Other text semantics are av
284. he compiling date   time stamp      gt  If the  Update diary  mode is selected in the  Options  menu of program  editors  the following dialog box is opened each time the program is saved on disk     Update diary for program main x     Text note to be added to the diary file  with current date time stamp            If OK button is pressed  the entered text note is then stored at the end of  the diary file with current date   time stamp  This feature is very useful for  maintenance of complete programs  as it provides useful help about the program  life cycle     A 9 5 Selecting a variable from dictionary    E When editing a text program  ST or IL  the  Edit   Insert variable  allows  the selection of a declared variable name to be inserted at the current position of  the caret  When editing LD or FBD programs  variable selection is required for the  description of contacts  coils  block I O parameters or FBD variable boxes  In both  cases  the following dialog box is open to select a declared variable        ICS Triplex ISaGRAF Inc  A 77    User s Guide       Select variable xi    ao    random animation selection    flash animation selection  lead animation selection  random animation selection  start stop command       The  Scope  selection box is used to select between global and local  variables  The selection box on the right allows the selection of the data type  Small  icons beside the type selection box are buttons that can be used as shortcuts to  select most current 
285. he email     A User Code  as well as a Registration Key 1 and Registration Key 2 will be  returned via e mail        ICS Triplex ISaGRAF Inc  A 17    User s Guide       5  Upon reception  enter the user code and both registration keys into their  respective fields  then click Proceed     A confirmation code appears in the Confirmation Code field     6  Reply to the email including the Confirmation Code as well as your name   address  and telephone number     A 1 3 Using on line information    On line information is installed with the ISaGRAF workbench  for the following  topics    e ISaGRAF languages reference   e Complete user s guide  for any ISaGRAF tool    e Technical note for elements in the libraries    From any ISaGRAF window  select the choices of the  Help  menu to display online  information     A 1 4 A sample application    This chapter explains  step by step  all the basic operations required to make   design  generate and test a short but complete multi language application     Below are the complete specifications of this application  mixing LD and SFC  representations     Boolean variables     IX0_1  IX0_2  input variables for process command  RunCmd  internal  run stop  command  QX1_1  output variable  status of the    Program Command  Cyclic begin section   LD language    Evaluates the internal  run stop  command  x01 DO 2 RunCmd          Program RunStop  Sequential section   SFC language  Controls the process       A 18 ICS Triplex ISaGRAF Inc     User s Gui
286. he program     The programs are now created  They appear in the Program Management window        ICS Triplex ISaGRAF Inc  A 19    User s Guide       Declaring the variables    Before entering the programs  the internal variable to be used in the programming  must be declared  This is done using the command  Dictionary  of the  File  menu  or the Dictionary button  I O variables are automatically declared when the project is  created     oz  The dictionary window is now opened  With the menu  File   the Sub   menu  Other   the Sub menu  Global variables  and then the command  Booleans    select the  Global  Boolean dictionary  Buttons Global objects and Boolean can be  used for the same effect     The  New  command of the  Edit  menu is used to create new Boolean  variables  You can also use the Insert objects button  In the open dialog box  enter  the description of the internal variable     name  RunCmd  comment  Run Stop command  internal  attribute  Select the  Internal  attribute    Press the  Store  button  the variable is created    Press the  Cancel  button to exit the dialog box   Finally  exit the dictionary editor and save the modifications entered  Menu  File     Command  Exit   Click on  YES  to save modifications     Editing the Quick LD program  To start editing the  Command  LD program  double click on its name in the  Program Management window or use the Edit button     Ha The ISaGRAF Quick LD Editor window is now open  To increase the  working area  resize th
287. he target code  Closing the simulator window implies that  the debugger window  and any ISaGRAF window opened during the debug session   is also closed     I O simulation    I O boards appear in the simulator window  titled by their name and slot number   Any of the ISaGRAF standard types of I Os  Boolean  analog or message  are  handled  The channels of the input boards are displayed with special buttons and  fields  The channels of the output boards are displayed with graphic status lights  and data fields     ep Boolean inputs  a square green button represents A Boolean input  The  number of the channel is displayed with the I O button  The input value is TRUE  when the button is pressed  Clicking on the button changes the corresponding I O  value  Use the right button of the mouse to set the input only when the button is  pressed     IL oe Boolean outputs  a small circle represents A Boolean output  The  number of the channel is displayed with the I O  The output value is TRUE when the  graphic symbol is highlighted     ah Analog inputs  An analog input channel is a simple numerical field   where the value of the corresponding input can be entered  Clicking on the box  displays the caret  A new value for the channel can then be entered  It is not  necessary to use the ENTER key after input  Analog inputs can be entered in either  decimal or hexadecimal base  Use up down buttons to increase or decrease the  current value        ICS Triplex ISaGRAF Inc  A 133    User s Guid
288. hen  Ethernet  is selected as a communication port  the  Set up  button is used  to enter the  Internet Address  and  Internet port  number  for TCP IP  communication    These fields use the standard formats defined by the Socket interface  The  Workbench uses the WINSOCK DLL Version 1 1 library for TCP IP  communications  This file must be correctly installed on the hard disk   1100  is the  default port number used if not specified when running the ISaGRAF target        A 36    ICS Triplex ISaGRAF Inc     User s Guide       A 4 Using the SFC editor    The SFC language is used to describe operations of a sequential process  It uses a  simple graphic representation for the different steps of a process  and conditions  that enable the change of active steps  A SFC program is entered by using the  ISaGRAF graphic SFC editor  SFC is the core of the IEC 1131 3 standard  The  other languages usually describe the actions within the steps and the logical  conditions for the transitions  The ISaGRAF graphic SFC editor allows the user to  enter complete SFC programs  It combines graphic and text editing capabilities   thus allowing the entry of both the SFC chart  and the corresponding actions and  conditions     A 4 1 SFC language main topics    The SFC language is used to represent sequential processes  It divides the process  cycle into a number of well defined successive steps  self contained situations    separated by transitions  Refer to the ISaGRAF Languages Reference Manual f
289. hen the step becomes active  Nothing  is done when the step becomes inactive    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 a SFC action has  exactly the same effect as the GSTART and GKILL statements  programmed in a ST pulse    action     Below is an example of a SFC action  The main SFC program is named Father  It has two  SFC children  called SeqMIx and SeqPump  The SFC programming of the father SFC  program is        SFC program using SFC actions          ICS Triplex ISaGRAF Inc     B 195    Language Reference                               Start                        2  4SeqMIx  N   101     SeqPump  S                        Full                    102    SeqPump  R                  N        B 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 a 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   result2    Fbinst out2   END_ACTION     or    ACTION  N     Fbinst in1  in2    result1    Fbinst out1   result2    Fbinst ou
290. i ceteris Comment  Network address   ssnisiriisiiiniieniiriiais Address  Attributes  internal  input  output               Attribute  Boolean  False  string        0   cee False        Boolean  True  string    Format       Analog format  real or integer    Analog unit string                ceeceeeseereeeeeeeeee Unit   Analog conversion name      Conversion  Message maximum length s s s MaxLength  Function block library type          ee Library  Defined word equivalence    Equivalence  Internal attribute 0    eee Internal  Input attribute        Output attribute     eres  Constant attribute    eee  Real analog format            Integer analog format       ICS Triplex ISaGRAF Inc     User s Guide       A 11 Using I O connection editor    YT    The aim of the I O connection operation is to establish a logical link between the I O  variables of the application and the physical channels of the boards existing on the  target machine  To make this link the user has to identify and set up all the boards  of the target machine  and place I O variables on corresponding I O channels    The list on the left shows the rack of the target machine  with board slots  A slot  may be free  or used by one I O board or complex equipment  An order number  identifies each slot  The rack may contain up to 255 boards  The list on the right  shows the board s parameters and the variables connected on the selected board   A board may have up to 128 I O channels  The total number of single I O boards   
291. i x8misa11  Then isa exe will find and execute    myproj    application     All these commands can be grouped for instance into a batch file and then started from the  workbench tool menu  see user   s guide  Managing programs        Error management and output messages    The ISaGRAF target software integrates an error detection management  You will find the  warning error list and their description in appendix     Error detection is processed as follows        An error is composed of an error and argument number sent to the ISaGRAF error routine       If the error detection flag is set in the workbench Make options  the error is processed  If  not  the information is lost and the error management ends     When processed        Error number  decimal value  and argument  hexadecimal value  are displayed on the  default stdout output       Error number and argument are pushed into a ring FIFO error buffer in order to be  retrieved at a later time  The error buffer size is set in the workbench Make options  When  the buffer is full  at each new incoming error  the oldest one is lost        Errors can be pulled either from the debugger or from the running application using the  SYSTEM call  see user s guide      When the debugger detects an error  a message describing the error is displayed in the error  window  Depending on the context of the application  running or not  the debugger may       C 328 ICS Triplex ISaGRAF Inc     Target User s Guide       display the name of the o
292. iagram  No other object may be  connected on the right of a jump or label symbol  The following notations are used     PPLAB iaae jump to a label  label name is  LAB    LAB  seia 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        Example of an FBD program using labels and jumps          ICS Triplex ISaGRAF Inc  B 207    Language Reference                                                                                                                       amp   manual  b1     gt  yNOMODIF   gt  1  input1  input2 result  NOMODIF    gt  1  result  valid cmd10     IL Equivalence      Id manual  and b1  jmpc NOMODIF  Id input  or input2  st result  NOMODIF  Id result  or valid  st cmd10    B 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  A small circle represents the negation  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           amp           input1  input2 re output                                                    ST equivalence      output1    input  AND NOT  input2      B 5 5 Calling function or function blocks from the FBD    The FBD language enables the calling of sub prog
293. iaig single precision floating value    The  access  box is used to define how the parameter can be accessed by the end  user  If the  User defined  option is set  the parameter is shown as an input field  during the I O board connection  The OEM parameter default value is used as  default for the parameter editing  If the  Hidden  option is set  the parameter is a  constant and does not appear in the I O board connection box  The OEM parameter  default value defines the value of the constant parameter  The  Read only  option  indicates that the parameter is visible for the user  but cannot be modified  Its  default value is used as a constant value     A 22 5 Functions and blocks written in IEC languages    ISaGRAF handles a library of functions and function blocks written in IEC  languages  The available languages to describe such a function or block are FBD   Function Block Diagram   LD  Ladder Diagram   ST  Structured Text  or IL   Instruction list   Note that LD and FBD languages can be mixed in the same  diagram  SFC language  Sequential Function Chart  cannot be used to describe a  function or a block in library  The language attached to a library element is selected  when the function is created  and cannot be changed later       Compiling  Functions and blocks defined in the library must be compiled  verified  before they  can be used within an ISaGRAF project  Nothing else has to be changed on the  Library side concerning functions and blocks  Elements of the librar
294. ies   Below is the list of the files that can be copied with this command   common eqv      common defined words   oem bat               user defined MS DOS command file    These files are saved one by one on the archive disk  in their original form  The  corresponding archive files are never compressed        A 152    ICS Triplex ISaGRAF Inc     User s Guide       A 23 2    A 23 3    A 23 4    Options    The path used for ISaGRAF archives is displayed at the bottom of the dialog box   Press the  Browse  button to browse the disks and select another archive disk and  directory          Archive location    When the  Compression  option is set  all the archive files created during a   Backup  procedure are compressed  This option is very useful to reduce the size  of a large project archive file  and save it on only one diskette  Archive compression  is generally not needed for library components  The ISaGRAF Archive Manager  automatically recognises the status of an archive file  compressed or not  when  restoring the archive  This implies that the  compression  option has no effect for a   Restore  procedure              T Compress    Backup and restore    The  Workbench  list  on the left  shows the objects existing in the ISaGRAF  Workbench installed on the hard disk  The  Archive  list  on the right  shows the  objects saved on the specified archive disk and directory     Backup    Saving an object on archive is achieved by selecting the object in the list on the left   ob
295. ies to divide a real analog by zero  Your application should prevent such an  event  which may have unpredictable effects  When this occurs  ISaGRAF places the maximum real analog value as the result  When the operand is negative  the result is inverted    69  invalid operate parameters application    72  application symbols cannot be modified application    22 ze  3 2  He  35 S  ge  g  zg  ae oo  83 EF     D 2y  x of  go roe   a     gt   g 5  S  5 2 30   gt O on  2       95 35  S  D  D   g O  og 3 v  e  m    D  3 2  a3 oes  3 g im  v om  En vo      gt  eo  S  2 s  o3 Oe  ancy a7  os os      oO  o  a 5a  x2 55  353    o  ag Qa  0 o  O 23    23  o5 2   gt  fo   a  5 2  Zo  G  J 0 Sa  o5 GBH  26 nach  58 o  o9 78  o  23  ao  a  SE EE  a   gt  oD  30    Cee 2  ion al  7D 3  Dg D   lt       S  lt      zo 2    3  os  3 0 a    added  removed or modified  compared to the current application     73  cannot update  different set of boolean variables application    Q   o   3  ge   D  oO  a           A    J   0   O  r  3  oO  p      o   pej  noe  O  feb      O  a       a gt       3  fe   a     D  2  v  E2   a  5  S              O  D  J3  J      2  loy      n  n      oa  D  a  o  mo   O  D  a ee  n   gt  oO  n      3  D  w  o   o  D  D       lt   S      D  Ss  D  n           lt   o  o  D  D  5        Q  Q     a      E        3       lt      a    74  cannot update  different set of analog variables application    75  cannot update  different set of timer variables application    QO  O  3 
296. ify the input values  The Virtual attribute applies to a complete board  It is  programmed during the I O board definition  before the application code generation   The virtual attribute is a static feature  and is stored when the application is  stopped and restarted    Another possibility is the I O variable locking  It consists of disconnecting one  physical device and the corresponding ISaGRAF I O variable  Variable locking and  unlocking is performed through the debugger  Variable locking is a dynamic  operation  and is not memorised when the application restarts  The lock operation  applies to only one variable  one I O channel  at a time  This is the summary of  main I O controlling features     Virtual Attribute Lock command  selection tool I O board connection debugger  definition static dynamic  selection mode board variable  application validation and tests maintenance    The following chart explains the I O data flow between the ISaGRAF tasks        ICS Triplex ISaGRAF Inc  A 161    User s Guide                    INPUTS Run time  DATA    OUTPUTS    DATA  BASE    VO driver BASE VO diver  User OEM User OEM  Input  devices    Output  devices    Deb  bugger             When an input variable is locked  the various accesses to the database are not  changed  but the input device is disconnected  Input values can be set with the  debugger and processed by the ISaGRAF kernel     Run time  Kernel    User OEM application   user oem key        Input  devices                
297. ight 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 output  1 Q                output2       ST Equivalence      output1    input1   output2    input1       Inverted coil    Inverted coils enable a Boolean output according to the Boolean negation of a connection  line state        B 214 ICS Triplex ISaGRAF Inc     Language Reference       boo_ variable       Left connection Right 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 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     input output    i il WO  output2                   ST Equivalence      output1    NOT  inputt    output2    input       SET coil   Set  coils en
298. iles  link lists  etc      Temporary files  sub directories of TMP are reserved for the  ISaGRAF Code Generator and cannot be deleted     The sub directories can be moved to other disk locations  When the user has a non   standard architecture  the pathnames of the sub directories should be declared in  the WS001 section  in the ISA ini initialisation file  in the EXE sub directory of  ISaGRAF  Here are the entries of the WS001 section     Isa  IsaExe    root directory for ISaGRAF architecture  root directory for  SaGRAF programs and help files       ICS Triplex ISaGRAF Inc     A 165    User s Guide       IsaApl root directory for ISaGRAF projects  IsaTmp directory for temporary files   IsaSrc directory for library source code  IsaDefs directory for library source headers    Note that if you change the IsaTmp entry to another directory  you must create the  sub directories OBJS  RELS and DATA in the new directory  The following example  uses the entries of the WS001 section to redefine the standard ISaGRAF disk  architecture      file c  ISAWIN EXE ISA  ini     WS001    Isa c   isawin   IsaExe c   isawin exe  IsaApl c  isawin apl  IsaTmp c   isawin tmp  IsaSrc c  isawin lib sre  IsaDefs c  isawin lib defs    When you want to add  C  functions or function blocks to the ISaGRAF target  the   ISAWIN LIB DEV directory is used to store development files  command files   makefiles  maps  etc    The  ISAWIN LIB RELS directory is used to store the object  files generated during  C  c
299. ill SFC program            Kills the selected program by removing all existing tokens   Freeze SFC program       Suspends the execution of the selected program   Restart SFC program      Restarts a frozen  suspended  program   For child programs  these commands correspond to the  GSTART    GKILL     GFREEZE  and  GRST  functions in the programming language   A control operation can be seen in a SFC step when debugging the application by  double clicking on its graphic representation in the SFC editing window  The  following commands are available in the debug dialog box   e Install a breakpoint on the step activation  e Install a breakpoint on the step de activation  e Clear breakpoint added to the step  Note  Activation and de activation breakpoints cannot be added to the same  step   A control operation can be seen in a SFC transition when debugging the  application by double clicking on its graphic representation in the SFC editing  window  The following commands are proposed in a debug dialog box   e Add a breakpoint on the transition clearing  e Clear a breakpoint added to the transition  e Manually clear the transition  move or add tokens    A 114 ICS Triplex ISaGRAF Inc     User s Guide       Conditional clearing  a token is created on the steps following the transition  The  tokens existing in the preceding steps are removed  Unconditional clearing  a  token is created on the steps following the transition  The tokens existing in the  preceding steps are not removed  
300. imal integers  The  virtual addresses  VA  are expressed as hexadecimal 4 digit numbers  and are  preceded by the character      For example     123 this is a decimal number   A003 this is an hexadecimal virtual address    The main structure of the file  APPLI TST  is shown below  The file is structured as  a list of blocks  A block is a list of records  Each record is described on one line of  text  Each block begins with a header  put on one line of text     Start block  description blocks  end block    The general syntax of one block is shown below        lt block_name gt   lt arguments gt    record      record       The structure of the first block  containing the main information about the  application  is shown below      ISA SYMBOLS   lt appli_cre gt     NAME  lt appli_name gt   lt version gt     DATE  lt creation_date gt    SIZE G  lt nbprg gt  S  lt nbstep gt  T  lt nbtra gt  L 0  P  lt nbpro gt  V  lt nbvar gt    COMMENT ICS Triplex ISaGRAF    appli_ere             application symbols checksum  appli_name         name of the application  version                ISaGRAF workbench version number    creation_date     application generation date       nbprg           number of programs  nbstep         number of SFC steps  nbtra             00  number of SFC transitions  nbpro             0  number of  C  functions used  nbvar            05  total number of variables    The structure of the last block  which signals the end of the file  is shown below      END_SYMBOLS    
301. in this document for further information  about these tools     Make the application code    The  Make  command starts the project code generation  The options for target  code generation must be set correctly before running this command  Before  generating the target code  any program that is still not verified is checked to detect  the syntax errors  ISaGRAF includes an incremental compiler  which does not re   compile programs  which have already been compiled     Verify the selected program    The  Verify  command allows the user to verify the syntax of the program currently  selected in the list  When a program is verified  with no error detected  it is not re   verified during the code generation until its contents or dependent defined words or  variables change     Simulating a modification    The  Touch  command simulates a modification of each program so that all of them  will be compiled again during the next code generation     Application run time options    This command opens a dialog box where are entered the main run time parameters  for the execution of the application  This includes the cycle timing programming  run  time error management  the starting mode and the hardware implementation of  retained variables  Refer to the chapter  Using the Code Generator  in this  document for more explanations about this command     Compiler options    This command is used to set up the options used by the ISaGRAF Code Generator  to produce and optimise target code  Refe
302. including single equipments and boards of complex equipments  cannot exceed  255     Icons    The icons displayed on the front face indicate the type and attributes of variables  that may be connected to the board channels  The ISaGRAF system does not allow  the connection of variables of different types on the same board  This is the  meaning of the used icons     T iar anneni Boolean type   r AEE Integer real type  both types of variables may be connected   a E E EE Message type   TB Inputs   no channel connected   Beee Outputs   no channel connected   na Inputs   at least one channel connected   WF  Outputs   at least one channel connected    Below are the icons used to show the type of I O device installed on a slot        Complex I O equipment      re Real I O board  FB eee eee Virtual I O board    Below are the icons used to draw a parameter or a channel     5008  Board parameter  OQ  Free channel       AE E Connected channel    Moving boards in list    Use these buttons in the toolbar or  Edit   Move board up down  menu commands  to move the selected I O board one line up or down in the main list  The  Edit    Insert slot  command inserts an empty slot at the current position        ICS Triplex ISaGRAF Inc  A 91    User s Guide       A 11 1 Defining I O boards    The  Edit  menu contains basic commands to define the selected board  set up its  parameters   and to connect I O variables to its channels     Selecting I O board type    Before connecting I O variables to a 
303. ing   The replaced text can be a variable name  a constant expression or a complex  expression  Defined words are sorted according to their range  Only defined words  of the same type and the same range can be entered on the same input grid  Here  are basic ranges   A 80 ICS Triplex ISaGRAF Inc     User s Guide       can be used by any program of any project  can be used by any program of the current project       can be used by only one program    A name  a well defined block of ST text equivalence and a free comment identify a  defined word     i Function block instances    The instances of the function blocks used in the ST and IL languages must be  declared in the dictionary  Because a function block has internal  hidden  data  each  copy of a function block must be identified  The following example shows the  function block  R_TRIG   rising edge detection  defined in the library used for edge  detection on different variables  Each copy of the block must be identified by a  unique name  Using the library manager makes naming the type of block and  definition of its parameters     Block name  R_TRIG  Parameters  Input CLK  Output Q    Using the dictionary editor makes naming the instances     Instance name  TRIG_B1 Block name  R_TRIG  Instance name  TRIG_B2 Block name  R_TRIG    The declared instances may be used in ST programs     TRIG_B1  b1    edge_b1    TRIG_B1 Q     b1 variable edge detection     TRIG_B2  b2    edge_b2    TRIG_B2 Q     b2 variable edge detection     
304. ing a new selection  selection of all objects previously selected is removed   To remove the existing selection  simply click with the mouse in an empty area   outside of the rectangle which borders the selected objects     For single selection  it is possible to use keyboard arrows to move selection from  one object to the other in the chart  Flow links can also be selected     a Inserting comments    Comments may be inserted anywhere in an empty part of the diagram  Comments  have no influence on the program execution  They allow a higher readability of the  diagram  To insert a comment block  select the corresponding button in the toolbar   and click in the diagram where comment must be put  Double click on a comment to  enter   change its text  No special leading or trailing characters such as      and       are needed when entering the text of a comment block  A comment block may be  resized by dragging the corners of its border when it is selected       Drawing flow links    Select this button in the toolbar to draw a flow link between existing elements  A link  must always be drawn in the direction of the flow  First select a non connected  output point of a FC element  and drag the mouse to the destination point to insert  the link  The destination point can either be the top  input point  of a non connected  FC element  or any location on an existing link  Convergence points between links  are shown with small grey circles in the Flow Chart  Convergence points can al
305. ing in the target PLC  No operation  can be performed if the project selected in the Diagnosis Tool dialog box is not the  same as the one installed and running in the PLC     When the limited ISaGRAF debugger is run  and correctly connected to  the target application  the following commands are available   e Spy lists of variables  e Spy graphic documents with SpotLight       A 132    ICS Triplex ISaGRAF Inc     User s Guide       A 21 Using the ISaGRAF simulator    A 21 1    A 21 2    The ISaGRAF Kernel simulator is started with the debugger when the  Simulate   command of the  Debug  menu in the Program Management window is run  The  kernel simulator is a complete ISaGRAF target system supporting ISaGRAF  standard features and all the  C  functions and function blocks of the standard  library delivered by ICS Triplex ISaGRAF  The I O boards are graphically simulated  in a window  Any type of I O board can be simulated  The boards defined as  Virtual  boards  during the I O connection also appear in the simulation window     Links with the debugger    The kernel simulator supports full communication with the ISaGRAF debugger  so  any of the debug possibilities can be used during simulation  The kernel simulator  always works on the current ISaGRAF application  During simulation  the debugger  commands  Start    Stop    Download  or  Update  are no longer available  The  simulator cannot be used if the  SIMULATE  target was not selected in compiler  options before building t
306. ing on input values  with hidden static data  which are copied  instanced  by the system on each  different use of the function block  Any program of any section in the project can call  the programs of the  Function Blocks  section  They cannot be programmed in SFC  or FC language     Sub programs    Sub programs are functions dedicated to one  SFC  FC or other  father program  A  sub program can be executed  called  by its parent program only  Each program of  each section may have one or more sub programs  Any language apart from SFC  and FC can be used to describe a sub program     Child SFC and FC programs    A child SFC program is a parallel program that can be started or killed by its  parent program  The parent program and child program must both be described in  SFC language    When a parent program starts a child SFC program  it puts a SFC token into each  initial step of the child program  When a parent program kills a child SFC program  it  clears all the tokens existing in the steps of the child    Any FC program of the sequential section may control other FC sub programs  A  FC father program is blocked  waits  during execution of a FC sub program  It is not  possible that simultaneous operations are done in father FC program and one of its  FC sub programs     Links between programs and sub programs     Sub programs and child programs are linked to their parent program by a line in the  hierarchy tree  An arrow ends a link between a SFC program and a SFC child 
307. ing programs is opened  with all fields set up with the  attributes of the selected program  Enter the name of the destination program and  its location in the sections of the hierarchy tree  If the destination program does not  exist  it is created at the specified location  If the destination program already exists   it is overwritten  All the local declarations and defined words are copied with the  program  The description language of the destination program must be the same as  the one used for the source program  Press the  OK  button to copy the program     The  Copy to other project  command of the  File  menu copies the selected  program into another project  with the same name  The child SFC programs and  sub programs of the selected program can be copied with it  The names of the  selected program and its children must not be used in the target project  Programs  cannot be overwritten by this command  All the attached local declarations and  defined words are copied with the programs     Deleting programs    To delete a program  first select it from the list of programs  and then run the  File    Delete  command  A program owning child or sub programs cannot be deleted  In  order to delete a program with child or sub programs  the child or sub programs  must be deleted first  All the local declarations and defined words are deleted with  the program     Importing function or function block from library    The  Tools   Import from library  command is used to copy a 
308. ink  used for communication for upload between ISaGRAF workbench and the target  ISaGRAF system  You have to ensure that the configured parameters match to the  connected target before running upload        ICS Triplex ISaGRAF Inc  A 129    User s Guide       A 19 3 Preparing a project for upload    You have to inform the ISaGRAF Code Generator that zipped source code must be  embedded with the application code if you want to enable upload later  For this   press the  Upload  button in the  Compiler options  dialog box  Another dialog box  enables you to check  as an option  the embedding of zipped source code  In this  case  only minimum required source files will be embedded  Use other check boxes  to embed also optional files     Important note  Libraries are not downloaded with embedded source code  This  includes functions and function blocks and I O boards and equipments     Optional files    In addition to the minimum required source code  the following files can also be  embedded  They are options as their selection leads to extra memory requirement  on the target     Project descriptor  If not embedded  the project descriptor after upload will just  indicate the upload date     Password protection  Upload function is not protected by a password  If you want  the uploaded project protected  you have to embed its password protection system  with source code     Comments for not connected I O channels    SaGRAF gives you the possibility to  enter description text for no
309. ink a diagram input and a diagram output  It can also be  used  with a Boolean negation line  to invert the state of a line connected to a diagram output           FBD example with assignment Blocks     1                ai10 m a023                     bil 1  bi2 qm bo100                                                                  ST equivalence      ao23    ai10   bo100    NOT  bi1 AND bi2         IL equivalence        LD ai10  ST ao23  LD bit  AND bi2  STN bo100  NEG  Neg  IN Q   Arguments    IN INT REAL input and output must have same format   Q INT REAL  Description     Assignment of the negation of a variable        FBD example with negation Blocks                                                                   Neg  ai10 N q a023       rit Neg  ri2 n ro100                      ST equivalence      ao23       ai10    ro100       ri1   ri2         IL equivalence        LD ai10  MUL  1  ST ao23       B 246 ICS Triplex ISaGRAF Inc     Language Reference       LD ri1  ADD ri2  MUL  1 0  ST ro100   amp  AND    Note  For this operator  the number of its inputs can be extended to more than two     Arguments     inputs  BOOLEAN   output BOOLEAN Boolean AND of the input terms  Description     Boolean AND between two or more terms        FBD example with  AND  Blocks      amp                                            bi101   bi102 k bo10   amp    bi51   bi52   bi53 bo5                         ST equivalence        bo10    bi101 AND NOT  bi102    bo5     bi51 AND bi52  AND bi5
310. 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     a   gt      B 1 6 Description language              rect                 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       ICS Triplex ISaGRAF Inc  B 177    Language Reference       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     B 1 7 Execution rules    ISaGRAF is a synchronous system  A clock triggers all the operations  The basic duration of  the clock is called the cyc
311. integration were not supported     Refer to your hardware manual to know the type of ISaGRAF target kernel installed  on your PLC  Other target types  machine code  C source code     may be  supported in future releases of the ISaGRAF Workbench       SFC processing    Check the  Use embedded SFC engine  box to enable the use of the ISaGRAF  SFC engine  This mode should be preferred as it leads to higher run time  performances  However  the target engine may be missing on some particular  implementations of the ISaGRAF target  of more commonly on customised targets  based on ISaGRAF code post processing  In this case you may have to remove this       ICS Triplex ISaGRAF Inc  A 99    User s Guide       option and let ISaGRAF compiler translate SFC charts into low level instructions   Refer to your hardware documentation for more information about the use of this  option     Optimiser options    Below are the parameters  used by the ISaGRAF Code Generator to optimise the  target code that can be set from the  Compiler options  dialog box  The  Default   button is used to remove all optimising options  in order to reduce the compiling  time      gt  When the  Run two optimiser passes  option is set  the ISaGRAF Code  Optimiser is run twice  Optimisations made during the second pass are generally  less significant than the ones made in the first pass      gt  When the  Evaluate constant expressions  option is set  the compiler  evaluates constant expressions  For example  the nume
312. ion task  linked with the same kernel task or to run up to 4 kernels with the same communication task   This makes easy some integration such as a process visualization link and the workbench  debugger link on the same application or a single link up to 4 different applications through  the same physical port     The kernel and communication tasks are independent and can be separately forked  The only  requirement is that the kernel task s  has to be started first so that it initializes its system  environment and the communication task s  can link it     The ISaGRAF multitask target does not prevent the running of background processes or  interrupt driven routines    C 4 2 1 Running the kernel task  isaker      Slave number   s Option    This option specifies the target kernel slave number  It can be from 1 to 255 except number  13   0D   This slave number is used through the communication link protocol and by the  communication task s  linked to the kernel  It is needed to distinguish slaves from each other  when more than one target are running     Default value  The default slave number is 1  Same as the workbench one   C 4 2 2 Running the serial communication task  isatst      Communication link and configuration   t Option    The target communication task isatst uses a serial link for debugger communication  The  name of the descriptor is specified with the  t option        ICS Triplex ISaGRAF Inc  C 331    Target User s Guide       No Default value  If this option is n
313. is saved on the target current directory with the file name    ISAx1 ISaGRAF application code backup file  where x is the slave number        ICS Triplex ISaGRAF Inc  C 327    Target User s Guide       Furthermore if the application symbol table has been downloaded before  it is also saved on  the target current directory with the file name   ISAx6 ISaGRAF application symbols backup file  where x is the slave number     When the ISaGRAF target is started  these application code and application symbols files are  searched on the current directory and loaded into memory    If no symbols file is available  then the target starts running the application code  with no  symbols loaded    If no application code is available  then the target is waiting for an application to be  downloaded    In order to start the target with a specific application at power up  without using the debugger  link  these files can be directly copied to the target current directory disk from the same disk if  the workbench is on the same PC  or using a floppy disk  If there is no disk on your target  machine you may use a virtual disk     If the ISaGRAF workbench is installed on the standard  ISAWIN directory    the application code file of the project MYPROJ is    ISAWIN APL MYPROJ appli x8m   the application symbols file of the project MYPRO4J is    ISAWIN APL MYPROJ appii tst    Example   From the directory where isa exe is installed  if the following command is entered     copy  ISAWIN APL MYPRO J appl
314. isaker  s 3  t COM1 Starts the ISaGRAF target with slave number 3 and with COM1 as the  communication port        C 354 ICS Triplex ISaGRAF Inc     Target User s Guide       C 6 3 Specific features      ISaGRAF start up    When the target is started  the following algorithm is executed     Look for application from disk  to load it into memory    Application OK       No available application on disk        Execute Application    Stop application    e Definitions   The application code is the binary data base generated and downloaded by the workbench  and then  executed by the target  The symbol table may complete it    The application symbol table is an ASCII database generated and downloaded by the  workbench  This table makes the link between symbol objects and internal target objects  It is  not required on target except for user   s specific symbol management as for instance the DDE  feature or I Os simulation with symbol names feature  For more information on symbol table  see user   s guide  Advanced programming techniques     e  ISaGRAF Multi applications   Different applications can run at the same time on a CPU  as far as they have respectively  different slave numbers and different communication task logical numbers  Nevertheless while  running different application  the user must take care of some application objects shared  access such as I O boards  For instance different application may use distinct physical boards  unless some kind of I O server or semaphore is
315. isually removed from the diagram   but simply marked with  Deleted  style   This enables the user to automatically keep  a trace of all modifications entered in the diagram    Use the  Edit Style Remove all deleted items  to actually remove all elements  marked with  Deleted  style from the LD FBD diagram  This command does not  take care of the current selection  and always applies to the entire diagram    To  restore  one element marked with the  Deleted  style  select the desired  element and apply to it the  Normal  style  the  Modified  style or any  Custom   style  Such operation may lead to invalid connections  more than one link  connected to the same input point  that will be detected during next program  verification     A 7 6 On line help    To get help about function blocks from the LD FBD editor     Select an existing function block on the LD FBD diagram OR place the cursor  on it        ICS Triplex ISaGRAF Inc  A 71    User s Guide          Press on F1    Help about the function block is displayed  In case of custom  C  or IEC function or  function block  the help displayed is the  technical note  entered in the library editor   text only      A 7 7 Printing an FBD diagram    The  File   Print  command outputs the FBD diagram on printer  This command  automatically runs the ISaGRAF Document Generator to printout the FBD diagram        A 72 ICS Triplex ISaGRAF Inc     User s Guide       A 8 Using the text editor    This section describes features and commands of 
316. itialized to FALSE      busy      x    If claim Then       ICS Triplex ISaGRAF Inc  B 269    Language Reference          x    True   Else  If release Then  busy    False   x    False   End_if   End_if   CTU  Arguments   CU BOO counting input  counting when CU is TRUE   RESET BOO reset command  dominant   PV INT programmed maximum value  Q BOO overflow  TRUE when CV   PV  CV INT counter result    Warning  The CTU block does not detect the rising or falling edges of the counting input  CU    It must be associated with an  R_TRIG  or  F_TRIG  block to create a pulse counter     Description   Count  integer  from 0 up to a given value 1 by 1       FBD program using  CTU  block                                           r_trig CTU  command lok ajeu  auto_mode C Rreset o overflow  100 v cy result                                                 ST Equivalence  We suppose R_TRIG   1 is an instance of R_TRIG block and CTU1 is an  instance of CTU block     CTU1 R_TRIG1 command  NOT auto_mode  100     overflow    CTU1 Q    result    CTU1 CV        IL Equivalence        LD command  ST R_TRIG1 clk  CAL R_TRIG1   LD R_TRIG1 Q  ST CTU1 cu  LDN auto_mode  ST CTU1 reset  LD 100   ST CTU1 pv       B 270 ICS Triplex ISaGRAF Inc     Language Reference          CAL CTU1  LD CTU1 Q  ST overflow  LD CTU1 cv  ST result  CTD  Arguments   cD BOO counting input   down counting when CD is TRUE   LOAD BOO load command  dominant    CV   PV when LOAD is TRUE   PV INT programmed initial value  Q BOO underflo
317. ives access to the communication configuration  The modified  option will be activated only after next start of the target  This feature isn   t available if  the target has been started with at least one option different from  s option     DDE gives access to the DDE advise loop rate modification  The modified option will  be activated only after next start of the target  This option isn   t available if the target  has been started with at least one option different from  s option     Simulate I O is checked or unchecked reflecting the state of the option  The modified  option will be activated only after next Stop Start of the application     Priority gives access to the priority modification  The modified option is activated  immediately     Default Options retrieves the default running options for the following only      Communication     DDE     Coordinates of the window on the screen   The modified options will be activated only after next start of the target  This feature  isn   t available if the target has been started with at least one option different from  s  option     e  Messages  menu  The  Messages  menu is the management of the output  It contains the two following  commands     Acknowledge stops the red blink in case of errors or messages   Clear totally erases the output     ISaGRAF NT target icon     The icon reflects the states of the target         application is running  then the icon turns       no application  or application stopped   then the icon i
318. jects of the ISaGRAF workbench  and pressing the  Backup  button  More than  one object on the list can be selected  The  Backup  button is disabled when an  element is selected from the list on the right  restore mode      Restore    Copying an object from the archive to the ISaGRAF Workbench is achieved by  selecting the object in the list on the right  archive objects  and pressing the   Restore  button  More than one object on the list can be selected  The  Restore   button is disabled when an element is selected from the list on the left  backup  mode      Archive files    The ISaGRAF archive manager creates a unique archive file for each saved object   The archive file has the same name as the object  Its file suffix indicates its type   Below are the used suffixes    Plain tees project       ICS Triplex ISaGRAF Inc  A 153    User s Guide       I O board   function in IEC language  function block in IEC language  C function   C function block   C conversion function   I O configuration   I O equipment          A 154 ICS Triplex ISaGRAF Inc     User s Guide       A 24 Printing a complete document    A 24 1    The ISaGRAF Document Generator allows the user to build and print a complete  document for the selected project  It can be called by the  Project   Print   commands of the Project Management or the Program windows to print a complete  document  The Document Generator is also run by the  Print  command of all other  ISaGRAF editors to print the contents of a single I
319. ke sure the setup and user codes are the same as those in  the License Manager window  then copy and paste the registration keys in  their respective fields     5  Click Proceed     If licensing is successful  ISaGRAF appears greyed in the Selected Components  list     6  When licensing is complete  stop then restart ISaGRAF     A 1 2 2 Transferring Licensing    You can transfer licensing from one computer to another   To transfer a license to a new computer    Transferring a license from one computer to another requires creating a license  transfer disk  then removing the license from the currently licensed computer and  copying it to this transfer disk before it can be installed on the new computer  The  floppy disk must be formatted and blank   1    From the new computer  prepare the license transfer disk    a  Install ISaGRAF    b  Insert a floppy disk in the computer s drive     c  From the Start menu of Windows  choose Programs  then ISaGRAF 3 5   then Licensing     d  On the Transfer License tab  select the drive holding the floppy disk  then  click Create Transfer Disk     The license transfer disk is created     e  Remove the license transfer disk from the new computer   s drive     2  Transfer the license from the currently licensed computer to the license  transfer disk     a  Inthe currently licensed computer s drive  insert the license transfer disk        A 16 ICS Triplex ISaGRAF Inc     User s Guide       A 1 2 3    b  From the Start menu of Windows  choose Pro
320. ks between father programs and children programs    D 424 ICS Triplex ISaGRAF Inc     Glossary       I O board  1 0 channel  V0    connection    I O variable    Identifier    IL    Initial  situation    Initial step  Input  Instruction  Instruction  List  Integer  Internal  Jump toa  step  Keyword  Label  IL   Ladder  Diagram  LD    Level 1 of  the SFC    Level 2 of    Hardware resource  A type and a direction  input or output  characterize an I O  board  The parameters of an I O board are described into the ISaGRAF library     Single connection point of an I O board  An I O channel may receive one I O  variable     Definition of the links between the variables of the application and the channels  of the boards existing on the target system     Variable connected to an input or output device  An I O variable must be  connected on a channel of an I O board     Unique word used to represent a variable or a constant expression in the  programming     Instruction List language     Set of the initial steps of a SFC program  which represents the context of the  program when it is started     Special step of a SFC program  which is activated when the program starts   Attribute of a variable  Such variables are linked to an input device    Elementary operation of an IL program  entered on one line of text    Low level literal language  entered as a sequential list of elementary operations   Class of analog variables  stored in a signed integer 32 bit format    Attribute of a variable
321. l address used to store message variables  Need to be always  different from zero    msg_size  Hexadecimal size  in bytes  available at this address  256 bytes per message  variable to store is required     Requirements        All fields of all types need to be specified even if you may not need to make a backup of all  types of variables  In such a case you need to specify a size of zero  except for analogs for  which you need to specify a size of four bytes  and any address different from zero  for the  non required type s  of variables        C 406 ICS Triplex ISaGRAF Inc     Target User s Guide       Example   Let   s suppose that we need to make a backup of   20 Booleans variables  0 Analog variable  0 Timer variable  3 Message variables  The backed up memory is located at Hexadecimal address 0xA2F200   Let   s suppose that   Booleans will be stored at address OxA2F200 with the exact required size of 20 bytes   Analogs minimum required size of 4 bytes will be stored at address 0OxA2F214   Timers dummy address will be OxA2F200 and specified with a size of zero   Messages will be stored at address 0x A2F218 with the exact required size of 256 3 bytes   Then the workbench entered string should be     A2F200 14 A2F214 4 A2F200 0 A2F218 300  a SYSTEM function call    If most of the application variables need to be stored  then the facilities of the SYSTEM  function should be used to deal with a complete set of variables  for more information on the  SYSTEM function see the us
322. l is run from another ISaGRAF tool  for  example  the Project Manager runs the Program Manager   Stored passwords are  lost when the last remaining ISaGRAF window is closed  Passwords entered during  project editing  or by using the Library Manager  or by using the Archive manager  cannot be shared  If the user enters a bad password  he cannot run the selected  function       Links with the archive manager    When saving an object  project or library element  on archive disk  the data  protection item named  Backup on archive  is invoked  This corresponds to the  data protection system attached to the object in the Workbench  hard disk   No test  is performed on the data protection system of the object on the archive disk if it  already exists  The  Backup  command of the ISaGRAF Archive Manager saves  the data protection information with the object on the archive disk    When restoring an object  which already exists in the Workbench  hard disk   the  data protection item  named  Overwrite with archive  is invoked  This corresponds  to the data protection system attached to the object in the Workbench  hard disk    No test is performed on the data protection system of the object on the archive disk   If this command is validated  the restored data protection information will then  replace the existing one on the hard disk        ICS Triplex ISaGRAF Inc  A 159    User s Guide       Setting individual protection for variables and I O channels    The ISaGRAF workbench provides 
323. l session  accessories group  with the right communication  parameters        Hit 3 carriage return     You are now logged on an OS 9 Shell      Type logout to exit the terminal mode     WARNING   The terminal mode session must always be left in a clean way using logout and nothing else   otherwise next connection with the workbench will be unsuccessful        C 338 ICS Triplex ISaGRAF Inc     Target User s Guide       C 5 Getting started with ISaGRAF VxWorks target    To run the ISaGRAF target s   a few commands need to be executed on the VxWorks  system  in order to set the configuration environment and finally spawn the ISaGRAF  target s   All these commands may be started from a script file  They are described in next  chapters     C 5 1 The system resource manager  isassr o    This module is always needed  in any configuration of the ISaGRAF target  and must be the  first of the ISaGRAF target loaded modules  It enables the system resource managing of multi  targets running     C 5 2 Common features to isa o  isakerse o and isakeret o    To run ISaGRAF  one of these modules may be loaded     isa o  enables to start  ISaGRAF single task targets  serial communication link only    Isakerse o  enables to start  SaGRAF multitask targets  serial communication link only    Isakeret o  enables to start ISaGRAF multitask targets  serial or and Ethernet    communication link    These modules are detailed in next chapters       Serial communication link configuration    The ISaGRAF
324. l_mode         IL Equivalence              LD level  ST CMP1 val1  LD max_level  ST CMP1 val2  CAL CMP1  LD CMP1 LT  OR CMP1 EQ  ST pump_cmd  LD CMP1 GT  ANDN manual_mode  ST alarm  STACKINT  stackint  Arguments   PUSH BOO push command  on rising edge only   add the IN value on the top of the stack  POP BOO pop command  on rising edge only   delete in the stack the last value pushed  top of the stack   R1 BOO resets the stack to its empty state  IN INT pushed value  N INT application defined stack size  EMPTY BOO TRUE if the stack is empty  OFLO BOO overflow  TRUE if the stack is full  B 276 ICS Triplex ISaGRAF Inc     Language Reference       OUT INT value at the top of the stack    Description   Manage a stack of integer values     The  STACKINT  function block includes a rising edge detection for both PUSH and POP  commands  The maximum size of the stack is 128  The application defined stack size N  cannot be less than 1 or greater than 128     Note that OFLO value is valid only after a reset  R1 has been set to TRUE at least once and  back to FALSE         FBD program using  STACKINT  block  error management                                                                                           stackint  err_detect push  acknoledge PoP auto_mode ual  manual_mode     smer q appli_alarm  err_code IN OFL err_alarm  max_err N ouj last_error                                                          ST Equivalence  We suppose STACKINT1 is an instance of STACKINT block     STAC
325. language can also be IL or Quick LD  The name of the selected  language is displayed in a small box in the level 2 title bar  Run the  Options   Set  Level 2 language  command from menus or click on that box to change the active  language  This command is valid only if the level 2 programming window is empty          04  Start machine M100  IL Language   ST Language  LD Language    A single line edit box appears at the top of the level 2 window  It is used to enter a  short description text  This text will be displayed as an IEC comment in the drawing  of FC symbols  It is very useful as it is used by other commands such as  Go To      and also in the FC printout to document FC actions and tests     4  Start machine M100    Start machine M100        The  Options   Refresh  command can be used at any time when level 2 windows  are open to refresh the main FC chart with modified level 2 programs     A 5 5 Programming level 2 with Quick LD    Quick LD editor is available for level 2 programming  In the case of a decision test   the LD diagram is made of just one rung  with only one coil  which represents the  decision  The name of the test is not repeated with the coil symbol  Below is an  example of a test programmed in Quick LD     toggle Cmd100    HHI    _     _   ManMode    When programming in Quick LD  use the keyboard arrows to move the selection in  the programming logical grid  and then use the following shortcuts to insert symbols   Farane a insert a contact after the s
326. le 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        B 178 ICS Triplex ISaGRAF Inc     Language Reference       B 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     B 2 1 Basic types    Any constant  expression or variable used in a program  written in any language  must be  characterised 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   B 2 2 Constant expressions    Constant expressio
327. lic object name begins with  ISAxn  where x is the kernel slave number  and n a space number with a specific meaning  except for ISAy3 where y is the  communication task logical number in the multitask implementation    Different applications  kernels and communication tasks  can run at the same time on a CPU   as far as they have respectively different slave numbers and different communication task  logical numbers  Nevertheless while running different applications  the user must take care of  some application objects shared access such as I O boards  For instance different  applications  kernels  may use distinct physical boards unless some kind of I O server or  semaphore is implemented through the I O driver     OS 9 object names     Disk Files   ISAx1 ISaGRAF application code backup file  ISAx6 ISaGRAF application symbol backup file  Memory Modules   ISAx0 ISaGRAF kernel system data  ISAx1 ISaGRAF application code  ISAx2 ISaGRAF kernel real time data base  ISAy3 ISaGRAF communication data exchange buffer  ISAx4 ISaGRAF on line modification 1 application code  ISAx5 ISaGRAF on line modification 2 application code  ISAx6 ISaGRAF application symbol    Therefore the user must take care to not use the same object names     e Application backup  When a new application is downloaded from the workbench debugger into the target  the  application code is saved on the target current directory with the file name    ISAx1 ISaGRAF application code backup file  where x is the slave num
328. lication should not be stopped when a key is hit  something  should be provided to disable these combinations     One dangerous side effect of these fast exits  is that the IO board interface is not closed   Thus the clean way for stopping your ISaGRAF target is      stop the application from the debugger  this will close the IO boards      stop ISaGRAF target from the keyboard      Application size    As the ISaGRAF MS DOS target is designed for Intel real mode  the maximum size of a data  structure is 64K  Thus  the application code downloaded by the workbench should not exceed  this limit  In some very rare cases  internal structure allocated by ISaGRAF may also exceed  this limit and crash your application after download  Furthermore the whole available memory  is limited to the 640K of conventional memory     Ask your supplier for a special implementation if your application require more memory  capacity        ICS Triplex ISaGRAF Inc  C 329    Target User s Guide       C 4 Getting started with ISaGRAF OS9 target    First of all you need to transfer files  at least executable files from CMDS directory  to your  OS 9 target using any file transfer tool   Then to get started you can simply run the help commands from your OS 9 system CMDS  directory    isa      isaker      isatst      Isanet       C 4 1 Running the ISaGRAF single task  isa    The ISaGRAF target can be run as single task  But in such a configuration operations can be  critical  It is for instance recommended
329. line state and  the rising edge of a Boolean variable     boo_ variable       P    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 rises from  FALSE to TRUE  It is reset to FALSE in all other cases        Example using RISING EDGE contacts       input1 input2 output  H   4   H     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        ICS Triplex ISaGRAF Inc  B 213    Language Reference       boo_ variable        gt  N    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 output    H ni O4    a           ST Equivalence      output1    input  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  Left connection NAN R
330. list to the other  Each project has its own list  of documents for initial workspace     a Link set up    The  Link set up  command enables the user to define the parameters of the link  used for communication between the debugger on the host PC and the target  ISaGRAF system    The  Slave number  identifies the target ISaGRAF system or task  It can be from 1  to 255  Refer to the target supplier manual for the slave number of the target system  used    The  Communication port  identifies the hardware media between ISaGRAF  workbench and target  It can be either the name of a serial port  or  Ethernet    reserved TCP IP communication using the  Winsock  Version 1 1    The  Time out  is the time left to the target system for its communication operations  between the end of a debugger question and the beginning of its response  This  time is set as a number in milliseconds  The  Retries  field is the number of  automatic trials the debugger executes for a communication operation before  detecting a communication error       Serial link set up    When a serial port  COM1  4  is selected  the  Set up  button is used to access to  other serial link communication parameters    The transmission baud rate  parity and format may be selected  When the   hardware  choice is selected for  Flow Control   the ISaGRAF Workbench  controls the CTS and DSR lines to enable hardware handshaking during  exchanges        ICS Triplex ISaGRAF Inc  A 35    User s Guide       Ethernet link set up    W
331. lock     ascii          message In  IHP Cod FirstChr                                                             ST Equivalence      FirstChr    ASCII  message  1       FirstChr is the Ascii code of the first character of the string          IL Equivalence        LD message  ASCII 1  ST FirstChr  CHAR  char  Code Q  Arguments   Code INT code in set  0    255   Q MSG one character string  the character has the ASCII code given in input Code   ASCII code is used modulo 256   Description     Gives a one character message string from a given ASCII code           FBD program using  CHAR  block                value char  48 code a Display                                                                ST Equivalence       Display    CHAR   value   48         value is in set  0  9          48 is the ascii code of  0          result is one character string from  0  to  9           IL Equivalence        LD value  ADD 48  CHAR   ST Display       B 302 ICS Triplex ISaGRAF Inc     Language Reference       DELETE    Arguments   IN  NbC  Pos    Q    Description     MSG  INT  INT    MSG       any non empty message   number of characters to be deleted  position of the first deleted character    first character of the string has position 1   modified string   empty string if Pos  lt  1   initial string if Pos  gt  IN string length   initial string if NbC  lt   0    Deletes a part of a message string        FBD program using  DELETE  block          CAT          ABCD    EFGH                     
332. log values  as the displayed information can  lead to confusions     COO         bit 31 bit 0       ICS Triplex ISaGRAF Inc  A 125    User s Guide       R    A 18 2    A 18 3    Select  move or resize items    Selecting graphic objects is needed for most of the editing commands  SpotLight  enables the selection of one or more existing objects in the chart area  To select  objects  the  select   button with an arrow  choice must be checked in the editor  toolbar  To select one object  the user simply has to click on its symbol  To select a  list of objects  drag the mouse in the drawing area to select a rectangle area  All the  graphic objects that intersect the selection rectangle are marked as  selected   A  selected object is drawn with little black squares around its graphic symbol    By making a new selection  any previously selected objects are unselected  To  remove the existing selection s   simply click with the mouse on an empty area  outside of the rectangle which borders the selected objects    To move objects  you first have to select them  Then place the mouse cursor on the  border of the selected item and drag it to other location    To resize an object  you first have to select it  Then place the mouse cursor on one  of the small rectangles displayed in the selection border  and drag it in appropriate  direction to resize the object  Pictures can also be resize  In such case  the  corresponding bitmap or metafile is stretched to fit the new specified item recta
333. made according to the current selection  You have to select a valid cell position  within the rung and hit one of the following function keys to insert        ICS Triplex ISaGRAF Inc  A 57    User s Guide       142    F2 a contact before the selected symbol  on the left   F3 a contact after the selected symbol  on the right   F4 a contact in parallel with the selected symbol   F6 a block before the selected symbol  on the left   F7 a block after the selected symbol  on the right        a block in parallel with the selected symbol    The following commands are valid when the selection is on the rung output  coil    add a coil in parallel with the selected one   add a  Jump  symbol in parallel with the selected one   add a  Return  symbol in parallel with the selected one       For parallel insertion  F4 F8   if several contacts of a rung are selected together  the  symbol is inserted in parallel with the group of selected elements  Below is an  example         F4     gt     To insert symbols in the diagram  you can also use the commands of the  Insert   menu  With the mouse  you can click on the LD toolbar  on the type of symbol you  want to insert     FO 4bE F3 JHE F4  Gel   F5  H   F6   HE F7  3H  F8  IG    F9   gt  tF9  gt        Entering symbols    To associate a variable symbol to a contact or a coil  select it and hit ENTER  With  the mouse  double click on the contact or coil  A variable selection box appears   Refer to chapter  More about program editors  in this docum
334. main characteristic of  In Line  function blocks is that the body  code  of the block is  duplicated on each use  each instance  of the block in the application  Unlike other function  blocks  the calling system and parameter passing mechanism is not applied to  In Line   function blocks  The call to an instance is replaced by the actual code of the block  This  replacement is achieved by the Quick LD compiler  Because the instanciation mechanism is  operated completely by the compiler  there is no limitation in nesting  In Line  function blocks   Therefore  an  In Line  function block may call another  In Line  FB or a standard or  C   function block     Principle      Let s imagine a very simple block with one input  one output and one internal instanciated  variable  This example is an edge detection function block     Name   FB1  Inputs   IN  boolean    input signal  Outputs   Q  boolean    set to TRUE only when IN changes from FALSE TO TRUE  Internal instance data  to be duplicated on each call    PREV  boolean    state of IN signal at the previous cycle    LD programming of the FB1 block     IN PREV Q       1_          1                    IN PREV         1                   Equivalent code in ST language   Q    IN and not PREV   PREV    IN     Below  is a Quick LD program that calls the function block     Bl ee att   B2              FB1           EI  a nae ie    B3 The masa ea    B4              FB1                 HoSseses         B 220 ICS Triplex ISaGRAF Inc     Lan
335. mation application  according to the ST language function calling interface   Functions are synchronous processes  The ISaGRAF target application is  suspended during the function execution  Function blocks associate operations and  static hidden data  For example  a  counter  function block represents the counting  operation  as well as the counting result  Functions and function blocks may be  used to complete the standard automation language capabilities  or to access  system resources     2 The parameters definition box is used to define the name and the type of  each calling or return parameter of the function or function block  The  Edit  menu  commands are used to define the parameters of the selected function or function  block  A function can have up to 31 calling parameters  and always has one return  parameter  A function block can have up to 32 parameters  with any mix of call and  return parameters  Below is the correspondence between ISaGRAF types and  C   types     BOOLEAN unsigned long unsigned 32 bit word  1 true   O false    ANALOG long signed integer 32 bit word   REAL float single precision floating value   TIMER unsigned long unsigned integer 32 bit word  unit is 1 ms   MESSAGE char  character string     When a message value is passed onto a  C  function or function block  it cannot  contain null characters  The string passed to the  C  code is null terminated    Refer to the ISaGRAF Target User s Guide for further information on how to  manage the  C  so
336. mber  They must be manually updated in the  C  source file     The file ISAWIN LIB USPNUMS gives the relationship between names and logical numbers  for the  C  functions existing in the ISaGRAF library  This is  as an example of such a file     1 funct_A  10 funct_B  16 funct_C    The file ISAWIN LIB FBLNUMS gives the relationship between names and logical numbers  for the  C  function blocks existing in the ISaGRAF library  This is as an example  of such a  file     0 fbl_A  1 fbl B  2 fbl C    The file  ISAWIN LIB CNVNUMS gives the relationship between names and logical numbers  for the conversion functions existing in the ISaGRAF library  This is  as an example  the  content of this file for the conversions of the standard library     0 SCALE   1 BCD  These files are automatically updated by the ISaGRAF Library Manager each time a  conversion  function or function block is created  renamed  copied or deleted  The ISaGRAF  Code Generator automatically generates the following files when an application is built        ICS Triplex ISaGRAF Inc  C 393    Target User s Guide        isawin apl ppp GRCNOLIB C Declaration as an array of all the  conversion functions used in the project    isawin apl ppp GRUSOLIB C Declaration as an array of all the functions    used in the project    isawin ap  ppp GRFBOLIB C Declaration as an array of all the function  blocks used in the project    ppp is the name of the ISaGRAF project        These files can be used during link operations to buil
337. mber is used through the communication link protocol  It is mainly  designed to distinguish slaves from each other when more than one target are connected to  the same host workbench or when more than one target run on the same PC  When using the  workbench debugger  make sure the workbench slave setting  see user   s guide  Managing  programs  matches the target one     Default value  The default slave number is 1 or the one in the ISaGRAF INI file     Example   WISAKER EXE  s 2    User interface  This window is display from the  Options Slave  command of the main window  of ISaGRAF NT target     ja slave Number Setup    Slave Number   ill      Using the mouse or the arrows  Up and Down  it is possible to change the value of this option   In order to use it  the ISaGRAF NT target should be restarted                Communication link and configuration   t Option    The ISaGRAF target can use a serial link or an Ethernet link for debugger communication   The name of the port is specified with the  t option  As the communication interface is  designed to be compatible with any machine  ports COM1  COM2  COM3 or COM4 can be  used for serial communication  and port numbers starting from 1100 can be used for Ethernet  communication     Default value  The default communication port is the 1100 for Ethernet and COM1 for serial  communication or the one in the ISaGRAF INI file     TO BE NOTED  The default communication link is the Ethernet     Examples   WISAKER  t COM2    WISAKER  t
338. mbol     Building the graphic layout    A chart is made of background pictures  bitmaps or metafiles   and a set of graphic  items that will be animated during debug  To enter the chart  the following  operations must be performed  Insert background pictures  insert graphic items  link  objects to the variables of the project    Background pictures    The background pictures are  bitmap    BMP  or    metafile      WWMF  files  Numbers of  pictures included in the graphic layout is not limited  Pictures can be moved or  resized in graphic layout  They do not appear in list layout  Pictures are built with  other tools  SpotLight does not include a painting tool  The  Options   Background  color  command is used to select a solid color for empty space in graphic layout     Note  Bitmaps consume a large amount of memory  It is highly recommended to  correctly size the picture  and limit the unused space inside the bitmap rectangle     Single text display    A    single text    item is a text written in a rectangle  The text displayed is the value of  the attached variable  Thus  such item can be linked to message string variable   The rectangle where text is displayed can be either filled with color or transparent   The character font used to display text is adjusted to fit the height of the rectangle  when item is resized     Unipolar and bipolar bar graphs    A bar graph is a rectangle with a colored part that represents the numerical value of  the attached variable  Optionally
339. mbol    A jump symbol always refers to a rung label  i e  the name of a rung defined  somewhere in the same LD diagram  It is placed at the end of a rung  When the  rung state is TRUE  the execution of the diagram directly jumps to this target rung   Note that backward jumps are dangerous as they may lead to a blocking of the PLC  loop in some cases     Return symbol    A return symbol is placed at the end of a rung  It indicates that the execution of the  program must be stopped if the rung state is TRUE     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           q     valuel  gt  value  waluet    2    ELSE  value  q    FALSE   END_IF      continue rung with q  state          ICS Triplex ISaGRAF Inc  A 55    User s Guide        TF 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 th
340. ments     Notes     Example     Output     If Goto    Meaning     Syntax     Arguments     Unconditional jump to a label   Goto  lt labelname gt    lt labelname gt  is the name of a label defined in the script     Backward jumps are allowed  In case of an infinite loop  script  execution is automatically broken on each loop in order to preserve  execution of ISaGRAF cycles     Print  Before Jump    Goto MyLabel   Print  Within Jump    never performed     MyLabel    Print  After Jump     Before Jump  After Jump    Conditional jump to a label  The condition is either a comparison  between two ISaGRAF variables  or a comparison between a variable  and a constant expression     If  lt varl gt  test  lt var2 gt  Goto  lt labelname gt   If  lt varl gt  test  lt constant_expr gt  Goto  lt labelname gt     Available comparison tests are      true if both members have same value    lt  gt  true if members have different values    lt  true if first member is less than second    lt   true if first member is less than or equal to  second member    gt  true if first member is greater than second    gt   true if first member is greater than or equal  to second member     lt varl gt   lt var2 gt  are valid symbols of declared application variables   or directly represented I O variables using     writing conventions      lt constant_expr gt  is a valid constant expression that matches the  type of specified variable  For Booleans   0  and  1  can be used  instead of  FALSE  and  TRUE   For 
341. mple  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  Syntax  GSTART    lt child_program gt      Operands  the specified SFC program must be a child of the one       ICS Triplex ISaGRAF Inc  B 233    Language Reference       in which the statement is written  Return value   none     The GSTART statement does not automatically start children of the child program   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   1 1  2  _JACTION P   2  _ Bo101   GSTART Schild    END_ACTION  GS2 t  gt  t 2s   2  NOT  Run_cmd    2 1  3  _JACTION P    GKILL Schild    END_ACTION   Run_cmd   3  1    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 the 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  followi
342. mple or double  is set by selecting one of these  buttons in the toolbar            Fei EAE    Insert an OR divergence or convergence   Add branches  romas Insert an AND divergence or convergence   Add branches    Adding branches to divergences    The start and stop position of each auxiliary branch is placed on the divergence  or convergence line using these buttons in the toolbar  The left corner of the  divergence or convergence must be present before inserting new branches  The  right corners have the same style  simple or double  as the main left corner  Right  corners cannot be placed if the main left corner has not been added        A 40    ICS Triplex ISaGRAF Inc     User s Guide       Fe     Feat Fett Insert an OR divergence or convergence   Add branches  ierasts Insert an AND divergence or convergence   Add branches    Inserting a macro step    This button is used to insert a macro step in the main chart  The body of the macro  step must be entered elsewhere in the same SFC program     ER FEE Body of a macro step    Macro steps must be described in the same SFC program as the main chart  A  macro step must start with a beginning step and stop with an ending step  The  sub chart described as the macro implementation must be self contained  The  macro beginning step must have the same reference as the macro step symbol of  the main branch     A 4 3 Working on an existing SFC chart    You can use either the mouse or keyboards arrows to select a rectangle area in the  c
343. munication  klPaddr port gt    gt  194 50 220 22 1100   194 0 0 1              rDDE Setup    Advise loop rate    10000 ms  Server name    ISASRY2  Topics  Items  names   s ystem Topics    lt appli_name gt  T opicltemList  For    Application    Status  imimew  Running mode   Software processed 00000  Code size  fice bytes   Data size   2542 bytes                            ICS Triplex ISaGRAF Inc  C 361    Target User s Guide       There are three topics   a  General setup     The slave number   the communication configuration  If the communication link is the Ethernet  one  in addition to the port number  the list of available IP address on the  current NT system is displayed     b  DDE setup    c  App       the advise loop rate   the DDE server name   the DDE topics and items name  This is a general information  this doesn   t  reflect the real values  In fact the fields between  lt   gt  should be replaced by  the real values    lication   The application status which is its name when there is a running application   and is the string    No application    when there is no running application   The running mode of application  which indicates if the application is  running through the software processor  It contains in this case the string      Software processed     Or if the application had been compiled with a C  compiler  It contains in this case the string     C compiled     If there is no  running application  it contains the string     No application       The code si
344. must then be selected and its parameters edited  A  variable cannot be attached to a conversion table that is not already defined     Main commands    The  Conversion tables  dialog box shows the list of defined conversion tables   and contains push buttons for main commands  to edit an existing table  define its  points   to create a new table  and also to rename or delete a table  Press OK to  quit the  Conversion tables  dialog box and save them on disk     Creating a new table    The  New  command allows the user to create a new conversion table  Up to 127  conversion tables can be created for each project  Only used tables  the ones  attached to analog variables  are inserted in the application executable code   Naming a table must conform to the following rules    e the name cannot exceed 16 characters   e the first character must be a letter   e the following characters can be letters  digits or  _  character   e the table name is case insensitive    Changing the contents of a table    The  Edit   command is used to enter the points of a table selected from the list  It  is also possible to double click on the name of the table  The  Edit  command is  automatically called when a new table is created  At least two points must be  entered for each table     Entering points of a table    The  Edit  dialog box allows the user to define the points of a conversion table  The  box shows on the left side the list of points already defined  The lower right box  shows the define
345. n  application  application  application  application  application  application    as E ee eee eee   gt  100   specific OEM error code  ask your supplier for more  details       The 3 error types correspond to the different sources of trouble         System errors    Such problems are probably due to target software or hardware  not to application setting or  to program execution    Try a hard reset  power off  of your target  and try to run other applications    These errors should be reported to your  SaGRAF support         Application errors    Such problems are due to application parameters  size or content    These errors should disappear when loading a known and previously validated application  If  the problem still appears  it becomes a system error as listed above         Program errors   Such problems are due to a particular sequence of program     These kind of error should disappear when the application is started in cycle by cycle mode   or when the critical program is stopped     Errors description     1  cannot allocate memory for run time data base    No memory available  Check the hardware        C 412 ICS Triplex ISaGRAF Inc     Target User s Guide       2  incorrect application data base  Motorola Intel  application    o         o      D         S     D  Q         3  fa   D  2  0   2  o  3  o  D  fa  x  fo   2  c     J      2   Q      3  fo   O  baa  o     D     3  3  S  v  D  D  a         gt   D    ne   ne   ne     application is generated for INTEL and do
346. n  one communication task at a time  It can be from 1 to 255 and must be different for each  communication task     Default value  The last  s specified option is used  The default value ensure compatibility  with previous  3 0  ISaGRAF versions     C 4 2 3 Running the Ethernet communication task  isanet      Communication link and configuration   t Option    The target communication task isanet uses a standard Ethernet link for debugger  communication  The port number is specified with the  t option     No Default value  If this option is not used  no communication with the target is possible  In  such a case  error number 7 may be displayed     When using the workbench debugger  make sure the workbench communication parameters   see user   s guide  Managing programs  match with the target ones    For ISaGRAF  the OS 9 target is the server and the debugger is the client  which connects  the specified port number        C 332 ICS Triplex ISaGRAF Inc     Target User s Guide       Before starting your first debug session on Ethernet  you should make sure your OS 9  Ethernet device is well configured  You may for instance send a ping to the OS 9 system       Slave number   s Option    This option specifies the target kernel slave number s  the communication task is linked to  It  can be from 1 to 255 except number 13   0D   This option can be repeated up to 4 times to  link up to 4 different kernel slaves  This slave number is used through the communication link  protocol  It is
347. n action  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     2 FC tests  A test represents a Boolean condition  A number and a name  identify a test  According to the evaluation of attached ST  LD or IL expression  the  flow is directed to  YES  or  NO  path  When programmed in ST text  a semicolon  may optionally follow the expression  When programmed in LD  the unique coil  represents the condition value     El FC sub program  The system enables the description of a hierarchised  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 it  FC programs  which call FC sub programs  are  called father program  FC programs are linked together into a main hierarchy tree        ICS Triplex ISaGRAF Inc  A 47    User s Guide       using a  father   child  relation  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 FC I O specific action  An I O specific action symbol represents actions  to be performed  As other actions  a number and a name identify an I O specific  action  The same semantic is used on standard actions and I O specific action
348. n connected I O channels  Do not check this option is  you work with connected I Os only     History of modifications  This is the global history of modifications for the project     Diary files  Diary file of each program contains user written notes plus the history of  compiler output messages referring to the program  Embedding diary files may  consume a lot of memory in target     Lists of variables and time diagrams  These are the files created during debug  and  containing lists of variable names for list or time diagram monitoring     Graphics  icons and bitmaps  This includes ISaGRAF graphics  plus all attached  icon and bitmap files  if they are located in the project directory  Warning   embedding diary files may consume a lot of memory in target     A 19 4 How zipped source are stored in the target    Embedded zipped source  EZS  is stored in generated code with resources  The  generated resource is called  EZS   If source code embedding is selected  you  cannot choose this name for another resource  Embedding source code does not  imply any limitation in resource definition  The user written resource definition file is  not affected by source embedding    Please refer to the ISaGRAF documentation about the Code Generator for further  details and information about resources        A 130    ICS Triplex ISaGRAF Inc     User s Guide       A 19 5 Memory requirements on the target    Embedded zipped source  EZS  code requires extra memory to be stored with  application 
349. n enables the user to name a function with a reserved keyword of the  C   language  or the name of an existing function of the  C  ISaGRAF libraries     Other statements can be added to the declaration function to create any specific initialization  operation relative to this function  The ISaGRAF system ensures the user that this function is  called only once when the application starts  The declaration function is called for any  integrated  C  function  even if it is not used in the programs of the ISaGRAF application  The  ISaGRAF kernel fails in a fatal error if a  C  function used in the application is not integrated  to the kernel     Before linking new functions with the kernel  the user must write another  C  source file   named  GRUSOLIB C   and insert it  with the retained functions  in the list of files for the link   The  GRUSOLIB C  only contains an array of declaration functions  This array is read during  application initialization  to establish a dynamic link with the functions written in  C   This is an  example of such a file        File  GRUSOLIB c    Example using trigonometric functions        include  lt tasyOdef h gt     required for types definition          C 374 ICS Triplex ISaGRAF Inc     Target User s Guide       extern UFP uspdef_fcl  char  name      declaration functions     extern UFP uspdef_fc2  char  name    extern UFP uspdef_fc3  char  name    extern UFP uspdef_fc4  char  name      UFP_LIST USPDEF          array of declaration functions     
350. n individual protection for selected channel  Both commands ask  you to enter a valid password so that a protection level can be attached to the  channel  Then  each time you want to change connection to a channel having  individual protection you must enter a password with sufficient priority level        Warning  If a channel is protected with a level  and the corresponding password is  removed from protection system  and if no higher level password is defined   connection to the channel cannot be changed anymore unless a new password with  sufficient level is defined        ICS Triplex ISaGRAF Inc  A 95    User s Guide       A 12 Creating conversion tables    A 12 1    A 12 2    The ISaGRAF workbench allows the user to create conversion tables  A conversion  table is a set of points used to define an analog conversion  A conversion table can  be attached to an analog input or output variable  A table creates a proportional  relationship between electrical values  read on input sensor or sent to the output  device  and physical values  used in application programming     Conversion tables are edited through a dialog box run by the  Tools   conversion   command in the ISaGRAF dictionary window   A defined conversion table can be used to filter values of any input or output analog  variable of the selected project  Attaching a conversion table to a variable is made  using commands of the ISaGRAF dictionary  the variable declaration editor  An  input or output analog variable 
351. n the PATH variable    ISaGRAF does not use any MS DOS environment variable  However  the following  statements can be added to the CONFIG SYS file        ICS Triplex ISaGRAF Inc  A 13    User s Guide       files 20  buffers 20    The ISaGRAF Workbench uses a serial port to communicate with the ISaGRAF  target PLC  The default serial port for ISaGRAF is COM1  If the mouse also uses a  serial port  choose COM2 for the mouse  so the default COM1 specification will be  valid for any new ISaGRAF applications     After updating the CONFIG SYS file  it is necessary to restart the computer for the  changes to take effect      gt  Important for Windows NT user   When the Workbench is used under Windows NT 3 51 or 4 00  the following line  has to be inserted in  WS001  section of ISA ini file in  ISAWIN EXE directory    wS001   NT 1  Isa C  ISAWIN  IsaExe C   ISAWIN EXE  IsaAp1 C   ISAWIN APL1  IsaTmp C   ISAWIN TMP  This is absolutely required for RS communication     A 1 2 Licensing    The version of ISaGRAF you just installed allows you to build control applications   You can use ISaGRAF for a trial period of 30 days before requiring licensing  When  not licensed  you cannot export IEC programs to a library  export variables   download Workbench project source code to a target  or upload source code from a  target  To have a fully operational version of the product  you need to license it     You can license ISaGRAF using either a hardware or software key  When using a  hardware ke
352. n this option is not checked  levels 1 and 2 appear together on  the same printout     Page format    The  Page format  command of the  Options  menu is used to define the main  parameters operated by the Document Generator when formatting a page  The  following parameters can be specified    e Left margin   1 or 2 centimetres  or no margin    e Page border  When this option is selected  a border is drawn around any printed    page   Page title template    The  Page Title  command of the  Options  menu is used to define the contents of  the title box printed at the bottom of any page  The standard layout of this box is as  follows           The first line of the main title  with the name of the ISaGRAF project   the current  date and the page number are automatically generated by the Document Manager   and cannot be changed    The three lines of text on the left side of the box  text1  text2  text3  and the second  line of the main title are user defined  The user also can change the logo printed in  the box on the left  To use another logo  the user has to specify the pathname of a  bitmap image file   BMP   The image can have any dimension  It will be stretched or  shrunk  according to the exact dimensions of the printed page  Clicking on the logo  area  in the dialog box  shows the new specified image  The image file must be on  the disk  at the specified directory and with the specified filename  when the  Print   command is run     Selecting character fonts    The  Text 
353. nction 8 char    Editing  for one program    Object Maximum Notes  SFC rows 600  SFC columns 20  SFC steps 4095 for the whole project  grouping steps   initial steps   beginning and ending steps  SFC transitions 4095 for the whole application  LD FBD editing 200 cols  2000 rows this is the size of the editing area  in cell units   Quick LD editing no limit limits are imposed by the PC capacity  IL labels 251 in the same IL program  Text editing 40KBytes or less according to  the system configuration    For the dictionary  for one project    Object Maximum Notes  Boolean variables 65535  Analog variables 65535 grouping integer and real variables  Timers 65535  Message variables 65535  Defined words 4095 in the same list  same range   Defined words 255 used in the same program  Conversion tables 127 used in the application  Points in one table 32 defined in the same conversion table       ICS Triplex ISaGRAF Inc  A 171    User s Guide       The limits given for maximum number of Boolean  analog or message variables  group internal  input and output variables  It also includes all hidden temporary or  variables allocated by compilers  The number of variables edited together  same  type  same scope   in the dictionary editor cannot exceed 16000  Depending on PC  configuration  the limit can be less than 16000  The application cannot run on an  ISaGRAF target version V3 21 or earlier if the total number of variable for one type  exceeds 4095  The standard  Modbus  link using netwo
354. nctions cannot be integrated in the ISaGRAF Simulator  The ISaGRAF applications  have to be simulated before using the non standard functions     Warning  Functions are synchronous operations  activated at run time by the ISaGRAF  kernel  during the application cycle  Time spent for the execution of a function is included in  the ISaGRAF application cycle timing  The user has to ensure that no  wait operation  is  programmed in a function  so that the ISaGRAF cycle processing is not unnecessarily  extended       Adding a function to the  SaGRAF library    The ISaGRAF Library Manager must be used to add a new  C  function to the ISaGRAF  library  on the Workbench side  The  New  command of the  Files  menu is used  when the       C 370 ICS Triplex ISaGRAF Inc     Target User s Guide        C  functions library is selected  When a new function has been created  its technical note  must be written  The ISaGRAF Library Manager automatically generates the frame of the  C   source code for the new function     The  Parameters  command of the  Edit  menu is used to define the call and return  parameters of the new function       Using a  C  function in an ISaGRAF project    Any integrated  C  function can be used as a standard function in the programs of an  ISaGRAF project   C  functions can be called from ST and FBD languages  and from special  statements of the SFC language     Calling a  C  function from the ST language follows the function call conventions of the  language  The
355. nd 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    102 ree motor 1    At run time  a token indicates that the step is active     Comment          Active step  Inactive step     Start motor 1          ICS Triplex ISaGRAF Inc  B 187    Language Reference       The initial situation of a 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 is started     Initial step     ie motor 1    A 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   0 0    activity of the step  Boolean value    GSnnn t       ee activation duration of the step  time value     where nnn is the reference number of the step     B 3 2 2 Transitions    A small horizontal bar that crosses the connection link represents transitions  A number   written next to the transition symbol references each transition  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
356. ndow  A 78    P    P qualifier  A 43   PO qualifier  A 44   P1 qualifier  A 44   Page  A 157   Parameter  A 30  A 150   Parameter  C function   C 371  D 427  Parameter  function block   C 379  Parameter  I O board   D 427  Parent program  D 427  Parenthesis  B 223  B 237  B 238  Parity  A 35   Parity test odd even  B 299  Password  A 24  A 95  A 145  A 158  Paste FBD  A 66   Paste FC  A 51   Paste LD  A 59       E 436    ICS Triplex ISaGRAF Inc     General Index       Paste SFC  A 41   Paste text  A 73   Paste variable  A 83   Point  A 96  A 97   Positive coil  B 216   Positive contact  B 213   POW  B 286   Power calculation  B 286   Power rail  A 54  A 55  A 62  B 210  D   427   Print  A 24  A 33  A 82  A 139  A 155   A 157     A 72  A 77   PrintTime  A 140   Priority  C 360   Priority level  NT target   C 354   Program  A 27  A 75  A 135  B 174  D   427   Program comment  A 29   Program manager  A 27   Program syntax  A 75   Project  A 23  A 152  D 427   Project descriptor  A 24  A 33   Project document  A 24  A 33  A 155   Project group  A 25   Project list  A 23  A 25   Project manager  A 23   Project separators  A 23   PROM  C 337  C 348   Protection  A 24  A 95  A 145  A 158     A 14   Protection level  A 158   Pulse  A 43   Pulse action  B 193  D 427   Pulse timing  B 275    Q    Quick LD  A 45  A 52  A 54  Quick LD editor  A 75    R    R  reset  operator  IL   B 240  R_TRIG  B 268    RAND  B 300   Random number  B 300   Range  A 80  A 82  D 427   Real  A 84  B 180  D 
357. nents  to the  target system before running applications  If the target is another PC  the new generated  ISaGRAF kernel can be loaded into the target machine by using a diskette or through a  network     es Linking with the ISaGRAF kernel libraries    Warning   The following are general information  which may not exactly correspond to your target    system   In any case you may consult the readme and  TXT files delivered on the target disk        The ISaGRAF target diskette contains many utility files to compile and link the conversions   functions and function blocks with the ISaGRAF kernel libraries        C 394 ICS Triplex ISaGRAF Inc     Target User s Guide       Two implementations exists     single task ISaGRAF  all functions are performed in the same program    multitask ISaGRAF  a separate task  or thread  is dedicated to communication    In either case  the  C  components are grouped in the same libraries  for the  C  programmer   no difference is made for single task or multitask  For a single task version  the user  C   libraries are linked to the single task  generally called isa   whereas for the multitask version  the libraries are linked to the kernel task  generally called isaker      Development Target  system system    WORKBENCH k  gt        The inner part of ISaGRAF software is independent of the hardware  It executes the IEC  languages and has its own variable database                 The first step  when making the link with the kernel  is to build libra
358. ng ae Rate eee ee O    T_TMR long  T_MSG char    32 bits   char pointer     Each field of the  str_arg  structure corresponds to one parameter of the function  The return  parameter is the last in the structure  The calling parameters appear in the structure with the  same order than the one established for the function definition  An uppercase identifier is  defined to directly have access to one parameter of the structure passed to the  C   implementation of the function  Names of the identifiers are the ones entered during the  definition of the function with the ISaGRAF Library Manager        The  C  definition file is updated each time the interface of the function is changed by using  the ISaGRAF Library Manager  This ensures a complete match between the implementation  of the function and its use in the programs of the ISaGRAF applications       Source code  Below is the standard frame of a  C  function implementation        Example of user function   Number is  255    Name is  SAMPLE         include  tasyOdef h      SaGRAF kernel common definitions      include  grus0255 h     interface definition for function 255       void USP_sample  str_arg  arg        body of the function             The following function is used for the initialization of the function and the  declaration of its implementation  It realizes the link with the ISaGRAF kernel   using the name of the function  This function is completely generated by the  ISaGRAF Library Manager        UFP uspdef_sam
359. ng 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   The GRST statement can restart frozen program    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        B 234 ICS Triplex ISaGRAF Inc     Language Reference       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   1  2  _JACTION P    GFREEZE Schild    END_ACTION                    NOT  Suspend_cmd                              3  _JACTION 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     The GRST statement automatically restarts children of the child program  Note  GRST is not in the IEC 1131 3 norm     Example  See GFREEZE  function described above       GSTATUS statement   Name  GSTATUS   Meaning  returns the current status of a 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 v
360. ng the application  code  with no symbols loaded    If no application code is available on memory  then the target is waiting for an application to  be downloaded    In order to start the target with a specific application at power up  without using the debugger  link    e A first way may consists in directly copying these files to the application backup storage  unit from the PC host where the workbench is installed  using any file transfer tool  You  can use the workbench  Tools  menu  see user   s guide  Managing programs  to ease  these manipulations     A second way may consists in storing the application code  and if necessary the  application symbol table  in a non volatile memory  like a PROM or EPROM   from files  from the PC host where the workbench is installed  with your own tools     Then at system power up  if required  for example because of faster access or breakpoint  management   you may load the application code  and if necessary the application  symbol table  from the PROM to the RAM  with your own tools     Then at ISaGRAF startup  just before tasks spawning  you must specify the address es   where the application code  and if necessary the application symbol table  is located in  memory  In that way you need to initialize the SSR global variable as following   SSRJx  1  space   address location of application code  And if necessary   SSRJx  6  space   address location of application symbol table    In that way you may write a short procedure  The SSR glo
361. ngle     Group items   dissociate groups    You can group items together so that they are managed as one item  To make a  group  select items in graphic layout and run the    Edit   Group    command  The     Edit   Dissociate    command is used to restore items of the selected group as  separated ones    A group may contain a picture  A group may also contain another group    When items are grouped  their style cannot be changed anymore  Items of the  group are still displayed  but cannot be used  with double click  to modify the value  of attached variables    A group appears at just one line in the list layout     The list layout    Fal At any time  you can swap between graphic and list layout  by pressing  this button  You can also use the    Options   List   Graphic layout    command    In the list layout  items are shown in a classical list box  The height of each item is  calculated according to its drawing style  Pictures  bitmaps and metafile  are not  visible from the list layout  A selection is available in list layout  and should be used  to set item style or change the value of a variable  Multiple selection and commands  using it are not available in this mode        fl You can re order the items in the list using the    Edit   Move in list     commands  The item to be moved should be selected in the list     Defining the item style    The graphic style and settings of an existing item can be modified  by double  clicking on its symbol in the graphic area  or by 
362. nication task identified with number 1  linked to the kernel slave 1 and  with  tyCo 1 device for the serial link    An  ISaGRAF communication task identified with number 2  linked to the kernel slave 1 and  with 1100 port number for the Ethernet communication link    The current host directory is the one where the target is installed     load isassr o module  Id  lt  RELS isassr o    load isakeret o module  You may load isakerse o when no Ethernet communication link is  needed   Id  lt  CMDS isakeret o    serial communication configuration  ISAMOD    tyCo 1   19200     System clock rate  CLKRATE   sysClkRateGet       slave registration  isa_register_slave  1     communication registration  isa_register_com  1   isa_register_com  2     File storage unit  could be skipped because default set   TSK_FUNIT        End of cycle control  could be skipped because default set   TSK_NBTCKSCHED   0    ISaGRAF kernel spawning  sp  isa_main  1         Communication task  slaves link  SlavesLink   0x01000000    ISaGRAF communication tasks spawning  sp  tst_main_ex    tyCo 1    amp SlavesLink  1   sp  tst_main_ex   1100    amp SlavesLink  2     This startup corresponds to the following figure       ICS Triplex ISaGRAF Inc  C 345    Target User s Guide       Com task  logical Nb 1    Kernel task  slave 1    Com task  logical Nb 2       You also have the choice of the following basic configurations     Kernel task Com task  slave 1 logical Nb 1       The most basic configuration consists in a
363. nnection 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    H        O   c    OTHER    input2 result  H ol  END        IL Equivalence        Idn manual_mode  jmpc other   Id input   st result   jmp END       B 218 ICS Triplex ISaGRAF Inc     Language Reference       OTHER  Id input2  st result  END     end of program       B 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 connect 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    q     valuel  gt  value 2    value1 ELSE  q    FALSE   END_IF     value              continue rung with q state      
364. nnot have more than one father     Only its father can call a child program     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  a  number and a name identify an I O specific action  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     7  nn  Name      I O specific blocks have exactly the same behavior as standard actions  This covers their  properties  ST  LD or IL programming  and connection rules              ICS Triplex ISaGRAF Inc  B 203    Language Reference         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 dat
365. ns are relative to one type  The same notation cannot be used to represent  constant expressions of different types     B 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 0     True  and  False  keywords are case insensitive   B 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  HEXADECIMAL  416   16 1A2B3C4D  OCTAL  8H  8 1756402  BINARY  2   2 1101_0001_0101_1101       ICS Triplex ISaGRAF Inc  B 179    Language Reference       The underscore character   _   may be used to separate groups of digits  It has no particular    significance  and is used to increase constant expression readability   B 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 signe
366. nserts another variable in the list  The  variable name is selected in the list of objects defined in the project dictionary  This  way the user does not have to manually enter the identifier  The variable is inserted  before the variable currently selected in the list  The list cannot contain more than  32 variables  The same variable cannot appear more than once in the same list     A When the name of a variable is highlighted in ST text  press this button in  the toolbar or run the  Edit   Spy selection  command to directly send the variable  to embedded spy list     Changing the selected variable    The  Edit   Change variable  command replaces the selected variable by another  variable  You can also use the  Cut variable  command to remove the selected  variable from the list        ICS Triplex ISaGRAF Inc  A 123    User s Guide       A 18 Debugging with SpotLight    A 18 1    123    a    it    ISaGRAF SpotLight tool allows the user to define watch lists that can be displayed  either as graphic pictures or as lists during debug  Graphic items must be linked to  the variables of the ISaGRAF project  The graphic picture is both defined and  animated  on line     To force the value of a variable  double click on the corresponding item from graphic  or list layout  or hit ENTER when it is selected    You also can lock the document  deny any modification  using the  File   Lock   command  When a document is locked  you still can force variables by double  clicking on their sy
367. nts  so that it can be totally  rebuilt using single item insertion     Inserting items in the table    When the  Edit   Insert  command is run  the  Add item  dialog box appears  It  allows the user to insert items  components of the project  into the table of contents   For an item relative to a program  use the  Program  combo box to select a  program name  Press the  Add  button to insert the selected item to the table of  contents  The same item can appear only once in the table     Options    The commands of the  Options  menu are used to define and customise the format  of the generated document  Other options are directly available from buttons of the  Document Generator window     M Front Page  NV Table of contents    When the  Font page  option is set  a header page is printed at the beginning of the  document  containing the project title and the history of printouts  When this option  is not set  the first item to be printed starts on the first page    When the  Table of contents  option is set  a table of contents is printed at the end  of the generated document    Both options are initially unchecked when the Document Generator is run from a   Print  command of an ISaGRAF editor  program  dictionary           A 156    ICS Triplex ISaGRAF Inc     User s Guide       iD  A  lk    SFC charts    The  Separate SFC levels  option directs the system to print  for each SFC  program  first the level 1 of the SFC  chart and comments   and then the level 2  programming  Whe
368. ny variable to an integer one       FBD example with  Convert to Analog  blocks                                              Ana  true m Q bres  Ana  t is46ms m Q tres  Ana  0198  in q  mres                                  B 260    ICS Triplex ISaGRAF Inc     Language Reference          ST Equivalence      bres    ANA  true     tres    ANA  t 1s46ms    mres    ANA   0198          IL equivalence        LD true   ANA   ST bres   LD t 1s46ms   ANA   ST tres   LD  0198    ANA   ST mres   REAL   Arguments   IN BOO INT    TMR   Q REAL   Description        bres is 1        tres is 1046        mres is 198       Real    any non real analog value  no message   0 0 if IN is FALSE   1 0 if IN is TRUE  number of milliseconds for a timer  equivalent number for integer analog    Convert any variable to a real one       FBD example with  Convert to Real  blocks                                              Real   true m Q bres  Real   t is46ms n Q tres  Real   198 in al ares                               ST Equivalence      bres    REAL  true     tres    REAL  t 1s46ms    ares    REAL  198         IL equivalence        LD true  REAL   ST bres   LD t 1s46ms       bres is 1 0        tres is 1046 0        ares is 198 0          ICS Triplex ISaGRAF Inc     B 261    Language Reference       Arguments   IN    Q    Description     tres  198    ares    Tmr    INT REAL any non timer value  IN  or integer part of IN if it is real   is the number of milliseconds  TIMER time value represented by IN    C
369. o5 o5   gt AD ADS   lt      lt x     O   Oo  Sg Sg  2 o  vss   a 3 on  9a 6a  O   D  ea 2 D 2    a    op 55  So So  om    h  9  amp  g 2   2p So  aa Vo  o  o    oO o   gt   gt   D     O O  x x      en   gt     D D       O O  Q Q  fe  fe   5 5  5 5  D     O O   a    fe  fe   5 5  5 5          gt   D          fe  fe   3                       5 5     a  5 5  o o  5 5  a 2a            gt   D D    33  cannot init message input board application    A message input board init has failed  Check the I O connection in the workbench and the  parameters of your message input boards     34  cannot init boolean output board application    A Boolean output board init has failed  Check the I O connection in the workbench and the    O   o0   7      3  oO  Oo   3  n  O  Q    lt    e         w   o   io   oO  feb   b     O  E      ge          ion  O   o   D   om  D    35  cannot init analog output board application    An analog output board init has failed  Check the I O connection in the workbench and the    ge   o  D  o  3  oO  Q  z  non  O  o   se  O     s  o  5  D  O  Q  O        gal     S  EF   O  D  Q  a    36  cannot init message output board application    A message output board init has failed  Check the I O connection in the workbench and the  parameters of your message output boards     37  cannot input boolean board application     gt   5     3  3  s  5  D  o  o  to   D  5  a      2   D  O  Q   D  2               f      fp   o      5  a  v  ius       io   D  D  5  5         S  T  fe 
370. ock  Va asi anna virtual address of the C function block instance  inst_name           name of the C function block instance  fb_name              name of the reference C function block    A 26 6 Limits of ISaGRAF  LARGE   WDL  workbench    There are some limitations for the objects used in the ISaGRAF Workbench  Of  course  many other practical limits are due to the configuration of the computer  used  available memory and disk space   and the capabilities of the ISaGRAF target  system  available memory  available hardware and software resources      The  following numbers absolute limits that cannot be exceeded     For a project        Object Maximum Notes  Programs 255 grouping main   sub and child programs  Levels in the hierarchy 20  The number of projects installed on the Workbench is only limited by the available  space on the hard disk   A 170 ICS Triplex ISaGRAF Inc     User s Guide        a For names   Name for  Maximum Notes  Project 8 char  Program 8 char  Variable 32 char   60 characters for comment  Defined word label 16 char  Defined equivalence 255 char   60 characters for comment  Conversion table 16 char  List of variables 16 char  function   f block  lib  8 char this applies to C functions     C function blocks   or functions written in IEC languages  function parameter  lib  16 char this applies to C functions    C function blocks   or functions written in IEC languages    IO board 8 char  IO configuration 8 char  Board oem parameter 16 char  Conversion fu
371. ode  where those variables are used  The cross references are very useful for a global  view of one variable life cycle  They help localise side effects  and reduce the time  to understand the project during the maintenance  The cross references may also  be used for a global view of the complete dictionary of a project  so unused  variables are easily found and the complexity of the project measured    The list on the left shows the declared objects of the project  programs  variables  and defined words   and the library elements  functions and function blocks   referenced in the project  The list on the right shows the occurrences in the  programs of the object currently selected in the first list    The description of an occurrence includes the program name  the number of the FC  or SFC step  transition or test  plus line number for text languages or co ordinates  for LD or FBD diagrams  For quick LD diagrams  the description is completed with  the number of the rung  If the variable is used as an output  on a coil  the rung  number is followed by a star       character    Set the  Show unused variables  option from the  Options  menu to display also  in main list variables that are not used in the application programs    When performing a cross reference search for variables  you can search for a  specific varaible by typing its name and clicking OK or search for all variables by  clicking All          Object type selection  Because a project can group a huge number of de
372. ogram called its owner program    Target ISaGRAF target machine  which supports the ISaGRAF kernel software    Target Set of the operations executed each time the ISaGRAF target system is   cycle activated  The cycles are triggered with programmable cycle timing    Technical Users guide for an element of the ISaGRAF libraries  C function or function   note block  conversion function or I O board   The designer of the element writes the  technical note    Test  FC   Also called decision  Flow chart symbol attached to a Boolean expression  The  flow is directed to either YES or NO symbol output depending on the state of  the expression    Timer Type of variables  Such variables contain time values  and can be automatically  refreshed by the ISaGRAF system at run time    Token Graphical marker used to show the active steps of a SFC program     SFC    Toolbox Small child window of an graphic editing tool window  which groups the main  buttons for the selection of the graphic components    Top level Program put at the top of the hierarchy tree  A top level program is activated by   program the system    Transition Basic graphic SFC component  A transition represents the condition between  different SFC steps  A number references a transition  A Boolean condition is  attached to each transition    D 428 ICS Triplex ISaGRAF Inc     Glossary       Type Class of variables  which have the same format  Basic types are Boolean   analog  timer and message     Validity of a Attribute of a 
373. ogrammed in LD  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        B 202 ICS Triplex ISaGRAF Inc     Language Reference         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     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 number and a name  as other programs  functions or function blocks identify a Flow Chart  sub program  Below is the drawing of a  sub program call  symbol      rsr      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     Achild of a program ca
374. ompiling  and the ISaGRAF  C  libraries required for  LINK operations     A 26 5 Application symbols    Each object of an ISaGRAF application is referenced by a name  entered during  variable declaration  and an internal virtual address  calculated by the code  generator  The virtual address of a variable is not its network address entered  during the declaration of the variable  Virtual addresses are used for communication  work  and special  C  applications using the OEM option  When the ISaGRAF code  generator is run  it makes an ASCII file with the logical correspondence between  names and virtual addresses for all the objects  variable  programs  steps     of the  project  This file can be easily interrogated for information about the ISaGRAF static  database from any user s application  The file is named  APPLI TST  and is located  in the directory of the ISaGRAF project   ISAWIN APL proname   proname is the  name of the project   This section describes the detailed format of the  APPLI TST   file  The main notations used for the following descriptions  is shown below     VA virtual address  ATTR attribute of a variable  USP  C  function    Possible values for the attributes of a variable are shown below  Such values occur  in the  attributes  fields      X internal variable   C read only internal variable   I input variable       A 166    ICS Triplex ISaGRAF Inc     User s Guide        0 output variable    All the numbers  except virtual addresses  are expressed as dec
375. on    The ISaGRAF workbench generates the source code file when a new library  element is created  It also creates and updates the source header  based on the  parameter definition  The programmer can use the ISaGRAF text editor to complete  the source code file     Archiving library elements       The  Tools   Archive  menu command runs the ISaGRAF archive manager to save  or restore library elements  You first need to select a library before running the   Archive command   The archive manager shows list of elements for only one  library at a time   A 22 2 I O configuration  The ISaGRAF 1 O configuration library provides an easy way to initialise new  ISaGRAF projects with pre defined I O configuration  An I O configuration defines   e a set of I O boards  e default values for I O boards parameters  e default names for I O channels  When a new ISaGRAF project is created with a library I O configuration  the  corresponding I O connection is automatically set  and the I O variables  A 146 ICS Triplex ISaGRAF Inc     User s Guide       corresponding to channel names are automatically declared in the project  dictionary     The definition of an I O configuration is made with the ISaGRAF I O  Connection tool  the same tool used within a project   Refer to the  I O Connection   section in this manual for further information about how to use this tool  When  inserting a new I O board in the configuration  all the channels of the new board are  declared with standard default names  
376. on   e Execute the top level programs of the SEQUENTIAL section   e Execute the top level programs of the END section   e  Refresh outputs     The programs of the  Begin  or  End  sections describe cyclic operations  They are  not dependent on Time  The programs of the  Sequential  section describe  sequential operations  where the Time variable explicitly appears to distinguish  basic operations  The main programs of the  Begin  section are systematically  executed at the beginning of each run time cycle  The main programs of the  End   section are systematically executed at the end of each run time cycle  The main  programs of the  Sequential  section are executed on the basis of the SFC or FC  rules and must be written in SFC or FC language  The programs of the cyclic  sections cannot be described in the SFC or FC language  Any program of any  section may own one or more sub programs     a Functions and function blocks    Any program of any section in the project can call the programs of the  Functions   section  A function is an algorithm that processes one output value from several  input values  A function algorithm only works with volatile intermediate variables   erased from one call to the other  This implies that a function should never call a  function block  A program of the  Functions  section cannot be described in the  SFC or FC language        ICS Triplex ISaGRAF Inc  A 27    User s Guide          Unlike functions   Function blocks  associate an algorithm work
377. on  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        ICS Triplex ISaGRAF Inc  B 175    Language Reference       programs  they are not dedicated to one father program  A 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 program 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 
378. ons     The conversion   C  function or function block must be precisely defined in the technical note   so that the automation programmer can really use it as a packaged ISaGRAF function  For a   C  function  the technical note must describe     O the detailed function processed by the function   O the complete description of its calling parameters   QO the meaning of its return value   O the detailed typing of its calling parameters and return value  Q the application context    For a  C  function block  the technical note must describe     O the detailed function processed by the block activation function  O the complete description of its calling parameters   QO  the meaning of its return parameters   O the detailed typing of its calling and return parameters   Q the application context    For a conversion function  the technical note must describe   O the exact meaning of the conversion when used with an input variable    O the exact meaning of the conversion when used with an output variable  O the limits of the values the conversion can process       Technical notes may also contain information about     O the complete identification of the conversion  function or function block  Q any information about its maintenance and updates   Q the supported target system   O the special multitasking features   O the required system services  memory  drivers          C 7 2  C  Conversion functions    The ISaGRAF Workbench includes a linear conversion utility to carry out simple 
379. onvert any analog variable to a timer one       FBD example with  Convert to Timer  blocks                                                    Tmr  1256 N q  ares  Tmr  1256 3 N o  rres     ST Equivalence      ares    TMR  1256      ares    t 1s256ms     rres    TMR  1256 3     rres    t 1s256ms        IL equivalence      LD 1256  TMR  ST ares  LD 1256 3  TMR  ST rres  MSG  Msg  IN Q  Arguments   IN BOO   B 262 ICS Triplex ISaGRAF Inc     Language Reference       INT REA any non message value  Q MSG    false    or  true  if IN is a Boolean  decimal representation if IN is an analog    Description   Convert any variable to a message one       FBD example with  Convert to Message  blocks             bres       true    125 ares       ST Equivalence      bres    MSG  true      bres is  TRUE      ares    MSG  125      ares is  125                                                        IL equivalence        LD true  MSG  ST bres  LD 125  MSG  ST ares  CAT    CAT    Note  For this operator  the number of its inputs can be extended to more than two     Arguments    inputs  MSG  addition of all message length must not exceed output  message capacity   output MSG concatenation of the input messages  Description     Concat several messages into one       FBD example with  Message Concatenation  blocks     CAT             Mr                                        Jones  myname                               ST Equivalence  use the   operator     myname      Mr            Jones           IC
380. optional        B 192 ICS Triplex ISaGRAF Inc     Language Reference       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 OUTPUT or an INTERNAL  The following SFC  programming leads to the following behavior     GS10 X     step activity              Bdirect  __   Binvert      Bset             Breset             Example of Boolean actions        SFC program using BOOLEAN actions             1  led1 R   led4 S   group12 R                  a         2 Hled1  N   group12  S      GS2 t gt  t Hs           3 Hiedz   G83   gt  t 2s        wj       4  led3  group12  R    a GS4 t  gt  t 1s                       re  VV  2   B 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          ICS Triplex ISaGRAF Inc  B 193    Language Reference          ST statements     END_ACTION      The following shows the results of a pulse action     Step activity    Execution    Example of pulse action      A
381. or  more details on the SFC language    Oriented lines join SFC components  The default orientation of a line is up to down   These are the basic graphic components used to build a SFC chart     A ETE EE Initial step   oO ESE Step     evene ain tee Transition   L E Jump to a step      TAA Macro step   E a dist Macro beginning step  Oo E E EAA Macro ending step    The SFC programming is usually separated into two different levels  The Level 1  shows the graphic chart  reference numbers of the steps and the transitions  and  comments attached to the steps and the transitions  The Level 2 is the ST or IL  programming of the actions within the steps  or the conditions attached to the  transitions  Actions or conditions may refer to sub programs written in other  languages  FBD  LD  ST or IL   Below is an example of level 1 and level 2  programming        ICS Triplex ISaGRAF Inc  A 37    User s Guide       Level 1  Level 2     Action  P    MixLevel    10   End_action             Mixing done       MixLevel  gt  100     The level 2 programming of a step is entered in a text editor  It can include action  blocks programmed in ST or IL  The level 2 programming of a transition can be  entered either in IL or ST text languages  or with Quick LD editor       Divergences and convergences    Divergences and convergences are used to represent multiple links between steps  and transitions  Simple divergences or convergences represent different inclusive  possibilities between different sub p
382. ore the selected project  it is moved with the  project     A 2 1 Creating and working with projects    O    The commands of the project manager menu are used to create new projects  edit  them and manage existing projects     Creating a new project    To create a new project  first enter its name  An empty project is then created  with  no object in it  An I O configuration can be attached to the new created project  This  I O configuration must be defined in library  If a configuration is chosen  ISaGRAF  will automatically set up the I O connection and declare the corresponding   O  variables in the new project dictionary  When creating or renaming a project  you  have to conform the following naming rules    e name cannot exceed 8 characters   e the first character must be a letter   e the following characters can be letters  digits or underscore character   e the project s name is case insensitive   When a project is created  use the  Edit   Set comment text  command to enter  the text to be displayed with the project name in the list        ICS Triplex ISaGRAF Inc  A 23    User s Guide       Editing the project descriptor    The  Project   Project descriptor  command is used to edit the project text  descriptor  This document fully identifies the project from the others on the project  list  The project descriptor can also be used to record any remarks during the  project lifetime     Editing project   The  File   Open  command opens the Program Management window for th
383. orized  instruction or variable type     16  cannot answer read data request system    A communication error is detected answering specific  SaGRAF Modbus request function  code 18  file read   Check connection and system configuration on both target and master  sides     17  cannot answer write data request system    A communication error is detected answering specific  SaGRAF Modbus request function  code 17  file write   Check connection and system configuration on both target and master  sides     18  cannot answer debugger session request system    A communication error is detected answering a debugger request  Check connection and  system configuration on both target and master sides     19  cannot answer modbus request system    A communication error is detected answering a Modbus request  Check connection and  system configuration on both target and master sides        C 414 ICS Triplex ISaGRAF Inc     Target User s Guide       20  cannot answer debugger application request system    A communication error is detected answering a debugger request  Check connection and  system configuration on both target and master sides     21  cannot answer debugger system    A communication error is detected answering a debugger request  Check connection and  system configuration on both target and master sides     23  unknown request code system     gt   Qa  o   o     Q  Q  o   3      o   2  G  D  Oo     3  o   pa  D  n  J  o   n  D  S  n  D    24  Ethernet communication error syst
384. osition   first valid position is 1   Q MSG modified string  empty string if Pos  lt   0  concatenation of both strings if Pos is greater than the  length of the IN string  B 304 ICS Triplex ISaGRAF Inc     Language Reference       Description   Inserts a sub string in a message string at a given position        FBD program using  INSERT  block           Mr JONES    Franck    4                                        MyName             ST Equivalence      MyName    INSERT     Mr JONES    Frank    4       MyName is  Mr Frank JONES           IL Equivalence        LD    Mr JONES   INSERT    Frank   4  ST MyName  LEFT  left  IN  NbC Q  Arguments   IN MSG any non empty string  NbC INT Number of characters to be extracted  cannot be greater than the length of the IN string  Q MSG left part of the IN string  its length   NbC   empty string if NbC  lt   0  complete IN string if NbC  gt   IN string length  Description   Extracts the left part of a message string  The number of characters to be extracted is  given        FBD program using  LEFT  and  RIGHT  blocks     right     12345678  IN  4   mc ql CAT    left complete_string                                                             ST Equivalence      complete_string    RIGHT   12345678   4    LEFT   12345678   4       complete_string is  56781234        ICS Triplex ISaGRAF Inc  B 305    Language Reference       the value issued from RIGHT call is  5678   the value issued from LEFT call is  1234              IL Equivalence  First 
385. ot used  no communication with the target is possible  In  such a case  error number 7 may be displayed     Communication using an Ethernet link is not available with isatst task implementation     The serial link device is opened in binary data transfer mode  no control characters  no  XON XOFF   Other communication parameters have to be set before starting ISaGRAF  so  that the user is totally free to use the parameters needed  When using the workbench  debugger  make sure the workbench communication parameters  see user   s guide  Managing  programs  match with the target ones   Example    xmode  t0 baud 19200   Sets up communication baud rate to 19200 baud on  t0 device      Slave number   s Option    This option specifies the target kernel slave number s  the communication task is linked to  It  can be from 1 to 255 except number 13   0D   This option can be repeated up to 4 times to  link up to 4 different kernel slaves  This slave number is used through the communication link  protocol  It is needed to distinguish slaves from each other when more than one target are  running  When using the workbench debugger  make sure the workbench slave parameter   see users guide  Managing programs  matches with an existing target  kernel and  communication tasks      Default value  The default slave number is 1  same as the workbench one        Communication task logical number   c Option    This option specifies the communication task logical number  It is used to manage more tha
386. other description fields for a Boolean variable           Attribute          c cess Specifies an internal  constant  input or output variable     False  string         String used for false value at debug time       True    string                 String used for true value at debug time    Set to true at init             The initial value is TRUE if this option is checked   otherwise the initial value is FALSE    E  These are other description fields for an integer or real variable    Attribute         Specifies an internal  constant  input or output variable    Form  t ssrin Specifies an integer or real  floating  variable  Display  format used during debug can be selected    Unit string    String used to identify the physical unit at debug time    Conversion         c cceeeee Name of the conversion table or conversion function  attached to the variable  for input or output variables only    Initial value              ce Initial value of the variable  must have the same format as    the variable   If not specified  the initial value is 0        A 84    ICS Triplex ISaGRAF Inc     User s Guide       A 10 4          These are other description fields for a timer variable   Attribute    cesses Specifies an internal or constant variable   Initial value           cee Initial value of the variable  time value   If not specified     the initial value is time Os     These are other description fields for a message variable     Attribute    cesses Specifies an internal  constant  inp
387. ould be used  The read value is a 16 bit integer  ranging from  32768 up to  32767  On the target side  Analog variables are 32 bits  therefore  a value  on the target  over the 16 bits range  positive or negative  will be read with the  maximum 16 bits range value  positive or negative      Real variables cannot be accessed with a Modbus request     Warning   The ISaGRAF implementation does not manage the error codes such as    unknown modbus    address        Notations   slv slave number  nbw number of words       C 400 ICS Triplex ISaGRAF Inc     Target User s Guide       nbb  nbi  addH    addL  vH  vL   V  bfd  crcH  ercL    number of bytes   number of bits   network address  High  Byte    network address  Low Byte   value  High Byte    value  Low Byte    Byte Value   Bit field  nbb Bytes   checksum  High Byte   checksum  Low byte     FUNCTION 1  read N bits    Read nbi bits  Booleans  starting from network address addH addL     o1 JaddH _Jaddt_  00  nbi  crch  crel    sz     o1  nbb  ofa          Byte 1 Byte nbb    bfd is a bit field of nbb Bytes with the following format     Bit 8 Bit 1    Byte 2    Bit nbi    Byte nbb  X xxx  l    Bit 1 correspond to the value of the variable at addH addL network address   Bit nbi correspond to the value of the variable at addH addL   nbi  1 network address   X means undefined value     FUNCTION 3  read N words    Read nbw words starting from network address addH addL      Question  siv  03 JaddH  add  00 _  nbw  crch  crel     Answer 
388. ower rail           Horizontal connection line           Vertical connection line           Multiple connection lines  all connected together            Contact associated with a variable             Coil associated to an output or to an internal variable    B 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     ___           a  ba Lal er                LD diagram graphic symbols are connected to power rails or to other symbols by connection  lines  Connection lines are horizontal or vertical        B 210    ICS Triplex ISaGRAF Inc     Language Reference       Horizontal connection lines          Yee      Ka    Vertical   Nos Vertical connection    connection line with OR meaning                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     B 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 Boolean state of the extremities of a multiple  connection follows logic rules     A multiple connection on the left combines more than one horizontal lines conn
389. ows the different items  data or functions  which can be  protected  and current protection level attached to either  read access  or  full       A 158    ICS Triplex ISaGRAF Inc     User s Guide       access  permissions  Assigning a protection level to  read  permission enables you  to prevent users without sufficient permission even to open or print a document   Double click on a line in the lower list to set permissions for the selected item or  data  The following box is open     Permissions Ed    History of modifications        Full access   00  psw0 ha    Read access     free access  ha    Both permissions can be set either to  free access   or to a protection level defined  by a password  Full access permission cannot be attached to a level with less  priority than the one selected for read access    Note that for some documents  naturally visible when using ISaGRAF Workbench   such as project descriptor  read access cannot be protected with a password       Accessing protected data    No password or user s name is asked when the Workbench is started  Each time a  user wants to have access to a protected data or function  he must enter the  required password in a dialog box    If the user enters the required password  or a password attached to a higher access  level   he can continue normally  Each time a password is entered by the user  it is  stored in memory  so the user will not have to enter it again later  Stored passwords  are held each time that an ISaGRAF too
390. patible with  any machine  ports COM1  COM2 or COM3 can be used  depending on the BIOS version     No Default value  If this option is not used  no communication with the target is possible  In  such a case  error number 7 may be displayed     Communication using an Ethernet link is not available with DOS ISaGRAF target  Ask your  supplier for special implementation     The communication parameters have to be set before starting ISaGRAF  so that the user is  totally free to use the parameters needed  When using the workbench debugger  make sure  the workbench communication parameters  see user   s guide  Managing programs  match with  the target ones     Example   MODE COM1 9600 N 8 1    Sets up communication parameters to the following values   baud rate is 9600  no parity check  8 bits of data  1 stop bit    Note that on some BIOS versions  the default workbench setting with 19200 baud is not  authorized    ICS Triplex ISaGRAF Inc  provides the ISAMOD EXE utility to set the workbench parameters   ISAMOD COM1   Is equivalent to MODE COM1 19200 N 8 1      Slave number   s Option    This option specifies the target slave number  It can be from 1 to 255 except number 13    0D   This slave number is used through the communication link protocol  It is mainly  designed to distinguish slaves from each other when more than one target are connected  together  When using the workbench debugger  make sure the workbench slave parameter   see user   s guide  Managing programs  matches wi
391. perated 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  7         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  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 assignment of the return value for the sub   program  returned to the calling program         B 206 ICS Triplex ISaGRAF Inc     Language Reference 
392. piler is automatically run when the  application code is built  This section explains the syntax of this file  The resource  definition file uses lexical rules of the ST language  Comments  beginning with       and ending with      characters can be inserted anywhere in the text  Strings are  delimited by single apostrophes  Refer to the second part of this manual for more  explanations about the lexical formats used to enter numerical values     Language reference    Below is the list of keywords and statements used in a resource definition  file     ULONGDATA    Meaning  Specifies a resource  which is a list of integer values  Values are  stored in target code as unsigned 32 bit integers  Values are stored in  the order specified in the resource definition file  Values must be       A 102    ICS Triplex ISaGRAF Inc     User s Guide       separated by comas  The name of the resource cannot exceed 15  characters     Syntax  ULONGDATA   lt resource name gt    BEGIN     target selection        list of values     END    Example  ULongData  MYDATA     Begin   0   1  100 000     decimal      16 A0B1  2 1011 0101    hexadecimal  binary     End    VARLIST    Meaning  Specifies a resource which is a list of variable addresses  Variables  are identified by their name in the resource definition file  Variable  addresses are stored in target code as unsigned 16 bit integers   Addresses are stored in the order specified in the resource definition  file  Variables must be separated by com
393. ple  char  name           ICS Triplex ISaGRAF Inc  C 373    Target User s Guide       strcpy  name   SAMPLE       gives the name of the function     return  USP_sample      returns the implementation function               end of file       The  TASYODEF H  include file from the ISaGRAF kernel is required for system dependent  definitions  It also contains the definition of the UFP type  which represents a pointer to a void  function  and is used for the declaration function       Links between projects and  C  implementation    The logical link between the implementation of a  C  function and its use in the programs of  an ISaGRAF project is made with the name of the function  A  declaration  function is added  to the  C  source code of the function  This function is called only once when the application  starts  and indicates to the ISaGRAF kernel the  C  function name  which corresponds to the  implemented function  This is the standard format of such a declaration function     UFP uspdef_xxx  char  name        strepy  name   XXX       gives the name of the function     return  USP_xxx      returns the implementation function                xxx is the name of the function        The name of the  C  function  used for strcpy statement must be written in uppercase  It  must be written in lowercase in the name of the implementation function and in the name of  the declaration function  Using the  USP_  and  uspdef_  prefixes for implementation function  and definition functio
394. plicitly 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 has 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   B 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 a 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_cmd      appl_timer    tmr  ana_timeprog   100         Calle
395. ptions are saved and retrieved according to the following diagram                 There is no option There is at least one There is a slave number and  in the command line      option inthe command      at least one other options in   line but no slave number the command line    The ISaGRAF NT target will use    The ISaGRAF NT target will use    The ISaGRAF NT target will use  the default set of options  the the default set of options  the the set of options associated with  ISaGRAF section of the ISaGRAF section of the the slave number  the ISaGRAFs  ISaGRAF INI file  ISaGRAF INI file  taking into section of the ISaGRAF INI file    account the command line  where    s    is the slave number           Alt F4 or Exit Alt F4 or Exit Alt F4 or Exit  application application application       The ISaGRAF NT target will The ISaGRAF NT target will not    The ISaGRAF NT target will save       save the options into the save the options into the default    the options into the set of options  default set of options  the set of options  the ISaGRAF associated with the slave number  ISaGRAF section of the section of the ISaGRAF INI file      the ISaGRAFs section of the  ISaGRAF INI file  ISaGRAF INI file           Note that ISAGRAF INI file is saved in the current working directory        C 350 ICS Triplex ISaGRAF Inc     Target User s Guide         gt  Slave number   s Option    This option specifies the target slave number  It can be from 1 to 255 except number 13    0D   This slave nu
396. ptions noen em ass Hitech ona eel A 60  A 6 5 On line help  oiai e r A EREE ER E R A 61  A 7 Using the FBD LD editor     sseseeesesesseeseeoesoeseeeoesereorseeoesereorseeoesoreeseoesee A 62  A 7 1 Basics of the FBD LD languages   0        ccesseecesseeceeeeeeeeeseenseeneeees A 62  A 7 2 Entering an FBD diagram          ceccscesseesceesceeseeeeceteceseenseenteeeeeseenes A 65  A 7 3 Working on an existing diagram        cceeceesseeceeeceseceseeeseeeseeeeeseeses A 66  A 7 4 Display Options vc  secs tek eee eo nos adn oR a os A 68  A 7 5 Styles and modification tracking             cecceseesceeeceseeeeeeseeeeenseenees A 70  A 7 6 On lin   helpet i ieee aves edeivsnscshatees cata teens NE RE A 71  A 7 7 Printing an FBD diagram          cceecccseesseecseesceeseeeeeeseeeseensecseeeeeeneeees A 72  A8 Using the text editor            ccccssscsssssscesscssscssssssssssesesesscsssesesnsessssesees A 73  A 8 1 Editing commands              cesccsceeseesseeeeeeeeeeeeeseceseenseenseensecseeeeeeneeses A 73  A 8 2 Syntax Colori E 2 ecco sacestte a Gee en EAEE ES A 73  A 8 3 QOPUOMS ses 30356  wide e Ra Rein ee nace a A A 74  A D More about program editors             ccsccsssescescssscsssssscssesssessessseesees A 75  A 9 1 Calling other ISaGRAF tools          cceeceescesecesceseceeeceeensecseeeeeeseeees A 75  A 9 2 Parameters of the programm            cccccceesseesseesceesceeeceseceseensecseeeaeeeneeees A 75  A 9 3 Other commands of the  File  menu           eee eeeeeceeeeeceeeereeseeeeeneees
397. put operations in the application program tie directly to corresponding  input or output conditions of the actual field I O devices  In Virtual Mode  I O  variables are processed exactly as internal variables  They can be read or updated  by the debugger  so that the user can simulate the I O processing  but no real world  connection is made     Technical notes    The  Tools   Technical note  command displays the on line user s guide of the  selected board or complex equipment  The hardware supplier of the I O board writes  the board technical note  It contains all the information about I O board  management  It also describes the meaning of its parameters     Removing connected variables    The  Tools   Free board channels  command disconnects all the I O variables  already connected on the selected board        A 92    ICS Triplex ISaGRAF Inc     User s Guide         Defining comments for free channels    The  Tools   Free board channels  command disconnects all the I O variables  already connected on the selected board     A 11 2 Setting board parameters    To set the value of a board parameter  the user has to double click on its name in  the list on the right  It is also possible to select  highlight  it and choose the  Set  channel parameter  command of the  Edit  menu  Parameters are listed at the  beginning of the list  The following icon is used to represent them in the list      B000  L n  Board parameter  The meaning and input format of the parameter are designed b
398. r       ANA_ VALUE   parameter_value      for a real integer parameter       REAL VALUE   parameter_value      for a time parameter       TMR_ VALUE   parameter_value      for a string parameter      strepy   MSG_VALUE  parameter_value      The ISaGRAF Library Manager automatically generates the  C  source code frame of this  service when the function block is created        C 386 ICS Triplex ISaGRAF Inc     Target User s Guide       e Example of  C  source file  Below is the standard frame of a  C  function block implementation        function block  xxx is the name of the function block         include  lt tasyOdef h gt    include  lt grfbOnnn h gt     nnn is the number of the f block in library          structure of hidden data for each instance of the block     typedef struct        fields definition       str_data        initialization service  returns the size of needed hidden data     word FBINIT_xxx  uint16 hinstance             return  sizeof  str_data          activation service  processes the calling parameters     void FBACT_xxx  uint16 hinstance  str_data  data  str_arg  arg             Pes         cast operation used to copy the value of a return parameter      define BOO _ VALUE   T_BOO   value     define ANA VALUE   T_ANA   value     define REAL VALUE   T_REAL   value     define TMR VALUE   T_TMR   value     define MSG VALUE   T_MSG   value        return parameters read service  called for each return parameter     void FBREAD_xxx  uint16 hinstance  str_data  
399. r    1  2  3  4  5  6  7  8             ICS Triplex ISaGRAF Inc  C 363    Target User s Guide       C 7    C  programming    C 7 1 Overview    This manual is aimed at the user already having experience in ISaGRAF concepts and  Workbench tools  After developing pure automation applications using conversion  functions   C  functions and function blocks from the ICS Triplex ISaGRAF standard  libraries  it is possible to develop  user defined  conversion functions   C  functions and  function blocks  This allows the user to enhance the ISaGRAF target PLC by creating new  libraries  and to get the maximum out of the workstation flexibility and hardware platform     With a  C  development system  and with some previous experience in  C  programming  this  manual will enable the user to customize his ISaGRAF target PLC for the best possible  control  Such developments improve the target PLC performance as well as the comfort and  quality of development with the ISaGRAF Workbench for the automation programmer     Information contained in this document is not dedicated to one special target system  Some  features  however   such as multitasking capabilities  cannot be applied to some mono   tasking systems     a Standard ISaGRAF workbench features    The ISaGRAF Workbench offers many functions to manage the  C  component libraries on  the automation development side  For the automation programming  a  C  conversion   function or function block is a  black box   completely defined by i
400. r Screen  command is used to clear the window text area  The window is  automatically cleared before each code generation or syntax checking operation   The  Copy  command is used to copy the displayed text in the clipboard of  Windows  so it can be used by other applications such as ISaGRAF text editors     Viewing compiler output messages    The  Execution messages  command shows all the messages displayed during  the last  Make  or  Verify  operation on the window text area  This applies to all the  error messages     Other choices of the  Edit  menu allow the user to monitor auxiliary text files  created during syntax verification and code generation  These files are not usually  used for a common ISaGRAF project     Defining resources    The  Resources  command of the  Options  menu allows the user to  define resources  A resource is any user defined data  network configuration   hardware setting     of any format  file  list of values  which has to be merged with  the generated code  in order to be downloaded with it in the target PLC  Such data  is not directly operated by the ISaGRAF kernel  and is commonly dedicated to other  software installed on the target PLC  Refer to your hardware manual for further  information about available resources     The resource definition file    The resources are defined in a  Resource definition file  stored with  other files of the ISaGRAF project  This is a pure ASCII text file  processed by the  ISaGRAF Resource Compiler  This com
401. r cannot display more that one list of variables at a time in the same  window  However  the list editor can be run more than once  in order to spy different  lists simultaneously     Inserting variables in the list    The  Edit   Insert  command inserts another variable in the list  The variable name  is selected in the list of objects defined in the project dictionary  This way the user  does not have to manually enter the identifier  The variable is inserted before the  variable currently selected in the list  The list cannot contain more than 32 variables   The same variable cannot appear more than once in the same list     Changing the selected variable   The  Edit   Modify  command replaces the selected variable by another variable   You can also use the  Cut  command to remove the selected variable from the list   Dump display    At any time  you can swap viewing mode between list and  Dump  view  Press the   zoom  button in toolbar or use  Options   Dump  command to swap viewing mode        ICS Triplex ISaGRAF Inc  A 121    User s Guide       In  Dump  mode  only one variable value is displayed  Its value is displayed in  numerical symbolic format at the top of the window  and is also displayed in binary   dump  format  This mode allows you to spy hexadecimal value of each byte in the  variable value        ISaGRAF   RFDEMO MYLIST   List of variables  File Edit Options Help  Daa  lt 4  Q     minp    this is a text string                            IX0 7    nbeycle 00 
402. r is used to close a level 2  window     The default language for Level 2 programming is ST  Structured Text   For  transitions  level 2 programming can also be entered with Quick LD editor  Use the   ST LD  button in level 2 title bar to change the active language  This command is  valid only if the level 2 programming window is empty        A 42    ICS Triplex ISaGRAF Inc     User s Guide       STLD EX     Pa   Close Level 2 window    Change lanquage   transitions only     A single line edit box appears at the top of the level 2 window  It is used to enter a  short description text  This text will be displayed as an IEC comment in drawing of  SFC symbols  It is very useful as it is used by other commands such as  Go To      and also in the SFC printout to document SFC steps and transitions     Description  text       The  Options   Refresh  command can be used at any time when level 2 windows  are open to refresh the main SFC chart with modified level 2 programs     E Inserting a variable name    When programming in text language  press this button to select a variable declared  in the project dictionary and insert its name at the current position of the caret   When programming in Quick LD  press this button to select the variable to be  attached to the selected contact or block I O parameter     Pp Inserting a Pulse action block in step    When programming the level 2 of a step  press this button to insert the template of  a Pulse action block at the current position of t
403. r to the chapter  Using the Code  Generator  in this document for more explanations about this command        A 32    ICS Triplex ISaGRAF Inc     User s Guide         Defining resources    A  resource  is a user defined data  for example a file  which has to be merged  with the target code so it can be downloaded with it  Refer to the section  Using the  Code Generator  in this document for more explanations about the format of the  resource definition file    The definition of resources  external data to be merged with the downloaded code   accepts relative pathnames  You can use the      relative path to specify an input file  located in the project folder  This applies to both TEXTFILE and BINARYFILE  resources  for the file specified in the  FROM  statement      A 3 4 Other ISaGRAF tools    The  Project  menu groups the commands that run ISaGRAF tools for the selected  project  Refer to the corresponding chapters in this document for more information  about these tools     om Wiring I O variables    The  IO connection  command runs the ISaGRAF I O variable connection editor   This tool is used to establish the relationship between I O variables declared in the  project dictionary and corresponding I O hardware     mM Running the cross reference editor    The  Cross references  command allows the user to calculate  to view or to print  the cross references of the project  The cross references show the user all the  occurrences of each variable in the source code of the pro
404. rams  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    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        B 208 ICS Triplex ISaGRAF Inc     Language Reference          Example of an FBD program using SUB PROGRAM block                net_weight                mode  delta                                  OJH a     lt  RETURN  gt     T  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                    ICS Triplex ISaGRAF Inc  B 209    Language Reference       B 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 vertical power rails  These  are basic graphic components of an LD diagram                                                                Left vertical power rail           Right vertical p
405. raphic editor allows the user to enter complete FC  Flow  Chart  programs  with actions and tests  decisions  programmed in either ST  IL or  Quick LD language  Flow Chart is a decision diagram  which can also be used to  describe sequential operations as it enables some advanced features such as non   blocking backward jumps     A 5 1 Basics of the FC 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 tests  are oriented links representing data flow  Below are graphic components of the Flow  Chart language     ie 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       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     v FC flow links  A flow link is a line that represents a flow between two  points of the diagram  An arrow always terminates a link  Two links cannot start  from the same source connection point     E FC actions  An action symbol represents actions to be performed  A  number and a name identify a
406. rget based on  ISaGRAF systems version 3 03 to 3 21  as EZS are stored in application code as  standard resources  But embedded information cannot be uploaded in this case  as  such target does not support required communication services        ICS Triplex ISaGRAF Inc  A 131    User s Guide       A 20 Using the Diagnosis tool    The  Diagnosis Tool  is a subset under the ISaGRAF debugger tool  It  enables the end user to work on a predefined set of variables  in order to examine  and control the process  The ISaGRAF debugger is a very powerful tool  which  includes high level functions  The Diagnosis Tool provides a safe way to control the  target application for final running operations or maintenance  The ISaGRAF  Diagnosis Tool is run directly from the ISaGRAF group in Program Manager  by  double clicking on the following icon    RS    Diagnosis    The list of existing projects is displayed in a dialog box  It enables the user  to run the limited ISaGRAF debugger on an existing  already downloaded ISaGRAF  application  Pressing the  OK  button starts the limited debugger on the selected  project  Pressing the  Cancel  button closes the dialog box  The  Set up  command  is used to set up the communication link between the ISaGRAF Workbench and the  target PLC  Refer to the  Managing programs  chapter of this manual for more  information about this command     Note  The ISaGRAF Diagnosis Tool  limited debugger  cannot be used to  download  stop or update the application runn
407. rgument is a far pointer to the data structure associated to the instance  The  arg  argument  is a far pointer to the structure  which contains the value of the calling parameters  The  programmer should use the identifiers defined in the function block  C  header to have access  to the fields of the  arg  structure     The  activation  algorithm processes the calling parameters  stored in  arg  structure   and  updates the fields of the  data  structure  The following    example shows the  activation  service of the TRIG  rising edge detection  function block        definitions stored in the function block  C  header       typedef struct      calling parameters     T BOO clk     trigger input       str_arg      define CLK  arg  gt _clk      function block instance data structure       typedef struct      T_BOO prev _state     previous state of the trigger input     T_ BOO edge detect     edge value  image of return param       str_data        activation service       void FBACT trig  uint16 hinstance  str_data  data  str_arg  arg        data  gt edge_detect    T_BOO  CLK  amp  amp   data  gt prev_state      data  gt prev_state   CLK     calling parameter          C 384 ICS Triplex ISaGRAF Inc     Target User s Guide       The ISaGRAF Library Manager automatically generates the  C  source code frame of this  service when the function block is created     e Reading the return parameters   The  read  service is called each time a return parameter of a function block instance i
408. riables     9  application stopped application    This warning is produced every time the application is stopped from the debugger        ICS Triplex ISaGRAF Inc  C 413       o  D  5  a     2   C  n  D  3  n  O      fo   o    10  too many simultaneous N or P actions application  This error occurs if one of the target cycles has to execute too many non stored  pulse actions    or cyclic blocks  It is possible to locate the trouble in CC mode  The maximum number of  simultaneous actions is 2   4 per SFC program     11  too many simultaneous setting actions application    This error occurs if one of the target cycles has to execute too many setting actions  executed         gt   D          n  o  o   ne   o   o   Q   e   3  O  a      Q      lt   o   gt   vU     O  QO  oO   0    R      7   3  D  5      e   5  O  Q      o   e    lt         12  too many simultaneous resetting actions application    This error occurs if one of the target cycles has to execute too many resetting actions   executed when a step is de activated   Proceed as mentioned above     13  unknown TIC instruction application    The kernel has detected something wrong in the application code  called Target Independent  Code   in a program  There are two possible explanations      an external program is probably writing into application code  Try to locate the crash in CC  mode and make sure no IO interface has wrong parameters      your target has a reduced set of instructions  and your application uses a non auth
409. rical expression  2   3  is  replaced by  5  in the target code  When this option is not set  constant expressions  are calculated at run time      gt  When the  Suppress unused labels  option is set  the Optimiser  simplifies the system of jumps and labels of the programs  in order to suppress  unused target labels or null jumps      gt  When the  Optimise variable copying  option is set  the use of  temporary variables  used to store intermediate results  is optimised  This option is  commonly used with the  Optimise expressions  option  When this option is set   the Optimiser re uses the result of expressions and sub expressions  which are  used more than once in the program      gt  When the  Suppress unused code  option is set  the Optimiser  suppresses the code which is not significant  For example  if the following  statements are programmed   var    1  var    X    the corresponding generated  code is only   var    X        gt  When the  Optimise arithmetic operations  option is set  the Optimiser  simplifies arithmetic operations according to special operands  For example  the  expression  A   0  will be replaced by the  A   When the  Optimise Boolean  operations  option is set  the Optimiser simplifies Boolean operations according to  special operands  For example  the Boolean expression  A  amp  A  will be replaced by  TA      gt  When the  Build binary decision diagrams  option is set  the Optimiser  replaces the Boolean equations  mixing AND  OR  XOR and NOT opera
410. ries of all the conversions   functions and function blocks needed for the specific project     content    ISAUSP   GRUSOLIB object file  array of declared functions     object file of each integrated function    ISAFBL   GRFBOLIB object file  array of declared function blocks     object file of each integrated function block    ISACNV   GRCNOLIB object file  array of declared conversions     object file of each integrated conversion function       Then the programmer has to link these new libraries with other object files and libraries of the  ISaGRAF kernel  The different phases of a user  C  development integration are outlined in  the following diagram        ICS Triplex ISaGRAF Inc  C 395    Target User s Guide          gren0lib C                         gren0nnn C                              Library utility                             grusOlib C                            grusOnnn C                      1    Library utility                         grfb0lib C                            grfbOnnn C    l    Library utility                      v          isafbl Other libraries                            Link utility               isaker                isa             This is the exact list of object modules and libraries  which have to be joined during the link     To build isaker     Object Module   Object Module     Kernel library   Kernel library     User library   User library   User library   Kernel library     System libraries     To build isa     Object Module   Obj
411. riod  Q BOO Not R1  XOUT REAL integrated output  Description     Integration of a real value     If the  CYCLE  parameter value is less than the cycle timing of the ISaGRAF application  the  sampling period is the cycle timing of the application        FBD program using  INTEGRAL  block                                                        integral  manual_mode L RUN  R1  sensor value xn  init_value xo  t 100ms cyce xou controlled_value                            ST Equivalence  INTEGRAL1 instance of INTEGRAL block     INTEGRAL1 manual_mode  NOT manual_mode   sensor_value  init_value  t 100ms    controlled_value    INTEGRAL1 XOUT        IL Equivalence           B 280 ICS Triplex ISaGRAF Inc     Language Reference          LD manual_mode  ST INTEGRAL1 run  STN INTEGRAL1 R1  LD sensor_value  ST INTEGRAL1 XIN  LD init_value  ST INTEGRAL1 X0  LD t 100ms  ST INTEGRAL1 CYCLE  CAL INTEGRAL1  LD INTEGRAL1 XOUT  ST controlled_value  DERIVATE  derivate  Arguments   RUN BOO mode  TRUE normal   FALSE reset  XIN REAL input  any real analog value  CYCLE TMR sampling period  XOUT REAL differentiated output  Description     Differentiation of a real value     If the  CYCLE  parameter value is less than the cycle timing of the ISaGRAF application  the  sampling period is the cycle timing of the application        FBD program using  DERIVATE  block                          derivate  manual_mode RUN  sensor_value iN  t 100ms ovce xou derivated_value                         ST Equivalence  DERI
412. ript  A script is  described with an easy ST like text language  and is used to automate tests with the  ISaGRAF simulator    The simulation script editor is run by the  Tools   Simulation scripts  command of  the Simulator window  Below is the frame of the script editor        A 136    ICS Triplex ISaGRAF Inc     User s Guide       RFDEMO TEST   Script     OF x   File Edit Script Options Help    ODA xul   amp         if bstart   1 goto Ll a  print  bstart   0    goto L2   L1    print  bstart   1  v  Ki oil  bstart   1 A  timeprog  lt  gt  0   status  lt  gt  Stop ne    m    The upper window is a text editor where script instructions are entered  It is used as  other ISaGRAF text editors and includes high level features such as mouse  selection of a variable symbol  You can use commands of the  Options  menu to  set up tab width and select a character font    The lower window shows all the messages output when the script is run  The  separation line between windows can be freely dragged to resize windows  The  output window can be hidden during script editing  but is automatically open each  time a script is run             Editing scripts  Use the commands of the  File  menu to manage script files   New    creates a new untitled script  Open     loads an existing script from file  Save oe  saves script text and contents of output window to disk  in project  directory  Save as      0         saves script under another name    Two files are created in the ISaGRAF project direc
413. rk addresses cannot be  used if number of variables for one type exceeds 4095       IO connections   Object Maximum Notes  IO Boards 256 defined for the same application     boards or complex equipments     Number of I O boards including single boards and items of complex equipments  cannot exceed 256     IO channels 128 on the same board    For libraries    Object Maximum Notes   Functions  IEC Lang   255 installed together in the library   Function blocks    IEC lang   255 installed together in the library   C functions 255 installed together in the library   C function blocks 255 installed together in the library   function blocks   instances 4095 for the same type of function block  in the same application   Function input parameters 31 this applies to C functions and  functions written in IEC languages   Function block parameters 32 freely distributed between input and    output parameters   At least 1 output parameter    is required   Conversion function 128 installed together in the library  IO configurations 255 installed together in the library  IO boards 255 installed together in the library  Complex IO equipt  255 installed together in the library    Board oem parameters 16       A 172 ICS Triplex ISaGRAF Inc     Language Reference       B  Language Reference       ICS Triplex ISaGRAF Inc  B 173    Language Reference       B 1 Project architecture    An ISaGRAF project is divided into several programming units called programs  The  programs of the project are linke
414. rogrammed time  Q BOO If TRUE  total time is not elapsed  ET TMR current elapsed time  Description     Increase an internal timer up to a given value     Timing diagram                    B 274 ICS Triplex ISaGRAF Inc     Language Reference       TP    Arguments   IN    PT  Q  ET    Description     BOO    TMR  BOO  TMR    TP    If Rising edge  starts increasing internal timer  if not  already increasing    If FALSE and only if timer is elapsed  resets the internal  timer   Any change on IN during counting has no effect   maximum programmed time   If TRUE  timer is counting   current elapsed time    Increase an internal timer up to a given value     Timing diagram     CMP    Arguments   VAL1  VAL2  LT  EQ  GT    INT  INT  BOO  BOO  BOO       any signed integer analog value  any signed integer analog value  TRUE if val1 is Less Than val2  TRUE if val1 is Equal to val2  TRUE if val1 is Greater Than val2       ICS Triplex ISaGRAF Inc     B 275    Language Reference       Description     Compare two values  tell if they are equal  or if the first is less or greater than the second    one        FBD program using  CMP  block          CMP       level  max_level    uy     gt  1          var            varz    EQ        pump_cmd          cr                   manual_mode                                         amp   G alarm          ST Equivalence  We suppose CMP1 is an instance of CMP block     CMP 1  level  max_level    pump_cmd    CMP1 LT OR CMP1 EQ    alarm    CMP1 GT AND NOT manua
415. roject  This document can group any component   program  variable  and parameters     of the selected project  To build a specific   non complete  document  the user only has to define its table of contents     Password protection    The  Project   Set password  command enables the user to define password  protection for tools and data of the selected project  Refer to the  Password  protection  section  at the end of the first part in this manual for further information  about password levels and data protection  Passwords are only relative to the  selected project  They have no influence on other projects and ISaGRAF libraries        A 24    ICS Triplex ISaGRAF Inc     User s Guide       A 2 2 Working with several groups of projects    An ISaGRAF project corresponds to one directory on the disk  where all the project  files are store  A  Project Group  corresponds to a list of project directories grouped  together under the same root directory  A project group is identified by a name  As  default  ISaGRAF creates two project groups      Default                on   ISAWIN APL   your working area   Samples             on   ISAWIN SMP   sample applications delivered with ISaGRAF  workbench    The name of the currently selected project group is written in the toolbar  close to  the button used to select a project group     2 Default    You can also run the  File   Select project group  to select an existing group or  create a new one  The following dialog box is open     Projec
416. rom  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 horizontal lines represent single  divergences and convergences        ICS Triplex ISaGRAF Inc  B 189    Language Reference       Single divergence    r          a esa         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 example of single divergence and convergence        SFC program with single divergence and convergence             AH                                                           Run  amp  not Error A Error  1 101  2 Start Motor M1 101HAlarm         M1 started        _ Acknowledge  2 102             3  Start timer           timer  gt  t 3s                   4 Stop motor M1              M1 stopped  4       B 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 horizontal lines represent double divergences and  convergences        B 190 I
417. rs  dictionary  lists of variables  I O  connection      All windows opened during a debug session operate in  debug  mode   meaning that the editing command is disabled  Displayed program  components  steps  transitions  variables     are shown with their current run time  status or value  Double clicking on an object changes its status or value in the target  application    When running the debugger in simulation mode  communication with the  ISaGRAF target system is stopped  The debugger only communicates with the  simulator window  Because the target system does not exist in this mode  the   download    stop  or  activate  commands are not available on the debugger  menu        A 15 1 The debugger window   The debugger window only contains information about the complete application   status  It is linked to other ISaGRAF windows creating a complete interactive debug   system  Detected run time errors are displayed in the bottom area of the debugger  window  Commands from the  Options  menu are used to hide  show or clear the  list of errors    The control panel  area under the debugger menu  shows the global status of the   target application  and information about the execution cycle timing  The list of   possible target status is as follows    Logging             0 0c8 Debugger establishes communication with the target  system    Disconnected                  Debugger cannot communicate with the target system   Ensure connection cable and communication parameters  are v
418. running the    Edit   Set style     command when item is selected in graphic or list layout  The    Style    dialog box is       A 126    ICS Triplex ISaGRAF Inc     User s Guide       A 18 4    also opened when a new item is added to the document  It groups the following  pieces of information to be selected by the user     Graphic style and settings     The display style  single text  bar graph  curve     of an item can be changed  dynamically  When foreground and background colors are used  they can be  customised using the corresponding boxes  When style is    Boolean icon     the  pathname of corresponding  ICO files has to be specified  Use           buttons close to  these controls to browse icon files existing on the disk     Scale     This is the maximum value that can be displayed in bar graphs and curves  For  bipolar bar graphs and curves  the same absolute value is used for both positive  and negative axis     Variable name     When the  Name  field is the active field  pressing the       button close to edit  control enables the user to find the names of the variables already declared in the  project dictionary     Caption    A caption can be displayed closed to the graphic item in graphic layout  You can  customise the location of the caption text  top  bottom  left or right  and its contents   Caption can be any combination of the variable name and its value formatted as  text  Caption customisation has no effect on list layout     Command variable     If the 
419. s     Example  Name Attribute  Comment  Level internal internal calculated water level  Alrm1 output main alarm output    e commas and quotes    Description  Fields are separated by commas   Each field is written between quotes     Example   Name   Attribute    Comment    Level   internal   internal calculated water level    Alrm1   output    main alarm output       Keywords    The names used to identify the fields in the first imported or exported line  may be changed  by pressing the  Keyword  button  This command opens the  following dialog box        ICS Triplex ISaGRAF Inc  A 89    User s Guide       Keywords for variable import   export   x     Variable name  Comment  Address  Attribute Cancel      False    Boolean  True  string True Modify  Integer real format Format    Integer real unit string Unit Default    Integer real conversion Conversion  M    Message maximum length          The window shows the list of object fields  and the associated keywords   To modify a keyword  the user must select a field in the list and press the  Modify   button  Pressing the  Default  button restores the original list of keywords  Naming  the keywords must conform to the following rules   e the name cannot exceed 16 characters  e the first character must be a letter  e the following characters can be letters  digits or  _  character  e the same name cannot be used for different keywords    Below are the standard keywords found in ISaGRAF     Object NaMe iirinn Name  TEXt COMMENT saris
420. s    of the  document  A choice of commands allow the user to use a default table  with all the  components of the project   build a specific table  with only some components  or  move items in the table and modify it     The default list    The  Default list  command of the  Edit  menu defines a standard table of contents  for the document  which includes all the components of the project  The standard  table consists of      Project descriptor     Hierarchy tree  links between programs      Source code for any program     Diary file for any program     Common definitions     Global definitions     Local definitions for any program     Global variables     Local variables for any program       ICS Triplex ISaGRAF Inc  A 155    User s Guide       ok  I    A 24 2      Application options     I O Connection     Lists of variables     Conversion tables     Condensed cross references    Detailed cross references     Declaration summary     Network addresses map     History of modifications    The table of contents can be saved on disk using the  File   Save  command  This  command is greyed when document generator is run from an ISaGRAF editor to  print a single document     Cut and paste    Use  Edit   Cut  and  Edit   Paste  commands to move items in the list  in order to  customise the order of the table  The Document Generator allows multiple selection  so that a group of items may be cut and pasted     Clearing the table    Use  Edit   Clear  command reset the table of conte
421. s   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  I O specific blocks have exactly the same behavior as standard actions     O 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 the target point  generally the name of the target symbol   A  connector always targets a defined Flow Chart symbol  Its logical number identifies  the destination symbol     E FC comments  A comment block contains text that has no sense for the  semantic of the chart  It can be inserted anywhere on a free space of the Flow Chart  document window  and is used to document the program     A 5 2 Entering a Flow Chart    To enter a chart  you have to place elements  actions  decision tests  and  connectors     in the graphic area  and draw flow links between them     Inserting objects    To insert an object in the diagram  select the corresponding button in the toolbar  and click in the graphic area  where you want to insert it  You can either put the  element on an empty area  or insert it in a flow by clicking on a flow link  Insertion  on a link is allowed for top to bottom vertical links only
422. s  referenced in a ST or FBD program  It is used to get the value of one return parameter  The  following example shows the  read  calls executed while running a ST program        ST programming     C  implementation       FB1 is a declared instance    of the SAMPLE function block    INSTANCE    ACTIVATE DATA       FB1  high  value  low  1 0   service       high alarm    FB1 QH   low_alarm    FB1 QL  READ  any_alarm    FB1 Q  service          Because the  read  service can be called more than once in the same cycle  for the same  return parameter or the same function block instance  no special calculation has to be  performed in such a service  It only operates transfer between hidden data and the ISaGRAF  application  Below is the standard frame of the read service        cast operation used to copy the value of a return parameter        define BOO_VALUE   T_BOO   value    define ANA VALUE   T_ANA   value    define REAL VALUE   T_REAL   value    define TMR_ VALUE   T_TMR   value    define MSG_ VALUE   T_MSG   value        return parameters read service  called for each return parameter       void FBREAD xxx       xxx  is the name of the function block     uint16 hinstance     logical number of the instance      str_data  data     pointer to the instance data structure     uint16 parno     logical number of read parameter      void  value     buffer where to copy the value of the param           switch  parno     case FBLPNO XX            break   case FBLPNO_YY            bre
423. s are not allowed    normal  refers to FBs such as implemented in ISaGRAF 3 3     Calling mistakes are detected at compilation  Also  the compiler automatically ensures that  In  Line  function blocks are compiled according to the calling graph when you run a  Verify  or   Make  command      In Line  function blocks can only be defined in a project  The ISaGRAF library does not  support these function blocks        ICS Triplex ISaGRAF Inc  B 221    Language Reference       B 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     B 7 1 ST main syntax    A ST program is a list of ST statements  Each statement ends with a semicolon        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  semicolon       separator  These are basic types of ST statements       assignment
424. s border to change its size     When an element is connected to a flow link  resizing it horizontally acts on both left  and right borders  so that the element is still correctly centred on the link when  resized     Q Swapping the outputs of a test    You can swap locations of YES   NO outputs on a test  decision   To do that  simply  double click on either  Yes  or  No  marks displayed close to the test symbol           A 50 ICS Triplex ISaGRAF Inc     User s Guide       A 5 3 Working on an existing chart    The commands of the  Edit  menu are used to change or complete an existing  diagram  Most of these commands act on the elements currently selected in the  diagram       Correcting a chart    The DEL key can be used to remove the selected elements  Pending links are  deleted with selected elements  Use  Edit   Undo  command to restore elements  after a DEL command  The DEL command can also be applied to a group of  elements selected in the diagram  The  Cut    Copy    Paste  commands of the   Edit  menu are used to move or copy selected elements       Find and replace    The  Edit   Find Replace  commands can be used to find or replace text strings in  the complete program  all actions and tests programmed in ST  IL or Quick LD    The Find Replace dialog box is used to enter a text to be searched and to directly  open the programming section where the text is found     Ee Direct access to an element    The  Edit Go to  command allows the user to access a graphic element 
425. s for the file name  specified in the vH vL fields   in that case High and Low is not meaningful  and including  0 for end of string   If the file does not exist  it is created with writable   readable   executable attributes         0xF002  Change base address to the specified value  nbb should be equal to 4  The first vH vL byte corresponds to the High word of the  specified value  Any 32 bit value is accepted   All future read or write requests will use this base address  When this request is not used  the default base address value is zero         0xF004  Delete file  nbb should be equal to zero   The file will be deleted if it exists and if it is possible         Greater than 0xF004  Reserved      Less than 0xF000  Write bytes    The specified address where to write bytes is specified in addH addL  It must be less than  F000  The specified bytes  nbb bytes specified in vH vL fields where High and Low may       ICS Triplex ISaGRAF Inc  C 403    Target User s Guide       be no more meaningful  are written  in the order given  from left to right   to the previously  selected remote file name  The start address written to  is the specified address added to  the previously selected base address  If the resulting addresses access exceed the  current file size  the file is extended  You cannot reduce the file size     FUNCTION 18  read data   Question _  slv_  12  addH  adat  00 _  nbb__ ercH_ crcl_    Answer  siv_  12  nbb  v  v     Jerch  cre      The specified address where 
426. s less or equal than 1 tick or  equal to zero  then the CPU is relinquished for 1 tick to force the scheduling     The target timing accuracy correspond to the OS 9 system tick one     A specified cycle timing is commonly used to trig cycles or to yield the CPU to other tasks  running on the OS 9 system         The communication task is in sleep status while there are no incoming data through the  communication link  When needed  this task gets information on the running application  through a question answer protocol with the kernel task  The communication task asks for  a question to the kernel  At the end of the cycle  to have a synchronous application  image   the kernel gives the answer to the communication task     The ISaGRAF tasks do no modify the priority they have been given  The user is free to adjust  these priorities according to ISaGRAF task behaviors described above and its whole  application requirements    For instance  to make sure that ISaGRAF is not pre empted by a low priority task  the OS 9  task management parameters such as MIN_AGE and MAX_AGE  can be modified       Terminal mode    The target serial communication protocol recognizes a sequence of 3 carriage return  characters   0D  and then starts an OS 9 shell task  if it is available  on the serial link device   This allows to get an OS 9 shell prompt on any terminal  using the  SaGRAF target serial link     Example   From the host PC         Close the ISaGRAF debugger        Start a Windows Termina
427. s or equal to 10 ms and different from zero will  generate an cycle duration overflow error  error 62   See the following chapter for more  information     Ask your supplier for a special implementation  if your application requires more accuracy       Cycle duration and target behavior    At the end of an ISaGRAF cycle  just before starting a new one  the following algorithm is  performed   If a cycle timing is specified  from the workbench  see user   s guide  Managing  programs  then the CPU is relinquished for the remained time period  specified cycle  time   current application one   If this remained time period is negative an overflow is  generated and the CPU is relinquished for 1 tick to force the scheduling    If no cycle timing is specified  or if the remained time is less or equal than 1 tick or  equal to zero  then the CPU is relinquished for 1 tick to force the scheduling    The target timing accuracy correspond to the Windows NT system tick one     A specified cycle timing is commonly used to trig cycles or to yield the CPU to other  processes running on the Windows NT system       Exit key    While testing an application in non industrial conditions on a desktop PC  the user may wish  to stop ISaGRAF  this is done by pressing a combination of keys to prevent unexpected  stops  This key sequence is     alt   F4    One dangerous side effect of this fast exit  is that the IO board interface is not closed  Thus  the clean way for stopping your ISaGRAF target is    
428. s stopped       errors or messages are present in the output window  The centre of the icon  blinks red  To stop the blink  it possible to choose the    Acknowledge    item of  the    Messages    menu or the    Clear    item of the same menu  beware that this  item will completely erase the output window   You will find more information on  errors  in the error management and output massages chapter        C 360    ICS Triplex ISaGRAF Inc     Target User s Guide       The different states are sum up in the following table          no error errors or messages   the centre is red     CEE  seie    FaN         ISaGRAF NT target Start Stop push button     The Start Stop push button is strictly identical to the start stop function of the debugger  The  text in the push button will reflect the running state of the application  If the application is  running  the text will be    Stop     If the application is stopped  or if there is no application   the  text will be    Start       Please note that if there is no application  and the start action is requested  the push button  will toggle into the Stop mode and then it will come back to the Start mode        running  application    no application      ISaGRAF NT target  general information    With the  View   Information  command  the following dialog box gives general information on  the target configuration and on the running application          ISaGRAF NT kernel   Global Information       General Setup    Slave number    2    Com
429. sample applications    It is highly recommended that when installing ISaGRAF for the first time all  components be included  Further components can  however  be added at a later  date by re installing the ISaGRAF Workbench     The default name for the ISaGRAF main directory is   ISAWIN   This allows  ISaGRAF for Windows to be easily installed on the same disk as a version of  ISaGRAF for MS DOS  Refer to the   SaGRAF directories  section in the  Advanced  techniques  chapter for more about ISaGRAF disk architecture  Once all the  ISaGRAF files have been copied  the following group is added to your Program  Manager Window     lel Es    a       ile Edit View Help         E a x    im       Book Diagnosis Libraries Projects Report Read Me           6 object s   212KB 7    Here are the main ISaGRAF icons     Book            0 06 On line information about ISaGRAF  Diagnosis tool for end user   Library management   Project management   Report                  Standard Bug report form   Read Me              Information about the ISaGRAF new version       In case you encounter a problem  use the standard bug report form  Open  it  fill the items requested and use the File Save As menu command to save it with a  given file name  Then send this file to ICS Triplex ISaGRAF  using Fax or e mail       Updating system files    Once installation is complete  the CONFIG SYS file needs to be updated before  restarting the computer  The ISaGRAF directory pathname does not have to be  inserted i
430. seconds        converts to a timer        stores converted value in a timer          Called sub program named  SUBPRO    evaluates the analog value        given as a binary value on three Boolean inputs  inO  in1  in2 are the three Boolean input  parameters of the sub program       LD  ANA  MUL  ST  LD  ANA  ADD  MUL  ST    in2    2       result   ana  in2          result    2 ana  in2         temporary    temporary    result       int    temporary    result    2 ana  in2    ana  in   1         2       result    4 ana  in2    2 ana  in1         temporary    temporary    result          B 242    ICS Triplex ISaGRAF Inc     Language Reference       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  start_cmd  SR1 set1  stop_cmd  SR1 reset  SR1  SR1 Q1  command       FBD equivalent                                                                                    auto_mode  start_cmd  stop_cmd 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_T
431. seeetesecaeeseeneeeeeaeeateaes A 151  A 23 Using the Archive utility               cssssssssseesesssssecsssescssessessecssesenseseees A 152  A 23 1 Calling the archive manager        ss ssessseesssseseeseeeessteresseseesresersesseese A 152  A 23 2 OptbOMS en pennae iiine n E E E RER RERE TEEN A 153  A 23 3 Backup and restore          cccceccsseesseeceeeceeeceeseceseceecaeeeseeseeeeeeeerenseens A 153  ARIA Are Me TICS esaa a E A aren E A A 153       vi ICS Triplex ISaGRAF Inc     User s Guide       A 24 Printing a complete document               cscsssessesscsrssssssesssscesesssseseees A 155  A 24 1 Customising the table of contents            cccceseeseeeeeseeeeeeeeeeeeeeeeens A 155  A242    Options  A E E E E A 156   A 25 Password protection      seseeseeseeoesseseeeoeseeeoeseeoesoeeeesonsereonseeoeneeeoesoreereoes A 158   A 26 Advanced programming techniques         seseesoeseeeerseeoesoesereoesesoesereoee A 161  A 26 1 More about ISaGRAF tools      sssesseeseesseseeseesreresseeressrseesresersesseese A 161  A 26 2 Locked I Os and virtual V OS      ssessessenssesensseseesesseerssseseeseesersesseese A 161  A 26 3 PC PLC link validation 2 0 0    ccceecceseeeecneeeeeeeseeeeeeeeeeeeeeeeeeeeerens A 164  A 26 4 ISaGRAF directories          ccccecceesceesceseceseceseeeseceeeeaeeeaeeeseeeeeeereneens A 164  A 26 5 Application symbols         s eeeseseesseeeessesessresrssseeresseeresseseeseesersesseese A 166  A 26 6 Limits of ISaGRAF  LARGE   WDL  workbench                08 A 170   B
432. ser to modify the  programmed cycle timing  This time is titled as  Allowed  in the debugger control  bar window  The  Cycle to cycle  mode should be set before modifying the cycle  timing  The cycle timing is entered as an integer number in milliseconds     Remove all breakpoints    The  Control   Clear all breakpoints  command removes all the breakpoints  currently installed  encountered or still active  in the whole application  Existing  breakpoints are not automatically removed when the debugger window is closed     Unlock I O variables    The  Control   Unlock all IO variables  command unlocks all the I O variables  currently locked in the application  When an I O variable is locked  no input or       A 112    ICS Triplex ISaGRAF Inc     User s Guide       A 15 3    A 15 4    output status change is made to the corresponding I O device  Variables attached to  the I O can still be written by the application or by the debugger  Currently locked  I O variables are not automatically unlocked when the debugger window is closed     Options    The  Options  menu contains the options to control the information displayed in the  debugger window     The communication parameters    The communication timing parameters can be adjusted when the debugger is  active  Only communication time outs can be set here  Other communication  parameters  baud rate  parity     must be set from the  Debug  menu of the  Program Management window    The  Communication time out  is the time left for 
433. sia This item shows the date and time when the code has  been built    CRG riae ea This is a checksum calculated with the contents of the    table of symbols  The code generator has calculated this  number  This value depends on the contents of the  dictionary of variables     Note  The  Get version number  command is also available during simulation   In real debug mode  this command cannot be used if the target PLC is not  connected     On line modification    The  File   Update application  command enables the user to achieve  on line  modification  of the running target application  This command is detailed in further  sections of this chapter  It is not available when the debugger is used in simulation  mode     Real time mode    The  Control   Real time  command is not available when no application is active   It sets the target application in normal  real time  mode  Normal mode  the  execution cycles are triggered by the programmed cycle timing     Cycle to Cycle mode    The  Control   Cycle to cycle  command is not available when no application is  active  It sets the target application in normal  cycle to cycle  mode  In this mode   cycles are executed one by one  according to the  Execute one cycle  commands  made by the user from the debugger menu     Execute one cycle    When target is in cycle to cycle mode  the  Control   Execute one cycle   command runs the execution of one cycle     The cycle timing    The  Control   Change cycle timing  command enables the u
434. sible  even if the input focus is on another window     A 21 5 Saving and restoring input states    Using the ISaGRAF simulator  input channels are forced through manual  operations  acting on toggle buttons and edit controls of the simulation panel  You  can at any time use the following commands of the  Tools  menu to save and  restore the state of all input channels     Load input scheme Set values of input channels with values  stored in a file that has been created on disk  by  Save input scheme  command    Save input scheme Save state of input channels in a file so that  they can be restored later using the  Load  input scheme  command  File is stored in the  project directory and thus is saved with other  project files by the ISaGRAF archive utility     Note  Only named input channels  the ones having a variable connected  are    saved on disk   A 21 6 The cycle profiler    The ISaGRAF Cycle Profiler is a powerful diagnostic tool that shows how cycle time  is distributed between various programs  functions and function blocks of an  application  This tool is very useful to have a quick diagnostic on the application  performances  and leads the programmer to the parts of code  which may need  optimisations    The Cycle Profiler is run by the  Tools   Cycle Profiler  command in the menus of  the ISaGRAF Simulator window  It displays  for each program  function or function  block  the percentage of the cycle time spent to execute it        ICS Triplex ISaGRAF Inc  A 135  
435. sing  edge detection  ir bes raa Pe ea Contact with negative  falling  edge detection  1F Coils  A coil represents an action  The rung state  state of the link on the left of the coil  is  used to force a Boolean variable  The name of the variable is displayed upon the  coil symbol  ISaGRAF Quick LD editor supports the following types of coils   ae Direct coil     E T Negated coil  3  ETE  Set  action coil     AE A  Reset  action coil   f  wii inneas Coil with positive  rising  edge detection   ti  ie raaa araa Coil with negative  falling  edge detection  A 54 ICS Triplex ISaGRAF Inc     User s Guide       Su    Function blocks    A block in an LD diagram can represent a function  a function block  a sub program  or an operator  Its first input and output parameters are always connected to the  rung  Other input and output parameters are literally written outside of the block  rectangle     time  is TBapsed        In Line  Function blocks    In the Quick LD editor  you can change an edited Function Block to an  In Line   Function Block by selecting the block  then choosing In Line from the Tools menu   This command enables you to set or reset the  In Line  attribute of the edited FB   When the  In Line  attribute is set  a small title bar showing the  In Line  text is  displayed with toolbars     Rung end  right power rail     A rung ends with a right power rail  Using the Quick LD editor  the right power rail is  automatically inserted when the user places a coil     Jump sy
436. single link up to 4 different applications through  the same physical port     The kernel and communication tasks are independent and can be separately spawned  The  only requirement is that the kernel task s  has to be started first so that it initializes its system  environment and the communication task s  can link it     The ISaGRAF multitask target does not prevent the running of background processes or  interrupt driven routines     Two modules are proposed depending on communication hardware capabilities      Kernel and serial link  isakerse o   This module enable to start the kernel task s  and the serial communication task s       Kernel and serial or and Ethernet link  isakeret o   This module enable to start the kernel task s  and the serial or and Ethernet communication  task s      The way of starting ISaGRAF is the same for isakerse o and isakeret o modules  except that  for isakeret o  you can either specify a serial device name  or a port number for Ethernet link   as communication device name parameter when starting the ISaGRAF communication  task s   tst_main_ex  see below      For ISaGRAF  the VxWorks target is the server and the debugger is the client  which  connects the specified port number       Kernel s  registration    An  SaGRAF kernel is characterized by its slave number  Its value can be from 1 to 255  except number 13   0D   This slave number is used through the communication link protocol  and by the communication task s  linked to the kernel  I
437. single precision   1 sign bit   23 mantissa bits   8 exponent bits    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       ICS Triplex ISaGRAF Inc  B 183    Language Reference       Note  When a real variable is connected to an I O device  the corresponding   O driver  operates the equivalent integer value     Warning  Integer and real analog variables or constant expressions cannot be mixed in the  same analog expression     B 2 3 5 Timer variables    Timer means clock or counter  Such variables have time values and 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 
438. sion  B 251   DO  B 229  B 230   Document  A 24  A 33  A 155   Download  A 111   Dump  A 121       E 432    ICS Triplex ISaGRAF Inc     General Index       E    Edge  D 424   Edge contact  B 213   Edit project descriptor  A 24   ELSE  B 227  B 228   ELSIF  B 227   Embedded source code  A 130   EN  A 55   Enabled transition  B 199   End  A 27  A 143  B 201   End of cycle control  VxWorks   C 340   C 343   End section  D 424   END_CASE  B 228   END_FOR  B 230   END_IF  B 227   END_REPEAT  B 229   END_WHILE  B 229   Ending step  A 41  B 192  D 424   ENO  A 56   EPROM  C 337  C 348   EQ operator  IL   B 258   Error  A 101   Error message  A 78   Ethernet  A 36   Execute one cycle  A 112   Execution order  A 67   EXIT  B 231   Exit key  NT target   C 358   Exit key  on target   C 329   Exponent  B 285   Export  A 87   Export function  A 32   Export function block  A 32   Expression  D 424   EXPT  B 285    F    F_CLOSE  B 314  F_EOF  B 315  F_ROPEN  B 313  F_TRIG  B 269  F_WOPEN  B 313    FA_READ  B 316   FA_WRITE  B 318   FALSE  A 84  B 179   Father SFC program  B 200  D 424   FBD  A 62  B 206  C 371  C 379  D   424   FBD comment  A 65   FBD editor  A 62  A 75   FC  A 47  B 201  D 424   FC comment  A 49   FC connector  A 49   FC editor  A 47   FC link  A 49   FC sub program  A 28  B 203   FEDGE  B 225   File  end of file detection  B 315   File close  B 314   File open  B 313   File read  B 316  B 320   File write  B 318  B 321   Find  A 42  A 51  A 59  A 67  A 73  A   78   FIND  
439. so  be selected and moved in order to arrange the diagram     O Using connectors    The ISaGRAF Flow Chart editor enables the use of graphic connectors  as a  replacement of a visible flow link  Connectors can be very useful to avoid very long  links and increase chart readability  A connector cannot be used to establish a link  with another FC program        ICS Triplex ISaGRAF Inc  A 49    User s Guide       A connector is put in the chart as other FC objects  It is represented by a circle  containing the numerical reference of targeted element  destination of the flow link    The short description text of the target element is displayed close to the connector  circle          15   Exception handling    I Moving objects    To move objects in the chart  you have to select them  and drag the mouse to move  them within the chart  You can either move a single element or a multiple selection   Elements cannot be overlapped when moving them  Moving elements cannot be  used to connect them to an existing link     When a single element  action  test     is moved  the ISaGRAF Flow Chart editor  automatically moves with the selected element all objects placed below and  connected to it  This feature does not operate in the case of a multiple selection     El Resizing objects    Any graphic element of a flow apart from  Begin    End  symbols and connectors  can be resized freely  To resize an element  you first have to select it  Then drag  with the mouse the small squares drawn on it
440. sscsenastenvevessssiesesnssedmessoeas    B 210  B 6 1 Power rails and connection lines             ccceesceeseeseceseeeseceseenseeseenees B 210  B 6 2 Multiple connection      442 c hcct a ee heh B 211  B 6 3 Basic LD contacts and coils  0       ccecceseesseesceeeeeeseeeeeeeeeneeneeeseeenes B 212  B 6 4 RETURN statement  ene ae an tees ine ah R seeds B 217  B 6 5 Jumps and labels    c c0x iva stews vr ehcbiaecees a E decease B 218  B 6 6 Blocks in LD  iscce ous hoki edie  Sodan eiaied aie E B 219  B 6 7  In  Line    Blocks im LD  ccsseesces cepechessonieealeeneeeacveecesceveseeiteeivonieess B 220  B 7 SAETTA E TA A E B 222  B 7 1 ST main SYMAK ere riei O EE E eos B 222  B 7 2 Expression and parentheses            cccccsccesseesseeeceeseeseeeeeeeneecseeeaeeenes B 222  B 7 3 Function or function block calls        0 cc ecceeceeeeeeeceteeeseceeenseeeeenes B 223  B 7 4 ST specific Boolean operators          ccccecceeseeeseeesceseceeeeeeeseeeseeeseeees B 224  B 7 5 ST basic statement inan enosn iesi aini o a i ie B 226  B 7 6 ST  EXtESIONS ie o i ire EE ERE EER AREER B 231  B 8 TORET EN E E A S B 237  B 8 1 TE main Syntax e i esd E ea E E E RE B 237  B 8 2 TsO PETatOrs oea a a TE E EE E E R B 238  B 9 Standard operators  function blocks and functions              s 0e00 B 245  B 9 1 Standard    Operators ic  i02  sc  ccsccceesssesesiei rian n i i Rk B 245  B 9 2 Standard function blocks 2 0 0    cececcceseesceesceeseeeseceeeceeeseeeseenseeereees B 265       viii ICS Triplex ISaGRA
441. sting  diagram  Most of these commands act on the elements currently selected in the  diagram       Correcting a diagram    The DEL key can be used to remove the selected elements  It is not possible to  remove a coil  a jump or return symbol when it is the only output of a rung  Use   Edit   Undo  command to restore elements after a DEL command  The DEL  command can also be applied to a group of elements selected in the diagram  The  DEL command can be used when selection is on the rung comment text to reset it   The DEL command  used when the selection is on the rung head  removes the  entire rung       Copying symbols  The  Cut    Copy    Paste  commands of the  Edit  menu are used to move or  copy selected elements  These commands do not act on rung comments  The  Edit  I Paste special  command gives you the choice to insert the pasted elements   e before the selected element  on the left   e after the selected element  on the right   e in parallel with the selected element      Managing entire rungs    All editing commands  delete  copy  cut     act on the entire rung if the selection is  on the rung header  left power rail   This provides an easy way to arrange rungs in  the diagram  just by moving the selection in the first column  It is also possible to  extend the selection vertically so that it includes several rung headers  In this case  edition commands may be applied to a list of entire rungs      a Find and replace    The  Edit   Find  and  Edit   Replace  menu 
442. t available during simulation  because  the ISaGRAF Workbench automatically installs the application processed by the  simulator     Stop the target application    The  File   Stop application  command stops the execution of the application  currently active in the ISaGRAF target system     Activate the target application    The  File   Start application  command runs the application existing in the target  system  When an application is downloaded  it is automatically started  so that the   Start  command does not have to be used  The  Start  command is typically used  after a  Stop  command     Note  the target application must be stopped  inactive  before it is possible to  download a new application     Download the application    The  File   Download  command is used to download the application code in the  target system  Select the type of code to be downloaded  according to the target  system processor and the application options     Display version number    The  File   Get version number  command is used to display complete  identification of both Workbench and target applications  The Workbench  application is the one currently open on the ISaGRAF Workbench  The target  application is the one executed in the target ISaGRAF PLC  The following items are  displayed        ICS Triplex ISaGRAF Inc  A 111    User s Guide       b gt     VERSION                005 This is the version number of the application code  The  code generator has calculated this number    DATE  cni
443. t can be produced  The    gt  gt   sign is used to indicate the selected target s   The ISaGRAF Code Generator  can produce up to 3 different codes in the same compiling operation  Use the   Select  and  Unselect  buttons to set the list of required target codes  according to  your target hardware  Below are the standard ISaGRAF targets     SIMULATE           This code is dedicated to the ISaGRAF Simulator on the  Workbench  The simulator cannot be run if this target is not  selected to produce the application code    ISA86M                This is a TIC code  Target Independent Code  dedicated to  ISaGRAF kernels installed on Intel based processors  The  processor type only concerns byte ordering in the generated  code    ISA68M                This is a TIC code  Target Independent Code  dedicated to  ISaGRAF kernels installed on Motorola based processors  The  processor type only concerns byte ordering in the generated  code    SOG riiui Selecting this target leads ISaGRAF compiler to produce  structured  C  language source code to be compiled and linked  with ISaGRAF target kernel libraries to produce an embedded  executable code    CC86M                 Selecting this target leads ISaGRAF compiler to produce non  structured  C  language source code to be compiled and linked  with ISaGRAF target kernel libraries to produce an embedded  executable code  This selection is provided for compatibility with  ISaGRAF versions before V3 23  when structured  C  code  generation and 
444. t groups xl   d  projectsisadsusaviniapl   d iprojectsisaSsisawinimyapl   fiisawinismp   d iprojectsisaSsisawinyfapl New group    Close      Select a group in the list and press  Select  to activate it in the project management  list  You can also double click on its name to select it  Use the  New group   command to create a new group  This command can be used either to assign a  group name to an existing directory  or to create a new group with a new directory              Note  No group can be selected or created when other ISaGRAF windows   program manager  editors     are open     A 2 3 Options    The commands of the  Options  menu are used to display or hide the toolbar   select the character font for text  and set the Project Manager  auto close  mode   The character font selected is the one used to display the project descriptor  and is  also used by all ISaGRAF text editors     When the  Keep Project Manager open  option is removed  the Project Manager  window is automatically closed when a project is entered        ICS Triplex ISaGRAF Inc  A 25    User s Guide       A 2 4 Tools    The commands of the  Tools  menu are used to run other ISaGRAF applications   The  Tools   Archive Projects  command runs the ISaGRAF archive manager to  save or restore projects  The  Tools   Archive Common data  command is used to  save or restore files used by all projects  such as common defined words      The  Tools   Libraries  command runs the ISaGRAF library manager in a separate  
445. t is needed to distinguish slaves from  each other when more than one target are running  Therefore  before starting the ISaGRAF  kernel task s   you need to registered it  them   In that way the isa_register_slave   subroutine  is provided     uchar isa_register_slave    uchar slave    slave number               C 342 ICS Triplex ISaGRAF Inc     Target User s Guide       Description   Add a new kernel slave registration to the multi targets management system    return value   0 if succeeded  BAD_RET if errors occur      Communication task s  registration    An ISaGRAF communication task is characterized by its logical number  It is used to manage  more than one communication task at a time  It can be from 1 to 255 and must be different for  each communication task  Therefore  before starting the ISaGRAF communication task s    you need to registered it  them   In that way the isa_register_com   subroutine is provided     uchar isa_register_com     uchar com_id    com  task identifier            Description   Add a new communication task registration to the multi targets management system    return value   0 if succeeded  BAD_RET if errors occur      Application backup file storage unit    The global variable TSK_FUNIT  char    can be initialized to a string containing the path unit  for application file backup  The ISaGRAF target simply uses the standard file management  routines fopen  fread  fwrite  fclose for application file backup    The default value is an empty string
446. t on the chart  the  user has to move the selection to appropriate location and select the type of the       ICS Triplex ISaGRAF Inc  A 39    User s Guide       component in the editor toolbar  The symbol is inserted at the current position  The  following keyboard sequences can also be used     Insert an initial step  Insert a single step  Insert a transition       Insert a jump to a step    Fei Fete Insert an OR divergence or convergence   Add branches    HFG  tt j  LBL oe    Insert an AND divergence or convergence   Add branches    Fe    E Insert a macro step  Fs  GI FSE   Insert begin or end step for the body of a macro step     The op symbol indicates a combination with SHIFT key     The editing grid shows matrix cells  An editor option allows the user to show or  hide the grid during chart input  The grid is very useful for initial layout of SFC chart   or selecting sub parts of the chart  Use the  Options   Layout  command to display  or hide the grid    The ISaGRAF SFC editor always shows the current position in the matrix  The  focused cell is marked in grey  The small square on its bottom right corner can be  used to freely resize the cells  The X Y ratio of the cells can also be changed this    way   C evaluate tmax    i  ACTION  N      Creating a divergence or convergence    Divergences and convergences are always drawn from the left to the right  To  draw a divergence or a convergence  its left branches has to be placed on the  chart area  The type of drawing  si
447. t result  lt  gt  0  gt  condition is TRUE       B 198 ICS Triplex ISaGRAF Inc     Language Reference       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 IL programming for transitions        SFC program with an IL program for transitions                      u   E  info IL  LD Run   amp N Error   endinfo    B 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        SFC program with sub program call for transitions       1  A EvalCond         B 3 7 SFC dynamic rules                   The five dynamic rules of the SFC language are        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     e Clearing of a transition  A transition is either enabled or disabled  It is said to be enabled 
448. t2   END_ACTION     Detailed syntax can be found in the ST language section   Example of a sub program call in action blocks        B 196 ICS Triplex ISaGRAF Inc     Language Reference          SFC program with a sub program call in an action block             1 Action  P    init    SPInit        End_action     A Init   OK     B 3 5 6 IL convention                               Instruction List  IL  programming may be directly entered in a 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             4      Action  P     r    info IL   LD False  ST Led1  ST Led2   endinfo   End_action                          B 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       ICS Triplex ISaGRAF Inc  
449. tatement     Example      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   o REPEAT statement  Name  REPEAT     UNTIL     END_REPEAT  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        ICS Triplex ISaGRAF Inc  B 229    Language Reference       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  BY  lt step gt  DO  
450. ted  a complete  frame of its source code is automatically generated     Working on existing elements    The  File   Rename  command allows the user to change the name or the comment  of the element selected from the list of elements  The  File   Copy  command  allows the user to copy the element highlighted in the active library on another  element in the same library  If the destination element already exists  all its contents  are overwritten  If the destination element does not exist  it is automatically created   The  File   Delete  command removes the currently selected element from the  active library   Rename    Copy  and  Delete  commands handle the following  components of the element    e technical note   e complete definition for an I O configuration   e parameters for an I O board or complex equipment   e interface definition for a function or function block   e source code for function and function block written in IEC language   e source code for a C conversion  a function or a function block    A If the element is a  C  conversion   C  function or  C  function block  its  name is not automatically updated in the attached source code by a  Rename  or   Copy  command     If the element is a function written in IEC language  the return parameter  name is not changed by a  Rename  or  Copy  command     Setting password protection    The  File   Set password  command enables the user to define password  protection for the selected element in the open library  Refer
451. ted with its editing date    Dictionary Set of internal  input or output variables  and defined words  used in the  programs of one project    Edge Change of a Boolean variable  A rising edge means a change from false to  true  A falling edge means a change from true to false    End section Group of cyclic programs executed at the end of each target cycle    Ending step Last step of the body of a SFC macro step  An ending step is not linked to any  following transition    Expression Set of operators and identifiers  which represents the evaluation of a value    Father SFC SFC program  which controls other SFC programs  called its children    program   FBD Functional Block Diagram language    FC Stand for  Flow Chart     Flow Chart Graphical language used to design a flow  The chart consists in action to be  performed and decision allowing the selection between various paths in the  flow  The Flow Chart language enables the drawing of loops to be executed on  consecutive cycles   Function Graphic component of the FBD language  which represents a standard   block elementary function from the ISaGRAF libraries    Functional Graphic language  the equations are built with standard elementary blocks from   Block the ISaGRAF library  linked together in the diagram    Diagram   Global Range of variables or defined words  Such objects can be used in any program  of one project    Hierarchy Architecture of a project  divided into several programs  The hierarchy tree  represents the lin
452. ter  Each command is described on two lines of text   according to the following syntax     M menu_string  C command_line    The menu string is the text to be displayed in the  Tools  menu  The command line  is any MS DOS or Windows executable  and can be completed with arguments  In  command line  you can use   A  characters to replace the name of the open  project  and   P  characters to replace the name of the selected program  The  following example runs  Notepad  to edit the selected program  to be used with ST  and IL programs      M Edit with Notepad  C Notepad exe  isawin apl  SA  SP 1sf    A 3 6 Simulating and debugging the application     gt     The command of the  Debug  menu are used to run the ISaGRAF graphic  debugger  either in simulation mode or in real connected mode     Simulation    The  Simulate  command opens the debugger in simulation mode  In this mode   another window appears  called the simulator  This command is very useful to test  any application when the target machine is unavailable  Starting the simulator  closes the Program Management window  The Program Management window is  then re opened in debug mode after both debugger and simulation windows are  opened  The simulator cannot be started if the target code has not been generated   The simulator cannot be started when child windows  editors  code generation  I O  connection     are opened  Each of them must be closed before running this  command  This command is also available from menus of I
453. ter  More about program  editors  in this document     Insert file    The  Edit   Insert file  command inserts the whole contents of a file at the current  location of the caret  Note that only pure ASCII text files can be handled by this  command     A 8 2 Syntax coloring    The text editor uses several colors for displaying language keywords  variable  identifiers  constant expressions    The set of colors applied for syntax coloring  cannot be customized        ICS Triplex ISaGRAF Inc  A 73    User s Guide       A 8 3 Options    The commands of the  Options  menu are used to display or hide editor toolbars   and select the character font  The selected character font will be used for any text  editing in all ISaGRAF Workbench    When used to enter the source code of a ST   IL program  the  Options   Show  keywords  command is used to show or hide a toolbox that groups the most  common keywords of ST or IL language  Click on a button in the toolbar to insert  the corresponding keyword or operator at the current location of the caret        A 74    ICS Triplex ISaGRAF Inc     User s Guide       A 9 More about program editors    This chapter contains useful information about editing features  which are common  to all the ISaGRAF program editors  This mainly concerns links with other ISaGRAF  tools and common ISaGRAF dialog boxes     A 9 1 Calling other ISaGRAF tools    aM Verify  compile  the program    The  File   Verify  command runs the ISaGRAF code generator to verify  the
454. th the target one        C 326 ICS Triplex ISaGRAF Inc     Target User s Guide       Default value  The default slave number is 1  same as the workbench one       Examples   isamod COM1 Configure COM1 to 19200 baud  no parity  8 data bits  1 stop bit   isa  t COM1 Starts the ISaGRAF target with default slave number  1  and with COM1    as the communication port   isa  s 3  t COM1 Starts the ISaGRAF target with slave number 3 and with COM1 as the  communication port     C 3 2 Specific features      ISaGRAF start up    When the target is started  the following algorithm is executed     Look for application from disk  to load it into memory    Application OK              No available application on disk    Wait for application download           Application OK              Save application to disk    Execute Application    Stop application       e Definitions   The application code is the binary data base generated and downloaded by the workbench  and then  executed by the target  The symbol table may complete it    The application symbol table is an ASCII database generated and downloaded by the  workbench  This table makes the link between symbol objects and internal target objects  It is  not required on target except for user   s specific symbols management  For more information  on symbol table see user   s guide  Advanced programming techniques     e Application backup  When a new application is downloaded from the workbench debugger into the target  the  application code 
455. the  technical note for a new element  this format is used as a main frame  This allows  the user to optimise technical note editing     Parameters    The parameters of an element describe the interface between the computer  operations provided by the element and the use of the element in an ISaGRAF  application  Parameters have a different meaning for each type of library element   The parameters of an I O configuration define the complete set of I O boards of the  configuration  and default variable names used for I O channels  The parameters of  an I O board or complex equipment define the physical and logical configuration of  the board  The parameters of a function or function block define the interface of the  element  according to ST language function calling conventions  There is no  parameter for a conversion function because it uses a standard pre defined  interface     Source code    The ISaGRAF Workbench allows the programmer to manage the source code of a  library conversion  function or function block  The source code of a function or a  block written in IEC language is a text or a diagram described with the language  attached to the function  The source code of  C  components   C  functions   C   function blocks and conversion functions  is divided in two separate files  a source  header that contains the exact definition of the interface  according to the  element s parameter definition and a source code file that contains the element s  operation implementati
456. the ISaGRAF text editor   particularly when used to enter the source code of ST and IL programs     A 8 1 Editing commands    zE    The commands of the  Edit  menu are used to work on the edited text  Most of  these commands act on the characters currently selected in the diagram  or perform  an action at the current location of the caret     Cut and paste    The DEL key can be used to remove the selected text  Use  Edit   Undo  command  to restore elements after a DEL command  The  Cut    Copy    Paste  commands  of the  Edit  menu are used to move or copy text in the program  or to insert pieces  of texts copied in the clipboard by other applications     Find and replace    The  Edit   Find  and  Edit   Replace  menu commands are used to find and  replace texts in the program  Any character string can be found  Research can be  performed upward or backward  starting at the current location of the caret  It does  not  loops  when the limits of the program are reached     Go to line    The  Edit   Go to line  command is used to move the caret to a specific line  number  This can be very useful to have access to a line with an error detected by  the ISaGRAF compiler in a ST or IL program  and referenced by a line number     Insert symbol from dictionary    Use the  Edit   Insert variable  command to insert at the caret position the symbol  of a variable or object declared in the project dictionary  Symbol is selected through  the common variable selection box described in chap
457. the diagram  Its left  connection must be linked to a Boolean point  When the left connection is TRUE   the execution of the diagram directly jumps to this target label  Note that backward  jumps are dangerous as they may lead to a blocking of the PLC loop in some  cases     Return symbol    A return symbol is connected to a Boolean point  It indicates that the execution of  the program must be stopped if the rung state is TRUE        ICS Triplex ISaGRAF Inc  A 63    User s Guide       Variables    Variables in the diagram are represented inside small rectangles  connected on the  left or on the right to other elements of the diagram     Connection links    Connection links are drawn between elements put in the diagram  Links are always  drawn from an output to an input point  in the direction of the data flow      Connection links with Boolean negation    Some Boolean links are represented with a small circle on their right extremity  This  represent a Boolean negation of the information transported by the link     User defined corners    User defined points may be defined on links  They allow the user to manually  control the routing of a link  If no corner is placed  the ISaGRAF FBD LD editor uses  a default routing algorithm        A 64    ICS Triplex ISaGRAF Inc     User s Guide       A 7 2 Entering an FBD diagram          To enter a diagram  you have to place elements  blocks  variables  contacts  and  coils     in the graphic area  and draw links between them     Inser
458. the error management ends     When processed        Error number  decimal value  and argument  hexadecimal value  are displayed on the  output  window of the WISAKER EXE        Error number and argument are pushed into a ring FIFO error buffer in order to be  retrieved at a later time  The error buffer size is set in the workbench Make options  When  the buffer is full  at each new incoming error  the oldest one is lost        Errors can be pulled either from the debugger or from the running application using the  SYSTEM call  see user s guide         ICS Triplex ISaGRAF Inc  C 357    Target User s Guide       When the debugger detects an error  a message describing the error is displayed in the error  window  Depending on the context of the application  running or not  the debugger may  display the name of the object  variable or program  where the error comes from  or the  argument error  decimal value  into brackets  x  which has a different meaning for each error     A welcome message is displayed on the output when the target starts  It is composed of the  slave number  the communication configuration and the DDE server name       System clock    As the ISaGRAF NT target is designed to run on any system  the time reference used for both  cycle synchronization and timer variables refresh is the standard tick  which is 10  milliseconds     Thus  it is not possible to have an accuracy on timer variables better than 10 ms  For the  same reason  a specified cycle duration les
459. the new function block  The  Parameters  command of the  Edit   menu is used to define the calling and return parameters of the new function block       Using a  C  function block in an ISaGRAF project    Any integrated  C  function block can be used in the programs of an ISaGRAF project   C   function blocks can be called from ST and FBD languages     Calling a  C  function block from the ST language follows the function block calling  conventions of the language  The calling parameters of the block are written after the name of  the function  between parentheses  and separated by commas  The return parameters are  accessed one by one  Each return parameter is represented by a name  combining the name  of the block instance  and the name of the parameters  The components of the name are  separated by a dot  For example  the name     FBINSTNAME parname    is used to represent the return parameter named  parname   of the function block instance  named  FBINSTNAME         C 378 ICS Triplex ISaGRAF Inc     Target User s Guide       The instances of the function blocks used in the ST language must be declared in the  dictionary  Each copy  instance  of a function block must be identified by a unique name   Below is an example of instance declaration in the ISaGRAF dictionary     instance  TRIG1 type  R_TRIG  TRIG2 R_TRIG    And below is an example using these declared instances in a ST program     TRIG1  boo_input1    TRIG2  boo_input2         Command     TRIG1 Q  amp  TRIG2 Q   
460. the project    The  Verify all programs  checks the syntax of all the programs of the project   even if some of them have not been modified  This command does not stop when  an error is detected in a program  It can be used to produce a complete listing of all  the errors remaining in programs of the project  This command may be aborted by  hitting the ESCAPE key     Simulating a modification    The  Touch  command simulates a modification of the entire project s programs  so  that they are all verified during the next  Make  operation  The  Open  command is  used to open the last verified program  This command is very useful to directly  access a program where syntax errors have been detected        A 98    ICS Triplex ISaGRAF Inc     User s Guide       A 13 2 Compiler options    The  Compiler options  command is used to set up main parameters used by the  ISaGRAF Code Generator to build and optimise the target code  The aim of this  command is to select the type of code which has to be generated  according to  corresponding ISaGRAF targets  and to set up the optimiser parameters according  to the expected compiling time and application run time requirements    The  Upload  button opens a second dialog box with other options that enable the  embedding of zipped source code to downloaded code  in order to enable the   Upload  feature  Refer to  Upload  documentation for further explanations       Selecting targets    The upper list shows the list of available target codes tha
461. the steps and the transitions of the  currently edited SFC program  When a step number is changed  all the jumps to  this step are automatically updated with the new reference number   This also  applies to macro steps and beginning steps     Direct access to a step or transition    The  Edit   Go to  command allows the user to access an existing step or  transition  The scrolling position is automatically adapted so that the step or  transition is visible     Find and replace texts    The  Edit   Find Replace  command can be used to find or replace text strings in  the complete program  all steps and transitions   The Find Replace dialog box is  used to enter a searched text and directly open the level 2 programming section  where text occurs     A 4 4 Entering the level 2 programming    To enter the Level 2 text  the user must double click on the step or transition  symbol  The level 2 programming is displayed on the right of the SFC window  The  separation line between SFC chart and level 2 programming can be freely moved     You can open one or two level 2 areas at the same time  The following commands  are available from keyboard  mouse or the  Edit  menu     Keyboard Mouse  Edit  menu  Open in last default window Enter Double click Edit level 2  Open in separate window Ctrl Enter Ctrl   Double click Edit Level 2  In separate   window    When two level 2 windows are visible  the separation between them can be freely  moved  The button on the right of the level 2 title ba
462. the target system to begin the  answer to one workbench request  The  Cyclic refresh duration  is the time period  required for the  read  requests to be sent by the debugger in order to refresh data  in the opened windows    All the time values are displayed and entered as integer numbers in milliseconds   The communication timing parameters cannot be set when the debugger is used in  simulation mode     Display options   The  Show cycle timing  option enables the user to hide or show the cycle timing  values in the debugger control bar  When this option is set  all the cycle timing  components  allowed  current  maximum  overflows  are displayed and refreshed   Disabling this option reduces the debugger communication burden    When the  Show errors  option is set  detected run time errors are listed in the  bottom area of the debugger window  When this option is disabled  the error list is  closed  Removing this option reduces the debugger display and communication  burden  The  Options   Clear errors  command clears the list of run time errors  currently displayed in the debugger window    The  Options   minimise window  command reduces the size of the debugger  window so that it is shown as a small  always on top  panel containing only the  application status and graphic buttons for most commonly used commands      Write  commands    The ISaGRAF symbolic debugger offers many commands to change the value or  status of the application components  Selecting the component to 
463. tically rearranges  sorts  the parameters  so that the  return parameters are put at the end of the list     Moving a program in the hierarchy tree    The  Rename move  command of the  File  menu is used to change the name of a  program  or to move it into another section of the hierarchy tree  However the       A 30    ICS Triplex ISaGRAF Inc     User s Guide       description language of an existing program cannot be changed  When running this  command  the same window as the one used for creating programs is opened  and  all fields are set up with the attributes of the selected program  The name of a  program can be modified  and another section or parent program selected to move  it into the hierarchy tree     The  Arrange programs  command of the  File  menu is used to give an explicit  order between a list of programs with same level and father  If the selected program  is at the top level  the command is used to arrange the top level programs of the  selected section  If the selected program is at a lower level  the command arranges  only the SFC children and sub programs which have the same father as the  selected one  When the  Arrange programs  dialog box is opened  select the  program you want to move  and press the  Up  or  Down  button to move it in the  list     Copying programs   To make a copy of a program  select the source program from the list of programs   and run the  File   Copy  command  When running this command  the same  window as that used for creat
464. 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    B 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 character 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     B 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 an ST program  and can be written on more than one line        B 184 ICS Triplex ISaGRAF Inc     Language Reference       These are examples of comments     counter    ivalue     assigns the main counter
465. timers  the  T   or  TIME    prefix can be omitted        A 142    ICS Triplex ISaGRAF Inc     User s Guide       Notes     Example     End    Meaning     Syntax     Notes     Example      lt labelname gt  is the name of a label defined in the script     Backward jumps are allowed  In case of an infinite loop  script  execution is automatically broken on each loop in order to preserve  execution of ISaGRAF cycles        This script loops until MyVar is TRUE     Loop    If MyVar   TRUE Goto TheEnd   Print MyVar   Goto Loop   TheEnd     Terminates script  End    It is not mandatory to place an  End  instruction on the last line of the  script       This script loops until MyVar is TRUE     Loop    If MyVar   FALSE Goto Continue   End   Continue    Print MyVar   Goto Loop       ICS Triplex ISaGRAF Inc  A 143    User s Guide       A 22 Using the Library Manager    A 22 1    The ISaGRAF libraries provide a standard interface between automation  development and the software or hardware capabilities of the ISaGRAF target  system  There is one library for each type of interface  The ISaGRAF Workbench  Library Manager is dedicated to the hardware supplier  or to the software engineer   He uses the library manager to describe the ISaGRAF programming interface of the  objects he creates    The ISaGRAF Workbench Library Manager shows the elements of one of the  ISaGRAF libraries  In the left area of the window is the list of the elements of the  selected library  In the right area is the
466. ting objects    To insert an object in the diagram  select the corresponding button in the toolbar  and click in the graphic area  where you want to insert it     Selecting objects    Selecting graphic objects is needed for most of the editing commands  The  ISaGRAF LD FBD graphic editor enables the selection of one or more existing  objects in the diagram area  To select objects  the  select   button with an arrow   choice must be checked in the editor toolbar  To select one object  the user only  has to click on its symbol  To select a list of objects  drag the mouse in the diagram  and select a rectangle area  All the graphic objects that intersect the selection  rectangle are marked as  selected   A selected object is drawn with little black  squares around its graphic symbol  By making a new selection  all previously  selected objects are unselected  To remove the existing selection  simply click with  the mouse on an empty area  outside of the rectangle which borders the selected  objects     Inserting comments    Comments may be inserted anywhere in the diagram  Comments have no influence  on the program execution  They allow a higher readability of the diagram  To insert  a comment block  select this button in the toolbar  and drag the mouse to select the  rectangle area where comment must be drawn  Then enter the text of the comment   No special leading or trailing characters such as      and      are needed when  entering the text of a comment block  A comment block
467. tion     Integer analog AND bit to bit mask        FBD example with Analog AND_MASK blocks          B 252 ICS Triplex ISaGRAF Inc     Language Reference                                                                ST Equivalence                       and_mask  xvalue m  1 msk al parity  and_mask  16 abc m  16 f0f msk al result             parity    AND_MASK  xvalue  1      1 if xvalue is odd       result    AND_MASK  16 abc  16 f0f      equals 16 a0c          IL equivalence        LD xvalue  AND_MASK 1  ST parity  LD 16 abc  AND_MASK 16 f0f  ST result  OR_MASK  Arguments   IN INT  MSK INT  Q INT  Description     must have integer format  must have integer format    or_mask    bit to bit logical OR between IN and MSK    Integer analog OR bit to bit mask        FBD example with Analog OR_MASK blocks                                                                                     or_mask  xvalue N  1 msk parity  or_mask  16 abc N  16 f0f msk result                   ST Equivalence        is_odd    OR_MASK  xvalue  1      makes value always odd       result    OR_MASK  16 abc  16 f0f      equals 16 fbf          IL equivalence        LD xvalue  OR_MASK 1   ST is_odd  LD 16 abc       ICS Triplex ISaGRAF Inc     B 253    Language Reference       OR_MASK 16 f0f       ST result  XOR_MASK  xor_mask   Arguments    IN INT must have integer format   MSK INT must have integer format   Q INT bit to bit logical Exclusive OR between IN and MSK  Description     Integer analog exclusive OR
468. tion    Cell Elementary area of the graphic matrix for graphic languages such as SFC  FBD  or LD    Child SFC SFC program controlled by another SFC program  called its father    program   D 422 ICS Triplex ISaGRAF Inc     Glossary       Clearing a  transition    Coil    Comment    Comment   SFC     Common  Condition   fora  transition   Connector   FC   Constant    expression    Contact    Conversion    Conversion  function    Conversion  table    Cross  references    Current  result  IL     Cycle  timing    Cycle to  cycle mode    Cyclic    Run time operation  all the tokens existing in the preceding steps are removed   A token is created into each of the following steps     Graphic component of an LD program  used to represent the assignment of an  output variable     Text included in a program  having no impact on the execution of the program     Text attached to a SFC step or transition  having no impact on the execution of  the program     Range of defined words  Such objects can be used in any program of any  project     Boolean expression attached to a SFC transition  The transition cannot be  cleared when its condition is false     FC graphic component  which represents a link  from a point of the flow chart to  a FC action or test  The graphic symbol of a jump is an small circle  numbered  with the reference of the destination element     Literal expression used to describe a constant value  A constant expression is  dedicated to one type     Graphic component of an 
469. tion   Count  integer  from 0 up to a given value 1 by 1  or from a given value down to 0 1 by 1       FBD program using  CTUD  block                                                                             r_trig  add_elt oK q  r_trig  sub_elt otk  reset_cmd full  load_cmd empty  100 nb_elt                                              ST Equivalence  We suppose R_TRIG1 and R_TRIG2 are two instances of R_TRIG block  and CTUD1 is an instance of CTUD block     CTUD1 R_TRIG1 add_elt   R_TRIG2 sub_elt   reset_cmd  load_cmd 100     full    CTUD1 QU    empty    CTUD1 QD    nb_elt    CTUD1 CV        B 272 ICS Triplex ISaGRAF Inc     Language Reference          IL Equivalence        add_elt  R_TRIG1 clk  R_TRIG1  R_TRIG1 Q  CTUD1 cu  sub_elt  R_TRIG2 clk  R_TRIG2  R_TRIG2 Q  CTUD1 cd  reset_cmd  CTUD1 reset  load_cmd  CTUD1 load  100  CTUD1 pv  CTUD1  CTUD1 QU  full  CTUD1 QD  empty  CTUD1 CV  nb_elt    TON    Arguments   XE  TON    XE  On delay timing    BOO If Rising edge  starts increasing internal timer  If Falling Edge  stops and resets internal timer    IN    PT  Q  ET    Description     TMR maximum programmed time  BOO If TRUE  programmed time is elapsed  TMR current elapsed time    Increase an internal timer up to a given value     Timing diagram        ICS Triplex ISaGRAF Inc     B 273    Language Reference          TOF  TOF  IN Q  PT ET  Arguments   IN BOO If Falling edge  starts increasing internal timer  If Rising edge  stops and resets internal timer  PT TMR maximum p
470. tion has mainly been designed for poor hardware platform such  as low cost boards or MS DOS PC   s or to make a first prototype when porting on a new  platform  Therefore the multitasking ISaGRAF target implementation should be preferred    The ISaGRAF single task target does not prevent the running of background processes or  interrupt driven routines       Slave s  registration    Its slave number characterizes an ISaGRAF target  Its value can be from 1 to 255 except  number 13   0D   This slave number is used through the communication link protocol  It is  needed to distinguish slaves from each other when more than one target are running   Therefore  before starting the ISaGRAF target s  task  you need to register it  them   In that  way the isa_register_slave   subroutine is provided     uchar isa_register_slave    uchar slave    slave number            Description   Add a new slave registration to the multi targets management system     return value   0 if succeeded  BAD_RET if errors occur       Application backup file storage unit    The global variable TSK_FUNIT  char    can be initialized to a string containing the path unit  for application file backup  The ISaGRAF target simply uses the standard file management  routines fopen  fread  fwrite  fclose for application file backup    The default value is an empty string      to specify that there are no storage unit     Example   TSK_FUNIT    host name  C  ISaGRAF target apl      Specify ISaGRAF target apl   on root of
471. tions   Different applications  kernels and communication tasks  can run at the same time on a CPU   as far as they have respectively different slave numbers and different communication task  logical numbers  Nevertheless while running different application  the user must take care of  some application objects shared access such as I O boards  For instance different application   kernels  may use distinct physical boards unless some kind of I O server or semaphore is  implemented through the I O driver     e Application backup  When a new application is downloaded from the workbench debugger into the target  the  application code is saved  the target uses standard file management routines fopen      with  the file name    pathISAx1 ISaGRAF application code backup file  where x is the slave number     Furthermore if the application symbol table has been downloaded before  it is also saved on  the target current directory with the file name   pathISAx6 ISaGRAF application symbols backup file  where x is the slave number     The path is specified at the ISaGRAF target startup using the global variable TSK_FUNIT  An  empty string      will specify there are no disk file unit  default value         ICS Triplex ISaGRAF Inc  C 347    Target User s Guide       When the ISaGRAF target is started  these application code and application symbols files are  searched on the current directory and loaded into memory     Then  if no symbol table is available on memory  the target starts runni
472. to read bytes is specified in addH addL  It must be less than  F000  Read the specified  nbb  number of bytes  from the previously selected remote file  name  starting from specified address  addH addL with any 16 bit value  added to the  previously selected base address    The Values are retrieved  V fields from left to right  in the order they are read in the file   Example     Select remote file name   target fil    Question Jo1_ i1_ FO_Joo_joo_joB_ joB  74     joo  25  9F    JAnswer__ 01  11  Fo  oo  oo  oB_ 8F_  oE _     Select base address  0x10000   Question  01  11  Fo  o2 joo  04  o4 foo jot joo joo  re  1n    Answer_  01  11  Fo  o2 joo  o4 jee Jeca    Write 4 bytes  absolute address 0x107D0  values 01 02 03 04        Question  o1  11  o7  Do foo  o4  o4 jot joz jos joa  28  eF    Answer Jot  11  o7 jbo joo joa  Fe  e7      Read 4 bytes  absolute address 0x107D0     Question  o1  12  o7  Do foo fo4  B8  e7         C 404 ICS Triplex ISaGRAF Inc     Target User s Guide       C 9 Power fail management    C 9 1 Basics    Managing a power failure is something very critical in an application  for three reasons       It depends on the process specifications       It depends on the hardware capabilities       It depends on the programming methods    Thus  the ISaGRAF answer to the power failure management is not a complete and absolute  universal method  but a set of principles  methods and tools that have to be combined in a  specific way for each application  or at least 
473. toolbar   A new  rung with one contact and one coil is created        A 56 ICS Triplex ISaGRAF Inc     User s Guide         Entering the rung comment    Each rung may be documented with up to two lines of text  To enter a rung  comment text  move the selection on the cell upon the rung and hit ENTER key  or  double click on this cell with the mouse     Hit ENTER on this cell                blead   brandom   led2                         HC HH  sel2    Entering the rung label    Each rung may be identified by a name  This name can be used as a target label for  jump operations  To enter or change the label of a rung  move the selection on rung  head and hit ENTER key  or double click on this cell with the mouse     Hit ENTER on this cell                blead   brandom   led2  bj w          y          sel2                 L       The ISaGRAF Quick LD editor keeps the memory of the rung labels you already  entered  whether it has been specified for a rung name or a jump operation  The   Jump Label    dialog box gives you the possibility either to enter a new label  or to  select an existing one     If you enter a new name  it will automatically be added to the list  The  Remove   button is used to remove the selected name from the list  It does not remove the  label on the rung you selected in the diagram  To do this  just press OK when the  edit box is empty       Inserting symbols on a rung    The insertion of symbols  contacts  coils  blocks     on an existing rung is always  
474. tors   by a  reduced list of conditional jump operations  The translation is operated only if the  expected execution time of the jump sequence is less than the one expected for the  original expression        A 100    ICS Triplex ISaGRAF Inc     User s Guide       The following table summarises the expected optimisation and requested compiling  time corresponding to each parameter     Gain  performances        compiling time          Run 2 passes VOO a a ee ane ie       Optimise constant expressions XXXXXXXX  na     XXXX  Suppress unused labels XXXX       ad     XXXXXXXX  Optimise variable copying XXXX  eee T     XXXXXXXX  Optimise expressions XXXX  eee vis     XXXXXXXX  Suppress unused code XXXXK  eee we     XXXXXXXX  Optimise arithmetic operations XXXXXXXX     we XXXX  Optimise Boolean operations XXXXXXXX     we we XXXX   Build binary decision diagrams XXXXXXXXXXX      eee XXXXXXXXXXX        The compiling time is also multiplied by 2   A 13 3 Producing C source code    The ISaGRAF workbench enables the production of source code in  C  language  In  this case  the whole contents of the application  including SFC chart description   data base definition and sequences of code are generated in  C  source code  format  There are two possibilities  proposed as two styles of generated code     CC86N                  C source code   V3 04  produces non structured  C  source  code  This style should be selected if your target software is  based on ISaGRAF release previous to 3 23  
475. tory for each script    lt scriptname gt  SCC           text of the script  instructions     lt scriptname gt  SCoO           contents of the output window   where  lt scriptname gt  is the name of the script  Both files are standard text files and  can be open using any other text editor     While editing a script  you can use the  Edit   Insert symbol  command  to select a declared variable name to be inserted at the caret position       Running scripts    Script must be checked and compiled before running it  If necessary  syntax  checking is automatically performed on a  Run  command  Use the following  commands of the  Script  menu     A Check    checks syntax and compile script       ICS Triplex ISaGRAF Inc  A 137    User s Guide       Ol Run Script                 start execution of the script currently edited    In the case of a new untitled script  it must be saved  and a name must be  entered for it  before it is checked  In case of a named script  script is automatically  saved to disk before syntax checking    When script is running  its contents cannot be changed  A message is displayed  when end of script is reached  You can also abort a running script using the  following command of the  Script  menu     Abort Script              terminates the running script    Script execution is performed between target cycles  In the case of an infinite loop  programmed in the cycle  ISaGRAF simulator ensures that this loop is always  broken so that ISaGRAF cycles are still
476. transition  A transition is validated when all the preceding steps  transition are actives     Variable Unique representation of elementary data which is processed in the programs  of project    Virtual I O board which is not physically connected to an I O device of the target   board machine        ICS Triplex ISaGRAF Inc  D 429    General Index       E  General Index       B 250     sequence  B 181      A 93  B 182    amp   B 247     operation  IL   B 241     B 251      B 251       A 139       ST assignment   B 226     B 249    lt   B 255    lt    B 256    lt  gt   B 259      B 258    1  B 248    gt   B 256    gt    B 257    gt  1  B 248   1 gain  B 245    A    ABS  B 284   Absolute value  B 284   Access right  A 158   ACOS  B 288   Action  A 47  A 51  B 192  B 197  B   202  B 203  D 422   Activate  A 111   Activity duration  B 188  B 232   Activity of a step  B 187  B 188  B 200   B 232  D 422   Adding licensing  A 15   Addition  B 249   Addition of messages  B 263   Alias  A 60   ANA  B 260   Analog  B 179  B 180  B 183  C 365  C   366  D 422   AND  B 247    AND_MASK  B 252  AnyTarget  A 104  appli tst  C 328  C 337  C 348  C 356  appli x6m  C 337  C 348  appli x8m  C 328  C 356  Application size  C 362  Application size limit  C 329  Arc cosine  B 288  Arc tangent  B 289  Archive  A 26  A 146  A 152  A 159  Archive drive  A 153  Archive file  A 153  ARCREATE  B 310  Argument  A 150  Array creation  B 310  Array reading  B 311  Array writing  B 312  ARREAD  B 311  ARWRITE
477. ts in the previous example  in the main IF structure        C 368 ICS Triplex ISaGRAF Inc     Target User s Guide       The  TASYODEF H  include file from the ISaGRAF kernel is required for system dependent  definitions  It also contains the definition of the UFP type  which represents a pointer to a void  function  and is used for the declaration function       Links between projects and  C  implementation    The logical link between the implementation of a conversion function and the use of the  conversion in an ISaGRAF project is made with the name of the conversion  A  declaration   function is added to the  C  source code of the conversion function  This function is called  only one time when the application starts  and indicates to the ISaGRAF I O manager the  conversion name  which corresponds to the function to be implemented  This is the standard  format of such a declaration function     UFP cnvdef_xxx  char  name          strcpy  name   XX X       gives the name of the conversion     return  CNV_xxx      returns the implementation function                xxx is the name of the conversion        The name of the function  used for the strcpy statement must be written in uppercase  It  must be written in lowercase in the name of the conversion implementation function and in the  name of declaration function     Using the  CNV_  and  cnvdef_  prefixes for implementation function and definition function  enables the user to name a conversion with a reserved keyword of t
478. ts interface     The ISaGRAF Library Manager is used to add components to the existing libraries and define  the interface between the  C  implementation and the use of these components in the  ST FBD programming  The ISaGRAF Library Manager also provides an automatic generation  of the frame of the  C  source code for conversions  functions and function blocks  and  includes tools for editing such  C  source files  Refer to the ISaGRAF User s Guide for further  information about the functions of the Library Manager        C  language development    The ISaGRAF Workbench does not include any  C  compiler or cross compiler tool  The user  must own a  C  compiler  dedicated to the ISaGRAF target system  to integrate his  C   components to the ISaGRAF kernel     When using a cross compiler  the ISaGRAF Workbench offers the user entry points for  running a user defined MS DOS command file   bat   in a DOS window  The cross compiler  used must run in a DOS emulation window  If not  Windows must be closed before running  the compilers and linkers in a pure MS DOS context       Technical notes    The ISaGRAF Library Manager allows the user to write a text description for each of the  library components  This technical note is the user s guide of the  C  component developed        C 364 ICS Triplex ISaGRAF Inc     Target User s Guide       and is for the benefit of the automation programmer  to describe the corresponding  conversions  functions or function blocks in ISaGRAF applicati
479. ts of the pathname  drive  directory  prefix  suffix  must  conform to the target host system conventions     Syntax  TO   lt target pathname gt      Example  TextFile  MYFILE   Begin    From  c  user config dat     To   dd user appl config dat   End      Example  Below is a complete example of a resource definition file        resource definition file       ULongData  DATA1     list of values     Begin  Target  ISA86M     for this target only          ICS Triplex ISaGRAF Inc  A 105    User s Guide       1  O  16 1A2B3C4D   1   1    numerical values     End  VarList  VLIST1     list of variables     Begin  Target  ISA86M     for this target only     Valvel  StateX  Command  Alrml    variable names     End  BinaryFile  FILE1     binary file resource     Begin  AnyTarget    dedicated to all targets       From  c  user updatef bin        source file on PC       To  updatef cfg     target file on PLC     End  TextFile  FILE2     text file resource     Begin  Target  ISA68M   From  c  nw nwbd txt      source file on PC     To   nw dat nwbd     target file on PLC     End    Resource compiling  If resources have been entered in resource definition file  a dialog box  appears at the end of ISaGRAF code generation  Press the  Start compile  button  to run resource compiler  Output messages and errors will be displayed in the main  control  Press  Exit  to avoid resource compiling  In this case  resources will not be  added to the ISaGRAF code     Implementation    The number of resour
480. ue read from file  Description     Reads MESSAGE variables from a binary file    To be used with F_LROPEN and F_CLOSE    This procedure makes a sequential access to the file  from the previous position   The first call after FLROPEN reads the first string of the file    each call pushes the reading pointer    A string is a terminated by null  0   end of line      n   or return      r      To check if the end of file is reached  use F_EOF    This function is not included in the ISaGRAF simulator        FBD program using file management blocks                                                          F_ROPEN     voltramp  Path D file_id  FM_READ    file_id o status1    FM_READ  F_EOF    file_id D K  gt   gt  CLOSE_FILE  ERR_FILE   ERROR  CLOSE_FILE     FM_READ   file_id D a unused_eof mes  F_CLOSE   file _id    ok ok       ST Equivalence       file_id    F_LROPEN    voltramp bin        status1    FM_READ file_id     status2    FM_READ file_id     IF  F_EOF file_id   THEN  ERROR    ERR_FILE   unused_eof_mes    FM_READ file_id     END_IF    ok    F_CLOSE  file_id               IL Equivalence        LD    voltramp bin    F_ROPEN   ST file_id   FM_READ    read status1          B 320 ICS Triplex ISaGRAF Inc     Language Reference          ST status1  LD file_id  FM_READ    read status2     ST status2  LD file_id  F_EOF  JMPNC CLOSE_FILE    if end of file jump not done     LD ERR_FILE  ST ERROR  LD file_id  FM_READ    read unused_eof_mes     ST unused_eof_mes  CLOSE_FILE LD file_id  F
481. umber in variable symbols    Additionally  you can specify basic attributes of created variables  internal  input or  output      plus some properties depending on the variable type   Retain  attribute   integer or real format  message string maximum length      You always need to define a text to be inserted before variable number  as a  variable symbol cannot start with a digit  When the  number of digits  is set to   Auto   ISaGRAF formats the variable number on the minimum needed number of  digits  When number of digits is specified  ISaGRAF formats all numbers to the  specified length by adding leading  0  characters  Setting a fixed number of digits for       ICS Triplex ISaGRAF Inc  A 85    User s Guide       variable numbers can be very useful to prevent bad lexicographic sorting  Below are  some examples     Example  This setting for quick declaration          Numbering     Digits   m Symbol     Name  itt  x O    will create the three following variables                    Var9xx Var10xx  Var11xx    Example  This setting for quick declaration        Bd    Digits           m Symbol     will create 100 variables with names from MyVar001 to MyVar100             A 10 5 Modbus SCADA addressing map    ISaGRAF  network addresses  are often used to establish a link between ISaGRAF  system and a SCADA based on Modbus communication  In that case  the SCADA  is a Modbus master and ISaGRAF target acts as a Modbus slave  Network  addresses are used to create a virtual Modbus map 
482. uments   IN MSG any non empty string  NbC INT cannot be greater than the length of the IN string  Q MSG right part of the string  length   NbC   empty string if NbC  lt   0  complete string if NbC  gt   string length  Description   Extracts the right part of a message string  The number of characters to be extracted is  given        FBD program using  LEFT  and  RIGHT  blocks     right             12345678  m  4 Mec ql CAT                                                       left   complete_string          ST Equivalence       complete_string    RIGHT   12345678   4    LEFT   12345678   4       complete_string is  56781234    the value issued from RIGHT call is  5678    the value issued from LEFT call is  1234              IL Equivalence  First done is call to LEFT       LD  12345678   LEFT 4  ST sub_string    intermediate result     LD  12345678   RIGHT 4  ADD sub_string  ST complete_string  DAY_TIME  day_time  SEL Q   Arguments    SEL INT output selection    O  get current date  1  get current time  2  get day of week  Q MSG time date expressed on a character string   YYYY MM DD  if SEL   0       ICS Triplex ISaGRAF Inc  B 309    Language Reference        HH MM SS  if SEL   1  day name if SEL   2  ex   Monday        Description   Gives date or time of the day as a message string        FBD program using  DAY_TIME  block     day_time   Oj   se q CAT             day_time    Display  1 SEL ol       ST Equivalence      Display    Day_Time  0         Day_Time  1       Display t
483. un the process  output red  LED lights      Close the Debugger window to exit from simulation  Menu  File    Command  Exit         A 22 ICS Triplex ISaGRAF Inc     User s Guide       A 2 Managing projects         t g    To run the ISaGRAF project management tool  double click the mouse on the   Projects  icon  in the ISaGRAF group  The  Project Management  window is then  opened  A project corresponds to one PLC loop run on a target PLC  The upper  window contains the list of the existing projects  The text descriptor of the selected  project is displayed in the lower window     Resizing windows    Just click on the separator  splitter  between project list and descriptor to resize  corresponding windows  The descriptor window cannot be completely hidden  It  always contains at least one line of text     Inserting separators    A separator line can be inserted before any project name  This allows grouping  some projects attached to the same application in the list layout  Use the  Edit    Toggle separator  command to insert or delete a separator before the selected  project     Moving projects in the list    To move a project in the list  you first have to select  highlight  it  Then click on its  name and drag it to a new location in the list  When dragging the project  a small  arrow on the left margin indicates where it will be placed  You can also use the   Move  commands of the  Edit  menu to move the selected project line by line   Note that if a separator is placed bef
484. unctions 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        B 174 ICS Triplex ISaGRAF Inc     Language Reference       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 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  The programs of the Sequential section  frequently us
485. unication baud rate to 19200 baud on  t0 device      Slave number   s Option    This option specifies the target slave number  It can be from 1 to 255 except number 13    0D   This slave number is used through the communication link protocol  It is needed to  distinguish slaves from each other when more than one target are running  When using the  workbench debugger  make sure the workbench slave parameter  see user   s guide  Managing  programs  matches with an existing target        C 330 ICS Triplex ISaGRAF Inc     Target User s Guide       Default value  The default slave number is 1  Same as the workbench one       Examples     isa  t  t0 Starts an ISaGRAF single task target with default slave number  1  and with   t0 as the communication port    isa  s 3  t  t1   Starts an ISaGRAF single task target with slave number 3 and with  t1 as  the communication port    isa  t  t0  amp    isa  s 3  t  t1   Starts two ISaGRAF single task targets  One with default slave number  1   and with  t0 as the communication port  The other with slave number 3 and  with  t1 as the communication port     C 4 2 Running the ISaGRAF multitasks  isaker  isatst  isanet    To improve the response time of the ISaGRAF target kernel and of the communication link   the target is split into two tasks separating communication job  isatst or isanet communication  task  from application execution  isaker kernel task     Such architecture is more flexible  It allows the user to run more than one communicat
486. unique group of steps and  transitions  represented as a unique symbol in the main chart  and described  separately     Logical division of the editing area into rectangular cells  while editing a graphic  language program     Type of variable  Such variables contains variable length character strings   Master Slave protocol  An ISaGRAF target system can be a Modbus slave for  the link with an external system  such as supervisory systems  in a complete    architecture     Single character put at the end of an IL operation keyword  which modifies the  meaning of the operation     Optional hexadecimal address freely defined for each variable  This address is  used by the Modbus protocol when the target system is connected to an  external system     SFC action  it is a list of statements  executed at each target cycle  when the  corresponding step is active     Hexadecimal 16 bit code defined for each I O board of the ISaGRAF library   The OEM code identifies the supplier of the board     I O board parameter  defined by the designer of the board  It can be a constant   or a variable parameter entered by the user during the I O connection     Variable or constant expression processed by an elementary IL instruction     Basic instruction of the IL language  An operation is generally associated to an  operand in an instruction     Attribute of a variable  Such variables are linked to an output device of the  target machine     Value given as an input to a  C  function  A type chara
487. upplier  All  the boards defined by the same supplier must have the same OEM key code  The  OEM key code is a 16 bit unsigned word  entered in a hexadecimal format  The  reserved OEM key code for ICS Triplex ISaGRAF is  1     Main parameters define the topology of the I O board  The number of channels  defines the number of available channels on the board  The type of the board is the  type of the variables that may be connected on the channels of the board  The  direction defines whether variables connected on the board are input or output  variables     Note  I O variables of different types or directions cannot be grouped on the  same ISaGRAF I O board  This feature should require complex I O equipment     The OEM parameters    The OEM parameters are entered in the lower part of the I O board parameters  definition box  These parameters are defined by the I O board hardware supplier  and are specific to the board  There are at most 16 OEM parameters for a board  A  board may have no OEM parameters  The ISaGRAF library manager allows the  hardware supplier to define the identification and the format of each parameter  and  the way the automation programmer enters it    The box on the left contains the list of the OEM parameters  A name and a logical  number  from 0 to 15 identify each parameter  The area on the right contains the  detailed description of the parameter selected on the list  A parameter is selected in  the list in order to access to its complete description  
488. urce code of a function or a function block  and how to integrate  a new element in the ISaGRAF target system     Conversion functions    A conversion function is a  C  function called by the ISaGRAF I O manager each  time the analog variables using this conversion are input to or output from the  project    The function creates the relationship between the electrical value of the variable   read on the input sensor or sent to the output device  and its physical value  used  in the application expressions   The function is therefore divided into two parts  input  conversion and output conversion  The ISaGRAF library manager allows the user to  control the  C  source code of a conversion function    A conversion can be used for an integer or real analog variable  This implies that  the conversion function interface is always defined by floating values  The interface  is the same for any conversion function  The  C  definition of this interface is made  in the  TACNODEF H  definition file    Refer to the ISaGRAF Target User s Guide for further information on how to  manage the  C  source code of a conversion function  and how to integrate a new  element in the ISaGRAF target system        ICS Triplex ISaGRAF Inc  A 151    User s Guide       A 23 Using the Archive utility    A 23 1    The ISaGRAF archive utility enables the user to save the ISaGRAF projects and  libraries on diskettes or backup directory  The ISaGRAF archive manager is a  dialog box that can be called from ISaGR
489. urce code of a program     Parameters of a function  sub program or function block    The  File   Parameters  command allows the user to define the call and return  parameters of the selected sub program  function or function block  This command  has no effect if a main program of the  Begin  or  End  section or a SFC program is  selected in the Program Management window    Sub programs  functions or function blocks may have up to 32 parameters  input or  output   A function or sub program always has one  and only one  return parameter   which must have the same name as the function  in order to conform to ST  language writing conventions     The list in the upper left side of the window shows the parameters  in the order of  the calling model  first the calling parameters last the return parameters  The lower  part of the window shows the detailed description of the parameter currently  selected in the list  Any of the ISaGRAF data types may be used for a parameter   The return parameters must be located after calling parameters in the list  Naming  parameters must conform to the following rules    e the length of the name cannot exceed 16 characters   e the first character must be a letter   e the following characters must be letters  digits or underscore character   e naming is case insensitive    The  Insert  command is used to insert a new parameter before the selected  parameter  The  Delete  command is used to erase the selected parameter  The   Arrange  command automa
490. ut or output variable    Maximum Length            Specifies the maximum number of characters that can be  stored in the message    Initial value    Initial value of the variable  length cannot exceed the    capacity of the message   If not specified  the initial value  is the empty string     al These are the description fields for a defined word    NamMe  ssssssssessseesseeerernesnns Name used in ST source files  first character must be a  letter  following characters must be letters  digits or  _    D  fin    siiin String according to ST syntax that replaces the defined  word during compiling  Example  Name   PI    Equivalence   3 14159   Comment    Free comment for defined equivalence   T These are the description fields for a function block instance    Name    eeeceeeeeeeeeeesteeeee Name of the instance  used in ST source files  first    character must be a letter  following characters must be  letters  digits or  _   TYPE hiirer asarana Name of the corresponding function block in the library   Comment         csceeeeee Free comment for the function block instance     Quick declaration    The  Tools   Quick declaration  command enables you to declare several  variables at the same time  Variables created by quick declaration are named using  a numbering convention  For that  you have to define      The index  number  of the first and the last variables      The text to be added before and after the number in variable symbols     The number of digits used to express the n
491. uts can be extended to more than two     Arguments    inputs  INT REAL can be INTEGER or REAL   all inputs must have the same format   output INT REAL signed multiplication of the input terms  Description     Multiplication of two or more analog variables        FBD example with Multiplication blocks                                        aii01  ai102 ao10  ai51  ai52  ai53 ao5                                                 ST equivalence     ao10    ai101   ai102   ao5     ai51   ai52    ai53        IL equivalence        LD ai101  MUL ai102  ST ao10  LD ai51  MUL ai52  MUL ai53  ST ao5        IN4  IN2 Q  Arguments   IN1 INT REAL can be INTEGER or REAL  operand   IN2 INT REAL non zero analog value  divisor      IN1 and IN2 must have the same format        ICS Triplex ISaGRAF Inc  B 251    Language Reference       Q INT REAL signed integer or real division of IN1 by IN2    Description   Division of two analog variables  the first divided by the second         FBD example with Division blocks                                                                      ai101 m  ai102 N2 q ao10     aid m    2 IN2 al IN  ai53 IN2 a  ao5                                        ST Equivalence      ao10    ai101   ai102   ao5     ai5   2    ai53        IL equivalence           LD ai101   DIV ai102   ST ao10   LD ai51   DIV 2   DIV ai53   ST ao5   AND_MASK   Arguments   IN INT must have integer format  MSK INT must have integer format  Q INT bit to bit logical AND between IN and MSK   Descrip
492. value oo    eeeeeeeeeceeeeeeeeeeeees A 115  A 15 6 On line Modification    eee eeeeseeseeeecneeeeeeeeeeceaecaeeseenerereeeeeeeaes A 116  A V5 7  DDE exchanges   s2ccccs  ccc  ie gee  Moen ee en AS ae A 119   A 16 Spying Lists of variables               csccsssssssssesecesscssscssssesssssssseseseeees A 121   A 17 Debugging ST and IL program              scssccssssscesscssscssssssscrsesnseeee A 123   A 18 Debugging with SpotLight         seseseesesseseesoeseesorcesoeseeeonsesoerseeoesoeeereoee A 124  A 18 1 Building the graphic layout  0         ceeceeceeseceseeeseeneeeeeeeeeeseeeeseeeens A 124  A 182   lt The list layout  eea a SH el ose a lee A 126  A 18 3 Defining the item style    ee eececceseceeeeteceseceecaeeeseeeeeeseeeereeseens A 126       ICS Triplex ISaGRAF Inc  v    User s Guide       A 18 4 Commands of the  File  Menu    cee eeeceseeeeetecneeeecneeeeceaeentenes A 127  A 18 5 Note for SaGRAF V3 2 USEMS       cc ceeeccseecceeeeeeeceeeeceeeeeeeaeeatenes A 128  A 19 Uploading applications                scscsssesssssssssssesscsessssssssssesssessessseseees A 129  AT9 1    Uploading a project aceesorii ciie i tea a i R A 129  A 19 2 Communication settings          ccccceeesseeeeceeeeeeeseeeeeeeeeeeeeseeneeerens A 129  A 19 3 Preparing a project for Upload    ee eeeeseeeteeeeeeeeeeseeeeeeseeeeeeeeens A 130  A 19 4 How zipped source are stored in the target    A 130  A 19 5 Memory requirements on the target      eceeeesesecseeeecneeeeeeseeeeeees A 131  A 19 6 About uploaded
493. variables of an instance keep their  values from one call to the other     Defining the interface    Functions or function blocks may have up to 32 parameters  input or output   A  function always has one  and only one  return parameter  which must have the  same name as the function  in order to conform to ST language writing conventions   The list in the upper left side of the window shows the parameters  in the order of  the calling model  first the calling parameters  last the return parameters  The lower  part of the window shows the detailed description of the parameter currently  selected in the list  Any of the ISaGRAF data types may be used for a parameter   The return parameters must be located after calling parameters in the list  Naming  parameters must conform to the following rules    e the length of the name cannot exceed 16 characters   e the first character must be a letter   e the following characters must be letters  digits or underscore character   e naming is case insensitive    The  Insert  command is used to insert a new parameter before the selected  parameter  The  Delete  command is used to erase the selected parameter  The   Arrange  command automatically rearranges  sorts  the parameters  so that the  return parameters are put at the end of the list        A 150    ICS Triplex ISaGRAF Inc     User s Guide       A 22 6    A 22 7     C  Functions and function blocks    The  C  functions and function blocks are computer functions called from the  auto
494. variables to the dictionary clipboard   CUT cian Copy the selected group of variables and remove it from the  edited list   CLEAR                 Remove the selected group of variables from the edited list   PASTE                 Insert the dictionary clipboard before the selected variable    Copy Cut Paste functions can be used from one list of variables to another  They  cannot be used between list of different object types     Sorting variables    The  Tools   Sort  command sorts the variables or defined words of the currently  edited list  The sorting order is given by the attributes of the variables    e first the internal variables   e then the input variables   e finally the output variables   Variables with the same attribute are sorted into alphabetical order  Defined words  are always sorted into alphabetical order     Setting network addresses    Network addresses are optional  A variable with a non zero network address can  be spied by an external system  for example a process visualisation system  at run  time  A network address may be entered for each variable  during its complete  description  when the variable is created or modified  The  Tools   Renumber  addresses  command allows the user to set up network addresses of an entire       ICS Triplex ISaGRAF Inc  A 83    User s Guide       group of variables  When this command is run  it acts on the group of variables  currently selected on the list  Entering a hexadecimal basis address  address for  the first v
495. vation and the interface of  the new element        C 398    ICS Triplex ISaGRAF Inc     Target User s Guide       C 8 Modbus link    Once the application is completely developed and tested  you may connect it to a process  visualization system      SaGRAF is an open system offering a large variety of networking possibilities    The simplest industrial network is the MODBUS MODICON standard protocol  which is  available on almost every process visualization system and which only requires a serial link   RS232  RS485  Current Loop      ISaGRAF communication debugger protocol is MODBUS compatible to enable variable  read write access from a Modbus master     C 8 1 MODBUS network and protocol    A Modbus network is composed of one master station only  usually a process visualization  system  and one or more slave stations  usually PLCs            The master sends one request at a time to one slave  using its slave number  and waits for  the slave to answer before sending the next question  Other non concerned slaves do not  answer     Each frame contains a slave number  a request number and corresponding data  and a 16 bit  checksum  CRC      If no answer is received after a time out duration  the question can be repeated a certain  number of times before the master declares the slave    disconnected       The time out value and the number of retries have to be adjusted on the master station to fit  the slave requirements  depending on the application  etc         If an error oc
496. vise  and  poke  transactions are supported by the ISaGRAF debugger  DDE server  You can use  request  transaction only for variables already spied in  an advice loop  Other DDE services such as  execute  are not available  When an  advice loop is established on a variable  the value of this variable is updated in the  client application each time it changes  Variables of any type can be spied  The  identification of the dynamic link includes the following names     Service name         SaGRAF   Topic name          Name of the ISaGRAF project  Item name            Name of the variable    If the variable is local to a program  its name must be followed by the name of its  father program  written between parentheses  with the following syntax        ICS Triplex ISaGRAF Inc  A 119    User s Guide       variable_name program_name     The ISaGRAF debugger DDE server is dedicated to the ISaGRAF application  currently spied by the debugger  The ISaGRAF server can spy up to 256 variables   The DDE server may be used when the ISaGRAF debugger runs in either  connected or simulation mode  The refresh duration is the one established for  communication between the debugger and the ISaGRAF target system or simulator        A 120    ICS Triplex ISaGRAF Inc     User s Guide       A 16 Spying Lists of variables    The  Spy lists  command in the  Spy  menu of the Debugger window enables the  user to build non contiguous lists of variables  which are refreshed with their current  values  Lists
497. w  TRUE when CV   0  CV INT counter result    Warning  The CTD block does not detect the rising or falling edges of the counting input  CD    It must be associated with an  R_TRIG  or  F_TRIG  block to create a pulse counter     Description   Count  integer  from a given value down to 0 1 by 1       FBD program using  CTD  block                                                    f_trig CTD  command joK aje  load_cmd Loan q underflow  100 Pv cy result                                     ST Equivalence  We suppose F_TRIG1 is an instance of F_TRIG block and CTD1 is an  instance of CTD block     CTD1 F_TRIG1 command  load_cmd 100     underflow    CTD1 Q    result    CTD1 CV        IL Equivalence        LD command  ST F_TRIG1 clk  CAL F_TRIG1   LD F_TRIG1 Q  ST CTD1 cd   LD load_cmd  ST CTD1 load  LD 100   ST CTD1 pv       ICS Triplex ISaGRAF Inc  B 271    Language Reference          CAL CTD1   LD CTD1 Q   ST underflow   LD CTD1 cv   ST result   CTUD   Arguments   CU BOO up counting  when CU is TRUE   cD BOO down counting  when CD is TRUE   RESET BOO reset command  dominant     CV   0 when RESET is TRUE    LOAD BOO load command  CV   PV when LOAD is TRUE   PV INT programmed maximum value  QU BOO overflow  TRUE when CV   PV  QD BOO underflow  TRUE when CV   0  CV INT counter result    Warning  The CTUD block does not detect the rising or falling edges of the counting inputs   CU and CD   It must be associated with an  R_TRIG  or  F_TRIG  block to create a pulse  counter     Descrip
498. w  or hide points of the editing grid       Enable Power flow debugging    During simulation or on line debugging of LD FBD programs  power flows appear  highlighted red or blue in order to easily follow the logic flow  However  enabling  power flow debugging affects memory allocation on the target  You enable power  flow debugging in the FBD editor  while in off line mode  from the Options menu by  choosing Enable Power flow debugging  This feature is enabled by default when  you install the Workbench        A 68    ICS Triplex ISaGRAF Inc     User s Guide       The FBD editor animates this power flow  graphical links  according to the process  values  All  0  or  FALSE  state items appear BLUE  All non zero values or  TRUE   state items appear RED              b1 TRUE  b2 FALSE    b3 F ALSE b4 F ALSE      Previewing page borders    When printed  the FBD diagram is split into folios according to the selected printer  and paper  You can choose to preview the border of each folio in the FBD editor   While creating your diagram  previewing enables you to avoid placing a symbol  where it will be split on two pages     The page borders are displayed as plain gray lines in the diagram  when the editing  grid is visible     The FBD editor uses the last selected printer configuration to display the page size   You must activate the document printer and select the right printer and paper before  viewing page borders in the FBD editor  Therefore  to preview a diagram  you must     1  
499. when all  immediately preceding steps linked to its corresponding transition symbol are  active  otherwise it is disabled  A transition cannot be cleared unless     itis enabled  and    the associated transition condition is true        ICS Triplex ISaGRAF Inc  B 199    Language Reference          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        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        Simultaneous activation and deactivation of a step  If  during operation  a step is simultaneously activated and deactivated  priority is  given to the activation     B 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    The basic rules implied by the hierarchy structure are      SFC programs  which have no father  are called  main  
500. window     The  Tools   Import IL program  can be used to import a project described as a  single IL program in a text file  according to PLC Open file exchange format        A 26    ICS Triplex ISaGRAF Inc     User s Guide       A 3 Managing programs    The Program Management window shows the programs  also called modules or  programming units  of the application and groups into its menus the available  commands  to create the project architecture  run editors  compiler and debugger   This window is the workbench kernel during the development of an application  The  Program Management window opens when running the  Open  command in the  Project Management window     A 3 1 The components of a project    The components of a project are called programs  A program is a logical entity that  describes one part of the control execution  Any program in the application can use  global variables  such as I O variables   Local variables may be used by only one  program  Programs are listed in a hierarchy tree  divided into different logical  sections  The window shows the programs and the links between them  The  Top  level  programs appear on the left side of the hierarchy tree       Top level programs    The top level programs appear on the left side of the hierarchy tree  Top level  programs of the three first sections are always active  and are executed in the  following order  during the run time cycle  scan     e  Read inputs    e Execute the top level programs of the BEGIN secti
501. wnloaded on MOTOROLA  and reverse  or if the file    ne   ne     T  D  n  o  co   D  pe   u             fo   2    3  cannot allocate communication mailbox system    This error is produced by the communication task if it cannot allocate space 3 for inter task  communication     4  cannot link kernel data base system    This error is produced by the communication task if it cannot find a kernel running with the  slave number specified in its command line     5  time out sending question to kernel system    The communication task cannot send a request to the kernel  The kernel is probably not  running or busy     6  time out waiting answer from kernel system    The communication task cannot receive an answer from the kernel  The kernel is probably not  running or busy     7  cannot init communication    system    This warning is produced when the communication layer cannot initialize the physical link   This warning is also displayed if no communication path is specified  This does not prevent  the target from running correctly  but it cannot communicate     8  cannot allocate memory for retained variables application    ISaGRAF cannot manage retained variables  There may be two reasons for such a problem      the string passed as a parameter to the host target is not syntactically correct     the size of memory specified for each block is not sufficient   You have to verify the syntax of your    retain variable    parameter  and you can try with a  reduced number of retained va
502. xt comment  The full description of the  selected variable is always displayed in the status bar  Use the following buttons in  the toolbar to select the range of variable to be edited     can be used by any program of any project  can be used by any program of the current project  LOCAL serisinin can be used by only one program    Use the  Tab  control displayed with title bar to select the type of object to  be edited     Booleans   integers Reals   Timers   Messages   FB instances   Defined words    Name Attrib  Addr  Comment    C Use the text input field on the left of the toolbar to search for a variable  prefix name  In this case  research is processed on the entire list  from the  beginning  based on the current selection  The  Edit   Find  command is also  available to search a text string in variable names and comments  and to move the  selection to this variable  Search is always case insensitive     Managing variables    The available  Files  menu commands work on the entire selected class of  variables  function block instances or defined words  Use the  Other  command to  select the type and range of objects to be edited     Printing variables    Use the  Files   Print  command to print the currently edited list of variables or  defined words  on a standard Windows    printer device  Printing is made using the  ISaGRAF document generator  The printout includes the complete description of  each variable or defined word of the currently edited type        A 82    I
503. y  a dongle which you place on the parallel or USB port of your  computer is delivered pre programmed with the selected feature set  When using a  software key  you need to obtain an authorized license  You license products in the  License Manager     The hardware key can be connected to any parallel port on the computer  If the  computer has more than one parallel port  it is preferable to connect the key and  printer to different ports  For some computer printer configurations  the hardware  key may not be recognised when its output is connected to an off line printer  In this  case  either disconnect the printer or start it in the on line state  then restart the  ISaGRAF Workbench     Note  When using a hardware key on Windows NT systems  you must install  the Sentinel driver in order for the key to be seen  You install the driver by  double clicking the Setup exe file located at the root of the ISaGRAF CD   ROM in the Sentinel folder  then following the on screen instructions        A 14    ICS Triplex ISaGRAF Inc     User s Guide       ISaGRAF is available in two feature sets        Limited number of I Os  having a limited number of I Os ranging between 1  and 4095     Large  having an unlimited number of I Os    Both feature sets include the use of the ST  Structured Text  and IL  Instruction List   programming languages  However  to enable the use of any other of the available  languages in the Workbench  you need to specify these     SFC  Sequential Function Chart   F
504. y the rung  comments in the whole diagram  Hiding the rung comments can be required to have  a more condensed view on a huge diagram  as each comment consumes one row  in the editing matrix  This option does not affect the contents of the existing rung  comments and can be swapped at any time     Names and aliases    Each variable  when associated to a contact  a coil or a block I O parameter is  identified by its symbolic name  The ISaGRAF Quick LD editor also introduces the  notion or  alias  for each variable  The alias of the variable is the variable comment  text  truncated before the first     character  and limited to 16 characters  Below are  examples     variable comment  alias    short text short text   long text with no separator long text with n  short text  long description short text    Aliases have no effect on the execution of the LD diagram and should be  considered as comments from a syntactic point of view  A variable alias is  automatically extracted from the variable comment when the name is selected in the  variable list  It cannot be changed manually  Use the  Options   Contacts and  coils  commands to select a display mode for variable identification  The following  modes are available    e display only the variable names   e display only the variable aliases   e display both names and aliases       A 60    ICS Triplex ISaGRAF Inc     User s Guide       Quick LD editor does not automatically updates LD documents when variable  aliases are changed in th
505. y the supplier of the    corresponding I O board or equipment  Use the  Tools   Technical note  command  or refer to your hardware manual for more information about board parameters     A 11 3 Connecting I O channels    To set the connection of a channel  the user has to double click on its location in the  list on the right  It is also possible to select  highlight  it and run the  Edit   Set  channel parameter  command  The following icons are used to represent channels    in the list   Oe se Free channel    ere Connected channel    The list contains all the variables  which match with the selected board type and  direction  Only variables  which are not yet connected  are listed here  The   Connect  button connects the variable selected in the list to the selected channel   The  Free  button removes  disconnects  the variable from the selected channel    Next  and  Previous  buttons are used to select another channel of the board  The  location of the selected channel is always displayed in the title of the dialog box     A 11 4 Directly represented variables    Free channels are the ones  which are not linked to a declared I O variable   ISaGRAF enables the use of directly represented variables in the source of the  programs to represent a free channel  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 bo
506. y will  automatically appear in box selection menu when using the LD FBD graphic editor  within a project        ICS Triplex ISaGRAF Inc  A 149    User s Guide       A A function defined in the library can call other functions of the library   However  the ISaGRAF system does not support recursive function calling  A  function block written in IEC language cannot call other function blocks  neither in  IEC nor in  C  language      Entering source code    The source code of a library function or function block is entered using standard  ISaGRAF tools  graphic editor for LD or FBD programs  text editor for ST or IL  programs  Refer to the corresponding sections in this manual for more information  about these tools  The ISaGRAF Code Generator can be directly called from the  graphic or text editing window  to compile the source code of a library function or  block     Dictionary of local variables    A library function or function block can have local variables  and local defined  words  To access the variable declaration  the user must run the commands of the   Dictionary  command of the  File  menu  in the editor window  while editing the  source code of the function     A A library function or function block cannot access a global variable or  function block instance  Local variables of a function should be initialised in the  function body     Local variables of a function block written in IEC language are copied  instanced   each time the block is used in a project  Local 
507. ze in bytes  If the running mode is    C compiled     this field is  zero    The data size in bytes  This is the sum of the runtime internal data and the  variables database      SaGRAF NT target simulation of virtual boards     When the option    Simulate I O    is selected  at the next application start the following  window will appear     1  2  3  4  5  6  U  8          booooooo  les       C 362    ICS Triplex ISaGRAF Inc     Target User s Guide       Depending on your I O connection configuration  there will be more or less boards  and  different  and more or less variables  and different   The numbers    s b   at the top of each  board represent the slot identifier  s  and the board identifier  b   The count starts at zero  and  it isn   t possible to modify it    The    32bits Boards Simulator    window works with the Start Stop application state  So if there  is a running application which has virtual boards  or uses simulator boards  and the     Simulate I O    flag is checked  this window will appear  On the contrary as soon as the Stop  push button is depressed  it will be closed  This window works along with the I O calls     The  Options  menu proposes two items     Variable names will show the names of the variables if and only if the symbol table  has been downloaded prior to the tic code     Hexadecimal values will show each integer in hexadecimal format instead of default  decimal format    The variable names will look as follows        32bits Boards Simulato
    
Download Pdf Manuals
 
 
    
Related Search
    
Related Contents
  L555 Guía de referencia rápida  DSBA3400 rev 08-07-2014 DOC TECHNIQUE VR  Bibliographie  〔取扱説明書〕  7 STEPS TO SPECIFYING A DL205 SYSTEM  SD Tools Manuel d`installation  WC Live! Motion.fm  取扱説明書  Samsung SP-S4223 Manuel de l'utilisateur    Copyright © All rights reserved. 
   Failed to retrieve file