Quantcast
Channel: AutoIt v3 - General Help and Support
Viewing all articles
Browse latest Browse all 12506

RS232 Commg problem.

$
0
0
I want to use com1 to com2 at the same time in same computer. 
 
  1.com1 send string abcde to com2 (At this time will receive com2 message)
  2.com2 send string abcde to com1 (At this time will receive com1 message)
 
I try to use the code.
 
while 1
    $a = "abcdefhhijklmnopqrstuvwxyz1234567890abcdefhhijklmnopqrstuvwxyz1234567890"
    _CommSwitch(1)
    _CommSendString($a)
    _CommSwitch(2)
    _CommSendString($a)
 
    _CommSwitch(1)
    $test1 = _Commgetstring()
    _CommSwitch(2)
    $test2 = _Commgetstring()
wend
 
But it seems that there is a delay time. 
 
_Commgetstring() always not receive the full message.(Only received abcdefg)
 
What do I do wrong? 
 
If want to send message with delay time.(Use $a Send message,press a then sleep (100) ) .
 
How should I do?
 
Or with only the following methods ..
   _CommSendString("a")
  sleep(100)
  _CommSendString("b")
  sleep(100)
   _CommSendString("c")
 
Please help.
Thank.

Viewing all articles
Browse latest Browse all 12506

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>