I am trying to use your DLL in a VB.net application to read and write via modbus to a Schnieder distributed IO device. I have used your sample modbusTCP client app and it successfully returns the input status by reading the holding registers. I call the ReadHoldingRegisters function (modbusclient.ReadHoldingRegisters(5392, 16) in this instance to read address 45392 which is a 16 input module) and I only ever get back an array of all 0s.
My test code is as follows:
Public Class Form1
Public Shared modbusclient As New EasyModbus.ModbusClient("192.168.1.101", 502)
When I trigger this via a push button on the form and setup a breakpoint after that line, the array shows as all 0's when the LSB (first) bit should be 1 as the input is switched on.
Any ideas?
Do you have sample VB code using this library for reference?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi I don't fully understand your code. But you definitelly have to check the mapping of your device, that has to match with your Modbus reading. It sounds to me that your trying to read a Holding Register to determine the state of a digital input, or did I missunderstand something?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi,
I am trying to use your DLL in a VB.net application to read and write via modbus to a Schnieder distributed IO device. I have used your sample modbusTCP client app and it successfully returns the input status by reading the holding registers. I call the ReadHoldingRegisters function (modbusclient.ReadHoldingRegisters(5392, 16) in this instance to read address 45392 which is a 16 input module) and I only ever get back an array of all 0s.
My test code is as follows:
Public Class Form1
Public Shared modbusclient As New EasyModbus.ModbusClient("192.168.1.101", 502)
End Class
When I trigger this via a push button on the form and setup a breakpoint after that line, the array shows as all 0's when the LSB (first) bit should be 1 as the input is switched on.
Any ideas?
Do you have sample VB code using this library for reference?
Hi I don't fully understand your code. But you definitelly have to check the mapping of your device, that has to match with your Modbus reading. It sounds to me that your trying to read a Holding Register to determine the state of a digital input, or did I missunderstand something?