From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

Synchronized AI and AO on PCI-6052E

Hi,
I need to acquire data on analog i/p channels and send out a TTL pulse on the analog o/p channel simlutaneously,both based on a trigger on PFI0 pin .I could create a vi that does only triggered AI and a seperate vi that does triggered AO.But when I try to combine the AI and AO in to a single vi it doesn't work.
The program consists of a simple while loop with AI and AO functionalities.AO config and AI config are outside the while loop.I have attached the vis.
Quick response is highly appreciated!
Thanks,
Shiv
Download All
0 Kudos
Message 1 of 7
(2,773 Views)
I tried to get your vi to open, though it was missing some subvi's.

I would suggest to try to debug your code using highlight exectution. Go to the block diagram and click on the lightbulb button up top. Then run your program. This will allow you to see where your program is getting caught up at and may give you some more insight on why it is not working properly. Let me know what you find out.

Brian
0 Kudos
Message 2 of 7
(2,773 Views)
Shiv,

I can see how both of your VIs separately would work. My concern is when you combine both of them. I'm specifically looking at your AI Read VI. Can you run this VI with the execution highlighting on (select the light bulb on the diagram)? If your AI read is executed BEFORE the AO Start VI, then the AI Read ties up the Data Acquisition thread, and the AO Start VI won't start until your AI Read comes back with data; by this point, your start pulse has occurred.

See, both VIs run in the Data Acquisition thread. When AI Read is called and the data isn't ready yet, it ties up the thread until the data IS available. Any other data acquisition VIs must wait until this VI finishes and releases the thread until they can execute.

If this is indeed
the case, then you just need to make sure your AO start VI runs before your AI Read VI runs. This can be accomplished by putting a sequence box around the AI Read, and running a wire from any output of the AO Start to the edge of the sequence; you don't have to wire it to the AI Read. This means the sequence can't start until all inputs (including the one you wired, even though it doesn't go anywhere) must be available before it can execute.

Also, try looking at the errors that come out of the VIs. Use an indicator to see it, or wire the error to an Error Handler VI located in the Time & Dialog palette.

Mark
0 Kudos
Message 3 of 7
(2,773 Views)
I had a similar problem with a 6034E: generate a ramp pattern while reading some analogue channels.
I found in the Resource Library (how is it called now??) the zip file attached, with some examples of simultaneous input and output.
The solution I adopted, summarized in the skeleton VI also attached, is conceptually this one:
- setup your AO to start on AI start; write your waveform to output an execute AO Start.vi
- setup your AI to start as you need it (in your case, with a digital slope in PFI0); execute AI Start.vi
- when the edge is seen in PFI0, both AI and AO starts simultaneously.

Hope this helps

Roberto


Proud to use LW/CVI from 3.1 on.

My contributions to the Developer Community
________________________________________
If I have helped you, why not giving me a kudos?
Download All
0 Kudos
Message 4 of 7
(2,773 Views)
Roberto,
Thanks for the info.I tried setting the trigger on AO Start to AI start trigger and left the trigger as PFI0 for AI start.If I trigger at 4 or 5 triggers a second I am having trouble.It misses some triggers.

-Shiva
0 Kudos
Message 5 of 7
(2,773 Views)
Shiva, I'm sorry for this late response. I can't help you in this matter: I had no experience on repetitive triggers in this condition; maybe someone else out there has. Nevertheless, I assume that the card should be able to 'litsen' all triggers, unless it's still busy in the previous generation and/or acquisition. Are you receiving an error or warning in this condition?
Roberto


Proud to use LW/CVI from 3.1 on.

My contributions to the Developer Community
________________________________________
If I have helped you, why not giving me a kudos?
0 Kudos
Message 6 of 7
(2,773 Views)
Roberto,
Thanks for the help.It doesn't give any errors nor does it show any warnings.
-Shiva
0 Kudos
Message 7 of 7
(2,773 Views)