Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

endian swap feature #2

Closed
mypiandrew opened this issue Sep 13, 2016 · 8 comments
Closed

endian swap feature #2

mypiandrew opened this issue Sep 13, 2016 · 8 comments

Comments

@mypiandrew
Copy link

Can I suggest you add the feature to swap the byte order for 32 bit reads (either long ints or floats)

This comes up more often than you'd expect in the field :-(

@christianhals
Copy link

I second this request. That would be an awesome feature.

Maybe a new parameter option where you can switch both bitorder and word order. For instance for 32bit you could have ABCD as the default for MSB-LSB AND MSW-LSW and then do CDAB for MSB-LSB and LSW-MSW and so on.

@epsilonrt
Copy link
Owner

Hi,
I just created the temporary branch 'big-endian' and add the -B option to enable big endian word order (for reading and writing the entire 32-bit and float).
I have no slave 'big-endian': Could you try and tell me if this change is right for you ?
If you confirm, I merge changes in branch 'Develop'.

@mypiandrew
Copy link
Author

Hi

You can use this program to simulate a modbus RTU/TCP slave

https://sourceforge.net/projects/modrssim2

You can then create all the register "types" by entering the raw values in and reading them back

@epsilonrt
Copy link
Owner

Hi,
I have very little time to devote to this project and you are at the origin of this request. Could you tell me if the realized version matches your request. If it does not, I would delete the branch 'big-endian' because I do not need. I would like a minimum of participation. Thank you.

@christianhals
Copy link

Amazing epsilonrt. Thanks for the new update. I have physical slaves available at the office so I can verify tomorrow.

@christianhals
Copy link

I'm happy to confirm that the new endian swap feature is working as expected for me.

Testresult LSW-MSW (Carlo Gavazzi EM24):

# mbpoll /dev/ttyM0 -m rtu -b 9600 -P none -a 36 -c 01 -r 00 -t 3:int -0 -1 -o 2.0 -v
mbpoll 0.1-23 - FieldTalk(tm) Modbus(R) Master Simulator
Copyright (c) 2015 epsilonRT, All rights reserved.
This software is governed by the CeCILL license <http://www.cecill.info>

Opening /dev/ttyM0 at 9600 bauds (N, 8, 1)
Protocol configuration: Modbus RTU
Slave configuration...: address = [36]
                        start reference = 0, count = 1
Communication.........: /dev/ttyM0,       9600-8N1
                        t/o 2.00 s, poll rate 1000 ms
Data type.............: 32-bit integer (little endian), input register table

-- Polling slave 36...
[24][04][00][00][00][02][76][FE]
Waiting for a confirmation...
<24><04><04><09><44><00><00><CC><CF>
[0]:    2372

Testresult MSW-LSW (Circutor CVM-1D):

mbpoll-big-endian# mbpoll /dev/ttyM0 -m rtu -b 9600 -P none -a 03 -c 1 -r 00 -B -t 3:int -0 -1 -o 2.0 -v
mbpoll 0.1-23 - FieldTalk(tm) Modbus(R) Master Simulator
Copyright (c) 2015 epsilonRT, All rights reserved.
This software is governed by the CeCILL license <http://www.cecill.info>

Opening /dev/ttyM0 at 9600 bauds (N, 8, 1)
Protocol configuration: Modbus RTU
Slave configuration...: address = [3]
                        start reference = 0, count = 1
Communication.........: /dev/ttyM0,       9600-8N1
                        t/o 2.00 s, poll rate 1000 ms
Data type.............: 32-bit integer (big endian), input register table

-- Polling slave 3...
[03][04][00][00][00][02][70][29]
Waiting for a confirmation...
<03><04><04><00><00><09><3D><1F><C5>
[0]:    2365

Thanks again:-)

@epsilonrt
Copy link
Owner

Fine ! Thanks. I merge the big-endian branch in develop branch, this improvement will be integrated into the master branch when I will spread the next version. Thank you for your participation.

@mypiandrew
Copy link
Author

Try this program to help you debug

https://sourceforge.net/projects/modrssim2

On 22 Oct 2016, at 10:47 pm, epsilonrt notifications@github.com wrote:

Hi,
I just created the temporary branch 'big-endian' and add the -B option to enable big endian word order (for reading and writing the entire 32-bit and float).
I have no slave 'big-endian': Could you try and tell me if this change is right for you ?
If you confirm, I merge changes in branch 'Develop'.


You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub, or mute the thread.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants