ARC Pro

Upgrade to ARC Pro

With ARC Pro, your robot is not just a machine; it's your creative partner in the journey of technological exploration.

#233  

@Boris, for the second part of your script here is the part of the solution. I don't have time to build your entire script for you.


:startspy

if ($Omron_Recognized_Name = "Boris10")


goto(check)
endif 
goto(startspy)

:check
#the difference of $last_reco_time and $date must be in minutes

if ($last_reco_time_year = $year AND $last_reco_time_month = $month AND $last_reco_time_day = $day AND $last_reco_time_hour = $hour AND $last_reco_time_minute - $minute < 60)

print("The time was less than 60.") #Print  is just for testing 

$last_reco_time_month = $month
$last_reco_time_year = $year
$last_reco_time_day = $day
$last_reco_time_hour = $hour
$last_reco_time_minute = $minute
EndIf
goto(startspy)

That will give you an idea of what you need to do to cover all of your time/date bases. I will recommend again you take this topic and start a new post so you get more input because likely no one else is going to follow the "Omron" thread if they don't have a camera and this is not related to the camera.

There are also other thread topics from other members who have solved the thread date/time script issues which you could search for in old community posts to see other solutions.

#234  

Hi Justin!

Thanx a lot for oyu help!

First i never (i also told this month before) want to have a complete ready solution!

I only want help! And you helped me again!

That why really big thanks to you! Cool Guy!

I found out with your script ideas what was wrong in my thinking!

I was working with the FmtTimeSpan in wrong way, but i found out in your script that i must separate each "part" - so days - hours - minutes

then i can bring everything to minutes (like breack statement from school)

days * 24 (hours) * 60 (Minutes) hours * 60 (Minutes) minutes (haha - no calculation ;-)

Then everything add and then we can compare the minutes with my "IF and ELSE" Statements

Here is the ready code for calculate the difference between to dates and the result is in minutes:

Update: First you must define a variable:

$date2 = $date

To calulate a difference, i change my computer time, then set the $date2, change again the computer time to the actual time and then the script can give you a result.



$tag = FmtTimeSpan(CDateTime($date) - CDateTime($date2), "dd")
$tagmin = $tag * 24 * 60
print($tag)
print($tagmin)
$stunde = FmtTimeSpan(CDateTime($date) - CDateTime($date2), "hh")
$stundemin = $stunde * 60
print($stunde)
print($stundemin)
$minutespan = FmtTimeSpan(CDateTime($date) - CDateTime($date2), "mm")
print($minutespan)
$kpl_zeit = ($tagmin + $stundemin + $minutespan)
print("The difference is : " + $kpl_zeit + " minutes")



For Translation i use german words:

tag=day stunde=hour zeit=time

And you see Justin, i don´t need a new Post, you fix this problem wih two answers! Come on, this is great!

Boris

#235  

I will write now the hole script for the omron cam and then i will post the hole script

Boris