Using PL/B as a Client
The following simple program accesses the component. First, we create a program object and start running the program.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Now the required events are registered and the program started.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
The ShowData routine will display the event information and is as follows:
|
|
|
|
|
|
|
|
|
|
|
|
The AllDone routine sends the terminate component event to stop the component.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
The ProgComplete routine indicates that the component has terminated and stops the program.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
The final code makes a read request of the component then loops waiting for a result.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
The entire code is shown below
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
See Also: Automation
![]() |