15.5 Testing the user program
15.5.9 Testing with the force table
Tags can be preassigned fixed values. This action is referred to as “forcing”.
A CPU 400 can force tags from the peripheral inputs and peripheral outputs area.
The maximum number of tags controlled with the force job depends on the CPU used. Forcing is then only possible if the Enable peripheral outputs function is switched off.
Please note: Forcing is sent to the CPU by means of a force job. The force job remains active even if online mode is terminated and the online connection to the program- ming device canceled! The force job also remains active after switching the CPU off and on! Forcing can only be exited using the Force > Stop forcing command; this com- mand deletes the force job in the CPU.
With the force table you can force peripheral inputs and peripheral outputs in the data formats BYTE, WORD, and DWORD. You can monitor tags from the inputs, outputs, bit memories, and data tags operand areas as well as peripheral inputs.
The force table is present once for a CPU and cannot be copied or renamed. A re- quirement for using the force table is an open project with an associated CPU.
Filling a force table
Open the force table by double-clicking in the project tree in the “Watch and force tables” folder.
In the empty table, enter the names of the tags line by line and the display format from a drop-down list. The display format may differ from the data type of the tag.
You can enter a short explanatory text for each tag in the comment column.
The tags entered with names must previously have been defined in the PLC tag table or in a data block. You can also enter the memory address (absolute address) in the Address column.
Monitoring tags in the force table
The entered tags can be monitored. The Expanded mode icon in the toolbar of the working window opens the Monitor with trigger column. You can set the monitoring conditions here. You start monitoring by clicking on the Monitor all symbol (refer to Chapter 15.5.7 “Testing with watch tables” on page 622 for details).
Forcing with the force table
You can call the test functions when forcing from the shortcut menu or using the icons in the toolbar of the working window shown in Fig. 15.18.
To carry out forcing, enter a value in the Force value column and activate the check- box in the Force column (tag selection). A yellow triangle with exclamation mark indicates that the selected tag has not yet been forced.
It is recommendable to switch on monitoring mode prior to forcing. An online con- nection to the CPU is then already established and the success of forcing can be monitored.
Caution: Make sure that no dangerous states can occur when forcing tags!
The Start forcing icon sends a force job to the CPU which contains the tags selected for forcing. Forcing is effective immediately (Fig. 15.19). The FRCE LED on the CPU lights up when a force job is active.
To exit forcing for individual tags, deactivate the checkbox in the tag selection and click on the Start forcing icon again. A new force job is sent to the CPU which termi- nates forcing for the tags which are no longer selected.
You exit forcing for all tags using the Stop forcing icon. A new force job is then sent to the CPU, which terminates forcing for all forced tags.
Note that termination of forcing leave the tags in their last state! Only the force job is deleted. For example, an output of a digital module remains in signal state “1” after termination of forcing if it is not controlled otherwise by the program.
The icons from left to right:
Name in text Tooltip text Expanded mode
Start forcing Stop forcing Monitor all Monitor now
Show/hide advanced setting columns
Starts or replaces forcing of the visible addresses in the Force table Stop forcing of the selected addresses
Monitor all
Monitors all values once and now Fig. 15.18 Icons in the toolbar of the force table
Fig. 15.19 Example of forcing of peripheral inputs and outputs
As an alternative to forcing using the icons, you can select one or more tags in the force table and then the Force > Force to 0, Force > Force to 1, Force > Force all, and Force > Stop forcing commands from the shortcut menu or the commands from the main menu under menu item Online > Force > … .
The FRCE LED on the CPU turns off when no more force jobs are present in the CPU.
16 Distributed I/O