Product: LABELVIEW, CODESOFT
Version: All Versions
|
About Counter Variables
What is a counter variable?
A counter is a variable that is set up to increment or decrement in value based on a counting base, a start value, an increment value, and a reset value.
NOTE: Using a negative number as an increment value causes the counter to count backwards (decrement). Using a zero makes the counter a non-incrementing value.
Why use a counter variable?
A counter variable can be used for counting, or for printing serial, lot, or production control numbers.
Using a counter allows you to print a unique number on each label or each series of labels.
Creating a Counter Variable
Properties of counter variables
You can set the following properties for counter variables:
- Counter properties, including:
- ISO counter
- Base calculation type
- Increment value
- Start value
- Reset value
- Increment timing
- Output properties, including:
- Prefix
- Suffix
- Decimal places
- Padding characters
- Inclusion in log file
Procedure
To create a counter variable:
- Name allows you to assign a unique name to the counter variable (to replace the system-assigned name).
- Shared variable identifies a variable that is saved in an external file each time after printing. This means that the value can be used in other documents.
- In LABELVIEW this is only available in Gold, available in all versions of CODESOFT.
- ISO counter specifies that each label printed is counted, regardless of whether it is an original or a duplicate.
- In LABELVIEW this is only available in Gold, available in all versions of CODESOFT.
- Type identifies the type of counting base. Decimal (base 10 calculation) is the default. See the online Help for a complete description of the available counting bases and instructions for creating a customized base.
- Current value allows you to specify the counter value to be printed on the first label. For counter variables, this value is established when the variable characteristics are determined.
- Increment defines the value by which the counter is incremented. It can be a positive or negative value.
- Min/Max Value allow you to set the initial value and maximum value of the counter. The counter resets to the minimum value each time the maximum value is reached.
- Increment after allows you to print multiple labels before incrementing the counter. These options are not available if you chose ISO counter.
- Having printed is the number of labels to be printed before incrementing the counter.
- Each reset of allows you to specify that incrementing occur based on the reset of another counter variable. Multiple counters can be cascaded to carry out complex counting.
- Reset after variable value change allows the counter to be reset at the end of a regular cycle (e.g., weekly or monthly).
- Prefix allows you to define one or more characters to precede the variable.
- Suffix allows you to define one or more characters to follow the variable.
- Output mask is used to format the variable as you want it displayed.
- Display decimals indicates that you want the variable to be formatted with decimal places.
- Number of decimals allows you to specify places to the right of the decimal point.
- Decimal separator allows you to specify a character to represent the decimal point.
- Thousand separator allows you to enter a thousand separator.
- A Pad with character can be appended to the left of a variable to ensure the variable occupies the maximum length of the field. For example, if the field length is 4 characters, and you specify a padding character of 0, then a variable value of 12 will print like this: 0012.
- Up to x characters allows you to specify the maximum number of padding characters. If you have a counter, this value is set at the number of characters in the maximum counter value.
- Include in the Printing log file causes the variable to be recorded in the printing log file.
- Accumulate value stores the value of the variable in a separate file. The value is added to the value already stored in the file. To select the file, click the button to access the folder containing these files.
- Activate event call labels created can contain data generated from Visual Basic Scripting. Check this option to use this feature.
- Events lists the Visual Basic Scripting events available.
- VBScript edit box is where to enter the VBScript directly in the Edit field.
- Test button allows you to generate compilation errors or warnings to test and correct your VBScript.
More information can be found by clicking the Help button on the Visual Basic Scripting tab.
|