Setup

After you established a connection to the device, in order to interact with it programmatically, setup your development environment next by following these steps:

Note

Most of the setup and examples we provide in the subsequent chapters are written in Python.

  1. Install Python: Make sure you have Python installed on your machine. You can download it from the official Python website.

    1. Optional: You can also setup your environment by using uv. See the installation instructions.
  2. Install Required Libraries: Use pip to install any required libraries. For the quickstart examples we need to install the following packages:

    pip install requests asyncua
    

    We use requests for HTTP and asyncua for OPC UA interaction

  3. Verify Installation: To verify that Python and the required libraries are installed correctly, you can run a simple script. Create a file named test_setup.py with the following content:

    import asyncua
    import requests
    
    print("Python and required libraries are installed correctly.")
    

    Run the script using the command:

    python test_setup.py
    

    If everything is set up correctly, you should see the message confirming the installation.

This is a command line tool and library for transferring data with URLs. It is commonly used for making HTTP requests. It is pre-installed on Windows, macOS, and most Linux distributions.

To check if it is installed, run the following command in your terminal or command prompt:

curl --version