Sign in to follow this  
Jimmy1125

Reading a streamed channel

Recommended Posts

Hi

Could you tell me how to read a streamed channel with timing of 0.0? I use the channel for a sequence to find Bottom dead center. I don’t want to read it while streaming because I don’t want the data to add to channel history. I’m plotting the streamed data and afterwards I need to read this channel to return to Bottom. 

Thanks

Share this post


Link to post
Share on other sites

Won’t this read the channel once? I need to read it continuously until motor reaches bottom dead center. 

Share this post


Link to post
Share on other sites

Hello

Disregard my last question. I went back and reread the chapter and got it working. 

The only thing wrong now is the sequence won’t end on it’s own. Am I missing something? Shouldn’t it end itself when completed?

Thanks

Share this post


Link to post
Share on other sites

Hi

Thanks for responding. I had a while(1), read(channel) with a if() followed by another while(). Once I removed the first while() everything worked. 

Now I need some help on counting. I saw the post on counteroffset. I’d like to read 125 counts but I’m having trouble figuring it out. Do I  put something in the RawCounts channel event? Or do some type of sequence?

Share this post


Link to post
Share on other sites

What do you mean by counting?  Do you want to read 125 times then stop?  I'm unsure what you want to do.

Share this post


Link to post
Share on other sites

Sorry

I’d like to stat my stream and read for 125 counts then stop stream. Or possibly just log the data corresponding to those 125 counts. 

Share this post


Link to post
Share on other sites

Starting and stopping the stream like that is impossible because DAQFactory only sees the data in blocks.  You can log that data, however, using an export set.  Just clear the history of the channel before starting the stream (myChannel.clearHistory()), then start the stream.  Once you stop the stream you can log the first 125 values using the expression:

myChannel[numrows(myChannel)-126, numrows(myChannel)-1]

in the export set.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this