Hi, I'm completely new to tshark so any help would be much appreviated also quite new to Modbus. I'm trying extract the raw modbus data from a capture. I've used similar code found in another question Tshark doesn't display the longer data fields (mbtcp) but I believe this is a different issue as I'm using standard function codes. I have filtered the wireshark data for ip.addr and mbtcp then passed the result through
modbus.data only extracts with function code 2 not 4. I have tried the suggestion on the link and included '-o "opensafety.enable_mbtcp:0"' but that doesn't look to sort my issue. Is there anything further someone could suggest that i'm missing? Output example: Also I would like to pull out the query start address and less importantly the number of registers to read but I can't find a -e field that will do this. Is it possible? Any insight would be greatly recieved as I've been trying to figure this out for a while now. Thanks, Alex asked 06 Jul '15, 23:07 agraybill |
One Answer:
Function code 4 is "read input registers", where the request payload (the first frame in your text output) consists of the starting register offset (16 bits) and the count of registers to read (also 16 bit). These two files have field identifiers of The response (the 2nd frame in your text) will have an 8 bit byte count (field identifier The You can easily determine field identifiers yourself by clicking on a field in the packet details tree and checking the status bar where the field identifier is shown in parentheses. If you can share a capture with the required data (in a public spot, e.g. Cloudshark, Google Drive etc.), then that will help to analyse your issue. answered 06 Jul '15, 23:52 grahamb ♦ |
Thank you for your quick response.
I have uploaded a capture to Google Drive
I should have given some more background info. I am currently having an issue where the analogue data is spiking extreme high/extreme low/set constant value. At the moment I am unsure where the issue is so I am wanting to analyse the data to make sure that the requests/responses are not getting mixed up or that the field device isn't corrupting the data etc. These 'corruptions' are happening irregularly so I want to be able to analyse a large amount of data and see what the messaging is doing around the 'corruption'
The analogue field data is either 32-bit float LH or 32-bit integer HL which I believe I have to extract using
modbus.data
. I was going to translate the extract using Excel but if you have another recommendation I'm all ears.Cheers, Alex