Topic: DMD0405 TDOPreset - Load Preset Table for Table Driven Output |
|
A Load Preset Table for Table Driven Output (TDOPRESET) instruction will assume control of the specified Table Driven Output and load a table of actions that are to be performed on that output at specified count values. Once a Preset Table has been loaded for a Table Driven Output, it will retain exclusive control of that output until a Deconfigure Table Driven Output (TDODECFG) instruction is executed which will unload the table and relinquish control of that Table Driven Output.
A Preset Table contains a series of steps that are processed in the order they appear in the table. These steps compare the current count value of the specified Master Register to the Preset Count in the current Step. When the count values match the step's action is performed on the Table Driven Output and the instruction begins looking for the next Preset Count value. The math operation being used is "equal to", meaning the count values must match exactly for the step to be performed.
Each Preset Table can have up to 64 steps; these step 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 Table Driven Output has an associated structure which contains an EnableOutput field. If this Bit is ON the current ON / OFF state of the Preset Table will be written to the Table Driven Output. This Bit is automatically set ON when the Preset 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.
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.
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).
The instruction's table will reset to Step 0 any time the source of the master register's count is reset, for example, if the source is a High Speed Counter, when that counter is reset the instruction's table will also be reset to Step 0. If the Master Register source is configured for rotary mode the instruction's table will reset to Step 0 if the source value wraps from the maximum rotary range value back to 0. It DOES NOT reset if the rotary source value wraps in reverse, that is it wraps from 0 to maximum rotary range value.
Initialize .InputValOffset will initialize this field in the Preset Table's associated structure to the value specified when the instruction is first enabled. This value can be changed while the Preset 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 Preset 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.
This instruction can source the values for the Preset table by one of two methods: load the table's values from PLC memory when the instruction is first enabled, or entering the table's values as Signed DWord constants directly in the instruction.
Enable Load Raw Preset Data from Data Block to have the instruction load the contents of the Preset 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.
This section is enabled if the Preset table's values will be entered as Signed DWord constants directly in this instruction.
Checking the Enable ISR Preset Function will allow the TDOPRESET instruction to trigger the execution of an ISR (Interrupt Service Routine) when a Preset Count is reached. Once enabled, use the drop-down selection to pick an existing ISR to run, or click the Create ISR button to create a new ISR to run. Note: this option is only available from within the TDOPRESET instruction; you cannot import the data for this function type from a numeric data block or from a CSV file.
Use OUTI / SETI / RSTI in the ISR to control other high-speed Y's, even on other BX-HSIO modules is referring to using the OUTI - Output Immediate Coil, SETI - Set Immediate Bit, and RSTI - Reset Immediate Bit instructions within the selected ISR to control additional high-speed outputs. This allows the ability to use a single PRESET value to control multiple high-speed outputs.
Preset Table contains a list of the steps in the Preset 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:
On Error selects which of
the following actions to perform if the operation is unsuccessful:
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.
|
|
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 Preset Table will be written to the Table Driven Output. This Bit is automatically set ON when the Preset 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: turn this Bit ON to reset the Preset Table to Step 0. Leaving the Bit ON will hold the Table in Reset until this Bit is turned OFF.
.ResetEdge: turn this Bit ON to reset the Preset Table to Step 0. This instruction will turn the Bit OFF to indicate that the table has been reset.
.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 Preset Table is either in Level Reset or is unconfigured.
.InputValOffset is used to adjust the current count value from the Master Register by a fixed amount before the comparison in the Step is performed.
.Done (read only) is ON after the last step in the TDOPRESET table has been executed, will be OFF when table is executing any of the steps.
.Event1 - .Event6 - (Read-only) are Bit locations that are set ON by the Trigger ISR Function. The .Event# fields are read-only; each time a Trigger ISR function is executed, all of the .Event# fields will be set OFF and only the .Event# field specified in the step will be set back ON.
|
|
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 / Done are the current values of these numeric fields from Table Driven Output's associated structure.
|
|
See Also:
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 Pulse Width Modulated Outputs
|
|
Example:
|
|