From 04:00 PM CDT – 08:00 PM CDT (09:00 PM UTC – 01:00 AM UTC) Tuesday, April 16, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

USB-6211 simultaneous AI AO issue

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 ?

0 Kudos
Message 1 of 4
(2,434 Views)

Hi Vikash,

 

how should the pwm output change when you don't write it in the loop?

It is set once before the loop - and then it sticks with the set value!

 

THINK DATAFLOW!

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 4
(2,429 Views)

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. 

 

Download All
0 Kudos
Message 3 of 4
(2,363 Views)

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).

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 4 of 4
(2,358 Views)