Forum Home › Forums › Understanding the Software › Sending Int16 or Uint16 as command value
- This topic has 18 replies, 2 voices, and was last updated 8 years, 6 months ago by Mikhail.
-
AuthorPosts
-
September 17, 2015 at 3:14 pm #494dejanParticipant
Hi Mikhail,
I am trying to send 2-byte integer as command value to the Modbus device. In “Output channels” table for the specified output channel I have declared “Standard” as “Command Type”. As far as I understand in this case the value is being sent as a 4-byte floating point number. Can’t figure out how to send the value as a 2-byte integer. Moreover, by checking the Communicator log i see that the actual value sent is always 00 00 regardless of the value entered in the Value box.
Please help,
DejanSeptember 17, 2015 at 7:01 pm #495MikhailModeratorHi Dejan,
Your configuration seems correct. In the new version of SCADA-Communicator commands are displayed on the Device Data page. What is the command value there?September 18, 2015 at 7:31 am #505dejanParticipantI’m still using the previous version 4.4 of Communicator and I can’t see command values there. Regardless of that, in “Standard” command type description provided in Administrator app, it says that for “Standard” type, command parameter is floating point number. And it seems that value entered is treated as such. So, I have no idea how to send an integer as command value.
If it is necessary, I will install the latest version of Rapid Scada.
Dejan
September 18, 2015 at 7:46 am #506MikhailModeratorHi,
Double value is trancated by Modbus driver. Value type is not a problem.
You could update SCADA-Communicator only. It’s easy. Make backup copy. After updating, copy the config folder and check the settings.September 18, 2015 at 8:21 am #507dejanParticipantHi,
I’ve installed the new Communicator. Now, when I send any value I get this log in Device Data / Commands:
| 2 | 18/09/2015 10:14:55 | Command: type = Standard, device num. = 1, value = N3 |
What does N3 mean?
September 18, 2015 at 8:55 am #508MikhailModeratorIt is a displaying bug )
It was fixed yesterday, but not published. Sorry. I shall do it till the midnight.September 18, 2015 at 9:11 am #509dejanParticipantHi Mikhail,
Thanks for your replies, but I still don’t have the answer to my original question – what to configure and how in order to send a value as 2-byte integer to a Modbus device.
September 18, 2015 at 9:20 am #510MikhailModeratorFirst of all, you should find where the value got lost.
Please remind me, if you send command by SCADA-Communicator directly, it works OK?September 18, 2015 at 9:47 am #511dejanParticipantNo, it doesn’t. I can only correctly send binary data from communicator.
September 18, 2015 at 9:54 am #512dejanParticipantFor example, if I send a simple number like 100 or 200, my modbus device receives 0. If I send binary hex data 00 64 (=100 decimal) my device receives 100.
All that done directly from communicator.September 18, 2015 at 9:55 am #513MikhailModeratorHow the command is configured in the device template? Send a screenshot, please.
September 18, 2015 at 10:30 am #515dejanParticipantSeptember 18, 2015 at 10:31 am #516dejanParticipanthttps://drive.google.com/file/d/0B6UnLsN1oaMgM05RcWhYdVFKelk/view?usp=sharing
In my machine I’m using Modbus function 16 for writing to holding registers. That’s why “Multiple is checked” to tell communicator to use function 16 instead of function 06.
- This reply was modified 8 years, 6 months ago by dejan.
September 18, 2015 at 11:44 am #518MikhailModeratorYou need to create your own function in Formulas table which converts double input value to the array of bytes. Then use your formula in Output channels table.
Also you need to upgrade SCADA-Server to 4.5.September 18, 2015 at 11:46 am #519dejanParticipantOK, got it.
Thanks
-
AuthorPosts
- You must be logged in to reply to this topic.