Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

UTS2200 Screen update

Status
Not open for further replies.

edwardsaus

Programmer
Jul 7, 2010
3
0
0
AU
Hi,

I have created a VBA macro to run certain commands on a uts-2200-1 COM screen.

However, when I input a command via the macro, the screen stalls before data is uploaded on the screen (Please see attached figure).

Is there a way to detect when the data has been completely loaded to the screen, before I can parse it? (Maybe the WAIT string on line 25 which I am unable to access - please see attached figure).

Here is the code:
Code:
Sub testUTS()
    Dim time1obj, screen1obj As Object
    Dim myArea As Object
    Dim waitObj As Object
    Dim i As Integer
    
    'Open accessory manager
    retval = Shell("C:\Program Files\Attachmate\INFOCNEE\Accmgr32\accmgr32.exe", 6)
    'Set the session
    Set time1obj = GetObject("C:\Program Files\Attachmate\INFOCNEE\Sessions\ENU\uts-2200-1.idp")
    'Set the screen
    Set screen1obj = time1obj.screen
    
    screen1obj.SendInput ("res")
    screen1obj.SendKeys ("<transmit>")
End Sub

Figure(after entering the command):

Thanks

Ed
 
I currently have this:
Code:
Sub Test()

    Dim time1obj, screen1obj As Object
    Dim i As Integer
    
    'Open accessory manager
    retval = Shell("C:\Program Files\Attachmate\INFOCNEE\Accmgr32\accmgr32.exe", 6)
    'Set the session
    Set time1obj = GetObject("C:\Program Files\Attachmate\INFOCNEE\Sessions\ENU\uts-2200-1.idp")
    'Set the screen
    Set screen1obj = time1obj.screen
    
    screen1obj.SendInput ("res")
    screen1obj.SendKeys ("<transmit>")

    breakLoop = 0
    firsttime = 1   'Ignore an update the first time, since it may be different
                    'to the screen that was previously called
    While breakLoop <> 1
        myBool = myScreen.Updated
        Debug.Print myBool
        If myBool = True And firsttime <> 1 Then
            breakLoop = 1
        End If
        Call Sleep(1)
        firsttime = 0
    Wend
End Sub

Note: sleep function from Lib "Kernel32" for milliseconds wait.

Can anyone suggest something better?

Thanks

Ed
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top