
Overview of the DP Base Interface
DP Base Programming Interface for CP 5613/CP 5614
54
C79000-G8976-C108-01
Using Hardware Events
After initializing the required semaphores, the following sequence can be run
through to activate and fetch events:
Step Action Meaning
1 Optional: Activate
hardware event for input
data changes (req_mask,
Section 4.3.11)
With this, the user program indicates
that it requires a semaphore to
increment if input data change.
2 Optional: Activate
hardware event for
diagnostic data
(req_mask, Section
4.3.11)
With this, the user program indicates
that it requires a semaphore to switch if
diagnostic data arrive.
3
Optional: Activate
hardware event for start of
cycle
(D_cycle_start_mask,
Section 4.3.11)
With this, the user program indicates
that it requires a semaphore to
increment at the start of a cycle.
4 Optional:
DP_fast_logic_on
Send fast logic job
5
Wait for semaphore (for
example
WaitForMultipleObjects)
The user program or the thread waits
until one of the events occurs.
"WaitForMultipleObjects" is a Windows
32-bit API function.
6 Detect the type of event The semaphore identifies the type of
event, for example, data change.
7
Detect the source of the
event (which slave)
Check the flags in the process image:
req_mask = DPR_DATA_CHANGE
if data changes (Section 4.3.4)
diag_count changed during
diagnostics (Section 4.3.2)
8 Read and process the
event
Read by accessing the process
image:
—
slave_in[n].data for input data
—
slave_diag[n].data for diagnostic
data
—
see Section 4.3.10 for fast logic
Pass on to other parts of the user
program.
Komentarze do niniejszej Instrukcji