show the entry list
STEP 7 -- Creating S7 programs -- Executing operations
How in STEP 7 V5.x do you program signal generation (rectangle, sawtooth, triangle, sinus) using the cyclic interrupts?
How do you determine the velocity, acceleration and distance?
How can you address I/O bytes and individual bits via the I/O?
How do you implement numerical differentiation in STEP 7 V5.5?
How can you convert a hexadecimal number into ASCII characters with STEP 7 V5.5?
What should you watch out for with the display of negative integer values in the LAD/STL/FBD editor when monitoring?
Information on the topic of "Executing operations"
How do you calculate power, exponential, root, polynomial, logarithm and linear values and how do you convert trigonometric functions into degrees?
How can you convert a number value of the data type INT into a string in S5TIME, or into the data types BCD and REAL?
How can you delay the output signal in relation to the input signal?
How can you accumulate physical flow measurements (e.g. mass flow rate, flow velocity) to an overall value?
How do you monitor a 32-bit field, evaluate the position of an active bit and access individual bits of a double-word?
How can you link variables and block parameters with each other?
How do you check real numbers for parity?
How is numerical integration programmed in S7-SCL and STEP 7?
When is there a first scan in logic operation sequences?
What does the NOP statement in the STL editor mean in STEP 7?
How accurately can I calculate with REAL numbers that are used in extensive formulas?
Which functions and IEC standard functions exist in STEP 7 for converting and comparing string variables?
How do you program a shift register with the LAD/FBD statements in STEP 7 V5.5 and STEP 7 (TIA-Portal)?
How can you address I/O bytes and individual bits via the I/O?
Part number:

Instructions:
If the bits are to be updated faster than through the process image, you can implement your program with the direct commands PQB, PQW and PQD in the STL editor of STEP 7. However, with these statements you cannot address individual bits via the I/O. For addressing individual bits you must write at least the complete byte to the I/O. If the other bits of the byte are not be to changed, then you must program relevant logical operations according to the change of the bit (TRUE/FALSE). Then you can write the complete byte to the I/O via direct command.

The table below contains examples for addressing a bit field and setting an individual bit in the I/O.
 
No. Examples for I/O addressing:
1 Setting the bit field in the I/O area
By calling and parameterizing SFC 79 "SET" you can set a selected bit field in the I/O area. The parameters must be assigned as shown in the following example (Fig. 01). In this example PQB 4 is set.


Fig. 01

Please pay attention to the syntax of the pointer on the "SA" parameter - here there must be the statement "P#Px.y" (pointer to the first bit to be set). If you specify a different area ID or an incorrect address here, STEP 7 doesn't report an error. Upon implementation at runtime however the CPU reports an "area error when writing a parameter".

More information on the system function SFC 79 is also available in the STEP 7 Online Help or in the manual "System Software for S7-300/400 System and Standard Functions", Entry ID: 44240604.

2 Setting individual bits via the I/O
The STEP 7 project contains the function FC4, which you use to change a bit and write it directly to the I/O without affecting the other bits. Specifying the output address and the bit to be changed changes the status of that bit according to your specification. Through logic operations in the function only that specific bit is changed. The function then transfers the complete byte to the I/O via direct command.


Fig. 02

Download:
The attached download "Di_Com.zip" contains a STEP 7 project with the block described above. Open and copy the "Di_Com.zip" file into a separate directory. The STEP 7 V5.4 project then unpacks automatically with all the associated subdirectories. You can use the SIMATIC Manager to open and process the extracted project.

Di_Com.zip ( 357 KB )  

Runnability and test environment:
The examples can be used on all the CPU types of SIMATIC S7-300, S7-400, C7 and WinAC. The following table lists the components that have been used to create this entry and verify the functions described.
 
Test environment: Version:
PC platform Intel(R) Pentium(R) M processor 1.73 GHz, 1.49 GB RAM
PC operating system MS Windows XP SP2
STEP 7 V5.4
Options package S7 PLCSIM V5.3

Keywords:
Direct command access

 Entry ID:18610506   Date:2011-05-11 
I regard this article....as helpfulas not helpful                                 
mySupport
My Documentation Manager 
Newsletter 
CAx-Download-Manager 
Support Request
To this entry
Print
Create PDF 
Send to a friend
QuickLinks
Compatibility tool 
Help
Online Help
Guided Tour