Discussion:
Multi-Function-Ctr Retrigg Pulse Train Generation for AI Sample Clock VI modification, help!
(too old to reply)
diishen
2008-07-16 16:10:12 UTC
Permalink
Hey guys, First of all, this problem might sound a bit vague because I did not write this code so I am not 100% sure of what the problem really is; for those curious, this program was incomplete and I am picking it up from where the author left it a year ago. This is a modification of the Multi-Function-Ctr Retrigg Pulse Train Generation for AI Sample Clock VI example. I am hooking up a delay generation set at rate of 1000Hz to the BNC-2110. What is changed in the program are the following:-Rate is changed to 1000000 Hz -Samples per channel is changed to 750-Sample clock is changed to Finite Samples-Added number of triggers (N) and regions (R), N*R must be 1000-The program writes a binary .dat file which will be analyzed in MATLAB so the DAQmx Read in the case structure is set to Raw 1D U16-The program must run for a user-defined amount of time, and this is at least 5 minutes, at most 10 minutesSo before I even throw the .dat file into MATLAB for analysis, I already realized that everytime the .dat file has been created, the file size is different which means I am getting different amount of data each time. I suspect that it's the buffer size and/or the DAQmx Read timeout value but I still can't seem to make the file size consistent regardless of how I change it (indicating that more problems will surface when I throw this into my MATLAB code).I've attached both my VI and my MATLAB code (change extension to .m) for those interested. Any suggestions or ideas are greatly appreciated!Message Edited by diishen on 07-16-2008 11:09 AM


dummy1.vi:
http://forums.ni.com/attachments/ni/250/41580/1/dummy1.vi


dummy.txt:
http://forums.ni.com/attachments/ni/250/41580/2/dummy.txt
samantham
2008-07-22 14:10:12 UTC
Permalink
Hello,

I took a look at the code and would like some more background information about the application.  Please take some time to clarify with more detail what the purpose of the application is and what needs to be accomplished for the application to work.  With this information, I can make a better recommendation of what to change or restructure.  For example, the AI has been changed to finite, as you noted, however is this because you want to have only a certain number of triggers processed for the retriggerable application?  I also noted that there are different values supplied to the Samples for Channel input for the Counter and the AI task.  Then, the AI task reads all available samples, which might contribute to the different file sizes.  It also looks like there might be an easier and more secure way to do finite acquisition on a retriggerable sample clock; however I am not sure if this is your goal.

I realize you are picking up where someone left off, so I think taking a small step back to explain what the code needs to do will help.  So we can focus our efforts on what and not how in order to determine if we are starting with the right structure.
Loading...