Forum Home › Forums › Understanding the Software › Using Formulas › Send Commond
Tagged: Send Commond
- This topic has 12 replies, 3 voices, and was last updated 1 day, 19 hours ago by
Mikhail.
-
AuthorPosts
-
July 6, 2025 at 3:53 am #16585
詹森
ParticipantSend a command in the script to a channel with a TagCode? For example, on the Table, you can directly call SetData() to manually input values and send them to the TagCode channel to achieve device control. May I ask if it’s possible to directly use the script to control the device? Thank you very much for your answer
July 6, 2025 at 7:34 am #16586manjey73
ParticipantNo, scripts don’t have access to send commands to devices. This can only be done by modules. For example, an automatic control module or your own.
July 7, 2025 at 9:17 am #16592詹森
ParticipantI have found that there are significant limitations in using the automatic control module. Can it be further improved in the future? For example, “Multi-Channel Data Trigger” can select another channel for copying the Value, which is very commonly used
Also, what does “my own module” refer to? How is it achieved?
Could you please tell me? Thank youJuly 7, 2025 at 10:30 am #16595manjey73
ParticipantYou can write your own control module if you are not satisfied with the Automatic Control Module from RapidScada.
Yes, the Automatic Control Module has limitations, especially if you need to control many different parameters. You can get around this by using scripts, creating one channel that will then control the module, but it’s not always that simple.July 7, 2025 at 10:40 am #16596Mikhail
ModeratorHello,
Commands can be sent:
– Using Automatic Control Module
– With a custom module developed by yourself in C#July 7, 2025 at 11:17 am #16602詹森
ParticipantThank you for your help. Then I am even more looking forward to the optimization of the automatic control module. Just as I said above, after the multi-channel trigger is met, copy value can be performed using the specified channel, which will meet the vast majority of requirements
July 8, 2025 at 8:51 am #16606Mikhail
ModeratorFor now, it’s needed to create an extra channel that compares other channels. The created channel is processed by the module.
July 8, 2025 at 9:27 am #16613詹森
ParticipantI’ll re-describe one of my scenes
For example, if I want to determine that the conditions of Channel1==1 && Channel2==2 are met, and I want to send the Value of Channel3 through the self-control module (that is, Copy the value of Channel3), how should I do it? Thank you for your helpJuly 8, 2025 at 9:46 am #16614manjey73
Participantpublic bool TwoChannel (int chn1, int chn2) { bool chn12 = false; if (Val(chn1) == 1 && Val(chn2) == 2) chn12 = true; return chn12; }
For example, add this formula to Scripts and then use it in an additional Calculated channel.
You can write a more complex formula for comparing channels so that you can even select the comparison values and the type of comparison. And make the script more versatile for different tasks.
July 8, 2025 at 9:55 am #16615詹森
ParticipantThe possible issue lies in the limitations of the self-control module. For instance, in an application scenario: you want to use a multi-channel trigger, but the multi-channel trigger cannot send data from the specified channel
July 8, 2025 at 10:03 am #16616manjey73
ParticipantThe automatic control module is quite self-sufficient. It is impossible to build complex scenarios on it, even if you provide for some part. Therefore, for complex scenarios, additional calculation channels are used, for which you already configure the module and perform some actions to send commands.
If it needs to be even more complicated, I wrote a program execution module in which the code is written in C# in Visual Studio and communication with channels is performed. The module has not been finalized yet, but you can look at the example of ModFarm for an example of building programs.July 8, 2025 at 12:43 pm #16617詹森
ParticipantOK, thank you.
July 9, 2025 at 1:47 pm #16631Mikhail
Moderatorif I want to determine that the conditions of Channel1==1 && Channel2==2 are met, and I want to send the Value of Channel3
It can be configured in Auto Control Module using a Multi-Channel Data Trigger.
-
AuthorPosts
- You must be logged in to reply to this topic.