Jimmy1125 Posted May 27, 2018 Share Posted May 27, 2018 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 Link to comment Share on other sites More sharing options...
AzeoTech Posted May 28, 2018 Share Posted May 28, 2018 Sure, just do: read(myChannel) Link to comment Share on other sites More sharing options...
Jimmy1125 Posted May 28, 2018 Author Share Posted May 28, 2018 Won’t this read the channel once? I need to read it continuously until motor reaches bottom dead center. Link to comment Share on other sites More sharing options...
Jimmy1125 Posted May 30, 2018 Author Share Posted May 30, 2018 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 Link to comment Share on other sites More sharing options...
AzeoTech Posted May 30, 2018 Share Posted May 30, 2018 I don't know what you have. Can you post your script? Link to comment Share on other sites More sharing options...
Jimmy1125 Posted June 4, 2018 Author Share Posted June 4, 2018 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? Link to comment Share on other sites More sharing options...
AzeoTech Posted June 6, 2018 Share Posted June 6, 2018 What do you mean by counting? Do you want to read 125 times then stop? I'm unsure what you want to do. Link to comment Share on other sites More sharing options...
Jimmy1125 Posted June 8, 2018 Author Share Posted June 8, 2018 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. Link to comment Share on other sites More sharing options...
AzeoTech Posted June 14, 2018 Share Posted June 14, 2018 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 More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.