Reading a streamed channel

Recommended Posts


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. 


Link to comment
Share on other sites


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?

Link to comment
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.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.