Send Commond

Tagged: 

Viewing 13 posts - 1 through 13 (of 13 total)
  • Author
    Posts
  • #16585
    詹森
    Participant

    Send 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

    #16586
    manjey73
    Participant

    No, 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.

    #16592
    詹森
    Participant

    I 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 you

    #16595
    manjey73
    Participant

    Logic Module Development

    You 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.

    #16596
    Mikhail
    Moderator

    Hello,
    Commands can be sent:
    – Using Automatic Control Module
    – With a custom module developed by yourself in C#

    #16602
    詹森
    Participant

    Thank 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

    #16606
    Mikhail
    Moderator

    For now, it’s needed to create an extra channel that compares other channels. The created channel is processed by the module.

    #16613
    詹森
    Participant

    I’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 help

    #16614
    manjey73
    Participant
    public 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.

    #16615
    詹森
    Participant

    The 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

    #16616
    manjey73
    Participant

    The 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.

    #16617
    詹森
    Participant

    OK, thank you.

    #16631
    Mikhail
    Moderator

    if 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.

Viewing 13 posts - 1 through 13 (of 13 total)
  • You must be logged in to reply to this topic.