Jump to content

How to send and read serial USB message between 2 PCs

Recommended Posts


Hi All

Well I have a Win 7 based X-Ray machine on which I am doing some automation tests using Autoit. The entire code is working properly.

I have interfaced an external Arduino board to the X-Ray machine using USB male A to USB male B cable. This communication is also working properly.

This is the code which I am using.

Func Exposure ()

   Global $CMPort = 4                                   ; COM port initialisation
   Global $CmBoBaud = 9600                     ; Baud Rate Select
   Global $sportSetError = ''                       ;Port Error Handle
   Global $CmboDataBits = 8                     ; Number of bits to be sent at a time.
   Global $CmBoParity = "none"                ; disable parity
   Global $CmBoStop = 1                            ; stop bit polarity
   Global $setflow = 2

   _CommSetPort($CMPort, $sportSetError, $CmBoBaud, $CmboDataBits, $CmBoParity, $CmBoStop, $setflow)




Now my problem is that, when any error situation comes on the X-Ray machine, it should pause the script, and send an email to the user stating that automation has halted.

But there is no internet on the X-Ray machine.

So I was thinking that I will connect a laptop having internet to the X-Ray machine. When script gets paused, the X-Ray machine will convey it to laptop. A separate automation code in the laptop will then send the email.

My various doubts are:

  • Can I use the above function to send message to the laptop, or do I need to modify anything
  • How to read the message in laptop autoit code ? Is it similar to the sending program or any major changes are needed
  • Can I use a simple USB A male to male cable to connect X-Ray system and laptop ? Or do I need cable with a hardware bridge ? Basically I am not doing any heavy data transfer. I just have to send one simple byte and that too only if the script gets paused. (If script doesnt get paused, then no problem at all)


I will be extremely grateful for any help and suggestions.


Thanks in advance

Share this post

Link to post
Share on other sites

@prasad123 please pay attention to where you post in the future - the Examples forum is not for questions. I have moved this topic to the appropriate forum.

√-1 2^3 ∑ π, and it was delicious!

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