Page 1 of 1

Modbus RTU and TCP/IP

PostPosted: Tue 15. Aug 2017 10:14:40
by steven
Hi everyone,
I am quite new to PROMOTIC and i would like to create a setting page for modbus RTU and TCP/IP.
So right now i would like to ask if is there anyway I can change serial port (COM1, COM2,etc), IP address and port while the application is running?
If there is, could anyone help/guide me through.
Thank you in advance.

Regards,
Steven

Re: Modbus RTU and TCP/IP

PostPosted: Fri 18. Aug 2017 8:29:07
by admin
Hello,

There are basically two possible solutions:

1) The PmComm object (responsible for communications https://www.promotic.eu/en/pmdoc/Object ... maComm.htm) has methods OpenPort and ClosePort. You can use these methods to modify the ports and IP addresses.
See:
https://www.promotic.eu/en/pmdoc/Object ... enPort.htm
https://www.promotic.eu/en/pmdoc/Object ... sePort.htm

2) You can insert multiple PmComm objects into your application, each of these objects configured to communicate on specific ports or to specific IP addresses. Then you just activate the PmComm object you need to communicate with. This approach has the advantage that the data you read from individual devices (from various ports and IP addresses) are easily separated and storeand do not mix together.

Re: Modbus RTU and TCP/IP

PostPosted: Sun 20. Aug 2017 7:48:02
by steven
Thank you for replying.
The alternative seems like a good method so i will try that. but for learning purpose i would still like to try the first method.
i have read about OpenPort and ClosePort but i dont seem to get the picture.
Is the method implement like this? (attach photo)

or am i totally off from the correct way of using it.

Re: Modbus RTU and TCP/IP

PostPosted: Wed 23. Aug 2017 12:39:04
by admin
Hello, could you please send me your PROMOTIC SCADA software project by e-mail to: kubny@microsys.cz so we can add example to it?

Re: Modbus RTU and TCP/IP

PostPosted: Thu 24. Aug 2017 2:46:34
by steven
i have send you the file.
Feel free to edit anything inside and again thanks for helping.