Both sides previous revision Previous revision | Next revisionBoth sides next revision |
en:software:devices:modbus [2016/12/27 14:47] – [6.3.5. Comandi] qem103 | en:software:devices:modbus [2016/12/27 15:00] – [7. Migrazione dal device MODBUS01 al device MODBUS] qem103 |
---|
| |
| |
===== - Migrazione dal device MODBUS01 al device MODBUS ===== | ===== - Migration from MODBUS01 device to MODBUS device ===== |
| |
Il primo aspetto da tenere presente per la migrazione è il fatto che il device MODBUS01 è esterno mentre il MODBUS è | 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.\\ |
interno. Questo implica che la dichiarazione del device deve essere eseguita nella sezione “INTDEVICE” dell’unità di | 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.\\ |
configurazione del progetto. Inoltre, questo comporta la scelta, durante la definizione del device MODBUS, del tempo di | 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.\\ |
campionamento. Il valore del tempo di campionamento che mantiene inalterate le prestazioni della comunicazione tra i | 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.\\ |
due device è pari a 5 ms. Bisogna inoltre, in fase di definizione, selezionare la seriale da impegnare.\\ | If an application was written for the MODBUS01 device you must add the OPENCOM command (executed only once) as shown in the following example. |
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: ==== | ==== Esempio: ==== |