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 18:01] – [Force multiple register] qem103en:software:devices:modbus [2016/12/22 15:51] – [5.6. Schema a blocchi] qem103
Line 207: Line 207:
 === Force multiple register === === Force multiple register ===
  
-Multiples word write function. For write (forzare) the word of a slave (//idcard//). Sets the parameter //type// = 16.\\ You must set addr to indicate the address of the word in the slave that you intend to write. You must set in num the number of word to write. You must set tabreg to indicate the index of the word in the “write data table” da cui iniziano i valori da scrivereSi raccomanda di soddisfare sempre le seguenti due condizioni:\\ +Multiples word write function. For write (forzare) the word of a slave (//idcard//). Sets the parameter //type// = 16.\\ You must set addr to indicate the address of the word in the slave that you intend to write. You must set in num the number of word to write. You must set tabreg to indicate the index of the word in the “dat write table” from which to begin the values to be writtenIt is recommended to always meet the following two conditions:\\ 
-(addr + num - 1) <= 32 e (tabreg + num - 1) <= 32 altrimenti la richiesta non potrà essere eseguita (segnalazione mediante wcmd).+(addr + num - 1) <= 32 e (tabreg + num - 1) <= 32 otherwise the request will fail (reporting by wcmd).
  
-==== - Esempi ====+==== - Examples ====
  
-1) Impostazioni modbus e apertura del canale di comunicazione di tipo seriale+1) Modbus settings and opening of serial communication
 <code QCL> <code QCL>
 modbus.mode = 0                             ; modbus master modbus.mode = 0                             ; modbus master
Line 247: Line 247:
 </code> </code>
  
-3) Lettura del registro input nr.7 dello slave id 67+3) Reading the registry input nr.7 of the slave id 67
 <code QCL> <code QCL>
 modbus.idcard = 67 modbus.idcard = 67
Line 257: Line 257:
 WAIT modbus.st_sended WAIT modbus.st_sended
 IF (modbus.err) IF (modbus.err)
-    CALL ErroreModbus+    CALL ErrorModbus
 ENDIF ENDIF
-slVelocita = modbus.iword7+slSpeed = modbus.iword7
 </code> </code>
  
-4) Lettura dei holding register dal nr.600 al nr.606 dello slave id 8\\ +4) Reading of the holding register from nr.600 to nr.606 of the slave id 8\\ 
-Siccome l’area di scambio dati QCL non supporta l’indirizzo 600, si utilizza il parametro tabreg per salvare i dati letti all’indirizzo 10+The area of QCL data exchange does not support the address 600, you use the tabreg parameter to save the data read at 10 address
 <code QCL> <code QCL>
 modbus.idcard = 8 modbus.idcard = 8
Line 273: Line 273:
 WAIT modbus.st_sended WAIT modbus.st_sended
 IF (modbus.err) IF (modbus.err)
-    CALL ErroreModbus+    CALL ErrorModbus
 ENDIF ENDIF
          
 swTemp1 = modbus.iword10 swTemp1 = modbus.iword10
-slVelocita = modbus.ilong6+slSpeed = modbus.ilong6
 slPosiz = modbus.ilong7 slPosiz = modbus.ilong7
 swTemp1 = modbus.iword15 swTemp1 = modbus.iword15
 </code> </code>
-==== - Schema a blocchi ====+==== - Block diagrams ==== 
 {{:software:devices:modbus:modbus_01.png?nolink400|}} {{:software:devices:modbus:modbus_01.png?nolink400|}}
  
  • Last modified: 2020/07/13 14:58