Skip to main content

A custom USB driver for Advantech USB-4718

Project description

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"

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pyadvantech-0.2.2.tar.gz (4.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pyadvantech-0.2.2-py3-none-any.whl (5.0 kB view details)

Uploaded Python 3

File details

Details for the file pyadvantech-0.2.2.tar.gz.

File metadata

  • Download URL: pyadvantech-0.2.2.tar.gz
  • Upload date:
  • Size: 4.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.8.3

File hashes

Hashes for pyadvantech-0.2.2.tar.gz
Algorithm Hash digest
SHA256 1af0441a4309a97e84b86e4d272a6e2fcb54a24725133aeecade35effb832ab3
MD5 34c0d0178c753deab7eaa43cc3cc9d78
BLAKE2b-256 d749b45b0167dc22b3c3e80632ed0cf0aa34ecbb02d7eff9fd91a70b3b0ddf4a

See more details on using hashes here.

File details

Details for the file pyadvantech-0.2.2-py3-none-any.whl.

File metadata

  • Download URL: pyadvantech-0.2.2-py3-none-any.whl
  • Upload date:
  • Size: 5.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.8.3

File hashes

Hashes for pyadvantech-0.2.2-py3-none-any.whl
Algorithm Hash digest
SHA256 e24163636cbb3ada8b8ed601dbc43367b2c0753682c7aa45acf336ad6dc0d032
MD5 d245e664048ca2e6f2efced19c98f911
BLAKE2b-256 d827902d8b5f000bd6eb91c51ca1742c7ef57c8821f93168325727632d7bb283

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page