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
en:software:devices:modbus [2016/12/27 14:32] – [6.3.2. Parameters] qem103en:software:devices:modbus [2020/07/13 14:58] (current) qem103
Line 1: Line 1:
 ====== DEVICE MODBUS ====== ====== DEVICE MODBUS ======
-===== - Introduction =====+====== - Introduction ======
  
 The MODBUS<sup>®</sup> protocol represents an industrial communication system distributed and developed by Gould-Modicon to integrate PLC’s, computers, terminals, inverter and other devices. MODBUS is a Master/Slave communication protocol where only one device can be Master and monitors all activities of the serial line or TCPIP. As for the serial line can be connected up to a maximum of 247 slave along the same lines. Each device is assigned an address that distinguishes it from all other connected devices.\\ The MODBUS<sup>®</sup> protocol represents an industrial communication system distributed and developed by Gould-Modicon to integrate PLC’s, computers, terminals, inverter and other devices. MODBUS is a Master/Slave communication protocol where only one device can be Master and monitors all activities of the serial line or TCPIP. As for the serial line can be connected up to a maximum of 247 slave along the same lines. Each device is assigned an address that distinguishes it from all other connected devices.\\
Line 550: Line 550:
  
  
-=== - Variabili === +=== - Variables ===
-^Nome^D^R^A^Condizioni^ Descrizione^ +
-|serr|B|0|R/W|-|**Serial Errors**\\ Indica se sono stati riscontrati errori nella comunicazione seriale.\\ Il parametro viene aggiornato ad ogni errore rilevato. Il valore permane fino ad un successivo errore o ad una scrittura sullo stesso con il QCL.\\ **0** = nessun errore,\\ **1** = parity error,\\ **2** = framing error,\\ **3** = overrun error.|+
  
-=== - Stati === +^Name^D^R^A^Conditions^Description
-^Nome^D^R^A^CondizioniDescrizione+|serr|B|0|R/W|-|**Serial Errors**\\ Indicates if errors occurred in serial communication.\\ The parameter is updated for each error encounteredThe value persists until a subsequent error or to a writing on the same with the QCL.\\ **0** = no errors,\\ **1** = parity error,\\ **2** = framing error,\\ **3** = overrun error.|
-|st_msgrx|F|0|R||-|**Message received**\\ Stato utilizzato solo in modalitá slaveIndica che un messagio del master ha eseguito una scrittura nell’area scambio dati QCL. Lo stato viene resettato con il comando RECEIVED.| +
-|st_opencom|F|0|R|-|**Open communication port**\\ L'attivazione indica che il device sta impegnando la porta di comunicazione seriale. Per settare questo stato usare il comando OPENCOM, per resettarlo CLOSECOM.| +
-|wdata|F|0|R|-|**Warning Data**\\ Questo bit segnala che è stato tentato un inserimento di un valore non valido in un parametro.| +
-|wcmd|F|0|R|-|**Warning Command**\\ Questo bit segnala che è non è stato eseguito un comando perchè mancano le condizioni necessarie.|+
  
-=== - Comandi === +=== - States ===
-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.  |+
  
 +^Name^D^R^A^Conditions^Description^
 +|st_msgrx|F|0|R|-|**Message received**\\ State used only in slave mode. Indicates that a message from the master has executed a write in the QCL data exchange area. The state is reset with the RECEIVED command.|
 +|st_opencom|F|0|R|-|**Open communication port**\\ Activation indicates that the device is working with the serial communications port. To set this state use the OPENCOM command, for reset use CLOSECOM.|
 +|wdata|F|0|R|-|**Warning Data**\\ This bit indicates that an attempt was made to insert an invalid value in a parameter.|
 +|wcmd|F|0|R|-|**Warning Command**\\ This bit indicates that it did not execute a command because they lack the necessary conditions.|
  
 +=== - Commands ===
  
-===== - Migrazione dal device MODBUS01 al device MODBUS =====+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.
  
-Il primo aspetto da tenere presente per la migrazione è il fatto che il device MODBUS01 è esterno mentre il MODBUS è +^ Name      ^ D  ^ R  ^ A  ^ Conditions                                   ^ Description                                                                                                                                                        ^ 
-interno. Questo implica che la dichiarazione del device deve essere eseguita nella sezione “INTDEVICE” dell’unità di +| RECEIVED  | -  | -  | -  | st_msgrx = 1\\ mode = 12\\ st_opencom = 1  | **Received**\\ Used only in slave modeIndicates that the QCL application has processed the information that the master has sent                         | 
-configurazione del progetto. Inoltrequesto comporta la scelta, durante la definizione del device MODBUS, del tempo di +| VALIDATE  | -  | -  | -  | mode = 12\\ st_opencom = 1                 | **Validate**\\ Indicates that the parameters of the QCL data exchange becomes available to the master                                                                        | 
-campionamentoIl valore del tempo di campionamento che mantiene inalterate le prestazioni della comunicazione tra i +| CLRWDATA  | -  | -  | -  | -                                            | **Clear Warning Data**\\ Reset the wdata parameter reporting                                                                                                | 
-due device è pari a 5 ms. Bisogna inoltrein fase di definizione, selezionare la seriale da impegnare.\\ +| CLRWCMD   | -  | -  | -  | -                                            | **Clear Warning Command**\\ Reset the wcmd parameter reporting                                                                                              | 
-Il device MODBUS ha aumentato il numero di variabili di scambio (da 16 word a 32 word) ma questo non influenza il funzionamento +| 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.             | 
-per le impostazioni che utilizzano al massimo 16 word come sono quelle pensate per il device MODBUS01.\\ +| 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.  |
-Il device MODBUS ha limitato la variabile “num” a 128, mentre per il device MODBUS01 il limite è 256Questo 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 comandil'impegno della seriale di comunicazione da parte +
-del deviceQuesta 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 voltacome 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 612: 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: 2019/08/29 17:18