Serial Link 3.0 User Guide
Introduction
Serial Link software allows you to capture serial data and send it to any
Windows based application as keyboard input or via DDE, to any major ODBC
database and to an ASCII log file. Or you may configure Serial Link to
send serial data to any combination of these.
Serial Link also allows you to program a serial conversation by polling
a device and by providing feedback to the serial device.
Serial Link provides the means to customize each of these options as
well as letting you configure the port that data is being received on.
Serial Link provides a normal run mode as well as a test mode that displays
useful debugging information.
The debug mode allows you to test the serial port to determine if you
are receiving data and to determine if your port setting are correct. The
debug mode also allows you to simulate serial input to test whether your
outputs are configured correctly.
Contents
Loading and Saving Configurations
Serial Link allows you to develop different configurations for different
purposes which may be loaded and saved on demand. Different configurtions
can have
different port settings and may also have different output options.
The File Menu has options to open a configuration or save changes to
a configuration. When Serial Link starts it will automatically load the
configuration that it
was using when it was last closed. You may open a different with the
File | Open option. If changes are made to a configuration they may be
saved with the File |
Save option. The File | Save As option may be used to save the configuration
to a new file, creating a new configuration. You may discard changes made
to a
configuration by reloading it with the File | Reload option.
Contents
General Configuration
The Setup | Options menu option will load the Serial Link Setup window
that lets you set general configuration options. From here you can tell
Serial Link to
which output options you want to use and whether you want it to start
up running or in configuration mode. You can also tell Serial link to remove
control
characters from serial input before sending it on. The following options
are available
Start up in Run Mode This option allows you to setup Serial Link
to start up running. This is common in a production setting when you want
to load Serial Link and begin data collection at boot up.
Start Minimized This option will cause Serial Link to minimize
when it loads.
Remove Control Characters This option will remove any control
characters from the input string before any parsing or transmission occurs.
Counter The counter option allows you to program a counter that
will increment each time serial input is received. This counter may then
be included in formatted output to the database, keyboard wedge, log file
or DDE item.
Initial Counter Setting The initial counter setting indicates
the starting point for the counter.
Keyboard Wedge to Application The keyboard wedge output will
allow you to send data to another application as if an operator were keying
it into the application.
Log to ASCII File The ASCII log allows you to write data to an
ASCII file for debugging or historic purposes.
DDE to Application The DDE option allows you to send output can
be sent to any application such as Microsoft Excel or Allen Bradley RSLinx
that is capable of acting as a DDE server.
Database Update The database update option allows you to record
serial data into an ODBC database.
Contents
Serial Port Configuration
The Setup | Serial Port menu option loads the Port Configuration window
that lets you configure the serial port communication parameters such as
baud rate and
parity. It will also allow you to place qualifiers on serial input
as well as send serial outputs.
Communication Parameters
The Serial Port Configuration window allows the port number, baud rate,
parity, data bits, stop bits and flow control to be selected. Each of these
fields has a
selection list including all supported values.
Input Qualifiers
Input qualifiers are used to determine when a complete string has been
received. If input is received from the port that does not satisfy these
parameters then it
will be held until sufficient data is received to meet the requirements.
The requirements that you can program are a minimum length and an end of
record
character. If you choose to use both of these then you may select to
“and” the two requirements (both must be satisfied before the input is
considered complete
or to “or” the two requirements (if either requirement is satisfied
then the input will be considered complete).
Output Parameters
Output parameters allow you to send serial data to the device. You
may program Serial Link to send data when it starts up (enters “run” mode).
You may also
program Serial Link to send data at intervals for instance to poll
a device. To program a startup communication, simply enter the string in
the Startup String field.
To program Serial Link to poll check the Enable Polling field, enter
a time interval and enter the string to be sent in the Transmitted String
field.
Any printable character can be included in either the startup or polling
output strings. Additionally control characters can be indicated by prefixing
them with the
carat (^) symbol.
Feedback
The Feedback button launches the Feedback Setup window that allows
you to program a conversation.
Contents
Keyboard Wedge Configuration
The Setup | Keyboard Wedge menu option loads the Wedge Configuration window
that allows you to configure the wedge interface. The wedge may operate
in
one of three modes. It can send data to whatever window is currently
active at the time, it can send data to a specific window, or it can send
data to the active
window of a specific application.
If Serial Link is to send data to a specific window then you need to
identify it by it’s title bar. It is not necessary to indicate the entire
window title, just enough to
uniquely identify it. For instance if you want to send data to notepad
then you could enter “Notepad” as the window title even though the actual
title will include
the name of the file being edited. If more then one notepad window
is opened then the actual window used will be random, however once Serial
Link starts
sending data to one Notepad session it will continue until that session
is closed. If this window becomes unavailable then serial link will attempt
to find another
window that matches the title and if it can not it will stop sending
data.
You may also configure Serial Link to launch the application it is to
send data to. In this case, if the appropriate application can not be found
it will be launched.
The Output Format field can be used to format the data that is sent
to the application. See the Formatted Output section for more information.
Contents
Log File Configuration
The Setup | Log File menu option loads the Log File Configuration window
that lets you indicate the name and location of the log file and also indicate
the type of
data that will be logged. You may key in a log file name and path or
you may use the Browse button to select the location of the log file. If
you may also select an
existing file it will be appended.
Contents
DDE Configuration
In order to configure DDE you must select an application that behaves as
a DDE server, select a topic and select an item. Examples of DDE servers
are Excel,
WinWord and RSLinx. A DDE topic is typically a document name or in
the case of Excel a sheet number. The DDE item is typically a cell or field
name. For
Excel this could be a cell number such as R1C1.
Contents
Serial Feedback Configuration
The Serial Feedback window is loaded through the Feedback button on the
Port Configuration window and allows you to program a serial conversation.
A serial conversation is programmed by providing responses to inputs
that can be received from a serial device. You can provide responses to
any number of
different inputs. The when serial link receives an input it will search
the list of programmed inputs. If one is found then the corresponding response
is sent.
Each response has three parts, an input string, an input position and
a response string. In order for a serial input to match one of the programmed
inputs it must
contain the programmed string at the indicated position. You may optionally
omit the position in which case any input that contains the programmed
input string
anywhere will be considered a match.
Contents
Formatted Output
Ordinarily Serial Link will transmit exactly what was received from the
serial device. Formatted output allows you to customize the output by adding
data to the output, removing data from the serial input or both. In addition
to serial input data that was received, you may output the user id, the
current data and time, the counter value and the station id number. Formatted
output may be used for advanced database updates, for keyboard wedge output
and for the DDE item.
The # character is used to indicate these data fields. Syntax
for the data fields are as follows:
| #C |
Insert the counter value |
| #D |
Insert the current date |
| #S |
Insert the station id |
| #T |
Insert the current time |
| #U |
Insert the user id |
| # |
Insert the entire serial input string |
| #[x] |
Insert an excerpt from the serial input string beginning with the xth
character and continuing to the end of the string |
| #[x,y] |
Insert an excerpt from the serial input string beginning with the xth
character and ending with the yth character. |
Examples:
The following statement will insert data into a table named table1
in four different fields. The first five characters of the data will be
inserted into field1, the remainder of the data will b placed into field2,
the current date will be inserted into field2 and the current time will
be inserted into field4.
insert into table1 (field1, field2, field3, field4) values (‘#[1,5]’,
‘#[6]’, ‘#D’, ‘#T’)
The following statement executed an Oracle PL-SQL block that executes
a stored procedure named procedure1. The entire serial data is passed as
the first parameter, the Windows station id is passed as the second and
the Oracle sysdate and user functions are used to pass the last two parameters.
begin procedure1(‘#’, ‘#S’, sysdate, user); end;
The following format can be used as the DDE item when sending output
to Excel to Insert values into column 1 with each data submission being
entered in the row below the previous one.
R#cC1#
Contents
Keystroke Formatted Output for Special Keys
In addition to the normal formatting that can be performed, Serial Link
allows you to send special keys such as cursor movement keys. The codes
for the special keys are as follows:
| {BKSP}, {BS} or {BACKSPACE} |
Backspace key |
| {BREAK} |
Break key |
| {CAPSLOCK} |
Caps lock key |
| {CLEAR} |
Clear key |
| {DEL} or {DELETE} |
Delete key |
| {DOWN} |
Down arrow key |
| {END} |
End key |
| {ENTER} |
Enter key |
| {ESC} |
Escape key |
| {F1}, {F2}, {F3}... {F16} |
Function keys |
| {HELP} |
Help key |
| {HOME} |
Home key |
| {INS} |
Insert key |
| {LEFT} |
Left arrow key |
| {NUMLOCK} |
Num lock key |
| {PGDN} |
Page down key |
| {PGUP} |
Page up key |
| {PRTSC} |
Print screen key |
| {RIGHT} |
Right arrow key |
| {SCROLLLOCK} |
Scroll lock key |
| {TAB} |
Tab key |
| {UP} |
Up arrow key |
Examples:
The following formatting will press the tab key, enter the serial data
that was received, and finally press the enter key:
{TAB}#{ENTER}
Contents
Running Serial Link
After Serial Link has been configured, you may start running by selecting
the Run | Start menu option. This will cause Serial Link to begin listening
for data and
sending it to the output options that you selected.
You can also set Serial Link to start running automatically as soon
is it is launched. To do this go to the Serial Link Setup window by selecting
the Setup |
Options menu item and check the “Start in Run Mode” option. Then save
the configuration. The next time you start Serial Link it will start up
in run mode.
To stop Serial Link from monitoring serial inpout select the Run | Stop
menu option.
Contents
Debugging In Test Mode
Serial Link may be run in one of four test modes by selecting the Run |
Test Run menu. When test mode is entered size of the Serial Link window
will be increased to show debugging information which includes the serial
input that is received as well as all of the outputs. The four test modes
are described below.
Fake Input
This mode will not accept serial input but will instead allow you to
key in the serial data. The keyed in data will then be processed and sent
to whatever outputs have been configured. This is useful for debugging
the output configurations.
Fake Output
This mode will receive serial data but will not send outputs applications,
databases or log files. The input and outputs will be shown on the debug
window. This mode is useful for debugging serial communications.
Fake Both
This mode will neither receive serial input nor send outputs. It will
allow you to key in test input and will process and show the outputs without
actually sending them. This is intended for debugging formatted output.
Fake Neither
In this mode, Serial Link will behave the same way that does when running
except that it will show both inputs and outputs in the debug window.
Contents
Trouble Shooting
Input Problems
If an input is not showing up on the debug window then serial input
is not being received by Serial Link. This could be caused by one of the
following:
-
Serial Link has not been configured for the right serial parameters. Recheck
the port number, baud rate, parity, data bits, stop bits and hand shaking.
-
The serial port is not functioning properly. Check that the serial port
has been properly configured in Windows. See if you can use it for some
other purpose like dialing a modem or using a serial mouse.
-
Serial input is not being received by the serial device, see if you can
verify it with another means.
Wedge Output Problems
The following steps can be used to debug problems with the keyboard
wedge output:
-
If wedge output is not visible on the debug window then check to see that
the wedge output option is enabled on the General Options window.
-
If the contents or format of the wedge output is not correct on the debug
window, check the output format field on the Keyboard Wedge Configuration
window.
-
If the information on the debug window is correct but keystrokes are not
being passed to the application first check to see that the application
is running. If it is not then start it. If you want the application to
be started automatically be sure that option is checked on the Keyboard
Wedge Configuration window. If the application does not start up check
the path of the program to be started.
-
If starting the application does not cause keystrokes to be sent to the
application check the following:
-
If you are sending keystrokes to whatever window is active then be sure
that the active window is one that will display keystrokes such as notepad
and not a dialog with just a menu or buttons.
-
If you are attempting to send keystrokes to a specific window or application
be sure that the window title given on the Keyboard Wedge Configuration
window is correct.
Database Output Problems
The following steps can be used to debug problems with database output:
-
If an SQL statement output is not visible on the debug window then check
to see that the database output option is enabled on the General Options
window.
-
If the contents or format of the SQL statement is not correct on the debug
window, check the SQL statement or the database fields on the Database
Configuration window.
-
If the SQL statement on the debug window is correct but data is not being
passed to the database then check the following to debug your database
connection:
-
Check the syntax of the SQL statement and make sure that the operator has
rights to execute the statement. If your database has a SQL processor you
might try typing the SQL statement shown on the debug window into it and
see if it executes properly using the same user login.
-
Check to see that your ODBC connection name has been keyed in correctly
on the Database Configuration window.
-
Check to see that your ODBC database connection is properly configured.
Try to use another application that uses ODBC to attach to the database.
Logfile Output Problems
The following steps can be used to debug problems with the logfile
output:
-
If an log statement is not visible on the debug window then check to see
that the logfile output option is enabled on the General Options window.
-
If a log statement is shown on the debug window but a logfile is not being
written then check the following:
-
The file name and path are valid.
-
You have rights to create or append the file.
Contents