Our full technical support staff does not monitor this forum. If you need assistance from a member of our staff, please submit your question from the Ask a Question page.


Log in or register to post/reply in the forum.

How to use TimeIntoInterval in a subscan?


Hanne Berghuis May 11, 2023 12:43 PM

For my program I want to read out my sensor every minute (Scan(60,Sec,5,0)). 

However, I have one sensor (a self calibrating soil heat flux plate) that needs to read out data every second. Therefore I have created a subScan within the main Scan (SubScan(1,sec,60)) . I want to calibrate this sensor every day. 170 seconds after the start of each calibration, I need to read out my sensor. I wanted to do this using the 'TImeIntoInterval' command:

If (TimeIntoInterval (startCalibration+170, calibrationInterval, Sec)) Then
.....
EndIf

This is not possible, it gives the following error:

"Scan interval must be integrally divisible into interval.Error(s) detected in the program". 

It seems to me that the function TimeIntoInterval does not work because I use an interval smaller than the interval of the main Scan (even though this is programmed in the subscan). Does anyone have a suggestion to solve this issue.

Thanks a lot in advance!

Hanne


robertmerrill May 12, 2023 09:39 AM

This post is under review.


smile May 13, 2023 08:48 AM

Run the main table at one second and do an "if time" to measure and do which you need only every minute.

Be careful however that within the 170 seconds of calibration interval you will also have 2 one-minute measurements.

for example, you could use a flag to block the measure per minute, if you are in the calibration phase.

Smile


Farwer32 May 15, 2023 11:33 AM

This post is under review.


ohKaij4oox! Aug 24, 2023 02:25 AM

This post is under review.

Log in or register to post/reply in the forum.