AutoHotkey Community

It is currently May 26th, 2012, 2:31 am

All times are UTC [ DST ]




Post new topic Reply to topic  [ 6 posts ] 
Author Message
 Post subject: Serial Communication
PostPosted: January 9th, 2008, 9:35 am 
Hello forum
i am new

i search in forum about this topic but i can't find anything use full

i want to send a data (Jony) from COM1 into hardware (IC).
The hardware (IC) is available
then hardware will send a data (tubb) on COM1.
software will recieve it & verify it,

if data = tubb
MsgBox, OK
else
MsgBox, Not OK

how can i do this in AHK?
can anyone make this scrip for me?
Plaese...Plaese...Plaese...

Regards...


Report this post
Top
  
Reply with quote  
 Post subject: Re: Serial Communication
PostPosted: January 10th, 2008, 11:48 am 
anyone... :?:


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: January 10th, 2008, 12:39 pm 
No.


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: January 10th, 2008, 12:51 pm 
Have you searched the forum already for "serial"?


Report this post
Top
  
Reply with quote  
 Post subject: Python
PostPosted: January 10th, 2008, 6:14 pm 
Offline

Joined: January 18th, 2006, 12:37 am
Posts: 290
If you aren't limited to using AHK, I know you can use python for serial communication. You will have to download python, python's windows modules, and pyserial. Also, you can get a GUI module for python to do message boxes.

_________________
My AutoHotkey Program for Warcraft III:
Warkeys
http://warkeys.sourceforge.net/

Remap your hotkeys
Healthbars always on
Remap inventory


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: January 10th, 2008, 8:23 pm 
Offline

Joined: April 19th, 2005, 10:26 am
Posts: 2249
Location: switzerland
it's not your solution, just remark, send one way with gwbasic to basic calculator
this example sends from XP to a basic calculator NEC PC-8201A (Tandy)
I can download xy.ba basic programs from internet and send via RS232 to the old calculator (1983)
needs gwbasic.exe

Code:
MODIFIED=20080110
/*
  date..............20080110
  name .............XP2PC8201A.ahk
  use for ..........transfer from XP to BASIC Calculator NEC PC-8201A
  addon.............gwbasic.exe
  ..................http://www.web8201.com/
  ..................http://www.geocities.com/KindlyRat/GWBASIC.html
  ..................http://oldfiles.org.uk/powerload/msdos.htm
  ..................http://www.autohotkey.com
*/



;------- this is autohotkey script can use numbered lines alone with GWBASIC -------------
; select xy.ba to transfer to NEC PC-8201A
; RS232 COM1 NullModemCable
;
F11=test1.bas
F12=test2.bas
filedelete,%F11%
  gosub,gosub11

Gui,1:Add, Listview, x10 y10 w400 h170 altsubmit vAAA1 gAAA2, FILES
Gui,1:add,text,x10 y190 w200 vAL
Gui,1:Show,x0 y0 w430 h210,Transfer to NEC PC-8201A
Loop, *.ba, 1, 1
  LV_Add("",A_loopfilename)

GuiControl,1:Text,AL,%nothing%
return

AAA2:
gui,1:submit,nohide
if A_GuiEvent=normal
     {
     LV_GetText(C1,A_EventInfo,1)
     goto,test11
     return
     }
return

TEST11:
filedelete,%F12%
FileRead,AAC,%F11%
  stringreplace,AAB,AAC,XXXXX,%C1%,all
  fileappend,%AAB%,%F12%
GuiControl,1:Text,AL,Running.....
runwait,%comspec% /C gwbasic test2
GuiControl,1:Text,AL,Transfer to PC-8201 finished
return

GuiClose:
ExitApp


GOSUB11:
transform,eof,chr,26
e11=
(
500 '
520 PRINT "First type in at computer NEC PC-8201A=":PRINT
560 PRINT "LOAD";Chr$(34);"COM:5N81NN";Chr$(34);"  and ENTER"
565 PRINT:PRINT:PRINT "push any key ......"
570 IF INKEY$<>" " THEN GOTO 570
580 OPEN "COM1:1200,n,8,1,asc" AS 1
592 OPEN "XXXXX" FOR INPUT AS 2
595 'x
600 A$=INPUT$(1,#2)
605 Print A$;
610 PRINT #1,A$;
615 IF EOF(2) <>0 THEN 630
620 GOTO 600
630 'x --
634 CLOSE
660 SYSTEM
)
transform,ten,chr,10
transform,tre,chr,13
CF=%TRE%%TEN%
stringreplace,e11,e11,%ten%,%CF%,all
Fileappend,%e11%`r`n,%F11%
return


Report this post
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 6 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: Alpha Bravo, Exabot [Bot] and 13 guests


You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group