Timing, variables, and error catching...


Recommended Posts

Hello again AzeoTech!

Have a few questions that need opinion answers rather than factual answers...

I am now finding some of my variables that are time based are not "lining" up properly, should I insert time on all my variables so I know the time of each?

When I set priorities on my sequences, does it affect the time of variables?

I see in some of your code examples you sometimes subtract a second, is this for lining up values?

Also, on one of my variables, I am starting to think DF is "auto-rounding" up my value and affecting the output of another value...(depth auto rounding causing drate to "look" faster...sound right??)

Do I need to check my values and format them accordingly?

Also, I just need a point in the right direction for error catching/handling....

I would like to ensure that if errors happen, do something else... :)

Any input is great and thanks for your masterful insight, Guru!

Link to comment
Share on other sites

"I am now finding some of my variables that are time based are not "lining" up properly, should I insert time on all my variables so I know the time of each?"

If they need to be exactly the same time, then yes. DAQFactory can only figure so much out when it comes to time. For example if you do x + y and x and y have different times, which time should the result have? So, to ensure you get the time you want, use insertTime() or .time to set it explicitly.

"When I set priorities on my sequences, does it affect the time of variables?"

Only in so much that priorities affect when sequences execute. The time stamp is still whenever the event occurred.

"I see in some of your code examples you sometimes subtract a second, is this for lining up values?"

You mean in insertTime()? That's just habit. InsertTime() works on arrays, so if you have an array of values with no time that are spaced by 1 second, you can do -1 at the end to have DAQFactory decrement the time stamp by 1 second each array item. If you only have one element, it doesn't do anything.

"Also, on one of my variables, I am starting to think DF is "auto-rounding" up my value and affecting the output of another value...(depth auto rounding causing drate to "look" faster...sound right??)"

DAQFactory doesn't do any processing of data unless you specify it. That said, remember that floating point values are not perfectly precise if there is anything in the decimal. They are precise on the integer side. So, 15.1 is actually probably stored as something like 15.09999999999997 (I didn't count the number of 9's, so no one get on my case about precision of doubles!) Because of this, DAQFactory will try and process the value so when you display it, it displays as 15.1 and not 15.0999999999997. This should only affect display, not calculations.

"Do I need to check my values and format them accordingly?"

I don't know. I doubt it. I'd try and figure out what's going on. Find the problem, don't chase the symptom.

"Also, I just need a point in the right direction for error catching/handling...."

I need more detail than that. Its a pretty broad topic.

Link to comment
Share on other sites

Archived

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