parasram Posted March 25, 2011 Share Posted March 25, 2011 Hi, I am sampling 2 analog channels at 20khz, looking for 1ms pulses (~ 10 pulses in a 5s window) and measuring the time between the pulses. I have the streaming working and have the channels with 5s histories. The plan is to run a function on the Channel's event to populate an array of timestamps. I understand that the Channels' events are called when a block is transferred in streaming mode. Is there a way to determine the size of the data array in a block, so that I operate only on fresh data in the channel's event? Thanks, Ryan Link to comment Share on other sites More sharing options...
AzeoTech Posted March 28, 2011 Share Posted March 28, 2011 No as that is determined by the LabJack UD. However, you can get around it by using standard DAQFactory tools, namely subsetting by time. Simply use a variable to store the time of the last data point you processed, then you can just get the new data points by doing something like: myChan[systime(), lastTime + 0.00001] Link to comment Share on other sites More sharing options...
AzeoTech Posted March 28, 2011 Share Posted March 28, 2011 BTW: make sure and use functions like search() and filter() to process through array data since the Event is going to need to be fast. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.