03-21-2007 04:04 AM
03-22-2007 01:37 PM
03-23-2007 07:28 AM
I'm repeating my last post.
03-23-2007 02:14 PM
03-27-2007 03:40 AM
03-27-2007
09:41 AM
- last edited on
08-07-2025
04:45 PM
by
Content Cleaner
Hello eesen,
It sounds to me like you are pushing the edge of the performance you can get out of your code. This has less to do with the sample clock being used in the DAQmx Create Timing Source.vi and more to do with the execution time of the code you have in the Timed While Loop. One way to determine if this is the case would be to monitor the Finished Late? [i-1] property of your Timed While Loop. If Finished Late? [i-1] is true, then you know that your code is taking longer than the period given by the DAQmx Create Timing Source.vi. There is also a tutorial on our website that discusses benchmarking single-point performance on National Instruments Real-Time hardware. This document can help you determine the maximum performance you can expect from your program and can be found here. Another thing to keep in mind is that your code will execute differently in the development environment than it would on a deployed system. The specifics of this difference are discussed in this document, but I would specifically point out the section that says:
"The RT Development System displays the front panel of the VI while the RT Engine executes the block diagram code. The RT Development System front panel communicates with the RT Engine block diagram through a user interface thread."
At this point, it may be helpful to know what kind of controller you are using. What is your real-time device? Are you planning on running on this device or will you be deploying to a separate real-time target?
03-28-2007 09:03 AM
03-29-2007
05:58 PM
- last edited on
08-07-2025
04:45 PM
by
Content Cleaner
Hello eseen,
I'm not sure what is going on with your data acquisition, but the fact that your communication is locking up suggests that the real-time target processor is being consumed by the timed loop and cannot spare the resources to manage the communication protocol. You may want to monitor the real-time system using the Real-Time System Manager. Aside from this utility, some good information might be: Are you deploying this program as an executable to run on the real-time system? Are you running the program from you development machine? If you are running as a deployed executable, how are you monitoring the front panel? When, exactly, does the freeze occur?
03-30-2007 10:21 AM
Referring all the way back to your block diagram screenshot "sampling_exp.jpg" in the thread you linked at the top of this thread...
Your data acq loop looks pretty tight and clean to me with 1 particular exception (maybe) -- the function call to VMI5565 in a loop that must execute 31 times. Do I remember right that it's some kind of reflective memory driver? Perhaps the reflective memory driver has some latency, and having that function call in your loop is what limits your execution speed to the 1 kHz realm. Try an experiment without that function call and see if you can't execute faster. If it helps, then I'd advise putting all the array processing and VMI5565 call in an independent loop which you feed via a RTFIFO or similar mechanism.
Other little tips:
Also, putting a hw-timed AI Read inside a Timed Loop may not be the ideal approach under RT. In the earlier linked thread, the discussion got pretty far along before it became clear you were using RT.
Looking back at the code snapshot again, the way you're set up appears to guarantee that if you ever start falling behind, you'll never be able to catch up. The Timed Loop only wakes on an AI sample clock. If you miss one, then AI Read will give you the earliest available sample, leaving 1 in the buffer. Your Timed Loop won't wake up again until a 2nd sample goes into the buffer. You'll again read the earliest, leaving 1 in there. Etc.
Maybe it's worth describing the big picture of what your app needs to do, what the response speed needs to be and why, etc. Maybe we're too deep into one specific approach when there may be better general approaches that can still satisfy your main goals.
-Kevin P.
04-02-2007 08:10 AM