-
Posts
391 -
Joined
-
Last visited
About sykes
- Birthday 10/02/1969
Profile Information
-
Member Title
Haiku Computer Operator
-
Location
Georgia
Recent Profile Visitors
The recent visitors block is disabled and is not being shown to other users.
sykes's Achievements
Universalist (7/7)
0
Reputation
-
sykes changed their profile photo
-
Poll Data from network connected device
sykes replied to sykes's topic in AutoIt General Help and Support
The devices I'm connecting to are fuel tank gauges. The devices have either a tcp/ip card or a rs-232 card connected to an ip to serial converter. I can connect to them using the ip address or directly to the serial card (with hyperterminal, telnet, putty, etc) and send a keyboard command (ctlr+a 200) and it returns the current tank inventory on the screen. I already have it automated this using puttytel and its log feature to do what I needed as a quick and dirty method, just wanted to do all of this internally in a program without having to use a separate terminal program. -
I've dug around for a while but can't quite track down exactly what i'm trying to accomplish. I have devices that i can use telnet, hyperterminal, putty, etc to connect to these devices with tcp. Once connected i send ctrl+a 200 and it returns data. I then save the data to file for parsing. I would love to be able to poll this data without using an outside terminal emulator is possible. I've played with the TCP functions and am able to connect to the device, but using TCPSend, TCPRecv I am unable pull the data. Is there something I'm missing here? Any advice pointers, etc would be greatly appreciated! Larry B
-
Getting list of files from an FTP site
sykes replied to jussie's topic in AutoIt General Help and Support
Check these links out: http://www.15seconds.com/issue/981203.htm http://15seconds.com/files/981203.zip http://support.genotec.ch/downloads/AspFTP2_Doc.htm Heres a sample of code that downloads all files in the root directory to the directory the script resides in: *Note - This code requires aspftp.dll to be installed ... the download link is above.* $oMyError = ObjEvent("AutoIt.Error","MyErrFunc") $oFtp = ObjCreate("NIBLACK.ASPFTP") $oFtp.sServerName = "<ip address here>" $oFtp.sUserID = "<username here>" $oFtp.sPassword = "<password here>" $oFtp.lTransferType = 2; sets transfer type to binary $oFtp.bConnect $oDirList = $oFtp.sListDir("/", 128) $x = StringSplit($oDirList, ";") For $i = 1 to $x[0] $oFtp.bGetFile($x[$i], @ScriptDir & "\" & $x[$i]) Next $oFtp.bDisconnect Func MyErrFunc() $HexNumber=hex($oMyError.number,8) $errlog = FileOpen(@ScriptDir & "\error.log", 1) FileWriteLine($errlog, "Error captured - " & @MON & "/" & @MDAY & "/" & @YEAR) FileWriteLine($errlog, @TAB & "Error Description: " & $oMyError.description & @CRLF & _ @TAB & "Error Number: " & $HexNumber & @CRLF & _ @TAB & "ScriptLine: " & $oMyError.scriptline & @CRLF & _ @TAB & "Source: " & $oMyError.source) SetError(1) Endfunc -
And heres a link for other programming language configurations for SCiTE... http://scintilla.sourceforge.net/SciTEExtras.html
-
Maybe because you posted this in a V3 support forum? As I stated earlier, you may want to check with a VB forum about VB questions.
-
Actually, it's not more of a VB question ... it *IS* a VB question. You may want to ask this on a VB forum? Sounds like you want someone to do your work for you.
-
RegExp - has anyone seen this library before?
sykes replied to sohfeyr's topic in AutoIt Technical Discussion
LMFAO -
We need a new function: _GuiCtrlFindWhatImLookingFor
-
I used NETComm.ocx because it is free and redistributable. All Properties, Methods, Events, etc, etc are the same as MSCOMM32.OCX with the exception of the Input property (it's InputData in NETComm.ocx). I played with the code this morning and was finally able to get it working. Working code is below: HotKeySet("{ESC}", "_KillDaWabbit") $NetComm = ObjCreate("NETCommOCX.NETComm");Create NETComm.ocx object ;Set object settings With $NetComm .CommPort = 1 ;Set port number .Settings = "9600,N,8,1" ;Set port settings .InputLen = 0 ;reads entire buffer .InputMode = 0 ;reads in text mode .HandShaking = 3 ;uses both RTS and Xon/Xoff handshaking .PortOpen = "True" ;opens specified COM port EndWith While 1 _GetData() WEnd Func _GetData() If $NetComm.InBufferCount > 0 Then ConsoleWrite($NetComm.InputData) Sleep(250) EndIf EndFunc Func _KillDaWabbit() Exit EndFunc Adding the HandShaking property was what finnaly enabled me to retrieve the data.
-
Thats where I got the code I've been using ... Just can't seem to receive the data
-
No lights to check. I can however open hyperterminal on com1 and see the data stream by.
-
The device is a register from Verifone. It is set up to have a Virtual Journal Printer. This is the port I am hooked to with COM1 on my pc. The virtual journal port supplies raw data in text form of all transactions on the register. All I am trying to do at this point is retrieve the data from this port and display it using the consolewrite function in autoit. Upon getting that far I intend to write the data to a database.
-
I have taken snippets of code from the forum as well as some from MSDN, but all i'm receiving from this program is zero's. I have com1 connected to a device that supplies raw data (i.e. text) but I never see any of it. The program returns thousands of zeros and just seems to stop. Am I missing something in my code? $NetComm = ObjCreate("NETCommOCX.NETComm") $NetComm.CommPort = 1;Set port number $NetComm.Settings = "9600,N,8,1";Set port settings $NetComm.InputLen = 0;reads entire buffer $NetComm.InputMode = 0;reads in text mode $NetComm.PortOpen = "True";opens specified COM port While 1 ConsoleWrite($NetComm.InputData) WEnd
-
I'm not sure if anyone else has experienced this problem with VPN connections, but here goes: Sometimes dialing our corporate VPN it seems to connect perfectly, but upon trying to communicate with any of the office networked PC's, I can't get a response from them (i.e. Ping). Disconnecting the VPN a random number of times finally returns a solid connection. I have searched the web for this issue and can't seem to find anything on it. This is the reason for this program. It uses RASDial.exe in Windows 2000 & XP to dial the connection and then checks for one of our servers by pinging it. If it responds it exits but if it doesn't, it then disconnects and tries again. #include<guiconstants.au3> $ini = @AppDataCommonDir & "\Microsoft\Network\Connections\Pbk\rasphone.pbk" Dim $sel $i = IniReadSectionNames($ini) For $x = 1 to $i[0] If IniRead($ini, $i[$x], "Device", "") = "WAN Miniport (L2TP)" Then $sel = $sel & $i[$x] & "|" EndIf Next $sel = StringTrimRight($sel, 1) GuiCreate("Select VPN", 200, 75) $ent = GuiCtrlCreateCombo("", 30, 10, 140, 20) GuiCtrlSetData($ent, $sel) $btn_submit = GuiCtrlCreateButton("Fire It Up!", 37.5, 45, 125, 20) GUISetState (@SW_SHOW) While 1 $msg = GUIGetMsg() Select Case $msg = $btn_submit $entry = '"' & GuiCtrlRead($ent) & '"' _VPNDial() EndSelect If $msg = $GUI_EVENT_CLOSE Then ExitLoop Wend Func _VPNDial() $vpn_ip = IniRead(@ScriptDir & "\VPN Launcher.ini", "General", "VPN_IP", "") $user = IniRead(@ScriptDir & "\VPN Launcher.ini", "General", "User", "") $pw = IniRead(@ScriptDir & "\VPN Launcher.ini", "General", "Password", "") $ping_ip = IniRead(@ScriptDir & "\VPN Launcher.ini", "General", "Ping_IP", "") $cmd = "Rasdial.exe " $i = 0 While 1 $i = $i + 1 TrayTip("Attempting Connection", "Attempting connection to " & $vpn_ip & @CRLF & _ "Attempt #" & $i, 5) RunWait($cmd & " " & $entry & " " & $user & " " & $pw & " /phone:" & $vpn_ip, "", @SW_HIDE) $ping = Ping($ping_ip, 500) If $ping > 0 Then TrayTip("Success!", "A solid VPN connection has been made to " & $vpn_ip & @CRLF & _ "Number of Attempts = " & $i, 5) Sleep(3000) Exit Else TrayTip("Retrying Connection", "Retrying connection to " & $vpn_ip, 5) RunWait($cmd & "/disconnect", "", @SW_HIDE) Sleep(3000) ContinueLoop EndIf WEnd EndFunc The VPN Launcher.ini this program uses is formatted as follows: [General] VPN_IP= User= Password= Ping_IP= So far this program has worked for us beautifully. Feel free to copy, enhance or change this to your liking.