Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here


Help Accessory Manager and Visual Basic

Help Accessory Manager and Visual Basic

Help Accessory Manager and Visual Basic

Hi , all ,

I´m programing a visual basic application (read from excel and capture from Accessory Manager) , is almost working , is reading and capturing information, but the problem is that , after the <transmit>, to get the result in the screen , is returnig , another screen not with the putstring data

Here is the code


appExcel = CreateObject("Excel.Application")
wbExcel = appExcel.Workbooks.Open("d:\teste.xlsx")

System = CreateObject("ACCMGR.System") ' Gets the system object

If (System Is Nothing) Then
MsgBox("Could not create the EXTRA System object. Stopping macro playback.")
End If

If (Sessions Is Nothing) Then
MsgBox("Could not create the Sessions collection object. Stopping macro playback.")
End If

g_HostSettleTime = 3000 ' milliseconds
OldSystemTimeout = System.TimeoutValue

If (g_HostSettleTime > OldSystemTimeout) Then
System.TimeoutValue = g_HostSettleTime
End If

Myscreen = System.ActiveSession

If (Myscreen Is Nothing) Then
MsgBox("Could not create the Screen object. Stopping macro playback.")
End If

If Not Myscreen.Visible Then
Myscreen.Visible = True
End If
Lastrow = appExcel.Worksheets("Main").UsedRange.Rows.Count

For fila = 2 To Lastrow

Consumo = Trim(appExcel.Worksheets("Main").Cells(fila, 1).Value)
Eco_Dom = Trim(appExcel.Worksheets("Main").Cells(fila, 5).Value)
Com_Esgoto = Trim(appExcel.Worksheets("Main").Cells(fila, 17).Value)

Myscreen.screen.putstring(Consumo, 4, 39)
Myscreen.screen.putstring(Eco_Dom, 6, 39)
Myscreen.screen.putstring(Com_Esgoto, 15, 39)

System.TimeoutValue = OldSystemTimeout

Saida = Myscreen.screen.getstring(20, 40, 17)
appExcel.Cells(fila, 19).Value = Saida



appExcel.Visible = True

appExcel = Nothing

End Sub

RE: Help Accessory Manager and Visual Basic


Just curious why...


g_HostSettleTime = 3000 ' milliseconds
OldSystemTimeout = System.TimeoutValue
Would you predetermine, for instance, "I'll stop at every traffic light, regardless if the signal is red or green, for 30 seconds: then proceed through the intersection?

You're working with an asynchronous system, and must wait for a response. It could be seemingly instantaneous or it could take second, minutes, or the transaction may even be A transaction outage with no response until some maintenance action is performed.

I often preform a loop using WaitForCursor at the screen rest coordinates.


glassesJust traded in my OLD subtlety...
for a NUance!tongue

RE: Help Accessory Manager and Visual Basic

Hi , thanks for the quick answer

First of all yor are right , I´m new in this interaction between VB e Mainframe , after post this help ,, I found some other solution in the same direction that you are pointing, use a loop catch a string or a cursor no know the return of the screen ,, I already try this but is not solving my problem.

My problem is focus specifically in the <transmit> , talking with our mainframe personal , they told me , that our mainframe as a configuration problem, when I send a transmit of a specific screen , the screen that is returned is another screen user , is the same screen but with data from a another user , they told me , that there is a common memory space used for all user using the same screen.

The code works ,, considering the fact pointed for you,, (i will fix) , but after the transmit in the loop , I catch information from another screen and not from my screen.

Thanks a lot for your help ,, any thoughts in this problem of the commit , sorry for my english is a little rusted

Have a good day

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close