24
MJ1 ref.: ma-MJ-PLC ver. 10.2.20 1/1/2013 Module J Handbook of the module “plc” for the line of artificial vision systems Vedo/HQV. This handbook illustrates the formalities use of the optional module PLC of the artificial vision systems Vedo/HQV and is turned to the users that already has a certain degree of familiarity with the operation of the relative software. “PLC” 1. Generality. The module PLC allows to check the signals of Input/Output interfaced with the vision system and to program their cycles and their actions through a set of instructions and logical operator. In association to the module MMI allows to show messages in particular situations (see Modules-L-MMI). 2. Window of work. To activate the modules PLC, is possible to select the voice PLC from the menu Options of the main window, push the key or access it from the window Input/Output through the key I/O of the window Scenes Menu for the management of additional functions. Options for set restore variable and end elaboration reset. Start the programs Menu to associate a section to a scene State of the inputs modifiable manually if the simulation has been enabled State of the exits during the test Menu for selection and editing of the sections Area immission string logical function rewrite section Syntactic control of the string on which is positioned the cursor If a section is associated to a scene, it is possible that the scene is repeated if the " Retry " is selected and if the 1ª condition of the section is valid.

“PLC” - VEA S.R.L. · MJ2 3. Programming. The planning of every single section happens through the definition of logic functions characterized by operations among the logical

  • Upload
    others

  • View
    1

  • Download
    0

Embed Size (px)

Citation preview

Page 1: “PLC” - VEA S.R.L. · MJ2 3. Programming. The planning of every single section happens through the definition of logic functions characterized by operations among the logical

MJ1

ref.: ma-MJ-PLC ver. 10.2.20 1/1/2013

Module J

Handbook of the module “plc”

for the line of artificial vision systems Vedo/HQV.

This handbook illustrates the formalities use of the optional module PLC of the artificial vision systems

Vedo/HQV and is turned to the users that already has a certain degree of familiarity with the operation of the

relative software.

“PLC”

1. Generality.

The module PLC allows to check the signals of Input/Output interfaced with the vision system and to program

their cycles and their actions through a set of instructions and logical operator. In association to the module MMI

allows to show messages in particular situations (see Modules-L-MMI).

2. Window of work.

To activate the modules PLC, is possible to select the voice PLC from the menu Options of the main window, push

the key or access it from the window Input/Output through the key I/O of the window Scenes

Menu for the

management of

additional functions.

Options for set

restore variable and

end elaboration

reset.

Start the

programs

Menu to associate a

section to a scene

State of the inputs

modifiable manually if the

simulation has been

enabled

State of the exits

during the test

Menu for selection

and editing of the

sections

Area immission

string logical

function

rewrite

section

Syntactic

control of the

string on

which is

positioned the

cursor

If a section is associated to a scene, it is possible

that the scene is repeated if the " Retry " is

selected and if the 1ª condition of the section is

valid.

Page 2: “PLC” - VEA S.R.L. · MJ2 3. Programming. The planning of every single section happens through the definition of logic functions characterized by operations among the logical

MJ2

3. Programming.

The planning of every single section happens through the definition of logic functions characterized by operations

among the logical states (high, low, activated, deactivated )of the used signals.

3.1 Section.

A section can be defined as a cycle of operations that the system activates in conseguence of the first programmed

condition.

The programming of a section happens making the followings actions:

Editing : to every section it is possible bind a description inserting the same one in the special field.

Activation : so that a section is performed, it needs that is activated. To do this is necessary select the flag

ON.

Association : a section can be associated to a scene and is performed at the end of the elaboration of the

same scene, or can be free and is cyclically performed.

Ripetition : a scene can be repeated more times if the flag Retry has been selected and if the attempts

have opportunely been programmed (T) in the definition of the functions (see§ 5. Example)

When it is chosen to perform more attempts of analysis of a same scene with the objective of retest not conformity

of one or more samples, the module plc offer the possibility to exclude from the following analyses all the samples

classified acceptable with the purpose to make a test of not conformity. To activate this option it is necessary use

the parameter DWR (DisableWhenRetry) from the window Input/Output.

DWR characteristic:

Applicable to every event of sample.

It excludes the sample selected by the search in the following attempt maintaining however all the information

of his first analyses (Delta Position, %acceptability, coordinates, rotation….)

It activates the

option DWR on the

event associate

If the sample in

object (ex Sample1)

is referred to

another, activating

this flag the DWR of

the sample of

reference is also

activated

Page 3: “PLC” - VEA S.R.L. · MJ2 3. Programming. The planning of every single section happens through the definition of logic functions characterized by operations among the logical

MJ3

3.2 Functions, logic states and signal.

The logical functions used by the modules plc to define a section are the followings:

IF : it indicates condition to be able to perform the following " THEN ".

THEN : it indicates the action to perform.

ELSE END : finishes the section if the condition to be able to perform the " THEN " is false.

ELSE JUMP x : It jumps the execution of the section to the form x if the condition to be able to perform the "

THEN " is false.

WAIT : it indicates the interval of time (mSec) at the end of which owes to activate the next condition.

To terminate a session of PLC dial “0”.

PRIORITY AND/OR: Is possible to choose if to the logical operations between I/O the priority is given to the

AND or to the OR. default priority is OR.

The syntax to be used for defining the function IF is the following:

for signal of INPUT: [ & + ] [ \ ] I [ L H A D ] [ n ]

For signal of OUTPUT: [ & + ] [ \ ] U [ L H A D ] [ n ]

For command of ATTEMPT: [ & + ] T [ n ]

Page 4: “PLC” - VEA S.R.L. · MJ2 3. Programming. The planning of every single section happens through the definition of logic functions characterized by operations among the logical

MJ4

For signal of OUTPUT: [ \ ] U [ L H ] [ n ] [#]

For command of GRAB IMAGE: G [ scene ]

To generate DISK EVENT: #>W [ iee ] where [i] is (Idx) and [ee] is (Ev)<[value]|[&V[decimal

digit][name of varibile][variable type][Sample separator]… (see

example and Module A §4)

For command of DUMP IMAGE : D

To write a string in MMI: # [ string ] (see Module L)

To allow operation on VARIABLE: #>V [variable name] [type] [value/operation] [separator] <see Module

M)

To print on system print:

#>S< [string] (dim 7) (print the string with line feed)

#>SL< [string] (dim 10) (print the string with line feed)

#>SM< [string] (dim 12) (print the string with line feed)

#>SF< (terminate the print)

#>SP< (next page)

To show an IMAGE: #>P [Event] < [path of image] (see module R)

To show a string on HMI: #>M [Event] <[string] & [variable type] [name] [Color] (see module R)

To send a string on Serial/Tcp: #>C [CommPort] <[string]

CommPort: 1=Serial door 1 – 2=Serial door 2 – 3=TCP/IP

Event of set PLC verbose: v5, show errors in MMI.

Event of reset PLC verbose: v6, don‟t show errors in MMI (default).

Event Open SNPX: v7, open SNPX communication.

Event Close SNPX: v8, close SNPX communication.

Event Reset collection: v9, reset collection (ma-MU-Selection).

Event of SHUTDOWN: v10 Force shutdown

Event of Refresh Counter(HMI): v20 manual refresh of HMI‟s counters.

Event of Load image: v1xx load on object X last dump from disk

Event of Change layout(HMI): v2xx x = number of layout.

Event Set tool: (0-99 sample) v3xx, ex. 301 set tool for sample 1, max value 399

Event Reset tool: (0-99 sample) v4xx, ex. 401 reset tool for sample 1, max value 499

Page 5: “PLC” - VEA S.R.L. · MJ2 3. Programming. The planning of every single section happens through the definition of logic functions characterized by operations among the logical

MJ5

Event Open – close windows (or enable

and disable):

v1ffm (v1001-v1199) (“ff” = window #, “m”= mode [0-2] 0=close

1=open 2=toggle) open or close windows.

Window list:

02 = window hmi (only enable and disable),

03 = window variable

Es.: 1020 disable hmi window.

Event Start self learning: v10xxx, (x = sample number- value max 999) begins the learning

automatic. Es.: 10001 begins the learning automatic for sample 1.

Event Stop self learning: v11xxx, (x = sample number- value max 999) end the learning

automatic. Es.: 10001 begins the learning automatic for sample 1.

Event Start elaboration self learning: v12xxx, (x = sample number- value max 999) begins the elaboration

of learning objects

Event Stop elaboration self learning: v13xxx, (x = sample number- value max 999) end the elaboration of

learning objects

Event Reset self learning: v14xxx, (x = sample number- value max 999) delete the learning

objects

Event Start superficial self learning: v15xxx, (x = sample number- value max 999) begins the learning

automatic. Es.: 10001 begins the learning automatic for sample 1.

Event Stop self superficial learning: v16xxx, (x = sample number- value max 999) end the learning

automatic. Es.: 10001 begins the learning automatic for sample 1.

Event Start elaboration superficial self

learning: v17xxx, (x = sample number- value max 999) begins the elaboration

of learning objects

Event Stop elaboration superficial self

learning: v18xxx, (x = sample number- value max 999) end the elaboration of

learning objects

Event Reset superficial self learning: v19xxx, (x = sample number- value max 999) delete the learning

objects

Event Set tool: (from ver 10.1.14) v23xxx, (x = sample number - value max 999) set the tool robot.

Ex.: 23001 tool setting for sample 1.

Event Reset tool: (from ver 10.1.14) v24xxx (x = sample number - value max 999) reset the tool robot.

Ex.: 24001 tool resetting for sample 1.

Page 6: “PLC” - VEA S.R.L. · MJ2 3. Programming. The planning of every single section happens through the definition of logic functions characterized by operations among the logical

MJ6

The syntax to be used for defining the function THEN is the following:

Where:

& (and) = logical operator AND. Is necessary that all the operandis AND are true, because condition is

valid

+ (or) = logical operator OR.Is enough that an operand OR is true, because condition is valid.

\ (not) = logical operator of negation

* (always) = logical operator that satisfies all the conditions

L (Low) = logical state : low signal

H (High) = logical state : high signal

A (activated) = logical state : from low signal to high signal

D (deactivated) = logical state : from high signal to low signal

n = number of I/O port, number of attempt.

Scene = Scene number

Variable name = Letter of the alphabet

Variable type

Bool/Integer % Set the specified value into the specified variable Bool/Integer.

Long & Set the specified value into the specified variable Long.

Double # Set the specified value for the specified variable Double.

min m Set the specified value for the specified variable min.

MAX M Set the specified value for the specified variable MAX.

String $ Set the specified value for the specified variable String

Statistic !

Do an operation for the specified variable Statistic. Statistic variables are

array of double data, at every set of the variable there is an increase of

the counter.

Value The value can be numerical or string. String value must be contains among quotation marks:

#>a$”prova”<

Operation

Reset R Reset of the variable, in case of statistic variable, it reset the series of

data of the specified variable.

Reset All RA Reset of all the variables of the specified type.

Calculate C Make calculations on the statistic variable specified.

Calculate All CA Make calculations on all statistic variable.

Increment +

Increase the variable, in case of string variable it appends the value(must

be in quotation marks). Not used by Statistic data type.

Adding sign „-„ is possible to decrease the variable, in case of String

variable, the specified string will be subtracted from the present one.

Separator Sample separator plans in Project Setup. See §7.1 of the manual.

Page 7: “PLC” - VEA S.R.L. · MJ2 3. Programming. The planning of every single section happens through the definition of logic functions characterized by operations among the logical

MJ7

Example of operations on variables:

Assigns at variable „a‟ of string type value “Prova”: #>Va$”Prova”<.

Resets variable „a‟ of string type: #>Va$r< (equivalent to #>Va$””<).

Assigns at variable ‟x‟ of double type value 1024,33: #>Vx#1024,33< (How decimal separator accept „.‟ or „,‟. Warning: if as separator

is planned „,‟ „x‟ will be set at 1024.

Resets variable „x‟ of double type: #>Vx#r<.

Increase variable „y‟ of long type of 3: #>Vy&+3<

Decrease variable „y‟ of long type of 3: #>Vy&+-3<

Example of serial communication way

Send by serial way of a message: #>C1<#Test send.

Modify of exit state 1 of an other vision system way TCP/IP: #>C3<#UH1.

Example of variables visualization

Visualization on message 2 of HMI of the B inside variable with before the wording “pezzi”: #>M2<pezzi: &%B

Visualization on MMI of X double variable follows by Y double variable: # &#X &#Y

Example of saving variable to disk

#>W101<0 &V2A# &VA% &VB% &VC%

idx: 1

ev: 01

Value1: 0.

Value1: Variable A double with 2 decimal digit.

Extra1: Variable A integer.

Extra2: Variable B integer.

Extra3: Variable C integer.

Sample separator: space.

3.3 Option’s control.

Inside the module plc are available control's tools to verify the correct insertion of the data in the strings of

programming. Using the command Syntax Check, a tool of correction it is activated in degree to notice and to

signal possible errors of syntax, giving so the possibility to the operator to intervene for the correction. The tool

Rewrite allows to rewrite the strings edited according to the correct arrangement.

3.4 Menu functions

Throug the menu files is possible to enter at programming of module Sync for the synchronization of entries (see

§8) and at module ShReg for manage a shift register (see §9).

Page 8: “PLC” - VEA S.R.L. · MJ2 3. Programming. The planning of every single section happens through the definition of logic functions characterized by operations among the logical

MJ8

3.5 Menu options

Inside options menù is possible to choose if set two functions:

Memorize variable: Allows to memorize and use the state of system variables. With this choice the

variable used in the project are those general of the machine and not those of the machine. In this way

all projects with memorize variable selected will shared the same varibles.

End elaboration reset: With this choice at the end of elaboration the exits used by the PLC are reseted.

Write single out: Don‟t set output as a block.

4. Simulation.

Once defined a section, the module plc offers the possibility to perform a test to verify that the edited functions

correctly perform all the operations. To do this is necessary to press button Test. With the option "Simulate in" is

possible to manually simulate the inputs. If this option is deactivated the real inputs are considered. In the space

reserved to the visualization of the state of the OUTPUT will be underlined in the correct succession all the active

actions.

5. Example.

Follow an example in which the function of Retry is used.

INPUT/OUTPUT SIGNAL

I2 = Grab Image IN

U0 = All rejected

U8 = All accepted

U9 = 1° attempt

U10 = 2° attempt

Sample 1 = DWR actived

Sample 2 = DWR deactived

Page 9: “PLC” - VEA S.R.L. · MJ2 3. Programming. The planning of every single section happens through the definition of logic functions characterized by operations among the logical

MJ9

PLC SETTINGS

Section1 = “1° attempt OK”

if attempt = 0 AND is result everything OK (output n°8

All Accepted = high)

then wakes up output 9 (it finishes with the 1° attempt)

after 1000mSec

lowers output 9

The Retry function is not activated because the Section1 is activated only in the case of "Everything OK " and

therefore it doesn't serve a further analysis (2° attempt).

Section2 = "1° attempt FAULT"

if attempt = 0 AND is not everything OK (output n°8 All

Accepted = low)

then take back the image (Grab Image) of the scene 1

and passes to the following attempt (Retry)

The Retry function is activated because the Section2 is activated only in the case of " FAULT " and therefore it

serves a further analysis (2° attempt).

Page 10: “PLC” - VEA S.R.L. · MJ2 3. Programming. The planning of every single section happens through the definition of logic functions characterized by operations among the logical
Page 11: “PLC” - VEA S.R.L. · MJ2 3. Programming. The planning of every single section happens through the definition of logic functions characterized by operations among the logical

MJ1

Section3 = 2° " attempt "

if attempt = 1

then wakes up output 10 (finishes with the 2° attempt)

after 1000mSec

lowers output 10

The Retry function is not activated because the Section3 after the execution of the 2° attempt is activated for pointing

out to the system to pass not to a following attempt, independently from the results gotten in the second elaboration.

In this second elaboration is not made a test on " Sample 1" in the case has already been noticed conforming after the

first attempt (function enabled DWR as from setup of I/O on the sample " Sample 1 ").

ATTENTION: Using End of scene, is processed only first IF block. Any THEN istruction not be performed. In case

of you want to use IF with ELSE begin from 2° block.

Page 12: “PLC” - VEA S.R.L. · MJ2 3. Programming. The planning of every single section happens through the definition of logic functions characterized by operations among the logical

MJ8

6. Programming example.

Here follows examples of programmation on PLC to use on PLC, Direct Selection and HMI counter:

Example of operation on I/O:

UH1 Turn on output 1

UL1 Switch off output 1

Example of generic operation:

G1 Grab of scene 1(is used with fixed scene).

D Execute Dump of current scene on defined path.

#Message Write string on MMI.

#>M1<Test message Write on HMI Message1 object the defined string.

#>M1<&&A Write on HMI Message1 object the value of A long variable.

Example of operation on variable:

#>Vx&+1< Add 1 to Long variable “x”.

#>Vx#r< Reset long variable “x”.

#>Vx#=0< Reset long variable “x”.

#>Va$”Test”< Assign to variable “a” type string the message “Test”.

#>Va$r< Reset string variable “a”.

#>Va$””< Reset string variable “a”.

#>Vx#1024,33< assing to duoble variable “x” value 1024,33 (with decimal separator is used „.‟ o „,‟. Attention:

if separator is „,‟ „x‟ is 1024).

#>Vx#r< Reset double variable “x”.

Example of serial comunication

#>C1<# Test send.

#>C3<#UH1 modified U1 on second vision system with TCP/IP connection.

Example of system event

V10 Execute Shutdown of PC.

V20 Execute refresh of Counter object of HMI(the object must be setted to refreh mode to

MANUAL).

V102 Insert on image1 of HMI last dump.

Page 13: “PLC” - VEA S.R.L. · MJ2 3. Programming. The planning of every single section happens through the definition of logic functions characterized by operations among the logical

MJ9

7. Print.

Is possible to print PLC module.

Every module can be disabled in way to print only the part of interest of PLC.

7. 1 Detail level

<2: Print only Section title

>=3: Print all PLC

7. 2 Option.

Options PLC allow to disabled print of PLC or of other modules. This allow to print only the part of programmation

that we interest.

Note: For the specific one on the operation of the Print reference to the general manual Appendix D.

Page 14: “PLC” - VEA S.R.L. · MJ2 3. Programming. The planning of every single section happens through the definition of logic functions characterized by operations among the logical

MJ10

Name of “Synchronizer”

Enable

Synchronizer

Way of operation, single or

double.

Way of learning, manually

or automatic.

Sequence of

times for the

“Synchronizer”

Alarm output.

Signal input.

Enable Input.

“SYNC”

8.1. Generality

This module determine if a digital signal from an input or from an output is in phase according to a sequence of times

defined.

It is possible to define the sequence of times in manual or automatic way with a procedure of auto-learning.

It will be possible to define more " Synchronizer " on different inputs.

8.2. Creation of “ Synchronizer ”

A " Synchronizer " is a comparator that allows to check if a signal (input/output) changes of state (high-low and

viceversa) inside a sequence of times defined. Is possible to define for every Synchronizer the input to check, the

sequence of times, the way of operation, single or double, the output alarm and an entry of Synchronization.

Page 15: “PLC” - VEA S.R.L. · MJ2 3. Programming. The planning of every single section happens through the definition of logic functions characterized by operations among the logical

MJ11

Synchronizer: The name of Synchronizer. Is possible to change this name typing inside the box of text and

pressing enter.

Signal input: Input of “Synchronizer”

On: Enable the synchronization. If ON is not selected the entry won't have managed even if all

the parameters have been defined.

Number of signal: It defines the number of impulses inside the wave. in single way the wave is rectangular

while in double way they are present two impulses inside the wave with different and

alternate height and low phases.

Time: They are the times that will be compared with the impulses. In single way the times will be

only four:

TLMIN: Min time of duration of the low signal.

TLMAX: max time of duration of the low signal.

THMIN: Min time of duration of the height signal.

THMAX: Max time of duration of the height signal.

For the double way must be defined four values for the second present impulse in the signal.

Auto learning: If selected, the times will be acquired automatically during a phase of auto-learning.

Subsequently to this phase it will be possible to modify the times to increase or to decrease

the border of error.

Error output: It points out the out alarm of the Synchronizer. If the signal is out of the sequence of times

defined the exit will be raise up. If the box of text is empty the alarm won't be managed.

Abil input: Input enable of the synchronizer. If defined the synchronizer will work only if the input is

close.

Page 16: “PLC” - VEA S.R.L. · MJ2 3. Programming. The planning of every single section happens through the definition of logic functions characterized by operations among the logical

MJ12

To enable the management of the synchronizer on an input is necessary to select ON to enable the synchronization

and to insert the input to manage in signal input. This input can be an input or an output adding +100 to the value. It

will be necessary to go to add the times of the signal the output of alarm.

The single way allows to manage a signal with period defined by a rectangular wave while the double way a signal

with a double wave with phases of tall and low alternate.

8.3. Definition of the sequence of times.

Is necessary to define a sequence of times on which to check the signal. To do this is possible to insert the times

manually writing in the special spaces or using the auto-learning.

To use this function select auto-learning from the window, go out of the window of the PLC and behavior to turn the

application for an enough period to the auto-learning. Made this return in the window of synchronization, deselect

auto-learning and in case of necessity to systematize the times to really liking.

The times autoappresis are exactly those returned by the system. For this could be necessary to increase the border of

control for the phase of synchronization.

8.4. Additional parameters.

Is possible to define an enable input and an output of alarm. The enable input points out that the synchronization will

work only if such input is high. When the entry is opened and then closed again, the cycle of wait is reseted.

The output of alarm will be raise up when the time low or high of the signal doesn't coincide with the sequence of

times defined. When the signal returns inside the times defined the output will be opened.

8.5. Formality of operation.

To use correctly sync module is necessary to select " Parallel elaboration " from the menù option. This avoids that the

times of grab of the image influence the management of the signal input.

The synchronization departs after a wait of three cycles of PLC to avoid that to the start of the elaboration there is

exaggeratedly tall times. The first signal is always a phase of height. Instead the synchronization of a signal in double

way happens with an ulterior delay of two cycles to be able to choose which of the two memorized signals use for

start.

If the synchronization has tied to an enable input every time that the entry is opened, will be left again by zero still

delaying of three cycles the synchronization.

Page 17: “PLC” - VEA S.R.L. · MJ2 3. Programming. The planning of every single section happens through the definition of logic functions characterized by operations among the logical

MJ13

“SHIFT REGISTER”

9.1. Generality

This form allows of to create a Shift Register on a digital signal from an in Input or from a Output. The use of this

functionality can be useful in the industry automation to delay a signal of a number of steps defined.

It will be possible to define more “Shift Register” on different inputs.

9.2. Creation of a “Shift Register”

One “Shift Register” allow to repeat a signal on an exit delaying it of N steps.

Enable “Shift Register”

Name of “Shift Register”

It determines if the Clock

has managed on the front

of slope or on that of

descent.

Signal Clock.

Number of steps for

shifting.

Input to Shift.

Output of signal.

Start output for

visualisation of shift

register.

Formattato

Page 18: “PLC” - VEA S.R.L. · MJ2 3. Programming. The planning of every single section happens through the definition of logic functions characterized by operations among the logical

MJ14

Shift Register: It is the name of the Shift Register. It is possible' to change this name typing inside the text

box and pressing Enter.

On: Enabled Shift Register. If ON is not selected the input is not managed.

Activated: It determines if the signal of clock will be managed on the front of slope or of descent.

Default is front of slope.

Clock Input: Clock signal. If the state of signal change, the signal input shift.

Shift Input: Input signal. The signal has moved some number of footsteps defined by Steps.

Steps: Number of steps of Shift Register. Max number is 10. Min 1.

Shift Output: The Input is repeated moved of N steps on this exit.

Print Out: Is possible to define an output to visualize Shift register.

To define one “Shift Register” it is necessary to go in Option | PLC and in this window to select Functions | Shift

Register. Once entered in the property window is enough to select ON.

To the “Shift Register” selected they will owe to have changed the parameters to answer to our demands.

Choose if the signal must moved on the front of slope or on the front of descent of the Clock. If the signal is on the

front of slope select Activated. Then Clock and the Shift input will be inserted that are respectively what determines

me the speed of move and the Input to move. These can be also exits adding +100 to the number of the exit.

Is necessary then to insert the number of steps of the Shift and the output on which to visualize the input shifted.

It is possible to define a series of output on which visualize the Shift Register. To do this insert in Print Out the start

output of the visualization. The necessary output will be so many how much the number of Steps defined previously.

Page 19: “PLC” - VEA S.R.L. · MJ2 3. Programming. The planning of every single section happens through the definition of logic functions characterized by operations among the logical

MJ15

“DIRECT SELECTION”.

10.1. Generality

The form Direct Selection allows to perform actions of PLC with combination of input.

10.2. Job window

To activate the form Direct Selection, is possible to select the voice Direct Selection from the menu Functions of the

form PLC.

Start input for

encode numerical.

Is possible print

message on

MMI/HMI with

header and

desacription.

Strobe input. Start

PLC action. Strobe used on the

front of slope or on

that of descent.

Clear contents of

a page or all

Module

PLC action to

execute

Enable Direct

selection.

Start-end

condition values.

Command

description.

Number of bits

used to encode

numerical

Input from file:

if you select the

value of condition

is read from the file

in ASCII format

Page 20: “PLC” - VEA S.R.L. · MJ2 3. Programming. The planning of every single section happens through the definition of logic functions characterized by operations among the logical

MJ16

10.3. Programmation

The planning of every single line happens through the definition of Values of input that perform a PLC action. To do

this is necessary to define the Strobe input, the input of base for the calculation of the value(Start In) and the lines of

PLC action that we want to perform.

From ver. 10.1.8 You can select "input from file" and enter the input value in a file defined in the "filename". The

file will contain an integer number in ASCII format. At the phase transition of the “strobe input” system will read

the file and will execute the corresponding action.

Using the "test file" button you can test the existence of the file and see if there is a valid value. The file must be

placed in the VEA program directory, usually C: \ Program Files \ VEA.

The Strobe is checked on the front of slope/descent defined by the option Activated. If Activated is selected the

Strobe will be checked on the front of slope, on that of descent in contrary case.

To define a line of action is necessary to first of all insert a value in Dec/Hex that identify the line. Optionally it is

possible to define a Range of action inserting another value Dec/Hec in the following field. The Line will be

performed if the value of the input will be included between Start and Stop.

It is possible to perform a line of ELSE writing in the field Dec/Hex the value “-1” or "ELSE". The line will be

performed only if all lines are not verified. It is possible to insert more than a line of ELSE that will be performed in

sequence.

The field Description allows to insert a description that will serve for remembering the purpose of a Line of PLC.

Optionally it is possible to use the description as message for the MMI or HMI. To do this is necessary to enable the

option Write MMI. At this point when the Line will performed the correspondant message will shown.

Es.

Header = " Hello "

Description = " 1 "

MMI = “Hello 1”

Header = " >m1 <Hello"

Description = " 1 "

HMI = “Hello 1”

Page 21: “PLC” - VEA S.R.L. · MJ2 3. Programming. The planning of every single section happens through the definition of logic functions characterized by operations among the logical

MJ17

In the field Then will be inserted the action of PLC that is wanted to perform when condition is verified. For the

definition of such field to make reference to the module J PLC, 3.2 Functions, logical state and signals.

“ASSEMBLED OUTPUT”

11.1. Assembled output.

Thanks to key Assembled Output of window Input/Output or to key of the toolbar (see § 10 of ma-ext) you can

enter in a new window that allows to perform advanced settings of the digital output doors.

Through this further level of settings it is possible to combine between them more output contemporarily through

logical values (AND and OR) and send the result of this combination on another output which can come submitted to

an analogous operation.

Example of setting:

1) Gives a formulation of I/O as brought in chart

OBJECT EVENT N° DOOR

After having associated to every event his Output, we

access the window Assembled Output and we combine

the themselves Outputs according to our demands.

Scene Scene Active 1

Scene All Accepted 3

Scene All Rejected 4

Sample 1 All Found 29

Sample 1 None Found 28

Sample 2 All Found 14

Sample 2 None Found 15

Sample 3 All Found 26

Sample 3 None Found 27

2) Now we combine outputs in way of to resolve the follow function:

Out8 = (Out28 OR Out29) AND (Out26 OR Out27) AND (Out14 OR Out15)

Page 22: “PLC” - VEA S.R.L. · MJ2 3. Programming. The planning of every single section happens through the definition of logic functions characterized by operations among the logical

MJ18

Outputs 10,11,12 are activated both when all the necessities of the sample have been

found, both in the opposite case (28 OR 29), (26 OR 27), (14 OR 15).

Output 8 is activated when all the 3 precedent events have been verified(28 OR 29)

AND (26 OR 27) AND (14 OR 15). Operator AND is on default. The system make

the logical operations from up to down.

Activation of

digital output

combination.

Number of door

where will be write

the result (from 0

to 31)

Activating Reverse

the state of the

door will be

inverted.

Logical Operator.

If trained the result

it is the OR binary

combinations of

output to the right,

if disabled it is

AND

Combination of

outputs

Page 23: “PLC” - VEA S.R.L. · MJ2 3. Programming. The planning of every single section happens through the definition of logic functions characterized by operations among the logical

MJ19

“STRINGS DECODER”

12. Strings decoded.

Every string that it goes out of the vision system it passes through a decoder that transforms particular codes in a text.

Following the chart of the decodes is brought.

Warning: the codes must be uppercase.

Code Description

&CHECK[n][T] Checksum of “n” characters type [T] (“S” = sum of the ascii value of the string up to &CHECK)

&DATE Put date

&Hnn Put hexadecimal <nn> character ASCII (ex. &H0A send character <LF>)

&In Put value of input number “n” and send “0”, “1” o “-1” (not existing input) (ex. &I5 send

character “1” if input no. 5 is high, “0” otherwise)

&NAME Current project name

&NAMEC Current project name without extention

&NOCC total number of occurrences found

&OCC current occurrence number

&OCR Last string read from OCR

&PATH Current project name with path

&RESINT(field,sample,occ)

&RESINT(field,sample)

Return the integer value of the field (field), sample (sample), occurrence (occ). If <occ> doesn‟t

exist then it writes all occurrences.

Field has these values: X = 4 Y = 5 Z = 6 Xr = 9 yr = 10 Angle = 14

Score = 21 SupScore = 23 Score3 (Height) = 25 Score4 = 26 alScore = 28

&RUN Send “1” if vision system is “in elaboration”, “0” otherwise

&SAMPLE current sample number

&SCENE current scene number

&SURF Send “1” if current surface analisys is good, “0” otherwise

&TAB Insert a TAB character

&TIME Put time

&Un Put value of output number “n” and send “0”, “1” o “-1” (not existing output) (ex. &U27 send

character “1” if output no. 27 is high, “0” otherwise)

&V[d]vt Write a variable:

“d” number is decimal to be write, if omitted he writes all the decimal presents it gets default format as defined in “option”-> “serial port” vedi cap. 7.1

“d”=” ^ ” angle format

“d”=”*” X,Yformat

“d”=”/” GENERIC format

“d”=”\” Z format

“v” is the name of the variable

“t” is the type of the variable

Page 24: “PLC” - VEA S.R.L. · MJ2 3. Programming. The planning of every single section happens through the definition of logic functions characterized by operations among the logical

MJ20

(ex. if variable X# = 123.4567 then &V2X# write the string “123.46”