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/21 14:50] – [5. Master operation description] qem103en:software:devices:modbus [2016/12/21 16:57] – [Read Coil] qem103
Line 141: Line 141:
 The device provides a data exchange area where the QCL can write or read values shared with the slaves on the network. This area is represented by a list of parameters of the device divided into two groups to differentiate the type of access of the data by the device. The first section is identified as INPUT the second as OUTPUT. The INPUT section, for master operation, is the storage area of reads data. It is used by all reader functions (parameter //type// = 1, 2, 3 o 4). The OUTPUT section, in the master operation, is the area of data storage that the master should transfer to the slaves. It is used by all writing functions (parameter //type// = 5, 6, 15 o 16). To facilitate the exchange of data between devices, the structure of the Exchange area includes data types commonly used in QCL namely WORD, LONG and FLAG. The “BYTE” type does not appear because the modbus usually uses the word size for each address registers. The modbus protocol selects data based on the number of access log register, while the QCL selects based on the parameter symbol, you create a reference table in which each QCL symbol find the corresponding number in the register of access in Modbus protocol. To obtain greater flexibility for addressing, the same area of Exchange data can be manipulated by the QCL with different dimension parameterized. All the symbols that appear in the same row of the table refer to the same memory locations. The device provides a data exchange area where the QCL can write or read values shared with the slaves on the network. This area is represented by a list of parameters of the device divided into two groups to differentiate the type of access of the data by the device. The first section is identified as INPUT the second as OUTPUT. The INPUT section, for master operation, is the storage area of reads data. It is used by all reader functions (parameter //type// = 1, 2, 3 o 4). The OUTPUT section, in the master operation, is the area of data storage that the master should transfer to the slaves. It is used by all writing functions (parameter //type// = 5, 6, 15 o 16). To facilitate the exchange of data between devices, the structure of the Exchange area includes data types commonly used in QCL namely WORD, LONG and FLAG. The “BYTE” type does not appear because the modbus usually uses the word size for each address registers. The modbus protocol selects data based on the number of access log register, while the QCL selects based on the parameter symbol, you create a reference table in which each QCL symbol find the corresponding number in the register of access in Modbus protocol. To obtain greater flexibility for addressing, the same area of Exchange data can be manipulated by the QCL with different dimension parameterized. All the symbols that appear in the same row of the table refer to the same memory locations.
  
-==== - Accesso dei dati input e coil ====+==== - Input and coil Data Access ====
  
-I dati tipo input //coi//l hanno nel protocollo modbus una dimensione a bit. Per la memorizzazione di queste informazioni +The data input or //coil// type have in the modbus Protocol a bit sizeTo store this information in the table of data exchange is defined as follows modeeach register (and then every word parameter of the device) represents 16 elements that are numbered from left to rightFor the Scriptures or multiple readings when bits read are higher than those contained in the register the operation continues in the next register.\\ 
-nella tabella di scambio dati è definita la seguente modalitàogni registro (e quindi ogni parametro word del device) rappresenta +The //st_ibit0//... and //st_obit1//... states are useful in order to facilitate access to information bit, only in the first table log.
-16 elementi che vengono numerati da sinistra verso destraPer le scritture o letture multiple quando i bit da leggere +
-sono superiori a quelli contenuti nel registro l’operazione continua nel registro successivo.\\ +
-Gli stati //st_ibit0//... //st_obit1//... sono utili per agevolare l’accesso alle informazioni di tipo bit solo nel primo registro della +
-tabella.+
  
-==== - Modo di funzionamento MASTER ====+==== - Mode of MASTER operation ====
  
-La modalità master viene impostata con il parametro mode = 0. La scheda genera messaggi modbus solamente su comando +The master mode is set with the mode parameter = 0. The card generates modbus messages only on QCL ordering and does not automaticallyTo "format" the modbus message string there are a number of parameters.\\ 
-del QCL e non automaticamentePer “formattare” la stringa del messaggio modbus vi sono una serie di parametri.\\ +Using the two commands SEND or SENDSYC you send the read or write request to the slave, a number of States allow an audit on the operation being executedWe see in detail:
-Mediante i due comandi SEND SENDSYC si inviano la richiesta di lettura o scrittura allo slave, una serie di stati +
-permettono una verifica sull’operazione eseguitaVediamo in dettaglio:+
  
-=== - Parametri per formattare il messaggio: === +=== - Parameters for formatting the message: ===
-**type** = tipo di richiesta che si vuole processare (lettura o scrittura di word o di bit).\\ +
-**idcard** = indirizzo dell’unità slave verso cui si vuole inviare la richiesta.\\ +
-**addr** = indice da cui iniziare a leggere o da cui iniziare a scrivere nello slave in questione.\\  +
-**tabreg** = per le operazioni di lettura (type = 1, 2, 3, 4), questo parametro indica la posizione nella “tabella dei dati letti” dove verrà memorizzato il dato letto sullo slave. Per le operazioni di scrittura (type = 5, 6, 15, 16), questo parametro indica da posizione nella “tabella dei dati da scrivere” dove si trova il dato da scrivere sullo slave. Sono previsti valori tra 1 e 512 per valori del parametro type = 1, 2, 5, 15 (scrittura e lettura di bit), mentre per valori type = 3, 4, 6, 16 (scrittura e lettura di word) i valori previsti sono tra 1 e 32.\\ +
-**num** = numero di valori che si intendono leggere o scrivere (se il tipo richiesta type lo prevede). Sono previsti valori tra 1 e 128 per valori del parametro type = 1, 2, (lettura di bit), mentre per valori type = 3, 4, 16 (scrittura multipla e lettura di word) i valori previsti sono tra 1 e 32.+
  
-=== - Comandi per inviare il messaggio: === +**type** request type that you want to process (reading or writing word or bit).\\ 
-SEND invia il messaggio di richiesta allo slave.\\ +**idcard** address of the slave drive to which you want to send the request.\\ 
-SENDSYC invia il messaggio di richiesta ad uno slave QEM di tipo MODBUS e segnala l’operazione conclusa (//st_sended//solamente quando lo slave esegue il comando RECEIVED.+**addr** the index from which to start reading or at which to start writing in the slave.\\  
 +**tabreg** for read operations (type 1, 2, 3, 4), This parameter indicates the position in the “table of data read” where will store the read data on the slave. For write operations (type 5, 6, 15, 16), this parameter indicates the position in the “table of data to be written” where is the data to be written on the slave. Are accepted values are between 1 and 512 for values of type parameter = 1, 2, 5, 15 (writing and reading of bits), while for type value = 3, 4, 6, 16 (writing and reading of word) the expected values 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.
  
-=== - Variabili di Stato per diagnostica operazione: === +=== - Commands to send the message: ===
-Quando l’operazione di trasmissione messaggio è conclusa, viene impostata a 1 la variabile di stato st_sended. Se è +
-stato utilizzato il comando SEND lo stato viene posto a 1 quando il master riceve la conferma del messaggio inviato. Se +
-invece è stato utilizzato nel master il comando SENDSYC allora questo stato verrà impostato a 1 quando lo slave QEM +
-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 ====+SEND sends the request message to the slave.\\ 
 +SENDSYC sends the request message to a QEM slave of MODBUS type and reports the operation concluded (//st_sended//) only when the slave executes the RECEIVED command. 
 + 
 +=== - 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 a bit. Si vogliono leggere i bit di un certo slave (//idcar//d). Viene impostato il parametro //type// = 1.\\ Bisogna Funzione di lettura a bit. Si vogliono leggere i bit di un certo slave (//idcar//d). Viene impostato il parametro //type// = 1.\\ Bisogna
 impostare //addr// per indicare l’indirizzo del bit nello slave da cui si intende iniziare a leggere. Il parametro //num// indica il impostare //addr// per indicare l’indirizzo del bit nello slave da cui si intende iniziare a leggere. Il parametro //num// indica il
  • Last modified: 2020/07/13 14:58