10-30-2007 04:19 AM
10-30-2007 04:21 AM
10-30-2007 04:24 AM
10-30-2007 04:28 AM
10-30-2007 04:36 AM
10-30-2007 06:08 AM
My aim is to execute the loop for 25ms of time...even if i use Tick Count..i cant able to set the start time as 0.
10-30-2007 07:02 AM
10-30-2007 07:08 AM
10-31-2007 02:40 PM - edited 10-31-2007 02:40 PM
Hi Meenatchi,
Let me check if I understand what you want; you want to write data continuously for 25 ms, so you are going to be setting up Analog Output task that will generate a voltage and you want this voltage to be outputted for 25 ms. Before trying to help you I will strongly recommend taking a look at this resource: Getting Started with NI-DAQmx: Main Page.
Basically you have two options either you generate enough “samples” with respect to you “rate” to generate 25 ms in “N Samples” generation mode or you try to control the data from the while loop. The best way of doing this is to change the “samples to write” to a number that will result in 25 ms. I have attached a code that will help you accomplish this; you will need to adjust the code to meet your needs but is a very good place to start. Controlling the while loop you will need to setup your task for 1 Sample (on demand or HW timed) and use the tick approach describe by (dan_u); also Instead of the “tick” function you can use the “Get Date/Time in seconds” with the same approach; the problem here is that is going to be software depended and it is not going to be deterministic so you will not get exactly 25 ms.
I either case if you choose to do software timing using "tick" or "Get Date/Time" you can keep posting in the thread, but if you have more question regarding hardware timing I will suggest posting in the "Multifunction DAQ forum".
I hope it helps.
Message Edited by Jaime F on 10-31-2007 02:42 PM
11-01-2007 01:40 PM