Upload
louie-carre
View
122
Download
10
Embed Size (px)
Citation preview
Proposition de correction des
exercices de cours
Automatismes séquentiels II
Langage IL: Exercice1
1°) Ecrire le programme IL qui code l’équation combinatoire suivante:
Résultat=a1+(a2*(a3-a4)*a5)+a6
LD a1ADD( a2MUL( a3SUB a4)MUL a5)ADD a6ST Résultat
Langage IL: Exercice2
2°) Ecrire le programme IL qui code les instructions FDB suivantes
LD auto_modeAND start_cmdST MemoireCommande.SLD stop_cmdST MemoireCommande.RCAL MemoireCommandeLD MemoireCommande.QST Command
Langage IL: Exercice3
3°) Ecrire un bloc fonctionnel AFFECTE qui a pour argument un entier non signé« Selecteur » et qui si Selecteur=i i∈{0,1,2} positionne un bit de sortie bsi à TRUE i∈{0,1,2} sans modifier les autres bits
Ecrire une séquence d’instruction IL qui appelle ce bloc et lit un des 3 bits de sortie
FUNCTION_BLOCK AFFECTEVAR_INPUT
selecteur: INT;END_VARVAR_IN_OUT
Bs0:BOOL;BS1:BOOL;Bs2:BOOL;END_VAR
LD selecteurJMPC test1LD TRUEST bs0RETTest1: LD selecteur SUB 1JMPC test2LD TRUEST bs1RETTest2: SUB 1RETCNLD TRUEST bs2
END_FUNCTION_BLOCK
Langage FDB: Exercice1/2
Partie déclarative
Code FDB
Langage FDB: Exercice2/2
Instanciation : ffg
Grafcet: Exercice de base
3 possibilités… parmi d’autres encore.
Le Grafcet est un langage de description.
Ce langage permet de décrire un même fonctionnement de différentes manières.
Proposition 1
Proposition 2 Proposition 3
Grafcet: Jeux des 7 erreurs
1°) Pas d’étape initiale2°) Etape 22 fugace, pas d’action continue sur Etape223°) La transition 24->25 ne sera jamais franchie4°) Erreur de Syntaxe: Convergence en ET Fausse 5°) 2 fronts decorrélés ne peuvent survenir en même temps. Transition 32->21 jamais franchie6°) Réceptivité X29 jamais franchie (Synchronisation avec un état futur…)7°) Erreur de Syntaxe: Divergence en ET puis Convergence en OU
GrafcetTranscription en LD/IL 1/2
€
Si M 0 ⋅M1 ⋅M 2 ALORS M0 =1
€
t0 = M0 ⋅a
t1 = M1 ⋅b
t2 = M2⋅↑ c
€
M0 = t2 + t0 ⋅M0
M1 = t0 + t1 ⋅M1
M2 = t1 + t2 ⋅M2
€
A = M1 + M2 ⋅d
B = M2
Equations correspondantes à transcrire
Réseau LD correspondant:
GrafcetTranscription en LD/IL 2/2
€
Si M 0 ⋅M1 ⋅M 2 ALORS M0 =1
€
t0 = M0 ⋅a
t1 = M1 ⋅b
t2 = M2⋅↑ c
€
M0 = t2 + t0 ⋅M0
M1 = t0 + t1 ⋅M1
M2 = t1 + t2 ⋅M2
€
A = M1 + M2 ⋅d
B = M2
Equations correspondantes à transcrire
Code IL correspondant:
LD M0OR M1OR M2JMPC L1LD TRUEST M0L1:LD CANDN M100ST fmcLD CST M100LD M0AND aST t0LD M1AND bST t1LD M2AND fmcST t2LD M0ANDN t0OR t2ST M0LD M1ANDN t1OR t0ST M1LD M2ANDN t2OR t1ST M2LD M2AND dOR M1ST ALD M2ST B