gse Posted April 25, 2004 Share Posted April 25, 2004 The version of DAQFactory is the Lite 32-IO. Sorry for not specifying on the last posting. Repeated Question: How do you clear the history in the real and virtual channels using sequences? New Question: Is it possible to create working variables in sequences in order to perform counters in loops similar to C or other programming languages? Link to comment Share on other sites More sharing options...
AzeoTech Posted April 25, 2004 Share Posted April 25, 2004 Yes, sequences are a scripting language and can do most things that C can. Variables work slightly differently though because there are variables AND channels. First I suggest checking out the chapter in the help file on sequences, as it will walk you through everything and should open up all sorts of possibilities to you. But to answer your question, lets say you want to loop 10 times: for (Private.counter = 0, Private.counter < 10, Private.counter++) ? ... something in the loop endfor or, if you prefer: Private.counter = 0 while (Private.counter < 10) ? ... something in the loop ? Private.counter++ endwhile You will probably want to put a wait() or delay() statement in the loop unless its a really short loop or the sequence will hang your computer while it runs the loop. Repeated question: Clearing a history in a sequence. As I mentioned before, its done by using a channel function. Lets say your channel name is MyChannel. The following will read MyChannel once a second for 10 times, then wait 10 seconds then clear the history and repeat: while (1) for (Private.counter = 0, Private.counter < 10, Private.counter++) read(MyChannel) wait(1) endfor wait(10) MyChannel.ClearHistory() endwhile Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.