Has anyone built a function block for getting the day of the week? I remember there used to be a function in the AsDateTime library but I can no longer find that library in AS6. Thanks!
Hi,
have you had a look into the function block DTStructureGetTime?
This function blocks reads the actual date and time into a structure of type DTstrucure, which contains a element .wday that represents the day of week.
If you need this information not for the actual date and time, you could set a DATE_AND_TIME variable to the value needed, and convert it using DT_TO_DTstructure.
Best regards!
3 Likes
Ahhh that works! Thank you.
1 Like
Hello CJ and welcome to the B&R Community page!
Please do let us all know if the question has been answered for future easy reference.
Cheers,
Eren
1 Like