Jump to content

prasad123

Members
  • Posts

    9
  • Joined

  • Last visited

Everything posted by prasad123

  1. Hello everyone I have written a code i which I have many GUI's at the start of the code to take different user inputs. First GUI pops, user enters value or selects a radio button , and clicks on OK. Then the next GUI pops. Now suppose the user enters some value in one GUI and clicks on OK. Then the next GUI will pop. Now lets assume the user realised some mistake and wants to change the input given in the first GUI. So is there any way the user can go back to the previous GUI and make some changes in it, by pressing some hotkey maybe...... Can anyone please suggest how this can be achieved. Thanks and Regards
  2. Hi All Well I have a Win 7 based X-Ray machine on which I am doing some automation tests using Autoit. The entire code is working properly. I have interfaced an external Arduino board to the X-Ray machine using USB male A to USB male B cable. This communication is also working properly. This is the code which I am using. Func Exposure () Global $CMPort = 4 ; COM port initialisation Global $CmBoBaud = 9600 ; Baud Rate Select Global $sportSetError = '' ;Port Error Handle Global $CmboDataBits = 8 ; Number of bits to be sent at a time. Global $CmBoParity = "none" ; disable parity Global $CmBoStop = 1 ; stop bit polarity Global $setflow = 2 _CommSetPort($CMPort, $sportSetError, $CmBoBaud, $CmboDataBits, $CmBoParity, $CmBoStop, $setflow) _CommSetRTS(0) _CommSetDTR(0) _CommSendByte(1) EndFunc Now my problem is that, when any error situation comes on the X-Ray machine, it should pause the script, and send an email to the user stating that automation has halted. But there is no internet on the X-Ray machine. So I was thinking that I will connect a laptop having internet to the X-Ray machine. When script gets paused, the X-Ray machine will convey it to laptop. A separate automation code in the laptop will then send the email. My various doubts are: Can I use the above function to send message to the laptop, or do I need to modify anything How to read the message in laptop autoit code ? Is it similar to the sending program or any major changes are needed Can I use a simple USB A male to male cable to connect X-Ray system and laptop ? Or do I need cable with a hardware bridge ? Basically I am not doing any heavy data transfer. I just have to send one simple byte and that too only if the script gets paused. (If script doesnt get paused, then no problem at all) I will be extremely grateful for any help and suggestions. Thanks in advance
  3. Hi All I am creating a new folder in My Dcouments based on current date and time. Then I have to save a notepad file in that folder. $sPath = @MyDocumentsDir & "\Automation Test " & @MDAY & "." & @MON & "." & @YEAR & " " & @HOUR & "." & @MIN & "." & @SEC DirCreate($sPath) Run ("Notepad.exe") WinWaitActive ("Untitled - Notepad") Send ("This is some text") How do I save this notepad file in the created folder ? I tried with FileSaveDialog but it is not working. Am I doing it wrong or should I use some different function altogether Thanks and Regards
  4. Hi All This is a small excerpt from my code. Basically I am creating a folder in My Documents. I am naming the folder using the current date and time. Then I have to save some screenshots in that folder. First I go to My Documents window. Then I do following Send("^+{n}") ;Create New Folder in My Documents using ctrl+shift+n Sleep (1000) Local $pathname = "Automation Test" & " " & " " & @MDAY & "." & @MON & "." & @YEAR & " " & " " & @HOUR & "." & @MIN & "." & @SEC ;create a string with current date and time Send ($pathname) ;name the folder with this string Sleep(1000) Send("{ENTER}") ; Folder gets successfully created and renamed. Now I have to save some screenshots. Here I am facing problem. I tried following ways but nothing is happening: _ScreenCapture_Capture(@MyDocumentsDir & $pathname & "\myscreen.jpg") _ScreenCapture_Capture(@MyDocumentsDir & $pathname "\myscreen.jpg") _ScreenCapture_Capture(@MyDocumentsDir \ $pathname "\GDI-lus_Image1.jpg") Please guide me regarding the correct way of accessing that folder. Thanking in advance
  5. Hi All I have this code with which I am able to pause and resume my program. The functions work perfectly. However I wanted to display 2 messages: When I press pause first time, it should display "Program paused" When I press pause second time, it should display "Program resumed" Without being able to display these messages, the pausing and resuming is happening properly. But I am having trouble with the messages. HotKeySet("{PAUSE}", "TogglePause") Func TogglePause() $Paused = Not $Paused While $Paused Sleep(10) WEnd EndFunc Can someone please help me with the messages ?? Thanks in advance
  6. Oh .. never heard of this function before. I will check in Help about this function in detail. But why did you say that it is not the prettiest solution. Are you aware of any drawbacks of it which I need to take care of ?
  7. Thanks for replying. I know about WinExists and ControlClick. But problem is I cannot put it straight forward in my code because the Error Window pops up randomly at any point of the code. The most crude way will be to write this "IF block" after each and every line of the code, which is definitely not the thing to do. I need something based on TRY CATCH. Correct me if I am wrong. I am not able to get the proper structure and format for it.
  8. Hello All I have to do an automation task which will repeat in a loop for the set number of count. This code is working properly. Now the problem is that, sometimes an error window pops up. So I need to click OK on the error window. The popping is extremely random. Sometimes it may not pop even after 20 cycles of execution, or sometimes it can pop 2-3 times in the same cycle. Can anyone please suggest a basic format so that: My code runs normally for the set number of cycles, if no error window pops at all during the entire execution Whenever the error window pops, the code should click on its OK button and then return back to the execution of the main code. There should not be any pausing or abrupt termination of the main code. Please suggest some basic structure or some special function or command names which can help achieve this. Thanking in advance
×
×
  • Create New...