DAY_OF_WEEK (DATE)
John_Glove
Posts: 95
hi
for tracking event's only on several day's, i take the following cmd: DAY_OF_WEEK (DATE) put it on a sinteger.
that works fine with a button_event or in the startup.
but i want refresh the variable every night on 12pm. so there is a channel_event every night on the same time. the channel_event works every night, but the following cmd doesn't seem to work in this channel_event:
nDay = DAY_OF_WEEK (DATE)
the variable doesn't change.
any hint's?
thanks
john
for tracking event's only on several day's, i take the following cmd: DAY_OF_WEEK (DATE) put it on a sinteger.
that works fine with a button_event or in the startup.
but i want refresh the variable every night on 12pm. so there is a channel_event every night on the same time. the channel_event works every night, but the following cmd doesn't seem to work in this channel_event:
nDay = DAY_OF_WEEK (DATE)
the variable doesn't change.
any hint's?
thanks
john
0
Comments
thanks for the replies.
first, sorry i mean midnight correct :-)
my channel_event works on midnight every night. i do this with (COMPARE_STRING(TIME,'00:05:0?'))
my problem is in the ON event of the channel_event the cmd:
nDay = DAY_OF_WEEK (DATE)
doesn't be updatet. all other cmd in this event works.
example:
CHANNEL_EVENT[vdv__EVENT,003]
{
ON:
{
nDAY = DAY_OF_WEEK (DATE)
}
}
This could help you determine if something else in your code is making changes that you didn't expect.
Here's the axi code, use all, part or none as you see fit.
Try (LDATE) instead of (DATE)
thanks for the code!
i have on all my system's at home this compare_string for minute/hour/day/month/year. this works for a long time without no problem, so i don't want to change them.
the cmd: nDAY = DAY_OF_WEEK (DATE) works on other event's like startup. and gives me the correct day back.
only in the specified channel_event it doesn't works. that's what i didn't understand
the cmd works and the channel_event is triggered, but together.....
that's my question ;-)
And this was the output when I did the button push:
So, doing those functions in a channel event is not inherently broken on the AMX side.
... where sDate is a globally defined CHAR array. I make it a nonvolatile variable so a reboot won't force the event.
with the nDay variable i make some channel_event's (one channel for every_day)
thanks for all the help!
john