Документ взят из кэша поисковой машины. Адрес оригинального документа : http://www.naic.edu/~phil/hardware/vertex/hagenDocmemos/debug.txt
Дата изменения: Wed May 8 18:25:12 2002
Дата индексирования: Thu Jan 15 02:45:19 2009
Кодировка:

Поисковые слова: m 103
NOTES ADDED 12-12-01
REGARDING (mostly) TEST FEATURES OF THE STEP 5 SYSTEM

1. You can edit code in the PLC and also load this edited code
while the PLC is running. (Doesn't have to be stopped). Note:
when you have finished making changes to the code, you will have
some difficulty making the system swallow it. Until the system
has come up with the prompt "Overwrite code in PLC" you're not there.
Be persistant with "enter" and "save" and after a few rejections,
you'll get the desired "Overwrite...." prompt.

2. STATUS VARIABLE DISLAY
You set up this screen with a list of the variables you wish to
monitor. After entering this list (or modifying it) always hit SAVE
so that the list will reappear the next time you enter this screen.
Note: besides saving the default list, you can use SAVE AS to create
multiple lists.

Once the list is entered, you ACTIVATE it with the mouse or
the INSERT (Ins) key. You will then see the values of the variables.
If the program is running, you can watch the variables as they change,
counters countings, etc. (Dynamic display).

If you have gone to this screen after hitting a breakpoint with
"program test", you will see the frozen values of the variables at the
break point.

You can also display a "FIELD" by hitting F4 and then
filling in the command line.

Editing the variable list: To edit, you must have the menu bar
visible at the bottom of the screen, i.e. the status display must
be interupped. To interrupt the display, hit ESC.
Ordinary key strokes, up and down arrows, and Enter all work in
conventional fashion to edit the variable list.

Example: to monitor DD7 of DB11, make an entry "DB11", hit return,
then enter DD7. In our Step 5 program, the contents of this location
are incremented every second by OB16, the 1-sec interrupt routine.
(Our OB16 does this and nothing else). After a warm restart by
toggling the front panel run switch, you will see the frozen old value.
This will be replaced by a zero, and then begin incrementing. Note:
if the initialization routine has trouble, i.e. in establishing
communication with the CP581, it will time out in 90 seconds and
then DD7 will begin to increment.

3. ISTACK DISPLAY (interrupt stack)

You can select this display with the program not running or running.
This seems not to be a dynamic display, but rather reflects various
control conditions, past and present, that were valid at the time the
display was selected. Use the mouse to click on any
symbol. The meaning of that symbol will be displayed at the bottom
of the screen. A red X below a symbol indicates a selected or
existing condition. Examples: that the last restart was a warm
restart; that the last restart was a cold restart; that the program
is running in cyclic mode; that the processor is stopped.....

But what about the interrupt stack?? If the cpu is stopped, you can
hit "INSERT", and the status display will be replaced by the stack of
nested interrupts that were active when STOP occurred. (See page
5-21 of the CPU 928B Version 3Ub1 Programming Guide).

4. BLOCK STATUS DISPLAY (dynamic display of processing within a block)
This
STEP5 EDITING HINTS
JBH 9-28-00

The STEP5/PC development system makes editing quite awkward.
This may be due, in part, to our use of a standard PC rather
than the Siemens custom Programmer PC. Getting around the
menus from one field to another is sometimes difficult, but
not as difficult as editing a field, once you are there. The
editor essentially gives you no prompts. You have to know what
can be entered. A non-acceptable entry, followed by RETURN will
often cause the entry to be erased - purged! Or you may be
answered with a cryptic error message, perhaps "Error No. XX"
for which there seems to be no written key or online help.

Reasons why your entry may not be acceptable:

1. You have used an instruction that is ok in an FB, but not
allowed in an OB or PB.

2. You have written JU FBxx but you have not filled the rest
of this function call: the name of the Fb and the argument list
(which is *** in the case of no arguments).


Comments: Three types of comment can appear in your program:
statement comments, segment comments, and symbolic comments.

Statement comments are those that you enter while editing the
program. They appear to the right of the statement. (See below
for how to access the comment field to enter a comment).

Segment comments form headings for program segments. They are also
entered while using the editor.

Symbol comments are those that have been entered in the
"assignments" file. Suppose that, in the symbols table, you have
assigned the symbol "pwrflag to F10.1, along with a comment
"pwrflag is for the dc supply". In your program, any line that
refers to the F10.0 or "pwrflag" will cause the comment in
the assignent file to appear in your program file. A function key
in the editor allows the editing screen to display either symbol
comments or statement comments, but not both. A print-out of the
program, however, can contain both. The function key, Shift F4,
actually cycles through three options: statement and segment
comments are displayed, symbol and segment comments are displayed,
and no comments are displayed.

It is tricky to enter statement comments. As you edit a line of code,
you must move the cursor to the extreme right side of the operand
field, using the space bar or the tab key. Once you are at the far
right of this field, hit the space bar and you will be at the
beginning of the comment field.

Labels on statments: To jump around in the code, you need
statements such as "JU =CAT". Here, "CAT" is a label on another
statement, e.g. "CAT :A -PWRFLAG" Note that the jump statemnt
must refer to CAT as "=CAT". Note also the dash before "PWRFLAG";
without the dash, the system doesn't have enough sense to look
for an otherwise unidentified symbol in its symbol table.

Shift F3 puts the editor in symbol mode or absolute mode. These are
display options. If you switch to symbol mode, every "F10.0" on
the screen will become "-PWRFLAG". If you switch back to absolute
mode, evern "-PWRFLAG" will change to "f10.0". If you are in
symbol mode and you enter "F10.0", as soon as you enter that line,
the "F10.0" will change to "-PWRFLAG".

Note that you can use the Function keys in the editor to get into
the symbol table - rather than leaving the program to edit the
symbol table and then getting back into the program editor.

To edit a program block. Invoke the editor. Put cursor on line to be
edited. Softkey "edit". Make changes. "enter" - maybe three times.


DEALING WITH THE PROMMER (prom burner)
The Siemens PROM burner came with a software disk "STEP4/ST/PC-PAKET
1.00 ERW.EXT.PROMMER 1/1 as well as a small multilingual manual. The
manual contains instructions for installing the software. However,
it seems that our PC version of STEP5 contains the necessary
software. The prommer works without further software, and , in fact,
the software on the disk refuses to install.

As with the editor, the prompts and keystrokes for PROM operations
are not obvious. One invokes these functions from the main
STEP5 menu's "Management" submenu and "EPROMS" sub-submenu. This
takes you to a screen on which two parameters can be entered or
changed amd then entered. The top parameter should be left as
"WORD", which always the correct response for our S135 system.
The second parameter sets the checksum to "YES" or "NO". A YES must
cause the checksum to be generated and transferred to the PROM as a
data word. A NO probably results in a zero or some more unique
word to be written in the checksum loacation. When the EPROM is
read by the PLC, the PLC calculates the checksum of the incoming data
and compares it to the included checksum. If the included checsum
is "no check sum", the PLC can simply say ok, as if the checksum had
been valid. (Why would one ever turn off the checksum option?).

The other fields on this first PROMMER screen cannot be changed here;
they have been set earlier on page 1 and/or page2 of Settings. Afer
being sure that WORD is selected and checksum is YES, hit F6. All that
changes on the screen is the softkey description at the bottom.
When the "BLOW" function is selected, a screen appears asking for
two parameters. The first,B, is for block. Type A for all and hit enter.
The cursor moves to the PRT field (printer). Leave this field blank
if you don't want to print and exit by hitting the "Insert" key on the
PC. When you are prompted for PROGRAM NUMBER, type 500 if you are
dealing with a FLASH card. Enter the 500 by hitting the "Insert" key
or with a left mouse click. As is often the case, this is not enough;
you have to also hit Insert again , or maybe even 500 Insert Insert.
The lower light (yellow) on the PROMMER will first blink - probably
when the "500 Program" is being downloaded. It will light continuously
while the module is being DELETED (erased) or BURNED (programmed).

How to install the module in the PLC. Simply push the module into its
slot. Then clear the RAM by using STEP5 BLOCKS, DELETE, IN THE PLC,
ALL, OVERALL RESET. The delete erases the ram and the overall reset
causes the contents of the module to be loaded into the ram.

Manual procedure for reloading the RAM from the module. (Not as
foolproof as the STEP5 procedure described above). Suppose the module is installed and its
contents are present in the RAM.

Switch the top switch to the downward position, STOP.
Press the RESET button upward to RESET and hold it there for 5 seconds.
Press the RESET button downward to OVERALL RESET and hold it there.
Switch the RUN switch up and the down.
Release the lower switch.
Repeat the procedure at least once.


Manuyal procedure to erase the RAM:
Pull the module out of its socket. (As long as the module remains plugged
in, you cannot erase the RAM).

Clear the memory as follows:

Switch the top switch to the downward position, STOP.
Press the RESET button upward to RESET and hold it there for 5 seconds.
Press the RESET button downward to OVERALL RESET and hold it there.
After about 5 seconds, switch the RUN switch up.
After another 5 seconds, switch the RUN swith down.
After another 5 seconds, release the lower switch.


plc error: attempting to set or reset q0.0 when the digital output card is
not present results in an error
that stops the PLC. In this case a warm restart jumps past the error
and the (test) program finishes its 5-sec timeout and stops. Another
warm restart doesnt start it againl, since it has finished and is
awaiting a start via OB20 or OB21. Give it a regular cold start and
it encounters the error and immedately hangs again. Then another warm
start again pushes it past the error and lets the program run its
alloted course.

The lamp blinking program, when eventually successful, showed that
the digital output board must be plugged in at the time the PLC crate
is powered up (manuals do mention this) but that no external power
need be applied to the board (except to work the LEDs) and no DB1
need be written and entered.


2-27-01
Siemens manual gives procedure for overall reset which
usually does not work. Here is a procedure discovered by Luis
Murray, which seems to work:

1. Set the top swich to STOP.
2. Push the bottom switch down (OVERALL RESET) and, while holding
it down, lift the upper switch to RUN.
3. Push the bottom switch up momentarily to RESET
4 Set the top switch to STOP
5 Lift the bottom switch to RESET and, while holding it up,
lift the upper switch to RUN.
6 mRelease the bottom switch.

Better Procedure for overall reset: from Notes given to Jorge during
Siemens course:

Start in the STOP position
Hold the Reset swith down
Toggle the RUN/STOP switch twice (note: twice!)
Hold the reset switch up
Place Run/Stop switch to "RUN"
Let the reset switch return to its center position

Timed interrupt routines (e.g. 1 sec, 0.1 sec...)_ will be active if
they are present in the code, i.e. if OB16 is present, it will be
automatically called ever second.

__________

Debugging tools difficult to use with init routines (OB21, OB21, Ob22 ).
A fix is to simply put a long delay loop (30 seconds, say) at the start of
the init routine. This gives time to do a "start PLC" command and
then turn on the breakpoint routine before the program has left the
delay loop.