Reference Materials > Programming for Multiple Ethernet Products

Previous | Next

Programming for Multiple Ethernet Products

Multiple Ethernet devices cannot properly start and restart from a single process using the ActiveX controls without some added code. When the first device is stopped, function WSACleanup is called which disrupts the communication required to properly stop the other devices before closing the program. Consequently, the devices cannot be restarted again.

The following steps MUST be taken to run multiple Ethernet units from a single process.

  1. Omit the call to WSAStartup on each Start so that Winsock will not be loaded into memory on every start/stop.
  1. Call WSAStartup function once (and only once) before calling the first start.
  1. Call WSACleanup function once (and only once) after the last stop before exiting.
  1. Directly under the [Global] heading in the TPDATAQ.INI file (located at C:\Windows) add the line: WSASTARTUP=0.

Use the sample program WSASTARTUP.vbp for reference.

Top