The text of a manual · part 9 of 21
PT Program Generator User's Manual, pages 78 to 87
Pages 78 to 87 of 204
The original document is the PDF (14 MB). This is its text as extracted, unedited; tables and drawings read best in the PDF, and each page heading opens it at that page.
For the PSC PT40 and Datalogic PT40
Page 78
2342.book Page 66 Thursday, July 22, 2004 8:35 AM
Creating & Using Nodes
None
Requires no match; it tests only on the basis of type.
Constant
Compares the value in the data source to a constant value
Range
Verifies that the value in the data source falls between an upper and a lower value
Register name
Verifies that the value in the data source matches the value in a specified register (refer to Registers on page 78, for details on specifying a register location.)
Ignore Case
Ignore Case verifies the data match regardless of capitalization.
If you want the data to be case specific, make sure this option is not selected.
Store Index Tab Figure 42. Store Index Tab
The Store Index In Register option stores in a register the number of the first record in the file that passes the verification. If there is no match, it stores the position of the last record. Select a register name from the list. This option is only available when the Verify Source option is set to File.
Next Nodes Next node specifies the next operation to go to when the verify function suc-ceeds or fails.
Copy Nodes Copy nodes are used to move data between registers and files. Collected data is often stored temporarily in a register until it is validated. Then a Copy node transfers the data into a file. A Copy node can also copy data from a portable file to a register, where it can be referenced or displayed. You can also use a Copy node to copy a constant value to a register or file or to copy data between files and between registers. Figure 43 on page 67 shows the dialog box associated with a Copy node.
66
PT Program Generator (PPG) v5.0
Page 79
2342.book Page 67 Thursday, July 22, 2004 8:35 AM
Creating New Nodes
Figure 43. The Copy Node Properties Dialog
Copy From Tab Data Source indicates the data to be copied - either a constant or the contents of a register or file. If you choose Constant, you are prompted for a number or text string. If you choose Register or File, you are prompted to specify a location. For more information, refer to Registers on page 78 and Files on page 81.
Copy To Tab Data Destination indicates where the data is copied. Data can be copied to either a register or a file. Select the destination from the available options. For more information, refer to Using a Register as a Destination on page 79 and Using a File as a Destination on page 83.
Next Nodes Next node specifies the next operation to go to when the verify function suc-ceeds or fails.
Modify Nodes Modify nodes let you change the contents of a register or file. You can switch text to all uppercase or all lowercase, reverse the order of data, or delete data. You can also perform a search-and-replace operation on data and clear the eighth bit of data. Figure 44 on page 68 shows the dialog box for a Modify node. User’s Guide
67
Page 80
2342.book Page 68 Thursday, July 22, 2004 8:35 AM
Creating & Using Nodes
Figure 44. The Modify Node Properties Dialog
Data to Modify Data source specifies the location of the data to modify. If you choose Register, select a register from the displayed Register list box. To modify only one field of the register, select the Field type and select the Template and Field name from the displayed list boxes (refer to Registers on page 78). If you choose File, select the file name from the pull-down list. If you select Record, refer to Using a File as a Source on page 82.
Modification Type This option allows you to select how the data is modified. Select from the following: To Upper case
Changes all lowercase characters in the source string to uppercase.
To Lower case
Changes all uppercase characters in the source string to lowercase.
Search \ Replace Replaces all instances of a given string with a second given string. You must use the entire string; it is not possible to do a partial match using a the Search/ Replace feature on the Modify node. To use a partial match, refer to Searching for a Partial Match on page 148 using the Verify node.
68
PT Program Generator (PPG) v5.0
Page 81
2342.book Page 69 Thursday, July 22, 2004 8:35 AM
Creating New Nodes
Reverse
Reverses the order of data in the specified register. For example, if the register value were 123456, this option would reverse the order of characters in the string to 654321.
Delete
Erases the data from the specified register, field or file.
Clear 8th Bit
Ensures that specified data is in seven-bit ASCII format. If the data is stored in eight bits, this options clears the eighth bit. For example, when you are working with a database file that originated on the PC, this strips the 8th bit prior to uploading collected data to the PC.
Next Nodes Next node specifies the next operation to go to when the modify function suc-ceeds or fails.
Math Nodes Math nodes perform basic mathematical operations on the contents of a file or register. Figure 45. Math Node Properties Dialog
User’s Guide
69
Page 82
2342.book Page 70 Thursday, July 22, 2004 8:35 AM
Creating & Using Nodes
For example, you could multiply the contents of the default register by 3 and store the results in a register called Triple. Rather than supplying a constant (such as 3), you could specify another register that contains the number you want to multiply, add, subtract, or divide by. Figure 45 on page 69 shows the dialog box for a Math node. The format of the math function is as follows: Constant | Register | File + | - | / | *| % Constant | Register = Register | File
The results of the math operation must be within the range of -999,999,999 through 999,999,999 and are always rounded to the nearest integer.
Floating Point Math PPG supports floating point math. Decimal values and exponential notation of values with up to 13 digits can be entered in an application.
Operand 1 Tab The Operand 1 tab lets you specify a constant value or a file or register containing the first operand for the mathematical operation. The location of Operand 1 is displayed near the bottom of the dialog. Figure 46. Math Node: Operand 1Tab
For more information on files and registers, refer to Registers on page 78 and Files on page 81.
70
PT Program Generator (PPG) v5.0
Page 83
2342.book Page 71 Thursday, July 22, 2004 8:35 AM
Creating New Nodes
Operand 2 Tab The Operand 2 tab lets you specify a constant value or a file or register containing the second operand for the mathematical operation. The location of Operand 2 is displayed near the bottom of the dialog. Figure 47. Math Node: Operand 2 Tab
For more information on files and registers, refer to Registers on page 78 and Files on page 81.
Result Tab Register/File specifies where the result of the math operation is stored - in either a field, register, or file. The location where the result of the mathematical operation is stored is displayed near the bottom of the dialog. Figure 48. Math Node: Result Tab
For more information, refer to Using a Register as a Destination on page 79, and Using a File as a Destination on page 83.
User’s Guide
71
Page 84
2342.book Page 72 Thursday, July 22, 2004 8:35 AM
Creating & Using Nodes
Next Nodes Tab Next specifies the node to branch to if the math operation passes and where to branch to if it fails. A math operation will fail only if you attempt to divide a value by zero or operate on a nonnumeric value.
Figure 49. Math Node: Next Nodes Tab
Operation (Mathematical Function) At the bottom of the Math Node Properties dialog (refer to Figure 45 on page 69), there is an Operation section, shown in Figure 50. Select from mathematical functions that follow it. Figure 50. Math Node: Operation
+ (Addition)
Adds the two values.
- (Subtraction)
Subtracts operand 2 from operand 1.
* (Multiplication)
Multiplies operand 1 by operand 2.
/ (Division)
Divides operand 1 by operand 2. Returns the integer result.
% (Modulus)
Divides operand 1 by operand 2. Returns the remainder.
Call Nodes Call nodes execute a branch to a subroutine. A subroutine contains nodes that perform a routine function, such as copying data to a file or verifying data. A subroutine can be called from multiple locations in the program (with Call nodes), eliminating the need for duplication. Creating subroutines and referencing them with Call nodes optimizes a PPG program, saving both time and program size. Figure 51 shows a Call Node Properties dialog.
72
PT Program Generator (PPG) v5.0
Page 85
2342.book Page 73 Thursday, July 22, 2004 8:35 AM
Creating New Nodes
Figure 51. Call Node Properties Dialog
Call Subroutine Click on the down-arrow button to the right of the input box to display a list of all subroutines within the program. Select the subroutine you want to Call, and then select OK. A Call to a subroutine executes the specified subroutine and then returns to the node following the Call node.
Links Creating Links Links are arrows that connect frames and nodes, directing the program to the next step. A Link pointing to a frame or node shows how it is accessed. A Link pointing away from a frame or node shows where the program goes next.
To create a Link, complete the following steps: 1. Select Create > Link from the menubar or press the Link button from the Program Nodes toolbar. 2. Position your cursor (the Link) on the initiating node, click and hold down the left mouse button, and drag your cursor (the Link) on to the Next Node. Release the Link. The Link is drawn using the middle of each object as an axis, regardless of the exact position of the pointer.
User’s Guide
73
Page 86
2342.book Page 74 Thursday, July 22, 2004 8:35 AM
Creating & Using Nodes
To draw a jointed Link (a Link with one or more bends), point to the source node, move the pointer to where you want the first joint to be, click the mouse again, and draw the next leg of the Link. Click inside a frame or node to complete the Link.
Adjusting Links To adjust an existing Link, move the arrow pointer to the Link's arrowhead or joint, and hold down the left mouse button. Drag the joint or arrowhead to a new position, and then release the mouse button. If two or more Links overlap, you can select them separately by moving the arrow pointer to a joint or arrowhead and holding down the left mouse button. The selected Link appears dashed. To select the next Link in the stack, press and hold down the left button again.
Moving Links To move a node while retaining the position of its anchored, jointed links, press and hold the Shift and Ctrl keys while grasping the node with the mouse and moving it to the new location.
Deleting Links To delete an existing Link, select the Link by moving the cursor to the Link’s arrow-head and holding down the left mouse button. Press the Delete button or the ESC button.
74
PT Program Generator (PPG) v5.0
Page 87
2342.book Page 75 Thursday, July 22, 2004 8:35 AM
Automatically Generated Nodes
Automatically Generated Nodes Start Nodes Start nodes point to the first node in each frame. The are created automatically by PPG when a frame or a subroutine is created.
Exit Nodes Exit nodes indicate where the frame ends and returns to its parent frame. Exit nodes are created automatically by PPG when you create a Link from one frame to another. (Refer to Node Types and the Parent-Child Relationship on page 17 for more information on the parent-child relationship between nodes.)
Return Nodes Return nodes indicate where a subroutine ends and returns to its calling node. Return nodes are created automatically by PPG when subroutines are created.
User’s Guide
75