Sign in to follow this  
gse

Clear History

Recommended Posts

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?

Share this post


Link to post
Share on other sites

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

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