1 Software Reference Propdf Pewin32 Pro Software Reference Manual Getting Started
1 Software Reference Propdf Pewin32 Pro Software Reference Manual Getting Started
^2 Pewin32 PRO
^4 3A0-09WPRO-xSx1
Table of Contents
OVERVIEW .......................................................................................................................................................................1
Introduction ......................................................................................................................................................................1
Features ............................................................................................................................................................................1
Hardware and Software Requirements .............................................................................................................................2
GETTING STARTED........................................................................................................................................................3
Installing Pewin32PRO ....................................................................................................................................................3
Help Features....................................................................................................................................................................3
Technical Support ............................................................................................................................................................3
MENU OVERVIEW ..........................................................................................................................................................5
How Menus Work ............................................................................................................................................................5
File Menu .........................................................................................................................................................................6
Configure Menu ...............................................................................................................................................................7
View Menu.......................................................................................................................................................................8
Resource Manager Menu..................................................................................................................................................8
Backup Menu ...................................................................................................................................................................9
Setup Menu ......................................................................................................................................................................9
Tools Menu ......................................................................................................................................................................9
Window Menu................................................................................................................................................................10
Help Menu......................................................................................................................................................................10
BASIC CONCEPTS .........................................................................................................................................................11
Workspace Management ................................................................................................................................................11
Project Management.......................................................................................................................................................12
Message Window ...........................................................................................................................................................12
Uploading Programs from PMAC..................................................................................................................................13
Uploading PMAC Variables ..........................................................................................................................................13
Downloading Files to PMAC .........................................................................................................................................14
Using Macros in the Editor .......................................................................................................................................14
Download Options .....................................................................................................................................................16
Terminal .........................................................................................................................................................................17
Changing the Appearance of the Terminal ................................................................................................................17
Selecting DPRAM ASCII Communication .................................................................................................................18
Enable View Interrupts ..............................................................................................................................................18
Position Window ............................................................................................................................................................18
Position Menu............................................................................................................................................................19
Units and Scales ........................................................................................................................................................19
Watch Window...............................................................................................................................................................20
Watch Menu...............................................................................................................................................................21
Adding Entries to the Watch Window ........................................................................................................................22
Adding and Editing Macro Definitions......................................................................................................................22
Editing Macros ..........................................................................................................................................................23
Add Multiple Variables..............................................................................................................................................23
Editing Watch Entries................................................................................................................................................24
DPR Viewer ...................................................................................................................................................................24
Status Screens.................................................................................................................................................................25
Connector Status........................................................................................................................................................25
Motor Status ..............................................................................................................................................................27
Coordinate Systems Status.........................................................................................................................................27
Global Status .............................................................................................................................................................28
Motor Setup Summary ...............................................................................................................................................28
Motion Programs/PLCs Status ..................................................................................................................................29
PLCC Program Status ...............................................................................................................................................29
PMAC CONFIGURATION ............................................................................................................................................31
Table of Contents i
PEWIN32 PRO Software Reference Manual
I-Variables......................................................................................................................................................................31
I-Variables by Category.............................................................................................................................................31
I-Variables by Number ..............................................................................................................................................34
I-Variables MACRO ..................................................................................................................................................35
M, P and Q-Variables.....................................................................................................................................................35
Coordinate Systems........................................................................................................................................................36
Coordinate System to Modify-Monitor ......................................................................................................................36
Current Axis Definitions ............................................................................................................................................36
Edit ............................................................................................................................................................................36
Remove.......................................................................................................................................................................36
Available Motors .......................................................................................................................................................36
Add.............................................................................................................................................................................37
View all Coordinate Systems .....................................................................................................................................37
Done ..........................................................................................................................................................................37
Encoder Conversion Table .............................................................................................................................................37
Entry Number ............................................................................................................................................................38
Entry, Source and Processed Data Addresses ...........................................................................................................38
Conversion Type ........................................................................................................................................................38
View All Entries of Table ...........................................................................................................................................39
Download Entry.........................................................................................................................................................39
Done ..........................................................................................................................................................................39
Inc with Inv-T Ext ......................................................................................................................................................39
A-D Register ..............................................................................................................................................................39
Parallel with and without Filter ................................................................................................................................39
Filter-Max Change ....................................................................................................................................................40
Time Base ..................................................................................................................................................................40
Triggered Time Base..................................................................................................................................................40
Inc with Parallel Ext..................................................................................................................................................40
Inc without Parallel Ext.............................................................................................................................................40
Summing Table Entries to Another ............................................................................................................................40
Bits Enabled Mask .....................................................................................................................................................41
Max Change...............................................................................................................................................................41
Conversion Shifting of Parallel Data ........................................................................................................................41
Encoder Conversion Table MACRO..............................................................................................................................41
ADVANCED FEATURES ...............................................................................................................................................43
EditorPro ........................................................................................................................................................................43
Introduction ...............................................................................................................................................................43
Syntax Highlighting ...................................................................................................................................................44
Auto Indenting ...........................................................................................................................................................44
Auto Correction .........................................................................................................................................................45
Popup Debugger Window..........................................................................................................................................45
Error Tracing ............................................................................................................................................................47
Editor Menu...............................................................................................................................................................48
Setup Window ............................................................................................................................................................50
Debugger ........................................................................................................................................................................52
Introduction ...............................................................................................................................................................52
How to Use the Debugger..........................................................................................................................................52
Important Notes .........................................................................................................................................................56
Resource Manager..........................................................................................................................................................57
Introduction ...............................................................................................................................................................57
How to Use Resource Manager .................................................................................................................................57
Active Project ............................................................................................................................................................60
Using Resource Manager in the Terminal Window...................................................................................................60
Using Resource Manager in the EditorPRO..............................................................................................................61
Important Notes .........................................................................................................................................................62
ii Table of Contents
PEWIN32 PRO Software Reference Manual
iv Table of Contents
PEWIN32 PRO Software Reference Manual
OVERVIEW
Introduction
Welcome to Pewin32PRO, Delta Tau’s PMAC Executive software for Microsoft Windows. This software
enables you to configure, control and trouble-shoot your PMAC (Programmable Multi-Axis Controller). At
its core, Pewin32Pro provides a terminal, a text editor for editing Motion/PLC programs and a workspace
environment. Additionally, there is a suite of tools for configuring and working with PMAC and its
accessories. Pewin32PRO is a development tool for creating and managing specific PMAC implementations.
This document details all the features of Pewin32Pro, and explains how to use Pewin32PRO to communicate
and control your PMAC motion control card. Companion applications such as Plotting, Tuning and Setup
have separate documentation. Knowledge of the basic use of the Windows operating system is assumed.
Note:
Pewin32Pro uses the latest driver from Delta Tau, PComm32 Pro, which works most
efficiently with firmware that supports I63 and I64 (Ctrl-X echo, and Internal Response
Tag Enable). Firmware version 1.16F and beyond for non-Turbo and 1.931 and
beyond for Turbo PMACs will support these I-Variables.
Features
This version of the PMAC Executive software is based on the previous versions but has been enhanced in
many ways. In this version Pewin32Pro has:
• Workspace support
• Project management
• A terminal window
• A real-time color editor with many options. Features include error tracking during downloads, color
options for different commands and compatibility with standard PMAC code. Advanced features of the
editor include
• A real-time PLC debugger. See editor section for detailed description
• Managing the code syntax and applying appropriate indenting and margins
Overview 1
PEWIN32 PRO Software Reference Manual
• Resource manager responsible for keeping track of all MACRO definitions for an active project.
• Real-time status display of all PMAC’s connectors.
• The ability to talk to multiple PMACs on a single computer.
• And many more.
Pewin32PRO has many tools to help both the novice and the advanced PMAC user get the most out of their
PMACs.
Hardware and Software Requirements
The PMAC Executive for Windows software will run on any computer capable of running Windows 98/ME
or 2000 (TM) (266 MHz Pentium MMX and up recommended). Of course, the faster the computer, the
better. In addition, you will need the following:
2 Overview
PEWIN32 PRO Software Reference Manual
GETTING STARTED
Installing Pewin32PRO
Before installing Pewin32PRO, read the license agreement included in this manual (behind title page), and
make a backup copy of the installation disks. Then install Pewin32PRO according to the instructions in the
PComm32Pro Installation Procedures User Manual.
Help Features
Context sensitive help is available. Simply press F1 to launch the help system.
Why Am I Not Moving? and Why Is My Program Not Running? are the two diagnostic functions in the
Help menu. These are only available if you are communicating with a PMAC. Probably, these will save you
many hours of searching and frustration in tracking down problems associated with running a motor or part
program, especially if you are new to PMAC. You may run into a condition in which a motor simply will not
run, even though you are sure that all the parameters have been set properly. These functions will look at
your configuration and cite possible (warnings) or definite (faults) causes of problems preventing you from
running your motor(s) / program(s). “Why am I not moving?” requires that you specify a motor to analyze
while “Why is my program not running?” requires that you specify a coordinate system to analyze.
The About box will give you detailed information about the version of the software you are running.
Technical Support
Delta Tau is happy to respond to any questions or concerns you have regarding the Windows Executive. By
far, you'll get the quickest response if you send your queries to the following e-mail address:
[email protected]. Of course, please do check out our Web site at www.deltatau.com.
You can call Delta Tau Monday through Friday from 9:00 AM to 4:30 PM PST or FAX us your request or
problem, and we will deal with it the next business day.
Delta Tau Data Systems, Inc. West Coast East Coast
21314 Lassen Street
Voice: (818) 998-2095 Voice: (804) 795-4288
Chatsworth CA, 91311
FAX: (818) 998-7807 FAX: (804) 795-4996
Getting Started 3
PEWIN32 PRO Software Reference Manual
4 Getting Started
PEWIN32 PRO Software Reference Manual
MENU OVERVIEW
How Menus Work
Pewin32PRO uses a dynamic menu system. This means that the menu at the top of the screen changes content
depending on what window has the current focus (is highlighted). The standard menu displayed when the
terminal has focus looks like this:
However, the menu will change when, for example, the Watch Window is highlighted -
If an option you expect to be available is not, make sure you have the proper window highlighted. If you have
many windows open, use the Window menu item to select the one you are looking for.
Note
There are very user-friendly context sensitive menus which pop up in many of the
Pewin32PRO Windows. Use the right mouse button over a window to see the context
sensitive menu.
Menu Overview 5
PEWIN32 PRO Software Reference Manual
File Menu
The File menu handles several things:
6 Menu Overview
PEWIN32 PRO Software Reference Manual
• DOWNLOAD FILE – Allows downloading any file with valid PMAC commands.
• EXIT – Closes the program.
Configure Menu
The CONFIGURE menu lets you view and change current variable definitions and PMAC feature parameters.
In some of the options that allow you to change a value or definition, the change is sent to PMAC
immediately after the value is changed. This allows you to verify automatically that the change in the input
field has also occurred in PMAC. It also protects against faulty entries, since out of range numbers will not
be accepted.
• I VARIABLES – There are two interfaces for listing and setting I variables; by category, or by numerical
order. In addition, a special interface for MACRO I-Variables exists.
• P VARIABLES – Allows setting P variable values.
• Q VARIABLES – Allows setting Q variable values.
• M VARIABLES – Allows setting M variable definitions and values.
• COORDINATE SYSTEMS – This menu choice enables you to alter the currently defined coordinate
systems, or define new ones.
• ENCODER CONVERSION TABLE – This menu choice allows you to alter, update, save or retrieve the
entries of the encoder conversion table.
• ENCODER CONVERSION TABLE MACRO - This menu allows you to alter, update, save or retrieve the
entries of the encoder conversion table of a MACO station.
Menu Overview 7
PEWIN32 PRO Software Reference Manual
View Menu
The VIEW menu contains many interactive status displays as diagnostic tools. Many of the displays are
updated in real-time.
• VIEW - Displays the resource manager and lists all macro variables with key name, macro name and
description.
8 Menu Overview
PEWIN32 PRO Software Reference Manual
Backup Menu
The options in this menu allow you to save or restore complete or partial portions of PMAC configuration to
disk.
• UPLOAD CONFIGURATION – Allows saving all or part of PMAC’s configuration to a disk file.
• RESTORE CONFIGURATION – Allows restoring all or part of PMAC’s configuration from disk.
• VERIFY CONFIGURATION – Verifies a specified configuration file.
Setup Menu
This pull down menu allows you to customize Pewin32PRO.
Menu Overview 9
PEWIN32 PRO Software Reference Manual
• PMAC TEST PRO - Launches PmacTest program. PmacTest is now installed with Pewin32PRO
Executive.
• PMAC PLOT PRO - Launches PmacPlot program (if it is installed).
• PMAC TUNING PRO - Launches Pmac Tuning program (if it is installed).
• P1 SETUP AND TUNING PRO - Launches the PMAC1 setup program (if it is installed).
• P2 SETUP AND TUNING PRO - Launches the PMAC2 setup program (if it is installed).
• TURBO/UMAC SETUP PRO - Launches the Turbo Setup program (if it is installed).
• UMAC CONFIG PRO - Launches the UMAC Configuration Setup program (if it is installed).
• CUSTOMIZE TOOLS MENU – Allows adding third party applications in the tool menu. These applications
then can be launched from the tools menu. These applications are listed after the customize tools menu.
Window Menu
This menu is for managing the position and arrangement of any windows currently displayed. It is
dynamically updated to allow easy selection of a specific window. Further, it shows all of PMAC Executive
windows and on selecting a window bring it to the front.
Help Menu
The HELP menu options allow you to retrieve on-line information about PMAC, the Executive program, and
the various help functions. You also have access to the two diagnostic routines provided by Pewin32PRO.
10 Menu Overview
PEWIN32 PRO Software Reference Manual
BASIC CONCEPTS
Workspace Management
Pewin32PRO can (and does by default) save the layout of the user forms (position, watch window etc.) and
the Project Manager configuration to a text based ‘INI’ file. This file keeps track of all the open forms
(windows) including their sizes, device association, update rate, state at the close of previous session, and
other parameters specific to the form. Of course, the workspace file can be edited outside the application for
desired changes, though this is not likely to be necessary. The default workspace file is
Pewin32PRO_default.ini, and is saved in the application folder.
Basic Concepts 11
PEWIN32 PRO Software Reference Manual
open and close the Project Manager and Message Window, respectively. Usage of these windows is
described next.
Project Management
All applications involving PMAC require some customization. Typically, these customizations are held and
organized in text files. The Project Manager facilitates the quick reference, organization and downloading of
such files.
To use the Project Manager, first add a project by clicking the Add Project button or use the pop-up menu
(right mouse click).
The Add Project dialog box allows you to specify the name of the project (i.e. Mill, Lathe) and the PMAC
device to associate it with. The device number is used when downloading the file. If you don’t want to
associate any PMAC device with this project, press the Select/Add Device button and then press Cancel.
Downloading individual files or complete projects can be done by first selecting the item then using the pop-
up menu’s download item.
Message Window
The message window is used from time to time by Pewin32PRO to display the results of a variety of things.
There are two main tabs in this window: Results and Change Monitor. The Results tab is used for:
• Downloading files.
• Backing up, Restoring and Verifying files.
• I-Variable changes made by Pewin32Pro and other applications.
• Miscellaneous items which may be implemented in the future.
Hint: When downloading a file that reports errors, double click on the Error within the Results tab to quickly
load and edit the offending line.
The Change Monitor reports behind-the-scene PMAC variable assignments done by Pewin32PRO or other
applications that have adopted the practice of reporting such changes. For example, any I-variable that is
assigned by Pewin32PRO is reported.
12 Basic Concepts
PEWIN32 PRO Software Reference Manual
Note
You can back up PLCCs and other pertinent information from the Backup\Save
Config menu item.
Just specify the type of variables you wish, and the range. The maximum To value depends on the PMAC
type you have.
Basic Concepts 13
PEWIN32 PRO Software Reference Manual
Note
The File Contains Macros box in the Download Options dialog must be checked for
the program to properly process "#define" and "#include" statements.
When the PMAC Executive Program is downloading your file from the text editor, if the #define command
is encountered and if the File Contains Macros or PLCC’s box is checked in Download Options dialog
box, the definition is stored in PC memory (nothing is actually sent to PMAC). When the macro name is
encountered later on the file, the PMAC Executive Program will send the actual PMAC command
phrase/variable for the particular macro so that PMAC only sees a valid PMAC command/variable (instead of
sending pressure to PMAC, P1 is sent for the above example). The only exception to this is when a
macro is defined as a NULL. In this case, nothing is sent to PMAC – it is available merely to provide units to
numeric values for further macro elaboration. See the sample program listing below for examples on how to
use the NULL definition. Remember that PMAC never sees the macro names – when the downloaded
program is listed, you will see standard PMAC commands.
A few rules must be followed when declaring and using these macro definitions. The macro name may
contain any unique sequence of characters (upper/lower case letters, numbers, symbols, etc.), but must be
separated from the #define command and the macro's definition by a space (as seen in the above
examples). The macro name (like gas_pressure, turn_on_pump, collect_data) may not
contain any spaces. However, you may use the underscore character _ to separate words for ease of
reading. The PMAC Executive Program will differentiate between upper and lower case for the macro
names, so take care when mixing upper and lower case letters. If you try to use a macro definition that has
not been previously defined properly (because you misspelled it or the upper/lower case letter sequence don't
14 Basic Concepts
PEWIN32 PRO Software Reference Manual
match, i.e. pressure and Pressure), the program will download that line as is and may (and most probably will)
result in an error generated by PMAC. Also, remember not to use the same name for two different macro
definitions.
You may also use macro definitions contained in other files on disk instead of or in addition to existing
definitions in the file you are downloading. The command to do this is the #include command:
#include "macro.pmc"
#include "names"
#include "program.def"
You may want to create a file that contains nothing but macro definitions, and then have several motion
programs "include" these definitions so that they can use the macros. This can help keep the size of program
files small when many macro definitions are being used. The rule to follow when using the #include
command is that the file name (any legal DOS file name) must be enclosed in quotes and must be separated
from the #include command with a space. The same rules stated above for naming the macros also
apply here, including the amount of PC memory used.
To best illustrate the potential of using macros, here is an example program using cleverly defined macro
names:
#define msec NULL
#define revs/sec NULL
#define set_acc_time_of TA
#define set_S_curve_time_of TS
#define set_feedrate_of F
#define set_move_time_of TM
#define feedrate_time_units I190
#define setup_gather_pointer M88->X1,18 M89>X1,19
#define free_up_memory_space DEL GAT DEL TRACE
#define reserve_memory_for_gather DEFINE GAT
#define start_gathering_data M88=1M89=1
#define stop_gathering_data M89=0
#define motor1_is_axis #1->
#define select_coordinate_system &
#define clear_coordinate_system UNDEFINE
#define move_X_to_position X
#define move_Y_to_position Y
#define move_Z_to_position Z
#define sit_there_for DWELL
#define repeat_as_long_as WHILE
#define end_of_loop ENDWHILE
#define increment_repetition_count P1=P1+1
#define repetition_count P1
#define repetition_limit 3
#define begin_program OPEN PROG
#define end_program CLOSE
;Now, let's use our new macro definitions!...
free_up_memory_space
setup_gather_pointer
select_coordinate_system1
clear_coordinate_system
motor1_is_axis 2000X
begin_program 2 clear
feedrate_time_units = 1000 msec
Basic Concepts 15
PEWIN32 PRO Software Reference Manual
Download Options
There are several options associated with the downloading of files. These are accessed through the SETUP-
GENERAL SETUP AND OPTIONS menu item.
Parse File for Macros. COMPILE PLCCs. Select this if the file you are downloading contains PLCCs or
uses the "#include" or "#define" statements.
Create Log File. If you wish to generate a log file of the download process, select this box. This is good for
debugging a large program.
Create Map File. A map file tells you what symbols are matched to what definitions.
Do not download. Have Pewin32PRO process the files downloaded to a compiled format (output file has a
*.56K file extension), but don't download to PMAC.
Display Warning if PLCs are running before downloading. If this box is checked, Pewin32PRO checks
for running PLCs every time you download a file. If they are running, you will be notified prior to download.
16 Basic Concepts
PEWIN32 PRO Software Reference Manual
Terminal
The Terminal represents a direct connection to a PMAC. There are two parts to the Terminal, the Entry and
Response windows. Any characters you type at the keyboard are sent to PMAC after pressing <ENTER>.
Any characters that are sent from PMAC to the PC are displayed on the response window in a color
corresponding to the current communications mode. If any command is rejected by PMAC, an error code is
shown as well as its description (and possible remedies) displayed in red text (assuming I6 is set to 1, the
default). You should always read this text, as it may affect your application.
The entry window keeps track of all unique commands sent to PMAC. To retrieve a previously sent
command, press the down arrow to view to the bottom right of the window, select and press <Enter>. This is
especially useful when, for example, you constantly have to type in a lengthy command phrase such as:
RHY$C000,20.
If you have SEND or CMD statements which cause PMAC to send ‘unsolicited’ strings to the host PC, you
may want to close all windows except the terminal window to ensure these strings are captured and displayed
by the Terminal window. Other open windows, which periodically poll PMAC, can inadvertently destroy
unsolicited responses.
Changing the Appearance of the Terminal
Select the Terminal window so that the Terminal menu item appears. Choose the Terminal | Select Colors
or Terminal | Select Font menu items for changing the appearance of the terminal.
Basic Concepts 17
PEWIN32 PRO Software Reference Manual
Note
Only SIA and PCI modes of communication support Interrupts.
Terminal has other nice features as Clear Terminal, Copy, Copy Terminal to Notepad, buffer size and
show macro names in the terminal.
Position Window
The position window displays motor position information. You can select the window to display position,
velocity, or following error separately or in combination for all eight motors simultaneously. Position can be
displayed for all motors.
18 Basic Concepts
PEWIN32 PRO Software Reference Manual
Position Menu
When the Position window is highlighted, the menu changes to :
POSITION – Allows displaying/hiding position. Position display can be combined with velocity and/or
following error displays.
VELOCITY – Allows displaying/hiding velocity. Velocity display can be combined with position and/or
following error displays.
FOLLOWING ERROR – Allows displaying/hiding following error. Following error display can be combined
with position and/or velocity displays.
Units and Scales
Position and velocity units Error! Bookmark not defined.– Allows setting scaling and unit parameters for
each motor. It also has the option to display/hide any motor.
To change the scale factor for displayed information, enter the appropriate number of encoder counts per user
units (i.e. if you want to have 10,000 CTS = 1 inch, enter 10000). Next, specify a name for your user units
Basic Concepts 19
PEWIN32 PRO Software Reference Manual
(i.e. “inch”, “deg”, “rev”). Select your velocity units (i.e. "per ms", “per second” or “per minute”). Enter in a
value for optional rolloverError! Bookmark not defined. (i.e. 360 if your user units are degrees). A value of
0 for rollover indicates no rollover. Lastly, specify how many decimal places to the right of the decimal point
you wish to have displayed (for inches, you may want to use a value of 3 so inches are displayed as “2.002
inches”). These parameters affect only the way information is displayed in the position window. They have
no connection to PMAC itself.
Note
Only an active (Ix00 = 1) motor’s parameters can be modified. Also, note that the
following error remains unchanged during these scalings.
Deselecting the display check box associated with a motor will cause the position window to not display
information about that motor. This allows systems to display/hide any given motor.
RESTORE DEFAULT VALUES - Reverts all settings to Pewin32PRO’s default settings, including display mode,
Cts/Unit, Dec. places, Rollover and units for Position and Velocity.
SELECT FONT | SELECT COLOR - Allows changing the appearance of the Position window.
NEXT SET OF MOTORS - Allows display of any one set of the motors for Turbo PMACs. By pressing the
<PgUp>, <PgDn> or the <UpArrow>, <DownArrow> keys it is possible to change to the next set of
motors in that order.
POSITION OF 32 MOTORS - Allows display of position only for all 32 motors for Turbo PMACs.
Watch Window
The watch window allows you to watch the response to any valid PMAC command, address or variable you
wish to observe in real-time. You may also select defined macro names from the .tbl files created when PLCs
and PMCs are downloaded to PMAC, or define macros of your own.
Each entry is divided into two sections. The first is the actual PMAC command used, and the second is the
value returned from PMAC. If there is a MACRO definition, then the main entry is the MACRO name and
the PMAC command is enclosed in parenthesis. When visible, the Watch window update rate, like other
active windows, is by default set to 1 second. However, it can be changed to as fast as 1 msec or as allowed
by your computer and PMAC.
Note:
Currently a total of 250 variables can be listed in a single watch window.
20 Basic Concepts
PEWIN32 PRO Software Reference Manual
Watch Menu
When the Watch window is highlighted, the main menu changes to:
OPEN WATCH –Use this to open a watch table previously saved. The saved files have a .WTB extension.
SAVE WATCH –Use this to save a watch table for future use.
ADD ITEM –Use this to add new watch entries to the watch table. Add Multiple Variables has been added in
this menu for simultaneous addition of variables. See the Add Multiple Variables section for details.
DELETE ITEM –This deletes the currently highlighted item.
EDIT ITEM –Allows changing the format in which return values are displayed. The available options are
decimal, hex and binary. See the Editing Watch Entries section below.
CLEAR ALL ITEMS – Clears (deletes) all items in the watch table.
SHOW MACRO DEFINITIONS –Allows displaying/hiding macro definitions in the Watch window.
OPEN MACRO TABLE –Use this to open a MACRO definition table.
EDIT MACRO TABLE –Use this to edit a MACRO definition table.
SELECT COLOR | SELECT FONT – Allow changing the general appearance of the Watch window including
Background Color, Text color and Font style.
Basic Concepts 21
PEWIN32 PRO Software Reference Manual
Simply type in the PMAC command you wish to watch the status of and press the Add button. The entered
command will then be displayed in the watch window. Add as many items as you want, then select the Done
button to return to the Watch window. You can also select any defined macros from the macro drop down list.
From this window, you could edit the macro table, by clicking on the Editing Macros button. The Add
Multiple Variables button lets you add multiple variables to the watch window. You could add multiple
variables in this window by separating every variable with a semicolon. For example, to add four variables to
the watch window at the same time, you could do: p1;i130;q10;m1. Include Non Macro Variables check
box, allows you to include all the non-macro variables to the drop down list box, which are added the watch
window.
Adding and Editing Macro Definitions
Pewin32Pro's Watch window has a built in macro management facility. You are able to load and save macro
files (like those produced by downloading files to PMAC) as well as add, edit and delete entries in those files.
Once these macros are set up, instead of typing variables into the Add Watch dialog, you can select them from
the macro list and view their status in the Watch window.
Simply select the entry you wish to watch and select the Add button.
22 Basic Concepts
PEWIN32 PRO Software Reference Manual
Editing Macros
Pewin32Pro’s watch table contains a full macro configuration utility. This will allow you to create, edit and
delete macros as well as save and load macro tables to disk.
These can then be selected from the list in the Add Watch Item dialog box. Selecting the Add or Edit
buttons will allow you to assign or change a Macro.
Specify a macro name and its corresponding PMAC command or variable. Pressing the Edit button will add
or change this macro definition in the macro list.
Selecting the Remove button will remove the currently highlighted macro definition. Remove All will clear
all the entries.
To display PLC or PMC macros in the Watch window, load the .tbl file (created when the PLC or PMC was
downloaded) by selecting the Load button. Select the appropriate file and press <ENTER>. Once a macro
table has been loaded, it name is displayed in the Add Watch dialog. Open the list box by clicking on the
small arrow button to the right of the command line to display a list of loaded macro definitions.
The Load and Save buttons prompt the user for a file and perform the specified operation.
Add Multiple Variables
A new interface Add Multiple Variables has been added to the Watch window. This adding more than one
variable in the watch window. It also allows you to add more than one macro variable to the watch window.
Basic Concepts 23
PEWIN32 PRO Software Reference Manual
Select the format the entry will be returned in. If you expect the response as a string (i.e. "TYPE"), Decimal
(i.e. RX0) or hex (i.e. "?").
Select the numerical display mode from the selection in the middle, and the number of bits of this entry to use
in the display.
The bit mask is used for a bitwise Boolean AND operation. The resulting value is displayed in the Watch
window. To show all bits (the whole number) set the mask to FFFF
If the Use Separator check box is selected, separators will break up the display. Binary numbers have
commas every four bits (nibble); decimal numbers have commas every 3 decimal places left of the decimal
point; hex numbers are separated by spaces every four places.
DPR Viewer
DPRAM viewer is a new screen. This shows the start address on the PMAC side as well as its equivalent PC
offset. This further allows you to display and change any location DPRAM from the computer side.
Note
DPR viewer is valid for ISA, PCI, USB and Ethernet modes of communication with
DPRAM available and configured mode only.
24 Basic Concepts
PEWIN32 PRO Software Reference Manual
Status Screens
The VIEW menu lets you view how programs, motors, coordinate systems, and global parameters and
connectors are organized and functioning in PMAC. Many of these allow you to monitor parameters in real-
time.
Connector Status
This option allows you to monitor the status of PMAC’s connectors. Currently, Pewin32PRO supports the
J2(JPAN), J3(JTHW), J5(JOPT), J7(JMACH2) and J8(JMACH1) connectors for PMAC1 style board and
J2(JTHW), J3(JIO) J9 thru J12 (JMACH) connectors for PMAC2 style boards. For PMAC Ultralite boards
only J2(JTHW) and J3(JIO) are supported. PEWIN automatically selects which connectors may be monitored
depending on the PMAC series.
When a selection from this dialog box is made and the OK button is pressed, the status window showing the
connector and its respective pins will be displayed. The colors of the pins change with the state of the pin,
TRUE or FALSE. Pins that are inaccessible through software are marked with an asterisk (*).
When a connector status window is highlighted, the main menu changes to:
Basic Concepts 25
PEWIN32 PRO Software Reference Manual
CONDENSE/EXPAND – Places the status window into condensed mode. In this mode only the pins and their
respective numbers are displayed.
BEEP ON CHANGE – When selected, the system will beep each time a parameter changes.
COLOR SETUP – This brings up the Status Colors dialog box, which allows changing the display colors used
in the current connector status window.
Select the colors you wish to use for True and False state displays.
26 Basic Concepts
PEWIN32 PRO Software Reference Manual
Motor Status
This display shows the interpretation of the status bits of the specified motor in real-time. This is done by
continually inquiring the PMAC for corresponding X and Y registers of each motor. The corresponding
registers are also displayed for each motor. True conditions are highlighted. The <PgUp>, <PgDn>,
<UpArrow>, and <DownArrow> keys allow you to select which motor to examine. This status screen is
equivalent to the “??” command at the terminal screen.
As of now, only full mode of display is provided. In future releases a custom status screen will be available
for the user to get any status bit of a motor or coordinate system in the same screen. This status screen is
equivalent to the “?” command at the terminal screen.
Coordinate Systems Status
This display shows the status of the specified coordinate system in the real-time fashion. This is done by
continually inquiring the PMAC for corresponding X and Y registers of each coordinate system.
Corresponding registers are also displayed for each coordinate system. True conditions are highlighted.
Pressing the <PgUp> or <PgDn> or the <UpArrow>, <DownArrow> keys changes the coordinate system
being examined.
As of now, only full mode of display is available. In future releases a custom status screen will be available
for the user to get any status bit of a motor or coordinate system in the same screen. Unlike Non-Turbo
PMACs’ coordinate system status (48-bit wide), Turbo PMACs need to be polled for three registers (72-bit
wide) in order to get the status of each coordinate system. This status screen is equivalent to the “??”
command at the terminal screen.
Basic Concepts 27
PEWIN32 PRO Software Reference Manual
Global Status
This display shows the Global status bits of the PMAC in real-time. This is done by continually inquiring the
PMAC for X:$3 and Y:$3 for Non-Turbo PMAC and X:$6 and Y:$6 for Turbo PMACs. True conditions are
highlighted.
As of now, only full mode of display is available. In future releases a custom status screen will be available
for the user to get any status bit of a motor, coordinate system or the global status bits of the PMAC in the
same screen. The global status screen is equivalent to the “???” command at the terminal screen.
Motor Setup Summary
This feature displays the configuration of the specified motor. This option reads key PMAC memory
locations and then displays the information in a meaningful way. The main parameter settings for the motor
are displayed. This screen can be helpful in determining problems when trying to servo a motor. To select a
particular motor, use the <PAGEUP> or <PAGEDOWN> key. <ESC> closes this screen.
28 Basic Concepts
PEWIN32 PRO Software Reference Manual
Basic Concepts 29
PEWIN32 PRO Software Reference Manual
30 Basic Concepts
PEWIN32 PRO Software Reference Manual
PMAC CONFIGURATION
I-Variables
At the heart of the PMAC’s configuration are its I-variables. These determine what makes a PMAC specific
to a given application. Because of the enormity of I-variables and their importance, we have developed two
interfaces for manipulating them. This manual shows the screens that would come up if you have a PMAC.
PMAC2 and other PMAC's should be detected and may have different screens.
Note
Changing I variables in these windows or in the terminal does not change the values
stored in PMAC’s non-volatile memory (EPROM or flash ram). You must use
PMAC’s SAVE command to permanently save the changed values.
I-Variables by Category
Selecting the by Category list-option will present the I variables separated by major categories. Which
categories are shown is dependent on the PMAC type.
PMAC Configuration 31
PEWIN32 PRO Software Reference Manual
For a PMAC-PC the categories and their respective windows will look like:
General I-Variables
Motor-Specific I-Variables
32 PMAC Configuration
PEWIN32 PRO Software Reference Manual
PMAC Configuration 33
PEWIN32 PRO Software Reference Manual
34 PMAC Configuration
PEWIN32 PRO Software Reference Manual
To move through the list, use the two arrow buttons on either side of the window or use the Go To button to
jump to a specific variable.
I-Variables MACRO
For an Ultralite PMAC if the MACRO station is connected and enabled then MACRO station’s I-variables
can be viewed and configured. MACRO I-variables are categorized as follows:
• General
• 4-Axis piggyback
• Node-specific
• Miscellaneous I/O
• 2-Axis piggyback
• CPU MACRO gate
All categories can be displayed and configured through this screen.
M, P and Q-Variables
This variable window behaves similarly to the I-variable window described above. It enables you to view and
easily change the value or definition of any of PMAC’s M-variables. It is your responsibility to format the
M-variables pointer properly. Refer to PMAC’s memory map for addresses to point to. A listing of
suggested M-variables pointers may be downloaded to PMAC by pressing the “Download Suggested M-
variables” button.
PMAC Configuration 35
PEWIN32 PRO Software Reference Manual
Coordinate Systems
This menu choice enables you to alter the currently defined coordinate systems, or define new ones. For
motors to move within motion programs, they must first be assigned to an axis within one (and only one) of
the eight (sixteen for Turbo) possible coordinate systems. Any motor may be assigned to any valid axis (X, Y,
Z, A, B, C, U, V, or W) or coordinate system, provided the motor has not been previously assigned to another
axis or defined in another coordinate system. To move from one coordinate system to the next, use the
<PgUp> and <PgDn> keys. Assignments are downloaded to PMAC's internal memory as you ADD and
REMOVE motors from the current axis definition window.
36 PMAC Configuration
PEWIN32 PRO Software Reference Manual
Add
This button adds the motor selected in the Available Motors window to the current axis definition window.
When you press this button, a dialog box opens where you can enter the axis definition for the motor before it
is added to the coordinate system.
View all Coordinate Systems
This option opens a window containing a list of all PMAC coordinate systems and their axis definitions. You
cannot edit the coordinate system definitions in this window, but you can print this information.
Done
This closes the Configure Coordinate Systems window. For Turbo PMAC systems, a message box may pop
up telling you the optimal setting for I68 (Maximum Coordinate System).
Encoder Conversion Table
This menu choice allows you to alter, update, save or retrieve the entries of the encoder conversion table.
You will need to alter this table in order to use various types of feedback devices other than the default 1/T
Conversion that typically is used for incremental encoders. Each feedback device will have an entry in the
table for which PMAC will process every servo period. In order for PMAC to interpret a particular feedback
device correctly, the raw data must be converted to the proper format. The choices within this dialog box
enable the user to change the conversion process easily, without getting into any meticulous details. Refer to
the PMAC User's Manual for specific information on how to edit the conversion table manually (i.e. using
PMAC memory read and write commands) or the help menu.
The table entries may be scrolled through using <PgUp> or <PgDn>. Alter the conversion method by
selecting one of the conversion types. To change the encoder source address, type a new address or select the
one from the pull-down list. To leave the conversion table editing without making any changes in PMAC
select DONE or press <ESC>. To update the modified encoder table entry, press the Download Entry
button.
PMAC Configuration 37
PEWIN32 PRO Software Reference Manual
Entry Number
This field contains the number of the encoder conversion table entry currently being viewed. Use the up and
down buttons or <PgUp> and <PgDn> to step through the encoder conversion tables. There are 256
possible table entries.
Entry, Source and Processed Data Addresses
The Entry Address is for informational purposes only. It tells where within PMAC’s memory this Encoder
Conversion table entry is located. As you may notice by scrolling through the entries, PMAC’s Encoder table
entries are in a contiguous block of memory.
The Source Address tells PMAC where in its memory is the raw data to use in the conversion process. You
can choose from the drop down list, or you may type in your own address. Typically, this address can be
found by reading the manual specific to the type of feedback being used.
Finally, the Processed Data Address is where PMAC stores the result of the conversion calculations. This
location is useful because it is needed to configure other features in PMAC (i.e. Master Position Feedback
address Ix03, Electronic gearing Ix05, etc.), typically by setting I variables.
Conversion Type
This field contains the conversion type for the current entry. Select this entry and press <ENTER> or click on
the down arrow to the right of this field to view a list of common conversion types. You can select a
conversion type from this list using a mouse or the keyboard arrow keys. If you need to use a conversion type
not shown in this list, you will have to enter the data manually from the terminal. Refer to the section entitled
"Encoder Conversion Table" in the PMAC User's Manual for help with this process.
38 PMAC Configuration
PEWIN32 PRO Software Reference Manual
PMAC Configuration 39
PEWIN32 PRO Software Reference Manual
hex (filtered parallel data), the size entry would be in Y:$721, and the maximum change entry would be in
Y:$722 hex. The converted data would be placed in X:$722 hex. If this were the position feedback for motor
#1, Ix03 would be set to $722 hex (1826 decimal).
Note
The parallel data word from a laser interferometer is not true absolute position
information, because the interferometer is fundamentally an incremental sensor. For
this arrangement, there is no need to wire more than 19 bits of data to the ACC-14 (in
fact, 16 bits is sufficient). Position reference is established by a homing procedure, and
full range is achieved by using rollover to extend the range of the count in software.
Filter-Max Change
The parallel data word filter simply sets a maximum amount the data word is permitted to change in a single
servo cycle. This value should be entered in the filter box in hex. If PMAC sees a change larger than this in
the source data word, the converted data only changes by the maximum amount. There is no permanent loss
of position information if the filter "kicks in." This filtering permits protection against spurious changes on
high-order data lines, while not delaying legitimate changes at all. This maximum amount is the third setup
entry for the encoder in the Y-memory portion of the conversion table. It should be set slightly greater than
the maximum actual velocity expected on the sensor.
Time Base
A time-base conversion is a scaled digital differentiation. Every servo cycle, it calculates the difference
between the value of the source register for this cycle and the value for the last cycle, and multiplies the
difference by the scale factor. The scale factor can be entered under the Bit Enable/Time Base input box.
The most common use for the resulting value is for the time-base (feedrate override) control, which makes the
speed of PMAC execution proportional to an external frequency (usually the speed of a master device).
Triggered Time Base
This is similar to the time base conversion described above, but with the added feature of synchronizing time
base following upon a hardware trigger. Refer to the PMAC User's Manual for further reference.
Inc with Parallel Ext
Short for "Incremental Encoder with Parallel Extension." Those who have set up to use the parallel sub-count
interpolation for incremental feedback would use this option. In this case, the source address must be one of
the odd-numbered encoders. A typical source address would be $C010, which provides parallel extension
(i.e. interpolation) of encoder #5 counter using encoder #6's flags.
Inc without Parallel Ext
Short for "Incremental Encoder without Parallel Extension." Those who have set up to use the parallel
incremental feedback without interpolation would use this option.
Summing Table Entries to Another
For Turbo PMAC’s select the Summing of Conversion Table Entries for the conversion type. Turbo allows
several options when using this conversion type. You may choose to add a table entry to it by disabling the
second entry. In addition, either you can negate the first, second or both table items to be summed. Lastly,
you may optionally integrate (summation of the results) the results.
For non-Turbo PMAC’s choose the Add with Previous Entry option. This will result in the sum of this
entry and the previous entry in the table. Setting this option to Additive in entry number 3 for instance, would
result in the summation of entry 2 and entry 3 at the address of location 3. This permits the servo feedback to
sum two sensors. (If the polarity of the sensors or their counters is opposite, this provides the difference of
the sensors. This can be useful for Doppler-type sensors, where the reference wave and the shifted-frequency
40 PMAC Configuration
PEWIN32 PRO Software Reference Manual
wave are fed into different counters, one counting up, the other counting down; summing the two counters
provides position.)
Bits Enabled Mask
This field contains a scale factor used when the appropriate bit is enabled. The most common use for the
resulting value is for the time-base (feedrate override) control, which makes the speed of PMAC execution
proportional to an external frequency (usually the speed of a master device).
Max Change
This limits the magnitude that the input value is allowed to change between scans.
Conversion Shifting of Parallel Data
If you want to have fractional parts of the position or you have a MACRO station base system then you have
to specify that in the conversion shifting of parallel data.
Encoder Conversion Table MACRO
For an Ultralite PMAC with MACRO station enabled this menu allows you to alter, update, save or retrieve
the entries of the encoder conversion table for MACRO station. Conversion types are similar to the main
Encoder conversion table.
PMAC Configuration 41
PEWIN32 PRO Software Reference Manual
42 PMAC Configuration
PEWIN32 PRO Software Reference Manual
ADVANCED FEATURES
EditorPro
Introduction
EditorPro is Pewin32Pro’s text editor used for writing PMAC programs. To open a file for editing, use the
File menu’s New or Open. This editor has many features, which include:
• PLC Debugger
• Syntax highlighting
• Auto indenting
• Auto correcting
• Popup debugger window
• Error Tracing during PMAC download
Advanced Features 43
PEWIN32 PRO Software Reference Manual
In addition to the above features, there is a status bar on the bottom of the EditorPro window. The first
column of the status bar shows the current row and column of the cursor. The second column shows if this
text file has been modified, and the third column shows the full name of the active file. Every active window
has its own specific name, which is the name of the opened file. EditorPro does not allow you to open two
files with the same name and path. If you try to open the same file twice, the Editor Pro will give you a
message asking if you would want to replace the opened file with the one you are trying to open.
If you select yes the contents of the opened file will be replaced with the one you are trying to open.
Syntax Highlighting
In the EditorPro, all the known variables, keywords, and commands have a separate color, and separate font
style. All items including font colors, size, and the styles could be customized in the Setup window. The
setup window can be accessed from the Editor menu.
Auto Indenting
Indenting is a useful tool for keeping track of the beginning and ending point of the loops or conditions in the
PMAC programs. For example, the code block below does not have any indenting.
If(p1=0)
P1=P1+1
If(p2=0)
P2=P1+1
If(p3=0)
P3=P3+1
EndIf
EndIf
EndIf
44 Advanced Features
PEWIN32 PRO Software Reference Manual
However, once reformatted with indentation the same code looks like:
If(p1=0)
P1=P1+1
If(p2=0)
P2=P1+1
If(p3=0)
P3=P3+1
EndIf
EndIf
EndIf
As you can see, the code with the indenting is easier to understand. The auto indenting property can be turned
on or off in the setup window.
Auto Correction
Auto correction corrects every line of code that you type in the EditorPro and enforces correct PMAC coding
syntax. It modifies only the IF, WHILE, and ELSEIF conditions. Auto correction will not change the size,
and style of your fonts (Except If and While and ElseIf). For example, the following code:
if((p1=1 and p3=0)or m1=0)
p1=100
end if
will be modified as:
If ((p1 = 1 And p3 = 0) Or m1 = 0)
p1=100
EndIf
Popup Debugger Window
One of the more useful tools of the EditorPro is the popup debugger window..
When you double click on any variable inside your programs, this window will pop up and give you the value
of that variable. If you are double clicking on an M variable, it will give you the value and the definition of
that M variable. In addition, if the variable is a macro, then it will show you the macro definition too. For
example, look at the following code.
Advanced Features 45
PEWIN32 PRO Software Reference Manual
When you double click on the P1, the popup window will appear, and you will get the value of the p1.
When you double click on the Macro definition Machine_Output_1, you will get.
Additionally, you can update the variable at real time by using Popup window. By clicking on the Blue arrow
on the top right corner of this window, you could check the update check box, and the value of the selected
variable will be updated at real time. In addition, you could change the update rate.
46 Advanced Features
PEWIN32 PRO Software Reference Manual
One other feature of the popup window is that you can change the value of the selected variable. Simply
change the value and click on the Apply Changes button.
Error Tracing
The EditorPro keeps track of the errors during the download operation. If there are any errors during the
download, the errors will show up in the message window. When you double click on the errors, the error
line in the EditorPro will be highlighted.
For example, when you double click on the error the line of code which has caused this error will be brought
into view and highlighted.
Advanced Features 47
PEWIN32 PRO Software Reference Manual
Editor Menu
The following is the editor menu. To open the editor menu, select the editor from the main menu, or right
click in the editor. There is another static menu on top of the EditorPro window, which links to some of the
functions in the editor menu. In addition, some of the items in the editor menu have shortcut keys.
• Open Source/Header File (Ctrl+H): If there are any header files included in your program, clicking on
this menu item will open the header file. If the file that you are working on is not a header file, and there
are no header files included in that program, then Editor Pro will create a new header file with the same
name of the file, but with an extension of .H. However, before it creates the file it will ask you if you
want to save and include the newly created header file in your program.
If you select yes, EditorPro will include the header file in your main program automatically, and will save it
as well.
If the file that you are working on is a header file with an extension .H, then EditorPro will try to open a file
with the same name but with a different extension. For example, if the header file name is Sample Program.h
then it will try to open the file Sample Program.pmc or with any other extension. If the file does not exist,
then the following window will appear.
48 Advanced Features
PEWIN32 PRO Software Reference Manual
This window allows you to create a file for the header file, with the same name and different extension.
When you click on the Apply button, Editor Pro will create the new file for you and will ask the following
question
If you click on Yes, the new file will be saved, and the header file will be included in the newly created file.
• Open File At Cursor: If you have included any header file in the main program, you can put the cursor
on that line, and it will open the file for you. Generally the line is of the form #Include ”FileName.”
• Close(Ctrl+Del): This closes the active window (Active tab).
• Close All: This closes all the windows.
• Include: Include prompts you with an open dialog box, from which you can select the filename that you
wish to be included in your program.
• Find(Ctrl+F): This allows you to search for any word in the program.
Advanced Features 49
PEWIN32 PRO Software Reference Manual
• Save(Ctrl+S): Saves the contents of the active window (Active Tab). If the file does not exist, then
the Save As function will be executed.
• Save As: Allows you to save any file under a different name.
• Print(Ctrl+P): Prints the contents of the active window. It can also print any selected text.
• Setup: Opens the Setup Window.
Select PMAC: Allows you to select a different PMAC device for the active window. Every window (Tab)
of the EditorPro can have a different PMAC device.
Setup Window
In the setup window, you can change the general, font, and font color settings of the EditorPro. In addition,
the setting of variables for Debugger is done in the setup window.
• Change the font name and font size of the whole Editor window.
• Change the font styles for every defined variable that is included in the list box. To change the font style,
select an item from the list of variables and select one of the Bold, Italic, or None font styles.
50 Advanced Features
PEWIN32 PRO Software Reference Manual
Every time you change a setting of a variable, the change will be reflected in the following window, so you
can see the changes before applying the modified settings.
In the color setup, you can change the colors of the variables provided in the variable list. To change the
color of any item, select the item from the list and click on the Change the Color button. The Select a Color
dialog box will appear, and you can select your desired color.
Advanced Features 51
PEWIN32 PRO Software Reference Manual
In addition, you can select the Only Black and White check box, and it will convert the colors of all the
variables to black. As explained in above, all the changes will be reflected immediately in the sample
window provided in setup window, so you can see the changes before applying them.
A Set the defaults button is provided in the Setup window, which will reset the settings for the EditorPro
window to the defaults. Please notice that Set the defaults button will set only the default values of the
selected tab in the setup window. To set default values for all the settings, click on and reset each tab
individually.
Debugger
Introduction
Debugger is used to debug the PLC programs at run time by putting the break points on the desired lines or by
stepping through the program.
52 Advanced Features
PEWIN32 PRO Software Reference Manual
The following is an example of how to use the debugger. Our example is based on the following plc.
p1=0
Open Plc1 Clear
p1=p1+1
If (P1 > 1000)
If (M1 = 0)
M1 = 1
Else
M1 = 0
EndIf
P1 = 0
EndIf
close
Click on the Run button or press F5 to start the debugger. The debugger will first download the PLC
program to make sure there are no errors in the program. If there are no errors in the program, then the
debugger will ask you to set some P or M variables which are going to be used in the debugger.
When you click YES on the message window, the debugger will display the popup setup window so you can
select and add the desired variables that are going to be used by the debugger.
Advanced Features 53
PEWIN32 PRO Software Reference Manual
In the middle of the setup window, there is a highlighted message showing the number of variables that need
to be selected. Select the desired variables and click Add. They are added to the list. After adding the
variables, click on the Apply button.
Then the debugger will show the variables that are being used.
When you click on Yes, the debugger creates the debug mode program and downloads it to the PMAC; and
finally it enables the program.
54 Advanced Features
PEWIN32 PRO Software Reference Manual
To Pause through the program, click on the Pause button (F6). By clicking on this button, the line that the
PMAC is running in the program will be highlighted. To go to the next line that PMAC will execute, click on
the Step button (F7). PMAC will execute a line with every click of the Step button.
You could also put a breakpoint on any line of the program. The program will stop on any line containing a
breakpoint. To put the breakpoint on a line, click on that line and click on the Breakpoint button (F9).
Advanced Features 55
PEWIN32 PRO Software Reference Manual
After satisfying the conditions within the PLC, the program will stop on the line on which we put a
breakpoint.
To stop the execution of the program, click on the Stop button (F8).
Important Notes
• The debugger modifies your original program and then downloads this modified (enlarged) version to the
PMAC. You need to replace this enlarged version with your original program that debugger has
corrected or verified. Therefore, download your original program after debugger has finished with it.
• Do not disable the PLC program from terminal window, while in the debug mode. To stop the program,
click on the stop button.
• Do not put DISABPLEPLC commands in the PLC program; it will crash the debug mode operation.
• PLC debugger is designed to debug one PLC program at a time.
56 Advanced Features
PEWIN32 PRO Software Reference Manual
Resource Manager
Introduction
Resource manager is a tool for managing all the PMAC macro variables within a project defined in the project
manager.
Advanced Features 57
PEWIN32 PRO Software Reference Manual
If the project contains any program with duplicate definitions, the following form will popup, allowing you to
select the definitions that you wish to be used in the Resource Manager.
The Duplicate key names window has two columns. The left column lists all the duplicate key names within
the selected project. The right column shows the macro definitions for the selected key name from the left
column. Location shows the file location of the definition. In the Duplicate key names window, you can
select the desired macro name for the selected key. To select the macro name, click on a key name. The
macro column will show the macro names defined for the selected key name. Just select the desired macro
name to associate the key name with the selected macro name. You could go through all the key names.
After the selection, click on Apply to include the filtered definitions in the Resource Manager. If you wish
not to include any of the definitions, click on Cancel. In addition, the duplicate window is a warning that
tells you that within the same project there has been multiple key names defined for the same macro name.
After clicking on the apply or cancel button the resource manager window will appear on the PEWIN32PRO
window. If there are PMAC variables that have been used more than once for different key names, the
Resource Manager will show a warning message, indicating which variable type has been used more than
once within a project. Thereafter, Resource Manager will highlight the variables. If there are multiple
variables used for different keys, the following message will pop up.
The above message will give the type of variables in which there are inconsistencies. To check the variables,
click on the appropriate tab in the Resource Manager. Click on OK if the above message appeared; the
Resource Manager window will be activated.
58 Advanced Features
PEWIN32 PRO Software Reference Manual
Since there have been some inconsistencies in the P and M variables we will click on P variables to see the
highlighted variables.
Resource Manager creates five tabs. The first tab shows all the macro variables, the second tab shows the P
variables, the third tab shows the M variables, the fourth tab shows the I variables, and the fifth tab shows the
Q variables. On the bottom of the page, it shows the number of variables being used in the selected project.
Advanced Features 59
PEWIN32 PRO Software Reference Manual
Active Project
Active Project is the project that the last Resource Manager was created for. The last resource manager will
show the active project when the Pewin32PRO is re-launched. The active project is always visible in the
bottom of the Project Manager pane.
60 Advanced Features
PEWIN32 PRO Software Reference Manual
You do not need to use CTRL+ALT+A every time you want to use this feature; you could also type the key in
the command area. However, every time you create a new Resource Manager, you should reload the new
table by using CTRL+ALT+A.
Using Resource Manager in the EditorPRO
Resource Manager allows you to use your definitions within the EditorPRO. This means that you do not need
to type the key names in the editor window; instead, you could use the definition that are created in the project
and included in the Resource Manager. To use this feature go to the editor window and press
CTRL+ALT+A simultaneously on any line that you wish to include the definition. A list box including all
the key names within the project manager will pop up at the cursor location. Select the desired key name, or
type it and then press enter. When you press enter, the key name will be placed in the editor window. A
message will pop up, asking you to include the file name for the file in which the definition has been
included.
Advanced Features 61
PEWIN32 PRO Software Reference Manual
When you select Yes in the message window, the editor will include the file name in the first line of the
program.
Important Notes
• Key names in the Resource Manager are unique. You cannot have more than two identical key names
with different macro definitions.
• Macro names are not unique. You can have more than one definition for the same macro name. For
example, M101 can be defined as Output_1 and On_Off_Switch.
62 Advanced Features
PEWIN32 PRO Software Reference Manual
CONFIGURATION FILES
Backup and Restore PMAC Configuration Files
The BACKUP menu options let you save, restore, and verify all or part of PMAC's configuration.
Upload Configuration
This menu item enables you to upload any combination of motion programs, PLC programs, I, P, Q, and M-
variable values, M-variable definitions, custom servo algorithms, other important memory locations,
leadscrew compensation tables, and coordinate system definitions and save them to disk. Items selected will
be uploaded and written to an ASCII file when you press the OK button. This file serves as a backup for
safety reasons and may be used to duplicate configurations on other similar PMAC cards.
Note
PLCC's are firmware specific. Therefore, a configuration file that uses PLCCs is only
valid for that type and version of PMAC.
Restore Configuration
This option is used to restore the contents of a backup file (created with the Save Configuration option) to
PMAC. The file is simply downloaded to PMAC. Therefore, you may also use the FILE\DOWNLOAD FILE
menu item.
Verify PMAC Configuration
This feature allows you to compare the contents of any previously uploaded configuration file with the
contents in PMAC's memory. It provides a good way to validate the backup file created by the UPLOAD
CONFIGRATION option described above.
Note
You may validate only files that have no #include statements, which means files
backed up using the Single Backup File option.
Configuration Files 65
PEWIN32 PRO Software Reference Manual
66 Configuration Files
PEWIN32 PRO Software Reference Manual
GENERAL SETUP AND OPTIONS – Sets default values for various Pewin32PRO displays.
• Default Device: If you have more than one PMAC in your system, the selection of a default device will
be important because the Pewin32Pro application can anticipate what device to use when opening up a
new dialog box. You may also have the Pewin32Pro ask you for the device number every time you open
a new dialog box.
• General: Here you may tell Pewin32Pro whether to save settings upon exiting the application. Settings
include window placement.
• Download: There are five different download options available. These selections have been centralized
here.
• View: The Project Manager and Message window can be toggled off and on within this tab.
FORCE ALL WINDOWS TO DEVICE NUMBER – Forces all windows to communicate to a specific device
number. It further, updates the workspace to use the new device number for any new window.
SHOW MESSAGE WINDOW – Displays the Message window.
SHOW PROJECT MANAGER –Displays the Project Manger window.
PEWIN32PRO HELP
Pewin32Pro Manual
From the help menu choose contents to view this document in help format. Alternatively, pressing F1 will do
the same in addition to locating context sensitive information.
Driver Installation Notes
This Adobe Acrobat format document provides details of all driver installations and is a great tool for
troubleshooting any communication or other configuration issues. It gives a detailed procedure for Firmware
downloads.
Why am I Not Moving?
This menu choice can save you many hours of searching and frustration in tracking down problems associated
with running a motor – especially if you are new to PMAC. You may run into a condition in which a motor
simply will not run, despite you're being sure that all the parameters have been set properly. This menu
option will look at your configuration and cite possible (warnings) or definite causes of problems preventing
you from running your motor(s). To use this self-diagnostic feature, you must specify a particular motor.
Why is my Program Not Running?
This menu choice can also save you many hours of searching and frustration in tracking down problems
associated with running the program. You may run into the condition in which a program simply will not run,
despite you're being sure that all the parameters have been set properly. This menu option looks at your
configuration, and cites possible or definite causes of problems preventing you from running your motion
program(s). To use this self-diagnostic feature, you must specify a particular coordinate system.
Help 69
PEWIN32 PRO Software Reference Manual
70 Help
PEWIN32 PRO Software Reference Manual
Appendix B 71
PEWIN32 PRO Software Reference Manual
72 Appendix A
PEWIN32 PRO Software Reference Manual
If you suspect that this may be the problem, check what your servo update rate is. First, calculate it from the
master clock frequency and the settings of jumpers E98, E29-E33, and E3-E6. Second, confirm the frequency
setting by probing with an oscilloscope the SERVO clock signal on the serial port connector. If it is true that
the servo clock frequency is too fast for the number of activated motors you want, you will need to slow down
the servo clock by changing jumper settings before re-activating all of your motors.
If the servo update frequency does not appear to be the problem, a PLC program probably is. Re-initialization
solves this problem by setting I5 to 0, not permitting any PLC programs to run. PLC 0, which runs as an RTI
task, is the most likely culprit, because it can starve the background tasks for time, preventing the
housekeeping routine from resetting the timer register. If you suspect PLC 0, you can delete it now (OPEN
PLC 0 CLEAR CLOSE), turn off power, change E51 back to its default setting, and turn power back on. If
the watchdog does not trip, you have confirmed that the PLC 0 was the problem.
In general, PLC 0 should be kept very short, and usually the shorter the better. PMAC will execute an
enabled PLC 0 every RTI, unless it has not finished the RTI tasks (PLC 0 and motion program) that it started
in a previous RTI cycle. If a given PLC 0 takes 95% of the time available for it in one RTI cycle, all of the
background tasks put together have to run in the remaining 5%, which may not let them keep the watchdog
timer happy. Shortening the PLC 0 slightly, so that it only takes 85% of available RTI time, would allow
background tasks to run 3 times faster, because they would now have 15% of available time. However,
lengthening the PLC 0 slightly, so that it takes 105% of the time available in a single RTI cycle, would cause
it to execute only every other RTI cycle, and leave the majority of the second cycle available for background
time.
For a background PLC program (PLC 1 to 31) to cause a watchdog failure, it must be extremely long --
probably thousands of lines long, unless it has virtually no time to execute, in which case the real problem is a
higher priority task. In general, however, if you have a lot of PLC code, it is better to split it up into several
separate PLC programs, because other background tasks, such as communications response and safety checks,
will operate more often.
Intermittent Problems: If simply resetting the card without re-initializing it causes the card to operate
without immediately tripping the watchdog timer, you have an intermittent problem, in either hardware or
software. As we all know from trying to show a car's problem to a mechanic, intermittent problems can be
much more difficult to track down.
The key in finding an intermittent problem is identifying the pattern of failure. One of the questions to ask
yourself is, "What has changed since the system worked?” Try changing things back to the way they were
before you were getting the failure.
Many of the possible causes of intermittent watchdog failure are fundamentally the same as the constant-
problem causes listed above, but only occurring on occasion. For example, a power supply may provide
inadequate voltage only when other components draw a heavy load. An important electrical contact may fail
intermittently. A PMAC program may take too much time only when it is in a particular section or logical
branch.
If a failure occurs repeatedly in the same section of operation of the system, the cause is probably a software
time problem (unless this section cuts the supply voltage by drawing increased load). Find out what is special
about the software at this point. For instance, maybe PLC 0 had been disabled, and the watchdog tripped
when PLC 0 was enabled. Alternately, maybe PLC 0 had been passing over most of its calculations because
of the conditional branch it was taking, but the card failed when the condition changed.
Although it is very rare for a motion program to cause a watchdog failure, this does happen on occasion. It is
important to understand how the motion program executes. When a Run command is given, and every time
the actual execution of programmed moves progresses into a new move, a flag is set saying it is time to do
more calculations in the motion program for that coordinate system. At the next RTI, if this flag is set,
Appendix B 73
PEWIN32 PRO Software Reference Manual
PMAC will start working through the motion program. Program calculations will continue (which means no
background tasks will be executed) until one of the following conditions occurs:
1. The next move or dwell is found and calculated.
2. End of, or halt to the program (e.g. STOP) is encountered.
3. Two jumps backward in the program (from ENDWHILE or GOTO) are done.
4. A WAIT statement is encountered (usually in a WHILE loop).
If calculations stop on condition 1 or 2, the calculation flag is cleared, and will not be set again until actual
motion progresses into the next move (1) or a new Run command is given (2). If calculations stop on
conditions 3 or 4, the flag remains set, so calculations will resume at the next RTI. In these cases, where you
have an "empty" (no-motion) loop, the motion program acts much like a PLC 0 during this period. These
empty loops, which are usually used to wait for a certain condition, provide very fast response to the change
in condition, but their fast repetition occupies a lot of CPU time, and can starve the background tasks for time.
Particularly if several coordinate systems are executing empty loops at the same time, you can run into serious
background time limitations, which can be severe enough to trip the watchdog timer.
If there are a huge number of lines of intensive calculations (e.g. 100) before any move or dwell is
encountered, there can be such a long time before background calculations are resumed (more than 512 RTI
cycles) it is possible to trip the watchdog timer. If this problem occurs, the calculations should be split apart
with short DWELL commands to give other tasks time to execute.
74 Appendix A
PEWIN32 PRO Software Reference Manual
Appendix B 75
PEWIN32 PRO Software Reference Manual
76 Appendix B
PEWIN32 PRO Software Reference Manual
INDEX
Index 77