08-22-2008 12:59 PM
Hello all
I know that using software timing is not ideal for this application, but I need to write this program for a both a USB-6008 and USB-6221 board. I have attached what I came up with for the 6008 board, and am wondering if there is a better way to accomplish it. What I am trying to to is delay the output of multiple TTL pulses, while at the same time acquiring data (50 to 100 Hz). I am guessing that the digital triggers and analog input will not be perfectly in phase, but I don't know by how much. If anyone out there has a guess as to how far off they will be, or any sugguestions on how to improve the program, I will appreciate it. I just can't wait to get the M series, so I can do this the right way!
Chris O.
08-25-2008 11:19 AM
Hi Chris,
It looks like you have setup up your application to meet your needs working with the software timed DIO. I would suggest that you add some timing to your while loop to avoid polling to computer. You could use the Wait Until Next ms Multiple VI or timed loop to improve the repeatability of your program execution. The DO task will occur when the right conditions are met in software as the AI task will occur based on the hardware timing, so a difference in phase between the tasks would be processor dependant.
Differences Between Wait (ms) and Wait Until Next ms Multiple
http://digital.ni.com/public.nsf/allkb/12B2EA9AD5B265AD86256257004DD8E2?OpenDocument
08-25-2008 11:25 AM
Thanks for the advice, and taking the time to look at it. I will put the wait until ms multiple in, and then be done with this program! I'm glad that someone took time to take a second look at my program, I appreciate it.
Chris
08-25-2008 11:42 AM
Also, when you say processor dependant, if this program is the only thing running on a 2.1 GHz processor, could the phase difference be more than a few ms, or could it get more serious than that
Chris O.
08-26-2008 09:43 AM
Hi Chris,
You would have to test that by measuring the DO signals in time with the AI to determine the timing. The software environment has timing based on the processor and even with only having your OS and VI running, there may be instances where background tasks, etc. can cause some slight delays in the software timing. This issue can be addressed in an M Series Card by sharing a trigger and a sample clock between the tasks to ensure synchronization.
08-26-2008 10:20 AM
Thanks Steve, Our M series board came in today!, so I can get that program written soon!
Chris O.