Jump to content
  • 0

USB-1208HS-4AO / ULx LabVIEW PID control - internal/external clock synchronization

Bartłomiej Sikora


I am looking for a timer synchronization solution for AO and AI for a real-time control appliaction. I attached an exemplary program with PID. It works fine for the "No clock" option in clock source. For "Onboard / External Clock" it does not work, returning error 10014 at ULx Write (Analog 1D DBL 1Chan 1Sample) - Measurements: Specified operation cannot be performed while the task is running. I am kindly asking for advice or sources from which I will be able to learn and understand how to synchronize AI / AO in RT for USB-1208HS-4AO.  I found and attached below a similar example from DAQmx, where you can see that the clock source for AO is the output from the AI clock (red circle). How can I implement that by using ULx LabVIEW library for USB-1208HS-4AO (MCC DAQ devices)? 



Link to comment
Share on other sites

2 answers to this question

Recommended Posts

  • 0


I've looked into your application further and using the ULx Timing VI to achieve higher throughput will not work in PID applications. This is because the underlying resources were designed to stream waveforms not single values. The waveform output works by first preloading the output buffer using the ULx Write Vi. For a clock rate of 1000, the buffer must be at least 5000 otherwise an error will occur. The buffer is not directly accessible and all additional ULx Writes get appended to the end.

Take a look at the ULx Cont Gen Voltage Wfm-Int Clk-Non Regeneration.vi for an example of this. It is located in the \National Instruments\LabVIEW 2021\Examples\ULx\Analog Out\Generate Voltage.llb library.



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
  • Create New...