Homebrewed software to communicate with measuring device via Modbus TCP

Dear sir,
Today I commenced with "homebrewed soft" as you kindly directed me, it would be relevant after debugging and third party tool succeded with wp8025.
I created a new project in vb.net, and included the EasyModbus.dll. I also made some minimal interface, assuming only succeeding connection and operating coils. In the beginning I texted only: "Imports EasyModbus" statement.
Please kindly have a look at the screenshots below:
1.JPG
2.JPG
3.JPG
5.JPG
6.JPG

Please kindly tell me, am I heading right direction? Are there any specific particulars left beyond my attention?
Faithfully,
N. Qv.
 
I am not very familiar with Visual Basic, but as far as I can tell, yes it appears you are on the right track.

For the specific bytes to use in your request packets and the device's expected responses, please refer to the Communication Traffic window in Modbus Poll (Display->Communication...) and the Serial Send Data / Serial Receive Data in the Wellpro software.
 
Dear sir,
I started with the coding.
I tried to describe what I am intending to accomplish, writing comments rightwards to the codeline.
It has confused me with reports about errors, though this time I am trying to understand, what I am intended to do with this code.
Could you kindly have a look at the codelines, to put me on the right track?

2.JPG
3.JPG

Faithfully,
N. Qv.
 

Attachments

You have a period '.' character at the end of your Form1.vb code after the line "End Class". Delete the period and your code should compile (well actually you're not passing enough arguments to WriteSingleRegister, but you shouldn't be using that function anyway - details below).

You're trying to use the WriteSingleRegister function. This is wrong. You need to read/write Coils using the ReadCoils and WriteSingleCoil or WriteMultipleCoils functions.

You don't need a port box (with a value of 502). This is for Modbus/TCP (Ethernet). You are doing Modbus RTU (RS-485). You need a COM port dropdown box or edit box and you need to pass the serial port name (i.e. COM1) to the EasyModbus.ModusClient() call.

You also need to set ModbusClient.UnitIdentifier to the Modbus slave address of the Wellpro device (I believe this is a value of 1 from your previous screenshots).
 
Top