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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Help Accessory Manager and Visual Basic

Status
Not open for further replies.

jzanca

Programmer
Jul 1, 2014
3
BR
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

Thanks

appExcel = CreateObject("Excel.Application")
wbExcel = appExcel.Workbooks.Open("d:\teste.xlsx")
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.")
Stop
End If

If (Sessions Is Nothing) Then
MsgBox("Could not create the Sessions collection object. Stopping macro playback.")
Stop
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.")
Stop
End If

If Not Myscreen.Visible Then
Myscreen.Visible = True
End If
appExcel.Worksheets("Main").Activate()
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)

Myscreen.screen.Sendkeys("<Transmit>")
Myscreen.screen.WaitHostQuiet(g_HostSettleTime)
System.TimeoutValue = OldSystemTimeout

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

Next

appExcel.ActiveWorkbook.Save()

appExcel.Visible = True


appExcel.ActiveWorkbook.Close()
appExcel = Nothing

End Sub
 
Hi,

Just curious why...
Code:
g_HostSettleTime = 3000 ' milliseconds
OldSystemTimeout = System.TimeoutValue
'...
Myscreen.screen.Sendkeys("<Transmit>")
Myscreen.screen.WaitHostQuiet(g_HostSettleTime)
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.

Skip,
[sub]
[glasses]Just traded in my OLD subtlety...
for a NUance![tongue][/sub]
 
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
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top