sambhojho / nmodbus

Automatically exported from code.google.com/p/nmodbus
0 stars 0 forks source link

Enter one-line summary #10

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
Hello,

I would like to knows :
why object "NetworkByte" must be a length always even ?
why in MODBUS PROJECT subfunction is defined like a ushort instead of a 
byte ?

I realized a little developpement to send a query ReadDeviceIdentification 
(Function Code=Ox2B SubFunction Code=0x0E).
I had to modify the project Modbus (about subfunction and 
NetWorkBytes ) to perform the query and accept the response from MODBUS 
SERVER like (TSX ETY 5103 "ETHERNET Communication module for Schneider 
PLC").

Original issue reported on code.google.com by jreber...@gmail.com on 30 Mar 2007 at 7:29

GoogleCodeExporter commented 8 years ago
In answer to your questions.

>> why object "NetworkByte" must be a length always even ?

I believe what you are trying to do is create a Register collection with an 
uneven  
number of bytes. Registers are 2 bytes each... therefore an exception is 
thrown. 

If you provide a specific use case in which this is causing you difficulty 
perhaps I 
could be more helpful.

>> why in MODBUS PROJECT subfunction is defined like a ushort instead of a byte 
?

The ModbusMessage SubFunctionCode property is a ushort because it is intended 
for 
usage by the serial Diaganostics function code 0x08, which is 2 bytes. As you 
noticed the Encapsulated Interface Transport function code 0x2B is not 
supported. I 
can look into the possibility of adding support if you are interested.

Scott

Original comment by sja...@gmail.com on 30 Mar 2007 at 7:59

GoogleCodeExporter commented 8 years ago
I need to receive and send modbus message with an uneven number of bytes also I 
modified the project modbus like this now I can perform a query read Device 
Identification(FC Ox2B & subfunction 0x0D) to TSX ETY 5103.

I  realized an implementation of this query in MODBUS project:
I modified following  files:
   - Util/ModbusUtils.cs
   - Device/ModbusMaster.cs
   - Device/ModbusTcpMaster.cs
   - Device/IModbusTcpMaster.cs
and I added these files
   - Message/ReadDeviceIdentificationRequest.cs
   - Message/ReadDeviceIdentificationResponse.cs

If you want,I can send you these files.

Best regards,
Jerome.

Original comment by jreber...@gmail.com on 11 Apr 2007 at 1:09

GoogleCodeExporter commented 8 years ago
I implemented FC= 0x2B with subfun=0x0E not subfunction =0x0D 

sorry :-)

Original comment by jreber...@gmail.com on 11 Apr 2007 at 1:12

GoogleCodeExporter commented 8 years ago
Great! Please do send your implementation. Can you send a patch?

Thanks.

Scott

Original comment by sja...@gmail.com on 11 Apr 2007 at 3:47

GoogleCodeExporter commented 8 years ago
hereafter you find patch to support readDeviceIdentification on TCP

best regards,
Jerome.

Original comment by jreber...@gmail.com on 13 Apr 2007 at 9:49

Attachments:

GoogleCodeExporter commented 8 years ago

Original comment by sja...@gmail.com on 2 Dec 2007 at 1:38