Page loading

Share your opinion
What do you think about gambaslinux.fr?
 
Interesting
It miss some informations
Excellent website
Results
WIDGETS GAMBAS
GAMBAS 3 SOFTWARES
TUTORIALS
Library
_gb3.pngNETWORK - Send datas on serial port

Send datas on serial port with gambas 3


Hi,
To send ASCII text on serial port of your computer, it's simple.
first, define serial port properties, open port, and send datas as this :

'port properties
If scmd.Status = Net.Inactive Then
scmd.portname = "/dev/ttyUSB0"
scmd.Speed = 4800
scmd.Parity = 0
scmd.StopBits = 1
scmd.DataBits = 8
scmd.FlowControl = 0
scmd.Open() 'open port
Endif


to send ASCII datas :

If scmd.Status = Net.active Then
Print #scmd, mytext;
End If


here mytext is a string variable

So now if you want to send another data type as  byte, integer, short, long or other, you have to  use WRITE command as this example bellow :

Write #scmd,myvariable as byte

Thanks for your attention.





Creation date : 15/10/2021 @ 07:57
Last update : 15/10/2021 @ 07:57
Category : NETWORK
Page read 1893 times


Print the article Print the article


react.gifReactions to this article

Nobody gave a comment yet.
Be the first one to do it!


QUICK MENU
SEARCH




LANGUAGE
COMPONENTS
Other
LANGUAGE
Where, who?
VISITS

   visitors

   visitors online

ARCHIVES GAMBAS 1/2
^ Top ^