 |
AutoHotkey Community Let's help each other out
|
| View previous topic :: View next topic |
| Author |
Message |
jony Guest
|
Posted: Wed Jan 09, 2008 9:35 am Post subject: Serial Communication |
|
|
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... |
|
| Back to top |
|
 |
Guest
|
Posted: Thu Jan 10, 2008 11:48 am Post subject: Re: Serial Communication |
|
|
anyone...  |
|
| Back to top |
|
 |
anyone Guest
|
Posted: Thu Jan 10, 2008 12:39 pm Post subject: |
|
|
| No. |
|
| Back to top |
|
 |
BoBoĻ Guest
|
Posted: Thu Jan 10, 2008 12:51 pm Post subject: |
|
|
| Have you searched the forum already for "serial"? |
|
| Back to top |
|
 |
POINTS
Joined: 18 Jan 2006 Posts: 283
|
Posted: Thu Jan 10, 2008 6:14 pm Post subject: Python |
|
|
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 |
|
| Back to top |
|
 |
garry
Joined: 19 Apr 2005 Posts: 1017 Location: switzerland
|
Posted: Thu Jan 10, 2008 8:23 pm Post subject: |
|
|
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
|
|
|
| Back to top |
|
 |
|
|
You can post new topics in this forum You can reply to topics in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|