Holding a reading


Recommended Posts

I will be using DaqFactory to read an A/D board. Is it possible by digital input signal to hold the value for say 30 seconds and then resuming reading from the A/D board? This is a mudlogging application and I need to do this while I change dilutions on my gas detector to give time for the sensor to settle back down to the correct value after the dilution change - otherwise bad data would end up being logged.

Link to comment
Share on other sites

Sure, you can set the Timing of the channel to 0 for that time. You'd create a sequence to do this, something like:

myChannel.Timing = 0

channel.restart()

delay(30)

myChannel.Timing = 1

channel.restart()

Then in the event for the digital input, you just call beginseq(myseq) to start that sequence and stop acquisition on myChannel for 30 seconds.

Link to comment
Share on other sites

I actually plan to have a five position radial switch with a position for each dilution setting and with each setting a TTL routed to a different digital input port so the computer knows which setting it is on. Could this delay sequence be triggered by the change in input port/setting value or will I need a seperate dedicated digital input switch to initiate the delay?

I should add I'm very new to this.

Link to comment
Share on other sites

Thanks. That makes sense. One more question though:

Rather than stopping acquisition for 30 seconds can it be made to hold and keep sending the last value read before the 30 second period? Somehow get it to keep supplying the last value read for 30 seconds? I still want to transmit that value serially during this 30 second period kind of fooling the system to think the reading is steady for that 30 seconds. Does the stopping acquisition for 30 seconds do this?

Link to comment
Share on other sites

Sure, its just slightly more complicated:

myChannel.Timing = 0
channel.restart()
private starttime = systime() + 30
while(systime() < starttime)
   myChannel.addValue(inserttime(myChannel[0], systime(), 0))
   delay(1)
endwhile
myChannel.Timing = 1
channel.restart()

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.