DASYLab

cancel
Showing results for 
Search instead for 
Did you mean: 

Time Base/ Block Size Error in Pulse-controlled Relay

Hey all,

 

I'm working on a project in which I would like to log data at an exact rate of one sample per second. I'm trying to do this by using a relay in front of the write module, triggered by a TTL Pulse Generator set for a phase 1 time of 0.1 seconds and a cycle time of 1 second. My write module is in ASCII mode and set to use computer time (learned the hard way not to use "deduct time from data"). With a very simple test setup, this concept seems to work, but when I try to run it in my actual project, I get an error message from the relay module that says that either the time base or the block size of the inputs does not match, so the inputs can not be linked inside the module. Initially I thought this was an issue between the multiple data input channels running through the relay, but even after narrowing it down to only one channel passed through the relay, I got the same error. The only way I managed to eliminate that error was to use a generator with a time based on a syncronizing input tied to the same channel being passed into the relay. However, when I do this, the data file shows several skipped seconds... it skips about one second out of every 10, basically at random. I'm not crazy about the idea of having to sync it like this anyway, because I've already been bitten by an incorrect time base in recorded data, and I can't afford to let it happen again.

 

So, what am I doing wrong? Is there an all-around better way to accomplish this? I need to make sure my data gets recorded at exactly 1Hz based on PC time, not hardware time.

 

Thanks in advance,

 

RJ

0 Kudos
Message 1 of 3
(6,498 Views)

What's the time base of the data channels of the relay. Usually that message means that the TTL Pulse Generator module is timing to "Driver" and the data channels are paced to a different hardware clock or are averaged.

 

To be more precise, consider using the Time Base module (under Special) and configure it to pulse every second. You need an overall sample rate of at least 10 samples/second.

Measurement Computing (MCC) has free technical support. Visit www.mccdaq.com and click on the "Support" tab for all support options, including DASYLab.
0 Kudos
Message 2 of 3
(6,483 Views)

Hi CJ, thanks for your response. The pulse generator is now set to DasyLab, not driver, and a block size of 1. My overall project (and hardware) block size is set to 1, and my overall sampling rate is set to 1000hz with hardware sampling rate of about 2.5hz.

 

I did indeed try using the Time Base module in Pulse-per-second and had much better accuracy with this, but still once I did get it to work, I encountered the problem that data was not actually being written at 1 sample per second. It was consistently skipping 2 or 3 seconds per 10. I also had some luck using an action-controlled relay with an action driven by a time base module, but again, the file showed that seconds were being skipped, and visually monitoring the relay showed that it was not working correctly. It works great in a sample project with generated data, but using real data from real devices, no such luck.

 

RJ

0 Kudos
Message 3 of 3
(6,481 Views)