Hi Guys,
I'm trying to turn on the AccuTerm UV license sharing with a downloadable macro so that the users don't have to change anything themselves. The macro is really simple:
MACRO = "With ActiveSession.Settings"
MACRO := CHAR(25):" .DeviceLicenseMode = 1"
MACRO := CHAR(25):" .Apply"
MACRO := CHAR(25):"End With"
* Send the VBA script to the AccuTerm session
PRINT CHAR(27):CHAR(2):'P':MACRO:CHAR(13):
If the macro changes the DeviceLicenseMode then the macro halts until I hit the enter key. If it's already set then it doesn't.
Any idea why? It's almost like it's waiting for a confirmation of the changes or something. I don't want the users to have to hit enter to make this work.
------------------------------
Joe Goldthwaite
Consultant
Phoenix AZ US
------------------------------
Try changing the method you use to run the macro:
PRINT CHAR(27):CHAR(2):'R':MACRO:CHAR(13):
Here is the text from the manual about this method:
Executes VBA script statements (see above) except that the script is synchronized with the terminal state. This basically sets the session's InputMode property to 1 before the script starts and restores it once the script completes. This ensures that any characters received from the host will not be processed by the terminal emulator unless they are first processed in the script using Input or WaitFor functions. This has the effect of buffering any data, control codes or escape sequences received while the script is running. This is useful when changing Session properties such as screen sizes, terminal type, etc.
I have no idea whether this will resolve your issue, but it is worth trying.
Cheers,
Brian
------------------------------
Brian Speirs
Senior Analyst - Information Systems
Rush Flat Ltd
Wellington NZ
------------------------------
Try changing the method you use to run the macro:
PRINT CHAR(27):CHAR(2):'R':MACRO:CHAR(13):
Here is the text from the manual about this method:
Executes VBA script statements (see above) except that the script is synchronized with the terminal state. This basically sets the session's InputMode property to 1 before the script starts and restores it once the script completes. This ensures that any characters received from the host will not be processed by the terminal emulator unless they are first processed in the script using Input or WaitFor functions. This has the effect of buffering any data, control codes or escape sequences received while the script is running. This is useful when changing Session properties such as screen sizes, terminal type, etc.
I have no idea whether this will resolve your issue, but it is worth trying.
Cheers,
Brian
------------------------------
Brian Speirs
Senior Analyst - Information Systems
Rush Flat Ltd
Wellington NZ
------------------------------
Hi Brian,
I had started with the 'R' method and switched to 'P' when I ran into the problem. They both have the same issue.
Thanks though!
------------------------------
Joe Goldthwaite
Consultant
Phoenix AZ US
------------------------------
Hi Brian,
I had started with the 'R' method and switched to 'P' when I ran into the problem. They both have the same issue.
Thanks though!
------------------------------
Joe Goldthwaite
Consultant
Phoenix AZ US
------------------------------
Okay - I have looked through my scripts here ...
Change your script to this:
MACRO = "With ActiveSession.Settings"
MACRO := CHAR(25):" .DeviceLicenseMode = 1"
MACRO := CHAR(25):" .Apply"
MACRO := CHAR(25)" .Changed = 0"
MACRO := CHAR(25):"End With"
This tells the session to not warn of changes.
Brian
------------------------------
Brian Speirs
Senior Analyst - Information Systems
Rush Flat Ltd
Wellington NZ
------------------------------
Okay - I have looked through my scripts here ...
Change your script to this:
MACRO = "With ActiveSession.Settings"
MACRO := CHAR(25):" .DeviceLicenseMode = 1"
MACRO := CHAR(25):" .Apply"
MACRO := CHAR(25)" .Changed = 0"
MACRO := CHAR(25):"End With"
This tells the session to not warn of changes.
Brian
------------------------------
Brian Speirs
Senior Analyst - Information Systems
Rush Flat Ltd
Wellington NZ
------------------------------
Hi Brian,
No joy I'm afraid. In one of my revisions I was doing a .Save to make the changes permanent. That should have cleared the change flag similarly to ".Changed = 0". I had taken that out. I tried it with ".Changed = 0" but it didn't make a difference.
The problem I'm trying to solve is having the user session hang without anything telling them they need to hit enter. I think what I'm going to do is check to see if the setting needs to be changed. If it does I'll print a message to the user saying that it needs to be changed and to hit enter. After I display that message I'll send the macro. When it hangs the user already knows to hit the enter key.
It's a lot more difficult than I originally thought but it should work ok. The message will only come up the first time the user logs in with the wrong settings. After that it won't do anything.
Thanks again for your help and the time you spent on this. I think Rocket should look into it an maybe fix it. It looks like a bug to me. Hey, maybe it's fixed on AccuTerm 8? I have no way to check but maybe...
Joe G.
------------------------------
Joe Goldthwaite
Consultant
Phoenix AZ US
------------------------------
Hi Guys,
I'm trying to turn on the AccuTerm UV license sharing with a downloadable macro so that the users don't have to change anything themselves. The macro is really simple:
MACRO = "With ActiveSession.Settings"
MACRO := CHAR(25):" .DeviceLicenseMode = 1"
MACRO := CHAR(25):" .Apply"
MACRO := CHAR(25):"End With"
* Send the VBA script to the AccuTerm session
PRINT CHAR(27):CHAR(2):'P':MACRO:CHAR(13):
If the macro changes the DeviceLicenseMode then the macro halts until I hit the enter key. If it's already set then it doesn't.
Any idea why? It's almost like it's waiting for a confirmation of the changes or something. I don't want the users to have to hit enter to make this work.
------------------------------
Joe Goldthwaite
Consultant
Phoenix AZ US
------------------------------
Hi Joe -
The problem seems to be caused by resetting the connection, which is how changing the device licensing option is accomplished. Two options: either wait a short time after changing the option, like a second, to allow the reset to complete:
EQU ESC TO CHAR(27), STX TO CHAR(2), CR TO CHAR(13)
MACRO = 'InitSession.DeviceLicenseMode=1'
CRT ESC:STX:'R':MACRO:CR:
SLEEP 1
or wait for AccuTerm to respond after the reset using an INPUT in your program. Something like:
EQU ESC TO CHAR(27), STX TO CHAR(2), CR TO CHAR(13)
MACRO = 'InitSession.DeviceLicenseMode=1'
MACRO := CHAR(25):'InitSession.Output Chr$(13)'
CRT ESC:STX:'R':MACRO:CR:
PROMPT ''
INPUT RSP:
This has the effect of causing the UV program to wait until AccuTerm is finished with the reset and sends a response (a simple CR is sufficient).
If you want to instruct the user to save the session settings with the updated DeviceLicenseMode, then you may need to add more complexity to the script to test the current value, update it if its zero, then display a message box instructing user to save the change.
Thanks, Pete
------------------------------
Peter Schellenbach
Rocket Internal - All Brands
------------------------------