Skip to main content

pyadvantech

Interact with the Advantech USB-4718

  1. Install the module via:

    pip install pyadvantech
    
  2. You might need to add the libusb.dll to your Path.

  3. Plug in the USB-4718 into your machine and install a WINUSB driver as its driver.

    import pyadvantech.pyadvantech as pya
    
    device = pya.setup(vendor_id=None,device_id=None)
    pya.prepare_read()
    print(pya.read(device))
    

    The vendor id and device id can be manually set but if left unspecified will default to the known tested values.
    Prepare read tells the device that it should now read the thermocouple. This call might not be necessary but it is a good Idea to call it as it moves the device out of a setup stage into the read stage.

  4. Changes to the Value Ranges of the device can be made with:

    import pyadvantech.pyadvantech as pya
    
    device = pya.setup()
    pya.set_channel_range(device,values=[0x0e,0x0b,0x0b,0x0b,0x0b,0x0b,0x0b,0x0b])
    

    If values is left as none it will reset the device to the 0-100mv range.

  5. Multiple values can be selected and saved with:

    import pyadvantech.pyadvantech as pya
    device = pya.setup()
    pya.read_and_save(device,channel=1,length=1000,update=0.1,file_name="test.csv")
    
    Variable Name Description Default Value
    device The Device handle required
    channel The channel to be saved and stored required [0:7]
    length Number of measurements to be taken 1000
    update The update time in sec 0.1
    file_name The file name must end in .csv format "%Y_%m_%d_%H_%M_%S".csv
  6. An Experimental plotting tool is also provided:

    import pyadvantech.pyadvantech as pya
    device = pya.setup()
    pya.plot_out(device,channel=1,x_name=None,y_name=None,x_range=60,update=None,acquisition_len=None)
    
    Variable Name Description Default Value
    device The Device handle required
    channel The channel to be saved and stored required [0:7]
    x_name X axis label Time in update sec intervals
    y_name Y axis label Output of USB device
    x_range Range of x axis, if left None will just add new values continuously None
    update The update time in sec 0.1
    acquisition_len Number of measurements to be taken 500 can be set to "inf"

Release files for pyadvantech 0.2.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pyadvantech 0.2.2
File Size Uploaded
pyadvantech-0.2.2.tar.gz 4.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for pyadvantech 0.2.2
File Interpreter ABI Platform
pyadvantech-0.2.2-py3-none-any.whl Python 3 none any Details

Total release size: 9.7 kB

Release files / pyadvantech-0.2.2.tar.gz

Download URL pyadvantech-0.2.2.tar.gz
Size 4.7 kB
Tags Source
SHA-256 checksum
How to use checksums
1af0441a4309a97e84b86e4d272a6e2fcb54a24725133aeecade35effb832ab3
BLAKE2b-256 checksum
How to use checksums
d749b45b0167dc22b3c3e80632ed0cf0aa34ecbb02d7eff9fd91a70b3b0ddf4a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.8.3

Release files / pyadvantech-0.2.2-py3-none-any.whl

Download URL pyadvantech-0.2.2-py3-none-any.whl
Size 5.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
e24163636cbb3ada8b8ed601dbc43367b2c0753682c7aa45acf336ad6dc0d032
BLAKE2b-256 checksum
How to use checksums
d827902d8b5f000bd6eb91c51ca1742c7ef57c8821f93168325727632d7bb283
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.8.3

Release history Release notifications | RSS feed

This release

0.2.2 This release

2 release files

0.2.1

2 release files

0.2

2 release files

0.1.4

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.1

1 release file

0.1

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page