Grantson Posted January 13, 2011 Share Posted January 13, 2011 Hi Folks I have been trying to write a little script to help with asset logging basically I have an rs-232 bar-code scanner I have tried the file open method to read from the scanner but it just seems to get stuck in the loop $comm = FileOpen("COM5", 4) While 1 $scan = FileRead($comm, 1) ConsoleWrite($scan) FileClose($comm) WEnd EndFunc The function is called twice once to scan the asset tag and once to scan the serial number Also is there a way of having a popup on the screen to prompt the user, something like a message box but that closes automatically when an input from the scanner is detected? Thanks Grant Link to comment Share on other sites More sharing options...
JoHanatCent Posted January 13, 2011 Share Posted January 13, 2011 basically I have an rs-232 bar-code scanner Question:If you have notepad open and you scan, does the result appear on notepad? Link to comment Share on other sites More sharing options...
VelvetElvis Posted January 13, 2011 Share Posted January 13, 2011 Dumb question, but if, as JoHanatCent indicated, you aren't getting readable text in Notepad, does your scanner require a "wedge"? All of our older serial port scanners required a wedge interface box between the scanner and the serial port. You could plug the scanner directly into the serial port, but it wouldn't do anything. Link to comment Share on other sites More sharing options...
Grantson Posted January 13, 2011 Author Share Posted January 13, 2011 Scanning directly into notepad does nothing using hyper terminal or rs-232 datalogger produces a list of list of barcodes Link to comment Share on other sites More sharing options...
enaiman Posted January 13, 2011 Share Posted January 13, 2011 Well, IMO you are not on the right way to do this. You need to have a look at martin's COM UDF and you have to deal with the serial port by reading what is received. There are about 2 other ways to deal with the COM ports and both of them are in Example Scripts. Your short snippet doesn't show how you deal with the rest; if only these lines are dealing with the COM port, it won't work at all. Show your full script and it will be easier to get help. SNMP_UDF ... for SNMPv1 and v2c so far, GetBulk and a new example script wannabe "Unbeatable" Tic-Tac-Toe Paper-Scissor-Rock ... try to beat it anyway :) Link to comment Share on other sites More sharing options...
Grantson Posted January 13, 2011 Author Share Posted January 13, 2011 I had a feeling i wasn't i was just using what i found from a search for using the com portI will look into the com udf Which example scripts? I am drawing a blank searching the help files I will post the full script but need to clear it up a bit first (lots of commented out bits while I was trying to figure it out)ThanksWell, IMO you are not on the right way to do this.You need to have a look at martin's COM UDF and you have to deal with the serial port by reading what is received.There are about 2 other ways to deal with the COM ports and both of them are in Example Scripts.Your short snippet doesn't show how you deal with the rest; if only these lines are dealing with the COM port, it won't work at all. Show your full script and it will be easier to get help. Link to comment Share on other sites More sharing options...
enaiman Posted January 13, 2011 Share Posted January 13, 2011 (edited) http://www.autoitscript.com/forum/topic/45842-serial-port-com-port-udf Edited January 13, 2011 by enaiman SNMP_UDF ... for SNMPv1 and v2c so far, GetBulk and a new example script wannabe "Unbeatable" Tic-Tac-Toe Paper-Scissor-Rock ... try to beat it anyway :) Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now