Property File Reader device

A Property File Reader device is a logical device with no corresponding physical device. The Property File Reader device type includes the features to:

  • Define variable names and values in a text file
  • Access the device variables as read only, they can not be written.

The file associated with a Property File Reader device must be available from the Staging Browser.

The first step in defining a property File Reader device is to create the property file.

Creating the property file

The property file used by a Property File Reader device defines variable names, called keys, and values.
Each line in the property file must have this format:

key=value

Where the items are:

Item Description
key Is the unique name of the variable within the Property File Reader device. A key name can be 1 to 64 characters in length and can include letters, numbers, and all characters except ^ / \ ~ ".
A period ( . ) will be converted to an underscore ( _ ) character.
A key name can contain spaces.
For example: Item serial number=1001
= A space before or after the = will be ignored.
For example: key = value is the same as key=value
value Is the string value of the variable. The maximum length is 79 characters.

The following lists other considerations for the property file:

  • The key=value can be placed anywhere in the file.
  • When the variables are displayed on the Variables tab, the variable names are listed in alphabetic order.
  • A line without a key= is ignored.
  • A line without a value is ignored.
  • Starting in the 13.2.0 release, a line without a value will be supported with the value being a null string.
  • Quotation marks around a string will appear as part of the string.
  • Key names and values with upper and lower-case letters will be recognized, they are case-sensitive.
  • The property file name can be any name you choose.
  • The property file can have any extension you choose, or it can have no extension.

Example property file

The following shows the contents of an example property file.

Example property file
WIP.Schedule=Monday_AM
WIP.Claim_Status=On
WIP.Setting=x
WIP.ID=3400
WIP.Entry=FrontLever
WIP.Squence=Line1_Line10
WIP.Vehicle_number=123456

Storing the property file in the Staging Browser

The property file that you have created must be stored in the Staging Browser.
You can use the Workbench -> Administration -> Staging Browser tab Put function to transfer the file from the external location to a folder in the Staging Browser.

Follow these steps:

  1. From the left pane, expand the node whose Staging Browser you want to store the file.
  2. Select the Administration icon.
    The Administration window appears.
  3. Select the Staging Browser tab.
  4. From the Staging Browser tab, right-click the folder that you want to put the file into to display its pop-up menu, and then select Put.
    You also can select the folder and then select the Put button at the bottom of the panel.

    The Select Files window appears.
  5. Change to the location where the file resides, and then select the file.
    The name of the file is added to the File Name box.
  6. Click Select.
    A message will ask you if you want to upload the selected file. Select Yes.

    Another message will tell you that the file was uploaded to the target folder. Select OK.
    The file appears in the directory structure.

Now that the property file is in the Staging Browser, a Property File reader device can be defined that references the property file.

Defining a Property File Reader device

To define a property File Reader, follow these steps:

  1. From the Workbench left pane, expand the node where you want to define the Property File Reader device.
  2. Select the Devices icon to display the Devices panel, right-click the Devices icon to display its pop-up menu, and then select New.
    You also can select the New button at the bottom of the Devices panel.
  3. Name the device. The device name can be up to 64 characters and include letters, numbers, and the underscore character. Spaces are allowed.
  4. Use the Type down-arrow, locate the System category, and then select Property File Reader.

    The Device window changes to accommodate a Property File Reader device.

    The following parameters are available under the Configuration section:

    Parameter Description
    Property File Use the Browse button to locate the file in the Staging Browser.

    Select the file, and then click Select.
    Per Variable Security Select False to disable the allocation of additional memory to track User to Variable access for all Variables in this Device. Select True to enable this feature if required. For more information, see Setting up Read Write per device variable.
  5. Select Save to save the device definition. The device will appear in the Devices window list of devices.
  6. You can now control the device (Start, Stop), access the device's variables by using the Variables window, and build solutions that use the device's resources.

What's Inside