Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
en:appnote:an007 [2017/04/28 18:17] – [Creare una visualizzazione mista non ricorsiva] qem103en:appnote:an007 [2019/08/29 17:01] (current) – external edit 127.0.0.1
Line 415: Line 415:
 </code> </code>
  
-==== Creare una visualizzazione mista non ricorsiva ==== +==== Create a mixed non-recursive visualization ==== 
-FIXME + 
-Si voglia creare una visualizzazione di un messaggio composto dalla stringa "Error" e da un numero identificativo dell'errore che appaia quando si verifica un errorementre normalmente venga visualizzatoin maniera ricorsiva, il valore di un conteggioPer realizzare questosfruttiamo il funzionamento di sola visualizzazione di un valore numerico presente nella funzionalità del comando //DATAENTRY// ed abilitata impostando a il bit //DE_ENABLE// del parametro //deflags//Per semplicitàrealizzeremo una condizione fittizia di errore tramite la fine di un timer caricato a 5 sec. Come vedremosarà importante ricordarsi di disabilitare la visualizzazione ricorsiva prima di visualizzare il messaggio di errorealtrimenti il risultato non sarà quello che ci si aspetta.\\ +You want to create a view of a message consisting of the "Error" string and an identification number of the error that appears when occurs an errorwhile normally appearsrecursively the counter valueTo achieve thiswe exploit the functioning can only be displayed by a numerical value present in //DATAENTRY// command functionality and enabled by setting to the //DE_ENABLE// bits of the //deflags// parameterFor simplicitywe'll create fictitious error condition by the end of a timer uploaded to 5 sec. As will seeIt will be important to remember to disable recursive view before showing the error messageotherwise the result will not be what you expect.\\ 
-Il codice risulta essere+The code is
  
 <code QCL> <code QCL>
Line 426: Line 426:
  dvHMI:dis6 = CHAR_C  dvHMI:dis6 = CHAR_C
   
- ;configura e abilita screenA+ ;Configure and enable screenA
  dvHMI:ncharA = 6  dvHMI:ncharA = 6
  dvHMI:offsA = 0  dvHMI:offsA = 0
Line 432: Line 432:
  dvHMI:scflags = dvHMI:scflags ORB SCRA_ENABLE  dvHMI:scflags = dvHMI:scflags ORB SCRA_ENABLE
  
- tm01 = 5000 ;utilizzo del timer per causare un errore+ tm01 = 5000 ;how to use the timer to cause an error
  
 LOOP: LOOP:
Line 440: Line 440:
  ;Errore?  ;Errore?
  IF tm01  IF tm01
- ;disabilita screenA+ ;disable screenA
  dvHMI:scflags = dvHMI:scflags ANDB ( NOT SCRA_ENABLE )  dvHMI:scflags = dvHMI:scflags ANDB ( NOT SCRA_ENABLE )
  CALL ERROR  CALL ERROR
Line 451: Line 451:
          
 SUB ERROR SUB ERROR
- ;stampa "ERROR"+ ;print "ERROR"
  dvHMI:dis6 = CHAR_E  dvHMI:dis6 = CHAR_E
  dvHMI:dis5 = CHAR_R  dvHMI:dis5 = CHAR_R
Line 459: Line 459:
  
   
- ;stampa errore con identificativo+ ;printing error with the ID
  dvHMI:deoffs = 0  dvHMI:deoffs = 0
  dvHMI:denchar = 2  dvHMI:denchar = 2
Line 467: Line 467:
  DATAENTRY dvHMI  DATAENTRY dvHMI
  
- ;attesa secondi+ ;wait seconds
  tm01 = 2000  tm01 = 2000
  WAIT tm01  WAIT tm01
Line 476: Line 476:
 </code> </code>
  
-==== Diagnostica Ingressi ====+==== Diagnostic Inputs ====
  
-Si voglia creare una visualizzazione che rappresenti lo stato di ingressi digitaliLo stesso esempio potrà essere poi utilizzato per la rappresentazione di uscite digitaliAssegneremo perciòad ogni ingresso, uno dei segmenti di ciascuno dei tre digit più a destra e lo attiveremo quando il corrispondente ingresso sarà attivo.\\ +You want to create a view that represents the State of digital inputsThe same example can be used for the representation of digital outputsWe will assign to each inputone of the segments of each of the three rightmost digit and we will activate when the corresponding input will be active.\\ 
-La figura mostra l'assegnamento scelto per gli ingressi ed i segmenti dei digit del display:+The figure shows the assignment chose for the inputs and segments of the digits of the display:
  
 {{:software:devices:hmi:an007:an_hmi2_01.png?nolink400|}} {{:software:devices:hmi:an007:an_hmi2_01.png?nolink400|}}
  
-Innanzitutto dichiareremonella unit di configurazione, 9 variabili di dimensione FLAG il cui valore simulerà lo stato dei ingressi digitali.+First we will declarein the configuration unit, 9 variables of FLAG dimensions whose value will simulate the condition of digital inputs.
  
 <code QCL> <code QCL>
Line 498: Line 498:
 </code> </code>
  
-Dichiareremo poi anche un array global da elementi che servirà per contenere i codici dei caratteri da stampare per ogni combinazione degli ingressi.+We will declare a global array to items that will serve to hold character codes to print for each combination of inputs.
  
 <code QCL> <code QCL>
 ARRGBL ARRGBL
- diagnTab B 8 ;tabella caratteri per diagnostica+ diagnTab B 8 ;character table for Diagnostics
 </code> </code>
  
-Infatti per ogni gruppo di tre ingressi associati ad uno dei tre digit sul display avremo possibili combinazioniLa tabella riassumead esempioper la combinazione degli ingressi I7,I8 ed I9, i possibili lo stati del digit associato:+In fact, for each group of three inputs associated with one of the three digits on the display we will have possible combinationsFor examplethe table summarizes the possible States of the digit associated withthe combination of inputs I7,I8 ed I9:
  
 ^I7^I8^I9^Display^ ^I7^I8^I9^Display^
Line 517: Line 517:
 |1|1|1|$| |1|1|1|$|
  
-Servirà infine anche la definizione di alcune costanti da utilizzare come maschera per bit generici di un byte:+Will finally also defining some constants to be used as a mask for generic bits of a byte:
  
 <code QCL> <code QCL>
Line 533: Line 533:
 </code> </code>
  
-Il codice completo per ottenere la funzione di diagnostica è:+The complete code to obtain the diagnostic function is:
  
 <code QCL> <code QCL>
-;inizializza tabella+;Initializes table
   diagnTab[1] = CHAR_   diagnTab[1] = CHAR_
   diagnTab[2] = CHAR_UP   diagnTab[2] = CHAR_UP
Line 546: Line 546:
   diagnTab[8] = CHAR_LOWUPCE   diagnTab[8] = CHAR_LOWUPCE
  
- ;stampa messaggio "INP."  + ;print "INP." message
  hmi:dis6 = CHAR_I  hmi:dis6 = CHAR_I
  hmi:dis5 = CHAR_N   hmi:dis5 = CHAR_N
  • Last modified: 2019/08/29 17:18