Hello. I am trying to compare a date from a list with todays date to see how many days apart they are. Ideally I would like to find the dates that are less than a week apart. Here is what I have but i get an error which looks like all the dates are being populated from the list into the end date. the 6/13/2022 is just a test date. I could probably move the get todaysdate into that spot. I just can't get the duration to work properly. I would like it to create a notifier when it finds the date in the list. Thanks for any help mark
Try this way, duration returns the milliseconds between instants
Make instant returns an instant in time specified by MM/dd/YYYY hh:mm:ss or MM/dd/YYYY or hh:mm.
Hi thank you that worked. it shows how many days till a certain date. I think in need to go the opposite way. I need to search the list and find the dates that will expire in 5 days from todays date. for example say the end date is set for 3/18/2022 and todays date is 3/13/2022. I want to be able to send a notify box saying 1 item will expire in 5 days. i assume the list? thing is where the change needs to be made? or is their and easier way? Here is what I modified so far the label1.text is just there so i can see what it is doing. I will be removed
Something like this maybe
Or something like this: dateList.aia (5.3 KB) 3 Likes
Hi thank you dora and anke I got it working with your help 1 Like
Hi I have been stuck on this for a couple of days. I want to compare incoming data to already stored data and if it is different, update the database and then display the saved data. I believe it is something to do with the clock timer, because the value will stay on screen if it's just one piece of data but as soon as I add another it only stays on the screen for the period I have set the timer. I can receive and display data from arduino no problems, just comparing and saving giving me problems .
Syth:
try moving the block (call Update_All_Values3) inside Compare_to_Database3 if Temp_RPM ≠ global RPM then [call Database .StoreValue] [call Update_All_Values3] 1 Like
Salman_Dev:
That works for the one value but as soon as I call compare_to_database in the second if/then it's the same problem. I also tried moving the compare_to_database outside the if/thens that replace the text and outside the receive bytes but that returns nothing. 1 Like
do you mean you just got value from RPM and Gain not give you any value? 1 Like
Yep, just blank in the text field. If i call compare_to_database in each if/then the text is displayed but only for the length of the timer. If i change the length of the timer the data is displayed for that length.
Is DelimiteByte = 10 set? What is the transmitter code like?
Delimiter is 10. I've changed the code and app and this seems to be working. Code: (this obviously isn't my whole code, just the sending part) BTserial.print("R"); BTserial.print(rpm); BTserial.print("|"); BTserial.print("G"); BTserial.print(gain); BTserial.println("\n"); The character i send before the value is just an identifier. Here are the app blocks, short version, have tested these with 5 values so far. Next question, is it best practice to clear globals and tags in database before replacing them or can I just write directly over them? Thanks for the help
Syth:
Another idea would be to save time, RPM and Gain. BTW, about println() print("one"); ------> one println("one"); ------> one\r\n println(); ------> \r\n print("one"); \n is 10 in ASCII hex.
Juan_Antonio:
Been working all day so my brain is a bit fried.
println("\n") -----> \n\r\n try: BTserial.println(gain); I assume that your BTserial works the same as Serial.
Juan_Antonio:
Ah I see, thanks. Yep that's just the name i gave to the software serial on the arduino. ABG:
Thanks, will keep that in mind for future. Mostly just saving the values now so they persist each time the app starts |