Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision Next revisionBoth sides next revision | ||
en:software:devices:modbus [2016/12/21 15:13] – [5.2.1. Parametri per formattare il messaggio:] qem103 | en:software:devices:modbus [2016/12/21 17:39] – [Read Holding Register] qem103 | ||
---|---|---|---|
Line 159: | Line 159: | ||
**num** = number of values that are read or write (if the request type so provides). Are accepted values are between 1 and 128 for values of type parameter = 1, 2, (reading of bits), while for type value = 3, 4, 16 (multiple word reading and writing) the accepted value are between 1 and 32. | **num** = number of values that are read or write (if the request type so provides). Are accepted values are between 1 and 128 for values of type parameter = 1, 2, (reading of bits), while for type value = 3, 4, 16 (multiple word reading and writing) the accepted value are between 1 and 32. | ||
- | === - Comandi per inviare il messaggio: === | + | === - Commands to send the message: === |
- | SEND invia il messaggio di richiesta allo slave.\\ | + | |
- | SENDSYC invia il messaggio di richiesta ad uno slave QEM di tipo MODBUS e segnala l’operazione conclusa (// | + | |
- | === - Variabili di Stato per diagnostica operazione: === | + | SEND sends the request message to the slave.\\ |
- | Quando l’operazione di trasmissione messaggio è conclusa, viene impostata a 1 la variabile di stato st_sended. Se è | + | SENDSYC |
- | stato utilizzato il comando | + | |
- | invece è stato utilizzato nel master il comando | + | |
- | avrà eseguito il comando RECEIVED. In caso di errore, invece, questo stato viene posto comunque a 1 (dopo il tempo | + | |
- | //toutsyc//) ma il parametro err segnala la causa dell’errore (vedere la descrizione di questo parametro per i dettagli).\\ | + | |
- | Il comando SENDSYC si rende necessario quando si vuole sincronizzare la scrittura del master di un pacchetto dati con la lettura degli stessi dati da parte dello slave (può essere usato quando sia master che slave sono Qmove). | + | |
- | ==== - Richieste di lettura | + | === - State variables for diagnostic operation: === |
+ | |||
+ | When ended the message send operation, the status st_sended variable is set to 1. If you used the SEND command the state is set to 1 when the master receive the confirmation of the message being sent. If you have used the SENDSYC command in the master then this status will be set to 1 when the slave QEM will execute the RECEIVED command. In case of error, This status is still in set to 1 (After the //toutsyc// time) but the err parameter indicates the cause of the error (see the description of this parameter for details).\\ | ||
+ | The SENDSYC coomand it becomes necessary when you want to synchronize master data packet writing by reading the same data from the slave (can be used when both master and slave are Qmove). | ||
+ | |||
+ | ==== - Read request | ||
=== Read Coil === | === Read Coil === | ||
- | Funzione di lettura | + | |
- | impostare | + | Bit read function. You want to read the bits of a slave (// |
- | numero di bit che si intendono leggere. Bisogna impostare | + | (//addr// + //num// - 1) <= 512 e (//tabreg// + //num// - 1) <= 512 otherwise the request will fail (reporting by //wcmd//). |
- | master | + | |
- | soddisfare sempre le seguenti due condizioni:\\ | + | |
- | (//addr// + //num// - 1) <= 512 e (//tabreg// + //num// - 1) <= 512 altrimenti la richiesta non potrà essere eseguita | + | |
=== Read Input === | === Read Input === | ||
- | Funzione di lettura a bit. Si vogliono leggere i bit di un certo slave (// | + | |
+ | Bit read function. To read the bits of a slave (// | ||
=== Read Holding Register === | === Read Holding Register === | ||
- | Funzione di lettura a word. Si vogliono leggere le word di un certo slave (idcard). | + | |
- | Bisogna impostare | + | Word read function. Si vogliono leggere le word di un certo slave (idcard). |
- | indica il numero di word che si intendono leggere. Bisogna impostare | + | You must to set addr to indicate the address of the word in the slave from which to start reading. The num parameter indicates the number of word to be read. You must set tabreg |
- | dei dai letti” del master | + | (addr + num - 1) <= 32 e (tabreg + num - 1) <= 32 otherwise the request will fail (reporting by wcmd). |
- | Si raccomanda di soddisfare sempre le seguenti due condizioni:\\ | + | |
- | (addr + num - 1) <= 32 e (tabreg + num - 1) <= 32 altrimenti la richiesta non potrà essere eseguita | + | |
- | wcmd). | + | |
=== Read Input Register === | === Read Input Register === |