UtterAccess.com
X   Site Message
(Message will auto close in 2 seconds)

Welcome to UtterAccess! Please ( Login   or   Register )

Custom Search
 
   Reply to this topicStart new topic
> SmarTerm language reference?    
 
   
Harfleur
post Oct 25 2007, 03:38 PM
Post#1



Posts: 280
Joined: 26-March 03
From: Near Disneyland. No, really.


We use a terminal emulation program called SmarTerm by Esker to connect to a laboratory information system. It's got a macro language that looks like VB, but there's not enough information in the help files for me to get a handle on the language. Does anyone know of a reference for this program?
Thanks,
Eric
Go to the top of the page
 
germargo
post Oct 25 2007, 04:09 PM
Post#2


UtterAccess VIP
Posts: 4,959
Joined: 22-May 02
From: SouthEast MI, USA


Did you try 'googling'? link
Go to the top of the page
 
Harfleur
post Oct 25 2007, 04:33 PM
Post#3



Posts: 280
Joined: 26-March 03
From: Near Disneyland. No, really.


Thanks, German, but I've been to the Esker website, and it seems they just want to sell me more software. I never found any reference manual.
Go to the top of the page
 
truittb
post Oct 25 2007, 06:00 PM
Post#4


Retired Moderator
Posts: 13,563
Joined: 23-June 02
From: Texas (Is there anywhere else?)


Try setting a reference to the program, you should be able to find a dll file, and using the VBE and the object browser to see if any methods or objects are exposed.
Go to the top of the page
 
Harfleur
post Oct 29 2007, 12:31 PM
Post#5



Posts: 280
Joined: 26-March 03
From: Near Disneyland. No, really.


Truitt--
searched the references and didn't find anything. I'm assuming that in addition to not finding any more information on the SmartTerm language, this also means I won't be able to refer to it from another app?
Boo hoo.
Go to the top of the page
 
germargo
post Oct 29 2007, 01:39 PM
Post#6


UtterAccess VIP
Posts: 4,959
Joined: 22-May 02
From: SouthEast MI, USA


This software may be not ActiveX-based, so you may search for the files with .lib and/or .h extension to see definition and function you may use..
Go to the top of the page
 
Harfleur
post Oct 29 2007, 01:55 PM
Post#7



Posts: 280
Joined: 26-March 03
From: Near Disneyland. No, really.


German--
I'll go hunting for those. What would I use to open those files to poke around, or can I somehow get them up in the VBA editor?
--Eric
Go to the top of the page
 
germargo
post Oct 29 2007, 02:16 PM
Post#8


UtterAccess VIP
Posts: 4,959
Joined: 22-May 02
From: SouthEast MI, USA


You can not 'open' .lib files, but it is point you to your software is non-ActiveX but it is a MFC (C/C++) based. But you can open .h files via Notepad, Visual Studio or .NET.
Go to the top of the page
 
AccessHappy
post Feb 11 2010, 03:11 PM
Post#9



Posts: 5
Joined: 11-February 10



Ping this thread.
id you get any further with your search for Smarterm language reference?
I've recently had to start working with an old version of Smarterm Office (09) and am using DDE to read/write data and send commands. I'd be interested to know if you are still using Smarterm, possibly a different version? I believe the more recent versions support OLE and ActiveX.
Any information would be appreciated at this point.
Simon
Go to the top of the page
 
Harfleur
post Feb 11 2010, 05:11 PM
Post#10



Posts: 280
Joined: 26-March 03
From: Near Disneyland. No, really.


Hi Simon--

Odon't think our version is SmarTerm Office, just SmarTerm. It's v. 11.0, copyright 2002.

My resource ended up being a manual for the macro language that I found somewhere on our company network, as I recall. My programming is simple enough (mostly data entry) that I haven't gone towards OLE and ActiveX stuff, which is fortunate, because my knowledge is pretty much nonexistent in those areas.

There are a few questions that still remain unanswered, mostly revolving around SmarTerm behaving unexpectedly while my code is running. I've definitely run up against some issues I haven't been able to solve.

Good luck! I'll say the same to you: if you find anything useful, I'd love to hear about it.

Thanks,
Eric
Edited by: Harfleur on Thu Feb 11 17:15:20 EST 2010.
Go to the top of the page
 
AccessHappy
post Feb 15 2010, 06:22 AM
Post#11



Posts: 5
Joined: 11-February 10



Thanks for the reply Eric.
I've found the built-in Macro language reference and done a couple of Macros within Smarterm, but found that slow progress and difficult to make robust (e.g. check that user is in the right 'starting location' for the macro and deal with delayed responses from host).
I've made some better progress using DDE. I can get data from and write data to the terminal screen.
We're only using version 9.01 at the moment. I'm hoping to persuade the powers that be to upgrade.
Thanks again for replying. If you're at all interested in DDE code (to control Smarterm from Access/Excel) just let me know.
Simon
Go to the top of the page
 
Robertski
post Mar 9 2010, 10:01 PM
Post#12



Posts: 2
Joined: 9-March 10



Hi Access Happy,
I would be very interested in your DDE code since I am trying to get Excel to call a macro in SmarTerm. I don't have any problems calling Excel macros from SmarTerm but haven't found a solution. Your help would be appreciated.
egards
Robertski
Go to the top of the page
 
AccessHappy
post Mar 10 2010, 06:37 AM
Post#13



Posts: 5
Joined: 11-February 10



Hi Robertski, sorry I've only just noticed your response. I'm not getting my notifications
haven't done this (called Smarterm macros) myself, and am still struggling to find a complete Smarterm Reference Manual, but did come across an example of calling a PCN-
Term macro in this document: http://tnmtechs.com/thenet/ajones/PCN-Term...at/Emul32en.pdf
NB This is not Smarterm, but another related product, so no guarantees that you can adapt it.
This is the key line for you:
DDEExecute canal2, "[Macro(" + (Chr$(34) +
"demo\\\\dde\\\\logindde.mac + Chr$(34) + ")]"
See section/page 5-81
This macro is written in Visual Basic for Excel. It performs the
following operations:
1. Starts PCN-TERM.
2. Initializes a DDE link between an Excel spreadsheet and PCNTERM's
system topic using the method DDEInitiate.
3. Opens a specific configuration using the method DDEExecute and
the command Open, and reduces PCN-TERM's main window with
the command Resize.
4. Fetches a list of open sessions using the method DDERequest with
the item Topics, and selects the first session from the list
(corresponding to the UNIX server).
5. Initializes a DDE link between the Excel spreadsheet and this
session using the method DDEInitiate.
6. Starts the emulation session by executing an PCN-TERM
connection session and sending commands using the method
DDEExecute with the command SendData.
7. Updates the data from the emulation screen using the method
DDERequest with the item ScreenRect.
8. Closes all the emulation sessions using the method DDEExecute
with the Close command from the system topic.
9. Closes the open DDE links using the method DDETerminate.
The code for the sample macro is as follows:
Sub DDEMacro()
RetVal = Shell("C:\PROGRA~1\TUN\EMUL\EMUL32.EXE", 1)
'1
canal1 = Application.DDEInitiate(app:="EMULWIN",
topic:="System")
'2
Application.DDEExecute canal1, "[Open(" + Chr$(34) +
"demo\\\\dde\\\\ddeconf.cfg")] [Resize(0)]"
'3
listTopics = Application.DDERequest(canal1, "Topics") 4
session1$ = listTopics(1)
waitTime = TimeSerial(Hour(Now()), Minute(Now()),
Second(Now()) + 3)
Application.Wait waitTime
canal2 = Application.DDEInitiate(app:="EMULWIN",
topic:=session1$)
'5
DDEExecute canal2, "[Macro(" + (Chr$(34) +
"demo\\\\dde\\\\logindde.mac + Chr$(34) + ")]"
'6
waitTime = TimeSerial(Hour(Now()), Minute(Now()),
Second(Now()) + 20)
Application.Wait waitTime
DDEExecute canal2, "[Senddata(" + Chr$(34) + "cd home"
+ "\\r" + Chr$(34) + ")]"
DDEExecute canal2, "[Senddata(" + Chr$(34) +
"./ddedemo2.sh" + "\\r" + Chr$(34) + ")]"
For k = 1 To 20
'7
waitTime = TimeSerial(Hour(Now()), Minute(Now()),
Second(Now()) + 1)
Application.Wait waitTime
sales = DDERequest(canal2,
"ScreenRect(0,8,41,12,43)")
For i = LBound(sales) To UBound(sales)
s$ = sales(i, 1)
j = i + 4
cell$ = "D" + j
Worksheets("Sales").Range(cell$).Value =
Val(s$)
Next i
Next k
Application.DDEExecute canal1, "[Close]" '8
Application.DDETerminate canal1 '9
Application.DDETerminate canal2
End Sub
Go to the top of the page
 
AccessHappy
post Mar 10 2010, 07:10 AM
Post#14



Posts: 5
Joined: 11-February 10



Further to my last message:
ather than using smarterm macros, I'm doing all control from DDE, using DDEEXecute(SendData) to send navigation commands and data and using my 'DDECutfield' function to retrieve data and check that Smarterm is staying in step (by requesting a part of the smarterm screen that indicates that it has loaded the desired screen before I send more data). This is not ideal, but is proving to work.
Function DDESendCommand(DDEChannel As Long, commandString As String, Optional debugMode As Boolean = False)
On Error Resume Next
DDEExecute DDEChannel, "[Senddata(" & commandString & ")]"
If debugMode Then Debug.Print "DDEExecute: " & "[Senddata(" & commandString & ")]"
End Function
Function DDECutField(DDEChannel As Long, lineNumber As Integer, columnNumber As Integer, characters As Integer, Optional debugMode As Boolean = False) As String
On Error Resume Next
Dim commandString As String
' Construct the command string
commandString = "Screen("
commandString = commandString & LTrim(Str(lineNumber)) & ","
commandString = commandString & LTrim(Str(columnNumber)) & ","
commandString = commandString & "1,"
commandString = commandString & LTrim(Str(characters))
commandString = commandString & ")"
If debugMode Then Debug.Print "DDECutField commandstring = " & commandString Else
DDECutField = DDERequest(DDEChannel, commandString)
If debugMode Then Debug.Print " Result = " & DDECutField Else
End Function
To get DDE information from Smarterm, open a channel to the 'system' topic to find out more about what commands and items it supports.
--
'This is code from a class(form) module I'm working on at present. It's a 'work in progress' so there are bits (constants/variables) that don't get used because I've copied from earlier code.
'
'To use it, you just need a form with a button called cmdGetDDEInfo and a text box called txtResult
'
Option Compare Database
Option Explicit
Private Const strDIV = "----------------------------------------------"
Private Const ActionTimeout As Integer = 10 'Time in seconds to allow before failing with timeout error - this used when navigating between screens in smarterm (not used yet in this module)
Private Sub cmdGetDDEInfo_Click()
Dim strTest As String, Tpic As String, strLoginScreenIdentifier As String, screenContent As String
Dim msgString As String, strOutput As String
Dim DDESysChan As Long
Me.txtResult = Null 'start with empty results field

writeOut vbNewLine & strDIV & vbNewLine & "cmdGetDDEInfo_Click @ " & Now()
On Error GoTo ErrorTrap


'Open a channel to SYSTEM to get a list of open sessions and other DDE info.
DDESysChan = DDEInitiate("STOFFICE", "System")
writeOut "DDE SYSTEM Channel opened: " & DDESysChan

strTest = DDERequest(DDESysChan, "Topics")
writeOut "Topics: " & strTest

strTest = DDERequest(DDESysChan, "SysItems")
writeOut "SysItems: " & strTest

strTest = DDERequest(DDESysChan, "Formats")
writeOut "Formats: " & strTest

strTest = DDERequest(DDESysChan, "TopicItemList")
writeOut "TopicItemList: " & strTest

strTest = DDERequest(DDESysChan, "Status")
writeOut "Status: " & strTest

strTest = DDERequest(DDESysChan, "Help")
writeOut "Help: " & strTest

DDETerminate (DDESysChan)

'Close DDE Channels
DDETerminateAll
Exit Sub

ErrorTrap:
msgString = "Error " & Err.Number & " (" & Err.Description & ")"
Debug.Print msgString
MsgBox msgString, vbOKOnly + vbCritical, "DDE Error"
DDETerminateAll
End Sub
Sub writeOut(inputString)
Debug.Print inputString
Me.txtResult = Me.txtResult & vbNewLine & Replace(inputString, vbTab, " - ")
End Sub
Go to the top of the page
 
Robertski
post Mar 10 2010, 06:04 PM
Post#15



Posts: 2
Joined: 9-March 10



Hi AccessHappy,
thanks for the response. I haven't had time to go through it in detail but I'm pretty sure it's what I'm after. I can send you a copy of the Smarterm Macro Guide just let me know.
nce again thanks
Go to the top of the page
 
AccessHappy
post Mar 30 2010, 07:17 AM
Post#16



Posts: 5
Joined: 11-February 10



Hi y'all.
If anyone is interested, I've now discovered it is possible to use OLE (late-binding only) with SmarTerm. I initially thought I'd have to upgrade to a later version to use it, but having established how to use OLE in the latest (2009) version, I've found that it also works in versions back to 9 and possibly earlier.
Here's the code:
CreateObject
Dim Application As Object
Set Application = CreateObject("SmarTerm.Application")
GetObject
Dim Application as Object
Set Application=GetObject(,"SmarTerm.Application")
Creating other Objects
Once the Application object has been created, you can use it to create other objects to automate a
SmarTerm Session, Connection, or File Transfer. A brief description of each object and sample code for
creating the object follows.
Creating a Session Object
The Session object is used to control the SmarTerm Session. By creating this object, you can send data to
the host, retrieve data from the SmarTerm Session window, and many other session oriented functions.
There are two methods of creating an object for a SmarTerm session. The one you use will depend on if the
session you want to automate is already running, or if starting a new session is preferred.
Method A
This method should be used if you want to start a new instance of a saved session. This particular example
will start a new instance of SmarTerm and open the session file telnet.stw.
Dim Application as Object
Dim Session as Object
Set Application=CreateObject("SmarTerm.Application")
Set Session=Application.Sessions.open("c:\progra~1_
\persoft\stoffice\sessions\telnet.stw")
Note: If the FTP Client is started rather than the session file you specified, double check the full path and
filename is specified correctly when using Application.Sessions.Open. If the session file is not found, the FTP
Client is started by default.
Method B
This method should be used if you want to link to a running instance of SmarTerm and the first session that
was opened (if more than one session is running, some checking of which session number you wish to link to
will be required).
Dim Application as Object
Dim Session as Object
Set Application=GetObject(,"SmarTerm.Application")
Set Session=Application.Sessions.Item(0)
Creating a Circuit Object
The Circuit object is used to control the SmarTerm connection. By creating this object, you can connect or
disconnect from the host as well as query and set many connection properties. To create the Circuit object, a
Session object must have been created first.
Dim Application as Object
Dim Session as Object
Dim Circuit as Object
Set Application=CreateObject("SmarTerm.Application")
Set Session=Application.Sessions.open("c:\progra~1\_
persoft\stoffice\sessions\telnet.stw")
Set Circuit=Session.Circuit
Creating a Transfer Object
The Transfer object is used to control a file transfers from the host to PC, or PC to host. By creating this
object you can automate file uploads and downloads. To create the Transfer object, a Session object must
have been created first.
Dim Application as Object
Dim Session as Object
Dim Transfer as Object
Set Application=CreateObject("SmarTerm.Application")
Set Session=Application.Sessions.open("c:\progra~1\_
persoft\stoffice\sessions\telnet.stw")
Set Transfer=Session.Transfer
The above code was in a PDF on the Esker Americas website (requires registration to view).
Once you get that far, you can refer to the macro guide to manipulate properties and methods of the objects. I have the latest version of the macro guide (2009) if anyone wants it.
That's all folks <
Go to the top of the page
 
truittb
post Mar 30 2010, 04:50 PM
Post#17


Retired Moderator
Posts: 13,563
Joined: 23-June 02
From: Texas (Is there anywhere else?)


Thanks for posting back with your solution.
Go to the top of the page
 
Meanderthal
post Jun 14 2010, 02:31 PM
Post#18



Posts: 1
Joined: 15-February 06
From: texas


Hi Harfleur,
What lab system are you working with? I have a lot of macro experience using Smarterm with the Sunquest lab system. If you need any tips or examples I might be able to help. In my experience the late-binding OLE provided by Smarterm is pretty weak, I just use it to start the Smarterm object and use a session macro to take it from there. I don't have any experience with DDE. Smarterm macro language is based on or adapted from 'Basicscript'. You might find more commands and examples by googling that.
Oalso have posted some excel macro examples, programs, and topics that are lab-related on my blog: www.synapsonic.com
Go to the top of the page
 
AlienV
post Jan 14 2014, 08:59 PM
Post#19



Posts: 1
Joined: 14-January 14



Hello everyone,
I am new to this forum. I was hoping that AccessHappy (or anyone!) might be able to help me. I hope users are still active!
I am working on a project that utilizes SmartTerm. I have had limited success with Excel macros accessing the SmarTerm object because I been running into some quirky issues. The SmarTerm window seems to update in Fast FWD mode after the macro releases (buffered) the object reference but not when it is running. It's as if it isn't doing anything (SmarTerm) Excel is telling it to do and therefore I can't respond to the host as I would like. SmarTerm is completely non-responsive during OLE automation. It won't respond to my physically typing in the terminal window. I am also trying unsuccessfully to use the Stringwait method through Excel. It always times out. Have you had any of this quirky behavior? This makes scraping data impossible as everything happens after the fact. I might have to try releasing it after every command if nothing works. Thanks in advance.
Go to the top of the page
 


Custom Search
RSSSearch   Top   Lo-Fi    17th December 2017 - 12:44 PM