Python for DAQ

Поділитися
Вставка
  • Опубліковано 28 сер 2024
  • Python resources for NI Do you use Python or another common coding language? Now you can add NI quality data acquisition to your Verification & Validation projects to take high-quality measurements and make data-driven decisions. Integrating an NI DAQ device with Python is easy; here's how to get started!
    ** Getting started guide for using NI DAQ devices with Python: bit.ly/3M7QOp0
    ** NI Python resources for Hardware and Software: bit.ly/3FANbFE
    ** NI-DAQmx Python Github: bit.ly/3FEZLnp
    ** NI-DAQmx Python Documentation: bit.ly/3FQd7gZ
    ** More about DAQ: bit.ly/3kYvsyy

КОМЕНТАРІ • 20

  • @BNelson-808
    @BNelson-808 Рік тому +1

    More Austin in Austin plz!

  • @brunodiazbat2532
    @brunodiazbat2532 2 роки тому +1

    Hi, is it possible to perform a Bridge Offset Nulling Calibration for a Load Cell, using python?

    • @cbogue1
      @cbogue1 9 місяців тому

      Yes, here's a demo sample.
      import time
      import sys
      from hx711 import HX711 # Import the HX711 class
      def cleanAndExit():
      print("Cleaning...")
      if hx:
      hx.power_down()
      print("Bye!")
      sys.exit()
      hx = HX711(5, 6) # Initialize the HX711 using pins 5 and 6 on the Raspberry Pi
      # I've set the reference unit to 1 for now. If you have a known reference weight, set it here.
      hx.set_reference_unit(1)
      hx.reset() # Before we start, reset the HX711 (not necessary but good practice)
      hx.tare() # Reset the scale to 0
      print("Tare done! Add weight now...")
      # To get better results, place a known weight on the scale and set the reference unit based on that.
      known_weight = input("Enter the known weight (in grams) and then press Enter: ")
      try:
      known_weight = float(known_weight)
      except ValueError:
      print("Invalid weight entered. Exiting...")
      cleanAndExit()
      input("After placing the known weight on the scale, press Enter to continue...")
      val = hx.get_weight(5) # Get the value from HX711 (average over 5 readings for stability)
      print(f"Value from HX711: {val}")
      reference_unit = val / known_weight
      print(f"Reference Unit: {reference_unit}")
      hx.set_reference_unit(reference_unit)
      input("Remove the known weight, and press Enter to continue...")
      hx.tare()
      while True:
      try:
      val = hx.get_weight(5)
      print(f"Weight: {val} grams")
      hx.power_down()
      hx.power_up()
      time.sleep(0.1)
      except (KeyboardInterrupt, SystemExit):
      cleanAndExit()

  • @dioutoroo
    @dioutoroo Рік тому

    Hi! Could you please help me to resolve this following problem?
    "was not explicitly closed before it was destructed. Resources on the task device may still be reserved"
    Thank you

    • @NIApps
      @NIApps  Рік тому +1

      Hi Dio! We recommend posting your question in our Discussion Forums: forums.ni.com/t5/Discussion-Forums/ct-p/discussion-forums. From here you can share your question with the community and explore solutions. Let us know if you have any more questions!

  • @salpadilla7145
    @salpadilla7145 2 роки тому

    I have tried reading both thermocouple data and voltage data but python and NI-daqmx does not allow to read different types of data at the same time
    with nidaqmx.Task() as task:
    task.ai_channels.add_ai_thrmcpl_chan("cDAQ1Mod4/ai0")
    task.ai_channels.add_ai_thrmcpl_chan("cDAQ1Mod1/ai0")
    task.ai_channels.add_ai_voltage_chan("cDAQ1Mod2/ai0") add this and it will fail
    print(task.read())
    only one or the other will function.
    Is there a workaround?

    • @austinstanton6265
      @austinstanton6265 Рік тому

      Hey Salpadilla, did you end up figuring this out or are you still having issues?

  • @alvaroachury6265
    @alvaroachury6265 2 роки тому

    Hi there, could you put the links mentioned on the video on the youtube video description or the link where could be found the links. Thanks!

    • @NIApps
      @NIApps  2 роки тому

      Thank you for your feedback and asking about additional links. We have updated the video description to include the links mentioned. Please let us know if you have any more questions or need additional information!

  • @aboutlook5381
    @aboutlook5381 Рік тому

    How was the output of USB-6008 device connected to the laptop to share it's data?

  • @seya_eury
    @seya_eury 2 роки тому

    I am using LabView community edition 2020 alongside DAQ Max. Is Python supported for my particular case? Thanks in advance!

    • @NIApps
      @NIApps  2 роки тому +1

      Hi Sajed, yes Python is supported in that case. Find more information at: bit.ly/3uxkLcc

  • @cessromer7078
    @cessromer7078 2 роки тому

    May I use this presentation together with my own daqmx training ?

  • @yormanjorcetquispechavez3330
    @yormanjorcetquispechavez3330 2 роки тому +1

    EXCLENTE THANKS

  • @haluklacin4190
    @haluklacin4190 Рік тому

    Can you make a video for ao please?

  • @abhirishi6200
    @abhirishi6200 2 роки тому

    Good thanks!

  • @NamasenITN
    @NamasenITN Рік тому

    "Windows only" makes it useless for many users.

  • @raymondzhao9557
    @raymondzhao9557 2 роки тому

    coooooooool