Forum Home › Forums › Communicating with Devices › Modbus › Function to Send Command
- This topic has 8 replies, 4 voices, and was last updated 6 years, 5 months ago by Mikhail.
-
AuthorPosts
-
June 30, 2017 at 7:52 am #2313raazsiParticipant
Hi ..
I used SetVal function and it worked well with input channels. Then, within a function, I tried to write Modbus register through a code by assigning values to the output channel. I could not find any inbuilt function for output channels. So I tried to define one in the formula.
public void Sendcmd(int cnlval,double cnldata)
{ double cmdVal;
try
{ cmdVal = Convert.ToDouble(cnldata);
BeginCalcCmdData(cnlval, cmdVal, null);
}
finally { EndCalcCmdData(); }}It compiled successfully but its values are not getting sent when I call this function for an output channel.
Sendcmd(3099,80);
Whenever I execute this channel in my scheme, Value of ‘1’ is sent to the holding register. I guess this is the default value sent for standard type command.
The configured output channel is of ‘Standard Type’ & Command Values is ‘Execute’.
June 30, 2017 at 10:22 am #2314manjey73ParticipantTo be able to send commands to the device after executing the formulas in the input channels required Automatic Control Module
November 6, 2017 at 6:36 am #2760ayyub.energiParticipantHi…
I am trying to send command to plc dse860 from this instruction.
====================================
Typical Requests (Using Pseudo Code)===>>> WriteRegister(10,1008,2,35701, 65535-35701): Puts the module into AUTO mode by writing to (hex) register 1008, the values 35701 (auto mode) and register 1009 the value 65535-35701 (the bitwise opposite of auto mode)
* One of the system control keys from the table below must be written into register 8 and its ones-compliment written into register 9 with a single function 16 (write multiple registers) to perform the specified system control function.
* Writing any other value or using a function that is not available will return extended exception code 7 (Illegal value written to register) and have no affect.
* Function codes 0 to 31 perform exactly the same function as pressing the equivalent button on the control unit.======================================
Can u help me please?
November 6, 2017 at 8:47 am #2761MikhailModeratorHi,
First of all, you should create a Modbus template in the Communicator application.
If you already create the template, please provide a screenshot. Otherwise, create a template and try to send a command using the UI of Communicator.November 6, 2017 at 9:41 am #2762ayyub.energiParticipantthis is the template
https://drive.google.com/open?id=1yxGYiaaLXbiaJGJdgj0UgVSzTaPfoVW9&authuser=0
what must i do now please?
November 7, 2017 at 7:25 am #2767MikhailModeratorThis link requires authorization. Can you share it for all?
November 7, 2017 at 7:48 am #2769ayyub.energiParticipantNovember 7, 2017 at 7:49 am #2770ayyub.energiParticipanti want to send an integer value like 2450455 to command button
November 8, 2017 at 1:04 pm #2773MikhailModeratorBecause we arranged a training, we will test the template and configure command together very soon.
-
AuthorPosts
- You must be logged in to reply to this topic.