Using the Micro SD Log and Autorun Files

15th August 2014

 

Overview

Technology Solutions UHF RFID readers have the provision for a micro SD card to be installed. The card provides two functions:

  1. A log file is created and appended (when enabled) that contains all the output sent from the reader.
  2. An autorun file can be created that changes the reader’s configuration from its default as it powers on from sleep.

This article assumes knowledge of the TSL ASCII Protocol that is used to communicate with Technology Solutions UHF readers. A document describing the most recent version of the TSL ASCII Protocol can be downloaded here


Reader Parameters Recap

Each command that can be sent to the reader has a list of optional parameters. The parameters for each command and the defaults are detailed in the TSL ASCII Protocol document. Where the same parameter is provided for multiple commands the parameter uses a separate value for each command (i.e. the inventory output power is independent of the read transponder output power). Each time the reader powers on from sleep all the command parameters revert to their default values. When a command is sent to a reader with one or more parameters specified the reader will use those parameter values for every subsequent execution of that command until the parameter is resent or the reader is reset. In this way a command can be setup by sending it with all the appropriate parameters and then repeated by simply sending only the command identifier.

.iv -o23 -n Set the output power for inventory to 23 dBm without performing an inventory
.iv

 Perform an inventory (output power is 23 dBm)

There are three special case parameters for commands that have an action:

  1. The read parameters parameter ‘-p’ is used to get the reader to include a “PR:” header in the response. This header outputs all the parameters of the command and their current values.
  2. The reset parameters parameter ‘-x’ is used to get the reader to reset the command parameters to their defaults before processing the new parameters specified in the current command.
  3. The take no action parameter ‘-n’ is used to get the reader to update the commands parameters only and not perform the command. For example when take no action is specified the read transponder command parameters would be updated without actually performing a read of transponders.

Read the Inventory Parameters Without Performing an Inventory

Read the parameters for the inventory command without performing an inventory. The PR: line shows the values of all the parameters for the inventory command

Command:

.iv -p -n

Response:

CS: .iv -p –n
PR: -al on -c off -dt off -e off -fi off -io on -ix off -n -o 29 -p -qa dyn -ql all -qs s1 -qt a -qv 6 -r off -sa 0 -sb epc -sd -sl 00 -so 0000 -st s1 -tf off –x
OK:


Update the Inventory Output Power Without Performing an Inventory

Set the output power for inventory to 20 dBm without performing an inventory

Command:

.iv -n -o20

Response:

CS: .iv -n -o20
OK:


Confirm the Change to the Output Power Without Performing an Inventory

Read the parameters for the inventory command without performing an inventory.

Command:

.iv -p -n

Response:

CS: .iv -p -n

PR: -al on -c off -dt off -e off -fi off -io on -ix off -n -o 20 -p -qa dyn -ql all -qs s1 -qt a -qv 6 -r off -sa 0 -sb epc -sd -sl 00 -so 0000 -st s1 -tf off –x

OK:


ASCII Protocol Explorer

The examples in this article show the TSL ASCII Protocol commands and responses as they are sent and received ‘over the wire’ to a Technology Solutions UHF reader. The ‘TSL ASCII Protocol’ document can be downloaded from the Technology Solutions website via the relevant product’s ‘Downloads’ page. Also available from the website is an application called ASCII Protocol Explorer. This desktop application can be used to send and receive commands to a Technology Solutions UHF reader. It also has a parse function that accepts an ‘over the wire’ command and decodes it into the command and associated parameters.

Using ASCII Protocol Explorer the examples in this article can be executed with a real reader. Pasting a command from this article into the command text box and clicking parse will select the appropriate command and display the applied properties for the command. The send button will then send the command to the reader and display the response.

Free, one time, registration is required to download the TSL ASCII Protocol and ASCII Protocol Explorer.


Log file “LOG.TXT”

Without a card fitted no logging is performed. Refer to the user guide for the reader for details on how to source and install a suitable card for the reader. By default logging is enabled.

When enabled and a card is installed the reader creates, if required, and appends to a file in the root of the card called “LOG.TXT”. All responses to commands are recorded to the log with or without a host connected. Trigger presses simply execute commands so this action is recorded to the log file in the same way as commands sent from a connected host.

The reader also writes events to the card. Events are a single line with the “EV:” prefix followed by a message defining the event. Events are preceded with a timestamp “DT:” line. An example of an event would be as the reader connection state changes i.e. the host connects or disconnects the reader.

The read log command is used to manipulate the log actions. It can be used to enable or disable logging, to read the log over the serial connection or to delete the log. It should be noted that it can take a long time to read a long log file from the card using the read log command. The log file can be kept short by periodically issuing the read log file command to first download and then delete the log at regular intervals. Alternatively the card can be removed from the reader and the log copied or moved from the card.


Delete the Log File from the Reader

Command:

.rl -dyes

Response:

CS: .rl -dyes

LB: **** Beginning of Log ****

DT: 2000-03-28T00:39:43

EV: Log File created

LE: **** End of Log ****

OK:


Enable Logging

Command:

.rl –con:

Response:

CS: .rl –con

LB: **** Beginning of Log ****

DT: 2000-03-28T00:39:43

EV: Log File created

LE: **** End of Log ****

OK:


Disable Logging

Command:

.rl –coff

Response:

CS: .rl –coff

LB: **** Beginning of Log ****

DT: 2000-03-28T00:39:43

EV: Log File created

LE: **** End of Log ****

OK:


Sample Log File

The log file below shows various events as the USB and Bluetooth connects and disconnects and also as the unit sleeps and wakes. Note that this reader has a single line AUTO.TXT to set the read transponder output power to 20dBm. This command can be seen being executed after each wake up event.

DT: 2000-03-25T05:36:46
EV: Log File created
DT: 2000-03-25T05:38:28
EV: Disconnected
DT: 2000-03-25T05:38:44
EV: Connected BT
CS: .vr LCMD 000000
MF: TSL UK Ltd.
US: 1128-EU-001013
PV: 2.2.0
UF: 3.6.0
UB: 1.4.0
RS: 1116-ET-012532
RF: 2.6.0
RB: 1.2.0
AS: 1128-S1-EU-000404
BA: 00:07:80:62:0b:1b
OK:

CS: .iv
EP: 000000000000000000002034
EP: 3039ECBC033EE6C12A05F739
EP: 00000000000000000000203B
OK:

CS: .iv
EP: 0000000000000000000020A9
EP: 000000000000000000002033
EP: 300833B2DDD906C000000000
OK:
CS: .iv
ME: No Transponder found
ER:005

CS: .bc
BC:12345678
OK:

DT: 2000-03-25T05:39:31
EV: Disconnected
DT: 2000-03-25T05:40:31
EV: Sleep
DT: 2000-03-25T05:45:02
EV: Wake up
CS: .rd -n -o20
OK:

CS: .iv -n –aloff
OK:

DT: 2000-03-25T05:46:03
EV: Sleep
DT: 2000-03-25T05:55:22
EV: Wake up
CS: .rd -n -o20
OK:

CS: .iv -n –aloff
OK:

DT: 2000-03-25T05:55:23
EV: Connected USB
CS: .bc
BC:12345678
OK:

CS: .bc
BC:12345678
OK:


Autorun File “AUTO.TXT”

An autorun file on an installed micro SD card provides the ability to change the reader configuration from its defaults. The autorun file is a file on the root of the card called “AUTO.TXT”.

This section assumes you are familiar with TSL ASCII Protocol commands and parameters – there is a recap in an earlier section as a reminder and more information can be found in the TSL ASCII Protocol overview application note.

The autorun file contains a list of ASCII Protocol commands, one command per line, that, when the file is present, are executed sequentially immediately after the reader powers on or in response to the execute autorun command (.ea). It is recommended that the ‘take no action’ parameter is used where appropriate in the autorun file so that the action of a command is not performed but the parameters updated from their defaults only.


Delete an Existing Autorun File

Command:

.ra -dyes

Response:

CS: .ra –dyes

OK:


Read the Contents of the Autorun File

Command:

.ra

Response:

CS: .ra

AB: **** Beginning of Autorun file ****

AE: **** End of Autorun file ****

OK:


Write New Commands to the Autorun File

This example write two commands to the autorun file both set the take no action parameter so that the commands are not actually performed but the parameters are configured. The first command sets the output power of the read transponder command to 20dBm and the second disables the alert of the inventory command.

Command:

.wa .rd -n -o20

Response:

CS: .wa .rd -n -o20

OK:

Command:

.wa .iv -n -aloff

Response:

CS: .wa .iv -n –aloff

OK:


Read the new Autorun File with the Commands Added

Command:

.ra

Response:

CS: .ra

AB: **** Beginning of Autorun file ****

.rd -n -o20

.iv -n –aloff

AE: **** End of Autorun file ****

OK:


Execute the Autorun to Configure the Reader Based on the Autorun File

The autorun file is performed automatically at power on but this command executes the file immediately for testing or to restore the reader back to the autorun configuration

Command:

.ea

Response:

CS: .ea

OK:

CS: .rd -n -o20

OK:

CS: .iv -n –aloff

OK: