en:software:devices:modbus

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
Next revisionBoth sides next revision
en:software:devices:modbus [2016/12/27 14:40] – [6.3.4. Stati] qem103en:software:devices:modbus [2016/12/27 15:01] – [Esempio:] qem103
Line 563: Line 563:
 |wcmd|F|0|R|-|**Warning Command**\\ This bit indicates that it did not execute a command because they lack the necessary conditions.| |wcmd|F|0|R|-|**Warning Command**\\ This bit indicates that it did not execute a command because they lack the necessary conditions.|
  
-=== - Comandi === +=== - Commands ===
-I comandi a disposizione per gestire il device sono elencati sotto in ordine di priorità decrescente.\\ +
-Il device esegue tutti i comandi ricevuti entro lo stesso tempo di campionamento iniziando da quello con la priorità maggiore.\\ +
-Per esempio se il device riceve nello stesso tempo di campionamento i comandi CLOSECOM e OPENCOM, per primo esegue il comando OPENCOM e poi quello di CLOSECOM lasciando perciò la porta di comunicazione chiusa. +
-^ Nome      ^ D  ^ R  ^ A  ^ Condizioni                                   ^ Descrizione                                                                                                                                                        ^ +
-| RECEIVED  | -  | -  | -  | st_msgrx = 1\\ mode = 1, 2\\ st_opencom = 1  | **Received**\\ Utilizzato solamente in modalitá slave. Indica che l’applicativo QCL ha processato le informazioni che il master ha inviato                         | +
-| VALIDATE  | -  | -  | -  | mode = 1, 2\\ st_opencom = 1                 | **Validate**\\ Indica che i parametri di scambio dati QCL diventano disponibili al master.                                                                         | +
-| CLRWDATA  | -  | -  | -  | -                                            | **Clear Warning Data**\\ Azzera la segnalazione del parametro wdata                                                                                                | +
-| CLRWCMD   | -  | -  | -  | -                                            | **Clear Warning Command**\\ Azzera la segnalazione del parametro wcmd                                                                                              | +
-| OPENCOM   | -  | -  | -  | st_opencom = 0                               | **Open Serial communication**\\ Apre la comunicazione seriale (il device quindi impegna la porta di comunicazione). Lo stato //st_opencom// diventa 1.             | +
-| CLOSECOM  | -  | -  | -  | -                                            | **Close Serial communication**\\ Chiude la comunicazione seriale (il device quindi non impegna piú la porta di comunicazione). Lo stato //st_opencom// diventa 0.  |+
  
 +The available commands to manage the device are listed below in descending order of priority.\\
 +The device executes all commands received within the same sampling time starting from the one with the highest priority.\\
 +For example if the device receives the same sampling time CLOSECOM and OPENCOM commands, first run the OPENCOM command and than to CLOSECOM leaving therefore the communication port closed.
  
 +^ Name      ^ D  ^ R  ^ A  ^ Conditions                                   ^ Description                                                                                                                                                        ^
 +| RECEIVED  | -  | -  | -  | st_msgrx = 1\\ mode = 1, 2\\ st_opencom = 1  | **Received**\\ Used only in slave mode. Indicates that the QCL application has processed the information that the master has sent                         |
 +| VALIDATE  | -  | -  | -  | mode = 1, 2\\ st_opencom = 1                 | **Validate**\\ Indicates that the parameters of the QCL data exchange becomes available to the master.                                                                         |
 +| CLRWDATA  | -  | -  | -  | -                                            | **Clear Warning Data**\\ Reset the wdata parameter reporting                                                                                                |
 +| CLRWCMD   | -  | -  | -  | -                                            | **Clear Warning Command**\\ Reset the wcmd parameter reporting                                                                                              |
 +| OPENCOM   | -  | -  | -  | st_opencom = 0                               | **Open Serial communication**\\ Open the serial communication (the device then committed the communications port). The //st_opencom// state changes to 1.             |
 +| CLOSECOM  | -  | -  | -  | -                                            | **Close Serial communication**\\ Closes the serial communication (the device then does not commit more the communications port). The //st_opencom// state changes to 0.  |
  
-===== - Migrazione dal device MODBUS01 al device MODBUS ===== 
  
-Il primo aspetto da tenere presente per la migrazione è il fatto che il device MODBUS01 è esterno mentre il MODBUS è 
-interno. Questo implica che la dichiarazione del device deve essere eseguita nella sezione “INTDEVICE” dell’unità di 
-configurazione del progetto. Inoltre, questo comporta la scelta, durante la definizione del device MODBUS, del tempo di 
-campionamento. Il valore del tempo di campionamento che mantiene inalterate le prestazioni della comunicazione tra i 
-due device è pari a 5 ms. Bisogna inoltre, in fase di definizione, selezionare la seriale da impegnare.\\ 
-Il device MODBUS ha aumentato il numero di variabili di scambio (da 16 word a 32 word) ma questo non influenza il funzionamento 
-per le impostazioni che utilizzano al massimo 16 word come sono quelle pensate per il device MODBUS01.\\ 
-Il device MODBUS ha limitato la variabile “num” a 128, mentre per il device MODBUS01 il limite è 256. Questo si è reso 
-necessario per permettere un’ottimizzazione del tempo di campionamento. La scelta è stata presa in considerazione del 
-fatto che tali valori venivano impiegati unicamente per la gestione dei Coils, ma che perdeva di logica la lettura/scrittura di 
-più di 128 coils consecutivi.\\ 
-Il device MODBUS consente di controllare (mediante 2 nuovi comandi) l'impegno della seriale di comunicazione da parte 
-del device. Questa nuova funzionalitá è interessante nell'eventualità che in un progetto Qview siano stati dichiarati altri 
-devices che possono utilizzare la stessa seriale.\\ 
-Se un applicativo era stato scritto per il device MODBUS01 bisogna aggiungere il comando OPENCOM (eseguito anche 
-solo una volta) come mostrato nel seguente esempio. 
  
-==== Esempio: ====+===== - Migration from MODBUS01 device to MODBUS device ===== 
 + 
 +The first thing to note for migration is the fact that the MODBUS01 device is external, while the MODBUS is internal. This implies that the device declaration must be done in “INTDEVICE” section in the configuration unit of the project. In addition, this entails choosing, when defining the MODBUS device, of the sampling time. The value of the sample time that keeps the performance of communication between the two devices is 5 ms. Being defined, you must select the serial port to be committed.\\ 
 +The MODBUS device increased the number of exchange variables (from 16 word to 32 word) but this does not affect the operation for settings that use the maximum 16 word How are those designed for the MODBUS01 device.\\ 
 +The MODBUS device has restricted the “num” variable to 128, while the MODBUS01 device the limit is 256. This was necessary to allow an optimization of sampling time. The decision was taken in view of the fact that those values were used only for Coils managing, but that was logic leaking more than read/write 128 consecutive coils.\\ 
 +The MODBUS device allows you to control (using 2 new commands) communication serial's commitment on the part of the device. This new functionality is interesting in the event that other devices have been declared in a project Qview that can use the same serial.\\ 
 +If an application was written for the MODBUS01 device you must add the OPENCOM command (executed only once) as shown in the following example. 
 + 
 +==== Example: ====
  
 <code QCL> <code QCL>
-impostazione dei parametri di comunicazione+setting communication parameters
 modbus.mode = 0 modbus.mode = 0
 modbus.brate = 38400 modbus.brate = 38400
Line 614: Line 605:
 WAIT modbus.st_sended WAIT modbus.st_sended
 IF (modbus.err) IF (modbus.err)
-    CALL ErroreModbus+    CALL ErrorModbus
 ENDIF ENDIF
 </code> </code>
  
  
  • Last modified: 2020/07/13 14:58