Set Modbus output at a certain time

Here is what I am trying to accomplish.

I have a modbus output that I change from 0 to 1 at 11:59pm to reset a data logger. The data logger resets, and then sets the modbus valve back to 0.

I was able to configure an email report at 11:58pm using the planner (cron), but I was unable to figure out how to add a command instead of sending an email.

I read through using Basic IDE, but it’s a little over my head, and seems like there should be an easier way using the crontab.

I have the modbus output labeled Reset.

If I use the Basic IDE and enter the command Reset$=1 it works.

Temporarily, I looked at one of the examples scripts on the flexy support page and every 60 seconds it runs a function that checks if its the correct time, and then sets the command. Is there an easier way to do this with cron only?

Thanks.

Hi Joe,

You can use cron statements in the Basic IDE with the command ONDATE. For example, to set the tag Reset to 1 at 11:58pm you could use the following code:

ONDATE 1, "58 23 * * *", "Reset@=1"

For more information you can read the ONDATE section (3.56.3) in the Basic reference guide: https://developer.ewon.biz/system/files_force/rg-0006-01-en-basic-programming.pdf?download=1

I read that on the Basic IDE help page, but I don’t know where to put that code. I tried to put it under the Init section and couldn’t get it to work. Where should this be placed in Basic IDE?

Hi Joe,

It should be placed under the init section. Can you try setting up something like ONDATE 1, "* * * * *", "PRINT 'cron triggered'" that will trigger every minute and print a statement saying as much? Once the code is running, stay in the Basic IDE and keep an eye on the console to make sure that message is printing.