Chaning logging interval in logging sets


Andreschrosa

Recommended Posts

I must change the logging interval via combo box selection, is it possible? I cant find the interval property when I do logging.mylog.Interval.

Is that dosent work, I might have to do a while(1) loop which inserts the latest value from the channels into SQL table then have it wait or delay or waitfor the next 5,10 or 15 minutes, acording to the combo box selection. Would there be any better way of implementing this?

Link to comment
Share on other sites

Only if your logging set is set to Fixed Interval / Snapshot. Then you can change the RefreshRate variable of the logging set. You might be better off creating an export set that logs a single line of data, then creating a sequence that runs the export set at the interval you'd like. You could then just use a global variable for that interval and adjust it from the combo or a slider. Something like this:

global interval = 1
while (1)
   beginexport(myexport)
   delay(interval)
endwhile

You can then change interval from any control. Just make sure interval is constrained and doesn't go below maybe 0.05.

Link to comment
Share on other sites

  • 2 weeks later...

I have a question that is similar to the topic...

You helped me out with this snippet -

private curvar = variable

while (1)
   waitfor(curvar != variable,1)
   curvar = variable
   beginexport(myexport)
endwhile

Now, the code is executing properly, but it is also triggered if the variable goes backwards 1 (not necessarily going negative) and that is not needed.

How can I keep the export trigger from doing that?

Make my trigger variable only change on the positive increment?

An example is this -

The drill pipe is being drilled down and hits 2000ft.

They drill one foot and the export is triggered at 2001ft.

They pick-up the pipe and head backwards going back to 2000ft, and the export is triggered again.

Now I have an export line at 2000ft, 2001ft, and again at 2000ft, ruining my copy and paste procedures. :)

Any pointers would be great!

Link to comment
Share on other sites

Archived

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