PSO Window Functions
The PSO Window module lets you configure a range of position values called a window. Each window includes a counter and two comparison values: a lower bound and an upper bound. The window counter tracks one feedback source and changes in real time to respond to the tracked feedback source. In most cases, the output of the PSO Window module is active when the window counter value is greater than or equal to the lower bound and also less than or equal to the upper bound. You can use the output of the PSO Window module to mask events from other modules.
The PSO Window module lets you configure and use two windows at the same time. If you want only one window, use Window 0. If you want two windows, use Window 0 and Window 1. With two windows, the output of each window is combined into one PSO Window module output. This means that the PSO Window module output is active when each window output is active (both window counters are within their respective window bounds).
Optional Purchase Necessary: PSO Window 1 is available only on drives that support two and three dimensional PSO distance tracking, which is a paid option on some drives. Review your ordering information to see the number of dimensions that your drive supports.
The PSO Window module also lets you use the drive array to specify a sequence of window ranges (array mode). The module has many advanced features, such as letting you generate events when entering or exiting a window range.
Configuring the Window Inputs
HARDWARE: When you specify the input to PSO as primary or auxiliary feedback, the drive that you use with PSO will only support encoders that give you incremental feedback. This condition applies to the PsoDistanceConfigureInputs()
, PsoTransformationConfigure()
, and PsoWindowConfigureInput()
functions.
Table: Supported Feedback Types
Input (Enum Values) | Feedback Type | Encoder Multiplier Options |
---|---|---|
IncrementalEncoderSquareWave | Primary | Encoder multiplier options do not apply. |
Auxiliary | Encoder multiplier options do not apply. | |
IncrementalEncoderSineWave | Primary | -MX2, -MX3, and -MX4 (for XR3 drives only) |
Auxiliary | -MX4 (for XR3 drives only) | |
AbsoluteEncoderEnDatwithSineWaveIncremental | Primary | -MX2, -MX3, and -MX4 (for XR3 drives only) |
AbsoluteEncoderBiSSwithSineWaveIncremental | Primary | -MX2, -MX3, and -MX4 (for XR3 drives only) |
Use the PsoWindowConfigureInput() function to specify the source of the position feedback signals you want the PSO window counter to track. If you want the window counter to count in the opposite direction of the selected position feedback signals, you can use the $reverseDirection argument. Once you specify a valid input for the window counter, it immediately starts to track the feedback signals. The PSO Window module can track input speeds up to 100 MHz (100,000,000 counts/second).
function PsoWindowConfigureInput($axis as axis, $windowNumber as integer, $input as PsoWindowInput, $reverseDirection as integer)
Selects the source of the specified window counter.
Arguments
$axis The axis on which to select the window counter input source.
$windowNumber The window number for which to select the counter input source.
$input The window counter input source.
$reverseDirection Configures the window counter to count in the opposite direction of its input source.
Use the PsoWindowInput enumeration to select the PSO window tracking input for your drive.
enum PsoWindowInput
GL4PrimaryFeedbackAxis1Encoder0 = 100 GL4PrimaryFeedbackAxis2Encoder0 = 101 GL4IfovFeedbackAxis1 = 102 GL4IfovFeedbackAxis2 = 103 GL4AuxiliaryFeedbackAxis1 = 104 GL4AuxiliaryFeedbackAxis2 = 105 GL4SyncPortA = 106 GL4SyncPortB = 107 GL4DrivePulseStreamAxis1 = 108 GL4DrivePulseStreamAxis2 = 109 XL4sPrimaryFeedback = 110 XL4sAuxiliaryFeedback = 111 XL4sSyncPortA = 112 XL4sSyncPortB = 113 XL4sDrivePulseStream = 114 XR3PrimaryFeedbackAxis1 = 115 XR3PrimaryFeedbackAxis2 = 116 XR3PrimaryFeedbackAxis3 = 117 XR3PrimaryFeedbackAxis4 = 118 XR3PrimaryFeedbackAxis5 = 119 XR3PrimaryFeedbackAxis6 = 120 XR3AuxiliaryFeedbackAxis1 = 121 XR3AuxiliaryFeedbackAxis2 = 122 XR3AuxiliaryFeedbackAxis3 = 123 XR3AuxiliaryFeedbackAxis4 = 124 XR3AuxiliaryFeedbackAxis5 = 125 XR3AuxiliaryFeedbackAxis6 = 126 XR3SyncPortA = 127 XR3SyncPortB = 128 XR3DrivePulseStream = 129 XC4PrimaryFeedback = 130 XC4AuxiliaryFeedback = 131 XC4SyncPortA = 132 XC4SyncPortB = 133 XC4DrivePulseStream = 134 XC4ePrimaryFeedback = 135 XC4eAuxiliaryFeedback = 136 XC4eSyncPortA = 137 XC4eSyncPortB = 138 XC4eDrivePulseStream = 139 XC6ePrimaryFeedback = 140 XC6eAuxiliaryFeedback = 141 XC6eSyncPortA = 142 XC6eSyncPortB = 143 XC6eDrivePulseStream = 144 XL5ePrimaryFeedback = 145 XL5eAuxiliaryFeedback = 146 XL5eSyncPortA = 147 XL5eSyncPortB = 148 XL5eDrivePulseStream = 149 XC2PrimaryFeedback = 150 XC2AuxiliaryFeedback = 151 XC2DrivePulseStream = 152 XC2ePrimaryFeedback = 153 XC2eAuxiliaryFeedback = 154 XC2eDrivePulseStream = 155 XL2ePrimaryFeedback = 156 XL2eAuxiliaryFeedback = 157 XL2eSyncPortA = 158 XL2eSyncPortB = 159 XL2eDrivePulseStream = 160 XI4PrimaryFeedbackAxis1 = 161 XI4PrimaryFeedbackAxis2 = 162 XI4PrimaryFeedbackAxis3 = 163 XI4PrimaryFeedbackAxis4 = 164 XI4AuxiliaryFeedbackAxis1 = 165 XI4AuxiliaryFeedbackAxis2 = 166 XI4AuxiliaryFeedbackAxis3 = 167 XI4AuxiliaryFeedbackAxis4 = 168 XI4SyncPortA = 169 XI4SyncPortB = 170 XI4DrivePulseStreamAxis1 = 171 XI4DrivePulseStreamAxis2 = 172 XI4DrivePulseStreamAxis3 = 173 XI4DrivePulseStreamAxis4 = 174 iXC4PrimaryFeedback = 175 iXC4AuxiliaryFeedback = 176 iXC4SyncPortA = 177 iXC4SyncPortB = 178 iXC4DrivePulseStream = 179 iXC4ePrimaryFeedback = 180 iXC4eAuxiliaryFeedback = 181 iXC4eSyncPortA = 182 iXC4eSyncPortB = 183 iXC4eDrivePulseStream = 184 iXC6ePrimaryFeedback = 185 iXC6eAuxiliaryFeedback = 186 iXC6eSyncPortA = 187 iXC6eSyncPortB = 188 iXC6eDrivePulseStream = 189 iXL5ePrimaryFeedback = 190 iXL5eAuxiliaryFeedback = 191 iXL5eSyncPortA = 192 iXL5eSyncPortB = 193 iXL5eDrivePulseStream = 194 iXR3PrimaryFeedbackAxis1 = 195 iXR3PrimaryFeedbackAxis2 = 196 iXR3PrimaryFeedbackAxis3 = 197 iXR3PrimaryFeedbackAxis4 = 198 iXR3PrimaryFeedbackAxis5 = 199 iXR3PrimaryFeedbackAxis6 = 200 iXR3AuxiliaryFeedbackAxis1 = 201 iXR3AuxiliaryFeedbackAxis2 = 202 iXR3AuxiliaryFeedbackAxis3 = 203 iXR3AuxiliaryFeedbackAxis4 = 204 iXR3AuxiliaryFeedbackAxis5 = 205 iXR3AuxiliaryFeedbackAxis6 = 206 iXR3SyncPortA = 207 iXR3SyncPortB = 208 iXR3DrivePulseStream = 209 GI4DrivePulseStreamAxis1 = 210 GI4DrivePulseStreamAxis2 = 211 GI4DrivePulseStreamAxis3 = 212 iXC2PrimaryFeedback = 213 iXC2AuxiliaryFeedback = 214 iXC2DrivePulseStream = 215 iXC2ePrimaryFeedback = 216 iXC2eAuxiliaryFeedback = 217 iXC2eDrivePulseStream = 218 iXL2ePrimaryFeedback = 219 iXL2eAuxiliaryFeedback = 220 iXL2eSyncPortA = 221 iXL2eSyncPortB = 222 iXL2eDrivePulseStream = 223 iXI4PrimaryFeedbackAxis1 = 224 iXI4PrimaryFeedbackAxis2 = 225 iXI4PrimaryFeedbackAxis3 = 226 iXI4PrimaryFeedbackAxis4 = 227 iXI4AuxiliaryFeedbackAxis1 = 228 iXI4AuxiliaryFeedbackAxis2 = 229 iXI4AuxiliaryFeedbackAxis3 = 230 iXI4AuxiliaryFeedbackAxis4 = 231 iXI4SyncPortA = 232 iXI4SyncPortB = 233 iXI4DrivePulseStreamAxis1 = 234 iXI4DrivePulseStreamAxis2 = 235 iXI4DrivePulseStreamAxis3 = 236 iXI4DrivePulseStreamAxis4 = 237 FLEXPrimaryFeedbackAxis1 = 238 FLEXPrimaryFeedbackAxis2 = 239 FLEXPrimaryFeedbackAxis3 = 240 FLEXPrimaryFeedbackAxis4 = 241 FLEXAuxiliaryFeedbackAxis1 = 242 FLEXAuxiliaryFeedbackAxis2 = 243 FLEXAuxiliaryFeedbackAxis3 = 244 FLEXAuxiliaryFeedbackAxis4 = 245 FLEXSyncPortA = 246 FLEXSyncPortB = 247 FLEXDrivePulseStreamAxis1 = 248 FLEXDrivePulseStreamAxis2 = 249 FLEXDrivePulseStreamAxis3 = 250 FLEXDrivePulseStreamAxis4 = 251 iFLEXPrimaryFeedbackAxis1 = 252 iFLEXPrimaryFeedbackAxis2 = 253 iFLEXPrimaryFeedbackAxis3 = 254 iFLEXPrimaryFeedbackAxis4 = 255 iFLEXAuxiliaryFeedbackAxis1 = 256 iFLEXAuxiliaryFeedbackAxis2 = 257 iFLEXAuxiliaryFeedbackAxis3 = 258 iFLEXAuxiliaryFeedbackAxis4 = 259 iFLEXSyncPortA = 260 iFLEXSyncPortB = 261 iFLEXDrivePulseStreamAxis1 = 262 iFLEXDrivePulseStreamAxis2 = 263 iFLEXDrivePulseStreamAxis3 = 264 iFLEXDrivePulseStreamAxis4 = 265 XA4PrimaryFeedbackAxis1 = 266 XA4PrimaryFeedbackAxis2 = 267 XA4DrivePulseStreamAxis1 = 268 XA4DrivePulseStreamAxis2 = 269 iXA4PrimaryFeedbackAxis1 = 270 iXA4PrimaryFeedbackAxis2 = 271 iXA4DrivePulseStreamAxis1 = 272 iXA4DrivePulseStreamAxis2 = 273 XA4PrimaryFeedbackAxis3 = 274 XA4PrimaryFeedbackAxis4 = 275 XA4DrivePulseStreamAxis3 = 276 XA4DrivePulseStreamAxis4 = 277 iXA4PrimaryFeedbackAxis3 = 278 iXA4PrimaryFeedbackAxis4 = 279 iXA4DrivePulseStreamAxis3 = 280 iXA4DrivePulseStreamAxis4 = 281 XA4SyncPortA = 282 XA4SyncPortB = 283 iXA4SyncPortA = 284 iXA4SyncPortB = 285 XA4AuxiliaryFeedback = 286 iXA4AuxiliaryFeedback = 287 PsoTransformationChannel0Output = 288 PsoTransformationChannel1Output = 289 PsoTransformationChannel2Output = 290 PsoTransformationChannel3Output = 291 GL4PrimaryFeedbackAxis1Encoder1 = 292 GL4PrimaryFeedbackAxis2Encoder1 = 293 end |
Configuring the Window Ranges
Each PSO window operates by comparing the window counter against a lower bound value and an upper bound value, together known as a range. The PSO Window module activates the output of each window when the corresponding counter is greater than or equal to the lower bound and also less than or equal to the upper bound. You can configure the module to use a single, fixed pair of range values, or an array of window range values from the drive array. To specify a fixed window range, use the PsoWindowConfigureFixedRange() function. The PSO Window module uses the values that you specify in the $lowerBound and $upperBound arguments as the lower and upper bounds of the window range, respectively. The specified window bounds must each be an integer number of counts. If you try to specify a non-integer number of counts, Automation1 Studio reports an error. You can use the Trunc() function to make sure that you specify valid integer window bounds, but this can change your expected window range by very small values.
function PsoWindowConfigureFixedRange($axis as axis, $windowNumber as integer, $lowerBound as integer, $upperBound as integer)
Configures a fixed window range consisting of a lower bound and an upper bound for the specified window.
Arguments
$axis The axis on which to configure the window range.
$windowNumber The number of the window on which to configure the range.
$lowerBound The value for the window range lower bound.
$upperBound The value for the window range upper bound.
To specify an array of window ranges, use the PsoWindowConfigureArrayRanges() function. Before you use this function, make sure that you write the number of range pair values specified by the $numberOfRanges argument, in counts, to the drive array starting with the location that you specify with the $driveArrayStartAddress argument. You must write the range pairs to the drive array in sequence, lower bound followed by upper bound. To write values to the drive array to be used as window range pairs, use the DriveArrayWrite() function and specify DriveArrayType.PsoWindowRanges as the $driveArrayType argument.
For more information on writing values to the drive array, see the DriveArrayWrite() function in the Device Functions topic.
When you use window ranges from the drive array, the PSO Window module uses the first specified pair of range values as the active window. When the PSO window counter exits the active window, the module loads the next pair of values from the drive array and uses the pair as the next window range. The module continues to use the values in the drive array in this way until the configured number of ranges is reached. You can use the $enableRepeat argument to tell the module to use an infinite number of drive array values. In this mode, the module returns to the value at the $driveArrayStartAddress and uses the same set of values again after the module uses the last pair of range values in the drive array.
function PsoWindowConfigureArrayRanges($axis as axis, $windowNumber as integer, $driveArrayStartAddress as integer, $numberOfRanges as integer, $enableRepeat as integer)
Configures an array of window range pairs each consisting of a lower bound followed by an upper bound.
Arguments
$axis The axis on which to configure the window ranges.
$windowNumber The number of the window on which to configure the ranges.
$driveArrayStartAddress The byte-addressable index of the drive array where the lower bound of the first range pair is stored.
$numberOfRanges The number of range value pairs to be read from the drive array.
$enableRepeat Configures PSO to continue to use range pairs after the last range pair in the array is used, starting over at the first range pair.
By default, when you use the window ranges from the drive array, the PSO Window module loads the next window range when the counter exits the active window in either direction. If you want the module to load a new window range only when the counter exits the active window in a specific direction, use the PsoWindowConfigureArrayUpdateDirection() function. The $windowUpdateDirection argument specifies the exit directions that cause the module to load a new window range. Use the PsoWindowUpdateDirection enumeration to specify the value of the $windowUpdateDirection argument.
IMPORTANT: The PsoWindowConfigureArrayUpdateDirection() function applies only when you use a single PSO window.
function PsoWindowConfigureArrayUpdateDirection($axis as axis, $windowNumber as integer, $windowUpdateDirection as PsoWindowUpdateDirection)
Configures the array of window range pairs to update when exiting the active window range in specific directions.
Arguments
$axis The axis on which to configure the window array update direction.
$windowNumber The number of the window on which to configure the array update direction.
$windowUpdateDirection Mode selection to select the active window range exit directions on which to update the window range.
Use the PsoWindowUpdateDirection enumeration to specify the value of the $windowUpdateDirection argument.
enum PsoWindowUpdateDirection
Both = 0 Positive = 1 Negative = 2 end |
The window update direction and the window counter are relative to the encoder direction. The ReverseMotionDirection parameter does not have an effect on them. If the window update direction is negative, then the window is updated when the lower bound is exited. If the window update direction is positive, then the window is updated when the upper bound is exited.
Controlling the Window Counter
You can specify conditions under which the counter will reset to zero by using the PsoWindowConfigureCounterReset() function. You can specify multiple counter reset condition options simultaneously. To do this, set the $optionsMask argument to the bitwise OR of all desired option mask options, as defined in the PsoWindowCounterResetMask enumeration.
function PsoWindowConfigureCounterReset($axis as axis, $optionsMask as integer)
Configures the conditions which will reset the PSO window counters.
Arguments
$axis The axis on which to configure the window counter reset conditions.
$optionsMask A bitmask of PSO window counter reset options. Use the values from the PsoWindowCounterResetMask enum.
enum PsoWindowCounterResetMask
ResetUntilMarker = 1 ResetOnMarker = 2 end |
You can directly set the PSO window counter to a specified value by using the PsoWindowCounterSetValue() function. Specify the desired value in counts as the $value argument.
function PsoWindowCounterSetValue($axis as axis, $windowNumber as integer, $value as integer)
Sets the specified window counter to the specified value.
Arguments
$axis The axis on which to set the window counter.
$windowNumber The number of the window on which to set the counter.
$value The new counter value.
Controlling the Window Events
By default, the PSO Window module does not generate events to send to the PSO event module. Optionally, you can use the PsoWindowConfigureEvents() function to configure the module to output events when entering or exiting the active window range. Specify the desired behavior for the $eventMode argument by using the PsoWindowEventMode enumeration.
function PsoWindowConfigureEvents($axis as axis, $eventMode as PsoWindowEventMode)
Configures the conditions which will generate PSO window events.
Arguments
$axis The axis on which to configure the window event conditions.
$eventMode The specified window event mode.
enum PsoWindowEventMode
None = 0 Enter = 1 Exit = 2 Both = 3 end |
Controlling the Window Output
By default, the PSO window output is disabled and is not active when the counter is within the active range. To enable the output, use the PsoWindowOutputOn() function. Once enabled, the output of the window module will be active when the counter is within the active range.
function PsoWindowOutputOn($axis as axis, $windowNumber as integer)
Enables the specified window output.
Arguments
$axis The axis on which to enable the window output.
$windowNumber The number of the window on which to enable the output.
To return the output to its default disabled state, use the PsoWindowOutputOff() function.
function PsoWindowOutputOff($axis as axis, $windowNumber as integer)
Disables the specified window output.
Arguments
$axis The axis on which to disable the window output.
$windowNumber The number of the window on which to disable the output.
*Go to the enum PsoWindowInput drop-down on this page to see the inputs for your drive.