
Overview of the DP Base Interface
DP Base Programming Interface for CP 5613/CP 5614
56
C79000-G8976-C108-01
3.7.5 Typical Sequences in DPC1 Operation with Semaphores
Definition
The polling mode for DPC1 described in Section 3.7.3 can also be replaced by
operation with semaphores.
The initialization of this mode, the elements of continuous operation and canceling
the mode are described below.
Initializing the Semaphores
Before it is used, the semaphore must be created as follows:
Step Action Meaning
1 Initialize a semaphore for
asynchronous jobs
(function
DP_init_sema_object)
The DP Base DLL provides a
semaphore for all asynchronous jobs
(type DP_OBJECT_TYPE_ASYNC).
Using Semaphores for DPC1
Step Action Meaning
1 Send the write job
(DP_ds_write)
On completion of the function, the job
is active.
2 Wait for the semaphore
(for example,
WaitForMultipleObjects)
The user program or the thread waits
until the event occurs.
"WaitForMultipleObjects" is a Windows
32-bit API function.
3
Fetch result
(DP_get_result)
The result can be recognized by the
order_id in the request field.
The other DPC1 services function analogously.
Kommentare zu diesen Handbüchern