Forum Replies Created
-
AuthorPosts
-
August 5, 2025 at 11:45 am in reply to: Auto Control Module : Multichannel Trigger between specific time #16791
MikhailModeratorHi,
Try the function below (not tested):function double TimeToGetHigh() { int hour = Timestamp.Hour; // the Timestamp is a built-in property return Timestamp.Minute == 0 && (hour == 8 || hour == 12 || hour == 18 || hour == 22) ? 1 : 0; }Note that UTC hour is used.
The channel input formula:TimeToGetHigh()
Channel type is calculated.-
This reply was modified 9 months, 3 weeks ago by
Mikhail.
August 4, 2025 at 11:01 am in reply to: Auto Control Module : Multichannel Trigger between specific time #16787
MikhailModeratorHi,
Yes, it’s possible. Please describe the entire task, so I could suggest the better way. What do you plan to do with 0 and 1?August 4, 2025 at 10:38 am in reply to: Auto Control Module : Multichannel Trigger between specific time #16785
MikhailModeratorAlternatively, use Auto Control Module and a time trigger.
August 4, 2025 at 10:37 am in reply to: Auto Control Module : Multichannel Trigger between specific time #16784
MikhailModeratorHi,
I suggest some optimization:1. The above script creates an array on every call. It’s better to initialize the array only once.
2. Use the TimeOfDay property instead of creating new DateTime manually, and compare time spans.
August 1, 2025 at 11:58 am in reply to: Auto Control Module : Multichannel Trigger between specific time #16776
MikhailModeratorI suggest using DateTime.UtcNow.Hour instead of DateTime.Now.Hour because converting universal time to local is slow. Of cause, modern computers don’t notice it.
MikhailModeratorThird, create formulas to insert phone number into commands.
MikhailModeratorHi,
DrvSms allows commands like
+12345;message
So a phone number can stored as a channel value, and then used when generating command text. It requires some formulas.
First, try to send command to the specific phone number.
Second, try saving a phone number in a string channel and implement editing of it.
MikhailModerator> how to use data of 2 channels for returning 1 or 0
Could you provide an example as text?
MikhailModeratorHello,
Please clarify the question and the title.July 31, 2025 at 10:55 am in reply to: Auto Control Module : Multichannel Trigger between specific time #16761
MikhailModeratorAlternatively, you can create a channel that can be 0 or 1 depending on the time, and use it in a multichannel trigger.
July 31, 2025 at 10:54 am in reply to: Auto Control Module : Multichannel Trigger between specific time #16760
MikhailModeratorHi,
The idea of implementing that is to cancel commands if they are sent outside of the allowed period.
A trigger should send commands to the channel. In the channel use the output formula that check time period. To reject a command, return null or double.NaN from the formula.
MikhailModerator🙂
MikhailModeratorHi,
For example
Cnl > 100 ? 1 : 0July 31, 2025 at 10:51 am in reply to: Error “was not in a correct format” when parsing telemetry time #16757
MikhailModeratorHello,
To be able to receive a timestamp, try converting the incoming data to a double encoded as OLE Automation date
MikhailModeratorHi,
Thank you for the update. -
This reply was modified 9 months, 3 weeks ago by
-
AuthorPosts