clp gpm-18 - metaltex.com.br · você pode programar o clp gpm tanto em linguagem ladder como em...

311
Manual Programação CLP – GPM CLP GPM-18 Manual de Programação

Upload: vuongdang

Post on 17-Nov-2018

232 views

Category:

Documents


1 download

TRANSCRIPT

Page 1: CLP GPM-18 - metaltex.com.br · Você pode programar o CLP GPM tanto em linguagem Ladder como em logica Boleana (lista de instruções). Funções básicas O CLP

Manual Programação CLP – GPM

CLP

GPM-18

Manual de Programação

Page 2: CLP GPM-18 - metaltex.com.br · Você pode programar o CLP GPM tanto em linguagem Ladder como em logica Boleana (lista de instruções). Funções básicas O CLP

Manual Programação CLP – GPM

2

Características do Controlador Lógico-Programável GPM-18

Prefácio

A programação do CLP GPM tem as seguintes características:

Suporta 2 tipos de linguagem de programação

Você pode programar o CLP GPM tanto em linguagem Ladder como em logica

Boleana (lista de instruções).

Funções básicas

O CLP GPM suporta não somente funções básicas de intertravamento, mas também

funções de alto nível tais como movimentação de dados, comparação, operações

aritméticas, loop, shift entre outras. Além disto também dispõe de funções de

interrupção, contador alta velocidade , saída rápida para controle de posicionamento e

comunicação serial.

Endereçamento indireto (Indexação)

Adicione o indexador após um bit ou registrador de dados (ex.. X3[D100]D0[D100])

para realizar o acesso indireto ao endereço. Por exemplo, quando D100=0, X3[D100]

significa X3,D0[D100] significa D0; quando D100=2, X3[D100] significa X5,D0[D100] significa D2.

Contadores alta velocidade de uma ou duas fases

Os contadores alta velocidade no GPM dispõe de um dispositivo de interrupção

independente para alguns pontos de entrada digital, logo eles são independentes do

ciclo de scan, o contador pode receber pulso de até 200KHZ.

Instruções de comunicação MODBUS

Com as instruções de comunicação MODBUS o CLP pode facilmente se comunicar

com diversos equipamentos, desde que estes comuniquem no protocolo MODBUS.

Saídas de Pulso Alta Velocidade

O GPM possue 2 saídas de alta velocidade, cada saída pode controlar segmentos em

seqüência e os segmentos e números de pulsos podem ser ajustados livremente. A

freqüência dos pulsos pode atingir 400KHz.

Page 3: CLP GPM-18 - metaltex.com.br · Você pode programar o CLP GPM tanto em linguagem Ladder como em logica Boleana (lista de instruções). Funções básicas O CLP

Manual Programação CLP – GPM

3

1-1....Resumo do CLP GPM e forma de programação

Controlador lógico-programável GPM

18 E/S

Memória FlashROM

Relógio/Calendário tempo real – possui bateria de litium no evento de

falta de energia

Porta de comunicação MODBUS.

Várias funções de alto nível que facilitam a programação

Introdução

Formas de Programação

Programação em Lista de Instruções – Boleana

A programação em lista de instruções e a que usa os comandos “LD”、“AND”、“OUT”etc. Este é o formato básico de compilação do programa, porém não é conveniente

para seu entendimento.

E.x.: Passo Instrução ID

0 LD X000

1 OR Y005

2 ANI X002

3 OUT Y005

Programação em Ladder

Utiliza a lógica de intertravamento de relés que é de mais fácil interpretação

do programa. Ao mesmo tempo é possível monitorar a condição do CLP

diretamente no desenho do circuito.

Ex.:

X0 X2

Y5

Y5

O programa elaborado e compilado com uma desta forma de programação é

armazenado no CLP. A edição de uma das formas acarretará na conversão

automática da outra forma também.

Page 4: CLP GPM-18 - metaltex.com.br · Você pode programar o CLP GPM tanto em linguagem Ladder como em logica Boleana (lista de instruções). Funções básicas O CLP

Manual Programação CLP – GPM

4

1-2....Especificações

Item Especificação

Tensão de Isolação Maior que 2MΩ – 500VCC

Imunidade a ruido 1000V 1uS pulsos por minuto

Temperatura

Ambiente 0~60

Umidade Ambiente 5%~95%

COM 1 RS-232, Programação do CLP e IHM

COM 2 RS-485, comunicação com inversores, controladores de temper., etc.

Aterramento Use terra independente

Especificação

Item 10 Entradas / 8 saídas

Forma de execução do

programa Scan em loop、scan tempo fixo

Forma de programação Ladder ou lista de instruções

Velocidade de execução 0.5us / passo

Proteção falta de energia FlashROM e bateria de litium

Capacidade de programação 8000 passos

Relés internos (M) 8512 pontos

Quantidade 620 temporizadores

Tempori

zador(T)

Espec.

Temporiz. 100mS:faixa tempo 0.1~3276.7 segundos

Temporiz. 10mS: faixa tempo 0.01~327.67 segundos

Temporiz. 1mS: faixa tempo 0.001~32.767 segundos

Quantidade 635 contadores

Contador(C) Espec.

Contador 16 bits:K0~32767

Contador 32 bits: K0~2147483647

Registradores de dados(D) 8512 words

Registrador FlashROM(FD) 2048 words

Funções do contador alta

velocidade

Contagem alta velocidade, saída de pulsos e interrupção

Ajuste do tempo de scan 0~99mS

Senha de proteção 6 bits ASCII

Funções auto-diagnose Auto diagnose ao ligar, watchdog e verificação de sintase

Page 5: CLP GPM-18 - metaltex.com.br · Você pode programar o CLP GPM tanto em linguagem Ladder como em logica Boleana (lista de instruções). Funções básicas O CLP

Manual Programação CLP – GPM

5

2-1....Mapeamento da memória do GP

A memória do CLP GP é dividida em diversos tipos de contatos/bobinas (bits) e registradores de dados.

Segue abaixo o dignificado de cada tipo:

As entradas digitais são denominadas por X. O GPM-18 possui 10 entradas digitais e elas são

mapeadas desde a X0 a X7 e de X10 até a X11. O contato de uma entrada, por exemplo X3 pode ser

usado inúmeras vezes no programa.

As saídas digitais são denominadas por Y. O CLP GPM-18 possui 8 saídas digitais e elas são

mapeadas desde Y0 atá Y7. O contato de uma saída pode ser usado inúmeras vezes no programa,

porém sua bobina só pode ser usada uma única vez.

Relé auxiliar interno do CLP, é utilizado para elaboração das lógicas de intertravamento. Este tipo

de relé não atua as saídas físicas. É só para uso interno.

Os relés utilizados como retentivos podem manter a condição (ON ou OFF) no caso de

desligamento do CLP.

Relé utilizado para controle de lógica step ladder.

Quando ele não é utilizado para monitorar o estado da lógica Step ladder poderá sere usado como

relé interno.

Os temporizadores são do tipo retardo e tem bases de tempo de 1ms,10ms,100ms etc.

Quando o tempo atinge o valor pré-ajustado o contato do temporizador é acionado.

Os temporizadores T100~T199 tem base de tempo de 100ms, o tempo corrido é acumulativo e

caso a lógica antes do temporizador seja desacionada o tempo corrido será acumulado

Os contadores são divididos em dois tipos de acordo com seu uso:

Uso interno na lógica: Com ou sem dados retentivos

Contador 16 bits: conta somente para cima de 0 a 32.767

Contador 32 bits: Conta para cima e para baixo de -2.147.483.648 a +2.147.483.647

Este contadores são usados nas lógicas internas do CLP, usualmete seu tempo de resposta é

inferior a 10Hz.

Contador de alta velocidade: Com ou sem dados retentivos

Contador 32 bits: Conta para cima e para baixo de -2.147.483.648 a +2.147.483.647

(contagem unidirecional para cima ou para baixo, contagem bidirecional em fase – encoder)

Utiliza entradas digitais especificas, pode contar pulsos de até 200KHz.

Relé Auxiliar Interno((((M))))

Temporizador((((T))))

Contador((((C))))

Status((((S))))

Entrada((((X))))e Saída ( Y )

Page 6: CLP GPM-18 - metaltex.com.br · Você pode programar o CLP GPM tanto em linguagem Ladder como em logica Boleana (lista de instruções). Funções básicas O CLP

Manual Programação CLP – GPM

6

O registrador de dados serve para armazenar valores dentro do CLP. Todos od registradores do

GPM são de 16 bits (o bit mais significativo é o sinal). Combinando dois registradores (double

word) pode-se trabalhar com até 32 bits. Os registradores de dados também podem ser

retentivos ou não.

Registrador de Dados((((D))))

São utilizadas de diversos modos na programação do CLP. O K significa valor decimal e

o H valor hexadecimal. Eles são utilizados em contadores, temporizadores e funções de

alto nível.

Constantes ( K ) e ( H )

Ponteiros ((((P)))) e ((((I))))

Os ponteiros são utilizados como derivação ou interrupção do programa. O ponteiro (P)

é utilizado nas funções jump ou subrotina. O ponteiro (I) é utilizado nas interrupções de

hardware ou de tempo.

Page 7: CLP GPM-18 - metaltex.com.br · Você pode programar o CLP GPM tanto em linguagem Ladder como em logica Boleana (lista de instruções). Funções básicas O CLP

Manual Programação CLP – GPM

7

2-2....Lista de alocação de memória

Mnemônico Nome Faixa Pontos

X Entradas digitais X000~X007, X010~X011

10 entradas

Y Saídas digitais Y000~Y007

8 saídas

M0~M2999【M3000~M7999】 8000

M Relés internos

M8000~M8511 – uso especial 512

S Step ladder

S0~S511 【S512~S1023】 1024

T0~T99:100ms não retentivo

T100~T199:100ms retentivo

T200~T299:10ms não accumulation

T300~T399:10ms retentivo

T400~T499:1ms não retentivo

T500~T599:1ms retentivo

T Temporiza-

dores

T600~T618:1ms com interrupção de tempo preciso

620

C0~C299:16 bits contadores só sobe

C300~C598:32 bits Contadores sobe e desce C Contadores

C600~C634:Contadores alta velocidade

635

D0~D3999 【D4000~D7999】 8000

D Registradores de dados

Para uso especial D8000~D8511 512

FD0~FD1535 1536 FD

Registradores

FlashROM

Para uso especial FD8000~FD8511 512

Page 8: CLP GPM-18 - metaltex.com.br · Você pode programar o CLP GPM tanto em linguagem Ladder como em logica Boleana (lista de instruções). Funções básicas O CLP

Manual Programação CLP – GPM

8

Ajuste das áreas retentivas:

Elemento Registrador

de ajuste Função

Valor ajustado

de fábrica Faixa de ajuste

D FD8202 Inicio da área de D

retentivos 4000 D4000~D8000

M FD8203 Inicio da área de M

retentivos 3000 M3000~M8000

T FD8204 Inicio da área de T

retentivos 620 Não ajustável

C FD8205 Inicio da área de C

retentivos 320 C320~C640

S FD8206 Inicio da área de S

retentivos 512 S512~S1024

NOTAS: ※※※※1. A área de memória marcada com【 】 é a área retentiva definida na fábrica; os

elementos D、M、S、T、C podem ter o tamanho de sua área retentiva mudados. Para

detalhes veja a tabela abaixo. ※※※※2. A área de memória FlashROM é toda retentiva e não necessita da bateria para isto.

Page 9: CLP GPM-18 - metaltex.com.br · Você pode programar o CLP GPM tanto em linguagem Ladder como em logica Boleana (lista de instruções). Funções básicas O CLP

Manual Programação CLP – GPM

9

2-3....Formato dos dados

O CLP GPM tem 5 formas diferentes de apresentação dos valores de acordo com a sua

aplicação. Veja abaixo: 《《《《DEC》》》》 DEC:NÚMERO DECIMAL

Ajuste cós valores de temporizadores e contadores (Constante K)

A identificação do número de relés internos(M),temporizadores(T),contadores(C) e status(S).

Determina valor em uma instrução de alto nível(Constante K) 《《《《HEX》》》》 HEX:NÚMERO HEXADECIMAL

Mesmo que o número DEC, este é usado para determinar valor em uma

instrução de alto nível(Constante H)

《《《《OCT》》》》 OCT:NÚMERO OCTAL

Os pontos de entrada e saída digital do CLP são identificados por número octal,

por ex , 1-7,10-17,...70-77,100-107. As entradas do CLP são de X0 a X7,

X10 e X11. 《《《《código BCD》》》》BCD: BINARY CODE DECIMAL

O BDC é um método de numeração que utilize 4 bits para representar um número

decimal de 0~9 《《《《Ponto flutuante((((float))))》》》》

O CLP GPM tem a capacidade de executar operação de alta precisão com ponto

flutuamte.

《《《《BIN》》》》 BIN:NÚMERO BINÁRIO

Os números utilizados na programação do CLP são DEC ou HEX, porém internamente

eles são transformados em binários. Ao se monitorar um valor pode-se fazê-lo em DEC

ou HEX.

Page 10: CLP GPM-18 - metaltex.com.br · Você pode programar o CLP GPM tanto em linguagem Ladder como em logica Boleana (lista de instruções). Funções básicas O CLP

Manual Programação CLP – GPM

10

2-4....Alguns princípios de acesso a registradores e bits

MOV D10[D0] D100M8000

M2

Y0[D0]

MOV K5 D0

M8002MOV K0 D0

MOV K21 DY0M0

MOV K3 D0M1

MOV DX2[D0] D10M8000

1、、、、Um registrador de dados pode ser usado como indexador((((endereçamento indireto))))

2、、、、 Acesso a bits através de registrador

As entradas X, saídas Y、relés internos M podem ser acessados através de registradores de 16 bits.

Por ex. DX0 significa X0~X17 na forma de registrador de 16 bits. DM20 significa M20~X37 na

forma de reg. de 16 bits.

Formato:Adicione D antes do mnemônico do bit. Ex. DY0

Registradores de combinação de bits disponíveis:DX、DY、DM、DS、DT、DC

Neste exemplo, quando D0=0, então D100=D10, e Y0 é ON;

Quando M2 vai de OFF para ON, D0=5, então D100=D15, e Y5 é ON.

Quando D10[D0]=D[10+D0], Y0[D0]=Y[0+D0].

Indexação de registradores: DXn[Dm] significa DX[n+Dm];

A indexação de variáveis só é feita usando-se o registrador D.

No exemplo acima, quando M0 vai de OFF para ON, o valor do registrador DY0 composto pelos bits

Y0~Y17 fica igual a 21,i.e. Y0、Y2 e Y4 vão para ON.

Antes de M1 ser ativado, quando D0=0, DX2[D0] significa um registrador composto por X2~X21;

Quando M1 vai de OFF para ON, D0=3, então DX2[D0] significa um registrador composto por X5~X24

Page 11: CLP GPM-18 - metaltex.com.br · Você pode programar o CLP GPM tanto em linguagem Ladder como em logica Boleana (lista de instruções). Funções básicas O CLP

Manual Programação CLP – GPM

11

D0.4Y0

D5[D1].4Y1

MOV D0T11M0

T11Y1

X0T11 K99

5、、、、 Interrupções: P,,,,I

P significa o ponteiro utilizado nas funções J e/ou CALL.;

I é o ponteiro da interrupção.

3、、、、 Acesso ao bit de um registrador

Formato:Dn.m

4、、、、 Diferenças entre interpretação das variáveis T e C

Para os registradores de temporizadores (T) e contadores (C ), Tn/Cn pode significar registrador de

dadosd ou bit dependendo da instrução aonde é aplicado.

T e C podem indicar o status do temporizador ou contador (no caso de bit), ou pode significar o

valor atual do temporizador ou contador (no caso de registrador).

No exemplo acima, D0.4 significa que quando o bit No.4 de D0 é 1, Y0 é ON;

D5[D1].4 significa acesso a bit com indexação, se D1=5, isto diz que D5[D1] significa o 4º bit de

D10.

O acesso a bit de registrador com indexação é : Dn[Dm].x

No exemplo acima,MOV T11 D0, T11 é um registrador de dados;

LD T11 ,T11 é um bit.

Page 12: CLP GPM-18 - metaltex.com.br · Você pode programar o CLP GPM tanto em linguagem Ladder como em logica Boleana (lista de instruções). Funções básicas O CLP

Manual Programação CLP – GPM

12

3-1....Temporizadores e funções [T]

100ms não retentivo(16 bits) T0~T99

100ms retentivo (16 bits) T100~T199

10ms não retentivo (16 bits) T200~T299

10ms retentivo (16 bits) T300~T399

1ms não retentivo (16 bits) T400~T499

1ms retentivo (16 bits) T500~T599

Número de

temporizadores

Veja abaixo na tabela os temporizadores [T] possíveis de serem

utilizados.

Funções Os temporizadores recebem pulsos de 1ms, 10ms, 10ms internamente no

CLP. Quando o valor escolhido é alcançado, o sinal de saída é ativado. Use

este sinal para acionar uma saída. Para determinar um tempo fixo utilize

uma constante K no programa, É possível utilizar um registrador (D) para

definir um tempo variável.

Se a entrada X000 estiver acionada, o

temporizador T200 inicia a contagem

do tempo. O T200 é um temporizador

de 10ms, ou seja, o valor do tempo

desejado terá que ser multiplicado por

esse tempo. Se o valor escolhido for

igual à K200, a saída do temporizador

ocorrerá após 2 segundos (200*10ms

= 2s). O temporizador só temporiza

enquanto existir a entrada X000, caso

o sinal de entrada vá para o nível baixo

o temporizador é zerado.

Tem

po

rizad

or n

ão

retentiv

o

Page 13: CLP GPM-18 - metaltex.com.br · Você pode programar o CLP GPM tanto em linguagem Ladder como em logica Boleana (lista de instruções). Funções básicas O CLP

Manual Programação CLP – GPM

13

T10 K100X0

MOV K200 D5

T10 D5

X0

X1

Y0

T2

X0

Y0 X0

X0

Y0 T2K200

T2

Se a entrada X001 estiver habilitada o

temporizador T300 começa a contar o

tempo. Quando o tempo é alcançado

(K2000*10ms = 20s), a saída do T300 é

acionada. Observe que durante a contagem

do tempo, a entrada X001 é desabilitada,

mas o tempo não é zerado devido a

retenção do valor. Quando habilitada

novamente o tempo recomeça de onde

parou, observe a figura. Quando a entrada

X002 é habilitada, o tempo e a saída do

temporizador são zerados.

T10 é um temporizador com unidade

de tempo de 100ms. K100 é uma

constante de multiplicação, logo 0.1s×100 = 10s tempo de trabalho.

O valor indireto consiste na entrada

do tempo para o temporizador através

de um registrador (D). Veja o

exemplo ao lado.

《《《《Saída com retardo na desernergização》》》》

Exemplos

《Valor constante (K)》

《Valor indireto (D)》

Método de uso

do

temporizador

Quando X000 é habilitado, a saída Y000 é acionada;

Se X000 é desabilitada (1->0), O temporizador T2 de 20 segundos inicia a

Valore de

referência

Existem 600 temporizadores (retentivos e não retentivos, conforme tabela

acima) do T0~T599 de 16 “bits” que abrange os valores de 0 á 32767. Se o

valor do temporizador for superior á 32767, o temporizador deixará de

cronômetrar e seu estado permanecerá o mesmo.

Tem

po

rizad

or reten

tivo

Page 14: CLP GPM-18 - metaltex.com.br · Você pode programar o CLP GPM tanto em linguagem Ladder como em logica Boleana (lista de instruções). Funções básicas O CLP

Manual Programação CLP – GPM

14

T1

T2

Y0

X0

T1

T2

X0

Y0

T1 T2 T1K10

K20

3-2....Contadores e funções [C]

Contador positive de 16 “bits” C000~C299

Contadores positivos e

negativos de 32 “bits”

C300~C598 (C300, C302... C598). (utilizar

sempre múltiplos de 2). Os contadores podem

ser ímpares.

Contador de alta velocidade

C600~C634 (C600, C602...C634). (utilizar

sempre múltiplos de 2). Os contadores podem

ser ímpares.

《《《《Pisca - pisca》》》》

Se X000 ativado, Y000 é alternado de acordo com os tempos definidos.

T1 controla o nível baixo de Y000, T2 controla o nível alto de Y000. A saída é

alternada enquanto existir o sinal alto de X000.

Números de

contadores

Veja na tabela abaixo os contadores (C), existentes no CLP.

Características

dos contadores Veja abaixo na tabela algumas características dos contadores de 16 “bits”

e 32 “bits”:

Tamanho Contador 16 bits Contador 32 bits

Direção da

contagem Positiva Positiva/negativa

Valores

min/máx De 1 à 32767 De -2,147,483,648 à +2,147,483,647

Tipo de dados Constante K ou registradores Constantes K ou registradores, mas,

aos pares.

Saídas Aciona a saída após o alcançar o

valor escolhido. Incrementa ou decrementa.

Reset

Quando executado o comando de

Reset,O contador retorna a zero e

sua saída retorna ao valor de

origem.

Page 15: CLP GPM-18 - metaltex.com.br · Você pode programar o CLP GPM tanto em linguagem Ladder como em logica Boleana (lista de instruções). Funções básicas O CLP

Manual Programação CLP – GPM

15

RST C0X0

C0 K10

Y0

X1

C0

O contador de incremento de 16 “bits” pode ser ajustado para valores de K1 a

K32767 (constante decimal).

Quando o CLP é alimentado, os

valores dos contadores são colocados

com o valor 0, salvo o contador que

utiliza dados retentivos. O contador

que utiliza dados retentivos mantém os

mesmos valores que tinha antes de ser

desernegizado.

A cada pulso da entrada X001 em C0, o contador é incrementado. Quando

a contagem alcançar o valor escolhido “K10”, ou a décima contagem, a

saída é ativada. Quando o valor da contagem é alcançado, os pulsos de

X001 não incrementarão mais o contador ficando com o valor escolhido.

Para resetar, basta dar um pulso na entrada X000 em série com a instrução

RST, o valor do contador é inicializado e a saída volta ao seu estado

inicial.

Para ajustar o valor do contador, insira um valor através de uma constante

“K” ou utilize um registrador interno do CLP, movendo o valor desejado

para o registrador escolhido.

Função

Co

nta

do

res de 1

6 “

bits” – U

so co

mu

m d

o co

nta

do

r

Page 16: CLP GPM-18 - metaltex.com.br · Você pode programar o CLP GPM tanto em linguagem Ladder como em logica Boleana (lista de instruções). Funções básicas O CLP

Manual Programação CLP – GPM

16

RST C300X3

C300 K10

Y1

X4

C300

M8238X2

C0X001

K100

MOV K100 D5

C0 D5

X000

X001

Para os contadores de incremento de 32 “bits”, com limites de K1 a

K2.147.483,647 (constante decimal). É necessário o uso do relé especial

M8238, que direciona a contagem em positivo/negativo (C300~C498). Veja o

exemplo abaixo.

Se a entrada X2 habilita M8238,

então a contagem será decrescente.

Caso contrário, a contagem será

crescente.

Escolha um valor positivo para o

contador através de uma constante

K ou de um registrador D. Esse

valor deverá estar dentro da faixa de

abrangência dos 32 “bits”. Para um

registrador, exemplo D0, utilize D0

e D1 para formar os 32 “bits” de

dados. Se a entrada X004 for

pulsada no contador C300, a

contagem é incrementada ou

decrementada de acordo com X2.

Co

nta

do

res de 3

2 “

bits”, C

on

tad

or reten

tivo d

e uso

com

um

Quando a entrada X3 é habilitada, a instrução RST é executada, o

contador é inicializado e a saída também.

Para os contadores retentivos, o valor e a saída do contador não são

perdidos quando o CLP for desernegizado.

Você também poderá utilizar o contador de 32 “bits” como um registrador

de 32 “bits”. Mas não é possível usá-lo com uma instrução de 16 “bits”

Exemplos Contador de 16“bits” 《Valor constante(K)》

《Usando um registrador(D), atravéz da instrução MOV》

Page 17: CLP GPM-18 - metaltex.com.br · Você pode programar o CLP GPM tanto em linguagem Ladder como em logica Boleana (lista de instruções). Funções básicas O CLP

Manual Programação CLP – GPM

17

C300X001

K43,100

DMOV K43100 D0

C300 D0(D1)X000

X001

3-3....Informações adicionais

《《《《Ordem de ação de entrada/saída, relé e tempo de resposta》》》》

Disposição das entradas

Antes de ser executado o programa no CLP, todas as entradas são colocadas para 0 na área

de imagem. Durante a execução do programa, mesmo que o estado de uma entrada mude o

conteúdo da memória imagem das entradas não será alterado. No entanto este conteúdo será

alterado no scan seguinte.

Disposição das saídas

Uma vez realizada a execução de todas as instruções, os dados de “bits” são transferidos

da área de imagem para a área de memória. Estas serão as saídas atuais no CLP. As saídas

físicas do CLP são modificadas em função do tempo de resposta.

Entrada de

valores

A contagem dos contadores T0 á T599 é de 16 “bits”, linear incremental que

varia de K0 á K32767. Caso o valor escolhido seja alcançado K32767, o

contador para a contagem, e seus estados são inicializados.

Contador de 32 “bits” 《Valor constante(K)》

《Usando um registrador(D), atravéz da instrução DMOV》

Page 18: CLP GPM-18 - metaltex.com.br · Você pode programar o CLP GPM tanto em linguagem Ladder como em logica Boleana (lista de instruções). Funções básicas O CLP

Manual Programação CLP – GPM

18

《《《《Não é aceito pulso de sinal de entrada rápida》》》》

《《《《Saída duplicada》》》》

Y3

Y4

Y3

X1

Y3

X2

Um pulso de entrada não pode ser maior que o tempo de ciclo. Se considerarmos um tempo de

entrada com filtro de 10ms, em um ciclo também de 10ms,então uma entrada necessitará de

20ms por borda. Logo, temos 1000 /(20+20)= 25Hz de limite de entrada. Mas, esta condição

pode ser ajustada para algumas entradas através instruções de função especial.

Como mostrado na figura ao lado, veja a

saída Y003 sendo utilizado numa

duplicidade por duas entradas, vamos

supor que as entradas se encontram na

seguinte condição:

Ex. X001=”1”,X002=”0”

No primeiro instante, X001=“1”, este valor

é transportado para a área de imagem, A

saída Y004 é atualizada neste instante para

“1”, porque Y003 da condição para isto.

Mas, a próxima linha faz da entrada

X002=“0”, e a área de imagem de

Y003=”0”.

Então, os estados das saídas sempre serão:

Y003=”0” e Y004= “1”.

Sempre que necessitar utilizar uma saída

duplicada, mantenha uma prioridade na linha

ou utilize uma lógica combinacional para

executar a instrução.

Page 19: CLP GPM-18 - metaltex.com.br · Você pode programar o CLP GPM tanto em linguagem Ladder como em logica Boleana (lista de instruções). Funções básicas O CLP

Manual Programação CLP – GPM

19

Neste capítulo, descrevemos algumas instruções básicas e funções.

4....Instruções de programação básicas

4-1.Lista de instruções básicas.

4-2.【LD】, 【LDI】, 【OUT】

4-3.【AND】, 【ANI】

4-4.【OR】, 【ORI】

4-5.【LDP】, 【LDF】, 【ANDP】, 【ANDF】, 【ORP】, 【ORF】

4-7.【ORB】

4-8.【ANB】

4-9.【MCS】, 【MCR】

4-10.【ALT】

4-11.【PLS】, 【PLF】

4-12.【SET】, 【RST】

4-13.【OUT】, 【RST】 (Para uso com os contadores também).

4-14.【NOP】, 【END】

4-15.Entre outros…

4-6.Instruções de comparação

Page 20: CLP GPM-18 - metaltex.com.br · Você pode programar o CLP GPM tanto em linguagem Ladder como em logica Boleana (lista de instruções). Funções básicas O CLP

Manual Programação CLP – GPM

20

4-1....Identificando as instruções básicas.

GPM-18 Tabela de instruções básicas

Mnemônico Função Formato e Registros

LD

(Contato aberto)

Operação inicial lógica contato

NA (Normalmente aberto) X、Y、M、S、T、C、Dn.m、FDn.m

LDI

(Contato fechado)

Operação inicial lógica contato

NF (Normalmente fechado) X、Y、M、S、T、C、Dn.m、FDn.m

LDP

(Pulso de borda)

Operação inicial lógica de

borda pulso de subida X、Y、M、S、T、C、Dn.m、FDn.m

LDF

(Pulso de borda )

Operação inicial lógica de

borda pulso de descida X、Y、M、S、T、C、Dn.m、FDn.m

AND

(E)

Lógica combinacional de

contatos NA (Normalmente

aberto)

X、Y、M、S、T、C、Dn.m、FDn.m

ANI

(E-Invertida)

Lógica combinacional de

contatos NF (Normalmente

fechado) contacts

X、Y、M、S、T、C、Dn.m、FDn.m

ANDP

(E pulsado, subida)

Lógica combinacional de

contatos por borda de subida X、Y、M、S、T、C、Dn.m、FDn.m

ANDF

(E pulsado, descida)

Lógica combinacional de

contatos por borda de descida X、Y、M、S、T、C、Dn.m、FDn.m

OR

(OU)

Lógica combinacional de

contatos NA (Normalmente

aberto)

X、Y、M、S、T、C、Dn.m、FDn.m

ORI

(OU-Invertida)

Lógica combinacional de

contatos NF (Normalmente

aberto)

X、Y、M、S、T、C、Dn.m、FDn.m

ORP

(OU-Pulsado, subida)

Lógica combinacional de

contatos por borda de subida X、Y、M、S、T、C、Dn.m、FDn.m

ORF

(OU-Pulsado, descida)

Lógica combinacional de

contatos por borda de descida X、Y、M、S、T、C、Dn.m、FDn.m

ANB

(Multiplos E)

Lógica combinacional de

contatos de entradas múltiplas

Não tem

ORB

(Multiplos OU)

Lógica combinacional de

contatos de múltiplas entradas

Não tem

OUT

(Saída)

Operação final de uma linha de

instrução Y、M、S、T、C、Dn.m

SET

(Seta)

Condiciona um “bit”

permanentemente “1” Y、M、S、T、C、Dn.m

RST

(Reset)

Condiciona um “bit”

permanentemente “0” Y、M、S、T、C、Dn.m

Page 21: CLP GPM-18 - metaltex.com.br · Você pode programar o CLP GPM tanto em linguagem Ladder como em logica Boleana (lista de instruções). Funções básicas O CLP

Manual Programação CLP – GPM

21

PLS

(Detecção de borda subida)

Atua uma ves na borda de

subida X、Y、M、S、T、C、Dn.m

PLF

(Detecção de borda descida)

Atua uma vez na borda de

descida X、Y、M、S、T、C、Dn.m

MCS

(Inicio de nova linha)

Nova linha de instruções em

série

Não tem

MCR

(Retorno da linha inserida)

Retorno da linha em série

inserida

Não tem

ALT

(Alterna estado)

Alterna os estados da saída do

dispositivo X、Y、M、S、T、C、Dn.m

NOP

(Sem operação)

Não executa durante o tempo

da instrução

Não tem

END

(FIM)

Força o programa para o final

do “scan”

Não tem

Page 22: CLP GPM-18 - metaltex.com.br · Você pode programar o CLP GPM tanto em linguagem Ladder como em logica Boleana (lista de instruções). Funções básicas O CLP

Manual Programação CLP – GPM

22

4-2.【.【.【.【LD】】】】, 【【【【LDI】】】】, 【【【【OUT】】】】

Mnemônico Função Formato e registros

LD

(Contato aberto)

Lógica de contato aberto

NA (Normalmente aberto)

Registros:X、Y、M、S、T、C、Dn.m、FDn.m

LDI

(Contato

fechado)

Lógica de contato fechado

NF (Normalmente

fechado)

Registros:X、Y、M、S、T、C、Dn.m、FDn.m

OUT

(Saída)

Lógica de saída física,

sinal ou relé interno.

Registros:X、Y、M、S、T、C、Dn.m、FDn.m

Coloque as instruções, por exemplo, (LD e LDI) do lado esquerdo da

barra de linha, ou utilize um novo bloco usando a instrução ANB.

A instrução OUT representa uma saída física, um relé interno auxiliar,

temporizador, contador, etc. Não é possível usar uma entrada na

instrução de saída.

Não é possível usar um comando de saída paralela por muitas vezes.

Para os temporizadores e ou contadores, depois de escolher a instrução

de saída é necessário inserir uma constante K.

O limite das variáveis deve ser respeitado. Veja abaixo na tabela.

Modo de

usar

Mnemonico

Page 23: CLP GPM-18 - metaltex.com.br · Você pode programar o CLP GPM tanto em linguagem Ladder como em logica Boleana (lista de instruções). Funções básicas O CLP

Manual Programação CLP – GPM

23

Y100

M1203

T 0

X0

Y 1

X1

T0K19

Temporizador /Contador Abrangência Valores respectivos

Tempo de 1ms 0.001~32.767 segundos

Tempo de 10ms 0.01~32.767 segundos

Tempo de 100ms

1~32.767

0.1~32.767 segundos

Contador de 16 “bits” 1~32.767

Igual a abrangência

Contador de 32 “bits” 1~2.147.483.647

Igual a abrangência

Programa LD X0

OUT Y100

LDI X1

OUT M1203

OUT T0

SP K19

LD T0

OUT Y1

Page 24: CLP GPM-18 - metaltex.com.br · Você pode programar o CLP GPM tanto em linguagem Ladder como em logica Boleana (lista de instruções). Funções básicas O CLP

Manual Programação CLP – GPM

24

4-3.【.【.【.【AND】】】】, 【【【【ANI】】】】

Mnemônico Função Formato e registros

AND

(E)

Lógica “E” de contato

NA (Normalmente

aberto)

M0

Registros:X、Y、M、S、T、C、Dn.m、FDn.m

ANI

(E-Invertida)

Lógica “E-Invertida”

de contato NF

(Normalmente

fechado)

M0

Registros:X、Y、M、S、T、C、Dn.m、FDn.m

Utilize as instruções “E” ou “E-Invertida” para uma seqüência de

lógicas combinacional.

Uma lógica combinacional “E” permite que uma saída ou uma

instrução, seja executada somente se as entradas estiverem em nível

alto (para um contato NA) ou nível baixo (para um contato NF)

forem verdadeiros. Veja o exemplo abaixo.

Descrição

Programa

LD X2

AND M1

OUT Y2

LD Y2

ANI X3

OUT M2

AND T1

OUT Y3

Y2

M2

Y3

X2 M1

X3Y2

T1

Mnemonico

Page 25: CLP GPM-18 - metaltex.com.br · Você pode programar o CLP GPM tanto em linguagem Ladder como em logica Boleana (lista de instruções). Funções básicas O CLP

Manual Programação CLP – GPM

25

4-4....【【【【OR】】】】, 【【【【ORI】】】】

Mnemônico Função Formato e registros

OR

(OU)

Lógica combinacional

“OU” contato NA

(Normalmente aberto)

Registros:X、Y、M、S、T、C、Dn.m、FDn.m

ORI

(OU-Invertida)

Lógica combinacional

“OU” contato NF

(Normalmente

fechado)

Registros :X、Y、M、S、T、C、Dn.m、FDn.m

Programa

Mnemônico

e Função

Descrição Use a instrução OR e ORI, quando houver a necessidade de mais de

uma entrada dar condição de acionar uma saída ou uma função. Para

inserir mais de um contato em uma lógica OU utilize a instrução

ORB. Veja o exemplo abaixo.

Uma ligação em paralelo

com as instruções OR, ORI,

e ANB é necessário usar as

instruções LD, LDI sempre

no inicio das instruções.

Y6

M100

X5

X6

M11

Y6 M4 X7

M12

M13

LD X5

OR X6

OR M11

OUT Y6

LDI Y6

AND M4

OR M12

ANI X7

OR M13

OUT M100

Relacionando

com ANB

Page 26: CLP GPM-18 - metaltex.com.br · Você pode programar o CLP GPM tanto em linguagem Ladder como em logica Boleana (lista de instruções). Funções básicas O CLP

Manual Programação CLP – GPM

26

4-5.【.【.【.【LDP】】】】, 【【【【LDF】】】】, 【【【【ANDP】】】】, 【【【【ANDF】】】】, 【【【【ORP】】】】, 【【【【ORF】】】】

Mnemônico Função Formato e registros

LDP

(Pulso de borda)

Operação inicial lógica

contato NA

(Normalmente aberto)

Registros:X、Y、M、S、T、C、Dn.m、FDn.m

LDF

(Pulso de borda )

Operação inicial lógica

de borda

Pulso de descida

Registros:X、Y、M、S、T、C、Dn.m、FDn.m

ANDP

(E pulsado,

subida)

Lógica combinacional de

contatos por borda de

subida

Registros:X、Y、M、S、T、C、Dn.m、FDn.m

ANDF

(E pulsado,

descida)

Lógica combinacional de

contatos por borda de

descida

Registros:X、Y、M、S、T、C、Dn.m、FDn.m

ORP

(OU-Pulsado,

subida)

Lógica combinacional de

contatos por borda de

subida

M0

Registros:X、Y、M、S、T、C、Dn.m、FDn.m

ORF

(OU-Pulsado,

descida)

Lógica combinacional de

contatos por borda de

descida

M0

Registros:X、Y、M、S、T、C、Dn.m、FDn.m

Mnemônico

e Função

Descrição

LDP、ANDP、ORP São ativados pelo “scan” quando mudam o estado

de ”0” para “1”.

LDF、ANDF、ORF São ativados pelo “scan” quando mudam o estado

de ”1” para “0”.

Page 27: CLP GPM-18 - metaltex.com.br · Você pode programar o CLP GPM tanto em linguagem Ladder como em logica Boleana (lista de instruções). Funções básicas O CLP

Manual Programação CLP – GPM

27

No diagrama acima quando X005~X007 mudar o estado de ”1” para “0” ou de ”0” para “1” ,

M13 ou M15 é ativado no primeiro scan do programa.

Nas duas condições, quando X0 mudar de ”0” para “1”, M20 é ativado no

ciclo de “scan”.

NOTA:::: X10MOV K10 D0

X10MOV K10 D0

M13

M15

X5

X6

M8000 X7

M13

M15

X5

X6

M8000 X7

LDP X5

ORP X6

OUT M13

LD M8000

ANDP X7

OUT M15

LDF X5

ORF X6

OUT M13

LD M8000

ANDF X7

OUT M15

Programa

Saída

Quando X10 mudar de ”0” para “1”,

a instrução MIV é executada apenas

uma vez.

No exemplo ao lado, quando X10

mudar de ”0” para “1”, a instrução

MOV é executada a cada ciclo de

“scan”.

Page 28: CLP GPM-18 - metaltex.com.br · Você pode programar o CLP GPM tanto em linguagem Ladder como em logica Boleana (lista de instruções). Funções básicas O CLP

Manual Programação CLP – GPM

28

4-7....【【【【ORB】】】】

Mnemônico Função Formato e registros

ORB

(Múltiplos

OU)

Lógica combinacional de

contatos de múltiplas

entradas

Registros:Não tem

Programa

Descrição

Declarar no início da lógica, quando necessitar de múltiplas entradas.

Uma instrução ORB é independente e não é associada com nenhum

registrador.

Sem limites para o uso da instrução ORB.

Quando usar a instrução ORB em grandes quantidades, não ultrapassar

de 8 instruções de LD e LDI nas definições dos blocos do programa (em

ligações paralelas).

Método de programação

seqüencial recomendada:

LD X0

AND X1

LD X2

AND X3

ORB

LDI X4

AND X5

ORB

OUT Y10

Método de programação

seqüencial não

recomendada:

LD X0

AND X1

LD X2

AND X3

LDI X4

AND X5

ORB

ORB

OUT Y10

Mnemônico

e Função

Page 29: CLP GPM-18 - metaltex.com.br · Você pode programar o CLP GPM tanto em linguagem Ladder como em logica Boleana (lista de instruções). Funções básicas O CLP

Manual Programação CLP – GPM

29

4-8....【【【【ANB】】】】

Mnemônico Função Formato and registros

ANB

(Múltiplos E)

Lógica combinacional de

contatos de entradas

múltiplas

Registros:Não tem

Inicio do ramo

Inicio do ramo

Fim do bloco paralelo

Fim do bloco paralelo

Lógica “E”

Mnemônico

Para declarar o ponto inicial do circuito utilize as funções LD ou LDI.

Depois de completar o circuito paralelo conecte-o com a instrução

ANB.

Descrição

Programa

LD X0

OR X1

LD X2

AND X3

LDI X4

AND X5

ORB

OR X6

ANB

OR X7

OUT Y20

Page 30: CLP GPM-18 - metaltex.com.br · Você pode programar o CLP GPM tanto em linguagem Ladder como em logica Boleana (lista de instruções). Funções básicas O CLP

Manual Programação CLP – GPM

30

4-9....【【【【MCS】】】】,【【【【MCR】】】】

Mnemônico Função Formato e registros

MCS

(Inicio de nova

linha)

Nova linha de

instruções em

série

Y0

Registros:Não tem

MCR

(Retorno da

linha inserida)

Retorno da linha

em série inserida Y0

Registros:Não tem

X1 X2

M2

M3M1

Y0

Y1

Y2

Descrição

Programa

Mnemônico

Após a execução da instrução MCS, indica que uma nova linha será

criada a partir da instrução (LD, LDI). Para retornar para a linha origina

use a instrução MCR.

MCS, MCR são instruções para serem usados em conjunto.

A lógica deve ser implementada entre as instruções MCS, MCR. O

máximo de níveis de linha que podem ser inseridos, não pode

ultrapassar de 10.

LD X1

MCS

LD X2

OUT Y0

LD M1

MCS

LD M3

OUT Y1

LD M2

OUT Y2

MCR

MCR

Inicio da segunda linha

Terceira linha

Retorno da segunda linha

Retorno da terceira linha

Page 31: CLP GPM-18 - metaltex.com.br · Você pode programar o CLP GPM tanto em linguagem Ladder como em logica Boleana (lista de instruções). Funções básicas O CLP

Manual Programação CLP – GPM

31

4-10....【【【【ALT】】】】

Mnemônico Função Formato e registros

ALT

(Alterna

estado)

Alterna os estados da saída

do dispositivo M0ALT

Registros: Y、M、S、T、C、Dn.m

M0ALT

M0Y0

M100

Y1M0

Descrição

Programa

Mnemônico

e função

É alternado o estado do dispositivo de destino em toda operação da

instrução de ALT.

LDP M100

ALT M0

LD M0

OUT Y0

LDI M0

OUT Y1

Page 32: CLP GPM-18 - metaltex.com.br · Você pode programar o CLP GPM tanto em linguagem Ladder como em logica Boleana (lista de instruções). Funções básicas O CLP

Manual Programação CLP – GPM

32

4-11.【.【.【.【PLS】】】】, 【【【【PLF】】】】

Mnemônico Função Formato e registros

PLS

(Detecção

de borda

subida)

Atua uma vez na borda de

subida

Registros: Y、M、S、T、C、Dn.m

PLF

(Detecção

de borda

descida)

Atua uma vez na borda de

descida

Registros: Y、M、S、T、C、Dn.m

X0PLS M0

M0SET Y0

X1PLF M1

M1RST Y0

Mnemônico

e Função

Descrição

Quando a instrução PLS é executada, as saídas atuam na borda de

subida, ou, são modificadas.

Quando a instrução PLS é executada, as saídas atuam na borda de

descida, ou, são modificadas.

Utilizado para capturar apenas um sinal por scan.

Programa

LD X0

PLS M0

LD M0

SET Y0

----------------------

LD X1

PLF M1

LD M1

RST Y0

Page 33: CLP GPM-18 - metaltex.com.br · Você pode programar o CLP GPM tanto em linguagem Ladder como em logica Boleana (lista de instruções). Funções básicas O CLP

Manual Programação CLP – GPM

33

4-12.【.【.【.【SET】】】】, 【【【【RST】】】】

Mnemônico Função Formato e registros

SET

(Seta)

Condiciona um “bit”

permanentemente “1”

Registros: Y、M、S、T、C、Dn.m

RST

(Reset)

Condiciona um “bit”

permanentemente “0”

Registros: Y、M、S、T、C、Dn.m

X10SET Y0

X11RST Y0

X12SET M50

X13RST M50

X14SET S0

X15RST S0

X10T250

K10

X17RST T250

X10

X11

Y0

Mnemônico

e Função

Descrição

A instrução SET força um registro para “1” garantindo o seu estado.

A instrução RST força um registro para “0”, garantindo o seu estado.

Use as instruções SET e RST, sempre em conjunto.

Programa

LD X10

SET Y0

LD X11

RST Y0

LD X12

SET M50

LD X13

RST M50

LD X14

SET S0

LD X15

RST S0

LD X10

OUT T250

SP K10

LD X17

RST T250

Page 34: CLP GPM-18 - metaltex.com.br · Você pode programar o CLP GPM tanto em linguagem Ladder como em logica Boleana (lista de instruções). Funções básicas O CLP

Manual Programação CLP – GPM

34

4-13....【【【【OUT】】】】, 【【【【RST】】】】para os contadores

Mnemônico Função Formato e registros

OUT

(OUT)

Resultado da lógica dos

contatos. Finaliza a

instrução.

K or D

RST

(Reset)

Condiciona um “bit”

permanentemente “0”

X10

RST C0

X11

C0K10

C0

Y0

Para uso com os contadores retentivos.

Sempre que for desernegizado o CLP,

para um contador retentivo (abaixo)o seu

valor permanecerá com o estado anterior,

use o reset para limpar o“bit” do contador.

Mnemônico

e Funções

Programação

C0 é incrementado através da

transição do pulso de X011 de “0”

para “1”. Quando o valor da contagem

K10 é alcançado, a saída do contador

C0 é ativada. Caso a entrada X011

continue gerando pulsos o contador

não fará mais contagens porque a sua

saída já está ativada.

Para zerá-lo, foi utilizada a entrada

X010 que utiliza o comando RST para

reiniciar o valor do contador. Isso é

necessário para reiniciar a contagem

do contador e limpar a saída também.

Programando

com o contador

de alta

velocidade

Page 35: CLP GPM-18 - metaltex.com.br · Você pode programar o CLP GPM tanto em linguagem Ladder como em logica Boleana (lista de instruções). Funções básicas O CLP

Manual Programação CLP – GPM

35

Open circuit

4-14....【【【【NOP】】】】, 【【【【END】】】】

Mnemônico Função Formato e registros

NOP

(Sem

operação)

Não executa

durante o

tempo da

instrução

END

(FIM)

Força o

programa para

o final do

“scan”

Descrição A função NOP não efetua nenhuma operação. E

O CLP executa repetidamente a leitura das

entradas, execução do programa e atualização das

saídas (scan). O programa é executado a partir da

prmeira instrução até a instrução END. As funções

após o END não são executadas.

AND→NOP ANI→NOP

OUT→NOP

OR→NOP

ORI→NOP

Mnemônico

e Funções

Page 36: CLP GPM-18 - metaltex.com.br · Você pode programar o CLP GPM tanto em linguagem Ladder como em logica Boleana (lista de instruções). Funções básicas O CLP

Manual Programação CLP – GPM

36

4-15....Pequenas notas para o início de programação

1- A estrutura de contatos e o número de passos

O programa é realizado em ordem seqüencial, de fácil construção e pode ser salvo de acordo

com o avanço no desenvolvimento.

2- Seqüência da programação

A seqüência do programa é feito da seguinte maneira: 【de cima para baixo】 e 【da esquerda

para a direita】.

3- Duas saídas ativadas e uma solução

Coloque as instruções em uma lógica combinacional “E” ou “OU”..., quando precisar ativar a

mesma saída.

Não é contra a regra usar duplamente a mesma saída, mas, este procedimento confunde e

dificulta na interpretação do programa, por favor, modifique o programa conforme o desenho

abaixo.

Existem diversas maneiras para ativar uma saída. O importante é garantir que a uma saída terá

apenas uma linha para a sua execução, isto facilita muito no desenvolvimento do programa

garantido toda a lógica em apenas uma linha.

Page 37: CLP GPM-18 - metaltex.com.br · Você pode programar o CLP GPM tanto em linguagem Ladder como em logica Boleana (lista de instruções). Funções básicas O CLP

Manual Programação CLP – GPM

1

In this chapter, we describe applied instruction’s function of GPM series PLC.

5....Applied Instructions

5-1.Table of Applied Instructions

5-2.Reading Method of Applied Instructions

5-3.Flow Instructions

5-4.Contactors Compare Instructions

5-5.Move and Compare Instructions

5-6.Arithmetic and Logic Operation Instructions

5-7.Loop and Shift Instructions

5-8.Data Convert

5-9.Floating Operation

5-10.Clock Operation

Page 38: CLP GPM-18 - metaltex.com.br · Você pode programar o CLP GPM tanto em linguagem Ladder como em logica Boleana (lista de instruções). Funções básicas O CLP

Manual Programação CLP – GPM

2

Page 39: CLP GPM-18 - metaltex.com.br · Você pode programar o CLP GPM tanto em linguagem Ladder como em logica Boleana (lista de instruções). Funções básicas O CLP

Manual Programação CLP – GPM

3

5-1....Applied Instruction List

The applied instructions’ sort and their correspond instructions are listed in the following table:

Sort Mnemon

ic Function

CJ Condition jump

CALL Call subroutine

SRET Subroutine return

STL Flow start

STLE Flow end

SET Open the assigned flow, close the current flow

ST Open the assigned flow, not close the current flow

FOR Start of a FOR-NEXT loop

NEXT End of a FOR-NEXT loop

Program

Flow

FEND First end

LD= LD activates if (S1) = (S2)

LD> LD activates if (S1) > (S2)

LD< LD activates if (S1) =< (S2)

LD<> LD activates if(S1)≠(S2)

LD<= LD activates if(S1)≤(S2)

LD>= LD activates if(S1)≥(S2)

AND= AND activates if(S1)=(S2)

AND> AND activates if(S1)>(S2)

AND< AND activates if(S1)<(S2)

AND<> AND activates if(S1)≠(S2)

AND<= AND activates if(S1)≤(S2)

AND>= AND activates if(S1)≥(S2)

Data

Compare

OR= OR activates if(S1)=(S2)

Page 40: CLP GPM-18 - metaltex.com.br · Você pode programar o CLP GPM tanto em linguagem Ladder como em logica Boleana (lista de instruções). Funções básicas O CLP

Manual Programação CLP – GPM

4

OR> OR activates if(S1)>(S2)

OR< OR activates if(S1)<(S2)

OR<> OR activates if(S1)≠(S2)

OR<= OR activates if(S1)≤(S2)

OR>= OR activates if(S1)≥(S2)

MOV Move

BMOV Block move

FMOV Fill move

FWRT FlashROM written

MSET Zone set

ZRST Zone reset

SWAP The high and low byte of the destinated devices are

exchanged

Data

Move

XCH Exchange

ADD Addition

SUB Subtraction

MUL Multiplication

DIV Division

INC Increment

DEC Decrement

MEAN Mean

WAND Word And

WOR Word OR

WXOR Word exclusive OR

CML Compliment

Data

Operation

NEG Negative

SHL Arithmetic Shift Left

SHR Arithmetic Shift Right

LSL Logic shift left

LSR Logic shift right

ROL Rotation shift left

ROR Rotation shift right

SFTL Bit shift left

SFTR Bit shift right

WSFL Word shift left

Data Shift

WSFR Word shift right

WTD Single word integer converts to double word integer Data

Convert FLT 32 bits integer converts to float point

Page 41: CLP GPM-18 - metaltex.com.br · Você pode programar o CLP GPM tanto em linguagem Ladder como em logica Boleana (lista de instruções). Funções básicas O CLP

Manual Programação CLP – GPM

5

FLTD 64 bits integer converts to float point

INT Float point converts to binary

BIN BCD converts to binary

BCD Binary converts to BCD

ASC Hex. converts to ASCII

HEX ASCII converts to Hex.

DECO Coding

ENCO High bit coding

ENCOL Low bit coding

ECMP Float compare

EZCP Float Zone compare

EADD Float Add

ESUB Float Subtract

EMUL Float Multiplication

EDIV Float division

ESQR Float Square Root

SIN Sine

COS Cosine

Float

Point

Operation

TAN Tangent

TCMP Time Compare

TZCP Time Zone Compare

TADD Time Add

TSUB Time Subtract

TRD Read RTC data

Clock

Operation

TWR Set RTC data

Page 42: CLP GPM-18 - metaltex.com.br · Você pode programar o CLP GPM tanto em linguagem Ladder como em logica Boleana (lista de instruções). Funções básicas O CLP

Manual Programação CLP – GPM

6

5-2....Reading Method of Applied Instructions

Understanding method of instruction understanding

In this manual, the applied instructions are described in the following manner.

Page 43: CLP GPM-18 - metaltex.com.br · Você pode programar o CLP GPM tanto em linguagem Ladder como em logica Boleana (lista de instruções). Funções básicas O CLP

Manual Programação CLP – GPM

7

Note:

Instruction D(NUM) Object data

Instruction D(NUM) Object data Object data

①①①① Denote the instruction name ②②②② 16 bits instruction and 32 bits instruction ③③③③ Denotes the soft units which can be used as the operation object ④④④④ Ladder Example ⑤⑤⑤⑤ Flag after executing the instruction. Instructions without the direct flag will not display. ⑥⑥⑥⑥ Suitable models for the instruction ⑦⑦⑦⑦ Source operand, its content won’t change after executing the instruction

Destinate operand, its content changes with the execution of the instruction

(8) Tell the instruction’s basic action, using way, applied example, extend function, note items etc.

S· D·

The assignment of the data

The data register of GPM series PLC is a single word (16 bit) data register,

single word data only engross one data register which is assigned by single

word object instruction. The disposal bound is: Dec. –327,68~327,67, Hex.

0000~FFFF.

The related

description

The denote way of 32 bits instruction

If an instruction can not only be 16 bits but also be 32 bits, then the denote method for

32 bits instruction is to add a “D” before 16 bits instruction.

E.g:ADD D0 D2 D4 denotes two 16 bits data adds;

Single word object instruction D(NUM)

Double word(32 bit)engrosses two data register, it’s composed by two consecutive data

registers, the first one is assigned by double word object instruction. The dispose

bound is: Dec. -214,748,364,8~214,748,364,7, Hex. 00000000~FFFFFFFF.

Double word object instruction D(NUM) D(NUM+1)

Page 44: CLP GPM-18 - metaltex.com.br · Você pode programar o CLP GPM tanto em linguagem Ladder como em logica Boleana (lista de instruções). Funções básicas O CLP

Manual Programação CLP – GPM

8

Instructions list of 16 bits and correspond 32 bits::::

16 bits 32 bits

WTD -

FLT DFLT

INT DINT

BIN DBIN

BCD DBCD

ASC -

HEX -

DECO -

ENCO -

Data convert

ENCOL -

- ECMP

- EZCP

- EADD

- ESUB

- EMUL

- EDIV

- ESQR

- SIN

- COS

Float

operation

TAN

TCMP -

TZCP -

TADD -

TSUB -

TRD -

Clock

operation

TWR -

16 bits 32 bits

CJ -

CALL -

SRET -

STL -

STLE

SET

ST

FOR -

NEXT -

Program

Flow

FEND -

MOV DMOV

BMOV

FMOV -

FWRT DFWRT

ZRST -

SWAP -

Data Move

XCH DXCH

ADD DADD

SUB DSUB

MUL DMUL

DIV DDIV

INC DINC

DEC DDEC

MEAN DMEAN

WAND DWAND

WOR DWOR

WXOR DWXOR

CML DCML

Data

operation

NEG DNEG

SHL DSHL

SHR DSHR

LSL DLSL

LSR DLSR

ROL DROL

ROR DROR

SFTL DSFTL

SFTR DSFTR

WSFL DWSFL

Data Shift

WSFR DWSFR

Page 45: CLP GPM-18 - metaltex.com.br · Você pode programar o CLP GPM tanto em linguagem Ladder como em logica Boleana (lista de instruções). Funções básicas O CLP

Manual Programação CLP – GPM

9

5-3....Program Flow Instructions

Mnemonic Instruction’s name

CJ Condition Jump

CALL Call subroutine

SRET Subroutine return

STL Flow start

STLE Flow end

SET Open the assigned flow, close the current flow (flow jump)

ST Open the assigned flow, not close the current flow (Open the

new flow)

FOR Start of a FOR-NEXT loop

NEXT End of a FOR-NEXT loop

FEND First End

Page 46: CLP GPM-18 - metaltex.com.br · Você pode programar o CLP GPM tanto em linguagem Ladder como em logica Boleana (lista de instruções). Funções básicas O CLP

Manual Programação CLP – GPM

10

As the instructions of executing list, with CJ instructions, the operate cycle and

dual coil can be greatly shorten.

In the following chart, if X000“ON”,then jump from step 1 to the end step of flag

P6. When X000“OFF”, do not execute jump instructions.

CJ

Y0

X0

X1

X3

X4

X0

RST

T246 K1000

MOV

CJ

X2

X5

X6

P6

T246

K3 D0

P7

T246RST

Y0

P6

P7

See the upward graph, Y000 turns to be dual coil and output. But

when X000=OFF, X001 activates. When X000=ON, X005 activates.

CJ can not jump from one STL to another STL.

If program timer T0~T640 and high speed counter C600~C640 jump

after driving, go on working, output point also activate.

Condition Jump [CJ]

16 bits instruction:CJ 32 bits instruction:-

Pointer: P

Soft Unit’s Bound: P0~P9999

Su

itab

le Dev

ice

Function

and Action

Page 47: CLP GPM-18 - metaltex.com.br · Você pode programar o CLP GPM tanto em linguagem Ladder como em logica Boleana (lista de instruções). Funções básicas O CLP

Manual Programação CLP – GPM

11

CALLX0

FEND

SRET

END

P10

P10

Call subroutine [CALL] and Subroutine return [SRET]

16 bits instruction:CALL、SRET 32 bits instruction:-

Pointer: P

Soft Unit’s Bound: P0~P9999

Su

itab

le Dev

ice

Function

If X000“ON”, carry on Jump instruction and jump to step of

flag P10. Here, after executing the subroutine, return to the

original step via executing SRET instruction. After the

following FEND instruction, program with the flag.

In the subroutine, 9 levels Call instruction is allowed, so to the

all, 10 levels nesting is available.

Main

pro

gram

S

ub

rou

tine

Page 48: CLP GPM-18 - metaltex.com.br · Você pode programar o CLP GPM tanto em linguagem Ladder como em logica Boleana (lista de instruções). Funções básicas O CLP

Manual Programação CLP – GPM

12

SET S0

STL S0

SET S1

ST S2

STL S1

STLE

STLE

STL S2

STLE

STL and STLE should be used in pairs. STL means start of a flow, STLE means end of a

flow.

After executing of SET Sxxx instruction, the flow assigned by these instructions is ON.

After executing RST Sxxx instruction, the assigned flow is OFF.

In flow S0, SET S1 close the current flow S0, open flow S1.

In flow S0, ST S2 open the flow S2, but don’t close flow S0.

When flow turns from ON to be OFF, OFF or reset OUT、PLS、PLF、not accumulate timer

etc. which belongs to the flow.

ST instruction is usually used when a program needs to run more flows at the same time.

Flow [SET]、、、、[ST] 、、、、[STL]、、、、 [STLE]

16 bits instruction:SET、ST、STL、STLE 32 bits instruction:-

Pointer: S

Soft Unit’s Bound: S0~S

Su

itab

le Dev

ice

Function

Page 49: CLP GPM-18 - metaltex.com.br · Você pode programar o CLP GPM tanto em linguagem Ladder como em logica Boleana (lista de instruções). Funções básicas O CLP

Manual Programação CLP – GPM

13

First execute the instructions between FOR~NEXT instructions for several times

(the loop time is assigned by the source data), then execute the steps after NEXT.

FOR K6

INC D0

NEXT

FOR K7

INC D1

NEXT

NEXT

FOR K5M0

M3

M1

[A]

[B]

[C]

FOR、NEXT instructions must be programmed as a pair. Nesting is allowed, and the

nesting level is 8.

Between FOR/NEXT, LDP、LDF instructions are effective for one time. Every time when

M0 turns from OFF to ON, and M1 turns from OFF to ON, [A] loop is executed 6 times.

Every time if M0 turns from OFF to ON and M3 is ON, [B] loop is executed 5×7=35

times.

If there are many loop times, the scan cycle will be prolonged. Monitor timer error may

occur, please note this.

If NEXT is before FOR, or no NEXT, or NEXT is behind FENG,END, or FOR and

[FOR] AND [NEXT]

16 bits instruction:FOR、NEXT 32 bits instruction:-

Su

itab

le Dev

ice

Word

Device

Bit

Device X Y M S T C Dn.m

D FDDMDX DY DS TD CDK/H

D· D·

Function

Page 50: CLP GPM-18 - metaltex.com.br · Você pode programar o CLP GPM tanto em linguagem Ladder como em logica Boleana (lista de instruções). Funções básicas O CLP

Manual Programação CLP – GPM

14

An FEND instruction indicates the first end of a main program and the start of the

program area to be used for subroutines. Under normal operating circumstances the

FEND instruction performs a similar action to the END instruction, i.e. output

processing, input processing and watchdog timer refresh are all carried out on

execution.

If program the tag of CALL instruction behind FEND instruction, there must be SRET

instruction. If the interrupt pointer program behind FEND instruction, there must be SRET

instruction.

After executing CALL instruction and before executing SRET instruction, if execute FEND

instruction; or execute FEND instruction after executing FOR instruction and before

executing NEXT, then an error will occur.

In the condition of using many FEND instruction, please compile routine or subroutine

between the last FEND instruction and END instruction.

[FEND] AND [END]

16 bits instruction:FEND、END 32 bits instruction:-

None

Su

itab

le Dev

ice

Function

Page 51: CLP GPM-18 - metaltex.com.br · Você pode programar o CLP GPM tanto em linguagem Ladder como em logica Boleana (lista de instruções). Funções básicas O CLP

Manual Programação CLP – GPM

15

5-4....Contactor’s Compare Instructions

Mnemonic Function

LD= Initial comparison contact. Active when the comparison (S1)=(S2) is true.

LD> Initial comparison contact. Active when the comparison (S1)> (S2) is true

LD< Initial comparison contact. Active when the comparison (S1)< (S2) is true

LD<> Initial comparison contact. Active when the comparison (S1)≠(S2) is true

LD<= Initial comparison contact. Active when the comparison (S1)≤(S2) is true

LD>= Initial comparison contact. Active when the comparison (S1)≥(S2) is true

AND= Serial comparison contact. Active when the comparison (S1)=(S2)is true.

AND> Serial comparison contact. Active when the comparison (S1)> (S2) is true.

AND< Serial comparison contact. Active when the comparison (S1)< (S2) is true.

AND<> Serial comparison contact. Active when the comparison (S1)≠(S2) is true.

AND<= Serial comparison contact. Active when the comparison (S1)≤(S2) is true.

AND>= Serial comparison contact. Active when the comparison (S1)≥(S2) is true.

OR= Parallel comparison contact. Active when the comparison (S1)=(S2) is true.

OR> Parallel comparison contact. Active when the comparison (S1)> (S2) is true.

OR< Parallel comparison contact. Active when the comparison (S1)< (S2) is true.

OR<> Parallel comparison contact. Active when the comparison (S1)≠(S2) is true.

OR<= Parallel comparison contact. Active when the comparison (S1)≤(S2) is true.

OR>= Parallel comparison contact. Active when the comparison (S1)≥(S2) is true.

Mnemonic & Function

Page 52: CLP GPM-18 - metaltex.com.br · Você pode programar o CLP GPM tanto em linguagem Ladder como em logica Boleana (lista de instruções). Funções básicas O CLP

Manual Programação CLP – GPM

16

The value of S1 and S2 are tested according to the comparison of the instruction. If the comparison is

true then the LD contact is active. If the comparison is false then the LD contact is not active.

16 bits 32bits Active condition Inactive condition

LD= DLD= (S1)=(S2) (S1)≠(S2)

LD> DLD> (S1)>(S2) (S1)≤(S2)

LD< DLD< (S1)<(S2) (S1)≥(S2)

LD<> DLD<> (S1)≠(S2) (S1)=(S2)

LD<= DLD<= (S1)≤(S2) (S1)>(S2)

LD>= DLD>= (S1)≥(S2) (S1)<(S2)

LD> D200 K-30 SET Y1

DLD> K68899 C300 M50

X0

M4

S1· S2·

LD= K100 C0 Y0X0

Instruction & Function

Program

Initial Comparison LD

16 bits instruction:Refer Below 32 bits instruction:Refer Below

S

Word

Device

Bit

Device X Y M S T C Dn.m

D FDDMDX DY DS

S1· S2·

TD CDK/H

Page 53: CLP GPM-18 - metaltex.com.br · Você pode programar o CLP GPM tanto em linguagem Ladder como em logica Boleana (lista de instruções). Funções básicas O CLP

Manual Programação CLP – GPM

17

The value of S1 and S2 are tested according to the comparison of the instruction. If the comparison is

true then the LD contact is active. If the comparison is false then the LD contact is not active.

16 bits 32

bi

ts

Active

condit

ion

Inactive

conditi

on

AND= DAND= (S1)=(S2) (S1)≠(S2)

AND> DAND> (S1)>(S2) (S1)≤(S2)

AND< DAND< (S1)<(S2) (S1)≥(S2)

AND<> DAND<> (S1)≠(S2) (S1)=(S2)

AND<= DAND<= (S1)≤(S2) (S1)>(S2)

AND>= DAND>= (S1)≥(S2) (S1)<(S2)

When the source data’s highest bit (16 bits:b15,32 bits:b31) is 1,use the data as a negative.

The comparison of 32 bits counter (C300~) must use 32 bits instruction.

If assigned as 16 bits instruction, it will lead the program error or

operation error.

Note Items

Instruction & Function

Serial Refer Below AND

16 bits instruction:Refer Below 32 bits instruction:Refer Below

S

Word

Device

Bit

Device X Y M S T C Dn.m

D FDDMDX DY DS

S1· S2·

TD CDK/H

Page 54: CLP GPM-18 - metaltex.com.br · Você pode programar o CLP GPM tanto em linguagem Ladder como em logica Boleana (lista de instruções). Funções básicas O CLP

Manual Programação CLP – GPM

18

AND= K100 C0 Y0

AND> D0K-30 SET Y1

DAND> K68899 D10 M50

X1

M4

X0

X2

S1· S2·

Program

When the source data’s highest bit (16 bits:b15,32 bits:b31) is 1,use the data as a negative.

The comparison of 32 bits counter (C300~) must use 32 bits instruction.

If assigned as 16 bits instruction, it will lead the program error or

operation error.

Note Items

Page 55: CLP GPM-18 - metaltex.com.br · Você pode programar o CLP GPM tanto em linguagem Ladder como em logica Boleana (lista de instruções). Funções básicas O CLP

Manual Programação CLP – GPM

19

The value of S1 and S2 are tested according to the instruction. If the comparison is true then the AND

contact is active. If the comparison is false then the AND contact is not active.

16 bits 32 bits Active condition Inactive condition

AND= DAND= (S1)=(S2) (S1)≠(S2)

AND> DAND> (S1)>(S2) (S1)≤(S2)

AND< DAND< (S1)<(S2) (S1)≥(S2)

AND<> DAND<> (S1)≠(S2) (S1)=(S2)

AND<= DAND<= (S1)≤(S2) (S1)>(S2)

AND>= DAND>= (S1)≥(S2) (S1)<(S2)

OR= K100 C0

Y0

DOR> K68899D10

M50M4

X0

X2

S1· S2·

Instruction & Function

Program

When the source data’s highest bit (16 bits:b15,32 bits:b31) is 1,use the

data as a negative.

The comparison of 32 bits counter (C300~) must be 32 bits instruction. If

assigned as a 16 bits instruction, it will lead the program error or operation

error.

Note Items

Parallel Comparision OR

16 bits instruction:Refer Below 32 bits instruction:Refer Below

S

Word

Device

Bit

Device X Y M S T C Dn.m

D FDDMDX DY DS

S1· S2·

TD CDK/H

Page 56: CLP GPM-18 - metaltex.com.br · Você pode programar o CLP GPM tanto em linguagem Ladder como em logica Boleana (lista de instruções). Funções básicas O CLP

Manual Programação CLP – GPM

20

5-5....Data Move

Mnemonic Function

MOV Move

BMOV Block Move

FMOV Fill Move

FWRT Written of FlashROM

MSET Zone Set

ZRST Zone Reset

SWAP Float To Scientific

XCH Exchange

Page 57: CLP GPM-18 - metaltex.com.br · Você pode programar o CLP GPM tanto em linguagem Ladder como em logica Boleana (lista de instruções). Funções básicas O CLP

Manual Programação CLP – GPM

21

MOV K10 D10X0

S· D·

《Read out the current value of timer、counter》

MOV T0 D20X1

《Indirect assign the set value of timer、counter》

MOV K10 D20X2

M0T20 D20

《Move of 32 bits data》

DMOV D0 D10

DMOV C235 D20

Function & Action

Move data from one storage area to a new one.

(K10)(D10)

(T0 current value)→(D20)

(D1,D0)→(D11,D10)

Move contents from source to destination

If X000 is OFF, data will not change.

Constant K10 will automatically convert to be BIN code.

[MOV]

16 bits instruction:MOV 32 bits instruction:DMOV

Su

itab

le Dev

ice

Word

Device

Bit

Device X Y M S T C Dn.m

D FDDMDX DY DS TD CDK/H

Page 58: CLP GPM-18 - metaltex.com.br · Você pode programar o CLP GPM tanto em linguagem Ladder como em logica Boleana (lista de instruções). Funções básicas O CLP

Manual Programação CLP – GPM

22

A quantity of consecutively occurring data elements can be copied to a new destination. The

source data is identified as a device head address(S) and a quantity of consecutive data elements

(n). This is moved to the destination device (D) for the same number of elements (n). (If the

quantity of source device (n) exceeds the actual number of available source devices, then only

those devices which fall in the available range will be used. If the number of source devices

exceeds the available space at the destination location, then only the available destination devices

will be written to.)

BMOV D5 D10 K3X0

nS· D·

D5

D6

D7

D10

D11

D12

n=3

The BMOV instruction has a built in automatic feature to prevent overwriting errors from

occurring when the source (S-n) and destination (D-n) data ranges coincide. This is clearly

identified in the following diagram: (NOTE: The numbered arrows indicate the order in which the BMOV is processed).

D10

D11

D12

D9

D10

D11

D10

D11

D12

D11

D12

D13

①②③③②①

Function

[BMOV]

16 bits instruction:BMOV 32bits instruction:-

Su

itab

le Dev

ice

Word

Device

Bit

Device X Y M S T C Dn.m

nD FDDMDX DY DS TD CDK/H

Page 59: CLP GPM-18 - metaltex.com.br · Você pode programar o CLP GPM tanto em linguagem Ladder como em logica Boleana (lista de instruções). Funções básicas O CLP

Manual Programação CLP – GPM

23

FMOV K0 D0 K10X0

nS· D·

Move K0 to D0~D9. Copy a single data device to a range of destination devices.

The data stored in the source device (S) is copied to every device within the destination range,

The range is specified by a device head address (D) and a quantity of consecutive elements (n).

If the specified number of destination devices (n) exceeds the available space at the destination

location, then only the available destination devices will be written to.

Function

[FMOV][FMOV][FMOV][FMOV]

16 bits instruction:FMOV 32 bits instruction:-

Su

itab

le Dev

ice

Word

Device

Bit

Device X Y M S T C Dn.m

D FDDMDX DY DS TD CDK/Hn

Page 60: CLP GPM-18 - metaltex.com.br · Você pode programar o CLP GPM tanto em linguagem Ladder como em logica Boleana (lista de instruções). Funções básicas O CLP

Manual Programação CLP – GPM

24

K0 D0K0

n

D1K0

D2K0

D3K0

D4K0

D5K0

D6K0

D7K0

D8K0

D9K0

Page 61: CLP GPM-18 - metaltex.com.br · Você pode programar o CLP GPM tanto em linguagem Ladder como em logica Boleana (lista de instruções). Funções básicas O CLP

Manual Programação CLP – GPM

25

1、、、、Written of a word

D0FWRT FD0X0

S· D·

2、、、、Written of double word

D0DFWRT FD0X1

S· D·

3、、、、Written of multi-word

D0FWRT FD0X2

K3

S· D1· D3·

Note:1, FWRT instruction only allow to write data into FlashROM register. In this storage area,

even battery drop, data could be stored. So it could be used to store important technical

parameters.

2, Written of FWRT needs a long time, about 150ms, so, frequently operate this operation is

not recommended.

3, The written time of FlashROM is about 1,000,000 times. So, we suggest using edge

signals (LDP、LDF etc.) to trigger.

[FWRT] [FWRT] [FWRT] [FWRT]

16 bits instruction:FWRT 32 bits instruction:DFWRT

Su

itab

le Dev

ice

Word

Device

Bit

Device X Y M S T C Dn.m

D FDDMDX DY DS TD CDK/H

Function:write value in D0 into FD0

Function:write value in D0、D1 into FD0、FD1

Function:write value in D0、D2、D3 into FD0、FD1、FD2.

Function

Page 62: CLP GPM-18 - metaltex.com.br · Você pode programar o CLP GPM tanto em linguagem Ladder como em logica Boleana (lista de instruções). Funções básicas O CLP

Manual Programação CLP – GPM

26

ZRST M500 M559

D0 D100

D1· D2·

D1· D2·

X0

ZRST

MSET M10 M120

D1· D2·

X0

X1RST M0

RST T0

RST D0

X2K0FMOV D0 K100

Function & Action

Zone Set Unit M10~M120

Zone Reset Bit Unit M500~M559。

Zone Reset Word Unit D0~D100

Other Reset

Instruction

Reset M0

Reset the current value and status of T0

Reset the current value and status of C0

Write K0 into D0~D99

As soft unit’s separate reset instruction, RST instruction can be used

to bit unit Y, M, S and word unit T, C, D.

As fill move for constant K0, 0 can be written into DX, DY, DM, DS,

T, C, D.

Are specified as the same type of soft units, and <

When > , only reset the soft unit specified in

D1· D2·

D1·D1·

D2·

D2·

[MSET]

16 bits instruction:MSET 32 bits instruction:-

Word

Device

Bit

Device X Y M S T C Dn.m

D1· D2·

D FDDMDX DY DS TD CDK/H

[ZRST]

16 bits instruction:ZRST 32 bits instruction:-

Word

Device

Bit

Device X Y M S T C Dn.m

D1· D2·

D FDDMDX DY DS TD CDK/H

D1· D2·

D1·

Page 63: CLP GPM-18 - metaltex.com.br · Você pode programar o CLP GPM tanto em linguagem Ladder como em logica Boleana (lista de instruções). Funções básicas O CLP

Manual Programação CLP – GPM

27

High 8 bits Low 8 bits

D10

Function

Low 8 bits and high 8 bits change when it is 16 bits instruction.

If the instruction is a consecutive executing instruction, each operation cycle should change.

[SWAP]

16bits instruction:SWAP 32 bits instruction:-

Su

itab

le Dev

ice

Word

Device

Bit

Device X Y M S T C Dn.m

D FDDMDX DY DS TD CDK/H

Page 64: CLP GPM-18 - metaltex.com.br · Você pode programar o CLP GPM tanto em linguagem Ladder como em logica Boleana (lista de instruções). Funções básicas O CLP

Manual Programação CLP – GPM

28

《《《《16 bits instruction》》》》

XCH D10 D11X0

D1· D2·

《《《《32 bits instruction》》》》

DXCH D10 D20X0

D1· D2·

Function

[XCH]

16 bits instruction:XCH 32 bits instruction:DXCH

Su

itab

le Dev

ice

Word

Device

Bit

Device X Y M S T C Dn.m

D FDDMDX DY DS TD CDK/H

D1· D2·

The contents of the two destination devices D1 and D2 are swapped,

When drive input X0 is ON, each scan cycle should carry on data exchange,

Before(D10)=100 →After (D10)=101

32 bits instruction [DXCH] swaps value composed by D10、D11 and the value

composed by D20、D21.

Page 65: CLP GPM-18 - metaltex.com.br · Você pode programar o CLP GPM tanto em linguagem Ladder como em logica Boleana (lista de instruções). Funções básicas O CLP

Manual Programação CLP – GPM

29

5-6....Data Operation Instructions

Mnemonic Function

ADD Addition

SUB Subtraction

MUL Multiplication

DIV Division

INC Increment

DEC Decrement

MEAN Mean

WAND Logic Word And

WOR Logic Word Or

WXOR Logic Exclusive Or

CML Compliment

NEG Negation

Page 66: CLP GPM-18 - metaltex.com.br · Você pode programar o CLP GPM tanto em linguagem Ladder como em logica Boleana (lista de instruções). Funções básicas O CLP

Manual Programação CLP – GPM

30

ADD D10 D12 D14X0

S1· S2· D·

Function

The data contained within the two source devices are combined and the total is stored in the

specified destination device. Each data’s highest bit is the sign bit, 0 stands for positive、1

stands for negative. All calculations are algebraic processed.(5+(-8)=-3)

If the result of a calculation is “0”, the “0” flag acts. If the result exceeds 323,767(16 bits

limit)or 2,147,483,647(32 bits limit), the carry flag acts.(refer to the next page). If the

result exceeds –323,768(16 bits limit)or –2,147,483,648(32 bits limit), the borrow flag

acts(Refer to the next page)

When carry on 32 bits operation, word device’s low 16 bits are assigned, the device

following closely the preceding device’s ID will be the high bits. To avoid ID repetition, we

recommend you assign device’s ID to be even ID.

The same device may be used as a source and a destination. If this is the case then the

result changes after every scan cycle. Please note this point.

(D10)+(D12)→(D14)

Addition Operation [ADD]

16 bits instruction:ADD 32 bits instruction:DADD

Zero M8020

Borrow M8021

Flag

Carry M8022

Su

itab

le Dev

ice

Word

Device

Bit

Device X Y M S T C Dn.m

D FDDMDX DY DS TD CDK/H

S1· S2·

Page 67: CLP GPM-18 - metaltex.com.br · Você pode programar o CLP GPM tanto em linguagem Ladder como em logica Boleana (lista de instruções). Funções básicas O CLP

Manual Programação CLP – GPM

31

SUB D10 D12 D14X0

S1· S2· D·

The relationship of the flag’s action and vale’s positive/negative is shown below:

Function (D10)—(D12)→(D14)

appoint the soft unit’s content, subtract the soft unit’s content appointed by in the

format of algebra. The result will be stored in the soft unit appointed by . (5-(-8)=13)

The action of each flag, the appointment method of 32 bits operation’s soft units are both

the same with the preceding ADD instruction.

The importance is: in the preceding program, if X0 is ON, SUB operation will be

executed every scan cycle

S1· S2·

[SUB]

16 bits instruction:SUB 32 bits instruction:DSUB

Zero M8020

Borrow M8021 F

lag

Carry M8022

Su

itab

le Dev

ice

Word

Device

Bit

Device X Y M S T C Dn.m

D FDDMDX DY DS TD CDK/H

S1· S2·

Page 68: CLP GPM-18 - metaltex.com.br · Você pode programar o CLP GPM tanto em linguagem Ladder como em logica Boleana (lista de instruções). Funções básicas O CLP

Manual Programação CLP – GPM

32

《《《《16 bits operation》》》》

MUL D0 D2 D4X0

S1· S2· D·

《《《《32 bits operation》》》》

X1DMUL D0 D2 D4

S1· S2· D·

\

Function & action

BIN BIN BIN

(D0) × (D2) → (D5, D4)

BIN BIN BIN (D1,D0) × (D3,D2) → (D7,D6,D5,D4)

The contents of the two source devices are multiplied together and the result is stored at

the destination device in the format of 32 bits. As in the upward chart: when (D0)=8、(D2)=9, (D5, D4) =72.

The result’s highest bit is the symbol bit: positive (0)、negative (1).

In 32 bits operation, when use bit device as the destination address, only low 32 bits

result can be obtained. The high 32 bits result can not be obtained, so please operate

again after transfer one time to the word device

Even use word device, 64 bits results can’t be monitored at once.

In this situation, float point data operation is recommended.

[MUL]

16 bits instruction:MUL 32 bits instruction:DMUL

Zero M8020

Borrow M8021

Flag

Carry M8022

S

Word

Device

Bit

Device X Y M S T C Dn.m

D FDDMDX DY DS TD CDK/H

S1· S2·

Page 69: CLP GPM-18 - metaltex.com.br · Você pode programar o CLP GPM tanto em linguagem Ladder como em logica Boleana (lista de instruções). Funções básicas O CLP

Manual Programação CLP – GPM

33

《《《《16 bits operation》》》》

DIV D0 D2 D4X0

S1· S2· D·

《《《《32 bits operation》》》》

DDIV D0 D2 D4X1

S1· S2· D·

DDIV D0 D2 D4X1

S1· S2· D·

Function & Action

Dividend Divisor Result Remainder

BIN BIN BIN BIN

(D0) ÷ (D2) → D4) (D5)

Dividend Divisor Result Remainder

BIN BIN BIN BIN

(D1,D0) ÷ (D3,D2) (D5,D4) (D7,D6)

appoints the device’s content be the dividend, appoints the device’s content be the

divisor, appoints the device and the next one to store the result and the remainder.

In the above example, if input X0 is ON, devision operation is executed every scan cycle.

S1· S2·

The dividend is composed by the device appointed by and the next one. The divisor

is composed by the device appointed by and the next one. The result and the

remainder are stored in the four sequential devices, the first one is appointed by

If the value of the divisor is 0, then an operation error is executed and the operation of

the DIV instruction is cancelled.

The highest bit of the result and remainder is the symbol bit (positive:0, negative: 1).

When any of the dividend or the divisor is negative, then the result will be negative.

When the dividend is negative, then the remainder will be negative.

S1·

S2·

[DIV]

16 bits instruction:DIV 32 bits instruction:DDIV

Zero M8020

Borrow M8021

Flag

Carry M8022

S

Word

Device

Bit

Device X Y M S T C Dn.m

D FDDMDX DY DS TD CDK/H

S1· S2·

Page 70: CLP GPM-18 - metaltex.com.br · Você pode programar o CLP GPM tanto em linguagem Ladder como em logica Boleana (lista de instruções). Funções básicas O CLP

Manual Programação CLP – GPM

34

INC D0X0

DEC D0X1

Function & Action

(D0)+1→(D0)

(D0)-1→(D0)

On every execution of the instruction the device specified as the destination has its

current value incremented (increased) by a value of 1.

In 16 bits operation, when +32,767 is reached, the next increment will write -32,767 to the

destination device. In this case, there’s no additional flag to identify this change in the

counted value.

On every execution of the instruction the device specified as the destination has its

current value decremented (decreased) by a value of 1.

When -32,768 or -2,147,483,648 is reached, the next decrement will write +32,767

or +2,147,483,647 to the destination device.

1、、、、Increment [INC]

2、、、、Decrement [DEC]

[INC] & [DEC]

16 bits instruction:INC、DEC 32 bits instruction:DINC、DDEC

Zero M8020

Borrow M8021

Flag

Carry M8022

S

Word

Device

Bit

Device X Y M S T C Dn.m

D FDDMDX DY DS TD CDK/H

Page 71: CLP GPM-18 - metaltex.com.br · Você pode programar o CLP GPM tanto em linguagem Ladder como em logica Boleana (lista de instruções). Funções básicas O CLP

Manual Programação CLP – GPM

35

MEAN D0 D10 K3

S· D·

X0n

(D0) + +

3(D10)

(D1) (D2)

Function & Action

The value of all the devices within the source range is summed and then divided by the

number of devices summed, i.e. n.. This generates an integer mean value which is stored

in the destination device (D) The remainder of the calculated mean is ignored.

If the value of n is specified outside the stated range (1 to 64) an error is generated.

[MEAN]

16 bits instruction:MEAN 32 bits instruction:-

Zero M8020

Borrow M8021

Flag

Carry M8022

S

Word

Device

Bit

Device X Y M S T C Dn.m

nD FDDMDX DY DS TD CDK/H

Page 72: CLP GPM-18 - metaltex.com.br · Você pode programar o CLP GPM tanto em linguagem Ladder como em logica Boleana (lista de instruções). Funções básicas O CLP

Manual Programação CLP – GPM

36

Execute logic AND operation with each bit

WAND D10 D12 D14

X0S1· S2·

Execute logic OR operation with each bit

WOR D10 D12 D14

X0S1· S2·

Execute logic Exclusive OR operation with each bit.

WXOR D10 D12 D14

X0S1· S2·

If use this instruction along with CML instruction, XOR NOT operation could also

be executed.

WXOR D10 D12 D14

X0S1· S2·

CML D14 D14

Function & Action

0&0=0 0&1=0

1&0=0 1&1=1

0 or 0=0 0 or 1=1

1 or 0=1 1 or 1=1

0 xor 0=0 0 xor 1=1

1 xor 0=1 1 xor 1=0

[WAND]、、、、 [WOR] & [WXOR]

16 bits instruction:WAND、WOR 32 bits instruction:DWAND、DWOR

Zero M8020

Borrow M8021

Flag

Carry M8022

S

Word

Device

Bit

Device X Y M S T C Dn.m

D FDDMDX DY DS TD CDK/H

S1· S2·

Page 73: CLP GPM-18 - metaltex.com.br · Você pode programar o CLP GPM tanto em linguagem Ladder como em logica Boleana (lista de instruções). Funções básicas O CLP

Manual Programação CLP – GPM

37

CML D0 DY0

S· D·

X0

A copy of each data bit within the source device is inverted and then moved to the designated

destination.

《Reading of inverted input》

M0

M1

M2

M3

M17

CML DX0 DM0M8000

X0

X1

X2

X3

X17

Function & Action

The sequential control instruction in

the left could be denoted by the

following CML instruction.

Each data bit in the source device is inverted (0->1, 1->0) and sent to the destination

device. If use constant K in the source device, it can be auto convert to be binary.

It’s available when you want to inverted output the PLC’s output

[CML]

16 bits instruction:CML 32 bits instruction:DCML

S

Word

Device

Bit

Device X Y M S T C Dn.m

D FDDMDX DY DS TD CDK/H

Page 74: CLP GPM-18 - metaltex.com.br · Você pode programar o CLP GPM tanto em linguagem Ladder como em logica Boleana (lista de instruções). Funções básicas O CLP

Manual Programação CLP – GPM

38

NEG D10 (D10) +1 (D10)X0

Function & Action

The bit format of the selected device is inverted, I.e. any occurrence of a “1’

becomes a “0” and any occurrence of “0” becomes “1”, when this is complete, a

further binary 1 is added to the bit format. The result is the total logic sigh change of

the selected devices contents.

When using continually executing instructions, then this instruction will be executed

in every scan cycle.

[NEG]

16 bits instruction:NEG 32 bits instruction:DNEG

S

Word

Device

Bit

Device X Y M S T C Dn.m

D FDDMDX DY DS TD CDK/H

Page 75: CLP GPM-18 - metaltex.com.br · Você pode programar o CLP GPM tanto em linguagem Ladder como em logica Boleana (lista de instruções). Funções básicas O CLP

Manual Programação CLP – GPM

39

Page 76: CLP GPM-18 - metaltex.com.br · Você pode programar o CLP GPM tanto em linguagem Ladder como em logica Boleana (lista de instruções). Funções básicas O CLP

Manual Programação CLP – GPM

40

5-7....Shift Instructions

Mnemonic Function

SHL Arithmetic shift left

SHR Arithmetic shift right

LSL Logic shift left

LSR Logic shift right

ROL Rotation left

ROR Rotation right

SFTL Bit shift left

SFTR Bit shift right

WSFL Word shift left

WSFR Word shift right

Page 77: CLP GPM-18 - metaltex.com.br · Você pode programar o CLP GPM tanto em linguagem Ladder como em logica Boleana (lista de instruções). Funções básicas O CLP

Manual Programação CLP – GPM

41

《《《《Arithmetic shift left》》》》

《《《《Arithmetic shift right》》》》

Function &

Action

After once execution, the

high bit is same with the bit

before shifting, the final bit

is stored in carry flag.

After once execution, the

low bit is filled in 0, the

final bit is stored in carry

flag.

[SHL] & [SHR]

16 bits instruction:SHL、SHR 32 bits instruction:DSHL、DSHR

Note:

In the left example, when X1 is ON, left/right shift is executed at every scan cycle.

S

Word

Device

Bit

Device X Y M S T C Dn.m

D FDDMDX DY DS TD CDK/H

D·n

Page 78: CLP GPM-18 - metaltex.com.br · Você pode programar o CLP GPM tanto em linguagem Ladder como em logica Boleana (lista de instruções). Funções básicas O CLP

Manual Programação CLP – GPM

42

《《《《Logic shift left》》》》

《《《《Logic shift right》》》》

Function & Action

After once execution, the

low bit is filled in 0, the

final bit is stored in carry

flag.

After once execution, the

high bit is same with the bit

before shifting, the final bit

is stored in carry flag.

NOTE:

In every scan cycle, loop shift left/right action will be executed

[LSL] & LSR]

16 bits instruction: 32 bits instruction:DLSL、DLSR

S

Word

Device

Bit

Device X Y M S T C Dn.m

D FDDMDX DY DS TD CDK/H

D·n

Page 79: CLP GPM-18 - metaltex.com.br · Você pode programar o CLP GPM tanto em linguagem Ladder como em logica Boleana (lista de instruções). Funções básicas O CLP

Manual Programação CLP – GPM

43

The bit format of the destination device is rotated n bit places to the left on every operation of the

instruction 《《《《Rotation shift left》》》》

《《《《Rotation shift right》》》》

Function & Action

Every time when X000 turns from OFF

to ON, executes n bits left rotation.

Every time when X000 turns from

OFF to ON, executes n bits right

rotation.

[ROL] & [ROR]

16 bits instruction:ROL、ROR 32 bits instruction:DROL、DROR

S

Word

Device

Bit

Device X Y M S T C Dn.m

D FDDMDX DY DS TD CDK/H

D·n

Page 80: CLP GPM-18 - metaltex.com.br · Você pode programar o CLP GPM tanto em linguagem Ladder como em logica Boleana (lista de instruções). Funções básicas O CLP

Manual Programação CLP – GPM

44

《《《《Bit shift left》》》》

《《《《Bit shift right》》》》

Function & Action

① M15~M12→Overflow ② M11~M 8→M15~M 12 ③ M 7~M 4→M11~M8

① M 3~M 0→Overflow ② M 7~M 4→M3~M0 ③ M11~M 8→M7~M4

In every scan cycle, loop shift left/right action will be executed

[SFTL] & [SFTR]

16 bits instruction:SFTL、SFTR 32 bits instruction:DSFTL、DSFTR

S

Word

Device

Bit

Device

The instruction copies n2 source devices to a bit stack of length n1. For every new addition of n2

bits, the existing data within the bit stack is shifted n2 bits to the left/right. Any bit data moving to

the position exceeding the n1 limit is diverted to an overflow area. The bit shifting operation will

occur every time the instruction is processed unless it is modified with either the pulse suffix or a

controlled interlock.

D FDDMDX DY DS TD CDK/H

n1n2

X Y M S T C Dn.m

Page 81: CLP GPM-18 - metaltex.com.br · Você pode programar o CLP GPM tanto em linguagem Ladder como em logica Boleana (lista de instruções). Funções básicas O CLP

Manual Programação CLP – GPM

45

n2 字左移

n2 字右移

《《《《Word shift left》》》》

《《《《Word shift right》》》》

Function & Action

The instruction copies n2 source devices to a word stack of length n1. For each addition

of n2 words, the existing data within the word stack is shifted n2 words to the left/right.

Any word data moving to a position exceeding the n1 limit is diverted to an overflow

area. The word shifting operation will occur every time the instruction is processed unless

it is modified with either the pulse suffix or a controller interlock.

① D13~D10→overflow ② D17~D14→D13~D10 ③ D21~D18→D17~D14

In every scan cycle, loop shift left/right action will be executed

[WSFL] & [WSFR]

16 bits instruction:WSFL、WSFR 32 bits instruction:DWSFL、DWSFR

① D25~D22→overflow ② D21~D18→D25~D22 ③ D17~D14→D21~D18

S

Word

Device

Bit

Device X Y M S T C Dn.m

D FDDMDX DY DS TD CDK/H

n1n2

Page 82: CLP GPM-18 - metaltex.com.br · Você pode programar o CLP GPM tanto em linguagem Ladder como em logica Boleana (lista de instruções). Funções básicas O CLP

Manual Programação CLP – GPM

46

5-8....Data Convert

Mnemonic Function

WTD Single word integer converts to double word integer

FLT 32 bits integer converts to float point

FLTD 64 bits integer converts to float point

INT Float point converts to integer

BIN BCD convert to binary

BCD Binary converts to BCD

ASC Hex. converts to ASCII

HEX ASCII converts to Hex.

DECO Coding

ENCO High bit coding

ENCOL Low bit coding

Page 83: CLP GPM-18 - metaltex.com.br · Você pode programar o CLP GPM tanto em linguagem Ladder como em logica Boleana (lista de instruções). Funções básicas O CLP

Manual Programação CLP – GPM

47

WTD D0 D10X0

S· D·

High bits Low bits

D11 D10

0 or 1 D0

Function & Action (D0) → (D11,D10)

When single word D0 is positive integer, after executing this instruction, the high

bit of double word D10 is 0.

When single word D0 is negative integer, after executing this instruction, the

high bit of double word D10 is 1.

[WTD]

16 bits instruction:WTD 32 bits instruction:-

S

Word

Device

Bit

Device X Y M S T C Dn.m

D FDDMDX DY DS TD CDK/H

Page 84: CLP GPM-18 - metaltex.com.br · Você pode programar o CLP GPM tanto em linguagem Ladder como em logica Boleana (lista de instruções). Funções básicas O CLP

Manual Programação CLP – GPM

48

《《《《16 Bits》》》》

《《《《32 Bits》》》》

DFLT D10 D12

S· D·

X0

《《《《64 Bits》》》》

FLTD D10 D14

S· D·

X0

Function & Action

(D11,D10)→ (D13,D12)

(D10) → (D13,D12)

Convert BIN integer to binary float point. As the constant K、H will auto convert by the

float operation instruction, so this FLT instruction can’t be used.

The instruction is contrary to INT instruction.

(D13,D12,D11,D10)→ (D17,D16,D15,D14)

FLT D10 D12

S· D·

X0

[FLT] & [FLTD]

16 bits instruction:FLT 32 bits instruction:DFLT

S

Word

Device

Bit

Device X Y M S T C Dn.m

D FDDMDX DY DS TD CDK/H

S· S·

Page 85: CLP GPM-18 - metaltex.com.br · Você pode programar o CLP GPM tanto em linguagem Ladder como em logica Boleana (lista de instruções). Funções básicas O CLP

Manual Programação CLP – GPM

49

《《《《16 Bits》》》》

INT D10 D20

S· D·

X0

《《《《32 Bits》》》》

DINT D10 D20

S· D·

X0

Function & Action

(D11,D10) → (D20)

Binary Floating BIN integer

(D11,D10) → (D20,D21)

Binary Floating BIN integer

Give up the data after the decimal dot

The binary source number is converted into an BIN integer and stored at the

destination device. Abandon the value behind the decimal point.

This instruction is contrary to FLT instruction.

When the result is 0, the flag bit is ON。

When converting, less than 1 and abandon it, zero flag is ON.

16 bits operation:-32,768~32,767

32 bits operation:-2,147,483,648~2,147,483,647

[INT]

16 bits instruction:- 32 bits instruction:INT

S

Word

Device

Bit

Device X Y M S T C Dn.m

D FDDMDX DY DS TD CDK/H

Page 86: CLP GPM-18 - metaltex.com.br · Você pode programar o CLP GPM tanto em linguagem Ladder como em logica Boleana (lista de instruções). Funções básicas O CLP

Manual Programação CLP – GPM

50

BIN D10 D0

S· D·

X0

Function & Action

Convert and move instruction of Source (BCD) → destination (BIN)

When source data is not BCD code, M8067(Operation error), M8068

(Operation error lock) will not work.

As constant K automatically converts to binary, so it’s not suitable for this

instruction.

[BIN]

16 bits instruction:BIN 32 bits instruction:-

S

Word

Device

Bit

Device X Y M S T C Dn.m

D FDDMDX DY DS TD CDK/H

Page 87: CLP GPM-18 - metaltex.com.br · Você pode programar o CLP GPM tanto em linguagem Ladder como em logica Boleana (lista de instruções). Funções básicas O CLP

Manual Programação CLP – GPM

51

BCD D10 D0

S· D·

X0

Function & Action

Convert and move instruction of source (BIN)→destination (BCD).

This instruction can be used to output data directly to a seven-segment display.

[BCD]

16 bits instruction:BCD 32 bits instruction:-

S

Word

Device

Bit

Device X Y M S T C Dn.m

D FDDMDX DY DS TD CDK/H

Page 88: CLP GPM-18 - metaltex.com.br · Você pode programar o CLP GPM tanto em linguagem Ladder como em logica Boleana (lista de instruções). Funções básicas O CLP

Manual Programação CLP – GPM

52

《《《《16 bits convert mode》》》》

ASCI D100 D200 K4

S· D· nX0

Convert each bit of source’s (S) Hex. format data to be ASCII code, move separately to the high 8

bits and low 8 bits of destination (D). The convert alphanumeric number is assigned with n.

(D) is low 8 bits, high 8 bits, store ASCII data.

The convert result is the

following:

n

D K1 K2 K3 K4 K5 K6 K7 K8 K9

D200 down [C] [B] [A] [0] [4] [3] [2] [1] [8]

D200 up [C] [B] [A] [0] [4] [3] [2] [1]

D201 down [C] [B] [A] [0] [4] [3] [2]

D201 up [C] [B] [A] [0] [4] [3]

D202 down [C] [B] [A] [0] [4]

D202 up [C] [B] [A] [0]

D203 down [C] [B] [A]

D203 up [C] [B]

D204 down

[C]

Function & Action

Assign start device:

(D100)=0ABCH

(D101)=1234H

[0]=30H [1]=31H [5]=35H

[A]=41H [2]=32H [6]=36H

[B]=42H [3]=33H [7]=37H

[C]=43H [4]=34H [8]=38H

[ASCI]

16 bits instruction:ASCI 32 bits instruction:-

S

Word

Device

Bit

Device X Y M S T C Dn.m

D FDDMDX DY DS TD CDK/H

Page 89: CLP GPM-18 - metaltex.com.br · Você pode programar o CLP GPM tanto em linguagem Ladder como em logica Boleana (lista de instruções). Funções básicas O CLP

Manual Programação CLP – GPM

53

《《《《16 bits switch mode》》》》

HEX D200 D100 K4

S· D· nX0

The convert of the upward program is the following:

n=k4

Function & Action

(S·)

ASCII

Code

HEX

Convert

D200 down 30H 0

D200 up 41H A

D201 down 42H B

D201 up 43H C

D202 down 31H 1

D202 up 32H 2

D203 down 33H 3

D203 up 34H 4

D204 down 35H 5

(D·) D102 D101 D100

1 ···0H

2 ··0AH

3 ·0ABH

4

Not change to be 0

0ABCH

5 ···0H ABC1H

6 ··0AH BC12H

7 ·0ABH C123H

8

0ABCH 1234H

9 ···0H ABC1H 2345H

Convert the high and low 8 bits in source to HEX data. Move 4 bits every time to

destination. The convert alphanumeric number is assigned by n.

[HEX]

16 bits instruction:HEX 32 bits instruction:-

S

Word

Device

Bit

Device X Y M S T C Dn.m

D FDDMDX DY DS TD CDK/H

Page 90: CLP GPM-18 - metaltex.com.br · Você pode programar o CLP GPM tanto em linguagem Ladder como em logica Boleana (lista de instruções). Funções básicas O CLP

Manual Programação CLP – GPM

54

0 1 0 0 0 0 0 1 0 0 1 1 0 0 0 0D200

41H→ [A] 30H→ [0]

0 1 0 0 0 0 1 1 0 1 0 1 0 0 1 0D201

43H→ [C] 42H→ [B]

0 0 0 0 1 0 1 0 1 0 1 1 1 1 0 0D202

0 A B C

Page 91: CLP GPM-18 - metaltex.com.br · Você pode programar o CLP GPM tanto em linguagem Ladder como em logica Boleana (lista de instruções). Funções básicas O CLP

Manual Programação CLP – GPM

55

① ②

《 When is software unit》 n≤16

DX0DECO M10 K3X10

nS· D·

0 1 1

0 0 0 1 0 0 0

X002 X001 X000

M17 M16 M15 M14 M13 M12 M11 M10

7 6 5 4 2 1 0

4

0

《 When is word device》 n≤4

D0DECO D1 K3X0

nS· D·

Function & Action

The source address is 1+2=3,so starts from M10, the number 3 bit (M13) is 1. If the source

are all 0, M10 is 1

When n=0, no operation, beyond n=0~16, don’t execute the instruction.

When n=16, if coding command “D” is soft unit, it’s point is 2^8=256。

Source ID’s low n bits(n≤4) are encoded to the destination ID. When n≤3, destination’s

high bits all converts to be 0.

When n=0, no disposal, beyond n=0~4, don’t execute the instruction.

[DECO]

16 bits instruction:DECO 32 bits instruction:-

S

Word

Device

Bit

Device

X Y M S T C Dn.m

S·n

D FDDMDX DY DS TD CDK/H

Page 92: CLP GPM-18 - metaltex.com.br · Você pode programar o CLP GPM tanto em linguagem Ladder como em logica Boleana (lista de instruções). Funções básicas O CLP

Manual Programação CLP – GPM

56

③ ① ②

① ②

All be 0

All be 0

Be ignored

《 When is bit device》 n≤16

M10ENCO D10 K3X0

nS· D·

0 0 0 1 0 1 0

M17 M16 M15 M14 M13 M12 M11 M10

7 6 5 4 2 1 0

0

0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1

D10b15

b0

4

《 When is word device》 n≤4

D0ENCO D1 K3X1

nS· D·

0 1 0 1 0 1 0 1 0 0 0 0 1 0 1 0

0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1

7 6 5 4 2 1 0

D0

D1b15

b15 b0

b0

4

Function & Action

If many bits in the source ID are 1, ignore the low bits. If source ID are all 0, don’t

execute the instructions.

When drive input is OFF, the instruction is not executed, encode output don’t change.

When n=8, if encode instruction’s “S” is bit unit, it’s point number is 2^8=256

[ENCO]

16 bits instruction:ENCO 32 bits instruction:-

S

Word

Device

Bit

Device

X Y M S T C Dn.m

D FDDMDX DY DS TD CDK/H

D·n

Page 93: CLP GPM-18 - metaltex.com.br · Você pode programar o CLP GPM tanto em linguagem Ladder como em logica Boleana (lista de instruções). Funções básicas O CLP

Manual Programação CLP – GPM

57

③ ① ②

① ②

All be 0

All be 0

Be ignored

《 If is bit device》 n≤16

M10ENCOL D10 K3X0

nS· D·

0 1 0 1 0 0 0

M17 M16 M15 M14 M13 M12 M11 M10

7 6 5 4 2 1 0

0

0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1

D10b15

b0

4

《 n≤16

D0ENCOL D1 K3X1

nS· D·

0 1 0 1 0 1 0 1 0 0 1 0 1 0 0 0

0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1

7 6 5 4 2 1 0

D0

D1b15

b15 b0

b0

4

If many bits in the source ID are 1, ignore the high bits. If source ID are all 0, don’t execute

the instructions.

When drive input is OFF, the instruction is not executed, encode output don’t change.

When n=8, if encode instruction’s “S” is bit unit, it’s point number is 2^8=256

Function & Action

[ENCOL]

16 bits instruction:ENCOL 32 bits instruction:-

S

Word

Device

Bit

Device

X Y M S T C Dn.m

D FDDMDX DY DS TD CDK/H

D·n

Page 94: CLP GPM-18 - metaltex.com.br · Você pode programar o CLP GPM tanto em linguagem Ladder como em logica Boleana (lista de instruções). Funções básicas O CLP

Manual Programação CLP – GPM

58

Page 95: CLP GPM-18 - metaltex.com.br · Você pode programar o CLP GPM tanto em linguagem Ladder como em logica Boleana (lista de instruções). Funções básicas O CLP

Manual Programação CLP – GPM

59

5-9....Floating Operation

Mnemonic Function

ECMP Float Compare

EZCP Float Zone Compare

EADD Float Add

ESUB Float Subtract

EMUL Float Multiplication

EDIV Float Division

ESQR Float Square Root

SIN Sine

COS Cosine

TAN Tangent

Page 96: CLP GPM-18 - metaltex.com.br · Você pode programar o CLP GPM tanto em linguagem Ladder como em logica Boleana (lista de instruções). Funções básicas O CLP

Manual Programação CLP – GPM

60

ECMP D10 D20 M0

M0

M1

M2

X0D·S1· S2·

ECMP K500 D100 M10X0

Function & Action (D11,D10) : (D21,D20)→M0,M1,M2

(D11, D10) > (D21<D20)

Binary Floating Binary Floating

(D11, D10) = (D21<D20)

Binary Floating Binary Floating

(D11, D10) < (D21<D20)

Binary Floating Binary Floating

The status of the destination device will be kept even if the ECMP instruction is deactivated.

The binary float data of S1 is compared to S2. The result is indicated by 3 bit devices

specified with the head address entered as D.

If a constant K or H used as source data, the value is converted to floating point before

the addition operation.

(K500) ∶ (D101,D100)→M10,M11,M12

Binary converts Binary floating

to floating

[ECMP]

16 bits instruction:- 32 bits instruction:ECMP

S

Word

Device

Bit

Device

X Y M S T C Dn.m

D FDDMDX DY DS TD CDK/H

S1· S2· S1· S2·

Page 97: CLP GPM-18 - metaltex.com.br · Você pode programar o CLP GPM tanto em linguagem Ladder como em logica Boleana (lista de instruções). Funções básicas O CLP

Manual Programação CLP – GPM

61

Compare a float range with a float value.

EZCP D10 D20 D0

M3

M4

M5

X0S1· S2·

M3

D1· D2·

The data of S1 is compared to the data of S2. The result is indicated by 3 bit devices specified

with the head address entered as D.

If a constant K or H used as source data, the value is converted to floating point before the

addition operation.

EZCP K10 K2800 D5 M0X0

Please set S1<S2, when S2>S1, see S2 as the same with S1 and compare them.

Function & Action

(D20, D21) > (D1, D0) ON

Binary Floating Binary Floating

(D21,D10) ≤ (D1,D0) ≤ (D31,D30) ON

Binary Floating Binary Floating Binary Floating

(D1, D0) > (D31, D30) ON

The status of the destination device will be kept even if the EZCP instruction is deactivated.

(K10) ∶ [D6,D5] ∶ (K2800)→M0,M1,M2

Binary converts Binary Floating Binary converts

[EZCP]

16 bits instruction:- 32 bits instruction:ECMP

S

Word

Device

Bit

Device

X Y M S T C Dn.m

D FDDMDX DY DS TD CDK/H

S1· S2· S3·

S1· S2· S3·

Page 98: CLP GPM-18 - metaltex.com.br · Você pode programar o CLP GPM tanto em linguagem Ladder como em logica Boleana (lista de instruções). Funções básicas O CLP

Manual Programação CLP – GPM

62

EAAD D10 D20 D50

S1· S2· D·

X0

EAAD D100 K1234 D110X1

Function & Action

(D11,D10) + (D21,D20) → (D51,D50)

Binary Floating Binary Floating Binary Floating

The floating point values stored in the source devices S1 and S2 are algebraically added

and the result stored in the destination device D.

If a constant K or H used as source data, the value is converted to floating point before

the addition operation.

(K1234) + ( D101,D100) → (D111,D110)

The same device may be used as a source and as the destination. If this is the case then,

on continuous operation of the EADD instruction, the result of the previous operation

will be used as a new source value and a new result calculated. This will happen every

program scan unless the pulse modifier or an interlock program is used.

[EADD]

16 bits instruction:- 32 bits instruction:EADD

S

Word

Device

Bit

Device X Y M S T C Dn.m

D FDDMDX DY DS TD CDK/H

S1· S2· S2·

S1·

Page 99: CLP GPM-18 - metaltex.com.br · Você pode programar o CLP GPM tanto em linguagem Ladder como em logica Boleana (lista de instruções). Funções básicas O CLP

Manual Programação CLP – GPM

63

ESUB D10 D20 D50

S1· S2· D·

X0

The floating point value of S2 is subtracted from the floating point value of S1 and the result

stored in destination device D.

If a constant K or H used as source data, the value is converted to floating point before the

addition operation.

ESUB D100K1234 D110X1

Function & Action

(D11,D10) - (D21,D20) → (D51,D50)

(K1234) - (D101,D100) → (D111,D110)

The same device may be used as a source and as the destination. If this is the case then,

on continuous operation of the EADD instruction, the result of the previous operation

will be used as a new source value and a new result calculated. This will happen every

program scan unless the pulse modifier or an interlock program is used.

[ESUB]

16 bits instruction:- 32 bits instruction:ESUB

S

Word

Device

Bit

Device X Y M S T C Dn.m

D FDDMDX DY DS TD CDK/H

S1· S2· S2·

S1·

Page 100: CLP GPM-18 - metaltex.com.br · Você pode programar o CLP GPM tanto em linguagem Ladder como em logica Boleana (lista de instruções). Funções básicas O CLP

Manual Programação CLP – GPM

64

EMUL D10 D20 D50

S1· S2· D·

X0

EMUL D100K100 D110X1

Function & Action

(D11,D10) × (D21,D20) → (D51,D50)

Binary Floating Binary Floating Binary Floating

The floating value of S1 is multiplied with the floating value point value of S2. The result

of the multiplication is stored at D as a floating value.

If a constant K or H used as source data, the value is converted to floating point before the

addition operation.

(K100) × (D101,D100) → (D111,D110)

Binary converts to Floating Binary Floating Binary Floating

[EMUL]

16 bits instruction:- 32 bits instruction:EMUL

S

Word

Device

Bit

Device X Y M S T C Dn.m

D FDDMDX DY DS TD CDK/H

S1· S2· S2·

S1·

Page 101: CLP GPM-18 - metaltex.com.br · Você pode programar o CLP GPM tanto em linguagem Ladder como em logica Boleana (lista de instruções). Funções básicas O CLP

Manual Programação CLP – GPM

65

EDIV D10 D20 D50

S1· S2· D·

X0

The floating point value of S1 is divided by the floating point value of S2. The result of the

division is stored in D as a floating point value. No remainder is calculated.

If a constant K or H used as source data, the value is converted to floating point before the

addition operation.

EDIV D100 K100 D110X1

Function & Action

(D11,D10)÷(D21,D20)→(D51,D50)

(D101,D100) ÷ (K100) → (D111,D110)

If S2 is zero then a divide by zero error occurs and the operation fails.

[EDIV]

16 bits instruction:- 32 bits instruction:EDDIV

S

Word

Device

Bit

Device X Y M S T C Dn.m

D FDDMDX DY DS TD CDK/H

S1· S2· S2·

S1·

Page 102: CLP GPM-18 - metaltex.com.br · Você pode programar o CLP GPM tanto em linguagem Ladder como em logica Boleana (lista de instruções). Funções básicas O CLP

Manual Programação CLP – GPM

66

ESQR D10 D20X0

S· D·

ESQR K1024 D110X1

Function & Action

(D11,D10) →(D21,D20)

A square root is performed on the floating point value in S the result is stored in D.

If a constant K or H used as source data, the value is converted to floating point before

the addition operation.

(K1024) → (D111,D110)

Binary converts to Floating Binary Floating

When the result is zero, zero flag activates

Only when the source data is positive will the operation be effective. If S is negative then

an error occurs and error flag M8067 is set ON, the instruction can’t be executed.

[ESQR]

16 bits instruction:- 32 bits instruction:ESQR

S

Word

Device

Bit

Device X Y M S T C Dn.m

D FDDMDX DY DS TD CDK/H

S· S·

Page 103: CLP GPM-18 - metaltex.com.br · Você pode programar o CLP GPM tanto em linguagem Ladder como em logica Boleana (lista de instruções). Funções básicas O CLP

Manual Programação CLP – GPM

67

SIN D50 D60X0

S· D·

D51 D50

D61 D60

Function & Action

(D51,D50) → (D61,D60)SIN

Binary Floating Binary Floating

This instruction performs the mathematical SIN operation on the floating

point value in S (angle RAD). The result is stored in D.

RAD value (angle×π/180)

Assign the binary floating value

SIN value

[SIN]

16 bits instruction:- 32 bits instruction:SIN

S

Word

Device

Bit

Device X Y M S T C Dn.m

D FDDMDX DY DS TD CDK/H

S· S·

Page 104: CLP GPM-18 - metaltex.com.br · Você pode programar o CLP GPM tanto em linguagem Ladder como em logica Boleana (lista de instruções). Funções básicas O CLP

Manual Programação CLP – GPM

68

COS D50 D60X0

S· D·

D51 D50

D61 D60

Function & Action

(D51,D50)RAD → (D61,D60)COS

Binary Floating Binary Floating

This instruction performs the mathematical COS operation on the floating point

value in S (angle RAD). The result is stored in D.

RAD value (angle×π/180)

Assign the binary floating value

COS value

[COS]

16 bits instruction:- 32 bits instruction:COS

S

Word

Device

Bit

Device X Y M S T C Dn.m

D FDDMDX DY DS TD CDK/H

S· S·

Page 105: CLP GPM-18 - metaltex.com.br · Você pode programar o CLP GPM tanto em linguagem Ladder como em logica Boleana (lista de instruções). Funções básicas O CLP

Manual Programação CLP – GPM

69

TAN D50 D60X0

S· D·

D51 D50

D61 D60

Function & Action

(D51,D50)RAD → (D61,D60)TAN

This instruction performs the mathematical TAN operation on the floating

point value in S. The result is stored in D.

RAD value (angle×π/180)

Assign the binary floating value

TAN value

[TAN]

16 bits instruction:- 32 bits instruction:TAN

S

Word

Device

Bit

Device X Y M S T C Dn.m

D FDDMDX DY DS TD CDK/H

S· S·

Page 106: CLP GPM-18 - metaltex.com.br · Você pode programar o CLP GPM tanto em linguagem Ladder como em logica Boleana (lista de instruções). Funções básicas O CLP

Manual Programação CLP – GPM

70

5-10....Clock Operation

Mnemonic Function

TCMP Time Compare

TZCP Time Zone Compare

TADD Time Add

TSUB Time Subtract

TRD Read RTC data

TWR Set RTC data

Note:The models without clock can not use these instructions.

Page 107: CLP GPM-18 - metaltex.com.br · Você pode programar o CLP GPM tanto em linguagem Ladder como em logica Boleana (lista de instruções). Funções básicas O CLP

Manual Programação CLP – GPM

71

Function & Action

Compare the assigned time with time data.

The status of the destination devices is kept, even if the TCMP instruction is deactivated.

:Assign the compare standard “Hour” :Assign the compare standard “Minute” :Assign the compare standard “Second”

S1·

S2·

S3·

「 , , 」represent hours, minutes and seconds respectively. This time is

compared to the time value in the 3 data devices specified by the head address , The

result is indicated in the 3 bit devices specified by the head address

S1· S2· S3·

:Assign the “Hour” of clock data +1 :Assign the “Minute” of clock data +2 :Assign the “Second” of clock data

S ·

S ·

S ·

, +1, +2 :According to the compare result, the 3 devices output ON/OFF.

The valid range of “Hour” is「0~23」.

The valid range of “Minute” is「0~59」.

The valid range of “Second” is「0~59」.

D· D· D·

Time Compare [TCMP]

16 bits instruction:DIV 32 bits instruction:DDIV

S

Word

Device

Bit

Device

D FDDMDX DY DS TD CDK/H

S1· S2· S3·

X Y M S T C Dn.m

Page 108: CLP GPM-18 - metaltex.com.br · Você pode programar o CLP GPM tanto em linguagem Ladder como em logica Boleana (lista de instruções). Funções básicas O CLP

Manual Programação CLP – GPM

72

Function & Action

即使使使使使用 X000=OFF停止执行 TZCP指令时,M0~M2

Compare the two assigned time with time data

Compare the 3 clock data start from with the two ends on the clock compare bound,

according to the area bound, output the three ON/OFF status starts from

, +1, +2 : Assign the compare low limit in the form of “Hour”, “Minute” and “Second”.

, +1, +2 : Assign the compare low limit in the form of “Hour”, “Minute” and “Second”.

S1· S1· S1·

S2·S2·

S2·

S· S· S·

D·D·D·

The valid range of “Hour” is「0~23」.

The valid range of “Minute” is「0~59」.

The valid range of “Second” is「0~59」.

[TZCP]

16 bits instruction:DIV 32 bits instruction:DDIV

S

Word

Device

Bit

Device

D FDDMDX DY DS TD CDK/H

S1· S2· S3·

X Y M S T C Dn.m

The status of the destination devices is kept, even if the TCMP instruction is deactivated.

Page 109: CLP GPM-18 - metaltex.com.br · Você pode programar o CLP GPM tanto em linguagem Ladder como em logica Boleana (lista de instruções). Funções básicas O CLP

Manual Programação CLP – GPM

73

D10 (Hour)

D11 (Minute)

D12 (Second)

D20 (Hour)

D21 (Minute)

D22 (Second)

D30 (Hour)

D31 (Minute)

D32 (Second)+

S1 S2 D

10 hour 20 min. 30 sec. 3 hour 20 min. 10 sec. 13 hour 40 min. 40 sec.

18 (Hour)

10 (Minute)

30 (Second)

10 (Hour)

20 (Minute)

5 (Second)

4 (Hour)

30 (Minute)

35 (Second)+

S1 S2 D

18 hour 10 min. 30 sec. 3 hour 20 min. 10 sec. 4 hour 30 min. 35 sec.

Function & Action

Each of S1, S2 and D specify the head address of 3 data devices to be used a time value.

The time value in S1 is added to the value in S2, the result is stored to D as a new time

value.

If the addition of the two times results in a value greater than 24 hours, the value of the

result is the time remaining above 24 hours. When this happens the carry flag M8022 is

When the result is 0(0 Hour 0 Minute 0 Second),Set zero flag ON.

The valid range of “Hour” is「0~23」.

The valid range of “Minute” is「0~59」.

The valid range of “Second” is「0~59」.

(D10, D11, D12)+(D20, D21, D22)→(D30, D31, D32)

TADD D10 D20 D30X0

S1· S2· D·

[TADD]

16 bits instruction:DIV 32 bits instruction:DDIV

S

Word

Device

Bit

Device X Y M S T C Dn.m

D FDDMDX DY DS TD CDK/H

S1· S2·

Page 110: CLP GPM-18 - metaltex.com.br · Você pode programar o CLP GPM tanto em linguagem Ladder como em logica Boleana (lista de instruções). Funções básicas O CLP

Manual Programação CLP – GPM

74

TSUB D10 D20 D30X0

S1· S2· D·

D10 (Hour)

D11 (Minute)

D12 (Second)

D10 (Hour)

D11 (Minute)

D12 (Second)

D10 (Hour)

D11 (Minute)

D12 (Second)

_ =

S1 S2 D

10 hour 20 min. 30 sec. 3 hour 20 min. 10 sec. 7 hour 0 min. 20 sec.

10 (Hour)

20 (Minute)

5 (Second)

18 (Hour)

10 (Minute)

30 (Second)

4 (Hour)

30 (Minute)

35 (Second)

_ =

S1 S2 D

10 hour 20 min. 5 sec. 18 hour 10 min. 30 sec. 4 hour 30 min. 35 sec.

Function & Action

Each of S1, S2 and D specify the head address of 3 data devices to be used a time value.

The time value in S1 is subtracted from the time value in S2, the result is stored to D as a

new time.

If the subtraction of the two times results in a value less than 00:00:00 hours, the value

of the result is the time remaining below 00:00:00 hours. When this happens the borrow

flag M8021 is set ON.

When the result is 0 (0 hour 0 min. 0 sec.), zero flag set ON.

The valid range of “Hour” is「0~23」.

The valid range of “Minute” is「0~59」.

The valid range of “Second” is「0~59」.

(D10, D11, D12)-(D20, D21, D22)→(D30, D31, D32)

[TSUB]

16 bits instruction:DIV 32 bits instruction:DDIV

S

Word

Device

Bit

Device X Y M S T C Dn.m

D FDDMDX DY DS TD CDK/H

S1· S2·

Page 111: CLP GPM-18 - metaltex.com.br · Você pode programar o CLP GPM tanto em linguagem Ladder como em logica Boleana (lista de instruções). Funções básicas O CLP

Manual Programação CLP – GPM

75

TRD D0X0

Function & Action The current time and date of the real time

clock are read and stored in the 7 data

devices specified by the head address D.

Read PLC’s real time clock according to the following format.

The reading source is the special data register (D8013~D8019)which save

[TRD]

16 bits instruction:DIV 32 bits instruction:DDIV

S

Word

Device

Bit

Device X Y M S T C Dn.m

D FDDMDX DY DS TD CDK/H

Unit Item Clock data

D8018 Year 0-99

D8017 Month 1-12

D8016 Date 1-31

D8015 Hour 0-23

D8014 Minute 0-59

D8013 Second 0-59

Sp

ecial data reg

ister for real

time clo

ck t

D8019 Week 0 (Sun.)-6 (Sat.)

Unit Item

D0 Year

D1 Month

D2 Date

D3 Hour

D4 Minute

D5 Second

D Week

Page 112: CLP GPM-18 - metaltex.com.br · Você pode programar o CLP GPM tanto em linguagem Ladder como em logica Boleana (lista de instruções). Funções básicas O CLP

Manual Programação CLP – GPM

76

TWR D10X0

Function & Action

The 7 data devices specified with the

head address S are used to set a new

Write the set clock data into PLC’s real time clock.

In order to write real time clock, the 7 data devices specified with the head

address should be pre-set. S·

After executing TWR instruction, the time in real time clock will

immediately change to be the new set time. So, when setting the time it is a

good idea to set the source data to a time a number of minutes ahead and

then drive the instruction when the real time reaches this value.

[TWR]

16 bits instruction:DIV 32 bits instruction:DDIV

S

Word

Device

Bit

Device X Y M S T C Dn.m

D FDDMDX DY DS TD CDK/H

Unit Item Clock data

D0 Year 0-99

D1 Month 1-12

D2 Date 1-31

D3 Hour 0-23

D4 Minute 0-59

D5 Second 0-59

Data fo

r clock

setting

D6 Week 0 (Sun.)-6 (Sat.)

Unit Item

D8018 Year

D8017 Month

D8016 Date

D8015 Hour

D8014 Minute

D8013 Second

D8019 Week

Sp

ecial data reg

ister for real

time clo

ck t

Page 113: CLP GPM-18 - metaltex.com.br · Você pode programar o CLP GPM tanto em linguagem Ladder como em logica Boleana (lista de instruções). Funções básicas O CLP

Manual Programação CLP – GPM

77

In this chapter, we introduce the functions of high-speed count input, high-speed pulse output and

MODBUS communication instructions of GPM series PLC.

6....Special Function Instructions((((GPM))))

6-1.High-speed Count

6-2.Pulse Uutput

6-3.Modbus Instructions

6-4.Free Format Communication

6-5.PWM Pulse Modulate

6-6.Frequency Testing

6-7.Precise Time

6-8.Interrupt Function

Page 114: CLP GPM-18 - metaltex.com.br · Você pode programar o CLP GPM tanto em linguagem Ladder como em logica Boleana (lista de instruções). Funções básicas O CLP

Manual Programação CLP – GPM

78

Page 115: CLP GPM-18 - metaltex.com.br · Você pode programar o CLP GPM tanto em linguagem Ladder como em logica Boleana (lista de instruções). Funções básicas O CLP

Manual Programação CLP – GPM

79

6-1....High-speed Count

High-speed Count Function

GPM series PLC all have high speed count function. By choosing different counter, you can

realize count function of increment mode, pulse + direction input mode, AB phase mode count, the

frequency can reach 200KHz.

About the definition of high speed counter’s input terminals, please refer to the following

table:

When X input terminals are not used as high speed input port, they could be used as common

input terminals.

[U]---count pulse input [Dir]---count direction judgment (OFF means +, ON means -)

[A]---A phase input [B]---B phase input

Increment Mode Pulse+ Direction Input

Mode AB Phase Mode

C600 C602 C604 C606 C608 C610 C612 C614 C616 C618 C620 C622 C624 C626 C628 C630 C632 C634

X000 U U B

X001 Dir A

X002 U U B

X003 Dir A

X004 U

X005 U

Page 116: CLP GPM-18 - metaltex.com.br · Você pode programar o CLP GPM tanto em linguagem Ladder como em logica Boleana (lista de instruções). Funções básicas O CLP

Manual Programação CLP – GPM

80

Input Mode of High Speed Counter’s Signal

1、、、、Input Mode

Increment Mode::::

Under increment mode, input pulse signal, the count value increases with each pulse signal.

+1 +1 +1 +1 +1 +1 +1 +1

Pulse + Direction input mode:

Under pulse + direction input mode, both the pulse signal and direction signal are input, the

count value increase/decrease according to the direction signal’s status.

+1 +1 +1 +1 -1 -1-1 -1

AB phase mode:

Under AB phase mode, the count value increase/decrease according to the signal difference (A phase

and B phase)

+1 -1

2、、、、Count Value

High speed counter’s count bound: K-2,147,483,648 ~ K+2,147,483,647. If the count value

exceeds the bound, overflow or underflow will occur; if occur overflow, K+2,147,483,647 will

change to be K-2,147,483,648, then go on counting; if occur underflow, K-2,147,483,648 will

change to be K+2,147,483,647, then go on counting

3、、、、Reset

High speed counter’s count format is software reset format

Pulse Input

Pulse input

Direction Dir

A phase input

B phase input

ON

OFF

ON

OFF

ON

OFF

ON

OFF

ON

OFF

Page 117: CLP GPM-18 - metaltex.com.br · Você pode programar o CLP GPM tanto em linguagem Ladder como em logica Boleana (lista de instruções). Funções básicas O CLP

Manual Programação CLP – GPM

81

RST C600

C600M0

M1

K2000

Connection of input terminal

The following, we take C600 as the example to introduce the connection format.

AB phase mode Pulse + Direction mode

COM

COM

X1

X0

X3

X2 X4

X5

X6

COM

COM

X1

X0

X3

X2 X4

X5

X6

Increment Mode

COM

COM

X1

X0

X3

X2 X4

X5

X6

Program Example

The following, we take GPM-18 PLC model as the example to tell how to program with the high

speed count:

See the right graph, when M0 is ON, C600 starts to

count with the pulse input from X0 port; when M1

turns from OFF to ON, the status value and count

value of C600 reset.

A phase input

B phase input Pulse input

Direction input

Pulse input

Page 118: CLP GPM-18 - metaltex.com.br · Você pode programar o CLP GPM tanto em linguagem Ladder como em logica Boleana (lista de instruções). Funções básicas O CLP

Manual Programação CLP – GPM

82

RST C600

C600

RST C604

C604

M0

M1

M2

M3

K2000

D0(D1)

RST C620

C620M4

M5

D0(D1)

RST C622

C622M6

M7

K100

When M0 is ON, C600counts

with the OFF→ON from X000.

When M1 activates, reset when

execute RST instruction.

When M2 is ON, C604 starts to

count. The count input is X004,

In this example, the set value is

the content indirectly assigned in

the data register.

See the graph, reset via M3 in the

sequential control program.

When M4 is ON, C620 counts with OFF→ON from X000, via OFF or ON status

from X001, decide the count direction. If

X001 is OFF, execute increase count; if

X001 is ON, execute decrease count”.

When M6 is ON, C622 counts with

OFF→ON from X000, via OFF or ON

status from X002, decide the count

direction. If X003 is OFF, execute

increase count; if X003 is ON,

execute decrease count”.

Increm

ent M

od

e

Pu

lse + D

irection

inp

ut m

ode

AB phase

mode

AB phase counter realize increase/decrease count by the judgment of A、B phase.

The output contactor’s (correspond with the current value) action is the same with

the preceding single phase counter.

Page 119: CLP GPM-18 - metaltex.com.br · Você pode programar o CLP GPM tanto em linguagem Ladder como em logica Boleana (lista de instruções). Funções básicas O CLP

Manual Programação CLP – GPM

83

RST C630

C630

Y002

K1000

RST C632

C632

Y004

D0(D1)

M8

M9

C630

M10

M11

C632

One time frequency mode:

+1 -1A

B

Increment count Decrement count

Four times frequency mode

Times

Frequency

A、B phase counter’s count format:

AB phase count add 4 times frequency count mode. The count mode is shown below:

High speed counters have one time frequency and four times frequency two

modes. PLC’s defaulted count mode is four times frequency mode. The count

format of two count modes is shown below:

When M8 is ON, C630 counts with

the input X000 (B phase), X001(A

phase) via interruption.

If M9 is ON, execute RST instruction

to reset.

If the current value exceeds the set

value, then Y002 is ON; If the current

value is smaller than the set value,

then Y002 is OFF

When M10 is ON, C632 starts to

count. The count input is X002 (B

phase)、X003(A phase).

Reset via M11.

If the current value exceeds the set

value, then Y004 activates; If the

current value is smaller than the set

value, then Y004 is OFF

In the condition of A phase input is OFF→ON, if B phase input is OFF, the counter is

increase count; if B phase input is ON, the counter is decrease count.

Page 120: CLP GPM-18 - metaltex.com.br · Você pode programar o CLP GPM tanto em linguagem Ladder como em logica Boleana (lista de instruções). Funções básicas O CLP

Manual Programação CLP – GPM

84

Increment count:

+1 +1 +1 +1

+1 +1 +1 +1+1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1

A

B

Decrement count:

-1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1

A

B

The setting method of 4 times frequency mode:

In the condition of testing the same pulses by the counter, the count value equals four times under

four times frequency mode of that under one time frequency mode.

FD8241 Times of C630 frequency 1 is 1 time frequency,

4 is 4 times frequency,

FD8242 Times of C632 frequency 1 is 1 time frequency,

4 is 4 times frequency

FD8243 Times of C634 frequency 1 is 1 time frequency,

4 is 4 times frequency

Page 121: CLP GPM-18 - metaltex.com.br · Você pode programar o CLP GPM tanto em linguagem Ladder como em logica Boleana (lista de instruções). Funções básicas O CLP

Manual Programação CLP – GPM

85

6-2....Pulse Output

Pulse Output Function

Normally GPM series PLC have 2 channels pulse output. Via different instruction to program, you can

realize single direction pulse output without speedup/speed-down; or you can realize single direction

pulse output with speedup/speed-down; or you can realize multiply-segment, positive/negative output

and so on. The output frequency can reach 400K Hz.

Y0

COM0

Y1

COM1

Y2

COM2

Note: 1) To use pulse output, you should use PLC with transistor output. Such as GPM-18T.

Type and application of pulse output

1、、、、 Single direction pulse output without speedup/speed-down

• Frequency: 0~400KHz

• Output terminals: Y0 or Y1

• Output mode: sequential or limited pulse output

• Pulse number: 16 bits instructions 0~K32767

32 bits instructions 0~K2147483647

• Instructions: PLSY、PLSF

PLSY: generate certain quantity pulse with the assigned frequency

PLSF: generate sequential pulse with changeable frequency form

Step Motor

Driver

Page 122: CLP GPM-18 - metaltex.com.br · Você pode programar o CLP GPM tanto em linguagem Ladder como em logica Boleana (lista de instruções). Funções básicas O CLP

Manual Programação CLP – GPM

86

PLSY Instruction::::

PLSY K30 D1 Y0M0

S1· S2· D·

M8170RST M0

After finish outputting the set pulse number, output will auto stop.

PLSF Instruction:

PLSF D0 Y0M0

S· D·

Continuously output pulse with the set frequency till pass the statement, then stop outputting.

Limited pulse output

Set pulse number

Sequential pulse output

Generate certain quantity pulse with the assigned frequency; support 32 bits instruction [DPLSY].

Assign the Frequency. Operands: K、TD、CD、D、FD

Assign the generated pulse volume. Operands: K、TD、CD、D、FD

Assign Y port which generates pulse, can only output at Y000 or Y001

S1·

S2·

When M0 is ON, PLSY instruction output pulse of 30Hz at Y0, the pulse number is assigned by

D1, when sending pulse, coil M8170 sets ON. When the output pulse reach the set value, stop

pulse output, coil M8170 sets OFF, reset M0.

Generate sequential pulse with changeable frequency form

Support 32 bits instruction [DPLSF].

Assign the frequency. Operands: K、TD、CD、D、FD

Bound: 200~400KHz (If the set frequency is lower than 200Hz, output 200Hz)

Assign Y port which generates pulse, can only output at Y000 or Y001

With the changing of the set frequency in D0, the output pulse frequency from Y0 changes.

Accumulate pulse number in register D8170

Page 123: CLP GPM-18 - metaltex.com.br · Você pode programar o CLP GPM tanto em linguagem Ladder como em logica Boleana (lista de instruções). Funções básicas O CLP

Manual Programação CLP – GPM

87

When M0 is ON, PLSR starts pulse output, send assigned pulse number

according to the assigned speedup/speed-down slope、highest frequency. To

output with the constant speed, set the speedup/speed-down time as 0. If set

the pulse number as H 7FFFFFFF, infinity pulse number will be sold out, at

this time coil M8170 set ON.

When the output pulse number reaches the set value, stop pulse outputting, at

this time coil M8170 set OFF, reset M000. See the following chart

If pulse output M000 is OFF, pulse output decreases to be 0 according to the

assigned slope. Stop pulse outputting, coil M8170 set OFF.

Pulse output of single segment and single direction

2、、、、One-direction pulse output with speedup/speed-down

• Frequency: 0~400KHz

• Speedup/speed-down time: Below 5000ms

• Output terminals: Y0 or Y1

• Output Mode: Limited pulse

• Pulse number: 16 bits instruction 0~K32767

32 bits instruction 0~K2147483647

• Instruction: PLSR

PLSR: generate certain pulse with the assigned frequency and

speedup/speed-down time.

PLSR K3000 D300 Y0M0

K300

S1· S2· S3· D·

M8170RST M0

Generate a certain quantity pulse with the assigned frequency; support 32 bits instruction [DPLSR]。

Highest frequency. Operands: K、TD、CD、D、FD

Total output pulse number. Operands: K、TD、CD、D、FD

Speedup/speed-down time. Operands: K、TD、CD、D、FD

Assign Y number of output pulse, could only be output at Y000 or Y001

S1·

S2·

D ·

S3·

Page 124: CLP GPM-18 - metaltex.com.br · Você pode programar o CLP GPM tanto em linguagem Ladder como em logica Boleana (lista de instruções). Funções básicas O CLP

Manual Programação CLP – GPM

88

Pulse output of segments and single phase

PLSR D0 D100 Y3

RST M0

M0

M8170

S1· S2· D·

The instruction which generates a certain quantity pulse with the assigned frequency.

An area with Dn or FDn as the start address. In the above example, D0 set the highest

frequency of segment 1 pulse, D1 set the highest frequency of segment 1 pulse, D2 set the

highest frequency of segment 2 pulse, D3 set the highest frequency of segment 2 pulse, ……if the set value of Dn, Dn+1 are both 0, it means segment finish. You can set at most 24

segments. Operands: D, FD

Speedup/speed-down time. Here the time means the speed time from start to the first

segment’s speedup time, meantime, all segments’ frequency and time slope are defined. So

the following speedup/speed-down speed follows them. Operands: K, TD, CD, D, FD

Assign the Y number of output pulse, can only output at Y000 or Y001

Support double words output DPLSR, here D0、D1 set the highest frequency of segment

1、D2、D3 set the pulse number of segment 1, D4、D5 set the highest frequency of segment 2、D6、D7 set the pulse number of segment 2……

S1·

S2·

D ·

Page 125: CLP GPM-18 - metaltex.com.br · Você pode programar o CLP GPM tanto em linguagem Ladder como em logica Boleana (lista de instruções). Funções básicas O CLP

Manual Programação CLP – GPM

89

3、、、、Dual Pulse Output with speedup/speed-down

• Frequency: 0~400KHz

• Speedup/speed-down time: Below 5000ms

• Output Terminals: Y0 or Y1

• Direction output terminal: Any Y

• Output Mode: Limited number of pulse

• Pulse Number: 16 bits instruction: 0~K32767

32 bits instruction: 0~K2147483647

Instruction: PLSR

PLSR: Generate certain pulse with the assigned frequency and speedup/speed-down time.

Dual Pulse Output with Speedup/Speed-down

PLSR D0 D100 Y0

RST M0

M0

M8170

S1· S2·

Y3

D1· D2·

Generate certain pulse with the assigned frequency, speedup/speed-down time, pulse direction.

An area which takes Dn or FDn with the start address. In the preceding example, D0 set the max

frequency of segment 1, D1 set pulse number of segment 1. D2 set the max frequency of segment 2, D3

set pulse number of segment 2, …… if Dn、Dn+1 are both 0, it means segment finish. You can set 24

segments at most. Operands: D, FD.

Speedup/speed-down time, here the time means the speedup time from the start to the highest frequency.

At the same time all segments’ frequency and time slope is defined, so the following speedup/speed-down

format all do according to them. Operands: K、TD、CD、D、FD

Assign Y number of output pulse, can only output at Y000 or Y001

Assign Y number of output pulse direction, can be assigned at your will. E.g. In , if the pulse

number is a positive value in segment 1, Y output ON; if be negative, Y is OFF. Please note: in once

segment pulse output, pulse’s direction is only determined by the pulse number set value (positive or

negative) of the first segment.

S1·

S2·

D 1 ·

D 2 ·

S1·

Page 126: CLP GPM-18 - metaltex.com.br · Você pode programar o CLP GPM tanto em linguagem Ladder como em logica Boleana (lista de instruções). Funções básicas O CLP

Manual Programação CLP – GPM

90

4、、、、Pulse Segment Switch [PLSNEXT]

Y0PLSNEXTM1

PLSY D0 D100 Y0M0

In the condition of pulse output reaches the highest frequency of current segment, and stably output,

if M1 turns from OFF to ON, then enter next pulse output with the speedup/speed-down time.

In pulse output speedup/speed-down process, execute this instruction is invalid.

--------(the broken line)means the original pulse output curve

Page 127: CLP GPM-18 - metaltex.com.br · Você pode programar o CLP GPM tanto em linguagem Ladder como em logica Boleana (lista de instruções). Funções básicas O CLP

Manual Programação CLP – GPM

91

5、、、、Pulse Stop [STOP]

D0PLSR D100 Y0M0

M1

M8170

STOP Y0

RST M0

Connection of output terminals

Y0

COM0

Y1

COM1

Y2

COM2

The following graph is connection of output terminals and step motor driver:

PLC Side Step Motor Driver Side

Output port Y0: pulse output port 0 (Single Phase)

Output port Y1: pulse output port 1 (Single Phase)

If M000 turns from OFF to ON, PLSY activates and Y000 output pulse, D0 assign the

frequency, D001 assign the pulse number, D100 assign the speedup/speed-down time, when the

output pulse number reaches the set value, stop pulse outputting. At the rising edge of M001,

STOP instruction stop pulse outputting at Y000 immediately.

Page 128: CLP GPM-18 - metaltex.com.br · Você pode programar o CLP GPM tanto em linguagem Ladder como em logica Boleana (lista de instruções). Funções básicas O CLP

Manual Programação CLP – GPM

92

Y0PU

PUY1

Note Items

1、、、、Concept of Step Frequency

In the process of speedup/speed-down, each step’s time is 5ms, this time is fixed.

The max. step is 15K. (the increase/decrease frequency of each step). If the value exceeds 15K,

count as 15K;the minimum step frequency is 10Hz, if lower than 10Hz, calculate as 10Hz.

When carrying on pulse output, please note each segment’s pulse number shouldn’t lower than 10,

if the set value is less than 10, sent as 10.

Page 129: CLP GPM-18 - metaltex.com.br · Você pode programar o CLP GPM tanto em linguagem Ladder como em logica Boleana (lista de instruções). Funções básicas O CLP

Manual Programação CLP – GPM

93

2、、、、Frequency jump in segment pulse output

3、、、、Pulse Output can’t realize dual output

D0PLSR D100 Y0M0

D200PLSR D1000 Y0M1

Application

E.g.1: Fixed Stop

With subsection pulse output statement [PLSR] and pulse segment switch

statement [PLSNEXT], realize fixed-length function.

In one main program, you can’t write two or up to two pulse output instruction with the same

output port Y.

The following program is wrong.

In the process of segment pulse output, if the current pulse number has sent out but still haven’t

reached the current segment’s max. frequency, then in the process from the current segment to the

next pulse output, there will be pulse frequency jump. See the following chart.

To avoid frequency jump, please note the speedup/speed-down time set value not to small.

Page 130: CLP GPM-18 - metaltex.com.br · Você pode programar o CLP GPM tanto em linguagem Ladder como em logica Boleana (lista de instruções). Funções básicas O CLP

Manual Programação CLP – GPM

94

FRQM K20 D0 K1 X003X000

PLSF D0 Y0

E.g.2::::Follow Relationship

The pulse output frequency of Y0 equals the tested input frequency of X003. If the tested input

frequency at X003 changes, the output frequency at Y0 changes relatively.

M0

M1

M8170

Take the preceding program as

the example, in D0、D1 and D2,D3, set two parts pulse output

with the same frequency value.

The pulse number in D3 is set to

be the number needed When M1

is ON. This will realize

fixed-length stop function. Refer

to the right graph:

Segment 1 Segment 2

Page 131: CLP GPM-18 - metaltex.com.br · Você pode programar o CLP GPM tanto em linguagem Ladder como em logica Boleana (lista de instruções). Funções básicas O CLP

Manual Programação CLP – GPM

95

Pulse output special coil and register

Some flag bits of pulse output is shown below:

ID

High

frequency

pulse ID

Function Description

M8170 PULSE_1 Sending pulse flag Be 1 at pulse sending

M8171 32 bits pulse sending

overflow flag Be 1 when overflow

M8172 Direction flag 1 is positive direction, the correspond

direction port is ON

M8173 PULSE_2 Sending pulse flag Be 1 at pulse sending

M8174 32 bits pulse sending

overflow flag Be 1 when overflow

M8175 Direction flag 1 is positive direction, the correspond

direction port is ON

M8176 PULSE_3 Sending pulse flag Be 1 at pulse sending

M8177 32 bits pulse sending

overflow flag Be 1 when overflow

M8178 Direction flag 1 is positive direction, the correspond

direction port is ON

M8179 PULSE_4 Sending pulse flag Be 1 at pulse sending

M8180 32 bits pulse sending

overflow flag Be 1 when overflow

M8181 Direction flag 1 is positive direction, the correspond

direction port is ON

Page 132: CLP GPM-18 - metaltex.com.br · Você pode programar o CLP GPM tanto em linguagem Ladder como em logica Boleana (lista de instruções). Funções básicas O CLP

Manual Programação CLP – GPM

96

Some special registers of pulse output:

ID

High

frequency

pulse ID

Function Description

D8170 PULSE_1 The low 16 bits of accumulated pulse number

D8171 The high 16 bits of accumulated pulse number

D8172 The current segment (means No.n segment)

D8173 PULSE_2 The low 16 bits of accumulated pulse number

D8174 The high 16 bits of accumulated pulse number

D8175 The current segment (means No.n segment)

D8176 PULSE_3 The low 16 bits of accumulated pulse number

D8177 The high 16 bits of accumulated pulse number

D8178 The current segment (means No.n segment)

D8179 PULSE_4 The low 16 bits of accumulated pulse number

D8180 The high 16 bits of accumulated pulse number

D8181 The current segment (means No.n segment)

D8190 PULSE_1 The low 16 bits of accumulated pulse number

D8191 The high 16 bits of accumulated pulse number

D8192 PULSE_2 The low 16 bits of accumulated pulse number

D8193 The high 16 bits of accumulated pulse number

D8194 PULSE_3 The low 16 bits of accumulated pulse number

D8195 The high 16 bits of accumulated pulse number

D8196 PULSE_4 The low 16 bits of accumulated pulse number

Page 133: CLP GPM-18 - metaltex.com.br · Você pode programar o CLP GPM tanto em linguagem Ladder como em logica Boleana (lista de instruções). Funções básicas O CLP

Manual Programação CLP – GPM

97

6-3....Communication Function

1、、、、 RS232 COM port

备注备注备注备注

2、、、、RS485 COM Port

COM Port

GPM main units can fulfill your requirement of communication and network. They not only

support simple network (Modbus protocol、free communication protocol), but also support those

complicate network. GPM offer communication access, with which you can communicate with the

devices (such as printer, instruments etc.) that have their own communication protocol.

GPM all support Modbus protocol、free protocol these communication function.

The pin graph of COM 1((((Port1):):):): 3 4 51 26 87

2:PRG

4:RxD

5:TxD

There are 2 COM ports (Port1、Port2).

COM 1 (Port1) is the program port, it can be used to download the program

and connect with the other devices. The parameters (baud rate, data bit etc.) of this

COM port are fixed, can’t be re-set.

COM 2 (Port2) is communication port, it can be used to download program

and connect with the other devices. The parameters (baud rate, data bit etc.) of this

COM port can be re-set via software.

About RS485 COM port, A is “+” signal、B is “-“ signal.

Page 134: CLP GPM-18 - metaltex.com.br · Você pode programar o CLP GPM tanto em linguagem Ladder como em logica Boleana (lista de instruções). Funções básicas O CLP

3

Station Modbus Station number: 1~254、255 (FF) is free format communication

Baud Rate 300bps~115.2Kbps

Data Bit 8 bits data bit、7 bits data bit

Stop Bit 2 stop bits、1 stop bit

Check Even、Odd、No check

How to set the communication parameter::::

Number Function Description

FD8210 Communication mode 255 is free format,

1~254 bit is modbus station number

FD8211 Communication format Baud rate, data bit, stop bit, check

FD8212 ASC timeout judgment time Unit: ms,if set to be 0, it means no

timeout waiting

FD8213 Reply timeout judgment time Unit: ms,if set to be 0, it means no

timeout waiting

FD8214 Start symbol High 8 bits invalid

FD8215 End symbol High 8 bits invalid

COM 1

FD8216 Free format setting

8/16 bits cushion,

with/without start bit,

with/without stop bit

Communication Parameter

The defaulted parameters of COM 1:

Parameter Setting GPM series PLC can set the communication parameters with the COM

Page 135: CLP GPM-18 - metaltex.com.br · Você pode programar o CLP GPM tanto em linguagem Ladder como em logica Boleana (lista de instruções). Funções básicas O CLP

4

0:300bps

1:600bps

2:1200 bps

3:2400 bps

4:4800 bps

5:9600 bps

6:19.2K bps

7:38.4K bps

8:57.6K bps

9:115.2K bps

0:8bits data

1:7bits data

0:2 stop bits

0:No check

1:Odd check

FD8220 Communication mode 255 is free format,

1~254 bit is modbus station number

FD8221 Communication format Baud rate, data bit, stop bit, check

FD8222 ASC timeout judgment time Unit: ms,if set to be 0, it means no

timeout waiting

FD8223 Reply timeout judgment time Unit: ms,if set to be 0, it means no

timeout waiting

FD8224 Start symbol High 8 bits invalid

FD8225 End symbol High 8 bits invalid

COM 2

FD8226 Free format setting

8/16 bits cushion,

with/without start bit,

with/without stop bit

FD8211((((COM1))))/FD8221((((COM2):):):):

15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0

Setting method of communication parameters:

Page 136: CLP GPM-18 - metaltex.com.br · Você pode programar o CLP GPM tanto em linguagem Ladder como em logica Boleana (lista de instruções). Funções básicas O CLP

5

0:8 bits communication

0: without start symbol

1: with start symbol

0:without end symbol

Reserve

FD8216((((COM1))))/FD8226((((COM2):):):):

15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0

Page 137: CLP GPM-18 - metaltex.com.br · Você pode programar o CLP GPM tanto em linguagem Ladder como em logica Boleana (lista de instruções). Funções básicas O CLP

6

6-3-1....MODBUS Communication function

Coil space:

Coil’s start ID ((((Dec.)))) M0 X0 Y0 S0 M8000 T0 C0

Corresponded Modbus ID ((((Hex.)))) 0 4000 4800 5000 6000 6400 6C00

Note: coil’s Modbus ID=Modbus ID which corresponds with coil’s start ID +coil number

Register space:

Register’s start ID ((((Dec.)))) D0 TD0 CD0 D8000 FD0 FD8000

Corresponded Modbus ID ((((Hex.)))) 0 3000 3800 4000 4800 6800

Note: register’s Modbus ID=Modbus ID which corresponds with register’s start ID + register number

Communication

Function GPM series PLC support both Modbus master and Modbus slave

Master format: When PLC is set to be master, PLC sends request to other

slave devices via Modbus instructions, other devices response

the master.

Slave format: when PLC is set to be slave, it can only response with other

master devices.

The defaulted status of GPM-PLC is Modbus slave.

Communication

ID

For the soft unit’s number in PLC which corresponds with Modbus address number,

please see the following table:

Page 138: CLP GPM-18 - metaltex.com.br · Você pode programar o CLP GPM tanto em linguagem Ladder como em logica Boleana (lista de instruções). Funções básicas O CLP

7

1、、、、Coil Read [COLR]

COLR K1 K500 K3 M1X0

K2

S1· S2· S3· D1· D2·

2、、、、Input Coil’s Read [INPR]

INPR K1 K500 K3 M1X0

K2

S1· S2· S3· D1· D2·

Communication Instructions

Coil read instruction, Modbus function code is 01H .

Function: Read the assigned bureau’s assigned coil status to PLC’s assigned coil.

Far away communication bureau number . Operands: K、TD、CD、D、FD

Far away coil’s start number. Operands: K、TD、CD、D、FD

Coil number. Operands: K、TD、CD、D、FD

S1·

S2·

S3·

D1·

D2·

Instruction description: when X0 is ON, execute COLR or INPR instruction. After finish

executing the instruction, set communication finish bit. No operation when X0 is OFF. If

communication errors, resend automatically. If reach 10 times, set communication error

flag. User can check the relative register to judge the reason.

Read the input coil instruction, Modbus function code is 02H

Function: Read the assigned bureau’s assigned input coil status to PLC’s assigned coil.

Far away communication bureau number . Operands: K、TD、CD、D、FD

Far away coil’s start number. Operands: K、TD、CD、D、FD

Coil number. Operands: K、TD、CD、D、FD

Local receive coil’s start ID. Operands: X、Y、M、S、T、C

Port number. Bound: K1~K2

S1·

S2·

S3·

D1·

D2·

Page 139: CLP GPM-18 - metaltex.com.br · Você pode programar o CLP GPM tanto em linguagem Ladder como em logica Boleana (lista de instruções). Funções básicas O CLP

8

3、、、、Single coil write [COLW]

COLW K1 K500 M1X0

K2

D1· D2· S1· S2·

4、、、、Multi-coil write [MCLW]

MCLW K1 K500 K3 M1X0

K2

D1· S1· S2·D2· D3·

Write single coil instruction, Modbus function code is 05H

Function: Write the assigned coil status to PLC’s assigned bureau’s assigned coil.

Far away communication bureau number . Operands: K、TD、CD、D、FD

Far away communication bureau number . Operands: K、TD、CD、D、FD

Local receive coil’s start ID. Operands: X、Y、M、S、T、C

Port number. Bound: K1~K2

D1·

D2·

S1·

S2·

Instruction description: when X0 is ON, execute COLW or MCLW instruction. After finish

executing the instruction, set communication finish bit. No operation when X0 is OFF. If

communication errors, resend automatically. If reach 10 times, set communication error flag. User can

check the relative register to judge the reason.

Write multi-coil instruction, Modbus function code is 0FH。

Function: Write the assigned multi-coil status to PLC’s assigned bureau’s assigned coil.

Far away communication bureau number. Operands: K、TD、CD、D、FD

Far away communication bureau number. Operands: K、TD、CD、D、FD

Coil number. Operands: K、TD、CD、D、FD

Local receive coil’s start ID. Operands: X、Y、M、S、T、C

Port number. Bound: K1~K2

D1·

D2·

D3·

S1·

S2·

Page 140: CLP GPM-18 - metaltex.com.br · Você pode programar o CLP GPM tanto em linguagem Ladder como em logica Boleana (lista de instruções). Funções básicas O CLP

9

5、、、、Register Read [REGR]

REGR K1 K500 K3 D1X0

K2

S1· S2· S3· D1· D2·

6、、、、Input Register Read [INRR]

INRR K1 K500 K3 D1X0

K2

S1· S2· S3· D1· D2·

Read register instruction, Modbus function code is 03H.

Function: Read the assigned bureau’s assigned register status to PLC’s assigned register.

Far away communication bureau number. Operands: K、TD、CD、D、FD

Far away communication bureau number. Operands: K、TD、CD、D、FD

Register number. Operands: K、TD、CD、D、FD

Local receive register’s start ID. Operands: D

Port number. Bound: K1~K2

S1·

S2·

S3·

D1·

Instruction description: when X0 is ON, execute REGR or INRR instruction. After finish

executing the instruction, set communication finish bit. No operation when X0 is OFF. If

communication errors, resend automatically. If reach 10 times, set communication error flag. User

can check the relative register to judge the reason.

Read the input register instruction, Modbus function code is 04H.

Function: Read the assigned bureau’s assigned input register status to PLC’s assigned register.

Far away communication bureau number. Operands: K、TD、CD、D、FD

Far away communication bureau number. Operands: K、TD、CD、D、FD

Register number. Operands: K、TD、CD、D、FD

Local receive register’s start ID. Operands: D

Port number. Bound: K1~K2

S1·

S2·

S3·

D1·

D2·

D2·

Page 141: CLP GPM-18 - metaltex.com.br · Você pode programar o CLP GPM tanto em linguagem Ladder como em logica Boleana (lista de instruções). Funções básicas O CLP

10

7、、、、Single Register Write [REGW]

REGW K1 K500 D1X0

K2

D1· S1· S2·D2·

8、、、、Multi-register Write [MRGW]

MRGW K1 K500 K3 D1X0

K2

D1· D2· D3· S1· S2·

Write single register instruction, Modbus function code is 06H

Function: write the assigned register status to PLC’s assigned bureau’s assigned register.

Far away communication bureau number. Operands: K、TD、CD、D、FD

Far away communication bureau number. Operands: K、TD、CD、D、FD

Local receive register’s start ID. Operands: D

Port number. Bound: K1~K2

D1·

D2·

S1·

Instruction description: when X0 is ON, execute REGW or MRGW instruction. After finish

executing the instruction, set communication finish bit. No operation when X0 is OFF. If

communication errors, resend automatically. If reach 10 times, set communication error flag. User

can check the relative register to judge the reason.

Write multi-register instruction, Modbus function code is 10H

Function: write the assigned input register status to PLC’s assigned bureau’s assigned register.

Far away communication bureau number. Operands: K、TD、CD、D、FD

Far away communication bureau number. Operands: K、TD、CD、D、FD

Register number. Operands: K、TD、CD、D、FD

Local receive register’s start ID. Operands: D

Port number. Bound: K1~K2

S1·

S2·

S3·

D1·

D2·

S2·

Page 142: CLP GPM-18 - metaltex.com.br · Você pode programar o CLP GPM tanto em linguagem Ladder como em logica Boleana (lista de instruções). Funções básicas O CLP

11

Page 143: CLP GPM-18 - metaltex.com.br · Você pode programar o CLP GPM tanto em linguagem Ladder como em logica Boleana (lista de instruções). Funções básicas O CLP

12

6-3-2....Free Format Communication

Communication Mode:

Free Communication

Start Symbol (1 byte) Data Block (max. 128 bytes) End Symbol (1 byte)

Baud Rate: 300bps~115.2Kbps

Data Format

Data Bit: 7bits、8bits

Check Bit: Odd、Even、No Check

Stop bit: 1 bit、2 bits

Start Symbol: 1 bit

End Symbol: 1 bit

User can set a start/end symbol, after set start/end symbol, PLC will automatically add this

start/end symbol when sending data; remove this start/end symbol when receiving data.

Communication Format: 8 bits、16 bits

If choose 8 bits cushion format to communicate, in the communication process, the high

bytes are invalid, PLC only use the low bytes to send and receive data.

Free format communication transfer data in the format of data block, each block can transfer 128

bytes at most. Meanwhile each block can set a start symbol and end symbol, or not set.

Page 144: CLP GPM-18 - metaltex.com.br · Você pode programar o CLP GPM tanto em linguagem Ladder como em logica Boleana (lista de instruções). Funções básicas O CLP

13

1、、、、Send Data::::

SEND D10 D100 K1

S1· S2· nM0

2、、、、Receive Data::::

RCV D20 D200 K1

S1· S2· nM1

Instruction Format

Data sending instruction, send data every rising edge of M0

Start address of send data. Operands: K、TD、CD、D、FD

The sent character’s number. Operands: K、TD、CD、D、FD

n::::COM port Bound: K1~K2

In the data sending process, “sending” flag M8122 (COM 1) sets ON.

S1·

S2·

Data receiving instruction, receive data every rising edge of M0

Receive address of send data.

Operands: K、TD、CD、D、FD

The received character’s number.

Operands: K、TD、CD、D、FD

n::::COM port Bound: K1~K2

In the data receiving process, “receiving” flag M8124 (COM 1) sets ON.

S1·

D1·

S2·

D1·

Page 145: CLP GPM-18 - metaltex.com.br · Você pode programar o CLP GPM tanto em linguagem Ladder como em logica Boleana (lista de instruções). Funções básicas O CLP

14

Page 146: CLP GPM-18 - metaltex.com.br · Você pode programar o CLP GPM tanto em linguagem Ladder como em logica Boleana (lista de instruções). Funções básicas O CLP

15

6-4....PWM Pulse Width Modulation

PWM K100 D10 Y0X0

S1· S2· D·

T0

t

Function

and Action

Assign occupy/empty ratio value “n”. The bound is:1~255

Assign output frequency f. The bound is:0~72KHz

Assign Y number of output pulse

Can only output at Y000 or Y001 (please treat as transistor output type).

The output occupy/empty ratio of PMW =n /256×100%

PWM output use the unit of 0.1Hz, so when set (S1) frequency, the set value is 10

times of the actual frequency (i.e. 10f). E.g.:to set the frequency as 72KHz, then

set value in (S1) as 720000.

When X000 is ON, output PWM wave;when X000 is OFF, stop outputting. PMW

S2·

S1·

In the upward graph:T0=1/f

T/T0=n/256

16 bits instruction:PWM 32 bits instruction:-

Su

itab

le dev

ice

Word

Bit

Device

D FDDMDX DY DS TD CDK/H

S2·S1· S2·S1·

X Y M S T C Dn.m

Page 147: CLP GPM-18 - metaltex.com.br · Você pode programar o CLP GPM tanto em linguagem Ladder como em logica Boleana (lista de instruções). Funções básicas O CLP

16

6-5....Frequency Testing

FRQM K20 D100 K1 X003X000

D·S1· S2· S3·

S1: Pulse cycle number (The sampled pulse cycle number in one scan cycle.)

Operands: D、CD、TD

D: Testing result. Operands: D、CD、TD

S2: Frequency division choice. Bound: K1 or K2;

When the frequency division is K1, the bound is: no less than 9Hz, precision bound: 9~18KHz.

When the frequency division is K2, the bound: no less than 300Hz, precision bound: 300~400KHz。

S3: pulse input X number

In frequency testing, if choose frequency division as K2, the frequency testing precision is higher

than frequency division K1.

When X000 is ON, FRQM will test 20 pulse cycles from X003 every scan cycle. Calculate the

frequency’s value and save into D100. Test repeatedly. If the tested frequency’s value is smaller

than the test bound, then return the test value as 0.

Function and Action

16 bits instruction:FRQM 32 bits instruction -

Su

itab

le dev

ice

Word

Device

Bit

Device X Y M S T C Dn.m

S3·

D FDDMDX DY DS TD CDK/H

S1·S2·

S1·

The correspond X number with the pulse output of frequency testing:

GPM-18 X1, X11, X12

Page 148: CLP GPM-18 - metaltex.com.br · Você pode programar o CLP GPM tanto em linguagem Ladder como em logica Boleana (lista de instruções). Funções básicas O CLP

17

6-6....Precise Time

STR T600 K100X0

D1· D2·

Y0T600

RST T600M0

SFC graph of the preceding program is:

X0

T600

100ms 100ms

M0

Function

and Action

:Timer’s number. The bound:T600~T618(T600、T602、T604…T618)

:The time value.

This instruction is the precise time instruction with the cycle of 1ms.

Precise timer is 32 bits, the count value’s bound is 0~+2,147,483,647.

When X000 turns from OFF to ON, timer T600 starts to time, when time accumulation reaches

100ms, T600 set;if X000 again turns from OFF to ON, timer T600 turns from ON to OFF,restart to

D 1·

D2·

16 bits instruction:STR 32 bits instruction:-

Su

itab

le dev

ice

Word

Bit

Device X Y M S T C Dn.m

D1·

D FDDMDX DY DS TD CDK/H

D2·D2·

Page 149: CLP GPM-18 - metaltex.com.br · Você pode programar o CLP GPM tanto em linguagem Ladder como em logica Boleana (lista de instruções). Funções básicas O CLP

18

STR T600 K100X0

RST T600M0

I3001

SRET

FEND

Interrupt tag correspond with the

timer::::

Timer’s number Interrupt tag

T600 I3001

T602 I3002

T604 I3003

T606 I3004

T608 I3005

T610 I3006

T612 I3007

T614 I3008

T616 I3004

T618 I3010

When precise time reaches the count value, a correspond interrupt tag will be

generated, some interrupt subroutines can be executed.

Each precise timer has its correspond interrupt tag. See the following graph:

Precise

Time

Interruption

When X000 turns from OFF to ON,

timer T600 starts to time, when time

reaches 100ms, T600 set; at the same

time an interruption occurs, the

program jump to interrupt tag I3001

and execute an interruption

subroutine.

Page 150: CLP GPM-18 - metaltex.com.br · Você pode programar o CLP GPM tanto em linguagem Ladder como em logica Boleana (lista de instruções). Funções básicas O CLP

19

Page 151: CLP GPM-18 - metaltex.com.br · Você pode programar o CLP GPM tanto em linguagem Ladder como em logica Boleana (lista de instruções). Funções básicas O CLP

20

6-7....Interruption Function

GPM series PLC have interrupt function. There are two kinds of interrupt function: external

interrupt and time interrupt. Via interrupt function, some special program can be disposed, not

affected by PLC’s scan cycle.

6-7-1.External Interrupt

Input terminal X can be used as external interrupt’s input, each input terminal corresponds with an

eternal interrupt, the rising edge or falling edge of each input can both active the interrupt. The

interrupt subroutine is written behind the main program (Behind FEND command). When interrupt

activates, the main program will immediately stop executing, turn to execute the correspond interrupt

subroutine. After finish executing the interrupt subroutine, go on execute the main program.

Definition of external interrupt port::::

GPM-18

Pointer’s tag Input

terminal Rising interrupt Falling interrupt

Forbid interrupt

instruction

X2 I0000 I0001 M8050

X5 I0100 I0101 M8051

X10 I0200 I0201 M8052

Main program Main program

Interrupt subroutine

Input interruption

Page 152: CLP GPM-18 - metaltex.com.br · Você pode programar o CLP GPM tanto em linguagem Ladder como em logica Boleana (lista de instruções). Funções básicas O CLP

21

Interrupt Instruction

Enable Interruption [EI]、、、、Disable Interruption [DI] and Interrupt Return [IRET]

EI

FEND

I0000

IRET

I0100

IRET

END

《《《《Limitation of interrupt bound》》》》

EI

FEND

DI

Interruption

allow bound

Interruption①

Interruption②

Normally PLC is in the status of

disable interruption, if use EI instruction

of allow interruption, then in the process

of scan the program, if interrupt input

changes from OFF to ON, then execute

interrupt subroutine①、②, return to the

initial program after that.

The pointer (I****) used as

interruption tag should be behind ,

FEND command. D

isable in

terrup

tion

Via DI instruction, you could set

interruption disabled area.

In EI~DI area, interrupt input is

allowed.

When don’t need interrupt disabled,

please program only with EI instruction,

needn’t program with DI instruction.

Allo

w In

terrup

tion

Page 153: CLP GPM-18 - metaltex.com.br · Você pode programar o CLP GPM tanto em linguagem Ladder como em logica Boleana (lista de instruções). Funções básicas O CLP

22

《《《《Disable Interruption》》》》

EI

M8050

FEND

I0000

IRET

END

M0

En

able in

terrup

tion

In

terrup

t Su

bro

utin

e

To each input interruption, special relay

of disable interruption is given.

(M8050~M8052)

In the left program, if use M0 to make

M8050 “ON”, then disable the interrupt

input of route 0

Page 154: CLP GPM-18 - metaltex.com.br · Você pode programar o CLP GPM tanto em linguagem Ladder como em logica Boleana (lista de instruções). Funções básicas O CLP

23

6-7-2.Time Interrupt

Y0

FEND

I4010

INC D0

IRET

X0

M8000

Table of interruption tag::::

Interruption tag Disable interruption

instruction

Description

I40** M8056

I41** M8057

I42** M8058

I43** -

I44** -

I45** -

I46** -

I47** -

I48** -

I49** -

“**” denotes the time of time

interrupt. The bound is 1~99,unit is “ms”.

Function

and Action

In the condition of the main program’s executing cycle too long, if certain special

program should be executed; or in sequential control scan, a special program should

be executed every certain time, time interruption function is suitable. It could be not

affected by PLC’s scan cycle, execute the time interrupt program every Nms.

The defaulted time interruption status is open. Time interrupt subroutine is

similar with other interrupt subroutines. It must be written behind the main

program, start with I40xx instruction, end with IRET.

There are 10 routes time interruption, the denote method is: I40**~I49**. (**

means time interrupt’s time, the unit is ms.)E.g. I4010 means execute the first

route’s interruption every 10ms.

Page 155: CLP GPM-18 - metaltex.com.br · Você pode programar o CLP GPM tanto em linguagem Ladder como em logica Boleana (lista de instruções). Funções básicas O CLP

24

《《《《Limitation of interruption’s bound》》》》

FEND

I4010

IRET

DI

EI

《《《《Disable Interruption》》》》

EI

M8056

FEND

I4020

IRET

END

M0

Normally time interruption is in the status of enable.

Use EI、DI instructions can set enable interruption/ disable interruption bound.

See the preceding graph, in DI~EI section, all time interruption are disabled,

Enable interruption

Enable interruption

Disable interruption

Interrupt subroutine

En

able in

terrup

tion

Interru

pt S

ub

rou

tine

For the first 3 routes’ time interruption,

special relay of disable interruption is

given. (M8056~M8059)

In the left example program, if use M0

to make M8056 “ON”, then disable the

time interruption of route 0.

Page 156: CLP GPM-18 - metaltex.com.br · Você pode programar o CLP GPM tanto em linguagem Ladder como em logica Boleana (lista de instruções). Funções básicas O CLP

25

In this chapter, we give you some sample programs for your reference.

GPM series PLC is mini model、high speed、good performance PLC. Besides the independent using of I/O points,

pulse output and other functions could be used. So GPM series PLC could satisfy diverse control.

7....Applied Example Programs

7-1.Example of Pulse Output

7-2.Example of MODBUS Instructions

7-3.Example of Free Format Communication

Page 157: CLP GPM-18 - metaltex.com.br · Você pode programar o CLP GPM tanto em linguagem Ladder como em logica Boleana (lista de instruções). Funções básicas O CLP

26

Page 158: CLP GPM-18 - metaltex.com.br · Você pode programar o CLP GPM tanto em linguagem Ladder como em logica Boleana (lista de instruções). Funções básicas O CLP

27

7-1....Example of Pulse Output

E.g:The following is the program which realize continuous sending high-low pulse

The parameters:

Parameters of step motor:step square angle =1.8 degree/step, fractionlet =40,the pulse number of a

round is 8000。

High frequency pulse:max frequency is 100KHz,the total pulse number is 24000(3 rounds)

Low frequency pulse:Max frequency 10KHz,total pulse number is 8000(1 round)

Ladder program::::

Page 159: CLP GPM-18 - metaltex.com.br · Você pode programar o CLP GPM tanto em linguagem Ladder como em logica Boleana (lista de instruções). Funções básicas O CLP

28

Statement Program:

LD M8002 //Initially forth pulse coil

SET M0 //Set M0 ON

LDF M10 //M10 falling edge trigger condition

DMOV K100000 D200 //Transfer decimal data 100000 into double-word register D200

DMOV K24000 D210 // Transfer decimal data 24000 into double-word register D210

MOV K100 D220 // Transfer decimal data 100 into word register D220

LDP M10 //M10 rising edge trigger condition

DMOV K10000 D200 // Transfer decimal data 10000 into double-word register D200

DMOV K8000 D210 // Transfer decimal data 8000 into double-word register D210

LD M1 //M1 status trigger condition

OUT T0 K20 //100ms counter T0, time 2 seconds

LD T0 //T0 status trigger condition

SET M1 //set M1

SET M0 // set M1

LDF M8170 //M8170 falling edge trigger condition

RST M0 //reset M0

RST M1 // reset M1

ALT M10 //M10 status reverse

LD M0 //M0 status trigger condition

DPLSR D200 D210 D220 Y0 //Take value is D200 as frequency、value in D210 as pulse

number、value in D220 as speedup/speed-down time, send

pulse via Y0

Program description::::

When PLC changes from STOP to RUN, M8002 coil gets through a scan cycle, set high

frequency pulse parameters into D200、D210, set speedup/speed-down time into D220, set M0, the

motor start to speedup with high frequency and work 3 rounds, set coil M8170 at the same time; the

motor runs 3 rounds, the speed-down till stop, coil M8170 reset. Here reset M0, set M1, reverse M10

status, set low frequency parameters into D200、D210. the counter starts to delay with 2 seconds,

when reach this 2 seconds, M1 is reset, M0 is set again, the motor starts to run 1 round with low

frequency. After finish this 1 round, the motor starts to run with high frequency again! In this format,

the motor runs with high frequency and low frequency.

Page 160: CLP GPM-18 - metaltex.com.br · Você pode programar o CLP GPM tanto em linguagem Ladder como em logica Boleana (lista de instruções). Funções básicas O CLP

29

7-2....Example of MODBUS Instructions

E.g.:The following is the communication program of one master station and 4 slave stations

Each parameters:

The master station number is 1, slave stations numbers are 2,3,4,5. This example, we use COM 2:

Ladder program::::

Program description::::

When PLC changes from STOP to RUN, M8002 coil gets through a scan cycle. S0 flow open,

write master machine’s D10——D14 into No.2 slave machine’s D10——D14. after finish

communication, set M8138, at the same time write slave machine’s D15——D19 into master

machine’s D15——D19,set communication finish flag. Realize write and read to a slave station.

At this time flow S3 will judge with the slave station. If the station number is less than 5,station

number add 1,offset add 10;or else station number starts from number 2 station again.

Page 161: CLP GPM-18 - metaltex.com.br · Você pode programar o CLP GPM tanto em linguagem Ladder como em logica Boleana (lista de instruções). Funções básicas O CLP

30

7-3....Example of free format communication

This example is the free format program with DH107/DH108 series instruments:

I、、、、Interface specification

DH107/DH108 series instruments use asynchronism serial communication ports, the interface level fits

the standard of RS232C or RS485. the data format is 1 start bit, 8 bits data, no check bit, one or two

stop bits. Baud rate of communication transfer data could modified to be 1200~19200bit/s

II、、、、Format of communication instructions

DH107/108 instruments use Hex. data format to indicate each instruction code and data.

Read/write instruction:

Read::::The address code +52H((((82))))+parameter’s (to read) code+0+0+CRC check code

Write::::The address code +43H((((67))))+ parameter’s (to write) code +the write data’s low byte +the

write data’s high byte +CRC check code

Read instruction’s CRC check code is:parameter’s (To read) code *256+82+ADDR

ADDR is instrument’s ID value, the bound is 0~100 (please do not add 80H). CRC is the redundant

caused by the following operation: the preceding data operate with binary 16 bits integer plus. The

redundant is 2 bytes, the low byte is ahead, the high byte is behind

Write instruction’s CRC check code is::::parameter’s (to write) code *256+67+parameter’s (to

write) value +ADDR

The parameter’s (to write) value is indicated by Hex. binary integer

No matter write or read, the instruments will return the following data

The test value PV+ the given value SV+ the output value MV and alarm status + read/written

parameter’s value +CRC check code

PV、SV and the read parameter’s value should be integer format, each engrosses 2 bytes, MV

engrosses one byte, the data bound is 0~220, the alarm status engrosses one byte, CRC check code

engross 2 bytes, the total is 10 bytes.

CRC check code is PV+SV+((((alarm status *256+MV))))+parameter’s value +ADDR,,,,the redundant

caused by the integer plus

(the detailed format, please refer to AIBUS communication protocol description) .

Page 162: CLP GPM-18 - metaltex.com.br · Você pode programar o CLP GPM tanto em linguagem Ladder como em logica Boleana (lista de instruções). Funções básicas O CLP

31

III、、、、Compile communication program

After power on, the program read the current temperature value every 40ms. In this period the user

could also write the set temperature value.

Data area definition:send data buffer area: D10~D19

Accept data buffer area: D20~D29

Instrument’s station ID: D30

Read command’s value: D31=52 H

Write command’s value: D32=43 H

Parameter’s code: D33

Temperature setting: D34

CRC check code: D36

Temperature display: D200,D201

Format of sending data: 81H 81H 43H 00H c8H 00H 0cH 01H (display of the current temperature)

Setting of communication parameters: baud rate: 9600,8 bits data bit, 2 bits stop bit, no check.

Set FD8220=255;FD8221=5。

Note ( both the host machine and the slave machine should use the version higher than V2.4)

Program::::

Page 163: CLP GPM-18 - metaltex.com.br · Você pode programar o CLP GPM tanto em linguagem Ladder como em logica Boleana (lista de instruções). Funções básicas O CLP

32

Page 164: CLP GPM-18 - metaltex.com.br · Você pode programar o CLP GPM tanto em linguagem Ladder como em logica Boleana (lista de instruções). Funções básicas O CLP

33

D32: write command value

D34: temperature setting

Page 165: CLP GPM-18 - metaltex.com.br · Você pode programar o CLP GPM tanto em linguagem Ladder como em logica Boleana (lista de instruções). Funções básicas O CLP

34

Page 166: CLP GPM-18 - metaltex.com.br · Você pode programar o CLP GPM tanto em linguagem Ladder como em logica Boleana (lista de instruções). Funções básicas O CLP
Page 167: CLP GPM-18 - metaltex.com.br · Você pode programar o CLP GPM tanto em linguagem Ladder como em logica Boleana (lista de instruções). Funções básicas O CLP

36

This chapter gives some auxiliary information of GPM series PLC.

8....Appendix

8-1.List of special auxiliary relay, special data register

8-2.List of Special FLASH data register SFD

8-3.Brief Introduction of GPM series PLC

Page 168: CLP GPM-18 - metaltex.com.br · Você pode programar o CLP GPM tanto em linguagem Ladder como em logica Boleana (lista de instruções). Funções básicas O CLP

37

8-1....List of special auxiliary relay、、、、special data register

ID Function Description

M8000 Working normally

ON coil

PLC be ON when

running

M8001 Working normally

OFF coil

PLC be OFF when

running

M8002 Initial positive

pulse coil

The first scan cycle is

ON when PLC starts

running

M8003 Initial negative

pulse coil

The first scan cycle is

OFF when PLC starts

running

M8005 Battery voltage too

low Act when battery voltage abnormal too low

ID Function Description

D8002 Register’s capacity 2…2K steps;4…4K steps;8…8K steps

D8005 Battery voltage 0.1V unit

Special soft unit’s type and its function

PC status((((M))))

PC status((((D))))

Page 169: CLP GPM-18 - metaltex.com.br · Você pode programar o CLP GPM tanto em linguagem Ladder como em logica Boleana (lista de instruções). Funções básicas O CLP

38

ID Function Description

M8010

M8011 Shake with the cycle of 10ms

5ms

5ms

M8012 Shake with the cycle of

100ms

50ms

50ms

M8013 Shake with the cycle of 1

0.5s

0.5s

M8014 Shake with the cycle of 1

30s

30s

M8018 Bits of year Defaulted is OFF(OFF:2;ON:4)

ID Function Description

M8020 Zero When plus/minus operation result is 0

M8021 Borrow When borrow occurs in minus operation

M8022 Carry When carry occurs in plus operation or overflow

occurs in bit shift operation

M8023

M8026 RAMP mode

M8029

Clock((((M))))

Flag ((((M))))

Page 170: CLP GPM-18 - metaltex.com.br · Você pode programar o CLP GPM tanto em linguagem Ladder como em logica Boleana (lista de instruções). Funções básicas O CLP

39

ID Function Description

D8010 The current scan cycle Unit: 0.1ms

D8011 Mini value of scan time Unit: 0.1ms

D8012 Max vale of scan time Unit: 0.1ms

D8013 Second(clock) 0~59(BCD code format)

D8014 Minute(clock) 0~59(BCD code format)

D8015 Hour(clock) 0~23(BCD code format)

D8016 Date(clock) 0~31(BCD code format)

D8017 Month(clock) 0~12(BCD code format)

D8018 Year(clock) 2000~2099(BCD code format)

D8019 Week(clock) 0(Sunday)~6(Saturday)(BCD code format)

Clock ((((D))))

Page 171: CLP GPM-18 - metaltex.com.br · Você pode programar o CLP GPM tanto em linguagem Ladder como em logica Boleana (lista de instruções). Funções básicas O CLP

40

ID Function Description

Model Low byte D8021

Serial number High byte

Compatible system’s version number Low byte D8022

System’s version number High byte

Compatible model’s version number Low byte D8023

Model’s version number High byte

D8024

D8025

D8026

Model’s information

D8027

D8028

D8029

Suitable host machine version

Max 5 ASC and a“\0”

ID Function Description

M8030 PLC initializing

M8031 Non-retentive register clear

M8032 Retentive register clear

When driving this M, ON/OFF image memory of Y,

M, S, TC and the current value of T, C, D are all

cleared

M8033 Register retentive stop When PLC changes from RUN to STOP, leave all

content in image register and data register

M8034 All output forbidden Set PC’s all external contacts to be OFF status

M8038 Parameter setting Communication parameters set flag

Flag((((D))))

PC mode((((M))))

Page 172: CLP GPM-18 - metaltex.com.br · Você pode programar o CLP GPM tanto em linguagem Ladder como em logica Boleana (lista de instruções). Funções básicas O CLP

41

ID Function Description

D8030

D8031

D8032

D8033

D8034

D8035

D8036

D8037

D8038

ID Function Description

M8041

M8045 All output reset forbidden When mode shifting, all output reset are forbidden

M8046 STL status act When M8047 acts, act when any unit of S0~S999

turns to be ON

PC mode((((D))))

Step ladder((((M))))

Page 173: CLP GPM-18 - metaltex.com.br · Você pode programar o CLP GPM tanto em linguagem Ladder como em logica Boleana (lista de instruções). Funções básicas O CLP

42

ID Function Description

M8050 I000 Forbid input interruption 0

M8051 I010 Forbid input interruption 1

M8052 I020 Forbid input interruption 2

M8053 I030 Forbid input interruption 3

M8054 I040 Forbid input interruption 4

M8055 I050 Forbid input interruption 5

After executing EI, even interruption allowed, but when M acts at this time, the correspond input interruption couldn’t act separately

E.g. : when M8050 is ON, interrupt I000 is

forbidden

M8056 I40 Forbid time interruption 0

M8057 I41 Forbid time interruption 1

M8058 I42 Forbid time interruption 2

After executing EI, even interruption allowed, but

when M acts at this time, the correspond input

interruption couldn’t act separately

M8059 Interrupt forbidden Forbid all interruption

ID Function Description

M8067 Operation error Power on and STOP->RUN check

M8070 Scan overtime

M8071 No user program Interior codes checking error

M8072 User program error Execute code or collocate table check error

Interrupt((((M))))

Error check((((M))))

Page 174: CLP GPM-18 - metaltex.com.br · Você pode programar o CLP GPM tanto em linguagem Ladder como em logica Boleana (lista de instruções). Funções básicas O CLP

43

ID Function Description

D8067 Execute error code’s ID Error of divide

D8068 Lock occur error code’s ID

D8069

D8070 Scan time of overtime Unit: 1ms

D8074 ID of Excursion register D

D8097

D8098

ID Function Description

M8120

M8122 RS232 is sending flag

M8124 RS232 is receiving flag

M8125 Receive imperfect flag Receiving finished normally, but the

received data is less than the required

M8127 Receive error flag

M8128 Receive correct flag

COM1

M8129 Timeout judgment flag

M8130

M8132 RS232 is sending flag

M8134 RS232 is receiving flag

M8135 Receive imperfect flag Receiving finished normally, but the

received data is less than the required

M8137 Receive error flag

M8138 Receive correct flag

M8139 Timeout judgment flag

COM2

Error check((((D))))

Communication((((M))))

Page 175: CLP GPM-18 - metaltex.com.br · Você pode programar o CLP GPM tanto em linguagem Ladder como em logica Boleana (lista de instruções). Funções básicas O CLP

44

ID Function Description

D8120

D8121

D8123 Data number received by

RS232

D8126

D8127 Communication error code

7: hardware error 10: no start sign

8: CRC check error 11: no end sign

9: bureau ID error

12: communication time out

D8128

COM1

D8129

D8130

D8131

D8133 Data number received by

RS232

D8136

D8137 Communication error code

7: hardware error 10: no start sign

8: CRC check error 11: no end sign

9: bureau ID error

12: communication time out

D8138

COM2

D8139

Communication((((D))))

Page 176: CLP GPM-18 - metaltex.com.br · Você pode programar o CLP GPM tanto em linguagem Ladder como em logica Boleana (lista de instruções). Funções básicas O CLP

45

ID Counter

ID Function Description

M8150 C600 Count finished sign 24 segments count finished, flag is 1

M8151 C602 Count finished sign 24 segments count finished, flag is 1

M8152 C604 Count finished sign 24 segments count finished, flag is 1

M8153 C606 Count finished sign 24 segments count finished, flag is 1

M8154 C608 Count finished sign 24 segments count finished, flag is 1

M8155 C610 Count finished sign 24 segments count finished, flag is 1

M8156 C612 Count finished sign 24 segments count finished, flag is 1

M8157 C614 Count finished sign 24 segments count finished, flag is 1

M8158 C616 Count finished sign 24 segments count finished, flag is 1

M8159 C618 Count finished sign 24 segments count finished, flag is 1

M8160 C620 Count finished sign 24 segments count finished, flag is 1

M8161 C622 Count finished sign 24 segments count finished, flag is 1

M8162 C624 Count finished sign 24 segments count finished, flag is 1

M8163 C626 Count finished sign 24 segments count finished, flag is 1

M8164 C628 Count finished sign 24 segments count finished, flag is 1

M8165 C630 Count finished sign 24 segments count finished, flag is 1

M8166 C632 Count finished sign 24 segments count finished, flag is 1

M8167 C634 Count finished sign 24 segments count finished, flag is 1

M8168 C636 Count finished sign 24 segments count finished, flag is 1

M8169 C638 Count finished sign 24 segments count finished, flag is 1

High speed count((((M))))

Page 177: CLP GPM-18 - metaltex.com.br · Você pode programar o CLP GPM tanto em linguagem Ladder como em logica Boleana (lista de instruções). Funções básicas O CLP

46

Positive/negative count

ID

High

frequency

pulse ID

Function Description

M8170 PULSE_1 Sending pulse flag Be 1 at pulse sending

M8171 32 bits pulse sending

overflow flag Be 1 when overflow

M8172 Direction flag 1 is positive direction, the correspond

direction port is ON

M8173 PULSE_2 Sending pulse flag Be 1 at pulse sending

ID Counter’s ID Function Description

M8238 C300~C498 Control of positive/negative

count

0 is plus count, 1 is minus count, the

defaulted is 0 ……

Pulse output((((M))))

Page 178: CLP GPM-18 - metaltex.com.br · Você pode programar o CLP GPM tanto em linguagem Ladder como em logica Boleana (lista de instruções). Funções básicas O CLP

47

ID Counter’s ID Function Description

D8150 C600 The current segment (means

No.n segment)

D8151 C602 The current segment

D8152 C604 The current segment

D8153 C606 The current segment

D8154 C608 The current segment

D8155 C610 The current segment

D8156 C612 The current segment

D8157 C614 The current segment

D8158 C616 The current segment

D8159 C618 The current segment

D8160 C620 The current segment

D8161 C622 The current segment

D8162 C624 The current segment

D8163 C626 The current segment

D8164 C628 The current segment

D8165 C630 The current segment

D8166 C632 The current segment

D8167 C634 The current segment

D8168 C636 The current segment

D8169 C638 The current segment

High speed count((((D))))

Page 179: CLP GPM-18 - metaltex.com.br · Você pode programar o CLP GPM tanto em linguagem Ladder como em logica Boleana (lista de instruções). Funções básicas O CLP

48

ID

High

frequency

pulse ID

Function Description

D8170 PULSE_1 The low 16 bits of accumulated pulse number

D8171 The high 16 bits of accumulated pulse number

D8172 The current segment (means No.n segment)

D8173 PULSE_2 The low 16 bits of accumulated pulse number

D8174 The high 16 bits of accumulated pulse number

D8175 The current segment (means No.n segment)

Pulse output((((D))))

Page 180: CLP GPM-18 - metaltex.com.br · Você pode programar o CLP GPM tanto em linguagem Ladder como em logica Boleana (lista de instruções). Funções básicas O CLP

49

8-2....List of special FLASH data register SFD

1、、、、 I filter

Number Function Description

FD8000 X port, input filter time value Unit: ms

FD8002

FD8003

FD8004

FD8005

FD8006

FD8007

FD8008

FD8009

2、、、、 I mapping

Number Function Description

FD8010 X00 corresponds with I** X0 corresponds with the number of input image I**

FD8011 X01 corresponds with I**

FD8012 X02 corresponds with I** …… ……

FD8073 X77 corresponds with I**

3、、、、 O mapped

Number Function Description

FD8074 Y00 corresponds with I** Y0 corresponds with the number of input image O**

FD8075 Y01 corresponds with I**

FD8076 Y02 corresponds with I** …… ……

FD8137 Y77 corresponds with I**

4、、、、 I property

Number Function Description

FD8138

X00 property 0: positive logic;others: negative logic

FD8139 X01 property

FD8140 X02 property …… ……

FD8201 X77 property

Page 181: CLP GPM-18 - metaltex.com.br · Você pode programar o CLP GPM tanto em linguagem Ladder como em logica Boleana (lista de instruções). Funções básicas O CLP

50

5、、、、 Device’s power failure retentive area

Number Function Description

FD8202 Start tag of D power failure store area

FD8203 Start tag of M power failure store area

FD8204 Start tag of T power failure store area

FD8205 Start tag of C power failure store area

FD8206 Start tag of S power failure store area

6、、、、 Communication

Number Function Description

FD8210 Communicate mode 255 is free format,

1~254 bits modbus station ID

FD8211 Communicate format Baud rate,data bit,stop bit,checkout

FD8212 Judgment time of ASC

timeout Unit: ms

FD8213 Judgment time of reply

timeout

Unit: ms,if set to be 0, it means no timeout

waiting

FD8214 Start ASC High 8 bits be of no effect

FD8215 End ASC Low 8 bits be of no effect

COM1

FD8216 Free format setting

8/16 bits cushion,

with/without start bit,

with/without end bit,

FD8220 Communicate mode 255 is free format,

1~254 bits modbus station ID

FD8221 Communicate format Baud rate,data bit,stop bit,checkout

FD8222 Judgment time of ASC

timeout High 8 bits be of no effect

FD8223 Judgment time of reply

timeout Low 8 bits be of no effect

FD8224 Start ASC Unit: ms

FD8225 End ASC Unit: ms,if set to be 0, it means no timeout

waiting

COM2

FD8226 Free format setting

8/16 bits cushion,

with/without start bit,

with/without end bit

Page 182: CLP GPM-18 - metaltex.com.br · Você pode programar o CLP GPM tanto em linguagem Ladder como em logica Boleana (lista de instruções). Funções básicas O CLP

51

8-3....Brief Introduction of GMP Series PLC

8-3-1....Statements

GPM series PLC has the following applied instructions:

Sort Mnemonic Function

CJ Condition jump

CALL Call subroutine

SRET Subroutine return

STL Flow start

STLE Flow end

SET Open the assigned flow, close the current flow

ST Open the assigned flow, not close the current flow

FOR Start of a FOR-NEXT loop

NEXT End of a FOR-NEXT loop

Program

Flow

FEND First end

MOV Move

BMOV Block move

FMOV Fill move

FWRT FlashROM written

MSET Zone set

ZRST Zone reset

SWAP The high and low byte of the destinated devices are

exchanged

Data

Move

XCH Exchange

ADD Addition

SUB Subtraction

MUL Multiplication

DIV Division

INC Increment

DEC Decrement

MEAN Mean

WAND Word And

WOR Word OR

WXOR Word exclusive OR

CML Compliment

Data

Operation

NEG Negative

Page 183: CLP GPM-18 - metaltex.com.br · Você pode programar o CLP GPM tanto em linguagem Ladder como em logica Boleana (lista de instruções). Funções básicas O CLP

52

8-3-2....Soft unit’s bound:

Soft unit’s bound:

Mnemonic Name Bound Points

X Input X000~X007 8 points

Y Output Y000~Y010 10 points

M0~M319 320 M Interior relay

M8000~M8370 for special using 256

S Flow S0~S31 32

T0~T23:100ms not accumulation

T100~T115:100ms accumulation

T200~T223:10ms not accumulation

T300~T307:10ms accumulation

T400~T403:1ms not accumulation

T Timer

T500~T503:1ms accumulation

80

C0~C23:16 bits forth counter

C300~C315:32 bits forth/back counter C Counter

C600~C634:high-speed counter

635

D0~D149 150

For special usage D8000~D8029

For special usage D8060~D8079

For special usage D8120~D8179

For special usage D8240~D8249

For special usage D8306~D8313

D Data Register

For special usage D8460~D8479

512

FD0~FD411 412

For special usage FD8000~FD8009

For special usage FD8210~FD8229

For special usage FD8306~FD8009

For special usage FD8000~FD8313

FD FlashROM

Register

For special usage FD83500~FD8409

98

Page 184: CLP GPM-18 - metaltex.com.br · Você pode programar o CLP GPM tanto em linguagem Ladder como em logica Boleana (lista de instruções). Funções básicas O CLP

IGIGIGIG----SoftwareSoftwareSoftwareSoftware

Manual Operação

Page 185: CLP GPM-18 - metaltex.com.br · Você pode programar o CLP GPM tanto em linguagem Ladder como em logica Boleana (lista de instruções). Funções básicas O CLP

2

Produtos Eletrônicos Metaltex Ltda.

Capítulo 1 - Sumário

1-1. Função GPMGPMGPMGPM----18181818 (CLP (CLP (CLP (CLP----IHM Incorporada) IHM Incorporada) IHM Incorporada) IHM Incorporada) é um CLP (Controlador Lógico Programável) com IHM (Interface homem

máquina) e teclas de funções incorporadas em um único hardware. Com ele é possível mostrar textos e indicações,

tais como, lâmpadas, monitorar ou modificar valores de registradores e ou relés internos do CLP. Dessa forma o

operador pode controlar facilmente sua máquina ou processo.

Abaixo as vantagens da GPMGPMGPMGPM----18181818:

Programa de edição da IHM (IG-Software), os programas são editados no seu computador, entrada de letras e

caracteres que controlam valores do CLP, uso da porta de comunicação RS-232 para descarregar seus

programas.

O protocolo de comunicação pode ser descarregado no modelo junto com os dados da IHM, sem a necessidade

de compilar o programa do CLP.

Comunicação com a maioria dos CLP´s populares no mercado, como os Mitsubishi FX series, Panasonic FP

series, Omron C series, Siemens S7-200 series, Koyo SG series etc.

Função de senha de proteção.

Função de lista de alarmes em tempo real, mostrando as informações dos alarmes linha por linha.

26 teclas de funções, cada tecla podendo ser definida sua operação.

Teclas sensíveis ao toque “touch”, facilitando o controle (para alguns modelos).

Comunicação RS232/RS485.

Vetores de texto e botões para facilitar na construção do programa.

Display de cristal líquido LCD com “backlight”, 24 caracteres × 4 linhas. Com o uso dos vetores é possível

visualizar mais informações!

Frontal para grau de proteção IP65, á prova d, á prova de óleo.

1-2 Especificações Gerais

1. Especificações Elétricas Alimentação 24VCC Consumo 3W

Queda de Energia Momentânea < 20ms Tensão de Isolação 1000VCA - 10mA 1 minuto Impedância de Entrada 500VCC ~ 10MΩ

2.Condições de Operação Temperatura de operação 0~50°C Temperatura de armazenamento –10~60°C Umidade máxima 20~85% Tolerância de vibração 10~25Hz (X, Y, Z cada direção 2G por 30 minutos). Interferência de ruídos 1000Vpp Ambiente do ar Não corrosível Grau de proteção IP65

Page 186: CLP GPM-18 - metaltex.com.br · Você pode programar o CLP GPM tanto em linguagem Ladder como em logica Boleana (lista de instruções). Funções básicas O CLP

3

1-3 Descrição das Partes

A interface da GPM-18 (CLP-IHM incorporada) foi inserida na parte frontal do CLP com 26 botões “touch”, teclas

sem resistências mecânicas de longa duração, seguras e com alto desempenho. As teclas de direção mudam

rapidamente as telas e os estados dos registrados; As teclas numéricas realizam as entradas ou modificações dos

registradores. As teclas de funções possuem funções básicas, sendo facilmente definidas quando o projeto esta sendo

desenvolvido.

Page 187: CLP GPM-18 - metaltex.com.br · Você pode programar o CLP GPM tanto em linguagem Ladder como em logica Boleana (lista de instruções). Funções básicas O CLP

4

1-4 Tabela das Funções Básicas dos Botões

Teclas Funções básicas

Não importa o que é mostrado na tela, uma vez pressionado está tecla, o sistema será retornado a tela inicial. O sistema direciona para a tela definida pelo desenvolvedor (a tela inicial padrão é a tela de No 1).

Retorna para a tela anterior.

Avança para a próxima tela.

Pressione está tecla para modificar os valores dos registros, o valor corrente a ser modificado é mostrado com a cor invertida. O bit a ser modificado é mostrado piscando. Se a tela corrente não existir nenhum registro para alteração, a tecla fica sem função. Antes de ser pressionado a tecla [ENT], for pressionada a tecla [SET] novamente, o valor corrente a ser modificado é cancelado, saltando para o próximo registro.

Confirma o valor modificado no registrador, e continua a modificar os próximos registros. Depois do último registrador modificado na tela, sai do modo alteração dos registros.

Exibe lista de alarmes ativos.

Limpa o valor de um registrador que está sendo editado.

Define valores positivos e negativos, quando o registrador está sendo editado.

Teclas numéricas (0-9), quando o registrador está sendo modificado, essas teclas alteram para o valor correspondente que será inserido no registro.

Teclas de funções configuráveis em cada tela F1~F8

Page 188: CLP GPM-18 - metaltex.com.br · Você pode programar o CLP GPM tanto em linguagem Ladder como em logica Boleana (lista de instruções). Funções básicas O CLP

5

1-5 GPM séries Definição da Porta de Comunicação

PORTA 1((((RS-232))))

GPM-18

Pinagem Definição

1 NC 2 RXD 3 TXD 4 NC 5 GND 6 NC 7 RTC 8 NC 9 NC

Configuração do Cabo de Programação

GPM-18((((DB 9 Pinos - Fêmea)))) PC((((DB 9 Pinos - Macho))))

RXD 2 2 RXD TXD 3 3 TXD RTS 7 7 CTS

GND 5 5 GND

Page 189: CLP GPM-18 - metaltex.com.br · Você pode programar o CLP GPM tanto em linguagem Ladder como em logica Boleana (lista de instruções). Funções básicas O CLP

6

1-6 Dimensões e Instalação

Dimensões:

Tamanho do furo para a instalação:

12116211156.5 172

6 7 8 9

5432

1 0

1 2 3 4

8765

164 113

Page 190: CLP GPM-18 - metaltex.com.br · Você pode programar o CLP GPM tanto em linguagem Ladder como em logica Boleana (lista de instruções). Funções básicas O CLP

7

Aviso importante para instalação::::

1-As dimensões para a instalação devem ser respeitadas, para evitar espaços maiores. Não precisa ser

muito apertado o furo para não forçar o painel.

2-Forçar o equipamento pode danificá-lo.

3-Os quatro fixadores devem ser pressionados por iguais.

4-Após a instalação, remova a película protetora da IHM.

Page 191: CLP GPM-18 - metaltex.com.br · Você pode programar o CLP GPM tanto em linguagem Ladder como em logica Boleana (lista de instruções). Funções básicas O CLP

8

Capítulo 2 - Ferramenta de Edição

2-1 Sumário Básico do Programa “IG-Software”

“IG-Software” é uma ferramenta de edição da IHM IG-20 e do CLP/IHM GPM-18. É executado nos sistemas

operacionais: Windows98 / NT / XP. Esta ferramenta é de fácil uso, criado para desenvolvimento das interfaces

gráficas entre a máquina e o usuário.

2-1-1 Instalação e Desinstalação da Ferramenta “IG-Software”

“IG-Software” não precisa de instalação. Copie a pasta contendo o programa em uma unidade de disco, então,

execute o arquivo “IG-Software.exe”. Para desinstalar, apenas apague a pasta com o programa. Esta ferramenta

de edição deve trabalhar diretamente sobre os sistemas operacionais Windows98 / NT / XP.

2-1-2 Projetos e Telas

Todas as telas criadas são compiladas e salvas no projeto. A base dos projetos são as telas. Para cada tela é

possível criar um design, realizar funções, saltar de uma tela para outra facilmente.

2-1-3 Conteúdo das Telas

Após executar o arquivo “IG-Software.exe”, você poderá criar um novo projeto ou abrir um projeto existente. Cada

tela pode ter textos、lâmpadas de indicação, chaves, exibir dados, saltar telas, barras gráficas, gráficos de linhas,

gráfico de bits (figuras), textos dinâmicos, etc. Facilidade na criação dos saltos das telas. O operador pode realizar

monitoramento de dados, parâmetrizar, teclas de controles, monitorar lista de alarmes, etc.

2-1-4 Seqüência de Uso do Programa “IG-software”

Seqüência básica de uso:

Abrir o program

a “IG-

Softw

are”

Criar ou abri um

novo

projeto

Escolher o tipo de IH

M

Escolher o tipo de C

LP

Desenvolver as telas

Salvar o projeto

Descarregar o program

a

na IHM

Executar o program

a

Page 192: CLP GPM-18 - metaltex.com.br · Você pode programar o CLP GPM tanto em linguagem Ladder como em logica Boleana (lista de instruções). Funções básicas O CLP

9

2-2 Ambiente de Programação

2-2-1 Tela Principal de Programação

Após executar o programa “IG-Software”, a tela abaixo será exibida.

Área de apresentação da

IHM para o usuário

Gerenciador

de telas

Menu Barra de ferramentas

Propriedades de objeto.

Se nenhum modelo for

escolhido, as propriedades

ficam invisíveis.

Ambiente de Programação::::

No topo desta ferramenta de edição, existe o menu e a barra de ferramentas;Na coluna da esquerda, são

apresentados os números que representam as telas, na parte inferior desta coluna, existem duas caixas [Nova]

e [Apagar], sendo usados para incluir ou excluir uma tela..

No centro da ferramenta de edição, existe a área editável. A grade de alinhamento pode ser

desabilitada. O programador move ou insere os componentes dentro da área com os pontos, representando o

que o usuário irá visualizar. O programador clica e arrasta o componente para posicionar na tela, o

movimento é dado de 4 em 4 pontos.

Objetos de criação.

Se nenhum modelo

for escolhido, as

propriedades ficam

invisíveis.

Page 193: CLP GPM-18 - metaltex.com.br · Você pode programar o CLP GPM tanto em linguagem Ladder como em logica Boleana (lista de instruções). Funções básicas O CLP

10

2-3 Descrição dos Componentes

Abaixo é descrito algumas teclas e suas funções:

Teclas Funções

Cria um novo projeto.

Abre um projeto salvo.

Salva o projeto atual.

Recorta o texto na área da tela.

Copia o texto na área da tela.

Cola o texto na área da tela.

Cria uma nova tela, esta função é igual ao botão [Nova].

Mostra os atributos da tela atual.

Copia uma tela para outra tela.

Apaga a tela atual, esta função é igual ao botão [Apagar].

Entra com informações da lista de alarme, toda informação de alarmes é interligado com um sinal de relé ou bit.

Atalho para configurações gerais

Define as teclas de funções para todas as telas.

Por meio de uma porta de comunicação RS232, o projeto desenvolvido é enviado para a IHM (GPM-18 (CLP-IHM incorporada) ou IG-20, apenas IHM).

Abaixo é descrito uma introdução dos componentes de criação:

Componentes Funções

Entrada de caracteres e sinais especiais.

Textos true-type (suporte para todas as linguagens), padrão Windows. Crie suas telas com textos variados e diferentes.

Registrador, janela de entrada e monitoração de dados (O registrador é uma área de memória do CLP).

Lâmpada de indicação mostra o estado dos relés internos nos CLP’s (LIG/DES).

Tecla função, as 26 teclas do GPM-18 (CLP-IHM incorporada) são definidas selecionando este componente. Neste componente indica com irá operar a tecla, como salto de tela, chave de controle, etc.

Linhas de gráficos, gráficos de controles de processos, evolução de produção, Configure adequadamente para apresentar ao usuário a evolução de uma linha.

Gráfico de barras, usado para mostrar ao usuário que o sistema está processando uma informação, mostrar vazão﹑pressão﹑nível de líquidos, etc. Também altura, largura e direção.

Insere uma figura do arquivo (bmp).

Textos dinâmicos apresentam diversos textos nas máquinas, posicionado o operador informações dinâmicas do processo.

Textos dinâmicos, padrão Windows. Crie textos dinâmicos com propriedades diferentes.

Criação de novas teclas de toque (suporte para todas as linguagens). Insira novas teclas na IHM.

Page 194: CLP GPM-18 - metaltex.com.br · Você pode programar o CLP GPM tanto em linguagem Ladder como em logica Boleana (lista de instruções). Funções básicas O CLP

11

2-5 Descrição das Propriedades dos Componentes

Aqui, é descrito o modo de uso de cada componente..

2.5.1. Texto

Pressione a tecla um retângulo será apresentado na área, mova o cursor até o local adequado para a

apresentação do texto. Confirme o local clicando com o botão esquerdo do mouse, para cancelar, clique com o

botão direito. Após sua confirmação a mensagem “Texto” será apresentada. Altere o texto de acordo com seu

projeto.

Posição

Apresenta a direção de origem do ponto superior e esquerda em uma coordenada.

X: Posição horizontal do texto.

Y: Posição vertical do texto.

Fonte

Dupla:O dobro do tamanho da fonte atual do objeto selecionado.

Inversa:Inverte as cores do texto com o plano de fundo.

Texto

Texto a ser visualizado na tela da IHM.

Obs.::::Para todos os objetos de criação existe as propriedades “posição” e “fonte”. Portanto nas

propriedades abaixo não mencionaremos mais esses dois itens.

Page 195: CLP GPM-18 - metaltex.com.br · Você pode programar o CLP GPM tanto em linguagem Ladder como em logica Boleana (lista de instruções). Funções básicas O CLP

12

2.5.2. Texto Formatado

Pressione a tecla , um retângulo será apresentado na área, mova o cursor até o local adequado para a apresentação

do texto. Confirme o local clicando com o botão esquerdo do mouse, ou para cancelar, clique com o botão direito.

Após sua confirmação a mensagem “Texto” será apresentada. Este componente é similar ao anterior, a diferença está

na possibilidade de alterar a fonte e o tamanho do texto. Flexibilizando o desenvolvimento das telas.

Fonte

Apresenta as formatações do próprio Windows.

Page 196: CLP GPM-18 - metaltex.com.br · Você pode programar o CLP GPM tanto em linguagem Ladder como em logica Boleana (lista de instruções). Funções básicas O CLP

13

2.5.3. Texto Dinâmico.

Clique na tecla , um retângulo será apresentado na área, mova o cursor até o local adequado para a apresentação

do texto. Confirme o local clicando com o botão esquerdo do mouse, ou para cancelar, clique com o botão direito.

Após sua confirmação a mensagem “Texto Dinâmico” será apresentada. Semelhante aos “Textos” anteriores,

porém, o “Texto Dinâmico” está vinculado com um registrador do controlador lógico.

Ao modificar o valor do registrador, o texto é modificado automaticamente de acordo com o índice de criação dos

textos!

Configuração

No do CLP:Número que identifica o CLP em uma estação. Quando existir diversos periféricos em

uma rede de comunicação (Ex.: Modbus), este número identificará a IHM na rede. Usualmente o valor

padrão é o 1, Quando estiver com mais de uma IHM ou outro periférico, identifique-o.

Campo:Endereço do registrador que terá o controle do “Texto Dinâmico”. Este endereço é

correspondente ao CLP que foi configurado.

Modo:Tipo do dado, normalmente não é necessário modificar.

Índice

Textos

Page 197: CLP GPM-18 - metaltex.com.br · Você pode programar o CLP GPM tanto em linguagem Ladder como em logica Boleana (lista de instruções). Funções básicas O CLP

14

Formatação:Tabela dos nomes que serão apresentados. Cada valor a esquerda representa o índice do

texto. O valor que existir no registrador escolhido representa o texto que se encontra na tabela.

Por exemplo: Na figura acima o CLP escolhido tem o registrador chamado D0, se este registrador estiver com o valor

igual á 1, o texto que será exibido é aquele que se encontra na tabela. Neste caso, o texto exibido será o “Texto Dinâmico

2”.

2.5.4. Texto Dinâmico com Formatação

Pressione a tecla , Adicione o Texto Dinâmico com formatação. Repita os passos conforme escrito anteriormente

para o objeto “Texto Dinâmico”. Texto Dinâmico com formatação é similar ao Texto Dinâmico, a diferença está na

possibilidade de formatar a fonte e o tamanho do texto. A formatação ocorre para todos os textos.

Page 198: CLP GPM-18 - metaltex.com.br · Você pode programar o CLP GPM tanto em linguagem Ladder como em logica Boleana (lista de instruções). Funções básicas O CLP

15

2.5.5. Indicador (Lâmpada)

Pressione a tecla e coloque o desenho na área de apresentação. Indique o endereço do Bit do controlador que

indicará o estado “Ligado/Desligado”. O indicador de lâmpada é freqüentemente utilizado para indicação dos estados das

saídas, alarmes, mensagens, etc.

Configuração

Número correspondente do CLP na rede, e o bit ou relé de referência do controlador lógico.

Formatação

Formato:A lâmpada de indicação pode ser quadrada ou redonda.

Normal:Quando o bit ou o relé está em “1”, a lâmpada está em negrito; Quando o bit ou o relé

está em “0”, a lâmpada está transparente ou oca. Inversa::::Quando o bit ou o relé está em “1”, a

lâmpada apresenta uma figura transparente ou oca; Quando o bit ou o relé está em “0”, a lâmpada

está em negrito.

Page 199: CLP GPM-18 - metaltex.com.br · Você pode programar o CLP GPM tanto em linguagem Ladder como em logica Boleana (lista de instruções). Funções básicas O CLP

16

2.5.6. Gráfico de Barras

Pressione a tecla e coloque o desenho na área de apresentação. A barra de gráfico é utilizada para visualizar

diretamente valores analógicos, como fluxos de pressão, nível de líquidos, etc. Altura, largura. a e direção podem

ser configuradas.

Medidas

Determina a altura e a largura da barra de gráfico.

Configuração

No do CLP:Número do CLP conectado.

Número do registrador

Campo:Registrador correspondente que representará a barra de gráficos.

Modo:data format (include Decimal、HEX/BCD,signed etc.)

Formatação

Valores máximos:Os valores máximos e mínimos da barra de gráfico são determinados numa

escala de 0 a 100%, com referência aos valores informados.

Sentido:Determina a direção da barra de gráfico, esquerda, direita, para cima ou para baixo.

Page 200: CLP GPM-18 - metaltex.com.br · Você pode programar o CLP GPM tanto em linguagem Ladder como em logica Boleana (lista de instruções). Funções básicas O CLP

17

2.5.7. Campo de Registrador

Pressione a tecla e coloque o desenho na área de apresentação. Visualiza os valores de registradores internos

do CLP.

Configuração

No do CLP:Número do CLP conectado.

Campo:Identifica o registrador que será apresentado. Por exemplo, o valor na figura acima que será

apresentado na IHM é do registrador D0.

Quando a opção “Edição” estiver selecionada, é possível fazer alterações do valor do registrador:

Senha: Habilita ou desabilita o uso de senha. Quando houver a necessidade de alteração do

valor do registrador com segurança. Para maiores detalhes, veja os próximos capítulos.

Limite Máx/Mín:Habilite a caixa “Limite” para configurar os limites mínimo e máximo do

registrador. Isto faz com que a IHM proteja os valores de entradas de dados para o

registrador. Por exemplo, quando inserido o valor máximo para 9000, e o mínimo para 0.

Somente será modificado o valor do registrador no CLP quando 0<valor<9000.

Page 201: CLP GPM-18 - metaltex.com.br · Você pode programar o CLP GPM tanto em linguagem Ladder como em logica Boleana (lista de instruções). Funções básicas O CLP

18

Formatação

Dígitos: Define o máximo de dígitos que serão apresentados.

Decimal: Define a quantidade de casas decimais após a vírgula que será apresentada.

Zero: Define se apresenta ou não zeros á esquerda.

Modo: Aqui você define o modo de apresentação do dado do registrador, decimal ou hexadecimal.

Nota::::

Quando a tecla “Set” é pressionada, ou, por meio de toque, o valor do registrador pode ser

alterado desde que habilitado a opção edição. As cores são invertidas e o teclado de dígitos será

utilizado para alterar o valor do processo.

Page 202: CLP GPM-18 - metaltex.com.br · Você pode programar o CLP GPM tanto em linguagem Ladder como em logica Boleana (lista de instruções). Funções básicas O CLP

19

2.5.8. Gráfico de Tendências

Clique na tecla e coloque o gráfico na área de apresentação. O gráfico de tendências demonstra gradativamente

uma evolução no processo de uma indústria. Dessa forma o operador pode visualizar como anda o processo.

Medidas

Estes valores determinam à altura e largura do gráfico de tendências.

Registradores

No do CLP:Endereço do CLP na comunicação.

Campo:Endereço correspondente para gerar o gráfico de tendências.

Modo:Formato do dado (incluindo decimal, HEX/BCD, com ou sem sinal).

Formatação

Máximo:Corresponde ao valor máximo do registrador, equivalente á 100% em escala do gráfico

de tendência.

Mínimo:Corresponde ao valor mínimo do registrador, equivalente á 0% em escala do gráfico de

tendência.

Page 203: CLP GPM-18 - metaltex.com.br · Você pode programar o CLP GPM tanto em linguagem Ladder como em logica Boleana (lista de instruções). Funções básicas O CLP

20

Amostras (número de pontos) :Da esquerda para a direita, número de pontos que serão

apresentados no gráfico de tendências.

Quanto maior o número de pontos, mais detalhado o gráfico é apresentado.

Intervalo:Tempo de leitura para construção do gráfico.

2.5.9. Teclas de função

Clique na tecla e coloque o componente na área de apresentação. Este componente direciona a modificação

do registro a partir da configuração. Uma tecla de função pode ser usada no projeto constantemente. Este

componente orienta o sentido de uso das teclas externas no sistema de controle. Geralmente em uma aplicação,

este componente é usado junto com um texto, lâmpadas e/ou outros componentes. Este componente apresenta

três funções (alterar “bits”, saltar telas, alterar dados). Dessa forma é possível escolher uma das três funções.

Veja abaixo os detalhes das três funções:

Nota::::É possível apresentar mais de uma curva de tendências. Se o projeto precisar apresentar mais

de uma curva, crie mais gráficos de tendências na tela, e alterne em um gráfico por vez.

Page 204: CLP GPM-18 - metaltex.com.br · Você pode programar o CLP GPM tanto em linguagem Ladder como em logica Boleana (lista de instruções). Funções básicas O CLP

21

Primeiro, alterar “bits”.

Função:

Tecla:Por padrão, a tecla “F1” é apresentada, ou clique, na caixa e escolha a tecla adequada para o seu

projeto. Veja abaixo a caixa.

Indic. :Apresenta ou a não a figura do dedo apontando para a tecla escolhida.

Transparente:Oculta ou não a tecla o indicador na tela. Quando esta opção é seleciona, a tecla de função

escolhida, simplesmente não é apresentada na tela, apenas a função dada.

Senha:Necessário à entrada de senha ou não. Se esta opção for ativada, uma senha será solicitada antes

de executar a função.

Opções: “Bit” ou relé、saltar tela、alterar dados (“Word”) ;

A função padrão inicial é a “Bit” ou relé.

“Bit” ou relé

Num. do CLP:Representa o endereço do equipamento em uma rede.

“Bit”. :Endereço do “Bit” ou relé interno do CLP. A ação da tecla corresponde à alteração do estado do

“Bit” ou relé, de acordo com a seleção abaixo descrita.

Função dos itens:

Seta LIGADA (O “Bit” ou relé selecionado quando pressionada a tecla é ligado).

Seta DESLIGADO (O “Bit” ou relé selecionado quando pressionada a tecla é desligado).

Inverte (O “Bit” ou relé a cada pulso é invertido o seu estado atual).

Pulso momentâneo (O “Bit” ou relé mantém a saída LIGADA enquanto o botão estiver

pressionado).

Obs.: As “Teclas de função” possuem diversos recursos, com parâmetros diferentes.

TECLA、INDIC. 、TRANSP、SENHA , esse parâmetros são válidos para todas as teclas de

função. Veja abaixo a descrição dos parâmetros..

Page 205: CLP GPM-18 - metaltex.com.br · Você pode programar o CLP GPM tanto em linguagem Ladder como em logica Boleana (lista de instruções). Funções básicas O CLP

22

Segundo, saltando telas.

Observe na figura acima, do lado esquerdo é apresentado às telas que foram criadas.

É possível dar um nome para a tela criada digitando no campo “DESCRIÇÃO” nas propriedades da tela.

As telas podem ser alternadas sem que seja necessário criar um botão que orienta. Para isto basta pressionar as

teclas “Seta acima” e “Seta abaixo”.

As telas serão saltadas de acordo com a configuração definida nas “Propriedades da tela”.

Propriedades da tela

Descrição: Nome para identificação da tela construída.

Tela anterior: Define para qual tela será direcionada, quando for pressionado o botão “Seta acima”.

Próxima tela: Define para qual tela será direcionada, quando for pressionado o botão “Seta abaixo”.

É possível criar atalhos usando as “Funções de teclado”, veja no desenho abaixo.

Page 206: CLP GPM-18 - metaltex.com.br · Você pode programar o CLP GPM tanto em linguagem Ladder como em logica Boleana (lista de instruções). Funções básicas O CLP

23

Observe que foram criadas três telas, conforme a descrição do lado esquerdo.

Na tela principal foi inserido um texto para indicar o significado da tecla de atalho “F4”.

Agora resta apenas configurar como o botão irá interagir. Segue abaixo a descrição das configurações:

Função

Quando a opção “saltar tela” é selecionada, uma caixa na parte inferior é mostrada para definir as

características do salto.

Tela

Definições:

Telas:Salta para a tela definida na caixa do lado direito.

Senha:Salta para o usuário digitar a senha.

Lista de alarme:Salta para a lista de alarmes.

Data/Hora: Salta para a tela de configuração de data/hora.

Page 207: CLP GPM-18 - metaltex.com.br · Você pode programar o CLP GPM tanto em linguagem Ladder como em logica Boleana (lista de instruções). Funções básicas O CLP

24

Terceira e Ultima Função “Word”.

Função

Se for selecionada a caixa ”Word”, As propriedades abaixo também poderão se configuradas.

Configuração

No. do CLP:Endereço correspondente na rede.

Campo:Endereço do registrador interno do CLP a se alterado.

Qtd:Quantidade de dados a partir do endereço definido, máximo de 2 registradores.

Valor:Esse valor e sobreposto no campo do registrador escolhido.

Toda vez que a tecla escolhida for pressionada, o valor definido na caixa “Valor” e colocado na memória

definida pela caixa “Campo”. Isto é muito utilizado quando o desenvolvedor necessitar zerar uma contagem ou

substituir o valor de algum registrador com apenas um toque do usuário.

Page 208: CLP GPM-18 - metaltex.com.br · Você pode programar o CLP GPM tanto em linguagem Ladder como em logica Boleana (lista de instruções). Funções básicas O CLP

25

2.5.10. Figuras

Figuras podem ser inseridas na IHM. Muito usado em apresentações, desenhos, introduções etc. Em geral o seu

uso é feito para a apresentação do LOGO, caracteres especiais, fontes artísticas, etc.

Clique no componente , uma caixa de diálogo será mostrada. Selecione a figura desejada, e então clique em

abrir. A figura será colocada na tela da IHM.

Nota::::Para usar este componente é necessário algumas habilidades. No desenvolvimento dos

projetos, usualmente algumas figuras precisam ser editadas. Ajuste o tamanho da figura e então

adicione na tela da IHM.

Normalmente, para a série GP, o tamanho não pode ultrapassar 180×60 “pixels”.

Com relação às figuras com LOGO, tamanho não pode ultrapassar 35×35 “pixels”.

Com relação á desenho, tamanho não pode ultrapassar 60×60 “pixels”.

Page 209: CLP GPM-18 - metaltex.com.br · Você pode programar o CLP GPM tanto em linguagem Ladder como em logica Boleana (lista de instruções). Funções básicas O CLP

26

2.5.11. Tecla de Toque “Touch”

Clique na tecla e coloque na área da IHM. Este componente define uma tecla por toque na IHM. A “tecla por

toque” é uma ferramenta a mais no desenvolvimento do projeto para a criação de mais teclas. A “tecla por toque”

possibilita a interação direta com o usuário a cada tela criada.

Função (Os conceitos são os mesmo da função tecla).

“Bit” ou relé (Os conceitos são os mesmo da função “Bit” ou relé).

Dica::::Quando usar na tela a função “tecla por toque”, você deverá saber o tamanho dos caracteres que

estarão dentro do botão. Portanto, o tamanho do botão será proporcional (de acordo com a altura e largura

da formatação da fonte) com o texto.

Page 210: CLP GPM-18 - metaltex.com.br · Você pode programar o CLP GPM tanto em linguagem Ladder como em logica Boleana (lista de instruções). Funções básicas O CLP

27

2-6 Configurações do Sistema

Para maiores detalhes da série GPM consulte 《manual do usuário modelo GP》. Aqui será descrito os principais

detalhes do modelo GPM-18.

Seleção do modelo

Quando criar um novo projeto, você deverá escolhe o modelo de IHM que você estará programando. Clique no

modelo GPM-18.

Seleção do CLP

Após escolher o modelo de IHM, é preciso definir qual o protocolo de comunicação da IHM (geralmente a IHM

comunica com um CLP). Selecione na lista qual o modelo de CLP ou um protocolo adequado para a IHM.

Page 211: CLP GPM-18 - metaltex.com.br · Você pode programar o CLP GPM tanto em linguagem Ladder como em logica Boleana (lista de instruções). Funções básicas O CLP

28

Parâmetros de Comunicação

Usualmente não é necessário modificar esses parâmetros. Após escolher o protocolo de comunicação do CLP,

configure a taxa de transferência dos dados de comunicação, número de “bits”, paridade, “bits” de parada entre a

IHM e o CLP de acordo com a sua necessidade.

Escolha a porta de comunicação adequada

Após finalizar a configuração de sua IHM, é necessário escolher a porta de comunicação adequada para a

transferência dos dados.

Page 212: CLP GPM-18 - metaltex.com.br · Você pode programar o CLP GPM tanto em linguagem Ladder como em logica Boleana (lista de instruções). Funções básicas O CLP

29

Criando uma nova tela

Com um projeto aberto, clique na caixa de menu superior em “Ferramentas—Nova tela...” ou clique na figura

na barra de ferramentas ou clique em na caixa inferior do lado direito denominado “Nova”.

Adicione várias telas utilizando o exemplo acima mencionado. Em “Tela No:”, você indicara um número de tela

como orientação no seu projeto. Cada tela corresponde a um número, e só pode ser modificado quando a tela existe.

Na parte “descrição” o desenvolvedor poderá usar para descrever qual é aquela tela criada, facilitando na procura da

tela.

Propriedades da tela

Clique na caixa de menu superior em “Ferramentas”-“Propriedades da tela”; ou de um duplo clique na tela existente

do lado esquerdo; ou clique no ícone superior com esta imagem .

Por padrão, no modelo GPM-18 (CLP-IHM incorporada), as telas são navegadas pelo usuário através das teclas

“∧” e “∧” sem a necessidade de inserir algum código. Nas demais, basta adicionar a funções de teclas “∧” e/ou

“∧”,configurando os parâmetros, conforme figura abaixo.

Page 213: CLP GPM-18 - metaltex.com.br · Você pode programar o CLP GPM tanto em linguagem Ladder como em logica Boleana (lista de instruções). Funções básicas O CLP

30

Lista de alarmes

Uma lista de alarme tem uma função importante no projeto. Esta função é disponível nos seguintes modelos,

“Metaltex IHM” série IG-20, série GPM-18.

Uma lista de alarme é usada para indicar alguma falha ou erro entre outros, dando ao usuário meios de corrigir

algum problema. Uma vez configurada a lista de alarmes, quando o “bit” indicado na linha da mensagem estiver

setado a tela da IHM é limpa e a mensagem aparece no dentro da IHM.

Para sair do alarme apontado, pressione a tecla “ESC” e a tela anterior é apresentada novamente. Enquanto o “bit”

indicado estiver em nível lógico alto, a mensagem de erro poderá ser visualizada pressionando a tecla “ALM”.

Para criar uma lista de alarmes clique em: “Ferramentas”-“Lista de Alarmes”; ou clique no ícone na barra de

ferramentas. Uma caixa será apresentada, igual á figura abaixo. Digite o texto que deseja aparecer quando o alarme

for ativado. Após digitar o texto as caixas “Bit” e “No do CLP” serão habilitadas, Indique qual o “Bit” ou relé que

você deseja que ative o alarme e escolha o endereço do CLP (Para todos os alarmes).

Após definir os alarmes clique em “OK” para concluir os alarmes.

Page 214: CLP GPM-18 - metaltex.com.br · Você pode programar o CLP GPM tanto em linguagem Ladder como em logica Boleana (lista de instruções). Funções básicas O CLP

31

Configurações Gerais

Clique em “Ferramentas”-“Configuração Geral”, ou escolha o clique no ícone diretamente .

Esta caixa está dividida em duas partes (Veja a figura acima): Parâmetros e configuração.

Parâmetros:

Tela inicial: Quando o projeto é iniciado, a tela que dará início está definida nesta caixa. Usualmente por

padrão a tela inicial é a No. 1;

Senha: Para alguns projetos com necessidades de proteção, esta caixa é definida a senha de gerenciamento

dessa operação;

Após...: Quando a primeira tela é apresentada, após o tempo definido nesta caixa a IHM executa uma das duas

operações descritas abaixo.

Apaga LCD: Desliga a luz da IHM “backlight”.

Carrega tela: Habilite esta caixa e desvie para a tela definida na caixa com o número da tela respectiva.

Page 215: CLP GPM-18 - metaltex.com.br · Você pode programar o CLP GPM tanto em linguagem Ladder como em logica Boleana (lista de instruções). Funções básicas O CLP

32

Configuração:

Aqui é possível definir qual será a rede de comunicação e o registrador a serem usados para a troca de informações

no projeto com o CLP. Essas caixas só estarão habilitadas caso você escolha um dos itens “Troca de dados” ou

“Periféricos”. Se um desses dois itens é habilitado o número do registrador padrão é o D0 para os CLP da Metaltex

séries. Para a estação de trabalho não é necessário modificar quando se tem apenas a IHM na rede.

Troca de dados:

Chamada de tela: Quando habilitado, o registrador definido fará o controle de mudança das telas. Significa que

ao alterar o valor do registrador escolhido, esse valor representa a tela que será apresentada.

Carrega tela atual: Quando habilitado, corresponde ao registrador escolhido + 1 (Exemplo, se escolhido D0,

logo será o registrador ”D1”), isto indica que, quando o usuário pressionar uma tecla o valor correspondente

dessa tecla será armazenado nesse registrador.

Periféricos: Pode ser.

I/O Analógicas: Em desenvolvimento, sem utilização para o modelo GPM-18!

Relógio calendário: Quando habilitado, corresponde ao registrador D18 (neste caso). Varia de acordo com as caixas

que estão habilitadas, as informações do relógio calendário em tempo real são dispostas em 6 registradores, e nesse

caso á partir do registrador D18.

Page 216: CLP GPM-18 - metaltex.com.br · Você pode programar o CLP GPM tanto em linguagem Ladder como em logica Boleana (lista de instruções). Funções básicas O CLP

33

Configuração das teclas de função

Para acessar as configurações das teclas de função clique em “Ferramentas”—“Configuração das teclas de função”;

ou clique no ícone diretamente. Essas teclas são as teclas fixas na IHM.

Por padrão todas as teclas de função podem ser definidas separadamente. Se as teclas de funções não forem

definidas, não importa qual tela está presente, as respostas dessas teclas terão seu uso padrão. Algumas teclas são

atalhos facilitando o desenvolvimento do projeto.

Exemplo de configuração de uma tecla como tecla de salto:

Conforme o desenho acima clique na tecla “F1” e escolha a função “Tela”, conforme ilustra a figura abaixo, Depois

clique em “OK”. Pronto, toda a vez que for pressionada a tecla “F1” será sempre apresentado à tela No 1.

Obs.: Esta função só será válida caso exista mais de uma tecla criada.

Page 217: CLP GPM-18 - metaltex.com.br · Você pode programar o CLP GPM tanto em linguagem Ladder como em logica Boleana (lista de instruções). Funções básicas O CLP

34

Capitulo 3 – Aplicação com “IG-Software”

3-1 Fluxograma Novo Projeto

3-1-1....Criando um novo projeto

Escolhendo o tipo de CLP::::

Aqui, você encontra uma lista de nomes que a IHM IG-20 suporta para

comunicação. A IHM IG-20 atende aos mais conhecidos CLP´s e módulos de funções

especiais.

Metaltex GPM-18

Mitsubishi FX

Koyo SG

Siemens S7-200

Omron CPM/CQM

Schneider Micro/Neza/Twindo

Modbus RTU(Slave)

Sharp

Panasonic - Matsushita FP

Toshiba TC

Hitachi MicroEH

Delta DVP

Facon MU/MA

AB (SLC500)

LG (K80/120S)-program

LG (K80-120S) ModBus

Keyence KV

Vigor VB

ADAM

Page 218: CLP GPM-18 - metaltex.com.br · Você pode programar o CLP GPM tanto em linguagem Ladder como em logica Boleana (lista de instruções). Funções básicas O CLP

35

3-1-2.Adicionando Telas.

Após criar o seu novo projeto, prossiga adicionando as telas.

O sistema, por padrão, já cria a tela No 1, de acordo com suas necessidades, você poderá adicionar facilmente

mais telas. Veja o exemplo abaixo:

Page 219: CLP GPM-18 - metaltex.com.br · Você pode programar o CLP GPM tanto em linguagem Ladder como em logica Boleana (lista de instruções). Funções básicas O CLP

36

3-1-3.Editando a Tela

O “design” é de extrema importância para a construção da tela, Agradar o usuário e facilitar seus manuseios dão

maiores confianças.

Page 220: CLP GPM-18 - metaltex.com.br · Você pode programar o CLP GPM tanto em linguagem Ladder como em logica Boleana (lista de instruções). Funções básicas O CLP

37

3-1-4.Acessando a Tela de Configurações Gerais

Aqui identificamos à tela No 1 como a tela que dará o inicio na apresentação.

Como não usaremos senha, então coloque o valor 0 na caixa.

O padrão do tempo de proteção de tela é de 3 minutos. Alteraremos para 15 minutes, por enquanto, habilitando a

caixa de luz do “backlight”.

Para a “troca de dados”, não precisará ser alterada, usaremos os controles padrões (não selecione nada).

Após configurar, salve o projeto.

Recomendações::::

Durante o desenvolvimento do projeto, alguns acidentes inesperados podem ocorrem, assim como perda

de energia, problemas com o sistema operacional, ou outros acidentes que possam fecha a ferramenta de

edição causando a perda dos seus trabalhos. , Por isso, sugerimos que salve seus trabalhos

freqüentemente.

Page 221: CLP GPM-18 - metaltex.com.br · Você pode programar o CLP GPM tanto em linguagem Ladder como em logica Boleana (lista de instruções). Funções básicas O CLP

38

3-1-5.Senhas

O sistema de senhas limita o uso do operador na navegação. Para o projeto inteiro, esta medida dispõe de um

grande papel para a segurança e confiança. Quando você insere uma senha, as telas habilitadas com senhas só

serão apresentadas quando for digitado o código da senha correta. Uma vez habilitada à senha pela IHM, o

usuário terá que desabilitar novamente.

Digite a senha, caso o usuário digitar a senha incorreta digite novamente. Após inserir a senha e navegar pelas

telas restritas, para voltar a proibir as telas com proibições de senhas, escolha a opção de desabilitar. E insira

novamente a senha registrada.

Caso você esqueça de fechar a senha durante o uso, o sistema manterá o estado de senha liberada deixando a

navegação ilimitada para o operador.

3-1-6....Transferindo o programa para a IHM.

Após finalizar o desenvolvimento do projeto, é só descarregar o programa para dentro da IHM.

Conecte o cabo de programação no computador e na IHM e então clique em no ícone “Enviar o projeto”.

Nota::::Quando estiver descarregando o programa na IHM, por favor, não remova o cabo de alimentação

para prevenir que os dados que estão sendo transferidos não sejam perdidos, ou ocorrência de falhas

no programa. Se uma dessas condições ocorrerem, por favor, reconecte o cabo e transfira novamente o

programa.

Page 222: CLP GPM-18 - metaltex.com.br · Você pode programar o CLP GPM tanto em linguagem Ladder como em logica Boleana (lista de instruções). Funções básicas O CLP

39

Capítulo 4 - Ferramentas

4-1Aplicando um Controle Automático

Crie a tela No 1 com o nome de “Tela principal”.

Clique no ícone e adicione mais quatro telas com os seguintes nomes: “Monitoramento”, “Parâmetros”,

“Automático” e “Manual”, conforme a figura abaixo:

Tela principal

Monitoramento

Parâmetros

Automático

Manual

Aqui, daremos um pouco mais de informações sobre cada tela:

Adicione e configure as propriedades da tela..

Page 223: CLP GPM-18 - metaltex.com.br · Você pode programar o CLP GPM tanto em linguagem Ladder como em logica Boleana (lista de instruções). Funções básicas O CLP

40

Elementos da tela: um título, quatro saltos com tecla.

Primeiro, projetar um titulo:

Adicione um Texto true-type clicando o ícone e adicionando na tela, digite o texto “Sistema de controle de

automação”; clique na caixa para modificar o formato e o tamanho, se desejar.

Arraste o texto para a posição desejada, ou, conforme o exemplo abaixo.

Agora criaremos uma Tecla de toque “Touch” para a navegação:

Coloque quatro teclas de toque “Touch”, clicando no ícone e depois na tela.

Separadamente insira o nome nas propriedades da tecla para cada tecla sucessivamente:

“Manual”, “Automático”, “Monitoramento” e "Parâmetros”. Modifique a fonte.

Modifique as funções e parâmetros da tecla de toque “Touch” para saltar as telas:

【Manual】Função: Tela; saltar para a tela 5 【Automático】Função: Tela; saltar para a tela 4

【Monitoramento】Função: Tela; saltar para a tela 2

【Parâmetros】Função: Tela; saltar para a tela 3

Veja abaixo como ficou a construção do nosso pequeno programa.

Edite a tela de controle “Tela principal”.

Page 224: CLP GPM-18 - metaltex.com.br · Você pode programar o CLP GPM tanto em linguagem Ladder como em logica Boleana (lista de instruções). Funções básicas O CLP

41

Composição da tela: um título, nove descrições de textos, seis lâmpadas de indicação, uma unidade de

monitoramento de dados, uma unidade de indicação de texto dinâmico e uma tecla de salto e tela.

Primeiro..., titulo para a tela de monitoramento:

Adicione um Texto “true-type” clicando o ícone e clicando na tela, digite o texto “Monitoramento”.

Escolha “Inverso” para destacar o título, clique na caixa para modificar o formato e o tamanho, se

desejar.

Organizando os demais componentes:

Adicione mais um Texto “true-type” clicando o ícone e depois na tela, digite o texto “Indicador de

estados:” na caixa de texto do componente.

Insira mais seis textos com os seguintes nomes: “Energia”, “Funcionamento”, “Luz”, “Auto Wind”, “Sobe”,

“Desce”.

Modifique a fonte e sublinhe os nomes. Coloque conforme a figura abaixo ou da forma desejada.

Editando a tela “Monitoramento”.

Page 225: CLP GPM-18 - metaltex.com.br · Você pode programar o CLP GPM tanto em linguagem Ladder como em logica Boleana (lista de instruções). Funções básicas O CLP

42

Agora, adicione seis indicadores , coloque a direita dos textos inseridos anteriormente ou da forma

desejado. Ajuste os parâmetros das lâmpadas da seguinte forma:

【Power】“Bit” ou relé M0 【Run】“Bit” ou relé M1 【Light】“Bit” ou relé M10 【Auto Wind】“Bit” ou relé M11 【Up】“Bit” ou relé M12 【Down】“Bit” ou relé M13

Adicione um texto dinâmico clicando no ícone , e juste as propriedades desse componente da seguinte

forma:

Registrador ID = D10;

Adicione os textos conforme a figura abaixo:

Coloque o texto dinâmico a direita do texto【Indicador de estados: 】.

Agora vamos colocar um texto para informar sobre a entrada de um valor, um registrador para apresentar este

valor e um texto para representar a unidade da seguinte forma:

Texto para entrada “Temp.”;

Texto para a unidade “∧”, Escolha inverso para destacar os textos;

Pressione a tecla e coloque o um campo de registrador. Identifique-o como D 100, Dígitos = 4, 1 casa

decimal, Inverte, o restante deixe no padrão. Coloque entre os textos “Temp.” e “∧”, usado como indicador da

temperatura.

Coloque uma Tecla de toque “Touch” clicando no ícone e depois clicando na tela.

Modifique o texto para “Voltar”.

Escolha a fonte e o tamanho.

Configure o parâmetro de função da Tecla de toque “Touch” da seguinte forma:

Função “tela”;

Carregar tela =1;

Page 226: CLP GPM-18 - metaltex.com.br · Você pode programar o CLP GPM tanto em linguagem Ladder como em logica Boleana (lista de instruções). Funções básicas O CLP

43

Coloque na posição conforme a figura e insira outro botão com o nome “Parar”. Escolha a fonte e o tamanho..

Configure o parâmetro de função da nova Tecla de toque “Touch” da seguinte forma:

Escolha a opção “Bit” ou relé

Escolha o gerenciamento do “Bit” ou relé: M51;

Agora clique na opção: Inverte.

Veja agora como ficou a nossa tela de monitoramento.

Aqui, nós finalizamos a edição da tela [Monitoramento].

Page 227: CLP GPM-18 - metaltex.com.br · Você pode programar o CLP GPM tanto em linguagem Ladder como em logica Boleana (lista de instruções). Funções básicas O CLP

44

Composição da tela: um título, quatro textos, quatro textos de unidades, quatro dados de leitura e uma

tecla de salto de tela.

Primeiro... título da tela.

Adicione um Texto “true-type” clicando o ícone e clicando na tela, digite o texto “Parâmetros”. Escolha

“Inverso” para destacar o título, clique na caixa para modificar o formato e o tamanho, se desejar.

Drag the title to the proper position, refer to the following graph.

Organizando os demais componentes:

Adicione quatro Textos “true-type” clicando o ícone e depois clicando na tela, digite o texto:

“Freqüência”, “Fluxo”, “Ajuste Temp.”, “Ajuste Tamanho”.

Modifique o formato e o tamanho, se desejar. Veja a figura abaixo de como foi montada a tela.

Adicione quatro Registradores e modifique as propriedades da seguinte forma:

Para cada registrador insira o endereço sucessivamente: D 500, D 502, D504, D508.

Número de dígitos = 4.

Casa decimal = 1.

Selecione a opção【edição】, o restante deixe com os valores padrões.

Posicione os componentes conforme a figura.

Adicione mais quatro Textos “true-type” clicando o ícone e depois clicando na tela, Altere para os textos

seguintes, “Hz”, “%”, “∧”, “m”, estes textos representarão as unidades dos valores.

Modifique o formato e o tamanho, se desejar. Veja a figura abaixo de como foi montada a tela.

Coloque uma Tecla de toque “Touch” clicando no ícone e depois clicando na tela.

Modifique o texto para “Voltar”.

Escolha a fonte e o tamanho.

Configure o parâmetro de função da Tecla de toque “Touch” da seguinte forma:

Função “tela”;

Carregar tela =1;

Editando a tela de parâmetros

Page 228: CLP GPM-18 - metaltex.com.br · Você pode programar o CLP GPM tanto em linguagem Ladder como em logica Boleana (lista de instruções). Funções básicas O CLP

45

Aqui, nós finalizamos a edição da tela [Parâmetros].

Page 229: CLP GPM-18 - metaltex.com.br · Você pode programar o CLP GPM tanto em linguagem Ladder como em logica Boleana (lista de instruções). Funções básicas O CLP

46

Composição da tela: um título, duas teclas de função, duas teclas de salto de tela.

Primeiro... título da tela.

Adicione um Texto “true-type” clicando o ícone e clicando na tela, digite o texto “Automático”. Escolha

“Inverso” para destacar o título, clique na caixa para modificar o formato e o tamanho, se desejar.

Organizando os demais componentes:

Adicione duas teclas de toque “Touch” clicando no ícone , modifique os textos com os seguintes nomes:

“Auto. Liga”, “Auto. Para”. Altere as fontes e as funções da seguinte maneira:

【Auto. Liga】Função: “Bit” ou relé M2; Escolha “Liga”, Escolha “Indic.”. 【Auto. Para】Função: “Bit” ou relé M3; Escolha “Pulso”.

Adicione mais três teclas de toque “Touch” clicando no ícone modifique os textos com os seguintes

nomes: “Monitoramento”, “Manual” e “Voltar”.

Altere as fontes e as funções da seguinte maneira: 【Monitoramento】Saltar tela; Tela Nº. 2. Selecione “INV”. 【Voltar】Saltar tela; Tela Nº. 1. Selecione “INV”. 【Manual】Saltar tela; Tela Nº. 5. Selecione “INV”.

Editando a tela automático

Page 230: CLP GPM-18 - metaltex.com.br · Você pode programar o CLP GPM tanto em linguagem Ladder como em logica Boleana (lista de instruções). Funções básicas O CLP

47

Aqui, nós finalizamos a edição da tela [Automático].

Composição da tela: um título, duas teclas de função, duas teclas de salto de tela.

Primeiro... título da tela.

Adicione um Texto “true-type” clicando o ícone e clicando na tela, digite o texto “Manual”. Escolha

“Inverso” para destacar o título, clique na caixa para modificar o formato e o tamanho, se desejar.

Organizando os demais componentes:

Adicione seis textos “true-type” clicando o ícone e clicando na tela, digite os textos:

“Luz”, “Bomba”, “Sobe”, “desce”, “Iniciar”, “Parar”; modifique o formato e o tamanho, coloque os

componentes na posição, veja a figura abaixo de como foi montada a tela.

Adicione seis funções do teclado, clicando no ícone e depois na tela, Modifique as teclas como: 【F1】, 【F2】, 【F3】, 【F4】, 【F5】, 【F6】, agora ajuste as funções do teclado da seguinte forma: 【F1】Função:“Bit” ou relé No. M21;Escolha “Liga”. 【F2】Função:“Bit” ou relé No. M22;Escolha “Liga”. 【F3】Função:“Bit” ou relé No. M23;Escolha “Liga”. 【F4】Função:“Bit” ou relé No. M24;Escolha “Liga”. 【F5】Função:“Bit” ou relé No. M25;Escolha “Liga”. 【F6】Função:“Bit” ou relé No. M26;Escolha “Liga”.

Finalmente adicione mais seis teclas de toque “Touch” clicando no ícone e depois na tela, ajuste os textos

das teclas de toque da seguinte forma:

Para cada tecla “Monitoramento”, “Voltar”, “Automático”, “Ligar”, “Parar”, agora ajuste as funções das teclas

de toque da seguinte forma:

【Monitoramento】Saltar tela; Tela Nº. 2 【Voltar】Saltar tela; Tela Nº. 1. 【Manual】Saltar tela; Tela Nº. 4. 【Ligar】“Bit” ou relé No.:M50;Escolha “Inverso”. 【Parar】“Bit” ou relé No.:M51;Escolha “Pulso”.

Editando a tela Manual

Page 231: CLP GPM-18 - metaltex.com.br · Você pode programar o CLP GPM tanto em linguagem Ladder como em logica Boleana (lista de instruções). Funções básicas O CLP

48

Aqui, nós finalizamos a edição da tela [Manual].

Page 232: CLP GPM-18 - metaltex.com.br · Você pode programar o CLP GPM tanto em linguagem Ladder como em logica Boleana (lista de instruções). Funções básicas O CLP

PRODUTOS ELETRÔNICOS METALTEX LTDA. Rua: José Rafaelli, 221 - Socorro - S. Amaro - São Paulo / SP.

CEP: 04763-280 - Brasil – Tel.: 55 - (11) 5683-5713 Fax: 55 - (011) 5524-2324 Site: www.metaltex.com.br

CLP

GPM-18

Ligações Elétricas

Page 233: CLP GPM-18 - metaltex.com.br · Você pode programar o CLP GPM tanto em linguagem Ladder como em logica Boleana (lista de instruções). Funções básicas O CLP

Ligações Elétricas – GPM-18

2

Entradas Digitais

Tensão de Entrada 24VDC ±10%

Corrente de Entrada 7mA / 24VDC

Corrente de Comutação OFF → ON > 4.5mA

Corrente de Comutação ON → OFF < 1.5mA

Tempo de Resposta ~ 10ms

Tipo de Entrada Transistor NPN Coletor Aberto

Isolação do Circuito Acoplador Óptico

dd

·

Alimentação

DC

Page 234: CLP GPM-18 - metaltex.com.br · Você pode programar o CLP GPM tanto em linguagem Ladder como em logica Boleana (lista de instruções). Funções básicas O CLP

Ligações Elétricas – GPM-18

3

Saídas Digitais

Isolação do Circuito Isolação Mecânica

Resistiva 3A Carga

Máxima Indutiva 80VA

Carga mínima 5VDC 2mA

OFF→ON 10ms Tempo de

Resposta ON→OFF 10ms

Corrente Máxima por

Comum 6A

Isolação do Circuito Acoplador Óptico

Resistiva 0.3A Carga

máxima Indutiva 5W/24VDC

Carga Mínima 5VDC 2mA

OFF→ON < 0.2ms Tempo de

Resposta ON→OFF < 0.2ms

Saída Relé

Saída Transistor

Circuito

de

Controle

Circuito

de

Controle

Page 235: CLP GPM-18 - metaltex.com.br · Você pode programar o CLP GPM tanto em linguagem Ladder como em logica Boleana (lista de instruções). Funções básicas O CLP

Ligações Elétricas – GPM-18

4

Exemplos de Ligações

Observação Para uma carga indutiva DC, introduza um diodo em paralelo com a

carga. O não uso do diodo diminui o tempo de vida útil dos contatos

do relé. Escolha um diodo que opere com uma tensão reversa de

5~10 vezes a tensão nominal da carga.

Para uma carga Indutiva AC, introduza um supressor de ruídos em

paralelo.

Carga DC Carga AC

Saída Relé

Circuito

de

Controle

Page 236: CLP GPM-18 - metaltex.com.br · Você pode programar o CLP GPM tanto em linguagem Ladder como em logica Boleana (lista de instruções). Funções básicas O CLP

Ligações Elétricas – GPM-18

5

Exemplo de utilização para saída rápida para driver de motor-de-passo.

Y0 PUPUY1

Saída Transistor

GPM-18T Driver Motor-de-Passo

Circuito

de

Controle

Observação Para utilização de driver’s que operam em tensões de 5VDC ligar

em série com a saída um resistor de 2,2kΩ ¼W.

Page 237: CLP GPM-18 - metaltex.com.br · Você pode programar o CLP GPM tanto em linguagem Ladder como em logica Boleana (lista de instruções). Funções básicas O CLP

PRODUTOS ELETRÔNICOS METALTEX LTDA. Rua: José Rafaelli, 221 - Socorro - S. Amaro - São Paulo / SP.

CEP: 04763-280 - Brasil – Tel.: 55 - (11) 5683-5713 Fax: 55 - (011) 5524-2324 Site: www.metaltex.com.br

Configuração do Cabo de Programação IHM IG-20 & CLP GPM-18T

Código: GP-IG-PROG

IG-20 / GPM-18T((((Conector DB9 - Fêmea)))) PC((((Conector DB9 - Fêmea))))

RX 2 2 RXD TX 3 3 TXD

CTS 7 7 RTS

GN 5 5 GND

Comprimento 2 metros

Depto. Engenharia de Aplicações: Renato Muga

Page 238: CLP GPM-18 - metaltex.com.br · Você pode programar o CLP GPM tanto em linguagem Ladder como em logica Boleana (lista de instruções). Funções básicas O CLP

PRODUTOS ELETRÔNICOS METALTEX LTDA. Rua: José Rafaelli, 221 - Socorro - S. Amaro - São Paulo / SP.

CEP: 04763-280 - Brasil – Tel.: 55 - (11) 5683-5713 Fax: 55 - (011) 5524-2324 Site: www.metaltex.com.br

Configuração do Cabo de Comunicação IHM IG-20 <-> CLP’s Panasonic FP

Código: IG-FP-COM

IHM IG-20 (Conector DB9 - Fêmea)))) CLP FP (Conector Mini-Din - Macho))))

RX 2 3 TXD TX 3 4 RXD

GN 5 1 GND

Observação:

Utilizar conector Mini-DIN macho 6 pinos (MDM-06) e retirar o pino 2 conforme figura abaixo:

Comprimento 3 metros

Depto. Engenharia de Aplicações: Renato Muga

Page 239: CLP GPM-18 - metaltex.com.br · Você pode programar o CLP GPM tanto em linguagem Ladder como em logica Boleana (lista de instruções). Funções básicas O CLP

XCP Pro user Manual Page 2 of 62 MANUL010R2V1

XCP Pro User Manual Index Page

Chapter 1 User explanation 1-1 System requirements 4 1-2 Installation steps 4 1-3 Uninstall steps 5

Chapter 2 Basic operation 2-1 Open and close the XCP Pro 7 2-2 Create and open the project 8 2-3 Add and delete the PLC mode 9

Chapter 3 Basic introduction to the edit environment 3-1 Basic interface 11 3-2 Conventional Toolbar 12 3-3 PLC Toolbar 13

3-4 Ladder logic Toolbar 14 3-5 Others 15

3-6 Menu bar 3-6-1 File 16 3-6-2 Edit 16 3-6-3 Search/Replace 17 3-6-4 View 17 3-6-5 PLC Operate 17 3-6-6 PLC Setting 18 3-6-7 Option 18 3-7 Project bar 19 3-8 Shortcut key introduction 20

Chapter 4 Simple function realization 4-1 Online 22

4-2 Upload/download program and PLC status control 23 4-3 Set PLC initialization value, upload/download data

4-3-1 Initial value settings 24 4-3-2 Upload/download data 25

4-4 PLC and module information enquires 4-4-1 PLC main unit information 25 4-4-2 BD board information 25 4-4-3 Expansion module information 26 4-4-4 Scan cycle 26 4-4-5 Clock information 26 4-4-6 Error information 27

4-5 PLC initialization 27 4-6 Lock/unlock program

4-6-1 Password settings 28 4-6-2 Lock/unlock 28 4-6-3 Default password decryption settings 29

4-7 Printing 29

Chapter 5 Program operation 5-1 Program mode 31 5-2 Instruction sign input 5-2-1 Instruction prompt 32 5-2-2 Input node 33 5-2-3 Input loop 34 5-2-4 Special instruction 37

Page 240: CLP GPM-18 - metaltex.com.br · Você pode programar o CLP GPM tanto em linguagem Ladder como em logica Boleana (lista de instruções). Funções básicas O CLP

XCP Pro user Manual Page 3 of 62 MANUL010R2V1

5-3 Ladder chart edit 5-3-1 Horizontal line and vertical line operation 40

5-3-2 Node and row operation 41 5-3-3 Edit comment 43 5-3-4 Ladder chart copy and cut 45 5-3-5 Ladder chart instruction management 46

5-4 Relevant config 5-4-1 PLC serial port settings 47 5-4-2 Password settings 48 5-4-3 BD board 49

5-4-4 Can-bus communication configuration 50 5-4-5 Power-off retentive save memory settings 50 5-4-6 Expansion module settings 50 5-4-7 I/O settings 51 5-4-8 Communication mode settings 52 5-4-9 TCP/IP settings 53

5-4-10 function block list 54 5-5 Soft element monitor

5-4-1 Soft element comment 56 5-4-2 Free monitor 57

5-4-3 Data monitor 58 5-4-4 Ladder chart monitor 59 5-4-5 Information bar 60 5-4-6 Status bar 61

Page 241: CLP GPM-18 - metaltex.com.br · Você pode programar o CLP GPM tanto em linguagem Ladder como em logica Boleana (lista de instruções). Funções básicas O CLP

XCP Pro user Manual Page 4 of 62 MANUL010R2V1

1 User explanation

This chapter focuses on XC XCP Pro PC software installation system requirements, installation and unloading steps.

This software is suitable for running on Windows 2000, Windows NT, Windows XP and others above.

1, If your operation system has not installed the Framework 2.0 library before, you should run the installation process "dotnetfx.exe" first, which is in the subfolder "dotnetfx" of the installation folder; 2, Double-click to operate the installation files“setup.exe”.

1-1 System requirements

1-2 Installation steps

1-3 Uninstall steps

1-1 System requirements

1-2 Installation steps

Click “Next”.

Choose the software installation path, click

"next step", until the

"install" button appears.

Page 242: CLP GPM-18 - metaltex.com.br · Você pode programar o CLP GPM tanto em linguagem Ladder como em logica Boleana (lista de instruções). Funções básicas O CLP

XCP Pro user Manual Page 5 of 62 MANUL010R2V1

1, Choose "Start"→ "Setting"→ "Control panel"

2, Double-click "Add/Delete XCP edit tool"

3, Pick on "XCPPro3.0" in the list, press "Delete" in the lower right corner

4, Click [Yes] in the "Add or Remove Programs" screen 5, Uninstalling XCP Pro

6, Prompt the uninstall is successful.

1-3 Uninstall steps

Page 243: CLP GPM-18 - metaltex.com.br · Você pode programar o CLP GPM tanto em linguagem Ladder como em logica Boleana (lista de instruções). Funções básicas O CLP

XCP Pro user Manual Page 6 of 62 MANUL010R2V1

2 Basic operation

2-1 Open and close XCP Pro

2-2 Create and open the project

2-3 Add and delete PLC types

Page 244: CLP GPM-18 - metaltex.com.br · Você pode programar o CLP GPM tanto em linguagem Ladder como em logica Boleana (lista de instruções). Funções básicas O CLP

XCP Pro user Manual Page 7 of 62 MANUL010R2V1

Open XCP Pro.

1, Click: Start → All programs → XCP Pro → XCPPro.exe.

2, When the XCP Pro has just started, the screen will display as shown below:

Note: You can also double-click the shortcut icon on the desktop to open the program.

To close XCP Pro:

Click: File → Exit, or just click the button , and XCP Pro will close.

2-1 Open and close XCP Pro

Page 245: CLP GPM-18 - metaltex.com.br · Você pode programar o CLP GPM tanto em linguagem Ladder como em logica Boleana (lista de instruções). Funções básicas O CLP

XCP Pro user Manual Page 8 of 62 MANUL010R2V1

1, how to create a new project:

(1) Click: File → New project ‘Ctrl+N’, or click the icon. When clicked, the PLC model selection window will pop up.

(2) Select the PLC model in the "Select PLC Model" windows, and then click "OK", the new project is now completed. As shown below:

2, Open project:

Choose: File → Open project, or click icon , then select *. XCp type of file in the "Open PLC project file" dialog box, then click the "open".

Note: Usually, when you open an XCP project, the system backs up the original file automatically, file named *. rak for backup. When you need to use this file, change the suffix to ". XCP", then open it in XCP Pro.

2-2 Create and open the project

Page 246: CLP GPM-18 - metaltex.com.br · Você pode programar o CLP GPM tanto em linguagem Ladder como em logica Boleana (lista de instruções). Funções básicas O CLP

XCP Pro user Manual Page 9 of 62 MANUL010R2V1

When a new project is created, its default name is PLC1. When you need to edit a number of PLCs, you can add multi-objects to the interface.

1, Add PLC:

Method 1 Click File → Add PLC.

Method 2 In project column which is on the left side,

right-click "PLC1"→"Add PLC", as follows:

When a PLC is added successfully, it will be named "PLC2" incremented each time by 1, and the project column in the left side will change also, as shown below:

When editing different PLCs, you only need to click the plc. Users can also modify the name, edit communication mode, change models or delete operation on the corresponding PLC.

1, Deleting models

Method 1: Right-click the PLC and, select "Delete PLC".

Method 2: First select the PLC to delete, and then to: File → Delete PLC.

After the operation, the system will hint whether or not to delete, as follows:

To confirm the deletion, click "OK", otherwise, click "Cancel."

Note: The code between different PLCs can be copied to or from each other; the code between different projects can also use the copy and paste function.

2-3 Add and delete PLC types

Page 247: CLP GPM-18 - metaltex.com.br · Você pode programar o CLP GPM tanto em linguagem Ladder como em logica Boleana (lista de instruções). Funções básicas O CLP

XCP Pro user Manual Page 10 of 62 MANUL010R2V1

3 Basic introduction to the edit environment

This chapter focuses on the basic structure of XCP Pro software, the main function of the toolbar, the menu bar, the project bar, and shortcut keys in common use.

3-1 Basic interface

3-2 Conventional toolbar

3-3 PLC tool bar

3-4 Ladder logic

3-5 Others

3-6 Menu bar

3-7 Project bar

3-8 Shortcut key introduction

Page 248: CLP GPM-18 - metaltex.com.br · Você pode programar o CLP GPM tanto em linguagem Ladder como em logica Boleana (lista de instruções). Funções básicas O CLP

XCP Pro user Manual Page 11 of 62 MANUL010R2V1

3-1 Basic interface

Title bar: Behind the ECPPro display the open ladder program file, name and path.

Menu bar: Choose the operation to carry out in the drop-down.

menu. Conventional Toolbar: Display the icons of basic functions,such as copy

.searc.

Ladder input bar: When adding instruction symbol, select icon.

PLC Toolbar Including upload, download, run

etc.

Windows switch bar: Switch windows.

Other: The operation of ladder.

Page 249: CLP GPM-18 - metaltex.com.br · Você pode programar o CLP GPM tanto em linguagem Ladder como em logica Boleana (lista de instruções). Funções básicas O CLP

XCP Pro user Manual Page 12 of 62 MANUL010R2V1

New New Create a Ladder program

Open Open an edited (saved) file

Save Save the modified or newly created file

Cut Cut in the the specified scope

Copy Copy within the scope of instruction

Paste

Paste the cut and copied contents to a designated location

Go back Go back to the region of previous cursor

Go forward Go forward to the region of next cursor

Search Search the statement or string

Node Show node comment

Instruction tooltip

Instruction tooltip open/close

Printer Print the current file

Help See related XC instructions for use

3-2 Conventional toolbar

Page 250: CLP GPM-18 - metaltex.com.br · Você pode programar o CLP GPM tanto em linguagem Ladder como em logica Boleana (lista de instruções). Funções básicas O CLP

XCP Pro user Manual Page 13 of 62 MANUL010R2V1

Download

Download the editing program or data into PLC EMS memory

Upload

Read the program or data in PLC memory out

Run Run PLC

Stop Stop PLC

Lock Lock program

Unlock Unlock program

Lad monitor

Monitor the operation process of ladder chart program

Data monitor

Monitor and set state, data of all PLC soft elements

Free monitor

Monitor and set state, data of specified PLC soft elements

Software serial port config

Configuration of serial port for connection to PLC

3-3 PLC toolbar

Page 251: CLP GPM-18 - metaltex.com.br · Você pode programar o CLP GPM tanto em linguagem Ladder como em logica Boleana (lista de instruções). Funções básicas O CLP

XCP Pro user Manual Page 14 of 62 MANUL010R2V1

Insert a node

Set

Insert a row

Instruction frame

Delete a Node

Horizontal Line

Delete a Row

Delete Horizontal Line

Normally Open Node

Vertical Line

Normally Closed Node

Delete Vertical Line

Rising Edge Pulse

PID Instruction Parameter Config

Falling Edge Pulse

Pulse Instruction Parameter Config

Output

High-speed Count 24-section Config

Reset

G-BOX SMS Config

3-4 Ladder logic toolbar

Page 252: CLP GPM-18 - metaltex.com.br · Você pode programar o CLP GPM tanto em linguagem Ladder como em logica Boleana (lista de instruções). Funções básicas O CLP

XCP Pro user Manual Page 15 of 62 MANUL010R2V1

Auto-adapt Col Width Auto-adjust col width to a appropriate length

Zoom In Zoom in ladder chart

Zoom Out Zoom out ladder chart

To Ladder Convert instruction list into ladder chart

To Instruction List Convert ladder chart into instruction list

Grammar Check Check user procedure on grammar

3-5 Others

Page 253: CLP GPM-18 - metaltex.com.br · Você pode programar o CLP GPM tanto em linguagem Ladder como em logica Boleana (lista de instruções). Funções básicas O CLP

XCP Pro user Manual Page 16 of 62 MANUL010R2V1

3-6-1 File

3-6-2 Edit

3-6 Menu bar

Page 254: CLP GPM-18 - metaltex.com.br · Você pode programar o CLP GPM tanto em linguagem Ladder como em logica Boleana (lista de instruções). Funções básicas O CLP

XCP Pro user Manual Page 17 of 62 MANUL010R2V1

3-6-3 Search/replace

3-6-4 View

3-6-5 PLC operate

In the basic operation of the PLC, there are several items listed below that need attention:

· The use of secret download

This protects the users' intellectual property, after the use of secret download, the program or data in PLC will never be able to upload, and the program is unable to be deciphered.

· Stop PLC when PLC reboot

In the instance of a program error, in the run mode you will not be able to communicate, set PLC to stop mode, then you can re-download the user program and set PLC to run mode.

· Lock/Unlock program

When using the function, first set the user program password, then download, password and program will download into PLC together. When the user wants to upload, they need to input the password to unlock the PLC first, and then they can upload.

When the PLC is password protected, it can be re-downloaded with a new user program,. The password is used to protect a specific user program.

Note: Specific PLC information see P29.

Page 255: CLP GPM-18 - metaltex.com.br · Você pode programar o CLP GPM tanto em linguagem Ladder como em logica Boleana (lista de instruções). Funções básicas O CLP

XCP Pro user Manual Page 18 of 62 MANUL010R2V1

3-6-6 PLC setting

3-6-7 Options

Page 256: CLP GPM-18 - metaltex.com.br · Você pode programar o CLP GPM tanto em linguagem Ladder como em logica Boleana (lista de instruções). Funções básicas O CLP

XCP Pro user Manual Page 19 of 62 MANUL010R2V1

The left column includes "Project bar" . The details in the project bar have been related to it in the menu bar and tool bar.

Instruction class bar: The instructions classified in accordance with the different functions, and then users can choose directly, as follows:

3-7 Project bar

Page 257: CLP GPM-18 - metaltex.com.br · Você pode programar o CLP GPM tanto em linguagem Ladder como em logica Boleana (lista de instruções). Funções básicas O CLP

XCP Pro user Manual Page 20 of 62 MANUL010R2V1

Ctrl+N

Create a new project Shift+ F6 Falling edge pulse

Curls

Save project F7 Output

Ctrl+P

Print config Shift+ F8 Reset

Ctrl+Z

Undo Shift+ F7 Set

Ctrl+Y

Redo F8 Other

Ctrl+C

Copy F11 Horizontal line

Ctrl+V

Paste Shift+F11 Delete horizontal line

Ctrl+X

Cut F12 Vertical line

Ctrl+A

Select all Shift+F12 Delete vertical line

Delete

Delete Ctrl+F Search soft element

Shift+Insert

Insert a rung Ctrl+T Sear step ID

Shift+Delete

Delete a rung Ctrl+R Replace

Ins

Insert a node Alt+Left Go back

F5

Open node Alt+Right Go forward

F6

Close node Ctrl+G Grammar check

Shift+ F5

Rising edge pulse F1 Help

3-8 Shortcut key introduction

Page 258: CLP GPM-18 - metaltex.com.br · Você pode programar o CLP GPM tanto em linguagem Ladder como em logica Boleana (lista de instruções). Funções básicas O CLP

XCP Pro user Manual Page 21 of 62 MANUL010R2V1

4 Basic operation

This chapter focuses on the use of PLC basic functions, including online, upload/download program, run/stop PLC, upload/download data, specified information search, PLC initialization, lock/unlock program, print, etc.

4-1 Online

4-2 Upload/download program and PLC status control

4-3 Set PLC initialise value, upload/download data

4-4 PLC and module information enguires

4-5 PLC initialisation

4-6 Lock/unlock program

4-7 Print

Page 259: CLP GPM-18 - metaltex.com.br · Você pode programar o CLP GPM tanto em linguagem Ladder como em logica Boleana (lista de instruções). Funções básicas O CLP

XCP Pro user Manual Page 22 of 62 MANUL010R2V1

2, In "Config Software Com Port" window, choose the correct serial port, baud rate, parity, or

click "Check", software will check and set correct serial port, baud rate, parity automatically.

3, When "Connect PLC Succeeded" shows red in the left bottom of "Config Software Com Port" window, online connection is successful, click "OK", to continue other operations.

4, When online fails, "Communication Error" will show in red wording in the left bottom of "Config Software Comport" window, please check computer comport, communication cable and PLC communication port and repeat procedure.

4-1 Online

1, Click menu bar: Option à Software serial port config, or click the icon.

Page 260: CLP GPM-18 - metaltex.com.br · Você pode programar o CLP GPM tanto em linguagem Ladder como em logica Boleana (lista de instruções). Funções básicas O CLP

XCP Pro user Manual Page 23 of 62 MANUL010R2V1

1, When you are successfully online, click "PLC operation" in menu bar→ "upload program &

data", or click the icon, this will upload the PLC program. Click "project" in menu bar→

"save project", or click the icon, to save program.

2, When you are online successfully, click "PLC operate" in menu bar → Download Program &

Data, or click the icon, the program will then download into the PLC. If the PLC is running, the "stop running PLC" window will pop up.

Choose "OK", The PLC will stop running, then download your new program. While downloading, the gauge pop up will show.

After downloading program, click button to run the PLC.

3, State control:

After online, click button to run the PLC and click button to stop the PLC.

4-2 Download/upload program, PLC state control

Page 261: CLP GPM-18 - metaltex.com.br · Você pode programar o CLP GPM tanto em linguagem Ladder como em logica Boleana (lista de instruções). Funções básicas O CLP

XCP Pro user Manual Page 24 of 62 MANUL010R2V1

4-3-1 Initial value settings 1. Click "Set Reg Init Value" in project bar, the "Init Reg Value" window will pop up.

2. "Upload": Upload the data of PLC soft element.

"Download": download the set value into PLC. The numerical value can switch between "decimal", "binary", "hexadecimal", "no

symbol" and "ASCII".

3. Add soft element: Click "add" button, "Add Reg Init Value Range" in the window pop up, choose register model 'D' or 'FD', then set the start and end address.

The chart below is the initial value settings of adding two registers, double-click address ID, and modify numerical value.

4-3 PLC toolbar

Page 262: CLP GPM-18 - metaltex.com.br · Você pode programar o CLP GPM tanto em linguagem Ladder como em logica Boleana (lista de instruções). Funções básicas O CLP

XCP Pro user Manual Page 25 of 62 MANUL010R2V1

4-3-2

Method 1: For bit address values, then use "upload","download" button. Method 2: For word address values, then use "PLC operate" in menu bar→"Upload data”, “Download data".

4-4-1 PLC main unit information Shows PLC series, model, slave version and subsequent master version.

4-4-2 BD board information

Shows BD input/output points, input/output bytes, primary/secondary version, and BD board name.

4-4 Ladder logic toolbar

Method1:

Click "Project column" → "PLC information",

the catalogue will appear.

Click "PLC main unit information","BD

board information", "expansion module

information","scan cycle", or "error

information" information.

Method 2:

Click correlative items in the left side,

"Project column" → "PLC information",

will display information, shown on right.

Page 263: CLP GPM-18 - metaltex.com.br · Você pode programar o CLP GPM tanto em linguagem Ladder como em logica Boleana (lista de instruções). Funções básicas O CLP

XCP Pro user Manual Page 26 of 62 MANUL010R2V1

4-4-3 expansion module information Shows module information (content as BD board).

4-4-4 Scan cycle Show current cycle, Min/Max cycle of ladder chart program.

4-4-5 Clock information Shows current clock date information.

Page 264: CLP GPM-18 - metaltex.com.br · Você pode programar o CLP GPM tanto em linguagem Ladder como em logica Boleana (lista de instruções). Funções básicas O CLP

XCP Pro user Manual Page 27 of 62 MANUL010R2V1

4-4-6 Error Information Shows compilation error information.

In the main menu bar Select: PLC setting à PLC Initialization, PLC will be initialized back to original factory settings.

4-5 PLC Initialization

Page 265: CLP GPM-18 - metaltex.com.br · Você pode programar o CLP GPM tanto em linguagem Ladder como em logica Boleana (lista de instruções). Funções básicas O CLP

XCP Pro user Manual Page 28 of 62 MANUL010R2V1

When password protection is set, the PLC program cannot be read out in locked state. If repeated entering of wrong password error occurs the PLC will block the password automatically. To reopen password entry, switch off the power to the PLC, wait a few seconds before powering back on and then re-enter password and upload.

4-6-1 Password settings In project bar, click "PLC setting" in project bar click "Password", or "PLC config" in menu bar click "Password", now the password can be set and modified. The password is made up of 6 letters/numerals.The system default password is six zeros, i.e. no password.

4-6-2 Lock/unlock

When the password is successfully entered, click icon to lock the current PLC. Or click icon to unlock the current PLC, so the program can upload as normal.

4-6 Lock/unlock program

Page 266: CLP GPM-18 - metaltex.com.br · Você pode programar o CLP GPM tanto em linguagem Ladder como em logica Boleana (lista de instruções). Funções básicas O CLP

XCP Pro user Manual Page 29 of 62 MANUL010R2V1

4-6-3 The default password decryption settings Top menu bar “Option"→ "Default Unlock Psw Config", set unlock password.

In the process of using a locked PLC frequently, or entering different passwords to different locked PLCs, the user can set a default decryption password. As shown above, the user can set a number of decryption passwords. Then during uploads there is no need to enter passwords repeatedly.

Click: File → Print, the print config window will pop up, the program can be printed in ladder chart or instruction mode.

Print object: 1. Ladder chart, command, note; 2. Print all or part (separated with cursor), all is allowed.

Print settings: 1. Choose printer 2. Print range 3. Print amount

4-7 Printing

Page 267: CLP GPM-18 - metaltex.com.br · Você pode programar o CLP GPM tanto em linguagem Ladder como em logica Boleana (lista de instruções). Funções básicas O CLP

XCP Pro user Manual Page 30 of 62 MANUL010R2V1

5 Basic operation

This chapter focuses on the introduction in the XCP Pro program environment, including

methods for configuration and idiographic operation process, which may be involved in a wide variety of programs.

5-1 Program mode

5-2 Instruction sign input

5-3 Ladder chart editing

5-4 Correlative configuration

5-5 Soft element monitor

Page 268: CLP GPM-18 - metaltex.com.br · Você pode programar o CLP GPM tanto em linguagem Ladder como em logica Boleana (lista de instruções). Funções básicas O CLP

XCP Pro user Manual Page 31 of 62 MANUL010R2V1

XCP Pro can program in two methods: ladder logic or statement list program.

Ladder logic programming: Is chosen by the majority of PLC programmers and maintenance personnel.

Statement list program: Is used for PLCs where maintenance personnel have no access to the PLC and ladder monitoring is not required.

5-1 Program mode

Page 269: CLP GPM-18 - metaltex.com.br · Você pode programar o CLP GPM tanto em linguagem Ladder como em logica Boleana (lista de instruções). Funções básicas O CLP

XCP Pro user Manual Page 32 of 62 MANUL010R2V1

5-2-1 Instruction prompt When users write instructions in ladder logic mode, they can open instruction prompt function via

click " " icon. In manual input state, the system will automatically list correlative instructions for users to choose, and put up choice tips on operand. For those not familiar with user's operation.

5-2 Basic interface

As shown in the left figure, when input "LD", a drop-down menu will appear starting with "LD". Convenient for users' who are not familiar with the instructions.

After the instruction is confirmed, the system will put up correlative prompt on operand, such as operand attribute and available address type, etc.

Page 270: CLP GPM-18 - metaltex.com.br · Você pode programar o CLP GPM tanto em linguagem Ladder como em logica Boleana (lista de instruções). Funções básicas O CLP

XCP Pro user Manual Page 33 of 62 MANUL010R2V1

5-2-2 Input node

This example will explain the instruction input:

Mouse left click on a certain node in ladder chart, the display area within the dotted line box

denotes the chosen node; first click the icon (or press F5 key), the figure will show a dialog box (LD M0), it can edit instruction and loop in dialog box. When editin is finished, press "Enter" button.

Icon Function Shortcut key

Commonly open node F5

Commonly close node F6

Rising edge Shift+F5

Falling edge Shift+F6

E

d

R

i

g

W

ro

n

Press "enter" to move right in the edit area

Page 271: CLP GPM-18 - metaltex.com.br · Você pode programar o CLP GPM tanto em linguagem Ladder como em logica Boleana (lista de instruções). Funções básicas O CLP

XCP Pro user Manual Page 34 of 62 MANUL010R2V1

5-2-3 Input loop

Next take this example to explain the instruction input: Ex1: Loop output After the ladder's first node X0 input, the dotted line box moves right one lattice;

Click icon (or press F7 key), the instruction dialog window pop up for (OUT);

Input Y0 in the cursor place;

Icon Function Shortcut key

Output loop, timer and counter

F7

Set loop Shift+F7

Reset loop Shift+F8

Edit instruction F8

Page 272: CLP GPM-18 - metaltex.com.br · Você pode programar o CLP GPM tanto em linguagem Ladder como em logica Boleana (lista de instruções). Funções básicas O CLP

XCP Pro user Manual Page 35 of 62 MANUL010R2V1

Press the "Enter" key, if input is correct, then dotted line box will move to the next row; if not, the node will show in red, then double-click the node to modify.

EX2: Timer and counter input

1. The input method for timer: OUT+Timer number+blank+K timing seconds

After pressing enter, then dotted line box line will wrap.

2. Counter input mode: OUT+blank+counter number+blank+K count value

After pressing enter, the dotted line box line will wrap.

Page 273: CLP GPM-18 - metaltex.com.br · Você pode programar o CLP GPM tanto em linguagem Ladder como em logica Boleana (lista de instruções). Funções básicas O CLP

XCP Pro user Manual Page 36 of 62 MANUL010R2V1

Ex3: Operand instruction input

1. Click the icon (or press F8 key), on left side column will show instruction list; double-click the input instruction, the instruction is activated in the appointed area, input parameter.

2. Users who are familiar with instructions can double-click the input area, and manually input instructions and parameters; Double-click the activated area:

Input instruction and operand in dialog box.

3. After input is entered, then input area line will wrap.

Notice: Instruction input mode: instruction + blank + operand.

The red node means an error has occurred

Page 274: CLP GPM-18 - metaltex.com.br · Você pode programar o CLP GPM tanto em linguagem Ladder como em logica Boleana (lista de instruções). Funções básicas O CLP

XCP Pro user Manual Page 37 of 62 MANUL010R2V1

5-2-4 Special instructions The several instructions mentioned below, can let the user complete an instruction set through the icon dialog box and format the parameter settings at a glance.

1. PID instruction

Ø Parameter settings and instruction transfer

Put the cursor in instruction input point, then click the icon in instruction bar, the parameter set dialog box will pop up, the settings include address, PID parameter in common use, mode settings, overshoot, direction, etc. As follows:

After setting the parameter, click "OK", the instruction will appear in the ladder chart window, as follows:

Ø Parameter modification

To edit parameters, double-click the instruction to modify the addresses. 2, Pulse output instructions

Ø Parameter settings and instruction calling

Page 275: CLP GPM-18 - metaltex.com.br · Você pode programar o CLP GPM tanto em linguagem Ladder como em logica Boleana (lista de instruções). Funções básicas O CLP

XCP Pro user Manual Page 38 of 62 MANUL010R2V1

Position the cursor on instruction input point, then click the icon in instruction bar, parameter setting dialog box will pop up, then set items including instruction types, bit, segment, frequency, accelerate and decelerate time, config, address, etc. As shown below:

When parameter settings are completed, click "OK", this will present to the ladder chart area, shown as follows:

Ø Parameter modification

Modify the parameters, by double-clicking the instructions to modify an address. You can also

single-click the instruction, then click the to modify parameter.

3, High speed counter 24-segment instruction

Ø Set parameter and call instructions.

Click the icon in the instruction bar, parameter config box will pop up. The config items include high speed count; compare value, 24-segment config value, etc. As shown below:

The instruction will appear in ladder chart appointed area, as shown below:

Ø Parameter modification

Double-click the instruction to modify the address. You can modify other parameters via the icon.

Page 276: CLP GPM-18 - metaltex.com.br · Você pode programar o CLP GPM tanto em linguagem Ladder como em logica Boleana (lista de instruções). Funções básicas O CLP

XCP Pro user Manual Page 39 of 62 MANUL010R2V1

4, The G-BOX SMS configuration

When XCP Pro is connected to the G-BOX successfully, you can set the SMS config.

Ø Parameter config and instructions call.

Click the icon in the instruction bar, dialog box will pop up, the config parameter includes instruction name, COM port, phone number, first address, SMS content, as shown below:

Page 277: CLP GPM-18 - metaltex.com.br · Você pode programar o CLP GPM tanto em linguagem Ladder como em logica Boleana (lista de instruções). Funções básicas O CLP

XCP Pro user Manual Page 40 of 62 MANUL010R2V1

5-3-1 Horizontal line and vertical line operation

Insert horizontal line and vertical line

1. Move the dotted line box to input place

2. Click (or press F11 key)

3. Move the dotted line box to upper right of the input place

Icon Functions Shortcut key

Insert horizontal line F11

Insert vertical line F12

Delete horizontal line Shift+F11

Delete vertical line Shift+F12

5-3 Ladder chart editing

Page 278: CLP GPM-18 - metaltex.com.br · Você pode programar o CLP GPM tanto em linguagem Ladder como em logica Boleana (lista de instruções). Funções básicas O CLP

XCP Pro user Manual Page 41 of 62 MANUL010R2V1

Click (or press F12 key)

Delete horizontal line and vertical line

Delete horizontal line: Move the dotted line box to delete place, click or press

Shift+F11 key .

2. Delete vertical line: Move the dotted line box to upper right of the delete place, click or

press Shift+F12 key .

5-3-2 Node and row operation 1. Insert node: move the dotted line box to input place.

2. Click (or press Ins key), node right extension, a blank line will appear in dotted line box.

3. Insert row: move the dotted line box to input place.

Cli

4. Click (or press Ins key), ladder chart down move a row, a blank row will appear in dotted line box.

Page 279: CLP GPM-18 - metaltex.com.br · Você pode programar o CLP GPM tanto em linguagem Ladder como em logica Boleana (lista de instruções). Funções básicas O CLP

XCP Pro user Manual Page 42 of 62 MANUL010R2V1

Ø Delete node: move the dotted line box to input place.

Delete (or press Del key), dotted line box right move a line, a blank line appears.

Ø Delete row: move the dotted line box to input place.

Click (or press Shift+Del key), the row of dotted line box is deleted, the next row up will move a row automatically.

Page 280: CLP GPM-18 - metaltex.com.br · Você pode programar o CLP GPM tanto em linguagem Ladder como em logica Boleana (lista de instruções). Funções básicas O CLP

XCP Pro user Manual Page 43 of 62 MANUL010R2V1

5-3-3 Edit comment In menu bar click View → show node comment, then you can display and close ladder chart node comment. 1, Add soft element comment

Move the dotted line box to comment soft element, right click, then menu will pop up.

Click "Modify Reg Comment " icon, the edit comment box will pop up;

Add and modify words in dialog box;

Click "OK", then show node comment, all the comment information will show in the bottom of the element.

Page 281: CLP GPM-18 - metaltex.com.br · Você pode programar o CLP GPM tanto em linguagem Ladder como em logica Boleana (lista de instruções). Funções básicas O CLP

XCP Pro user Manual Page 44 of 62 MANUL010R2V1

Ø In the mode of ladder chart don't show comment, move the mouse to soft element, then an information box will emerge to show soft element comment information.

Ø Click "Reg Comment" in the left project bar, or click "View" in menu bar→ "Node Comment List", PLC soft element comment table pop up, you can view, modify, and add all soft elements comment in the table. The display mode can be a classified display, it can also be a whole display.

Page 282: CLP GPM-18 - metaltex.com.br · Você pode programar o CLP GPM tanto em linguagem Ladder como em logica Boleana (lista de instruções). Funções básicas O CLP

XCP Pro user Manual Page 45 of 62 MANUL010R2V1

5-3-4 Ladder chart copy and cut

1. Copy: move the dotted line box to input place, press and drag the mouse, the selected area

will show in hi light, click (or press Ctrl+C);

Then move the dotted line box to paste place, click (or press Ctrl+V)

2. Cut: drag mouse and select the cut area, press (or press Ctrl+X), then move the dotted

line box to paste place, click (or press Ctrl+V).

Note: You can press Ctrl to select multi-node for cutting or pasting.

Page 283: CLP GPM-18 - metaltex.com.br · Você pode programar o CLP GPM tanto em linguagem Ladder como em logica Boleana (lista de instruções). Funções básicas O CLP

XCP Pro user Manual Page 46 of 62 MANUL010R2V1

5-3-5 Ladder chart instruction management

1, The fold and unfold of program.

When user procedure is too long, effective instruction management can help with clear area management.

After being folded, the program is much more concise, to help users better grasp of the overall program situation.

2. GROUP/GROUPE

"GROUP/GROUPE" will help to organize sentence into groups, fold/expand are also suitable. "GROUP" and "GROUPE" instructions don't have practical significance, only to organise the program into labelled sections. Usually, a GROUP will start with "GROUP", and ends with "GROUPE", the middle part is the effective user program. The following is an example of GROUP.

At the same time, it is convenient for management, All items are noted in "ladder", double-click to expand.

Page 284: CLP GPM-18 - metaltex.com.br · Você pode programar o CLP GPM tanto em linguagem Ladder como em logica Boleana (lista de instruções). Funções básicas O CLP

XCP Pro user Manual Page 47 of 62 MANUL010R2V1

5-4-1 Relevant configuration 1, In the project bar click PLC config → serial port, serial port set box will pop up.

2, Click "serial port 1", "serial port 2", "serial port 3" to set different serial ports.

3, There are two optional communication modes, "Modbus" and "Free protocol".

4, Click "Read From PLC" to get PLC default parameter.

5, Click "Write Into PLC" to write current parameters into the PLC, then PLC re-power.

5-4 Conventional toolbar

Modbus

communication

Free protocol

communication

Page 285: CLP GPM-18 - metaltex.com.br · Você pode programar o CLP GPM tanto em linguagem Ladder como em logica Boleana (lista de instruções). Funções básicas O CLP

XCP Pro user Manual Page 48 of 62 MANUL010R2V1

5-4-2 Password settings In project bar click PLC Config → Password The password set box will pop up for password setting and modification, work together with lock/unlock functions.

Page 286: CLP GPM-18 - metaltex.com.br · Você pode programar o CLP GPM tanto em linguagem Ladder como em logica Boleana (lista de instruções). Funções básicas O CLP

XCP Pro user Manual Page 49 of 62 MANUL010R2V1

5-4-3 BD board settings In the project bar click PLC Config → BD. The BD set box will pop up.

Ø In "BD Config", you can choose "No config", "BD serial port", or "Other BD board". Ø Click "Read from PLC" to get default BD config parameter. Ø After modifing with BD board parameter, click "Write to PLC" to write set value into PLC. Ø

EX: take "2AD2PT-P" type BD config as example, first pick "other BD" in "BD Config", then choose relevant BD board type in the dialog box.

Click the box before "BD-2AD2PT-P", then "BD-2AD2PT-P config" box will appear in the right. Click drop-down menu to modify its configuration, then click "Write To PLC".

Page 287: CLP GPM-18 - metaltex.com.br · Você pode programar o CLP GPM tanto em linguagem Ladder como em logica Boleana (lista de instruções). Funções básicas O CLP

XCP Pro user Manual Page 50 of 62 MANUL010R2V1

5-4-4 Can-bus communication configuration Click "PLC config" in project bar→"CAN", CAN config settings dialog box will pop up.

Ø Add: first select the configure item, then click "add" button to add address;

Ø Delete: select "configed", click "delete" button.

Note: the add and delete of item can also first select operation item, right-click, choose operation in the pop-up menu.

5-4-5 Power-off, rententive save memory settings In project bar click PLC Setting → Hold Mem Setting. The save hold memory set box will pop up.

The value shown in the right box of each soft element, is the power-off retentive area original address. The "Input Value Range" in the lower left side, show the soft elements effective range.

5-4-6 Expansion module settings Click PLC config → expansion module. The expansion module setting box will pop up.

Click "Read From PLC" to get default configure parameters of expansion module. After you have chosen the settings of expansion module parameters, click "Write To PLC" to write set values into PLC.

Page 288: CLP GPM-18 - metaltex.com.br · Você pode programar o CLP GPM tanto em linguagem Ladder como em logica Boleana (lista de instruções). Funções básicas O CLP

XCP Pro user Manual Page 51 of 62 MANUL010R2V1

5-4-7 I/O settings In project bar click "PLC config" → I/O settings. The I/O setting box pop up.

I/O point mapping: refer to the relevant actual input, output definition of internal soft element number. Such as, set value to be 0 in X0,X1position, then when input terminal is ON, soft element X0,X1 all set ON; if the set value in Y0,Y1 position all are 0, then only while soft element Y1 is ON, output terminal Y0 has export.

In port property: when it's "+", the input and output state is positive logic; when it's "-", the input and output state will be negative logic.

Click E31, pop up drop-

down options, as left shown

Page 289: CLP GPM-18 - metaltex.com.br · Você pode programar o CLP GPM tanto em linguagem Ladder como em logica Boleana (lista de instruções). Funções básicas O CLP

XCP Pro user Manual Page 52 of 62 MANUL010R2V1

5-4-8 Communication mode settings

The default communication mode is serial port, when click "+", it will open TCP/IP device(via .TCP/IP settings) window, as shown below:

Click "Add GBOX" button, users can add communication device here, window will pop up as follows:

Communication mode settings is usually used to set communication mode of computer and connection device(include main unit PLC, net module).

Page 290: CLP GPM-18 - metaltex.com.br · Você pode programar o CLP GPM tanto em linguagem Ladder como em logica Boleana (lista de instruções). Funções básicas O CLP

XCP Pro user Manual Page 53 of 62 MANUL010R2V1

Set relevant parameters in the window, create parameter set, please refer to <<Wireless data transmission module G-BOX user manual>>, not repeated here. The communication mode setting interface has changed, item UDP is activated, network type is activated also. Usually G-BOX use internal network type, while T-BOX uses external network type, as shown below:

Communication mode settings can also be done via clicking PLC name in project bar, right click, select "Edit PLC Communication Mode" in pop-up menu, as shown below:

5-4-9 TCP/IP settings Set window is the same as "TCP/IP device", it can only activate UDP communication after TCP/IP device configured

Page 291: CLP GPM-18 - metaltex.com.br · Você pode programar o CLP GPM tanto em linguagem Ladder como em logica Boleana (lista de instruções). Funções básicas O CLP

XCP Pro user Manual Page 54 of 62 MANUL010R2V1

5-4-10 Function block list The window is use to show used C language function block and relevant information.

Function block directly compiles in software, it will save as export after completion, and can be directly transferred in ladder chart, shown as below:

Page 292: CLP GPM-18 - metaltex.com.br · Você pode programar o CLP GPM tanto em linguagem Ladder como em logica Boleana (lista de instruções). Funções básicas O CLP

XCP Pro user Manual Page 55 of 62 MANUL010R2V1

After confirming the input function block basic information, you will find a "FUN1" added in the project bar, as shown below:

Click "FUN1", the following interface will appear in the main window, users can edit the program here.

Page 293: CLP GPM-18 - metaltex.com.br · Você pode programar o CLP GPM tanto em linguagem Ladder como em logica Boleana (lista de instruções). Funções básicas O CLP

XCP Pro user Manual Page 56 of 62 MANUL010R2V1

5-5-1 soft element comment

Click "Reg comment" in project bar, soft element comments window will pop up, you can see all or part of the soft element comment, double-click comment bar will edit the comment.

Click "used" in the window, the used soft element window will pop up, and the used element number will be listed respectively.

5-5 Soft element monitor

Page 294: CLP GPM-18 - metaltex.com.br · Você pode programar o CLP GPM tanto em linguagem Ladder como em logica Boleana (lista de instruções). Funções básicas O CLP

XCP Pro user Manual Page 57 of 62 MANUL010R2V1

5-5-2 Free monitor Click "free monitor" in project bar, the free monitor window will pop up.

Click "Add", "monitor node input" window will pop up: input the monitor soft element capital address in "Monitor Reg" bar, set the continuous monitoring soft elements number in "Num", select soft element monitor method in "Monitor Mode" bar, select soft element show mode in "Show Mode" bar.

After adding the, serial number, value, word length, number format and comment of relevant element list in monitor window, double-click edit its attribute.

Page 295: CLP GPM-18 - metaltex.com.br · Você pode programar o CLP GPM tanto em linguagem Ladder como em logica Boleana (lista de instruções). Funções básicas O CLP

XCP Pro user Manual Page 58 of 62 MANUL010R2V1

5-5-3 Data monitor Click "data monitor" in the project bar, the data monitor window will pop up. Data monitoring loop state or data register value in the list or the register value can also be modified and the loop state directly.

1. Mouse double-click loop, then state negation; double-click register, then activate value modification, press enter to confirm input. 2. Input relevant soft element number in search bar, press enter, monitor table will automatically

jump to relevant place.

3. When loop state is OFF, it's blue-background black word; when is ON, it's green-background white word, shown as below:

Page 296: CLP GPM-18 - metaltex.com.br · Você pode programar o CLP GPM tanto em linguagem Ladder como em logica Boleana (lista de instruções). Funções básicas O CLP

XCP Pro user Manual Page 59 of 62 MANUL010R2V1

5-5-4 Ladder chart monitor When the PLC connection is successful and in the run state, it is especially useful for program debugging.

Click icon in toolbar, open ladder chart monitor, soft element states of program are shown, loop in green-background white-word is ON state, real-time data in timer, register shows also in ladder chart, shown as follows:

For convenient debugging, users can right-click soft elements, change the current state, and monitor the revised operating results.

Page 297: CLP GPM-18 - metaltex.com.br · Você pode programar o CLP GPM tanto em linguagem Ladder como em logica Boleana (lista de instruções). Funções básicas O CLP

XCP Pro user Manual Page 60 of 62 MANUL010R2V1

5-5-5 Information bar Information bar contains "Error information" and "Output". Error information: for showing syntax and run error, generally speaking, when users edit ladder chart, if sentence error, press enter, it will show in red, and show error in error information list. Shown as follows:

If only checking one sentence, you can click "PLC operate"→"Grammar check". Double-click error information, then cursor will position to error place automatically, shown as below:

Output: Usually when PLC run is in error, relevant information written into output bar, prompt the operation error. As shown below:

The display of information, data monitor and free monitor can switch via as shown below:

Page 298: CLP GPM-18 - metaltex.com.br · Você pode programar o CLP GPM tanto em linguagem Ladder como em logica Boleana (lista de instruções). Funções básicas O CLP

XCP Pro user Manual Page 61 of 62 MANUL010R2V1

5-5-6 Status bar The status bar not only shows the relevant information of the current enabled PLC, but users can double-click the status display information, to quickly open the modify attributes window.

Documentation Reference

Document Number

Revision

Date

MANU L010 R1 V1 01/09/2009

XINJE IS A REGISTERED TRADEMARK OF XINJE ELECTRICAL CO.LTD.

REPLICATION OF THE INFORMATION CONTAINED WITHIN THIS DOCUMENT WITHOUT PRIOR NOTIFICATION AND AGREEMENT IS PROHIBITED.

Page 299: CLP GPM-18 - metaltex.com.br · Você pode programar o CLP GPM tanto em linguagem Ladder como em logica Boleana (lista de instruções). Funções básicas O CLP

XCP Pro user Manual Page 62 of 62 MANUL010R2V1

Documentation Reference

Document Number Revision Date

MANU L010 R2 V1 05/07/2011

XINJE IS A REGISTERED TRADEMARK OF XINJE ELECTRICAL CO.LTD.

REPLICATION OF THE INFORMATION CONTAINED WITHIN THIS DOCUMENT WITHOUT PRIOR NOTIFICATION AND AGREEMENT IS PROHIBITED.

Engineered and supplied by:

International partners with:

Web: www.listo-ltd.com

www.xinje-support-centre-listo.com E-mail: [email protected] Please consider the environment before printing this document

Page 300: CLP GPM-18 - metaltex.com.br · Você pode programar o CLP GPM tanto em linguagem Ladder como em logica Boleana (lista de instruções). Funções básicas O CLP

!

"#$%%#

&

' (&

'&

&

&

! )(&

( ')&

* &

!*(&

) ''!&

"+

&

' *&

,-%#+%

&

'&

+%%#

-

'

.$/

.#/

Definição do protocolo de comunicação FD8221.

No exemplo utilizou-se por conveniência o valor FD8221 = “6” (0000 0000 0000 0110) que

corresponde à seguinte configuração:

Sem Paridade;

2 stop bits;

8 bits;

19.2kbps.

'! ' ' ' '' ' ) * ( ! '

Page 301: CLP GPM-18 - metaltex.com.br · Você pode programar o CLP GPM tanto em linguagem Ladder como em logica Boleana (lista de instruções). Funções básicas O CLP

111111111

1Rua José Rafaeli, 221 Socorro 04763-280 [email protected]

São Paulo SP Brasil www.metaltex.com.br (11) 5683-5713 / 5683-5712 11

Nota de Aplicação

Comunicação ModBus CLP GPM-18 com Inversor TECO L510

Engenharia de Aplicações

Page 302: CLP GPM-18 - metaltex.com.br · Você pode programar o CLP GPM tanto em linguagem Ladder como em logica Boleana (lista de instruções). Funções básicas O CLP

211111122

2Rua José Rafaeli, 221 Socorro 04763-280 [email protected]

São Paulo SP Brasil www.metaltex.com.br (11) 5683-5713 / 5683-5712 22

ConteúdoObjetivo: ..................................................................................................................................3

Introdução: .............................................................................................................................. 3

Parâmetros do Inversor ...........................................................................................................4

Parâmetros do CLP................................................................................................................. 4

Definição das Instruções do CLP ............................................................................................ 6

Endereçamento do Inversor ....................................................................................................7

Exemplo Programa do CLP.....................................................................................................8

Exemplo Programa da IHM ...................................................................................................10

Informações Gerais ............................................................................................................... 11

Page 303: CLP GPM-18 - metaltex.com.br · Você pode programar o CLP GPM tanto em linguagem Ladder como em logica Boleana (lista de instruções). Funções básicas O CLP

311111133

3Rua José Rafaeli, 221 Socorro 04763-280 [email protected]

São Paulo SP Brasil www.metaltex.com.br (11) 5683-5713 / 5683-5712 33

NOTA DE APLICAÇÃO:Comunicação ModBus CLP GPM-18 Inversor TECO L510.

Objetivo:

Esta nota tem por objetivo demonstrar todo o procedimento para estabelecer uma comunicação entre oCLP Metaltex série GPM-18 com os inversores de frequência TECO família L510, utilizando o protocolo decomunicação ModBus.

Introdução:No exemplo a seguir foi utilizado um CLP Metaltex série GPM-18T (canal 2 | RS485) como mestre na redee um inversor de frequência TECO L510 (canal RS485 RJ45) como escravo na rede, comunicando-seatravés de um par de cabos (shield) e utilizando o protocolo de comunicação ModBus-RTU.

Serão demonstradas operações básicas de controle do inversor, como:

Start (fwd/rev) / Stop;

Controle de frequência;

Leitura da frequência.

Leitura de corrente de saída.

Leitura de tensão de saída.

Leitura tensão Barramento DC.

CLP Metaltex

GPM-18

A B

Inversor

TECO L510

2 1

(DATA-) (DATA+)

Page 304: CLP GPM-18 - metaltex.com.br · Você pode programar o CLP GPM tanto em linguagem Ladder como em logica Boleana (lista de instruções). Funções básicas O CLP

411111144

4Rua José Rafaeli, 221 Socorro 04763-280 [email protected]

São Paulo SP Brasil www.metaltex.com.br (11) 5683-5713 / 5683-5712 44

Parâmetros do Inversor

Parâmetros a serem alterados via teclado do próprio inversor.

00-02 = “2” Origem do controle de operação (Via serial RS485)

00-05 = “5” Origem do controle de frequência (Via serial RS485)

09-00 = “1” Endereço na rede (Escravo 01)

09-01 = “0” Seleciona protocolo Modbus em formato RTU09-02 = “2” Taxa de comunicação (19.2kbps)

09-03 = “1” Seleciona 2 Stop Bits na comunicação Modbus

09-04 = “0” Seleciona checagem do pacote Modbus sem paridade.

IMPORTANTE:Nunca coloque o inversor TECO com o endereço na rede igual a zero (0), pois esseendereço é utilizado pelo mestre. Nunca utilizar fio sem blindagem para a comunicação entre o CLP e oinversor.

Parâmetros do CLP Parâmetros a serem alterados via IHM do próprio CLP.

FD8220 = “1” Endereço na rede COM2 (1=mestre | 2=escravo 1| .... | N=escravo N-1)

FD8221 = “6” Protocolo de comunicação (19.2kbps, 8 bits, sem paridade, 2 stop bits)

IMPORTANTE: Depois de efetuado os carregamentos nos registradores especiais (FD8220/FD8221) doCLP, deve-se obrigatoriamente desligar e ligar o CLP, para as alterações entrarem em vigor.

Page 305: CLP GPM-18 - metaltex.com.br · Você pode programar o CLP GPM tanto em linguagem Ladder como em logica Boleana (lista de instruções). Funções básicas O CLP

511111155

5Rua José Rafaeli, 221 Socorro 04763-280 [email protected]

São Paulo SP Brasil www.metaltex.com.br (11) 5683-5713 / 5683-5712 55

VELOCIDADE

0:300 bps

1:600 bps

2:1200 bps

3:2400 bps

4:4800 bps

5:9600 bps

6:19200 bps

7:38400 bps

8:57600 bps

9:115200 bps

PALAVRA

0:8 bits

1:7 bits

BITS DE PARADA

0:2 stop bits

2:1 stop bit

PARIDADE

0:Sem

1:Impar(Odd)

2:Par (Even)

Definição do protocolo de comunicação FD8221.

No exemplo utilizou-se por conveniência o valor FD8221 = “6” (0000 0000 0000 0110) que corresponde àseguinte configuração:

Sem Paridade;

2 stop bits;

8 bits;

19.2kbps.

15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0

Page 306: CLP GPM-18 - metaltex.com.br · Você pode programar o CLP GPM tanto em linguagem Ladder como em logica Boleana (lista de instruções). Funções básicas O CLP

611111166

6Rua José Rafaeli, 221 Socorro 04763-280 [email protected]

São Paulo SP Brasil www.metaltex.com.br (11) 5683-5713 / 5683-5712 66

Definição das Instruções do CLP Função do CLP REGR (Read Register Instruction- Código ModBus 03H). Efetua a leitura de um ou

mais dados (registradores) do escravo.

R E G R K 1 K 5 0 0 K 3 D 1X 0

K 2

S 1 · S 2 · S 3 · D 1 · D 2 ·

Onde:

S1 Numero do escravo na rede.

S2 Endereço inicial da memória do escravo a ser lido.

S3 Quantidade de registros a serem lidos a partir do endereço inicial.

D1 Ponteiro do registrador do mestre para armazenamento dos dados.

D2 Canal de comunicação do CLP (COM1/ COM2).

Função do CLP REGW (Write Single Register Instruction – Código ModBus 06H). Envia um dado(valor) para um registrador.

R E G W K 1 K 5 0 0 D 1X 0

K 2

D 1 · S 1 · S 2 ·D 2 ·

Onde:

D1 Numero do escravo na rede.

D2 Endereço de memória do escravo para escrita.

S1 Registrador com o valor a ser carregado no escravo

S2 Canal de comunicação do CLP (COM1/ COM2).

Page 307: CLP GPM-18 - metaltex.com.br · Você pode programar o CLP GPM tanto em linguagem Ladder como em logica Boleana (lista de instruções). Funções básicas O CLP

711111177

7Rua José Rafaeli, 221 Socorro 04763-280 [email protected]

São Paulo SP Brasil www.metaltex.com.br (11) 5683-5713 / 5683-5712 77

Endereçamento do InversorDados fornecidos pelo fabricante do produto, no exemplo TECO

Escrita endereços Modbus

BIT LIGA-DESLIGA

BIT SENTIDO DEGIRO

ENDEREÇO ESCRITAFREQUÊNCIA

ENDEREÇOS LEITURAFREQUÊNCIA DE

COMANDO, FREQUÊNCIADE SAÍDA, TENSÃO DE

SAÍDA, TENSÃOBARRAMENTO DC ECORRENTE DE SAÍDA

Page 308: CLP GPM-18 - metaltex.com.br · Você pode programar o CLP GPM tanto em linguagem Ladder como em logica Boleana (lista de instruções). Funções básicas O CLP

811111188

8Rua José Rafaeli, 221 Socorro 04763-280 [email protected]

São Paulo SP Brasil www.metaltex.com.br (11) 5683-5713 / 5683-5712 88

Exemplo Programa do CLP Para efetuar a leitura da frequência de comando, frequência de saída, tensão de saída, tensão

no barramento DC e corrente de saída do inversor, vamos utilizar a função do CLP REGR (ReadRegister Instruction- Código ModBus 03H).

Essa instrução irá perguntar ao escravo (inversor) o valor atual da posição de memória “2523H” até “2527”que nos inversores TECO L510 corresponde ao valor atual da frequência de comando, frequência desaída, tensão de saída, tensão no barramento DC e corrente de saída, e armazenar esse valor noregistrador D100 até D104.

Para efetuar a escrita da frequência, vamos utilizar a função do CLP REGW (Write SingleRegister Instruction – Código ModBus 06H).

Essa instrução irá enviar ao escravo o valor atual do registrador D4000 para a posição de memória doescravo “2502H”, que nos inversores TECO L510 corresponde à frequência programada(comando).

Page 309: CLP GPM-18 - metaltex.com.br · Você pode programar o CLP GPM tanto em linguagem Ladder como em logica Boleana (lista de instruções). Funções básicas O CLP

911111199

9Rua José Rafaeli, 221 Socorro 04763-280 [email protected]

São Paulo SP Brasil www.metaltex.com.br (11) 5683-5713 / 5683-5712 99

Para enviar o comando Stop, vamos utilizar a função do CLP REGW (Write Single RegisterInstruction – Código ModBus 06H).

Essa instrução irá enviar ao escravo a constante “0” em hexadecimal para a posição de memória doescravo “2501H”, que nos inversores TECO L510 corresponde ao comando de Stop.

Para enviar o comando Start, vamos utilizar a função do CLP REGW (Write Single RegisterInstruction – Código ModBus 06H).

Essa instrução irá enviar ao escravo a constante “1” ou “3” em hexadecimal para a posição de memória doescravo “2501H”, que nos inversores TECO L510 corresponde ao comando de FWD ou REV.

Page 310: CLP GPM-18 - metaltex.com.br · Você pode programar o CLP GPM tanto em linguagem Ladder como em logica Boleana (lista de instruções). Funções básicas O CLP

101111111010

10Rua José Rafaeli, 221 Socorro 04763-280 [email protected]

São Paulo SP Brasil www.metaltex.com.br (11) 5683-5713 / 5683-5712 1010

Exemplo Programa da IHM

Após definidos os endereços de troca de dados entre o CLP e o Inversor pode-se elaborar as telas, conformeexemplo:

Page 311: CLP GPM-18 - metaltex.com.br · Você pode programar o CLP GPM tanto em linguagem Ladder como em logica Boleana (lista de instruções). Funções básicas O CLP

111111111111

11Rua José Rafaeli, 221 Socorro 04763-280 [email protected]

São Paulo SP Brasil www.metaltex.com.br (11) 5683-5713 / 5683-5712 1111

Informações Gerais

PRODUTOS ELETRÔNICOS METALTEX LTDA.

Rua José Rafaelli, 221 - Socorro - Sto. Amaro - São Paulo/ SP

CEP: 04763-280 -Brasil - Tel. (11)5683-5713 Fax: (011)5524-2324

E-mail: [email protected]

Site: www.metaltex.com.br

Autor: Fabio Souza Faria

Setor: Engenharia de Aplicações (SP)

Arquivos: Nota de Aplicação – ModBus – GPM – TECO L510 Ver_01.pdf

Revisão: 0

São Paulo, 29 de Maio de 2014