Jump to content
  • 0

USB-1208HS-4AO


Bartłomiej Sikora
 Share

Question

Good Morning,

     I have bought USB-1208HS-4AO and would like to control/plot/aquire data from 4 AI channels and 2 AO channels with the given sampling frequency up to 5kHz as close to synchronous mode, as it is possible. I am using the Python UL, but I am a quite new Python learner, so any tips/tutorials or code advice will be a great help for me. I am trying with a_in_scan and a_out_scan.py + pulse_out.py as a trigger, but it seems, that these operations are not running at the same time. Should I change the OS or programming language? Maybe LabView? I am open for any suggestions!

Best Regards

Bartłomiej Sikora

Link to comment
Share on other sites

2 answers to this question

Recommended Posts

  • 0

Hello,

Often overlooked is our UL Help that can provide useful information about a specific product. The shortcut to it can be found on the Measurement Computing start program menu. A good place to start is to click the Search tab and perform a search on "USB-1208HS-4AO". This will provide a link to the device's page, which lists the functions and scan options to use. There you will see that both the AInScan and AOutScan functions support the external trigger option - EXTTRIGGER.  If you include this option in the scan options for both functions, neither process will start until a rising edge of a +5 volt pulse is detected on pin 39 - see page 0 in the user manual for pinout names. 

There is another better way, instead of EXTTRIGGER use EXTCLOCK. With this option, neither will run (and continue to run) until a +5 volt square wave clock is applied to pins 35 & 37. For a clock signal, use the timer output and connect pin 43 to 35 & 37. This assures both run in lock-step until the clock is removed.

regards,
John

Link to comment
Share on other sites

  • 0

Dear John,

     Thank you very much for the valuable advice, according to which I was able to get the first measurements, but I still have some confusion about the code (pmDataScan1208HS.py), that is how to acquire synchronously AI and AO data. I attached a program that utilizes pulse_out, ai_scan and ao_scan in EXTCLC mode. The code is basically copy-paste three functions You have mentioned with minor changes. There are lines 81,82, where in the pulse _out function I call ai_scan, ao_scan. How could I be sure of the measured data synchronization? I will be very grateful for further advice, where should I start to work with this code. Also my experience up to now was around control systems in Simulink, but in a new job I may use Python or LabVIEW. Would You recommend me to start building control system in LabVIEW rather than with UL Python Library help? First task will be a real-time  temperature control in peltier module. Next project may include high-speed rotating machinery diagnosis. Any advice, how to speed up rapid prototyping with such applications will be very useful.

Best regards,

Bartek 

pmDataScan1208HS.py ul.py

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...