Forum Home › Forums › Understanding the Software › Using Formulas › Send command
Tagged: send command
- This topic has 56 replies, 10 voices, and was last updated 11 months, 3 weeks ago by
Mikhail.
-
AuthorPosts
-
July 23, 2024 at 5:49 am #15003
redass
Participantso I would like to create several buttons with different commands. What formula to use for example. connect the circuit with command 111e or turn off the circuit with command 1122
Is it enough to enter a channel with a given value in output?July 23, 2024 at 5:59 am #15004manjey73
ParticipantYes, it seems enough to specify the values in the output formula, but you have a value in hex format – 111e. You need to try, the output variable will also be double, you will probably need to convert it, for example, into a byte array, that is, use CmdData instead of Cmd
July 23, 2024 at 6:10 am #15005redass
ParticipantSince I’m a beginner, what should I do step by step? Where to enter which formula? I’ll write it down. At this moment, when I turn it on using the button connected to channel no. 1031, the console to enter the value starts and this is how it works at the moment. I want the button (or even different buttons to send different commands) and when the button is turned on, the circuit sends the 111e command. When I click the second button, I want it to send the command 1122. How and where exactly should I set this?
July 23, 2024 at 6:57 am #15006manjey73
ParticipantWhat do you enter when the command window opens and it works as it should?
July 23, 2024 at 7:01 am #15007redass
Participant111e circuit activation
1122 circuit tripJuly 23, 2024 at 7:45 am #15008redass
Participantjust the value 111e in the popup
July 23, 2024 at 7:59 am #15009manjey73
ParticipantOnce you have indicated that the channel type is hex, write in the output formula of channel 111e and specify “Send command immediately” on the mnemonic and check.
If you need to send different values using different buttons, then you probably need to write a formula and use an enumeration.
July 23, 2024 at 11:39 am #15011Mikhail
ModeratorDo you need many buttons that send different command values via the same channel?
July 24, 2024 at 4:21 am #15015redass
Participant@Mikhail
Exactly, the simplest way would be if there was such a function when adding a button with the send command now option immediately with a given value (somewhere nearby). The next one is the same button but a different value (111e, 1122, 113d) each button for a different value.July 24, 2024 at 6:42 am #15016manjey73
ParticipantHmm, sending different values from different buttons but to the same channel is a rare task. I remember there was such a problem, just related to the fact that it is impossible to specify a value when selecting “Send command immediately”
You need to make several calculation channels that will have their own formulas with different values to specify these channels in the buttons.
The Modbus device to which you are sending commands?
Add additional commands to the template that will lead to the same register and link them to the created channels.July 24, 2024 at 6:44 am #15017manjey73
ParticipantAnother option is to use the Auto-control Module and calculation channels for the values. But it seems to be superfluous here if Modbus is used
July 24, 2024 at 8:58 am #15020Mikhail
ModeratorOption 1
Use enumeration format, for example, On-Off. The command sending form will show several buttons.Option 2
Put several buttons on a scheme (mimic diagram). In this case you need a channel of the output type for each button, because a button component sends value = 0. -
AuthorPosts
- You must be logged in to reply to this topic.