38.5.1 Procedure - Retrieve WinGP information or Operate WinGP from user application

API allows to retrieve WinGP information or operate WinGP from user applications.

  1. From the [Project] menu, click [System Settings]-[Display Unit] then open the [WinGP Settings] tab.

  2. Select the [Use API Communication] check box and specify the port, between 0 and 65535. Define a value that differs from the [Transfer Settings] [Port] number.

    • Be sure not to use the same port as that for communication with the other device/PLC or for FTP communication.

    • Please do not use port numbers 8000 to 8019, which are designated as the port numbers for transfer.

  3. Save the Project file, and transfer it to the IPC or PC/AT compatible machine.

  4. Acknowledge the communication between WinGP and the device/PLC.

  5. Set up a programming application to use API.

    When using the device access API in VB.NET

    Open the solution explorer in VB.NET and right-click [Browse Settings] to select [Add Browse].

    Click [Browse] in the [Add Browse] dialog box and select the following file.

    • When using .NET Framework 4.0
      (In GP-Pro EX DVD-ROM) \WinGP\SDK\Pro-SDK\DotNet40\BIN\WinGPAPIDotNet.dll

    • When using .NET Framework 2.0

    (In GP-Pro EX DVD-ROM) \WinGP\SDK\Pro-SDK\DotNet20\BIN\WinGPAPIDotNet.dll

    • When using .NET Framework 1.1

    (In GP-Pro EX DVD-ROM) \WinGP\SDK\Pro-SDK\DotNet\BIN\WinGPAPIDotNet.dll

    Click [Open] and select [OK].

    At the start of the source code, enter "Imports ProEasyDotNet."

    When using the device access API in Visual Basic 6.0

    From Visual Basic 6.0 menu bar, select [Project] - [Add Standard Module] and add the following module.

    (In GP-Pro EX DVD-ROM) \WinGP\SDK\Pro-SDK\VB\API\WinGPAPI.bas

    When using handling API in VB.NET

    From VB.NET Menu Bar, select [Project] - [Add Existing Item] and add the following module.

    (In GP-Pro EX DVD-ROM) \WinGP\SDK\Pro-SDK\DotNet\BIN\RtCtrlAPI.vb

    When using the handling API in Visual Basic 6.0

    From Visual Basic 6.0 menu bar, select [Project] - [Add Standard Module] and add the following module.

    (In GP-Pro EX DVD-ROM) \WinGP\SDK\Pro-SDK\VB\API\RtCtrlAPI.bas

  6. Execute programming.

  7. Setup the user application created on the IPC or PC/AT compatible machine.

  8. Start WinGP and the user application.