Topic: DMD0406

Help File Version: 2.10.0.636

TDOPLS - Load Programmable Limit Switch Table for Table Driven Output


A Load Programmable Limit Switch Table for Table Driven Output (TDOPLS) contains a table with a series of start and stop positions similar to the cams on a shaft. These cam positions are compared to the current count value of the specified Master Register. When the count value falls between any of the positions in the table the discrete output is turned ON or OFF relative to the specified Default Output State. Each table can have up to 64 cam positions; these positions can be entered as constant values directly in the instruction, or as variable values read from PLC memory locations when the instruction is first enabled.

 

Each PLS table compares the count value of one High-Speed I/O input and will control one High-Speed I/O discrete output. This instruction loads a table of values for a Table Driven Output and enables the process that runs the table. The specified High-Speed I/O discrete output will remain under control of that table of values until a Deconfigure Table Driven Output (TDODECFG) instruction is executed for the Table Driven Output.

 

Each Table Driven Output has an associated structure which contains an EnableOutput field. If this Bit is ON the current ON / OFF state of the PLS Table will be written to the Table Driven Output. This Bit is automatically set ON when the PLS Table is first loaded, and automatically turned OFF when the Table Driven Output is deconfigured. The ladder logic program can manually turn this Bit OFF to stop the table from writing it's state data to the Table Driven Output without having to use a TDODECFG - Deconfigure Table Driven Output to do so.

 

A graph of the current PLS Table configuration is displayed at the bottom of the editor which shows each of the entries. Clicking on the graph will place the cursor on the table entry that contains that location.

 

 

Table Driven Output Device selects which Table Driven Output this instruction will use. A Table Driven Output can only be selected for use by one Preset Table or Programmable Limit Switch at a time.

Table Driven Output Structure is the structure that is associated with this device. This structure is automatically created when the Table Driven Output itself is created.

 

Click the Configure Table Driven Outputs ... button to open the BRX Table Driven Outputs dialog in the System Configuration where the Table Driven Outputs are created and their High-Speed Outputs are selected.


Master Register selects the BRX High-Speed I/O channel that will provide the source count value. This can be from the on-board High-Speed I/O or from a BRX HSIO module (BX-HSIO1, BX-HSIO2, or BX-HSIO4).

High speed Ctr / Tmr 1 Accumulator selects the current count value for Counter / Timer Function 1.

High speed Ctr / Tmr 2 Accumulator selects the current count value for Counter / Timer Function 2.

High speed Ctr / Tmr 3 Accumulator selects the current count value for Counter / Timer Function 3.

 

Pulse Output 1 Position selects the current position value for Pulse Output 1.

Pulse Output 2 Position selects the current position value for Pulse Output 2.

Pulse Output 3 Position selects the current position value for Pulse Output 3.

 

Click the Configure Master Register Device ... button to open the Axis / Pulse Output Configuration dialog in the System Configuration where the High-Speed Output that contains the Master Register is configured.

Initialize .InputValOffset will initialize this field in the PLS Table's associated structure to the value specified when the instruction is first enabled. This value can be changed while the PLS Table is executing. See the full discussion of this value in the section below.

Note: if this option is disabled, make sure the value in this field of the PLS Table's associated structure is being initialized by some other means (ladder logic, HMI, etc.).


Use Source Register Scaling specifies whether the table entries are raw count values or values that have been scaled the same as the Master Register.

 

  • select the Raw Pulse Counts (No Scaling) option to enter the Preset Count values in the Table as raw count values.

  • select Use Source Register Scaling if the Master Register has been configured to scale the current count value you can use the scaled values in the table by selecting this option and entering Preset Count values that are scaled the same as the Master Register.

 


This instruction can source the values for the PLS table by one of two methods: entering the table's values as Signed DWord constants directly in the instruction, or load the table's values from PLC memory when the instruction is first enabled.

 

Load Raw PLS Data from Data Block: enable this option to have the instruction load the contents of the PLS Table from consecutive locations in a block of Signed DWord memory locations in the PLC: this will disable the ability to enter the values as Signed DWord constants directly in the instruction.

Table Start Address is the beginning address in PLC memory where the PLS table data is stored. This can be any Signed DWord location from a data block.

 

Number of PLS Entries is the number of entries in the PLS table that are stored in PLC memory. This can be any numeric location.

 

Table Data Block Range: using the two values above, this shows the range of PLC memory that will be used as the PLS Table. When selecting this option the Data values in the specified memory locations must be formatted properly. Improperly formatted data will generate a runtime warning message.



Each PLS table entry consists of 2 signed DWord locations.

 

Each DWord location can contain any value between -2,147,483,648 and 2,147,483,647.

All of the values in the PLS table must be in ascending order.

 

Click the PLC TDO PLS Table Editor... button to open the PLS Table Editor which allows you to edit the data values in the specified Data Block (only available when online with the PLC). The data configuration options on this dialog are the same as the main dialog.

 

Initial values for Default Output State, PLS Table Start Address, and Number of PLS Entriescome from the main instruction editor. If these values are changed while editing the table data with this dialog those values will be updated on the main instruction editor when this dialog is closed.

 

If the Number of PLS Entries is a variable the value in that location is read and that many of rows of data are read from the PLC to prefill the table. The Also Write Table Length to PLC selection will also be enabled and that variable location will be prefilled here so that when the table data is written back to the PLC this location will be updated as well.

 

A graph of the current PLS Table configuration is displayed at the bottom of the editor which shows each of the entries. Clicking on the graph will place the cursor on the table entry that contains that location.


Default Output State specifies the state of the first entry in the table.

 

  • OFF (default) means the first entry in the table will be a point which the output turns ON and subsequent entries will flip between OFF / ON / OFF / etc.

  • ON means the first entry in the table will be a point which the output turns OFF and subsequent entries will flip between ON / OFF / ON / etc.

 


This section is enabled if the PLS table's values will be entered as Signed DWord constants directly in this instruction.

 

(Raw / Scaled) PLS Count Entries: Output (ON / OFF) When - contains a list of cam positions. Any time the Master Register's current count value falls within any of the cam positions the Table Driven Output will be set ON, if the current count value falls outside of all of the cam positions the Table Driven Output will be set OFF.

Entries must be unique within the Table, the lower and upper positions of one position cannot overlap other cam positions.

 

Note: Use the F9 key or click the 'three dot box' at the right edge of the parameter field to open the Default Element Selection Tool (the Element Picker or the Element Browser) or use the Down-Arrow key (Auto-Complete) on any parameter field to see a complete list of the memory locations that are valid for that parameter of the instruction.

 

Output (ON / OFF) when Greater Than or Equal To is the value that represents the lower edge of the cam position. This can be any value between -2,147,483,648 and 2,147,483,647, or any numeric memory location.

 

And Less Than is the value that represents the upper edge of the cam position. This can be any value between -2,147,483,648 and 2,147,483,647, or any numeric memory location.

 

Note: if the count values are numeric memory locations - instead of constants - the values in those locations are read when the instruction is enabled, meaning that changes to the values in those registers while the instruction is enabled will have no effect.

 


Insert Row will add an empty Step above the currently highlighted Step in the Table.

 

Append Row will add an empty Step at the end of the Table.

 

Delete Row will remove the currently highlighted Step from the Table.

 

Clear Table will remove all of the entries in the Table.

 

Import is used to import the contents of the PLS Table from a CSV file. The format of the import file is two numbers per line, separated by a comma or whitespace, all numbers must be in ascending order, and a maximum of 64 lines. In the example below the "//" indicates a comment, anything on that row after the "//", or anything after the "//" in a cell is ignored :

Read from PLC will overwrite the contents of the table with values from PLC memory location specified in the Load Raw PLS Table from Data Block section.

 

Write to PLC will overwrite the contents of PLC memory at the location specified in the Load Raw PLS Table from Data Block section with the current contents of the table.


The On Success and On Error parameters specify what action to perform when this instruction completes. You do not have to use the same type of selection for both On Success and On Error.

 

If the Set Bit selection is used for either On Success or On Error, the specified BIT location will be SET OFF when the instruction is first enabled and will remain OFF until the instruction completes. Once complete, the appropriate Success or Error bit location ON. The specified Bit location is enabled with a SET (Latch) operation meaning that it will remain ON even if the input logic for the instruction goes OFF.

 

If the JMP to Stage selection is used for either On Success or On Error the target Stage must be in the same Program code-block as this instruction, you cannot specify a target Stage that exists in a different Program code-block. When the operation finishes, the target Stage will be enabled the same way as a standalone Jump to Stage (JMP) instruction would do it. The JMP to Stage option will only be available if this instruction is placed in a Program code-block.

 

On Success selects which of the following actions to perform if the operation is successful:

  • Enable SET Bit then specify any writable bit location.
  • Enable JMP to Stage then specify any Stage number from S0 to S127 in the current Program code-block.

 

On Error selects which of the following actions to perform if the operation is unsuccessful:
 

  • Enable SET Bit then specify writable bit location.
  • Enable JMP to Stage then specify any Stage number from S0 to S127 in the current Program code-block.

 

If either the On Success or On Error selections are set to JMP to Stage, Automatically create the SG box for any NEW stage number will be enabled which will automatically create any target stage that does not already exist.

  • Below this rung will create the new target stage on a new rung following this instruction.
  • At end of code-block will create the new target stage as the last rung of this Program.

 


Table Driven Output Structure:

 

Each time a Table Driven Output is created there is an associated structure automatically created by the same name - with a prepended $. This structure will contain member fields that can be used in the Program to interact with the Table Driven Output. Each of these structures contain the following fields:

 

.EnableOutput: if this Bit is ON the current ON / OFF state of the PLS Table will be written to the Table Driven Output. This Bit is automatically set ON when the PLS Table is first loaded, and automatically turned OFF when the Table Driven Output is deconfigured. The ladder logic program can manually turn this Bit OFF to stop the table from writing it's state data to the Table Driven Output without having to use a TDODECFG - Deconfigure Table Driven Output to do so.

 

.ResetLevel: not used by PLS Table.

 

.ResetEdge: not used by PLS Table.

 

.OutputState (read only) is the ON / OFF state of the Output that will be written to the Table Driven Output if EnableOutput is ON.

 

.StepNumber (read only) is the step number from the table that is currently active. A step number of -1 indicates the PLS Table is between ON positions or is unconfigured.

 

.InputValOffset is used to adjust the current count value from the Master Register by a user determined amount before the comparison in the Step is performed. The following are a few examples where this is used:

A table that needs to start processing the Steps in the table at a particular count value, for example, a repeating pattern that needs to be started at variable distances between the pattern repetitions. In this case, InputValOffset would be set before each pass through the table.

 

If a table is being processed that does not expect deviations in the position value but a deviation is detected while the table is running, the difference between the expected value and the detected value (delta) can be written through this value so the table can behave as though there is no deviation seen. In this case, InputValOffset would be set any time a deviation is detected.

 

A table that uses fixed values to account for equipment changes, for example, encoders that have a different number of pulses per revolution. In this case, InputValOffset would be set before the first pass through the table.

Note: if the Master Register Device is configured to operate in Rotary mode, it is the user's responsibility to make sure the sum of the current Master Register value + InputValOffset stays within the device's configured Rotary Range. The TDO will not be fired if the calculated sum is outside the device's configured Rotary Range.

 

Note: if the Master Register is an Axis' position, and the application is using either a servo controller or stepper controller with micro-stepping or smoothing, be aware that both of these controller types have a conversion time that will introduce some delay between the Axis' output position and the actual shaft position of the motor. The InputValOffset can be used to compensate for the conversion time by adding the number of pulses that would occur during the conversion time to the current count of the Master Register. Multiplying the servo or stepper controller's conversion time by the current velocity will yield the number of pulses that would occur during that amount of time. Using this pulse count value in the InputValOffset field will delay the comparison in the Steps by the same amount as the conversion time of the motor controller. Doing this will more closely sync the Table Driven Output's state to the actual shaft position of the motor.

.Done (read only): not used by PLS Table.

 

.Event1 - .Event6 - (Read-only): not used by PLS Table.

 


Status Display:

 

The red triangle in the upper left corner of the status display indicates this is a Fully Asynchronous instruction.

 

The gray triangle at the right end of the input leg indicates the input is edge-triggered, meaning this instruction will execute each time the input logic transitions from OFF to ON.

 

OutputState / EnableOutput - the current values of these numeric fields from Table Driven Output's associated structure.

 


See Also:

BRX Table Driven Outputs

 

TDODECFG - Deconfigure Table Driven Output

 

TDOPLS - Load Programmable Limit Switch Table for Table Driven Output

 

TDOPreset - Load Preset Table for Table Driven Output

 


Related Topics:

BRX High Speed I/O

 

BRX Input Filters

 

BRX Interrupt Triggers

 

BRX Timer / Counter Functions

 

BRX Analog

 

BRX Axis / Pulse Outputs

 

BRX Pulse Width Modulated Outputs

 


Example: