Forum Home › Forums › Understanding the Software › Send Setpoint value (float number)
- This topic has 14 replies, 5 voices, and was last updated 5 years, 9 months ago by Mikhail.
-
AuthorPosts
-
July 26, 2017 at 8:11 am #2399traudenParticipant
Hi everyone,
I have a trouble when I want to send setpoint value to Device (connecting to OPC). I use dynamic text to send desired values but in the scheme received values are different.
The command values are created in the attached pictures (1).
I set in command values 10;50.5;101.5
Results of command are different 0,1,2. (can see in the pictures)
Anybody can help me.
the pictures are here.
https://photos.app.goo.gl/nkdT9QJJJywbMaUy1July 26, 2017 at 10:43 am #2400manjey73ParticipantWhen transferring 10;50.5;101.5 are values, this is the text for the buttons.
The value is precisely 0 , 1 and 2
Need for a control channel to write a formula that will check the value 0,1 or 2 and substitute these values instead of the required 10, 50.5 или101.5
And may also have the formula of permutation bytes, if you work directly with the device. With OPC has faced, may not require.July 26, 2017 at 1:19 pm #2402MikhailModeratorThat’s right.
Note: in English control channels are named “output channels”.July 26, 2017 at 2:09 pm #2405traudenParticipantI also tested with the simple formulas ( Cnl*100) but the commands returned only 0.00. Without formula results are 0.00 1.00 and 2.00. I dont know data type of the results. Is int or real or string?
July 26, 2017 at 2:30 pm #2406manjey73ParticipantAll formulas return a double, but to enumerate the possible integer values only.
On; Off; Reset values 0, 1 and 2
; Off; Reset values 1 and 2 appear to have two buttons Off and ResetIn the output channel to be used in the formula Cmd*100 (example)
Or write more complex formula in the database of formulas, call it for example Out_real, and to apply the output channel Out_real(Cmd)Where is Cmd will get the values 0, 1 or 2 and depending on them you will return the desired value.
- This reply was modified 7 years, 1 month ago by manjey73.
July 27, 2017 at 2:23 am #2408traudenParticipantI’ve writen a formula
double SPFloat()
{
if(Cnl==0) return 10.5;
if(Cnl==1) return 50.0
if(Cnl==2) return 101.5
}
it’s correct.July 27, 2017 at 3:55 pm #2418MikhailModeratorTalking about commands, you should use Cmd instead of Cnl.
Anyway this formula causes compilation error because a function must return a value from all logical branches.July 27, 2017 at 3:57 pm #2419MikhailModeratorIf you can use Visual Studio, the Formula Tester project helps you to debug your formulas.
July 27, 2017 at 5:09 pm #2420traudenParticipantThank so much Mikhail.
June 18, 2018 at 6:19 pm #3868tom040264ParticipantHi,
I have tried to do exactly what has been proposed, but it doesn’t work. I want to send a setpoint to an address (in my case a pH setpoint to the address 2109 in a modbus device). In the Communicator I’ve created a command, and tried to send a new setpoint from the “Commands tab”. The message “The command has been sent successfully” appeared, but the setpoint has not been changed. In the log file there is no trace from the command and in the “Devices data” of the communicator no command is shown.
All input channels work perfectly. I still haven’t create any output channel.
H E L P ! ;-)))
Thank you in advance
T.
June 20, 2018 at 8:05 am #3878MikhailModeratorIn the log file there is no trace from the command
Hi,
You need to find info in a communication line log. The name of the file is C:\SCADA\ScadaComm\Log\lineXXX.log
I think this will clarify the cause.June 20, 2018 at 8:06 am #3879MikhailModeratorThe command has been sent successfully
This message means sending command from the shell to the service.
December 18, 2018 at 8:03 pm #4750MarCus0ParticipantHi All
I have similar problem and I did not find ansver there.
I have output chanel and it working corectly when I send command directly what mean to on/off I send 256/512 value.
To simplifiy I trying to convert to 0/1 by Formula “(Cmd*256)+256”.
What ever I did allways I get:
2018-12-18 20:53:32 Command to the Device 10 “Bufor_4_chanel”, type: KpModbus, address: 4
Command “Chanel_1_cmd”
Send (8): 04 06 00 01 00 01 19 9F
Receive (5/5): 04 06 00 01 00
Receive (3/3): 01 19 9F
OK!
what mean it sending 1 instead 512(calculated formula)?
SCADA-AdminCan You help with it,please?
December 18, 2018 at 10:28 pm #4751MarCus0ParticipantHi Again
OK. I found something.
It not working when I send command from communicator.
When I created table with commands formulas started convert values as it should.Question, what it difference when I send command from Communicator and WebInterface?
In Communicator I send Standard command?Regards
December 19, 2018 at 2:13 pm #4754MikhailModeratorHi,
When you send a command from Webstation, it goes to Server and can be modified by formula. Server passes the command to Communicator. When you send a command from Communicator, there is no calculations. -
AuthorPosts
- You must be logged in to reply to this topic.