Difference between revisions of "Writing values to Serial Port"

From ArcoWiki
Jump to: navigation, search
(Created page with "This is used to write strings to a COM port, a typical use is to send to the information to an external software or device.<br/> The string to set the port is as follow:<br/>...")
 
 
(2 intermediate revisions by one other user not shown)
Line 18: Line 18:
 
::<code><span style="color: green; text-decoration: none;">$$Closing the Port</span><br/></code>
 
::<code><span style="color: green; text-decoration: none;">$$Closing the Port</span><br/></code>
 
::<code>CLOSE/DID(my_com_device)</code>
 
::<code>CLOSE/DID(my_com_device)</code>
 +
[[it:Scrittura dei valori su Serial Port]]
 +
[[zh-cn:将值写入串行端口]]
 +
[[de:Schreiben von Werten in den seriellen Port ]]
 +
[[pt: Escrevendo valores para a porta serial:]]
 +
[[es:Escribir valores en el puerto serie]]
 +
[[en:Writing values to Serial Port]]
 +
 +
[[Category:Dmis_Tutorial]]

Latest revision as of 10:22, 29 June 2018

This is used to write strings to a COM port, a typical use is to send to the information to an external software or device.
The string to set the port is as follow:
‘PortName:Speed,Parity,Bit,Control’.

This statement is manually written without user interface.

$$Begin Example

DECL/CHAR,10,my_var
DECL/INTGR,ii
my_var=ASSIGN/'Here the value assigned!'

$$Open the COM port

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(my_com_device),'Here the String WRITTEN directly!!'
WRITE/DID(my_com_device),my_var
ENDDO
$$Closing the Port
CLOSE/DID(my_com_device)