iB686

                  After some work with IEC languages
                  returning to assembly language looks like
                  "to build a computer on МП39 soviet transistors".

                  Igor Petrov 
                  Small shots for large artillery..,
                  http://www.kit-e.ru/articles/industrial/2005_4_166.php

## GEBAUTOMATION. FIRST LOOK.

  https://www.gebautomation.com/
  
Download page:

GEB Automation IDE - Professional IEC 61131-3 programming.

Version 3.2.11.209 for Windows (7 or above, 64 bits). 
Installer size: 122.9 MB.

For Linux (64 bits, requires Java 8) : Version 3.2.9.154.

Installed to default location (C:\geb)

1. File -> new -> new 61131-3 project
  
    Project name: GEBHello
    [v] Use default location
    [ ] Add project to working sets
    
    [ Finish ]
    
2. GEBHello (RClick) -> Properties -> GEB project properties ->

     Device Selected: WIN_LOCAL  [ Apply and Close ]

! Just Remember ! 
    
     %IX54.1-16 Input bit in file
     %QX55.1-16 Input bit in file

3. GEBHello (RClick) -> Create new POU:

     POU name: cntHELLO
     POU lang: LD
     POU type: PROGRAM
     
     |       X1                   Q1      |
     |------| |------------------( )------|
     |                                    |
     |       X2                   Q2      |
     |------| |------------------( )------|
     |                                    |
     
Elements:    contact -> X1, contact -> X2, coil -> Q1, coil -> Q2
Connections: Connection Tool (connect from left to right)
Palette:     Selection tool (beautify)

Ladder variables
         
  var_name  data_type  modifier  AT
  X1        BOOL       VAR       %IX54.1
  X2        BOOL       VAR       %IX54.2
  Q1        BOOL       VAR       %QX55.1
  Q2        BOOL       VAR       %IX55.2
  
4. Project -> Build All

   Run -> Debug as -> GEB Simulator:
       Times to run: 0
       Cycle duration: 250

5. Play with stimulus (to the left Digital Inputs, Analog Inputs), observe reactions (Digital Outputs, Analog Outputs).

   Window -> Perspective -> Reset Perspective (if you see sth. else)
   
   [RED] Stop Debugging
   
Back to developer's perspective (Eclipse, left to button with little bug (like [Ж]))
   
6. GEBHello (RClick) -> Create new POU:

     POU name: fakeFBD
     POU lang: FBD
     POU type: FUNCTION_BLOCK

  var_name  data_type  modifier
  
  X1        BOOL       INPUT
  X2        BOOL       INPUT
  Q         BOOL       OUTPUT
  
  Inputs are Elements : Expression
  
  Enter an IEC-61131-3 expression (RHS) to be read
  Typically a literal or a variable reference
  [ X1            ]
  
  Outputs are Elements : Varable Ref
  
  Enter name of variable to be written
  It should be correspond to a non-constant variable
  [ Q             ]
  
     X1  X2  Q
     0   0   0
     0   1   1
     1   0   1
     1   1   0
     
7. GEBHello (RClick) -> Create new POU:

     POU name: fakeST
     POU lang: ST
     POU type: FUNCTION_BLOCK

  FUNCTION_BLOCK fakeST 
    VAR
    END_VAR
    VAR_INPUT
      X1: BOOL;
      X2: BOOL;
    END_VAR
    VAR_OUTPUT
      Q: BOOL;
    END_VAR
    
    Q := X1 AND NOT X2 OR NOT X1 AND X2;
    
  END_FUNCTION_BLOCK

8. Build Project
   File -> Save
   
9. Modify container (cntHello):

  Place and connect
  
    Block -> Select POU
      > GEBHello : fakeFBD (FB)
      
    Block -> Select POU
      > GEBHello : fakeST (FB)
      
A. Project -> Build All

   Run -> Debug as -> GEB Simulator:
       Times to run: 0
       Cycle duration: 250

B. Play with stimulus (to the left), observe reactions.

   Window -> Perspective -> Reset Perspective (if you see sth. else)
   
   [RED] Stop Debugging

C. It's done.

## NOTES:

1.  To Change POU type please press this: -
                                            \
Problems  Ladder Variables  Console          \
                                              \
                                      [ POU Name/Type ][ Add Variable ]
      