Difference between revisions of "Writing SerialPort"

From ArcoWiki
Jump to: navigation, search
 
(2 intermediate revisions by one other user not shown)
Line 2: Line 2:
 
serial port through the [[DMIS]] code, for example:
 
serial port through the [[DMIS]] code, for example:
  
<code>
+
 
DECL/CHAR,10,my_var<br />
+
DECL/CHAR,10,my_var
DECL/INTGR,ii<br />
+
DECL/INTGR,ii
my_var=[[Assign|ASSIGN]]/'Here the value assigned!'<br />
+
my_var=[[Assign|ASSIGN]]/'Here the value assigned!'
DID(my_com_device)=DEVICE/COMM,'com3:9600,n,8,1'<br />
+
DID(my_com_device)=DEVICE/COMM,'com3:9600,n,8,1'
OPEN/DID(my_com_device),DIRECT,INPUT<br />
+
OPEN/DID(my_com_device),DIRECT,INPUT
DO/ii,1,10,1<br />
+
  DO/ii,1,10,1
WRITE/DID_com_device),my_var<br />
+
    WRITE/DID_com_device),my_var
ENDDO<br />
+
  ENDDO
CLOSE/DID(my_com_device)<br />
+
CLOSE/DID(my_com_device)
</code>
+
[[it:Scrivere SerialPort]]
 +
[[zh-cn:编写SerialPort]]
 +
[[pt:Escrevendo SerialPort]]
 +
[[de:Schreiben von SerialPort]]
 +
[[es:Escribiendo SerialPort]]
 +
[[en:Writing SerialPort]]
  
 
[[Category:ReadMe3.5.100]]
 
[[Category:ReadMe3.5.100]]

Latest revision as of 10:18, 29 June 2018

 It is possible to write data on a serial port through the DMIS code, for example:


DECL/CHAR,10,my_var
DECL/INTGR,ii
my_var=ASSIGN/'Here the value assigned!'
DID(my_com_device)=DEVICE/COMM,'com3:9600,n,8,1'
OPEN/DID(my_com_device),DIRECT,INPUT
  DO/ii,1,10,1
    WRITE/DID_com_device),my_var
  ENDDO
CLOSE/DID(my_com_device)