VG108 General Programming Help Topics

___________________________________________________________________________

A word to word help is also provided, just select the word & press key F4

Before proceeding to write a program, it is necessary to understand Flags, Input, Output, Counters, Timers, structure of program and statements.

Flags

Input

Output

Counters

Timers

Programming Structure

Statements


Type of Flags

Flag

__________________________________________________________________________

Flags are Boolean These Flags can be put to on or off and/or it can be tested whether they are ON or OFF while programming.

There are two types, USERFLAG and SYSTEMFLAG.

SystemFlag

UserFlag

TimersFlag


SystemFlag

__________________________________________________________________________

SYSTEMFLAGS:-

are supplied by system software and can only be addressed by its name E.g. OnOffFlag. This Flag is turned on & off at every one second, one can use this flag to flicker any output but can not put to on or off.

ErrorFlag, AuxErrorFlag, RemoteFlag, DataOkFlag, OnOffFlag are system flags.

R Flag.

R flag is resultant flag can be set to on or off, or can be tested in all block programming. (Can not be used in wagon programming).

This resultant flag R is addressed as R

E.g. To set resultant flag R to off One has to write a statement.

Putoff R

Errorflag is set to on whenever error occurs else it is off. This error occurs due to mainly plant halt in auto.

AuxErrorFlag is set to on whenever error occurs else it is off. This error occurs on communication fail, buffer full, instrument not responding or manual error of plant.

RemoteFlag is set to on whenever plant is in remote mode else it is off.

DataOkFlag is set to on if memory retains data at time of power is switched on else set to off. This flag is set by system at time of power is switched on.

OnOffFlag is set to on & off at every one second.


UserFlag

__________________________________________________________________________

USERFLAG:-

256 GlobalFlag are numbered as 0 To 255.

256 Sequnce1Flag (Wagon1Flag) are numbered as 0 To 255.

256 Sequnce2Flag (Wagon2Flag) are numbered as 0 To 255.

256 Sequnce3Flag (Wagon3Flag) are numbered as 0 To 255.

256 Sequnce4Flag (Wagon4Flag) are numbered as 0 To 255.

256 Sequnce5Flag (Wagon5Flag) are numbered as 0 To 255.

256 Sequnce6Flag (Wagon6Flag) are numbered as 0 To 255.

256 Sequnce7Flag (Wagon7Flag) are numbered as 0 To 255.

256 Sequnce8Flag (Wagon8Flag) are numbered as 0 To 255.

Global Flag can be set to on or off, or can be tested in all sequence programming. All Global Flags are addressed as GlobalFlag.

Flag 0 of Global is addressed as GlobalFlag.0

E.g. To set Flag 0 to off One has to write a statement.

Putoff GlobalFlag.0

All sequence (Wagon) flags are related to its own sequence (Wagon). Refer in details AutoBlock4.Program written in Wagon1 can not set other Wagon (2 To 8) flag.

Flag 0 of sequence1 is normally addressed as Sequence1Flag.0 or Wagon1Flag.0, while Wagon programming it is addressed as MyFlag.

To set Sequence1Flag 0 to on one has to write following statement.

E.g. Puton Sequence1Flag.0 or Puton Wagon1Flag.0

Puton MyFlag.0 while programming in wagon block.


Type Of Counters

Counter

__________________________________________________________________________

Counters value ranges from 0 to 99.With post suffix H with value, counter value can be extended to 255. These Counters can be set to value, value can be tested, or can be compared while programming.

There are two types, USERCOUNTER and SYSTEMCOUNTER.

SystemCounter

UserCounter

TimersCounter


SystemCounter

__________________________________________________________________________

SYSTEMCOUNTERS:-

Are supplied by system software and can only be addressed by its name E.g. Hour counter. This Counter is real clock HOUR counter. Its value is 0 to 23, varies as per hour passed one can only set its value. Or off.

Hour, Minute, Second, Display Line, ErrorNumber, ErrorStart, Errorstop are system Counters.

Hour value ranges from 0 to 23; it is updated at every real time hour.

Minute value ranges from 0 to 59; it is updated at every real time minute.

Second value ranges from 0 to 59; it is updated at every real time second.

Please note that Hour, Minute, Second counters are system counter, although they still come under UserCounter Categories. One can use it as UserCounter.

Display Line value ranges from 0 to 7.VG108 LCD is 32 character two line display(i.e. two line of display is shown at a time.) and one can scroll up to 16 lines(Line 0 To 15) to see different status of plant.

When Display Line value = 0 then LCD line 0 & 1 are shown. When Display Line value = 1 then LCD line 2 & 3 are shown. Similarly When Display Line value = 7 then LCD line 14 & 15 are shown & vice versa.

E.g. If one set this value = 4, then VG108 LCD line 8 & 9 will be shown.

ErrorNumber it shows error number occurred at time of error. Or one set this value and can create its error.

ErrorStart and ErrorStop one can set this two counters value. At time of error occurs display line 0 will be rotated within these two counters.


UserCounter

__________________________________________________________________________

USERCOUNTER:-

224 Global are numbered as 0 To 223.

224 Sequnce1 are numbered as 0 To 223. (Can be addressed as Wagon1).

224 Sequnce2 are numbered as 0 To 223. (Can be addressed as Wagon2).

224 Sequnce3 are numbered as 0 To 223. (Can be addressed as Wagon3).

224 Sequnce4 are numbered as 0 To 223. (Can be addressed as Wagon4).

224 Sequnce5 are numbered as 0 To 223. (Can be addressed as Wagon5).

224 Sequnce6 are numbered as 0 To 223. (Can be addressed as Wagon6).

224 Sequnce7 are numbered as 0 To 223. (Can be addressed as Wagon7).

224 Sequnce8 are numbered as 0 To 223. (Can be addressed as Wagon8).

Global Counter can be set to value, or can be tested in all sequence programming. All Global Counters are addressed as Global.

Counter 0 of Global is addressed as GlobalCounter.0

E.g. To set its value to 25 of counter 0, One has to write a statement. Global.0 = 25

All sequence (Wagon) Counters are related to its own sequence (Wagon). Refer in details AutoBlock4.Program written in Wagon1 can not set other Wagon (2 To 8) Counter.

In Wagon programming one has to address it as My.0

Counter 0 of sequence1 is normally addressed as Sequence1.0 or Wagon1.0

E.g. To set its value to 25, One has to write a statement.

Sequence1Counter.0 = 25 or Wago1.0 = 25

My.0 = 25 while programming in wagon block.

Hour, Minute and Second are also treated as UserCounter. (See in SystemCounter)


Type of Timers

Timer

__________________________________________________________________________

There are three types of timers. Namely Timer, AlarmTimer, DwellTimer.

There are 48 Timer are numbered as 0 To 47, 8 AlarmTimer (One for each sequence used by system) are numbered as 0 To 7, 8 DwellTimer (One for each sequence used by system) are numbered as 0 To 7.

Each type of Timer has its own TimersCounter & TimersFlag.

TimersCounter

TimersFlag

Timer:-

There are 48 timers numbered as 0 to 47.Units of these timers can be set as in seconds or in minutes.

AlarmTimer:-

There are 8 timers numbered as 0 to 7.Each AlarmTimer is associated with its sequence. If one is using, sequence1 then one should not use AlarmTimer0, because it is used by system to create an error in case a step of said sequence is not completed in given AlarmTime.

This Timer unit is in 0.1second

DwellTimer:-

There are 8 timers numbered as 0 to 7.Each DwellTimer is associated with its sequence. If one is using, sequence1 then one should not use DwellTimer0, because it is used by system to wait for given dwell time after completion of current step and before jumping to next step.

This Timer unit is in 0.1second


Addressing TimersCounter

TimersCounter

__________________________________________________________________________

Each type of Timers has two counters, High & Low. High counter retains unit 100’s of Timer value while Low retains unit 1’s of Timer value. Like other counter one can load value, test value & can compare value.

This way one can address TimerHigh & TimerLow for 48 Timers.AlarmTimerHigh & AlarmTimerLow for 8 AlarmTimers.DwellTimerHigh & DwellTimerLow for 8 DwellTimers.

E.g. to load value of 1234 seconds in Timer 0,One has to load value 12 in High counter & value 34 in Low counter of that Timers. And Statements for loading are

TimerHigh.0 = 12 & TimerLow.0 = 34

E.g. to load value of 1234 seconds in AlarmTimer 0,One has to load value 12 in High counter & value 34 in Low counter of that Timers. And Statements for loading are

AlarmTimerHigh.0 = 12 & AlarmTimerLow.0 = 34

E.g. to load value of 1234 seconds in DwellTimer 0,One has to load value 12 in High counter & value 34 in Low counter of that Timers. And Statements for loading are

DwellTimerHigh.0 = 12 & DwellTimerLow.0 = 34


Addressing TimersFlag

TimersFlag

__________________________________________________________________________

All three types of Timers have its own flag.

Timer flag is addressed as TimerFlag

AlarmTimer flag is addressed as AlarmTimerFlag

DwellTimer flag is addressed as DwellTimerFlag

TimerFlags are Boolean Like other flag; Timers flag can be set to on or off or can be tested to branch to other step.

E.g. To set TimerFlag 0 to off One has to write a statement.

Putoff TimerFlag.0

E.g. To set AlarmTimerFlag 0 to off One has to write a statement.

Putoff AlarmTimerFlag.0

E.g. To set DwellTimerFlag 0 to off One has to write a statement.

Putoff DwellTimerFlag.0


Switches & Proximities

Input

__________________________________________________________________________

Inputs are also treated as Boolean All type of switch, proximities hard coupled to VG108 are treated as Input. One can set it on to off or can test it. Although at end of program its value changes as per its absolute value of switch. There can be maximum 256 inputs are numbered as 0 To 255.

They are addressed as Input. Input 8 is addressed as Input.8

E.g. to test Input 8 is on one has to give following statement.

If Input.8 Is On

First Four inputs are used by system. One should always try to avoid use of these inputs.

Input 0 is used for Emergency. If this is on then Emergency is On. If it is Off then Emergency off. Status of this input is shown on first line (Out of two lines) of display line 0(they are 0 to 7).

Input 1 is used to rollover display line 0 to 7

Input 2 is used for Auto/Manual. If this is on then Auto .If it is Off then Manual. Status of this input is shown on first line (Out of two lines) of display line 0(they are 0 to 7).Emergency has priority.


Relays & Contactors

Output

__________________________________________________________________________

Outputs are also treated as Boolean All type of relay, contactors hard coupled to VG108 are treated as Output. One can set it on to off or can test it. Although at end of program its value changes as per its value se in program. There can be maximum 256 Outputs are numbered as 0 To 255.

They are addressed as Output. Output 8 is addressed as Output.8

E.g. to test Output 8 is on one has to give following statement.

If Output.8 Is On

Output 0 and 8 Outputs are used by system. One should always try to avoid use of these Outputs.

Output 0 is used for Error conditional time of error it flickers at rate of second.

Output 8 is used for Auxiliary Error conditional time of this error it flickers at rate of second.


Block or Program  Structure
Programming Structure

__________________________________________________________________________

For ease of programming, programming is divided into 10 blocks.

Procedure Block0.

Initialize Block1.

Initial Run Block2.

Initial AutoRun Block3.

AutoStep Block4.

End AutoRun Block5.

Initial ManualRun Block6.

ManualStep Block7.

End ManualRun Block8.

End Run Block9.

Fixed Message Block10.


Procedure Programming

Procedures, Block 0

___________________________________________________________________________

This block will no be scanned by program but can be called upon later in program by Call Statement. There are 8 procedures. Select the procedure number from sub-list. To call a Procedure0 in your program just write statement Call 0.

One can write all type of statements available in VG108.


Once Power on Programming

Initialize Run, Block 1

___________________________________________________________________________

Block 1 also will no be scanned continuously, but it will be scanned only once at time of power on, thus it helps to initialize some counters, Counters or even routines or a fixed messages

on display.

e.g.

DataOk flag is set to ON by system software if Data’s are not lost else it is set to OFF.

You can use following statements in this block to supply information to user’s on 14th display line of LCD.

If DataOk Is On

  Display 14 “Data are safe”

Else

  Display 14 “Data Lost Check Battery.”

End If


Initial Run Programming

Initial Run, Block2

___________________________________________________________________________

All inputs will be refreshed as per their switch or proximities status. All statements in these blocks are executed first in program. These statements are executed regardless of auto mode or manual mode.


Initial AutoRun Programming

Initial AutoRun, Block3

___________________________________________________________________________

All statements in these blocks are executed only if plant is in auto mode. (Input 2 of card 0 is ON)  & also they are executed before block5.Here you can write all statements which are needed for AutoStep block4 required.

In Sequence0 Step0 of AutoStep Block4, one requires that this step is completed if any one of Input 5 or Input 6 is on.

R = Input.5

Nonparallel Input.6

Input.5 = R

Then In Sequence0 Step0 of AutoStep Block4, One has to select Input 5 as to complete that step. Here one can loose Input 5; Because Input 5 is replaced with Input5 Or Input 6.

If one wants to use Input 5 in program afterwards then he has to save Input 5 in any other suitable Boolean. Like Following

Input.40 = Input.5 `It is assumed Ip.40 is not used anywhere

R = Input.5

Nonparallel Input.6

Input.5 = R

Now if one wants to use Input.5 in his program then he should always refer Input.40 instead of Input.5

Another way where Input 5 & Input6 are O red and stored in GlobalFlag 3

R = Input.5

Nonparallel Input.6

GlobalFlag.3 = R

Then In Sequence0 Step0 of AutoStep Block4, One has to select GlobalFlag 3 as to complete that step.


AutoStep Programming

AutoStep Run Mode, Block4

___________________________________________________________________________

Block 4 is used for 8 sequence program. For ease of a Zero maintenance programming this block is further divided in step completing, statement, step message, step alarm time and step Errortext.


End AutoRun Programming

End AutoRun, Block5

___________________________________________________________________________

Generally this block is used to switch all outputs requires in automode. As one is aware that output can be switched in AutoStep Run Mode Block4 statement section, as this output is not switched off if emergency is pressed or error is on, but switching outputs in this block means they will be switched off automatically at time of error or emergency is on.


Initial ManualRun Programming

Initial ManualRun, Block6

___________________________________________________________________________

All statements in these blocks are executed only if plant is in manual mode. (Input 2 of card 0 is OFF) & also they are executed before block6.Here you can write all statements which are needed for ManualStep block7 required.


ManualStep Run Programming

ManualStep Run, Block7

___________________________________________________________________________

This is applicable only for Si-110 system.


End ManualRun Programming

End ManualRun, Block8

___________________________________________________________________________

This is applicable only for Si-110 system.

Generally this block is used to switch all outputs requires in maualmode. As one is aware that output can be switched in ManualStep Run Mode Block7 statement section, as this output is not switched off if emergency is pressed or error is on, but switching outputs in this block means they will be switched off automatically at time of error or emergency is on.


End Run Programming

End Run, Block9

___________________________________________________________________________

All statements in these blocks are executed last in program. These statements are executed regardless of auto mode or manual mode. all outputs will be switched as per their status in this block after completing this step.


Fixing Display Messages

Fixed Messages, Block10

___________________________________________________________________________

Block 10 allows you to fix your display messages, still any message supplied directly in programmed will automatically be fixed in this block at time of compiling. To avoid inconvenience it is better to observe that each line of display messages does not increase more then 32 characters And a correct message is put to its correct line number.


Type of Statements

Statements

___________________________________________________________________________

All Statements

Boolean Manipulating Statements

Conditional Statements

Counter Manipulating Statements

Function Statements

Timer Statements


List of Statements

All General Statements

+1 USERCOUNTER

-1 USERCOUNTER

+1H USERCOUNTER

-1H USERCOUNTER

ANALOGCOUNTER = VALUE (0 TO 9999)

Boolean = Boolean

Call (0 To 7)

COUNTER = COUNTER

Display (0 To 15) (“32 character message”)

Else

End If

Goto Step (0 To 255)

If ANALOGCOUNTER = VALUE (0 TO 9999)

If ANALOGCOUNTER <> VALUE (0 TO 9999)

If ANALOGCOUNTER <= VALUE (0 TO 9999)

If ANALOGCOUNTER >= VALUE (0 TO 9999)

If ANALOGCOUNTER < VALUE (0 TO 9999)

If ANALOGCOUNTER > VALUE (0 TO 9999)

If Boolean Is ClickedOff

If Boolean Is ClickedOn

If Boolean Is Off

If Boolean Is On

If USERCOUNTER = USERCOUNTER

If USERCOUNTER <> USERCOUNTER

If USERCOUNTER <= USERCOUNTER

If USERCOUNTER >= USERCOUNTER

If USERCOUNTER < USERCOUNTER

If USERCOUNTER > USERCOUNTER

If USERCOUNTER = (0 To 99)

If USERCOUNTER <> (0 To 99)

If USERCOUNTER <= (0 To 99)

If USERCOUNTER >= (0 To 99)

If USERCOUNTER < (0 To 99)

If USERCOUNTER > (0 To 99)

NcParellel Boolean

NcSeries Boolean

Nonparallel Boolean

NoSeries Boolean

OnOff Boolean

Putoff Boolean

Puton Boolean

Reset

Trigger TIMERS

Trigger TIMERS By USERCOUNTER

Trigger TIMERS Data = VALUE (0 TO 9999)

USERCOUNTER = USERCOUNTER + VALUE (0 To 99)

USERCOUNTER = USERCOUNTER - VALUE (0 To 99)


Boolean Manipulating statements

Boolean Statements

___________________________________________________________________________

Boolean = Boolean

If Boolean Is On

If Boolean Is Off

If Boolean Is ClickedOn

If Boolean Is ClickedOff

NcParellel Boolean

NcSeries Boolean

Nonparallel Boolean

NoSeries Boolean

OnOff Boolean

Puton Boolean

Putoff Boolean


If Else End If Statement
Conditional Statements

___________________________________________________________________________

One can test a Boolean  or a Counter value and can continue program or branch program.

Following are different type of conditional statement

Statement Type1

If (Condition)

    Program Steps

End If

Statement Type2

If (Condition)

    Program Steps A

Else

    Program Steps B

End If

Following are types of condition for a Boolean.

If Boolean Is On

If Boolean Is Off

If Boolean Is ClickedOn

If Boolean Is ClickedOff

Following are types of condition for a Counter.

If COUNTER (Operator) Value

If COUNTER (Operator) Counter

Where Operators are = , <> ,< , > , <= , >=


Counter Manipulating statements

Counter Statements

___________________________________________________________________________

+1 COUNTER

-1 COUNTER

+1H COUNTER

-1H COUNTER

COUNTER = COUNTER + Value

COUNTER = COUNTER - Value

COUNTER = COUNTER

COUNTER = Value

If COUNTER (Operator) Value

If COUNTER (Operator) Counter


Function Statements

___________________________________________________________________________

Display (Display Line 0 To 15) (Message Or Message Number)

Call (0 To 7)

Reset


Timer Commands
Timer Statements

___________________________________________________________________________

Trigger TIMERS

Trigger TIMERS By USERCOUNTER

Trigger TIMERS Data = VALUE (0 TO 9999)


Increment Counter

+1 UserCounter

____________________________________________________________________

Example

Statement Type1

+1 UserCounter

UserCounter: - All Sequence (Wagon) and Global counters. Although Hour, Minute & second counters can be used but they will have bad effect as they are system clock counters.

These statements add 1 to given UserCounter If value of counters after adding is 100 then counter is cleared to value zero.

Statement Type2

+1H UserCounter

These statements add 1 to given UserCounter If value of counters after adding is 256 then counter is cleared to value zero.

E.g.

+1 Sequence1.0 (+1 Wagon1.0)

+1 Global.0

+1H Sequence1.0 (+1 Wagon1.0)

+1H Global.0


Decrement Counter

-1 UserCounter

____________________________________________________________________

Example

Statement Type1

-1 UserCounter

UserCounter: - All Sequence (Wagon) and Global counters. Although Hour, Minute & second counters can be used but they will have bad effect as they are system clock counters.

These statements subtract 1 from given UserCounter If value of counters after subtracting is less then 0, counter is cleared to value 99.

Statement Type2

-1H UserCounter

These statements subtract 1 from given UserCounter If value of counters after subtracting is less then 0, counter is cleared to value 255.

E.g.

-1 Sequence1.0 (+1 Wagon1.0)

-1 Global.0

-1H Sequence1.0 (+1 Wagon1.0)

-1H Global.0


Boolean Saving or Transferring

Bollean = Boolean

___________________________________________________________________________

Statement

Boolean1 = Boolean2

Boolean2 value is stored in Boolean1.while Boolean1 value is changed to Boolean2 value, Boolean2 value remains unchanged Following are possibilities of New R.

In Ladder logic it is like  [image] where B1 & B2 are Boolean.

E.g.

R = Input.1

Output.1 = R

Output.1 = Input.1

GlobalFlag.5 = Sequence1Flag.12

Sequence5Flag.14 = Sequence1Flag.12


Call Procedure

Call Procedure (0 To 7)

_________________________________________________

There are 8 procedures can be written in Procedure block0 which may require frequently. This block can be called upon latter in your program by given statements

Statement

Call Procedure

Procedure: - is value ranges from 0 to 7 for calling a corresponding procedure block.

E.g.

In Procedure0 block Following Program is written

If Wagon1.219 = 10       ‘if Wagon1 Current station value = 10

  Output.23 = Output.1   ‘Output 23 = Wagon1 lift Output

End If

Latter in program if Call 0 statement is found then procedure block will be executed instead of Call 0


Counter Saving or Transferring

Counter = Counter

______________________________________________________________________

Statement

Counter1 = Counter2

Counter1:- is UserCounter or TimerCounter

Counter2:- all type of counter. System, User & Timers counter.

Counter1 value is changed to Counter2 value.Counter2 value remains unchanged.

E.g.

Wagon1.2 = Wagon1.5

Global.5 = Wagon.3

Global.123 = Hour


Message Display

Display (0 To 15) Message

______________________________________________________________________

Example

Statement

Display LineNumber Message

LineNumber: - 0 to 15.

Message: - is 32 character message starting with apostrophe’s character “

Or is a number from 0 to 255.If this is a number, then in Fixed Message Block10 in same line one should write require message.

E.g. Message = Waiting for LiftArm to Lower and Statement is Display 3 10

Then In 10th line of Fixed Message Block10 one should write Waiting for LiftArm to Lower


Step Jump

GoTo Step (0 To 255)

______________________________________________________________________

Note: - This statement is only applicable in Program Block4

Statement

Goto Step

Step: - value from 0 to 255.


Boolean On Test and Branch
If Boolean Is On

___________________________________________________________________________

Example

Statement Type1

If Boolean Is On

  Statements

End If

Boolean: - SystemFlags, UserFlags, Inputs, Outputs and TimerFlags are Boolean.

Statements: - All VG108 statements. Like Puton Output.2

If Boolean value is on then statements will be executed.

Statement Type2

If Boolean Is On

  Statements A

Else

  Statements B

End If

Boolean: - SystemFlags, UserFlags, Inputs, Outputs and TimerFlags are Boolean.

Statements A: - All VG108 statements.

Statements B: - All VG108 statements.

If Boolean value is on then only statements A will be executed if value is off then only statements A will be executed.

e.g.

If R is On

If DataOkFlag is On

If Wagon1Flag.25 Is On (If Sequence1Flag.25 Is On)

If Input.25 Is On

If Output.25 Is On

If TimerFlag.0 is On

If AlarmTimerFlag.0 is On

If DwellTimerFlag.0 is On


Boolean On Example

In this example if Input 25 is off then program will not execute anything but if Input 25 is on then Output 12 will be turned on and on display line 5 “Program 25 is On.” message will appear. However once input 25 is on message is put on to display line will not be removed from line and output 12 remains on until new statement make changes to same display line and output 12.

If Input.25 Is On

   Puton Output.12                  ‘Turn Output 12 on

   Display 5 “Input 25 is On.”      ‘Display on Line 5 “Input 25 Is On”

End If

Here “Else’ statement can also be used.

In given example if Input 25 is on Output 12 will be turned on and display line 5 shows Program 1 Selected. Otherwise Output 12 will be turned off on display line 5 shows Program 2 Selected.

If Input.25 Is On

   Puton Output.12                        ‘Turn Output 12 on

   Display 5 “Program 1 Selected.”      ‘Display on Line 5

Else

   Putoff Output.12                       ‘Turn Output 12 off

   Display 5 “Program 2 Selected.”      ‘Display on Line 5

End If


Boolean Off  Test and Branch

If Boolean Is Off

___________________________________________________________________________

Example

Statement Type1

If Boolean Is Off

  Statements

End If

Boolean: - SystemFlags, UserFlags, Inputs, Outputs and TimerFlags are Boolean.

Statements: - All VG108 statements. Like Puton Output.2

If Boolean value is off then statements will be executed.

Statement Type2

If Boolean Is Off

  Statements A

Else

  Statements B

End If

Boolean: - SystemFlags, UserFlags, Inputs, Outputs and TimerFlags are Boolean.

Statements A: - All VG108 statements.

Statements B: - All VG108 statements.

If Boolean value is off then only statements A will be executed if value is on then only statements A will be executed.

e.g.

If R is Off

If DataOkFlag is Off

If Wagon1Flag.25 Is Off (If Sequence1Flag.25 Is Off)

If Input.25 Is Off

If Output.25 Is Off

If TimerFlag.0 is Off

If AlarmTimerFlag.0 is Off

If DwellTimerFlag.0 is Off


Boolean Off Example

In this example if Input 25 is on then program will not execute anything but if Input 25 is off then Output 12 will be turned on and on display line 5 “Program 25 is On.” message will appear. However once input 25 is off message is put on to display line will not be removed from line and output 12 remains on until new statement make changes to same display line and output 12.

If Input.25 Is Off

   Puton Output.12                  ‘Turn Output 12 on

   Display 5 “Input 25 is On.”      ‘Display on Line 5 “Input 25 Is On”

End If

Here “Else’ statement can also be used.

In given example if Input 25 is off Output 12 will be turned on and display line 5 shows Program 1 Selected. Otherwise Output 12 will be turned off on display line 5 shows Program 2 Selected.

If Input.25 Is Off

   Puton Output.12                        ‘Turn Output 12 on

   Display 5 “Program 1 Selected.”      ‘Display on Line 5

Else

   Putoff Output.12                       ‘Turn Output 12 off

   Display 5 “Program 2 Selected.”      ‘Display on Line 5

End If


Boolean ClickedOn Test and Branch

If Boolean Is ClickedOn

___________________________________________________________________________

Example

Statement

If Boolean Is ClickedOn

  Statements

End If

Boolean: - SystemFlags, UserFlags, Inputs, Outputs and TimerFlags are Boolean.

Statements: - All VG108 statements. Like Puton Output.2

If Boolean value is on then statements will be not executed. If Boolean value is off then statements will be not executed. The statements will be executed only when Boolean is turned to on from its off value. i.e. statements are executed only once at time when Boolean value turns from off to on.

e.g.

If R is ClickedOn

If ErrorFlag is ClickedOn

If Wagon1Flag.25 Is ClickedOn (If Sequence1Flag.25 Is ClickedOn)

If Input.25 Is ClickedOn

If Output.25 Is ClickedOn

If TimerFlag.0 is ClickedOn

If AlarmTimerFlag.0 is ClickedOn

If DwellTimerFlag.0 is ClickedOn


Boolean ClickedOn Example

In given example only when Input 25 is turned to on from off value then program will add 1 to GlobalCounter 0 else program goto Next Statement of End If i.e. afterward even if input remains on this step will be not be executed.

If Input.25 Is ClickedOn

   +1 Global.0                  ‘Add 1 to GlobalCounter 0

End If


Boolean ClickedOn Test and Branch

If Boolean Is ClickedOff

___________________________________________________________________________

Example

Statement

If Boolean Is ClickedOff

  Statements

End If

Boolean: - SystemFlags, UserFlags, Inputs, Outputs and TimerFlags are Boolean.

Statements: - All VG108 statements. Like Puton Output.2

If Boolean value is off then statements will be not executed. If Boolean value is on then statements will be not executed. The statements will be executed only when Boolean is turned to off from its on value. i.e. statements are executed only once at time when Boolean value turns from on to off.

e.g.

If R is ClickedOff

If ErrorFlag is ClickedOff

If Wagon1Flag.25 Is ClickedOff (If Sequence1Flag.25 Is ClickedOff)

If Input.25 Is ClickedOff

If Output.25 Is ClickedOff

If TimerFlag.0 is ClickedOff

If AlarmTimerFlag.0 is ClickedOff

If DwellTimerFlag.0 is ClickedOff


Boolean ClickedOff Example

In given example only when Input 25 is turned to on from off value then program will subtract 1 from GlobalCounter 0 else program goto Next Statement of End If i.e. afterward even if input remains off these statements will be skipped.

If Input.25 Is ClickedOff

   -1 Global.0                  ‘Subtract 1 from GlobalCounter 0

   Trigger DwellTimer.7         ‘Start DwellTimer 7

End If


Comparing Counters and Branching

If Counter (Operator) CompareValue

___________________________________________________________________________

Statement1

If Counter Operator CompareValue

  Statements

End If

counter: - Only UserCounter All Sequence (Wagon) and Global counters. Although Hour, Minute & second counters can be used but they will have bad effect as they are system clock counters.

Operator: - =, <>, <, >, <=, >=

CompareValue: - Can be UserCounter or fixed data, Value 0 To 99

If condition is satisfied then statements will be executed. If condition is not satisfied then statements will not be executed.

Statement2

If Counter Operator CompareValue

  Statements A

Else

  Statements B

End If

If condition is satisfied then statements A will be. If condition is not satisfied then statements B will be executed.

E.g. (1)

If Sequence1.5 = 35

  Puton Output.5

Else

  Putoff Output.5

End If

E.g. (2)

If Sequence1.5 >= 35

  Putoff Output.5

Else

  If Sequence1.5 <= 32

    Puton Output.5

  End If

End If

E.g. (3)

If Sequence1.5 = Global.0

  Puton Output.5

Else

  Putoff Output.5

End If


Or Complement of Boolean

NcParellel Boolean

___________________________________________________________________________

Statement

NcParellel Boolean

Boolean condition is complemented Ore’s with resultant flag R & result is stored into R.Boolean condition is restored.

Following are possibilities of New R.

Previous R   Boolean   New R (After execution Of Statement)

On           On        On

On           Off       On

Off          On        Off

Off          Off       On

In Ladder logic it is like  [image] where B is Boolean.

E.g.

NcParellel Input.1

NcParellel Output.1

NcParellel Wagon1Flag.1

NcParellel GlobalFlag.1

NcParellel AlarmTimerFlag.0


And Complement of Boolean

NcSeries Boolean

___________________________________________________________________________

Statement

NcSeries Boolean

Boolean condition is complemented And’ed with resultant flag R & result is stored into R.Boolean condition is restored.

Following are possibilities of New R.

Previous R   Boolean   New R (After execution Of Statement)

On           On        Off

On           Off       On

Off          On        Off

Off          Off       Off

In Ladder logic it is like  [image] where B is Boolean.

E.g.

NcSeries Input.1

NcSeries Output.1

NcSeries Wagon1Flag.1

NcSeries GlobalFlag.1

NcSeries AlarmTimerFlag.0


Or Boolean

Nonparallel Boolean

___________________________________________________________________________

Statement

Nonparallel Boolean

Boolean condition is Ore’s with resultant flag R & result is stored into R.

Following are possibilities of New R.

Previous R   Boolean   New R (After execution Of Statement)

On           On        On

On           Off       On

Off          On        On

Off          Off       Off

In Ladder logic it is like  [image] where B is Boolean.

E.g.

Nonparallel Input.1

Nonparallel Output.1

Nonparallel Wagon1Flag.1

Nonparallel GlobalFlag.1

Nonparallel AlarmTimerFlag.0


And Boolean

NoSeries Boolean

___________________________________________________________________________

Statement

NoSeries Boolean

Boolean condition is And’ed with resultant flag R & result is stored into R Following are possibilities of New R.

Previous R   Boolean   New R (After execution Of Statement)

On           On        On

On           Off       Off

Off          On        Off

Off          Off       Off

In Ladder logic it is like  [image] where B is Boolean.

E.g.

NoSeries Input.1

NoSeries Output.1

NoSeries Wagon1Flag.1

NoSeries GlobalFlag.1

NoSeries OnOffFlag


Complement of Boolean

OnOff Boolean

___________________________________________________________________________

Statement

OnOff Boolean

Boolean value is complemented. i.e. if Boolean value was On then after execution of this statement it will be Off. If Boolean value was Off then after execution of this statement it will be On.

In Ladder logic it is like  [image] where B is Boolean.

E.g.

OnOff R

OnOff Output.1

OnOff GlobalFlag.5

OnOff Sequence1Flag.12


Boolean set on

PutOn Boolean

___________________________________________________________________________

Statement

PutOn Boolean

Boolean value is set On value.

E.g.

PutOn R

PutOn Output.1

PutOn GlobalFlag.5

PutOn Sequence1Flag.12


Boolean set to Off

Putoff Boolean

___________________________________________________________________________

Statement

PutOff Boolean

Boolean value is set Off value.

E.g.

PutOff R

PutOff Output.1

PutOff GlobalFlag.5

PutOff Sequence1Flag.12


Reseting Controller

Reset

___________________________________________________________________________

Statement

Reset

Executing this statement rest all counters, Flags. Statement should be used in program block0 only.

E.g.

If DataOkFlag Is Off

  Display 14 “Data are Lost”

  Reset

Else

  Display 14 “Data retained OK”

End If


Triggering Timer

Trigger Timers

___________________________________________________________________________

Statement

Trigger Timers

Timers: - Only 48 Timers can be used.

AlarmTimer or DwellTimer can not be used.

Given timer will be triggered by it’s corresponding counter(High & Low) value & it’s corresponding Flag will be set to On. After completion of time its flag will be set to Off.

Note: - Simply writing this statement will go on triggering timers, and its flag will remain On. One should use ClickedOn or ClickedOff condition for triggering timers.

E.g.

If GlobalFlag.5 Is ClickedOn

  Trigger Timer.8

End If


Triggering Timer By Counter

Trigger Timers By UserCounter

___________________________________________________________________________

Statement

Trigger Timers By UserCounter

Timers: - All three types of Timer can be used. Timer, AlarmTimer & DwellTimer.

Each count = 10 milli seconds.

If timers Minute flag is set then count = 6 seconds

UserCounter: - Only SequenceCounter & GlobalCounter.

Given timer will be triggered by given counter as High & its next counter as Low, Timers corresponding Flag will be set to On. After completion of time its flag will be set to Off.

Note: - Simply writing this statement will go on triggering timers, and its flag will remain On. One should use ClickedOn or ClickedOff condition for triggering timers.

E.g.

If GlobalFlag.5 Is ClickedOn

  Trigger Timer.8 By Global.4

  Trigger AlarmTimer.7 By Global.4

  Trigger DwellTimer.7 By Global.4

End If

In above cases Global Counter 4 & 5 will be used as Low & High time of timers.


Triggering Timer with fixed Data

Trigger Timers By Data = Value

___________________________________________________________________________

Statement

Trigger Timers By Data = Value

Timers: - All three types of Timer can be used. Timer, AlarmTimer & DwellTimer.

Value: - 0 To 9999

  Each count = 10 milli seconds.

  If timers Minute flag is set then count = 6 seconds

Given timer will be triggered by given Value, Timers corresponding Flag will be set to On. After completion of time its flag will be set to Off.

Note: - Simply writing this statement will go on triggering timers, and its flag will remain On. One should use ClickedOn or ClickedOff condition for triggering timers.

E.g.

If GlobalFlag.5 Is ClickedOn

  Trigger Timer.41 By Data = 65535H

  Trigger AlarmTimer.5 By Data = 1234

  Trigger DwellTimer.6 By Data = 9999

End If


Adding Counters to Counters

UserCounter = UserCounter + Value

___________________________________________________________________________

Statement

UserCounter1 = UserCounter2 + Value

UserCounter1:- All Defined UserCounter

UserCounter2:- All Defined UserCounter

Value: - Ranges from 0 To 99

To the UserCounter2’s value Given Value is added and it is stored in Usercounter1.

E.g.

Sequence1.5 = Global.2 + 5

Sequence1.5 = Sequence1.5 + 99


Subtracting Counters to Counters

UserCounter = UserCounter - Value

___________________________________________________________________________

Statement

UserCounter1 = UserCounter2 - Value

UserCounter1:- All Defined UserCounter

UserCounter2:- All Defined UserCounter

Value: - Ranges from 0 To 99

To the UserCounter2’s value Given Value is subtracted and it is stored in Usercounter1.

E.g.

Sequence1.5 = Global.2 - 5

Sequence1.5 = Sequence1.5 - 99


Their value is either ON or OFF.


Their value ranges from 0 to 99 or 0 to 255.


This is Erasing for HelpIndexId


Test Incomplete