Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - muratguenduez

Pages: [1] 2
1
Open Discussion / Re: modbus tcp to modbus rtu converter
« on: May 17, 2019, 03:02:34 AM »
its gprs and you need more time  then cable connection. it about traffic, its very alternative. as your answer, yes 3 sec some times give me a timout error. actually as you see the packages are same anly differenses are probably times.

2
Open Discussion / Re: modbus tcp to modbus rtu converter
« on: May 16, 2019, 08:35:45 AM »
its 3.99x. i think your time out is not working or limited ? when i change it every time get a connecton error in 3sec why?

request is same but reasult is different.

upper is modbuspool and bottom is AHMI. both are have same requests but output doesnt on with AHMI.
i setted time ut same 5000ms, there is a response timeout in modbuspool, AHMI has just timeout, is there any way to set it in AHMI?

3
Open Discussion / Re: modbus tcp to modbus rtu converter
« on: May 16, 2019, 02:08:14 AM »
of course it should be in the packet  =) problem is how to put it into the packet with AHMI ? this is modbuspool tx rx page.
000026-Tx:00 11 00 00 00 06 03 01 05 02 00 01
000027-Rx:00 11 00 00 00 04 03 01 01 02
its "read single coil"

and

this is a explanaiton the packet,

Summary

The equivalent request to this Modbus RTU example

                 11 03 006B 0003 7687

in Modbus TCP is:

  0001 0000 0006 11 03 006B 0003

0001: Transaction Identifier
0000: Protocol Identifier
0006: Message Length (6 bytes to follow)
11: The Unit Identifier  (17 = 11 hex)
03: The Function Code (read Analog Output Holding Registers)
006B: The Data Address of the first register requested. (40108-40001 = 107 =6B hex)
0003: The total number of registers requested. (read 3 registers 40108 to 40110)

http://www.simplymodbus.ca/TCP.htm

4
Open Discussion / Re: modbus tcp to modbus rtu converter
« on: May 15, 2019, 10:05:31 AM »
i dont use modbusRTUcom, i use modbusTCPcom.  converter has a static ip for modbusTCP and has a rtu port connected rtu devices. i have one on the rtu bus its a plc id adsressed by 3. for example i found a tcp class

this for connection,
Code: [Select]
public Master(string ip, ushort port, bool no_sync_connection)
        {
            connect(ip, port, no_sync_connection);
        }
and this for write single coil,
Code: [Select]
public void WriteSingleCoils(ushort id, byte unit, ushort startAddress, bool OnOff)
        {
            byte[] data;
            data = CreateWriteHeader(id, unit, startAddress, 1, 1, fctWriteSingleCoil);
            if (OnOff == true) data[10] = 255;
            else data[10] = 0;
            WriteAsyncData(data, id);
        }

i downloaded from https://github.com/stephan1827/modbusTCP-DotNET

working well but i cant find like this control in ahmi.

5
Open Discussion / modbus tcp to modbus rtu converter
« on: May 15, 2019, 02:30:07 AM »
hi there,
im working on a converter modbusTCP toMOdbusRTU. i have couple of problems and a bit confusion. i can read my rtu plc connected to converter modbus rtu port via Modbuspool without any problems. modbuspool provide me to setup connection parameters "ip, port, unitID(for rtu), and reg address". however i cant find any unitID in the AHMI except modbusTCPcom Properties. yes it is exist but nothing changes by changing it. how to solve this problem? GODRA, ARCHI or another knowlegefuly forumer =) im using c#

6
Open Discussion / Re: Dynamic creation for DataSubscriber2? need help!
« on: September 14, 2018, 09:40:33 AM »
well,
what is wrong in my code ?

actually it should be easy i think. something wrong with my modbusTCPCom setup.

dinamic ds is working on drag-dropped modbusTCPCom but why dynamic ds is not working on dynamic modbusTCPCom ?

this was my first code before the copied all setup from designer.cs

Code: [Select]
public partial class Form1 : Form
    {     
        PLCAddressItem item0 = new PLCAddressItem { PLCAddress = "U44597", Name = "L1" };
        ModbusTCPCom mbDelta = new ModbusTCPCom { IPAddress = "192.168.1.5"};       
        DataSubscriber2 ds = new DataSubscriber2();

        public Form1()
        {
            InitializeComponent();
            timer1.Start();
        }

       
        private void Form1_Load(object sender, EventArgs e)
        {
            ds.BeginInit();
            ds.ComComponent = mbDelta;// !!!!!!!!!!!! changing to mbDelta to modbusTCPCom1(drag-dropped) is working. !!!!!!!!!!!!!!!!!!!!!!!!!!
            ds.PLCAddressValueItems.Add(item0);
            ds.EndInit();
        }

        private void timer1_Tick(object sender, EventArgs e)
        {
           
            richTextBox1.Text = ds.GetValueByName("L1");
           
        }
}

7
Open Discussion / Dynamic creation for DataSubscriber2? need help!
« on: September 14, 2018, 08:33:13 AM »
hail all,
i have tried basic addition dynamicly for DataSubscriber2 but i coudnt get any values.

i added a ModbusTCPCom  modbusTCPCom1 from toolbox as drag and drop,

then i added dynamicly a DataSubscriber2 ds, ModbusTCPCom mbDelta and  PLCAddressItem item0 = new PLCAddressItem { PLCAddress = "U44597", Name = "L1" };
when the ds.Comcomponent =  modbusTCPCom1; is ok i read my first object L1 by ds.GetValuesByName("L1");

but ds.Comcomponent = mbDelta; is not working.
i tried to copy all setup for modbusTCPCom1 from designer.cs even more  =) i miss something here. anyway code is below,


Code: [Select]
public partial class Form1 : Form
    {
        PLCAddressItem item0 = new PLCAddressItem { PLCAddress = "U44597", Name = "L1" };
        ModbusTCPCom mbDelta = new ModbusTCPCom();     
        DataSubscriber2 ds = new DataSubscriber2();

        public Form1()
        {

            InitializeComponent();

            mbDelta.BeginInit();
            ds.BeginInit();

            mbDelta.DisableSubscriptions = false;
            mbDelta.IniFileName = "";
            mbDelta.IniFileSection = null;
            mbDelta.IPAddress = "192.168.1.5";
            mbDelta.MaxReadGroupSize = 20;
            mbDelta.PollRateOverride = 500;
            mbDelta.SwapBytes = true;
            mbDelta.SwapWords = true;
            mbDelta.TcpipPort = ((ushort)(502));
            mbDelta.TimeOut = 20000;
            mbDelta.UnitId = ((byte)(1));


           
            ds.ComComponent = mbDelta;
            ds.PLCAddressValueItems.Add(item0);
            ds.PollRate = 0;           
            ds.SynchronizingObject = this;           
            ds.Value = null;
            ds.EndInit();
            mbDelta.EndInit();

           
            timer1.Start();
        }

private void timer1_Tick(object sender, EventArgs e)
        {
           
            richTextBox1.Text = ds.GetValueByName("L1");
           
        }
}

8
Open Discussion / 3.99x modbus tcp timeout setting doesnt work ?
« on: June 11, 2018, 04:02:40 AM »
hi bosses,
i have use gprs modem to connect a plc that i used before. i need to increase the timeout for the modbusTCP connection due to carrier issues. default is 3000 and i put it as 20000 but i see the connection error message on basicLabel in 3 second after runing the program!
i think this message should be seen after 20 seconds. why it is still 3 sec ?

or maybe i need to use another technic that i dont know =)

thanks

9
i have researched for 3 days .

it says first time baud is 300 then if you want choose another speed anyway

Code: [Select]
private void button2_Click(object sender, EventArgs e)
        {
            serialPort1.Close();
            serialPort1.BaudRate = 300;
            serialPort1.PortName = "COM2";
            serialPort1.Parity = Parity.Even;
            serialPort1.StopBits = StopBits.One;
            serialPort1.DataBits = 7;
            serialPort1.Open();

            serialPort1.Write("/?!" + (char)13 + (char)10);
            Thread.Sleep(200);
            serialPort1.Write((char)6 + "050" + (char)13 + (char)10);
            Thread.Sleep(200);
            serialPort1.Close();
            serialPort1.BaudRate = 9600;
            serialPort1.Open();
            serialPort1.DtrEnable = true;
            serialPort1.Write((char)1 + "R2" + (char)2 + "0.0.0"+"()" + (char)3 + "P");
            string a = serialPort1.ReadLine();
            listBox1.Items.Add(a);

        }
i did this but i didnt try because of i havent device yet. maybe i need to convert to ascii or sometinng like utf-16 32 im not sure.  i will report here when i try =)

10
i need to read some datas from these meters. it says it has a port rs-485 but im not sure it is. initial baudrates must be 300 b/s and after first communication, baudrate can be selectible. i dont understand. here is the information to use this communication http://vrtp.ru/index.php?act=Attach&type=post&id=479714

i hope you find a solution for this issue.

best regards
thanks

11
i found something in plcadress settings of buttons. "PLCAddressHighlight " in 3.99w, "PLCAddressHighlightX " in 3.99x. as you see last letter "X" so this couses an error with before and after.

12
i have another project. actually a little bit difference between before. ex. just more label less button blabla... all "   this.btn2.PLCAddressHighlight = "02170";    "  lines has an error during the first building.

thanks

13
You should not have to select the designer files. Once you select the form file, VS should automatically grab the designer file. That is why you can only select one at a time, otherwise it will not grab the designer file. If you have resources, you will need to also add that back to the project.

Since you are using c#, this may be an easier way:

1) Download and extract version 3.99x
2) Replace the AdvancedHMIcs folder with the same folder from your previous project
3) Open 3.99x in Visual Studio
4) Build the solution

This is similar to what you did previously, except you do not have to delete the project and add existing within VS.

After you build the project, use Windows Explorer to check the properties of the DLL files that are with the executable to see if they are version 3.9.24

with this way;
1) Download and extract version 3.99x
2) Replace the AdvancedHMIcs folder with the same folder from your previous project
3) Open 3.99x in Visual Studio
4) Build the solution
its ok i have no error after build or trying to open any form. =) i delete the folder AdvancedHMIcs in 3.99x then i copied my folder AdvancedHMIcs then builded everything is good. thanks Archie.

but my problem is same. it stoped at 83 now. atherwise i tried in vs mode

error event never works.

14
im using c#.  just forms ?? i dont think so. there are option under the solution tree. AdvancedHMI and AdvancedHMIcs. i right-clicked on  AdvancedHMIcs and i selected all my woks as form.cs ( not form.designer.cs right ? )
and when i try to run or build i have many errors. first of all i have tried like this and then  i wrote the problem here =)

otherwise, i think i need to copy that form.designer.cs so how will it understand about design materials??
secondly, i have some pictures for pictureboxes as resources
...

doesnt works, dont recognised all labels, drivers, modbuses....

15
i extract the 3.99x, then open in vs, i deleted " AdvancedHMIcs "in solution explorer, then right clicked on solution explorer then clicked on "existing project" then i selected  my .sln file.  it is working but i cant see my one of forms for edit. you know the white screen with errors i clicked on ignore and continue =) errors of all analogvalue displays but when i clicked on go to error, there is no red-subline with the line !
 
in the end, i tried again that issue then result is same.

Pages: [1] 2