Forum Home › Forums › Understanding the Software › Using Formulas › Send command with button
Tagged: Button command formula
- This topic has 6 replies, 3 voices, and was last updated 4 years, 4 months ago by
Mikhail.
-
AuthorPosts
-
August 9, 2021 at 8:28 pm #9380
Dons
ParticipantMy variable is so configured:
Input channel = 11094
Output Channel = 21094Output channel is an OPC Device
I can set a new value with Scada server generator with command 21094 without problems.
Now I need to configure a button to set the variable value.
My settings are:
https://drive.google.com/file/d/1BB3jknGEMXYPqGcSXScBH1KqZO56aU9h/view?usp=sharinghttps://drive.google.com/file/d/18jNd9xtNyu1A5jsMYLQx4A-gx0kxE_6z/view?usp=sharing
… but nothing happens.
Where is the problem ?
August 10, 2021 at 2:25 pm #9382
MikhailModeratorHello,
The settings look OK. Check in ScadaServer.log that commands are received by the server app.August 10, 2021 at 2:26 pm #9383
MikhailModeratorScreenshot of the input channel can be useful
August 10, 2021 at 9:05 pm #9384Dons
ParticipantIf I send a command on 21094 output channel, input channel 11094 is updated and the value is sent to the opc server. (OK)
If the output channel(60000) fornula is
SetVal(11094,5), only the local variable changes but doesn’t send the value to opc server.August 11, 2021 at 5:18 am #9386JW
Participantchanging the value of input channel doesn’t send command to linked output channel.
if you need auto sync, you will need auto control module.
if you just want to send cmd to device and set value of an input channel at the same time once you press a button, you can create a formula
int CmdExample(int c, int v) { SetVal(c,v); return v; }set the device and cmd number of out channel 60000 same as out channel 21094
and enable formula of out channel 60000,
CmdExample(11094,5)August 11, 2021 at 3:40 pm #9394
MikhailModeratorI recommend to change channel type of the channels that are set only from formulas to the Calculated Discrete (or Calculated Real) type.
To send command according to some conditions and actions, Automatic Control Module is needed.
August 11, 2021 at 3:44 pm #9395
MikhailModeratorAs I understand your case, command should be sent by button click. In this case Auto Control Module is not required. But you should correctly set the Command Number and Device fields of the output channels. Device is related to the OPC server.
-
AuthorPosts
- You must be logged in to reply to this topic.