The text of a manual · part 4 of 6
PCM-11 Application Module Operator's Manual, pages 31 to 40
Pages 31 to 40 of 56
The original document is the PDF (3.6 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 Emerson PCM-11
Page 31
Building Your Program Q Set Maximum Torque Output
If you enter a zero, that output will be forced off. These outputs will remain in this pattern until they are updated. If you enter an “X” for any line, that line state will not be changed. 2.
Set single output line ON: Turns any output, hardware or internal, on. Output remains in this state.
3.
Set single output line OFF: Turns any output, hardware or internal, off. Output remains in this state.
P Call Program The Call Program function is used to initiate a program from within a program. You can use the “P” function to call additional programs as sub-routines of your original program. This is called “Nesting”. PCX allows you to nest up to 30 programs under any one Program Call function before returning to the original program. Use care in constructing programs that create a continuous loop condition by “Nesting” programs. When nesting programs, your program must return to the “Master” program somewhere in the loop to prevent programs from becoming stacked up in memory.
For example: You initiate Program #1, which uses the “P” function to call Program #2, which uses the “P” to call Program #3, which uses the “P” function to again call Program #2. This continuous loop condition could cause the memory to get stacked up, causing the drive to drop out of the program and return to external mode or register a “Ø” fault on the diagnostic display. To avoid this condition, make all of your program calls from your original program (Program #1 in this example). Then use the Jump function (J) right after the “P” function calling Program #3 to jump back to “P” function calling Program #2. This will allow the memory (RAM) to clear and the loop to continuously run program #2 and #3 from Program #1.
Q Set Maximum Torque Output This function overrides the “Maximum Torque Output” which is set up in the “Limits” screen. When the program has completed, the original value is restored. If you use a low value for “Q” (less then 100%) you may need to set a high value for following error (F). This will avoid faulting the drive if it runs into a condition requiring more torque than it is allowed to deliver.
25
Page 32
PCM-11 Application Module Operator's Manual
J, W Jump/Wait The Jump and Wait For External Input Functions include unconditional jumps to another program step, jumps if an input line pattern is matched, or a jump/wait on a single input line being made active, whether that line has been assigned as an External Input Line or not. The statements “Jump If Input Match” and “Wait For Input Match” are satisfied if the input line pattern of active lines (hardware and/or internal) matches the specified pattern exactly. In addition, a “don’t care” character, “X”, is available to mask off from the pattern any input lines whose condition should be ignored at this point.
Using Jump/Wait Statements in a Program When the “J” command is entered as a program step, PCX displays the screen shown in Figure 22. The first choice, Jump Always, means exactly that, an unconditional jump to another statement number or label. Figure 22 Jump Command Options
The second choice, Jump on Input Pattern (PGI), brings up another window with these match selections: Figure 23 “Jump If” Options
The first and third choices in Figure 23 are alike in that they are asking for an AND condition of the selected Input Lines before jumping to the destination program step. In other words, the Jump will be made if, for example, selected Lines 1 AND 3 AND 4 are ALL on or off, depending on your selection. A numeral 1 looks for that Input Line to be on or off; the letter X causes that Input Line condition to be ignored. The second and fourth choices are alike in that they are asking for an OR condition of the selected Input Lines before jumping to the destination program step. That is, the Jump will be made if Line 1 OR Line 3 OR Line 4 is on or off, depending on your selection. Again, a numeral 1 looks for that Input Line to be on or off; the letter X causes that Input Line condition to be ignored.
26
Page 33
Building Your Program J, W Jump/Wait
The fifth choice, Jump if Input Match, will then ask you for an Input Line pattern to match before Jumping, with numeral 1 representing a Line ON, numeral Ø representing a Line OFF, and X representing a Line whose condition is ignored by this statement. This choice will Jump program execution to the specified program step if and only if the exact PATTERN is matched line for line. If any of these conditions are not met, program execution proceeds to the next step in the sequence. Another feature of both jumps and waits is the ability to monitor a single input line (hardware or internal) that is independent (or part of) of the existing jump/wait pattern (i.e. Programmable Input (PGI) Pattern). The following four jump/wait options are available. Figure 24 Jump/Wait Single Input
Wait for External Input Functions are very similar, except that program execution is halted at that spot in the program until the desired Input Line condition is met. If the condition is not met, program execution proceeds immediately to the next step.
Jump Commands To select this option, enter “J” in the program step. Then select one of three Jump options shown in Figure 25. Figure 25 Jump Command Options
The “Jump Always” command is an unconditional jump statement that causes program execution to move immediately to the specified program step. The “Jump on Input Pattern (PGI)” command causes program execution to skip to the designated program step if the specified input lines match the pattern you have selected. If the specified lines do not match that pattern the program continues to the next step in the program.
27
Page 34
PCM-11 Application Module Operator's Manual
Before this command can be used in a program, Input Function #28 “Wait/Jump Input” must be assigned to one or more hardware or internal input lines (see “Input Functions” section). Once the Jump Command has been selected, the cursor will move to the center of the PCX screen. The zeroes that appear in this field correspond with the number of Input Lines selected with Input Function #28. The left-most zero corresponds to the first input line selected. You may now choose which lines to monitor during this step by entering a (1) in the field corresponding to the input line you wish to monitor. Any field that has a zero or an “X” will cause that input line to be ignored during execution of this step. The “Jump on Single Input Line” command causes program execution to jump to the designated program step if the specified input line matches the condition you set in the next screen. This line can be any input line and is not restricted to those lines assigned to Input function #28, Wait/Jump Inputs. If the specified line does not match the condition (On or Off), the program continues to the next step.
Wait For Input Commands Before this command can be used in a program, you must assign Input Function #28 “Wait/Jump Input” to one or more hardware or internal input lines (see Input Functions, of this Manual). To use Wait For External Input when editing or writing a program, enter W as a program step. When you have entered the W, the screen will offer the choices shown in Figure 26. Figure 26 Wait for Input Command Options
When the “Wait On Single Input Line” function is selected, the system will hold program execution at this step until the designated input line meets the On or Off condition you select in the next screen. This line can be any hardware or internal input line and is not restricted to those lines assigned to Input Function #28, Wait/Jump Inputs. When the “Wait On Input Pattern (PGI)” function is selected, the system will hold program execution at this step until the input pattern you designate in the pop up menu is satisfied. These lines are restricted to those that you have assigned as “Wait/Jump” inputs. Once the Wait Command has been selected and a choice made from the pop-up screen, the cursor will then move to the center of the PCX screen. Zeroes will appear in this field that correspond to the number of External Lines selected in the Input Function Screen. The left-most zero will correspond to the first line selected.
28
Page 35
Building Your Program / + - * ^ Math Operators
You now choose which lines to monitor during this step. You make this choice by entering a “1” in the field corresponding to the line whose state you wish to monitor. Any field that has a zero or an “X” will cause that line to be ignored during execution of this step.
/ + - * ^ Math Operators The equation screen allows you to set up complex equations to be entered, stored, and recalled for execution in a program. You may also perform single step math operations on any of the User Registers as a step in a program. These operations are stored as simple program steps and do not infringe on the storage capacity for the more complex math equations. Any of the following math operators may be used as program step commands: / : divide + : add - : subtract * : multiply ^ : exponent
Using Math Operators in a Program To enter a math operator as a step in a program, move the cursor to the desired program step and type the math operator you wish to work with (/, +, -, *, ^,) and press <Enter>. PCX will display a window displaying the user registers. Select the user register in which you want to store the results and press <Enter>. A second window will pop-up which again displays the user registers with the added option “Immediate Value”. Figure 27 Load Value Setup Options
If you select Immediate Value you then enter the value that you want to use to modify the register when the program encounters this step.
29
Page 36
PCM-11 Application Module Operator's Manual
Any immediate value between -2,147,483,648 and 2,147,483,247 will be accepted.
For example, to add a count of 1 to user register “Flag1”, the program step would appear as: + FLAG1 = FLAG1 + 1 If you want to add the contents of register “OFFSET1” to register LENGTH1, the program step would appear as: + LENGTH1 = LENGTH1 + OFFSET1
= Load Value This function replaces the contents of a User Register with an immediate value, the value of the contents of another register, or the value of a drive parameter. The contents of the changed register may now be used as a new drive parameter, etc.
Using Load Value in a Program This function is selected by entering the equals (=) sign as a program step. When the equals sign is used, a popup window shows four choices: Load Immediate Value If you select this option, PCX will display a pop-up window showing the first 16 of the 64 User Data Registers. You can then select the register in which the information will be stored. As with other PCX lists, the first letter of the variable name can be typed for quicker access. Once you select the register, PCX prompts you for the immediate value that you want stored. Copy User Register If you select this option, PCX prompts you to choose which User Register to change. When you select the User Register to be changed, PCX then prompts you for the User Register whose contents are to be copied INTO the first. Remember, the first register selected under this command is the one whose contents will be set equal to the second register chosen. Values are re-scaled to the format of the destination (first) register if the decimals are different. With the drive parameters above, the value loaded into any user register will be adjusted to the number of decimal places of the destination register. Each register works with the number of decimal places that were assigned when the default data was assigned.
30
Get Drive Command Data
This option enables the program to interrogate the FX Drive at this step in the program and store the response in a register. As before, PCX first asks for the register to use for data storage. Once you specify the register, you may use any two-letter FX Drive command query, along with the corresponding command modifier. (See FX Drives Serial Commands Manual P/N 400255-00). Again, ensure that the response to your query will fit properly in the register you selected. Data with more than the register’s number of decimal places will be truncated, not rounded off, so care should be taken to avoid errors that may result.
Page 37
Building Your Program B Conditional Branches
Read Drive Parameter Data When this option is is selected you will be prompted for the User Register to use for storage. The next four screen clips present a list of possible FX Drive parameters to be read:
Figure 28 Read Drive Parameters
B Conditional Branches Conditional branches are set up as steps in a PCX program to establish conditions that can change the program execution. This function tests the contents of two user registers and branches to a step number or label if the condition is true. Otherwise, the next consecutive program step is executed. The contents of the selected user registers are tested against one of the following conditions: > < = >= <= greater than less than equal to greater than or equal to less than or equal to
31
Page 38
PCM-11 Application Module Operator's Manual
Using Conditional Branches in a Program Figure 29 shows a sample program that uses conditional branch commands in steps 4 and 9. Figure 29 Sample Program Using a Conditional Branch
To insert a Branch condition in your program, move the cursor to the spot where the branch is to be made and enter the letter B. Now PCX will display four menu windows (one at a time) to set up the conditional branch. The first window selects the register to be compared. The second window sets the branching condition. The third window sets the register or immediate value, to match against the first register. The fourth window sets the step number or label to branch to if the condition is met. As mentioned above, if the specified condition is not met, the program proceeds to the next consecutive step.
DC Drive Command The DC program step sends drive commands from within the program to the FX Drive. Any serial drive command (except Index Initiate or Program Initiate) can be issued from a program. With drive commands, the data accompanying the drive command can be either “immediate” (i.e., a constant entered at the program step line), or the current value of a User Register. This would allow, for example, a change of Maximum Following Error (c (“ME=XXX”) at a specific point in the program sequence. After executing the motions that required the change, the Maximum Following Error can be reset to its default value with another execution of this command.
32
Page 39
Building Your Program I, PJ Program Index, Program Jog
Using Drive Commands in a Program When in the program setup menu and in the specific program you want to modify, move the cursor to the correct program step location. Enter “DC” as a program step command. The program screen will pop up a menu which allows you to chose either “Immediate Value” or one of your user registers. If “Immediate Value” is chosen, you are then prompted for the serial command you’d like to enter (e.g., “ME” for maximum error). The cursor will then move over to the data field. You enter the appropriate data in this field. If a user register is chosen, the value of that register is then added to the command string sent to the drive. You must be aware of the units in use and any possible scaling of values when using drive commands in a program. See the FX Drives Serial Commands Manual (P/N 400255-00) for detailed descriptions of available drive commands and their ranges.
Execution commands, such as Index Initiate or Program Initiate, are not supported and will be ignored. When you run a program, the FX Drive will not look for an Initiate command until the program is completed. Because of this structure, Initiate commands will not receive a response and will not be acted on when sent in the middle of a program. The sole exception to this rule is the Stop Motion command, “ST”.
I, PJ Program Index, Program Jog An important feature of the PCM-11 Motion Program Controller is the ability to initiate motion from the program and execute subsequent non-motion program steps during the motion. The program can monitor control parameters such as position and velocity and perform other operations based on these parameters while the motor is in motion. There are three ways to start the FX Drive in motion and execute non-motion program steps during the motion. First is the Program Jog command, which starts motion based on the serial jog parameters set up in the Jog screen. This Jog motion is continued until a Stop Motion command is executed in the program sequence, until the program terminates or another motion program step is commanded. At that time the motor will change to the speed called for in that motion step (index, another jog or other motion command). The other two ways of initiating motion are to call a Program Incremental Index or a Program Absolute Index. Program Indexes are called with “I” just as normal indexes. Program Indexes are programmed in the Index setup screen (under “Define Motion”) from two new index types, Program Incremental and Program Absolute. With these two index types, the FX Drive initiates motion based on index parameters entered in the index screen and continues motion until the index is complete or until a subsequent program step calls another index or jog.
33
Page 40
PCM-11 Application Module Operator's Manual
When selecting Program Index Incremental or Program Index Absolute as the desired Index Type, the index count is automatically assumed to be 1. A flag for Program Indexes allows the Program Index to complete its move before allowing a subsequent program step to affect motion. This flag is set in the Index screen. Motion will not be aborted if “Yes” is entered for the “Run Until Index Complete” parameter. Instead, the program will start the Program Index and remain at the beginning of the next step which affects motion until the previous Program Index completes, at which time the program will start executing the next motion. If the entry is <NO>, the program index will abort as soon as program flow meets a subsequent motion step or call to another program. If any other index follows a program index (and the entry is <NO>), the Program Index is aborted when the second index is called. The index distance starts from this position and the accel/decel ramps of the second index are used. This is very similar to the way compound indexes are handled, except that the first index is aborted. Example: If a normal Incremental index of 4000 ST immediately follows a Program Incremental index of 8000 ST, the FX drive would immediately ramp from 0 to the velocity of the normal index and move only 4000 ST. If subsequent program steps do not affect motion, the Program Indexes run the entire distance as would any normal Incremental or Absolute index. If a Program Index follows Program Jog, the jog motion is aborted when the index is called and the FX Drive ramps to the velocity of the index using Serial Jog Ramps. Motion does not stop between Program Jog and the Program Index. If Program Jog follows a Program Index, the index motion is aborted when the jog is called and the motor will change speed to Serial Jog Speed without stopping. If changes are made to serial Jog parameters during a Suspend condition, these changes affect Program Jog. The changes take effect as soon as the program is resumed, including changes in direction!
Program Index and Program Jog support compounding motion. This means that a Program Index can be compounded into another index or jog. If the next program step is Program Jog then the accel/decel ramps of the jog are used in transitioning to the jog velocity. If the next program step is a Program Index or a normal index, the transition is handled just as in normal compound indexes. A Program Index may also be used as an index to be compounded into. Notes On Program Index And Program Jog: 1. A Program Index, when set to Run Until Complete, will complete the index before other motion steps execute and before a call to another program.
2. A Program Index, when NOT set to Run Until Complete,will abort the Program Index and will stop before another index begins, and before a call to another program. 3. If Program Jog is running and the program calls another program which makes changes to Serial Jog parameters, those changes are permanent until modified deliberately by a program or by an operator. 4. If a Program Index is running at the time an END program statement is reached by any program or sub-program, that Program Index is aborted and motion is stopped, regardless of Run to Complete - Yes or No.
34