Blog
Technology Sharing
Tower I3C Host Adapter Usage Example (1)hits:9


Easyi3C is a leading supplier of embedded system tools that simplify the development and debugging of various communication protocols. The company offers a range of products designed to help engineers and developers use I3C/I2C , USB and MIPI, JEDEC, MCTP and other protocols more efficiently.



Controlling the Tower I3C Host Adapter in LabVIEW


A customer recently asked us whether it is possible to control the Tower I3C Host Adapter in LabVIEW. To answer this question, we created this blog post.

1. Theoretical Preparation, Using LabVIEW's Python Node


This section mainly refers to the NI official websitehttps://www.ni.com/docs/zh-CN/bundle/labview-api-ref/page/menus/categories/computer/python-node-mnu.htmlUsing Python nodes is mainly divided into three steps:

1. Open the Python session function


Opens a Python session for a specific Python version. Python sessions are required when configuring multiple Python nodes to run with specific Python versions and in the same process.

icon


Input/Output




  • cstr.png

     Python Version The Python version specifies the Python version that the Python session runs. This function supports the following Python versions:

    Although unsupported Python versions may work with LabVIEW Python, National Instruments recommends using only supported Python versions.



    • LabVIEW 2025 Q1 - Python 3.9~3.12


    • LabVIEW 2023, 2024 - Python 3.6 to 3.10


    • LabVIEW 2021, 2022 - Python 3.6 to 3.9





  • cpath.png

     Python  Path—

    The python path specifies the directory where Python is installed. The default directory is the directory where the specific Python version is located.





  • cerrcodeclst.png

     Incorrect input (no error) 

    error in describes error conditions that occur before this node runs. This input providesStandard error inputFunction.





  • ignrn.png

     Session handle  output—

    session out returns a reference to the Python session.





  • ierrcodeclst.png

     Error  Output—

    error out contains error information. This output providesStandard error outputFunction.



2. Python Node


Call Python functions directly.

The Python node is an expandable function that displays the data types of its wired inputs and outputs. You can configure the Python node to specify the Python session, module path, and function name.

The Python Node is not supported on Real-Time or FPGA targets.

icon


Input/Output




  • cgnrn.png

     Session  Input—

    The session handle in specifies a reference to a Python session. One or more Python nodes can run in a single Python session.





  • cpath.png

     Module  Path—

    The module path specifies the path to the Python module that contains the Python function to be called.





  • cstr.png

     Function  Name—

    function-name specifies the name of the Python function to call.





  • cerrcodeclst.png

     Incorrect input (no error) 

    error in describes error conditions that occur before this node runs. This input providesStandard error inputFunction.





  • cpoly.png

     Return  Type—

    Return type specifies the data type of the return value .

    You must wire the data type to the return type to indicate the expected data type of the return value . If the Python function does not return any value, do not wire the return type .




  • cpoly.png

     Input  Parameters—

    input arguments specifies the input arguments to the Python function.

    You can adjust the Python Node to add more terminals. Wire from the left terminal to pass values to the Python function. Wire from the right terminal to read the values of the parameters after the function call.




  • ignrn.png

     Session handle  output—

    session out returns a reference to the Python session.





  • ierrcodeclst.png

     Error  Output—

    error out contains error information. This output providesStandard error outputFunction.





  • ipoly.png

     Return  Value—

    return value is the return value of the Python function.





  • ipoly.png

     


3. Close the Python session function


Close the Python session.
 

icon

Input/Output




  • cgnrn.png

     Session  Input—

    The session handle in specifies a reference to a Python session. One or more Python nodes can run in a single Python session.





  • cerrcodeclst.png

     Incorrect  input—

    error in describes error conditions that occur before this node runs. This input is useful in the following situations:Standard error input


    Even if an error occurs before a node runs, the node still runs normally.





  • ierrcodeclst.png

     Error  Output—

    error out contains error information. This output providesStandard error outputFunction.



2. Practical Operation


With the previous theoretical preparation, we can use the Python node function of LabVIEW to control our Tower I3C Host Adapter.

1. Install the whl package related to Tower I3C Host Adapter API


Refer to the Userguide of Tower I3C Host Adapter. The Python version on our computer is 3.12. Then select the corresponding version of whl to install. The installation steps are as follows:

Make sure the correct version is installed.

Note: The whl package here is 64-bit. According to LabVIEW official requirements, you must also install the 64-bit version of LabVIEW for it to run properly. In addition, before use, be sure to ensure that our USB driver is successfully installed.

2. Prepare the relevant Python test code file Easyi3C test.py as follows:


# ==========================================================================
# --------------------------------------------------------------------------
# Copyright © 2025 by Easyi3C, Inc.
# All rights reserved.
# --------------------------------------------------------------------------
# ==========================================================================

import sys
from ezi3c.api import *


def register_read(Slave_address, Register):
    # open adapter
    ez = ez_open()
    if not ez:
        print("Cannot open Adapter")
        sys.exit(-1)

    # setaasa
    ez_ccc_setaasa(ez)

    # i3c read
    ret, data = ez_i3c_write_read(ez, Slave_address, Register, 1)

    # close adapter
    ez_close(ez)

    return data

Our example above is to read the register through the I3C protocol.

3. Create LabVIEW project files



4. Create a VI file and name it Easyi3C



5. Modify the Easyi3C.vi file in the project and click to select the file in the red box below



Right-click in a blank area and find the following options:


Click on the red box above, and the following interface will appear:


According to the theoretical part of the first section, drag the three icons above, Open Python Session, Python Node, and Close Python Session to the blank space, and then connect and configure as shown below:


Now return to the Front Panel of the .vi file, as shown below:


Enter the corresponding information on this interface as follows:

Click the red circle to run, and you can see the read data updated in the Reigster value box.


Notes: The function name here must be consistent with the definition in Easyi3C test.py, and the input parameters must also be consistent with the definition in the register_read function.

3. Summary


Through the simple I3C register read operation above, we can see that the Tower I3C Host Adapter can be easily integrated into LabVIEW, which is convenient for customers with this need. The above is just one way to use our device in LabVIEW. According to the instructions on the LabVIEW official website, our device can also be controlled in the following two ways: 1. Use System Exec.vi to execute Python scripts; 2. Communicate via TCP/IP or shared files; for more detailed usage, please refer to the LabVIEW official website documentation. This shows that the Tower I3C Host Adapter can be easily and cost-effectively integrated into LabVIEW. Compared with I3C Host Adapters using NI solutions on the market, such as those based on PXIe-6594, refer to the NI official website, the starting price is 275,555 RMB, the link is as follows:https://www.ni.com/zh-cn/shop/model/pxie-6594.html?namespace=s7classicThe price comparison advantage is obvious. Combined with our GUI, it is very convenient for engineers to get started with verification and use. At the same time, Python scripts can also be used to easily build complex automated testing environments.



Previous: NONE!
Next: NONE!
Return Back

Service Line:

Address:Silicon Valley
Email:support@easyi3c.com

Copyright © Easyi3C Co., LTD