Navigation: Filtering & Collection > Event Subscription > Scripts >

Reader Control Language (RCL)

Still need help? Create a Support Ticket with Stratum Support

Send comments on this topic.

← Previous Next →

 

Reader Control Language (RCL)

 

Overview

Reader Control Language Script (RCL) is TagNet’s universal scripting language for readers and their associated GPIO devices. RCL allows the user to define how the readers, sensors, signal lights and other GPIO devices will react to tag events during a schedule. RCL breaks up the way a reader behaves during its schedule into (3) logical events:

Pre-Processor – these commands set up the initial state of the devices controlled by TagNet. This may include sending configuration overrides and turning on status lights on the light stack indicating a schedule is running. It also controls when to trigger a read cycle based upon what input sensor (if any) and what light condition should be initiated to indicate that the read event has begun.

Post-Processor – These command sub-types define how the reader GPIO will behave based on read event statuses returned from bindings. This can be more than that just a signal light; a PLC can receive a signal and divert a tagged case on conveyer. Each command sub-type can execute primary commands as in the Pre-processor. The four primary statuses are:

MATCH – this condition is sent back from the binding function indicating that the tag(s) all meet a ‘matching’ condition. What exactly is a matching condition is determined by the business logic in the binding function. This could be as simple as ‘all the tags map to a specific object ID’, or as complex as comparing cases read against a bill of lading to ensure all were placed on a trailer or pallet. The permutations are limitless.

NOMATCH – this condition is sent back from the binding function indicating that some or all of the tag(s) did not meet the business logic criteria in the binding function.

NOTAG – this condition is sent back from the binding function indicating that there were no tag(s) read during the read event cycle.

ERROR – this condition is sent back from the binding function indicating that an error occurred when attempting to connect to an external system API or database (ex. MSSQL, Oracle via JDBC, RPC, etc.). This must be in script to trap errors as above.

 

Some processes require more than the basic four statuses. With that in mind TagNet also includes auxiliary statuses

AUX1–3 - there are 3 Auxiliary statuses that are based on pre-defined logic which is controlled by the binding function. These are defined as AUX1, AUX2 and AUX3 and their definition is use-case specific. Contact Stratum Global tech support for more information on Auxiliary statuses

 

End-Schedule – These commands define any shutdown routines after a schedule has ended.  A basic script will turn off all the signal lights to clearly indicate schedule has completed.

 

Command syntax

There are (6) very basic commands each having a number of defined keyword/value parameters (collectively known as directives) as described below:

CONNECT – Directives used here are for establishing or maintaining an open connection to a reader, GPIO controllers or PEV client. This command is used during the Pre-Processor event.

CONFIGURE – These directives set the physical properties for the reader. This command is used during the Pre-Processor event.

WRITEGPIO – These directives are used to control output devices. This command can be used in any of the 3 events

READ – These directives define how a read event cycle is triggered.  This command is used during the Pre-Processor event.

CLOSE – These directives are used to cleanly close the connection between TagNet and the reader/GPIO controls. This command is for use in the End of Schedule event.

IGNORE – This command is used exclusively during the Post-Processor ERROR sub-type function. It has no optional directives.

To help explain these commands, their definitions have been broken into their command categories. There are directives that can be used under multiple commands and to avoid repetitiveness; those directives are defined under the first command that can use them:

 

CONNECT          establishes a connection to a Physical Reader or PEV client that is associated with the schedule. This command can be invoked without any directives however it must always be specified for any RCL script.

 

Keyword -          SETGPIO(value)

Values -          *NEW (to be used with the CONNECT command)

*CURRENT (Not to be used within the CONNECT command, see                                                      WRITEGPIO command)

Definition -          The SETGPIO parameter opens a socket to the GPIO controller that is associated to the Physical Reader.

          The *NEW property establishes a new GPIO connection

          The *CURRENT property maintains the GPIO connection that is currently active for the GPIO device.

 

Keyword -          SETVIEWER(value)

Values -          *NEW (to be used with the CONNECT command)

Definition -          The SETVIEWER keyword opens a socket to the PEV client that is associated to the Logical Reader. .

The *NEW value establishes a new PEV connection

 

CONFIGURE           specifies that the following directives are for setting the physical properties of the reader. Since not all readers support all directives, reader specific directives will be noted.

 

Keyword -          SETHANDLER(value)

Value -                    *CURRENT

Definition -          The SETHANDLER parameter maintains the current instance of the Java Handler which was established during the CONNECT command.

This parameter should always be specified for all commands.

 

Keyword -          SETPARMS(value)

Value -                    *CURRENT

Definition -          The SETPARMS parameter maintains the current properties that are established during the initial CONNECT statement.

This parameter should always be specified for all commands.

 

Keyword -          FEATURES(value)           [Currently Symbol Readers Only]

Value -                    SETPARAMETERS

Definition -          The FEATURES parameter overrides the reader’s properties with properties that have been established within TagNet. Properties such as number of usable antennas and power settings

 

Keyword -          USEANTENNAx(value)           [Currently Symbol Readers Only]

Value -                    *YES – Activate this antenna

                    *NO – Deactivate this antenna

Definition -          The USEANTENNAx parameter allows individual antennas on a reader to be turned on or off. The x is the antenna number to apply this command to.

 

Keyword -          TAGTYPE(value)

Value -                    *EPC-CLASS-0

                    *EPC-CLASS-1

                    *EPC-GEN-2

                    *ISO

Definition -          The TAGTYPE parameter specifies which class of tag the reader will be interrogating. Readers that allow activation of individual antennas can have the individual antennas each read different tag types (See example)

 

 

WRITEGPIO           used to control the signal going to a GPIO device parameter maintains the current properties that are established during the initial CONNECT statement.

 

Keyword -          GPIOCODEx(OUTPUT-n-v)

Value -                    x = The instance of the parameter within the WRITEGPO command

                    Options = 1-4

                    n = The output device to affect

                    Options = 1-4

                    v = How the output should behave

                    Options = ON, OFF, FLASH

Definition -          The GPIOCODEx parameter is used to output a signal to an external GPIO device. While it’s most common usage is modifying the state of stack lights, the signal can also be sent to any standard PLC device which accepts up to 12VDC signals.

          This parameter can also be used under CLOSE command

 

READ           is used to define the read cycle’s event triggers and subsequent GPIO reactions.

 

Keyword -          TRIGGERON(INPUT-n-v)

Value -                    n = The input device to listen for to start the read cycle

                    Options = 1-4

                    v = Which signal on the input device to listen for.

                    Options = ON, OFF

Definition -          The TRIGGERON parameter is used to allow an external event to trigger a read cycle to begin.

 

Keyword -          TRIGGEROFF(INPUT-n-v)

Value -                    n = The input device to listen for to end a read cycle

                    Options = 1-4

                    v = Which signal on the input device to listen for

                    Options = ON, OFF

Definition -          The TRIGGEROFF parameter is used to allow an external event to trigger a read cycle to end.

 

Keyword -          DWELL(v)

Value -                    v = time in milliseconds

                    example = 10000 = 10,000 milliseconds or 10 seconds even

Definition -          The DWELL parameter is used to control how often the read event should occur on a continuing basis. Example, if the Read event cycle is 2 seconds (physical reader property) and the Dwell is 10 seconds, then any tags will be attempted to be read for those two seconds, then schedule will sit idle for 10 seconds before continuing the read cycle again.

 

Keyword -          SIGNALON(OUTPUT-n-v)

Value -                    n = The output device to affect

                    Options = 1-4

                    v = How the output should behave

                    Options = ON, OFF, FLASH

Definition -          The SIGNALON parameter is used to output a signal to an external GPIO device during a read cycle. While it’s most common usage is modifying the state of stack lights, the signal can also be sent to any standard PLC device which accepts up to 12VDC signals.

 

CLOSE           is used to cleanly end a schedule and turn off all external GPIO devices.

 

IGNORE           is used to bypass GPIO error notification.

 

It is also important to note that there should be no spacing between keyword(value) as shown in example below however there must be at least one space and no Tabs between each block of Keyword(value) statements:

WRITEGPIO  SETHANDLER(*CURRENT)  SETPARMS(*CURRENT) SETGPIO(*CURRENT)  GPIOCODE(OUTPUT-3-ON)  GPIOCODE2(OUTPUT-3-OFF) GPIODELAY2(2000)

 


Copyright © 2024 Stratum Global, Inc.