You are on page 1of 17

About DataWatch

Pgina 1 de 17

About DataWatch
This is a GOLD edition feature.
DataWatch allows you to monitor a database that is linked to a particular label. Whenever DataWatch
detects new records added in the database, it prints the records automatically.
Note: If you have two databases of two different types (e.g., one dBase and the other OLE DB) attached
to your label, DataWatch monitors the first one; that is, the first database field that you added to the
label. If you have two databases of the same type attached to your label, DataWatch will not run and will
display "Cannot run DataWatch..." errors.

Using DataWatch to Print Records


Automatically
This is a GOLD edition feature.
DataWatch allows you to monitor a database that is linked to a particular label. Whenever DataWatch
detects new records added in the database, it prints the records automatically.

To set up DataWatch and start monitoring a database


1. On the Options menu, click Configuration, and then click the DataWatch tab.
2. Set the properties on the DataWatch tab as appropriate for your label printing application.
3. When you have finished setting the DataWatch options, click OK.
4. Open a label that contains a database field.
5. On the Server menu, click DataWatch Server.
6. A dialog box appears asking if you want to print the records that are currently in the database. If
desired, click Yes to print the records. Otherwise, click No.
The DataWatch monitor appears. DataWatch monitors the database and prints new records as they
appear.
Note: If you have two databases of two different types (e.g., one dBase and the other OLE DB) attached
to your label, DataWatch monitors the first one; that is, the first database field that you added to the
label. If you have two databases of the same type attached to your label, DataWatch will not run and will
display "Cannot run DataWatch..." errors.

file:///C:/Users/SOPORTE-1/AppData/Local/Temp/~hh37A8.htm

27/06/2015

About DataWatch

Pgina 2 de 17

About Command Files


This is a GOLD edition feature.
A command file is a simple instruction file or database that can be used to print labels automatically. It
contains commands that identify the name of the label, the printer to use, and the label quantity. Variable
data can be provided in the command file, or it may be provided in a separate data file.
Command files can be used to pass information generated by other systems and possibly other
computers, including mainframes or mini-computers. For example, an invoicing program could pass
information into a command file, which would in turn print a label.

Types of Command Files


A command file is an ASCII text file that can be created with any text editor. There are four types of
command files that can be used to execute command file processing. This table shows the file extension
to use with each type.
Command File
Type
Multiple Raw
Data
Multiple and
Single ASCII
Files
DBF File

Command File
Extension
.def

Definition file

.cmd

Command files

.dbf

Database file

File Type

Multiple Raw Data: Uses a definition file as the command file and separate text files that contain
the data. The system reads the command file once, and then monitors the data file directory for
changes. When a new data file appears in the directory, the system prints the labels according to
the command file instructions.

You specify the name of the directory to be monitored. All data files are deleted after printing.

Multiple ASCII File: Uses multiple ASCII files that can contain both the commands and the data.
The system monitors the entire directory of command files for changes to any of them. When
changes appear, the system executes the command files and prints the labels.

You specify the name of the directory to be monitored. All command files executed in the monitored
directory are deleted after printing.

Single ASCII File: Uses a single ASCII file that can contain both the commands and the data. The
system monitors this one file for changes. When changes appear, the system executes the
command file and prints the labels.

file:///C:/Users/SOPORTE-1/AppData/Local/Temp/~hh37A8.htm

27/06/2015

About DataWatch

Pgina 3 de 17

You can select whether or not the single file is deleted after printing.

DBF File: Uses a database (.dbf) file that contains the commands and the data. The system
monitors the database for changes. When changes appear, the system executes the command file
and prints the labels.

The .dbf file is not deleted after printing.

Command Files that Use a Definition File


This is a GOLD edition feature.
A command file is a simple instruction file or database that can be used to print labels automatically.
The Multiple Raw Data command file type allows you to store variable data for command files outside
the command file itself, instead of internally. To do this, you create a definition file that contains only
the commands, and then set up separate text data files to contain the variable data. The benefit of using
this configuration is that only the data files are monitored for changes, processed, and deleted. The host
or third-party system only updates the data files. The command file remains intact until you replace it
with another command file.
All the text data files are stored in one folder; this is the folder that is monitored by the label design
software. Once these data files are processed, they are deleted. For this reason, you should store the
definition file in a separate folder.

To set up a command file that uses a definition file


1. On the Options menu, click Configuration, and then click the Command File tab.
2. Select Multiple Raw Data as the command file type.
3. In the Definition File box, enter the path of the command (definition) file.
4. Specify the extension (e.g., TXT) of the data files.
5. In the Directory to Monitor box, enter the path of the folder that contains the text data files.
The definition file should have the .def file extension. For the sample below, the path in the Definition
File box would look like this:
C:\Users\Public\Public Documents\TKI\InstallationFolderName\Labels\sample.def

A sample definition file might look like this:

file:///C:/Users/SOPORTE-1/AppData/Local/Temp/~hh37A8.htm

27/06/2015

About DataWatch

Pgina 4 de 17

LABELNAME=C:\Users\Public\Public
Documents\TKI\InstallationFolderName\Labels\LabelName.LBL

DATATYPE = DELIMITED
DELIMITER= ,
FIELD=PART
FIELD=QTY
FIELD=SUPPLIER
FIELD=SERIAL

For this sample, the path in the Directory to Monitor would look like this:
C:\Users\Public\Public Documents\TKI\InstallationFolderName\Command Files\Monitor
A sample text data file would look like this:
1001, 2222, 3333, 4444
1002, 2222, 2222, 4444

Command File Formatting


This is a GOLD edition feature.
A command file is a simple instruction file or database that can be used to print labels automatically.

Command File Formatting


There are many commands that can be issued in command files. Follow these guidelines when writing
the command file:

Be careful to include the spaces.

file:///C:/Users/SOPORTE-1/AppData/Local/Temp/~hh37A8.htm

27/06/2015

About DataWatch

Pgina 5 de 17

Using quotation marks (" ") around field names is optional, unless you are adding spaces in the
fields.

A semicolon ( ; ) indicates remarks or comment statements; characters that appear on a line after a
semi-colon will be ignored.

Command files are NOT case sensitive.

Sequence of Commands
In a command file, each batch normally begins with the LABELNAME command and finishes with
LABELQUANTITY. All other commands for that label should be between these two commands.
After the LABELQUANTITY command, you may add the LABELNAME command for the next label
to be printed.

Command File Commands


This is a GOLD edition feature.
A command file is a simple instruction file or database that can be used to print labels automatically.

Command File Commands


LABELNAME
The LABELNAME command identifies the name of the label to print, and must be the first line in any
command file. It can, however, appear multiple times in a command file specifying different labels to
print each time.
If the same label is being printed more than once in the same command file, it is not necessary to repeat
this command. The program will reprint the last label with the new data and quantity. It is good practice
to include the full path to the file; for example:
LABELNAME=C:\Users\Public\Public
Documents\TKI\InstallationFolderName\Labels\LabelName.LBL

DATATYPE
The DATATYPE command identifies the type of data file that this system can access:

DELIMITED: Each field in the command file is separated from the next field by a delimiting
character. When writing the command file, you must first give the DATATYPE command,
followed by the DELIMITER command that specifies the delimiting character. For example:

file:///C:/Users/SOPORTE-1/AppData/Local/Temp/~hh37A8.htm

27/06/2015

About DataWatch

Pgina 6 de 17

DATATYPE=DELIMITED
DELIMITER=,

FIXED: Each field occupies a specific number of spaces in the data file. Every record must be set
up the same for this to work. Fields that are shorter than the specified length must fill up the rest
of the space with blanks. The size of each field must be specified in the FIELD command.

ASSIGNED: The size of each field is defined in the command file structure. Each named field
from the label that requires data is assigned a value using the FIELD_NAME format. Only one
piece of data appears per line.

FIELD
The FIELD command is used for each data field on the label. The form depends on the data type being
used:

DELIMITED: Since delimited data is already separated by definition, there is no need to include
the starting and stopping position within the data file. Only the field name needs to be included.
For example:

FIELD=PART
FIELD=QTY
FIELD=SUPPLIER

FIXED: For fixed data, the start and stop positions must be specified. The field name should be
followed by the start and stop position of the data within the data file. For example:

FIELD=Company@110

ASSIGNED: For assigned data, the FIELD command is not used; instead, the FIELD_NAME
format is used to specify the data for the variable field.

FIELD_NAME
For each variable data field (When Printed or database) on the label; there should be a statement in the
command file that assigns it a value. The value for FIELD_NAME in the command file must match
exactly the name of the field in the label; the variable data should appear after the equal sign within
quotation marks.
For database key data fields, the name of the key data field on the label should be the same as its name
in the database. If more than one label is being processed in the same command file, leaving a field
name blank results in the last assigned value for that name being reused. To leave a field blank, insert a
null character (two quotes with nothing in between, "" ) into the string. For example:

file:///C:/Users/SOPORTE-1/AppData/Local/Temp/~hh37A8.htm

27/06/2015

About DataWatch

Pgina 7 de 17

PART_NUM = "836773"
COMPANY=""

LABELDATA
The LABELDATA command identifies the location and name of the file that contains the data to be
used. If the data is in the same command file, set LABELDATA=THISFILE.
IMPORTANT: When creating command files with multiple raw data that use .def files, you must
create folders for each .def file and its associated .txt file. If the .txt file and its associated .def file are
not isolated in separate folders, all .txt files within the same folder as the .def file will be executed when
the command file is run.

PRINTER
The PRINTER command is an optional command that identifies which printer to use. If omitted, then
the currently selected printer is used.
The printer name must be typed exactly as it appears on the Select Printer dialog box, including upperand lower-case letters, and must be contained within quotation marks in order to be recognized.
For example:
PRINTER="Datamax DMX 430-(V) on COM2:"

You can also use this command to send the output of the command file to a picture file:
PRINTER = "PICTURE:name,dpi,color"

Where:
name = Name of the file. The extension you choose determines the format of the graphic (e.g., .bmp,
.pcx). Include the full path to the file (e.g., c:\labels\pic.bmp).
dpi = The resolution of the image in dots per inch. The default is 300.
color = 0 (zero) is for black and white; 1 is for color images.

PRINTERTASK

file:///C:/Users/SOPORTE-1/AppData/Local/Temp/~hh37A8.htm

27/06/2015

About DataWatch

Pgina 8 de 17

The PRINTERTASK command can be used if you have enabled Run Separators. Using
PRINTERTASK, you can specify the order of printing using the standard printer tasks available. Include
the appropriate letters in the sequence you want them to occur. For example, PHP would print your print
batch twice with the Run Separator between them. For example:
PRINTERTASK=PHP

Note: The PRINTERTASK command must appear before the LABELQUANTITY command.

LABELQUANTITY
The LABELQUANTITY command specifies the number of labels to print, and should be the last line
for each label to be printed from the command file, since it is the active command. The label prints when
this command is encountered. If omitted, then only one label will print (default is
LABELQUANTITY=1).
If desired, you can vary the label quantity for specific labels by adding the LABELQUANTITY
command on its own line anywhere after the LABELDATA command. This will specify the label
quantity to print for any labels following the LABELQUANTITY command.
For example:
The LABELQUANTITY defaults to 1. If you want only one label of a group to print with a quantity of
2, you must change the quantity to 2 on the line before that labels data, and change it back to 1 on the
line following that labels data.
LABELDATA=THISFILE
Label #1, Field 1-2, Field 1-3,
Label #2, Field 2-2, Field 2-3,
LABELQUANTITY=2
Label #3, Field 3-2, Field 3-3, (**This label prints with a quantity of 2**)
LABELQUANTITY=1
Label #4, Field 4-2, Field 4-3,

Note: Do not include the LABELQUANTITY command if you are using data files; one label or group
of labels will be printed for each line of data.

file:///C:/Users/SOPORTE-1/AppData/Local/Temp/~hh37A8.htm

27/06/2015

About DataWatch

Pgina 9 de 17

QUITAPP
The QUITAPP command terminates the execution of the command file immediately, and so should be
the very last command in the file. The program will remain open after running a command file unless
this line is included.
QUITAPP should not be used in definition files; if included in a definition file, the program ignores it.

Setting Up the DBF File Command File Type


This is a GOLD edition feature.
The DBF command file type uses a dBase-compatible database file. The file is not deleted after labels
are printed.

To set up the DBF file mode


1. On the Options menu, click Configuration, and then click on the Command File tab.
2. Select the DBF File option.
3. Set the following options as appropriate for your labeling application:

Monitor only new records: Prints only the records that are added to the database. Otherwise, all
records are printed when new records appear.

Timed Interval (in seconds): How often the directory is monitored for changes.

4. Click OK to return to the design window.


5. If data is available, execute the command file.

Setting Up the Single ASCII Command File


Type
This is a GOLD edition feature.
The single ASCII command file type uses one ASCII file. You can select whether or not the file is
deleted after labels are printed.

file:///C:/Users/SOPORTE-1/AppData/Local/Temp/~hh37A8.htm

27/06/2015

About DataWatch

Pgina 10 de 17

To set up the single ASCII file mode


1. Select Configuration from the Options menu, and then click the Command File tab.
2. Select the Single ASCII File option.
Note: The location of the single ASCII file is specified during the process of executing the command
file.
3. Set the following options as appropriate for your labeling application:

Process File Based on: Determines the order in which files are processed.

Date Time: Processing is based on the when the file was created (oldest first).

File Name: Files are processed in alphabetical order.

Minimize Main Window: The design window is minimized during command file processing.

Create Backup before deleting (BAK): Saves a backup copy of each command file after printing
takes place.

Delete Command File after executing: Deletes the command file after executing it. Otherwise, the
file is not deleted.

Log Errors to File: Logs any errors encountered during the execution of the command file. The
file (named CMDFILE.ERR) can be found in the same directory as the command file.

Stop Processing On Error: If an error occurs while printing any label it will stop the print job, and
prevent printing the remaining labels in the file. For example, a misspelled field name will end the
print job.

Timed Interval (in seconds): How often the directory is monitored for changes.

4. Click OK to return to the design window.


5. If data is available, execute the command file.

Setting Up the Multiple ASCII Command File


Type
This is a GOLD edition feature.
The multiple ASCII command file type uses multiple ASCII files located in a folder that is monitored

file:///C:/Users/SOPORTE-1/AppData/Local/Temp/~hh37A8.htm

27/06/2015

About DataWatch

Pgina 11 de 17

for changes. After labels are printed, the command files are deleted. You may, however, select the
option to save a backup of each command file (.bak extension).

To set up the multiple ASCII file mode


1. Select Configuration from the Options menu, and then click the Command File tab.
2. Select the Multiple ASCII File option.
3. In the Directory to Monitor box, select the path to the folder that contains the command files.
4. Set the following options as appropriate for your labeling application:

Process File Based on: Determines the order in which files are processed.

Date Time: Processing is based on when the file was created (oldest first).

File Name: Files are processed in alphabetical order.

Minimize Main Window: The design window is minimized during command file processing.

Create Backup before deleting (BAK): Saves a backup copy of each command file after printing
takes place.

Log Errors to File: Logs any errors encountered during the execution of the command file. The
file (named CMDFILE.ERR) can be found in the same directory as the command file.

Stop Processing On Error: If an error occurs while printing any label it will stop the print job, and
prevent printing the remaining labels in the file. For example, a misspelled field name will end the
print job.

Timed Interval (in seconds): How often the directory is monitored for changes.

5. Click OK to return to the design window.


6. If data is available, execute the command file.

Setting Up the Multiple Raw Data Command


File Type
This is a GOLD edition feature.
With the multiple raw data command file type, the system executes the command file once, and then
monitors the data files. This allows for faster processing, since the system is not executing the command

file:///C:/Users/SOPORTE-1/AppData/Local/Temp/~hh37A8.htm

27/06/2015

About DataWatch

Pgina 12 de 17

file over and over again each time the data files change.
When you do change the command file, you can move the old command file to the monitored folder
where it will be executed and deleted, so that the rest of the data files will be executed according to the
new command file.

Definition File
The commands for a multiple raw data file type are stored in a definition file that uses the .def file
extension. This is a sample of what a definition file may contain:
LABELNAME=C:\Program Files\LV8\Command Files\AIAG.lbl
DATATYPE=DELIMITED
DELIMITER=,
FIELD=PART
FIELD=QTY
FIELD=SUPPLIER
FIELD=SERIAL
IMPORTANT: When creating command files with multiple raw data that use .def files, you must
create folders for each .def file and its associated .txt file. If the .txt file and its associated .def file are
not isolated in separate folders, all .txt files within the same folder as the .def file will be executed when
the command file is run.

Data Files
The data file contains the data that populates the fields in the label. This is a sample of what a data file
may contain:
20700,10,ABC Company,123456
20701,20,ABC Company,654321
Data files may be generated by an outside system (e.g., inventory or accounting system) or computer,
and are sent to the directory that is monitored for changes. When changes appear in the directory, the
labels are printed and the data files are deleted.

To set up the multiple raw data mode


1. Select Configuration from the Options menu, and then click the Command File tab.

file:///C:/Users/SOPORTE-1/AppData/Local/Temp/~hh37A8.htm

27/06/2015

About DataWatch

Pgina 13 de 17

2. Select the Multiple Raw Data option.


3. In the Definition File box, select the definition file that you want to use.
4. In the Data Extension box, select the file extension for the data files that you are using.
5. In the Directory to Monitor box, select the path to the folder that will contain the data files.
6. Set the following options as appropriate for your labeling application:
Process File Based on: Determines the order in which files are processed.

Date Time: Processing is based on the when the file was created (oldest first).

File Name: Files are processed in alphabetical order.

Minimize Main Window: The design window is minimized during command file processing.
Create Backup before deleting (BAK): If your definition file is in the same directory as your data files,
saves a backup copy of each definition file after printing takes place.
Log Errors to File: Logs any errors encountered during the execution of the command file. The file
(named CMDFILE.ERR) can be found in the same directory as the command file.
Stop Processing On Error: If an error occurs while printing any label it will stop the print job, and
prevent printing the remaining labels in the file. For example, a misspelled field name will end the print
job.
Timed Interval (in seconds): How often the directory is monitored for changes.
7. Click OK to return to the design window.
8. If data is available, execute the command file.

Setting Up a Command File Database


This is a GOLD edition feature.
A command file is a simple instruction file or database that can be used to print labels automatically.
IMPORTANT: The command file database (DBF file) you create must be stored in the label design
software's Data folder. The default location is C:\Users\Public\Public Documents\TKI\Common\Data.
A command file database requires these three fields:

file:///C:/Users/SOPORTE-1/AppData/Local/Temp/~hh37A8.htm

27/06/2015

About DataWatch

Pgina 14 de 17

LBLNAME: A character field specifying the full name and path of the label.

LBLPRINTER: This field contains the printer and port on which the label will be printed. The
syntax must be exactly the same as it appears on the Select Printer dialog box, including
capitalization.
For example: ZEBRA Z4000 - (V) on LPT1:

LBLQTY: Set the number of labels to print.

There can be other fields in the database. If there are any variable fields on your label (fields that would
normally be When Printed or Database), these fields should also be included in the command file
database.
Since multiple labels can be printed from one command file database, the variable fields for all of the
labels that are to be used should be in the database.
Set up the label as you normally would. Any database fields should call the command file database. Not
all of the fields in the command file database must be used, but any fields used must be in the command
file database.

Executing Command Files


This is a GOLD edition feature.
Command files (including definition files) can be executed from the label design software or from
Windows. When typing a command, be sure to use the required command file formatting and sequence.

To run a command file from the label design software

On the Server menu, click Command File.

To run a command file from Windows


1. On the Start menu, click Run, and browse to select the path to the label design program's main
executable file (.exe extension).
For example, C:\Program Files\InstallationFolderName\lv.exe.
2. Type /CMD to signify that you are running a command file.
3. Enter the path and file name of the command or definition file.
So, for example, your completed command line might look something like this:
C:\Program Files\InstallationFolderName\lv.exe /CMD C:\Users\Public\Public
Documents\TKI\InstallationFolderName\Labels\sample.def

file:///C:/Users/SOPORTE-1/AppData/Local/Temp/~hh37A8.htm

27/06/2015

About DataWatch

Pgina 15 de 17

4. Click OK to execute the command file.

Results of Command File Execution


Results of running a command file (or definition file) depend on which command file type you are
using:

Multiple Raw Data: The label design software executes the definition file first, monitors the data
directory for changes and, when changes appear, prints the labels.

Multiple ASCII Files: All of the command files in the selected directory are executed in order.

Single ASCII File: A prompt appears asking you to enter the name of the file to run, and whether
or not you want the file monitored for changes that will then be printed.

Database File: A prompt appears asking for the name of the file to use, and if you want the
database records currently in the file to be printed. The database file is monitored for any changes
and, when changes appear, labels are printed.

Command File Monitor


After you execute a command file that requires monitoring, the Command File Sentinel appears
displaying a log of the processed command files.
Note: For Multiple Raw Data command file types, the processed files are text data files.
Information in the monitor includes:

Definition file name (if using Multiple Raw Data)

Command file name (or text data file name)

Current printer name

Log of each file, including time of processing, file name, and status (processed, waiting, etc.)

About Label Select


This is a GOLD edition feature.
Label Select automates the process of printing a variety of label formats, each to their assigned printer
and port, based on key field data entered by an operator.
To do this, Label Select uses a database that supplies the label and printer information, as well as any
variable (e.g., When Printed and database) data associated with individual labels.

file:///C:/Users/SOPORTE-1/AppData/Local/Temp/~hh37A8.htm

27/06/2015

About DataWatch

Pgina 16 de 17

For example, a database can be set up so that the operator is prompted for a part number. The part
number is the key field value that looks up a record containing the label format, printer, port, and any
variable data associated with the label. Label Select uses the record information to print the selected
label to the correct printer and port, and includes any variable data without requiring additional user
input.

Configuring Label Select


This is a GOLD edition feature.
Label Select automates the process of printing a variety of label formats, each to their assigned printer
and port, based on key field data entered by an operator. Once you have set up the Label Select database,
you must configure Label Select to use the database.

To configure Label Select


1. On the Options menu, click Configuration, and then click the Label Select tab.
2. Complete the settings on the Label Select tab as appropriate for your label printing application.
3. Click OK to save the configuration and return to the design window.

Setting Up a Database for Label Select


This is a GOLD edition feature.
Label Select automates the process of printing a variety of label formats, each to their assigned printer
and port, based on key field data entered by an operator.
Before Label Select can be used, you must create a database that contains the required information for
each label. The Label Select database must have these fields:

Key field: Contains the key field valuessuch as part numbers, last names, or other valuesthat
can be used to retrieve (look up) specific records in the database. This field must be set up as a
character data type.

Label name field: Contains the name of the label file, including the full path to each label. This
field must be set up as a character data type.

Printer name field: Contains the name of the printer and port for each label. The printer name and
port must match exactly what appears in the Printer box (in the Select Printer dialog box)
including upper- and lower-case characters, and all punctuation. This field must be set up as a
character data type.

file:///C:/Users/SOPORTE-1/AppData/Local/Temp/~hh37A8.htm

27/06/2015

About DataWatch

Pgina 17 de 17

Variable data fields: Contain the variable data values, if any, that you want to print for each label.
The name of the variable data field in the Label Select database must match the name of the field
in the label. If there is a match, then the label field will be populated with the value from the Label
Select database. If there is no match, then no variable data will be printed. For example, if the
Label Select database has a field called DEPT, and there is a variable field on the label also named
DEPT, then the DEPT field on the label will be populated with the value from the Label Select
database for that label.

Tip: A sample Label Select database, called l_select.dbf, is located in the program's Data folder
(C:\Users\Public\Public Documents\TKI\Common\Data) to demonstrate how the Label Select feature
works. You can use the program's Database Editor to display the contents of the database.

Printing Labels Using Label Select


This is a GOLD edition feature.
Label Select automates the process of printing a variety of label formats, each to their assigned printer
and port, based on key field data entered by an operator. Once you have completed configuring Label
Select, you can launch Label Select to start printing labels.
Note: The label design software attempts to print labels to their designated printer and port. If the printer
is not installed on the expected port, a message is displayed and the label is not printed.

To launch printing using Label Select


1. In the label design software, select Label Select from the Server menu. Alternatively, you can
launch Label Select from the program Start menu.
The Label Select dialog box appears displaying the prompt for the key field data.
2. Click Browse.
The Label Select database appears displaying the key field data from which you can select.
3. Click on the appropriate data (e.g., the record associated with a printer that you have installed) and
click OK.
The label design software attempts to print the label to its designated printer and port. If the printer is not
installed on the expected port, a message appears and the label is not printed.
4. Click Close to return to the design window.
The label for the data you selected appears.

file:///C:/Users/SOPORTE-1/AppData/Local/Temp/~hh37A8.htm

27/06/2015

You might also like