PMAC Product Guide PROGRAMMING PMAC PMAC is fundamentally a command-driven device. PMAC does things by issuing it ASCII command text strings and generally PMAC provides information to the host in ASCII text strings. These text strings are typed and sent from a terminal window of a program communicating with PMAC, either by the ISA bus or the RS-232/422 serial port. The EZ-PMAC Setup Software, for example, provides such terminal window. When PMAC receives an alphanumeric text character over one of its ports, it does nothing but place the character in its command queue. It requires a control character (ASCII value 1 to 31) to cause it to take some actual action.
The most common control character used is the carriage return ( ; ASCII value 13) which tells PMAC to interpret the preceding set of alphanumeric characters as a command and to take the appropriate action. Note: Use the EZ-PMAC Setup Software as a software tool for configuring and programming PMAC. All the example programs provided in this manual can be found in the samples folder of the EZ-PMAC Setup Software installation directory. Moving a Motor: Jog Commands and Motion Programs The main goal of the PMAC motion controller is to control motion (i.e., to let a particular physical motor to move). In PMAC once the motors are properly setup, motion can be accomplished in two ways.
Jog commands allow moving the motor continuously, to position it to a certain distance or to move it in incremental intervals. Jog commands are issued from the terminal window in the form of online commands: Examples: #1J+ ; Moves Motor #1 continuously in the positive direction #1J/ ; Stops Motor #1 #1J- ; Moves Motor #1 continuously in the negative direction #1J/ ; Stops Motor #1 If a particular motion sequence is desired, and also if that sequence is tight to some logic, a motion program is a better approach for moving a motor than Jog online commands: Example:
OPEN PROG 1 CLEAR ; Opens “PROG1” buffer for editing LINEAR ; Linear mode motion INC ; Incremental mode TA100 ; Acceleration time is 100 msec TS0 ; No S-curve component F40 ; Feedrate is 40 length_units / second IF (M11=1) ; If Input 1 is ON X3 ; Move axis X 3 length_units of distance ELSE Y-3 ; Move axis Y 3 length_units of distance in the ; opposite direction ENDIF CLOSE A motion program is placed in a buffer for later execution. Thus, motion program commands are referred to as buffer commands because they can only be executed inside a motion program. Programming PMAC 43