Time Based Sampling Plan

I’m working on an application that will prompt samples to be taken at specific times according to a sampling plan. What method would be optimal for this application?
Thanks

hello @jzwierzchowskimmc, welcome to the Tulip Community!! it’d be great if you could introduce yourself at: Welcome to the Community, let’s meet!!

there are a couple of Apps I’d recommend taking a look at to start off with in the Library for the use case you’re describing: Audit Checklist, Digital Andon & Manufacturing Resource Calendar.

if you’d rather build the App yourself, you could use logic similar to this one: Different timers - #2 by gio to Trigger different events (such as prompts for sampling) on a schedule you define.

what do you think of these alternatives??

I will also mention that you can join Office Hours tomorrow: https://tulip.co/office-hours-est/, and we can certainly help out with this!!

again, welcome to the Tulip Community!!

1 Like

Thanks for the resources! I’ll check them out and let you know if I have any questions.

@jzwierzchowskimmc, no problem!! I will mention that those Apps aren’t designed exactly for the use case you’re describing, but should provide a starting point and some inspiration as you build out your solution.

yes, please do let us know how it goes as you build your App!!

Those are all very helpful. I’m just having some trouble wrapping around writing the logic for calling the actions in my application. The logic I’m trying to use; If the current time reaches a pre-specified pull time. Then it will notify the operator via lights and/or a message to pull the sample. Scan sample or press button to log sample and return to top of the if loop. With the all triggers requiring a when statement I cant seem to get the logic to do this.

hello @jzwierzchowskimmc, here’s a little demo that should help out based on what I’m understanding.

the first thing we’ll want to do is store the end time in a Variable that we can use to check against the Current Time to see if a task is due. to do this, I’m adding a Variable Seconds that the User Inputs to the Current Time. this is stored via a Button press:

then, on a 5 second timer, the App checks if the time Variable End Time is after the Current Time. if so, the App displays a message showing it’s time to perform a task (of course, you could send the User to another Step or perform any other Action):


in this example, I store 20 seconds to the End Time, which is added to the Current Time:

then, when the End Time Variable is greater than the Current Time, the Message is displayed:

is this what you were inteneding to build??

let us know if this makes sense!!

I think the 3rd screenshot helped clear it up for me. So rather then continuously checking the condition like a more traditional if statement it will check the condition every ___ seconds or minutes. I’ll give this a crack tomorrow I think it should work I’m looking for. I’ll let you know how it goes

ah OK, using something similar to that you can have Triggers fire every X seconds, and you can execute Actions based on that.

I will point out that by default you can’t do 1 Second or 5 Second Triggers. but if you’d like these faster timers, let me know the URL of your instance (via DM if you prefer) and I can enable it for you.

That’d be great if you could that, the shortest time interval available for me is every 30 seconds.

@jzwierzchowskimmc, I have enabled this on your instance. can you confirm you’re now able to access faster intervals??

Yeah it worked, thanks. This a daily sampling plan that will prompt action at fixed predefined times when the current date time matches. Is there a way to update the date portion of my pulltime variable so that it matches with the current date and time pulled from app data

I’m running some test trial of this logic, trying to display a message when current time is equal to a specified time. And it does not work. I’ve tried using later than or equal too but to no avail. Could you help trouble shoot this.

@jzwierzchowskimmc, could you share a screenshot of the Trigger that you’re building that displays the message??

and as a follow up question, how are you determining the specific time to compare to??

@gio I got the timing trigger to work, just had to do a little finicking with it. Essentially there is a AQL sampling plan where a certain number of multiple different types of parts need to be pulled by a specified time. In order for quality tests to be conducted. I am trying to use Tulip as means of notifying operators to pull the parts and log them. And when specified number of parts have been pulled it will prompt for the tests to be conducted and the results recorded. Then integrate the light kits as visuals as of what is going on.

ahh OK, thanks for clarifying @jzwierzchowskimmc. great job getting it to work!! to integrate the Light Kit, you just need to replace the Show Message with Turn On Light Kit Action.

it would be awesome if you could share on: Show and tell - Tulip Community as you build it!!

@gio will do! But in terms of setting up the timing schedule that is reference is it possible to do this via tables and have the date automatically update leaving the same pull times, Im not seeing how to get around this other then using a counter variable that corresponds to different times.

hello @jzwierzchowskimmc, would you like to store the timing schedule in a Tulip Table and use that as the reference?? if so, have you taken a look at this article by any chance: How To Modify Tables Within the App Editor | Tulip Help Center - Support for Building Manufacturing Apps??

@gio Yeah, but this will store only the dateandtime form, this sampling will occur 5 days a week throughout the year. And I would like to try to avoid creating a table for each day the line will be running. So my thought was to use the app opened trigger, set the value of the counter to zero, and then increment the counter by the time elapsed on the app. Then on the standby(1st) step, use the timer trigger firing each second to check if the counter equals countvalue corresponding to different pull times. That is my thought process. Do you think that is a good way to go about it or is there a better way?

@jzwierzchowskimmc do the pulls happen at the same time(s) each day??

if so, you could do something like this:

this Trigger will fire every minute, and when the time is 05:45 (AM), the If statement will be true and the Message will display. would this be useful for you??

1 Like

@gio Yeah the pull times will be the same time each day. Awesome thank you just played with those functions a bit I think this will work great for my application! Hadnt seen much of the different function available in the expression window in any of the Tulip University courses that I had taken, this was super helpful.