Sign in to follow this  
Followers 0
neotrio

Serial communication

5 posts in this topic

Hi all,

I have written a script for serial communication which uses MSCOMM functionality......it is working fine for COM port. Now my question is does it also work for USB port?

awaiting your response.

Neotrio.

Share this post


Link to post
Share on other sites



Erm.. try it?

Or, post the code, so someone here can try it.. ?

Share this post


Link to post
Share on other sites

Hi all,

I have written a script for serial communication which uses MSCOMM functionality......it is working fine for COM port. Now my question is does it also work for USB port?

awaiting your response.

Neotrio.

It should work for a serial to usb converter which looks to windows like a com port, but it won't work for talking to devices over usb. With a serial to USB you are actually communicating with the driver for the device which imitates a com port, and the driver handles the usb communications.


Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.

Share this post


Link to post
Share on other sites

Hi all,

I have written a script for serial communication which uses MSCOMM functionality......it is working fine for COM port. Now my question is does it also work for USB port?

awaiting your response.

Neotrio.

I use NETComm for Serial Port communication which works with both USB and Bluetooth devices. This is a snippet of code which works with a GPS Bluetooth device

CODE
;Error Processing for COM Port

$oMyError = ObjEvent("AutoIt.Error", "MyErrFunc")

;COM Port Error Message

Func MyErrFunc()

MsgBox(0, " GPS/Map Viewer", "COM Port Error : " & $oMyError.description)

PLExit()

EndFunc ;==>MyErrFunc

;Create NETComm.ocx object

$NetComm = ObjCreate("NETCommOCX.NETComm")

;Process message

$message = " Establishing GPS Communications."

DisplayMessage()

;Set object settings

With $NetComm

.CommPort = $port ;Set port number

.Settings = $settings ;Set port settings

.InputLen = 0 ;reads entire buffer

.InputMode = 0 ;reads in text mode

.HandShaking = 3 ;uses both RTS and Xon/Xoff handshaking

.PortOpen = "True" ;opens specified COM port

EndWith

Ant..

Share this post


Link to post
Share on other sites

I use NETComm for Serial Port communication which works with both USB and Bluetooth devices. This is a snippet of code which works with a GPS Bluetooth device

CODE
;Error Processing for COM Port

$oMyError = ObjEvent("AutoIt.Error", "MyErrFunc")

;COM Port Error Message

Func MyErrFunc()

MsgBox(0, " GPS/Map Viewer", "COM Port Error : " & $oMyError.description)

PLExit()

EndFunc ;==>MyErrFunc

;Create NETComm.ocx object

$NetComm = ObjCreate("NETCommOCX.NETComm")

;Process message

$message = " Establishing GPS Communications."

DisplayMessage()

;Set object settings

With $NetComm

.CommPort = $port ;Set port number

.Settings = $settings ;Set port settings

.InputLen = 0 ;reads entire buffer

.InputMode = 0 ;reads in text mode

.HandShaking = 3 ;uses both RTS and Xon/Xoff handshaking

.PortOpen = "True" ;opens specified COM port

EndWith

Ant..

Thanks! actually I had some conceptual clots that's why I was not sure.Now I think my code will also work...........

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0