‎08-25-2009 09:31 AM
How do I go about setting up a timed loop? I want the loop to run every 0.1 s?What should I hook up to the source name? I tried to hook up a Get Date/Time in seconds.vi to seconds to date time.vi to get fractional seconds, but when I attached this to the source and put 0.1 as dt, it didnt run, nbo errors, just nothing happend?
Cheers,
Sam
‎08-25-2009 09:36 AM
Sam,
a timed loop can create it's clocksource on its own. So if you don't need access to the clocksource somewhere else and if you don't need external clocking, i'd go for that.
In order to configure the clock, double click the left box on the loop and select the settings. The settings for instance can be Source Type 1kHz Clock and Period 100 ms.
hope this helps,
Norbert
‎08-25-2009 09:38 AM
If you don't wire anything it will default to the built-in 1 ms clock.
If you have a hardware device you can use it for the timing source.
For what you are doing the hardware clock should not be required.
Ben
‎08-26-2009 05:04 AM
Im using a DAQ assistant to read from accelerometers, how do I get this to be the clocksource?
Cheers
‎08-26-2009 08:13 AM
Im tring to run the a loop of 0.1secs in which data is written to a file, however,when I do this off the timed loops clock source, the time for each result is 0.1s but only to 1 decimal place. How do I fix this?
Cheers
‎08-26-2009 08:16 AM
Sam,
as far as i know, you cannot use a task configured in the assistant as clock source of a timed loop. But i doubt that this is necessary at all.
In order to make sure that my proposition is correct, i ask you to describe what your application should do.
thanks,
Norbert
‎08-26-2009 08:33 AM
Well my program reads 3 values from an anemometer via a serial port, reads 3 values from accelerometers connected via an A/D board, and then write these vales to a file with the time (including fractional seconds) all within the loop. However I need the program to have a frequency of 10Hz, or a loop time of 0.1 seconds. However when I use a timed loop, with a dt of 100 ms, the time values written to the file are not exactly 0.1s apart. e.g. the first value could have a time of 9.1507855 seconds but then the next time would have a time of 9.26897778,its only exact to 1 decimal place. Im also unsure, as to which time is correct?I have tried to use the 'Profile Performance and Memory' tool to work out the delay between values being read and a the 'get date/time vi' assigning a time, but the results it gives are well confusing.
Cheers
‎08-26-2009 08:41 AM
The anemometers via serial are not deterministic.
Ben
‎08-26-2009 08:55 AM
‎08-26-2009 09:08 AM
The anemometers use serial which breaks up a reading into multiple data bytes and transmits one after the other which in turn have to be framed by the hardware and transfered via interupts servie routines and Winows shared memory buffers before they are availabel to any app. That long string of uncontrolled events add up to an un-determined amount of time. So anything we get from serial is always "history" and how old can only be determined by using AI hardware to analyze the data packets on the wire after the fact.
THe anemometers I have used (WindMaster) are NOT periodic.
Ben