The LASERDYNE S94P commands $INDATA and $INSDATA provide users of LASERDYNE systems greater flexibility and efficiency in creating programs that require or benefit from operator input during the execution of the program.
The $INDATA command can be used in a part program to prompt the user to enter a number in a dialog box that appears on the S94P screen. A designated system variable is set to the number that is entered, making it available for use in part programs. The number can be used as a data value (position or move length) or to control program execution with logical statements (ex., IF V1>10 GOTO N1000). The $INDATA command must include a prompt string, surrounded by double quotes, and a variable number or valid variable expression.
For example, the following command lines would assign the number the user entered to variable 20 and vector VEC1[X], respectively.
$INDATA(“Process how many parts?”, 20)
$INDATA(“Enter X position”, VEC1[X])
You can also embed ‘$’ commands in the message to print the value of system variables and other data, such as that collected using SPC Data Acquisition.
The $INDATA OR $INSDATA (the latter is described in the next section) windows will wrap long text automatically and will resize it vertically to fit longer prompts.
The prompts can include embedded carriage returns to format the displayed text. To force a return, include a “piping” symbol – “|” (usually the shifted back slash key).
‘$INDATA(“ENTER-0 FOR ALL 5PCS|ENTER-1 FOR PART-1|ENTER-2 FOR
PART-2|ENTER-3 FOR PART-3|ENTER-4 FOR PART-4|ENTER-5 FOR PART-
5 “, 33)
will appear as:
The prompt is limited to 300 characters. Line wrap and embedded carriage returns should generally not be combined.
The $INSDATA command can be used in a part program to prompt the user to enter a string (alphanumeric data up to 30 characters) in a dialog box that appears on S94P. Then a designated string variable (from $S0 to $S9) is set to the entered data, making it available to use in part programs. The string can be used only in certain ways:
- In a logical comparison:
IF $S1= “BC” GOTO 54
- To specify a file name for SPC:
- To specify a file name for SPC, mixing with preset text:
- As output in a G80 to G58 line:
M58 File name is $S9
The $INSDATA command must include a prompt string, surrounded by double quotes, and a string variable number from 0 to 9. For example, the following line would assign the file name entered by the user to string variable 5.
$INSDATA(“Enter file name”, 5)