• 沒有找到結果。

The SFC83 "READ_DBL" is an asynchronous operating SFC, that is, processing covers multiple SFC calls. Start the job by calling SFC83 with REQ = 1.

The job status is displayed via the output parameters RET_VAL and BUSY.

See also Meaning of REQ, RET_VAL and BUSY for Asynchronously Operating SFCs

Parameter Declaration Data type Memory area

Description

REQ INPUT BOOL E, A, M, D, L REQ = 1: Read request

SRCBLK INPUT ANY D Pointer to the data area of the DB in the load memory from which is to be read

RET_VAL OUTPUT INT I, Q, M, D, L Error code

BUSY OUTPUT BOOL I, Q, M, D, L BUSY = 1: The read process is not yet terminated.

DSTBLK OUTPUT ANY D Pointer to the data area of the target DB

Error Information

Error code (W#16#...):

Description

0000 No error

8081 The source range is larger than the target range.

The target range is fully written. The remaining bytes of the source area are ignored.

7000 First call with REQ=0: no data transfer active; BUSY has the value 0.

7001 First call with REQ=1: no data transfer active; BUSY has the value 1.

7002 Intermediate call (REQ irrelevant): data transfer already active; BUSY has the value 1.

0081 The target range is larger than the source range.

The source area is written completely to the target area. The remaining bytes of the target area are not changed.

80C0 The target is currently being processed by another SFC or communication operation.

8093 No block or no execution-relevant block is indicated for the parameter DSTBLK (initializing block).

80B1 No block or no execution-relevant block is indicated for the parameter SRCBLK (initializing block).

80B4 DB with an F-attribute must not be changed

80C3 The required operating resources are currently occupied.

8xyy General error codes

长沙工控帮教育科技有限公司整理

3.11 Writing a Data Block in Load Memory with SFC 84

"WRIT_DBL"

Description

With the SFC84 "WRIT_DBL" (write data block in load memory) you can write a source DB in a DB of the data type BLOCK DB or into an area of a DB in load memory (Memory Card). The DB in load memory to which the parameter DSTBLK refers can be relevant or not relevant for processing. The source area to which the parameter SRCBLK refers can be of data type BLOCK_DB or a DB(-content) in the work memory. The source DB to which the parameter SRCBLK refers must

therefore be process relevant (keyword UNLINKED = 0). The source DB can also be generate with SFC22 "CREAT_DB".

To maintain consistency, you must not change the source area while the SFC 83 is being processed.

The following restrictions apply to the parameters SRCBLK and DSTBLK:

• For an ANY pointer of the type BOOLEAN the length must be divisible by 8.

• For an ANY pointer of the type STRING the length must be equal to 1.

If required, you can determine the length of the target DB with SFC24 "TEST_DB".

SFC82 does not change the checksum of the user program if you describe a DB that was generated via SFC. When writing a loaded DB the first entry in this DB changes the checksum of the user program.

Note

SFC 84 is processed asynchronously and is therefore not suitable for writing variables to the load memory frequently. Please note that write access to a Micro Memory Card is limited for technological reasons.

长沙工控帮教育科技有限公司整理

Operating principle

The SFC 84 "CREA_DBL" operates asynchronously, that is, processing covers multiple SFC calls. Start the job by calling SFC84 with REQ = 1.

The job status is displayed via the output parameters RET_VAL and BUSY.

Refer also to Meaning of REQ, RET_VAL and BUSY with Asynchronously Operating SFCs

Parameters Declaration Data type Memory area Description

REQ INPUT BOOL I, Q, M, D, L REQ = 1: Write request

SRCBLK INPUT ANY D Pointer to the data area of the source DB

RET_VAL OUTPUT INT I, Q, M, D, L Error code

BUSY OUTPUT BOOL I, Q, M, D, L BUSY = 1: The write process is not yet terminated.

DSTBLK OUTPUT ANY D Pointer to the data area of the DB in the load memory which is to be written

Error Information

Error code (W#16#...):

Description

0000 no error

0081 The target range is larger than the source range.

The source area is written completely to the target area. The remaining bytes of the target area are not changed.

7000 First call with REQ=0: no data transfer active; BUSY has the value 0.

7001 First call with REQ=1: no data transfer active; BUSY has the value 1.

7002 Intermediate call (REQ irrelevant): data transfer already active; BUSY has the value 1.

8081 The source range is larger than the target range.

The target range is fully written. The remaining bytes of the source area are ignored.

8092 Windows NT operating system has crashed (blue screen)

8093 No block or no execution-relevant block is indicated for the SRCBLK (initializing block) parameter.

80B1 No block or no execution-relevant block is indicated for the DSTBLK (initializing block) parameter.

80B4 A DB with F attribute must not be changed

80C0 The target is currently being processed by another SFC or communication operation.

80C3 The required operating resources are currently occupied.

8xyy General error codes

长沙工控帮教育科技有限公司整理

长沙工控帮教育科技有限公司整理

4 SFCs for Controlling Program Execution

4.1 Re-triggering Cycle Time Monitoring with SFC 43

"RE_TRIGR"

Description

With SFC 43 "RE_TRIGR" (re-trigger watchdog), you can re-trigger the cycle time monitoring.

Parameters

SFC 43 "RE_TRIGR" has no parameters.

Error Information

SFC 43 "RE_TRIGR" does not provide any error information.

4.2 Changing the CPU to STOP with SFC 46 "STP"

Description

With SFC 46 "STP" (stop), you change the CPU to the STOP mode.

Parameters

SFC 46 "STP" does not have any parameters.

Error Information

SFC 46 "STP" does not provide any error information.

长沙工控帮教育科技有限公司整理

4.3 Delaying Execution of the User Program with SFC 47

"WAIT"

Description

With SFC 47 "WAIT," you program delays or waiting times in your user program.

You can program waiting times up to 32767 µs. The smallest possible waiting time depends on the particular CPU and is the same as the execution time of SFC 47.

Interrupt ability

SFC 47 "WAIT" can be interrupted by higher priority OBs.

Note

(for S7-300 only, but not for CPU 318)

The waiting time programmed with SFC 47 is a minimum time. It is extended by the execution time of the nested priority classes and by load on the system.

Parameter Declaration Data Type Memory Area Description

WT INPUT INT I, Q, M, D, L, constant The parameter WT contains the waiting time in µs.

相關文件