08-18-2017 08:14 AM
Hi,
I am trying to use simultaneous AI AO using USB-6211.
I downloaded a sample vi and modified it according to my need.
I can able to generate a signal and verify using my oscilloscope.
But when I vary the duty cycle using the slide I could not able to see the duty cycle variation in my oscilloscope. I know I need to add a loop to my write vi but even though after adding when I vary the duty cycle it didnt work.
Is there a better example to use the vi simultaneously using USB-6211 ?
08-18-2017 08:29 AM
08-25-2017 07:33 AM
I have now put the while loop for analog read.
I can able to read and write simultaneously.
The new issue is I need to take the average value out of the output and save it in a spreadsheet file.
It can be done only when the while loop stops executing.
duty cycle.csv file contains different duty cycle and time period that the duty cycle needs to run.
example : 15%, 10 seconds
My aim is to run 1Khz waveform for 15% duty cycle and for 10 seconds and get the average AI value for that 10 seconds and save in the file.
I need to do this for different sets of duty cycle.
08-25-2017 08:34 AM - edited 08-25-2017 08:36 AM
Hi Vikash,
It can be done only when the while loop stops executing.
Why do you think so?
duty cycle.csv file contains different duty cycle and time period that the duty cycle needs to run.
Why is your Counter-Output loop a while loop? You know how many iterations you need this loop to spin before the loop starts, so you should use a FOR loop instead!
(Why do you need to count the number of rows in your CSV file this complicated? Why not use a simple ArraySize on the output of the ReadSpreadsheetFile? But then you don't need to count the number of rows as the proposed FOR loop would employ autoindexing the iterate over your setpoint data…)
My aim is to run 1Khz waveform for 15% duty cycle and for 10 seconds and get the average AI value for that 10 seconds and save in the file.
Then you need to send a "flag" signal from Counter loop to AI loop. Each time you send this signal the AI loop will calculate the average of the samples, it has collected until then…
You could use a notifier for this task (but even a simple local variable will be sufficient here).