This type of connection with an Active X allows to connect the X64 Terminals to any application in a few minutes. We are going to describe step by step a connection to a program in VB. The first step is opening a new application. After that, it is necessary to install the EasyTerm component.

 

 

A new application is opened in VB and a new component is installed in a Form.



 

The two screens must be filled in, the fist one asks for the Ref. and the Qt. And the second shows a message of error.
To instert lines, Ins, Shift+Ins, Del y Shift+Del is used..

Size -> Field's size
Input -> 1/0 Whether is input or not
ExitField -> 1/0 Whether it must quit when it arrives to the end of the field
Hidden -> 1/0 Input fields of password type
Barcode -> 1/0 It connects the barcode reader. (By using the arrow that looks to the right it connects the laser, and using the arrow that looks to the left it selects input keyboard)
NewLine -> 1/0 Change of line
Protected -> 1/0 It allows to have an input field that cannot be changed
SendWithEnter -> 1/0 If Enter is pressed, the screen is sent

Screen 1:



 

 

 

 

 

 

 

 

 

 

 

 

Screen 2:



 

After this, you can put some code in Form:

Private Sub EasyTerm1_ReceiveData(TerminalId As String, Screen As Integer, Answer As String)

If Screen = 1 Then

EasyTerm1.SendScreenToTerminal TerminalId, 2

End If

If Screen = 2 Then

EasyTerm1.SendScreenToTerminal TerminalId, 1

End If

End Sub

Private Sub EasyTerm1_ReceiveReset(TerminalId As String)

EasyTerm1.SendScreenToTerminal TerminalId, 1

End Sub


Private Sub Form_Load()

EasyTerm1.InitializeCom

End Sub


Private Sub Form_Unload(Cancel As Integer)

EasyTerm1.TerminateCom

End Sub

-----------------------------------------------------------------------------------------------------------------

Now the program can be made start. In the terminal, the program XRTN must be started and then press any key or the emulator must be made start.

The emulartor is on this website, at the Download link.




 

 

 

 

 

A key is

 

 

 

 

 

 

 

Another key is:



 

EasyTerm ActiveX Functions


Events

Private Sub EasyTerm1_ReceiveData(TerminalId As String, Screen As Integer, Answer As String)

TerminalId – Name of the Terminal which sent the data.
Screen – Number of the sent screen.
Answer – It allows to know if the Enter or the Escape key were pressed on that screen. If on each line text it is written a text like: “ 1- List, 2- Print, 3- Balance”, etc. this options returns the value that appeared at the beginning of the line if this was selected and the 'SendWidthEnter' option is activated.

Private Sub EasyTerm1_ReceiveReset(TerminalId As String)

If the terminal Reset button is pressed and after that any key, the terminal will want to start communications.

Functions

Public Function WriteDataToMatrix(TerminalId As String, Screen As Integer, Line As Integer, Texto As String)

Parameters:
TerminalId – Name of the terminal in wich matrix data are to be written.
Screen – Number of the screen that is going to be modified.
Line – Line that is to be modified.
Text – Text that is going to be changed.

Public Function ReadDataFromMatrix(TerminalId As String, Screen As Integer, Line As Integer)

Parameters:
TerminalId – Name of the terminal in wich the data are going to be written on the matrix.
Screen – Number of screen that is going to be modified.
Line – Line that is going to be modified.
Returns to Text.

Public Function InitializeCom() As Boolean

It searchs the Base and starts communications. If it did not find the base, it would return to False.
It opens the Serial Port.

Public Sub TerminateCom()

It closes the serial port.

Public Sub SendScreenToTerminal(TerminalId As String, Screen As Integer)

It sends to the 'TerminalId' terminal the 'Screen' screen.

Public Sub ChangeFilename(Filename As String)

It allows to form the name of the file that the Easyterm uses as a auxiliary file.

All the examples referred above can be seen with the Emulator. On the Emulator the XRTN program must be installed, then the Emulator must be executed and after that the program must be started in VB.