HP OpenVMS I/O User’s Reference Manual: OpenVMS Version 8.4 > Appendix E Programming USB Generic DriversE.6 ExampleAn example program is in SYS$COMMON:[SYSHLP.EXAMPLES.USB],: ug_example.c. This program is a simple example of how to use the UG driver to control a USB device. In this case, it loops two PL2303 USB to RS232 controllers and exchanges data. Note that this example does not exercise all the capabilities of the UG driver, nor does it work on all PL2303-based controllers. Some PL230- based controllers require additional setup, which is not shown in this example. To compile the example, copy the programs ug_example.c and ugdef.h from sys$common:[syshlp.examples.usb] to a local directory where you have write access, then compile and link them; no special switches are needed. To run the program, you must add both PL2303 devices into the system. To do this, follow the steps in USB Device Configuration. The example program follows steps that are the usual ones for any device you want to control:
|