Many thanks, hopefully will have a part 2 out shortly.
Just a heads up, I hated the way that the functions for modbus were named. We named them after official functions and really they make no sense. So now I have named them in a cleaner way so they better align with the slave device features. Hopefully making things much easier for someone coming to it for the first time.
Please beware this will break existing programs. I'm really sorry about this and can help if you need any help moving to the new version. The function parameters haven't changed just the function names.
MODBUS Confusion
-
- Matrix Staff
- Posts: 1924
- http://meble-kuchenne.info.pl
- Joined: Mon Dec 07, 2020 10:06 am
- Has thanked: 501 times
- Been thanked: 684 times
Re: MODBUS Confusion
Regards Ben Rowland - MatrixTSL
Flowcode Online Code Viewer (Beta) - Flowcode Product Page - Flowcode Help Wiki - My YouTube Channel
Flowcode Online Code Viewer (Beta) - Flowcode Product Page - Flowcode Help Wiki - My YouTube Channel
- p.erasmus
- Posts: 434
- Joined: Thu Dec 03, 2020 12:01 pm
- Location: Russia / Россия
- Has thanked: 104 times
- Been thanked: 88 times
Re: MODBUS Confusion
Hi Ben
Thanks Ben
No problem on my side was just exploring until now ,from next week I will start the real application,Will look at the new names
How does this affect the Master function as I will work with the MIAC dsPIC as a MATER controlling an 250Kw Inverter system
looking forward at the second video

Thanks Ben
No problem on my side was just exploring until now ,from next week I will start the real application,Will look at the new names
I have named them in a cleaner way so they better align with the slave device features. Hopefully making things much easier for someone coming to it for the first time.
How does this affect the Master function as I will work with the MIAC dsPIC as a MATER controlling an 250Kw Inverter system

looking forward at the second video


Regards Peter - QME Electronics
-
- Matrix Staff
- Posts: 1924
- Joined: Mon Dec 07, 2020 10:06 am
- Has thanked: 501 times
- Been thanked: 684 times
Re: MODBUS Confusion
Now everything shares the same naming convention.
So here are the registers made available on the slave.
Here are the Slave functions.
And here are the master functions.
Hopefully much cleaner than before.
So here are the registers made available on the slave.
Here are the Slave functions.
And here are the master functions.
Hopefully much cleaner than before.
Regards Ben Rowland - MatrixTSL
Flowcode Online Code Viewer (Beta) - Flowcode Product Page - Flowcode Help Wiki - My YouTube Channel
Flowcode Online Code Viewer (Beta) - Flowcode Product Page - Flowcode Help Wiki - My YouTube Channel
-
- Valued Contributor
- Posts: 997
- Joined: Wed Dec 02, 2020 10:53 am
- Has thanked: 190 times
- Been thanked: 217 times
Re: MODBUS Confusion
Hi Ben
Thank you very much.
Modbus is nice to use. It's almost like a data socket. Have you already been able to do something for the data socket?
regards
Stefan
Thank you very much.
Modbus is nice to use. It's almost like a data socket. Have you already been able to do something for the data socket?
regards
Stefan
-
- Matrix Staff
- Posts: 1924
- Joined: Mon Dec 07, 2020 10:06 am
- Has thanked: 501 times
- Been thanked: 684 times
Re: MODBUS Confusion
Hi Stefan,
No sorry not had chance to look at that one yet. Ideally I would like to encrypt a data socket or at least provide the means to do this which would be a benefit over modbus TCP. I'll keep at it
Part 2 video now available here.
https://youtu.be/ZVg91kJOXdY
No sorry not had chance to look at that one yet. Ideally I would like to encrypt a data socket or at least provide the means to do this which would be a benefit over modbus TCP. I'll keep at it

Part 2 video now available here.
https://youtu.be/ZVg91kJOXdY
Regards Ben Rowland - MatrixTSL
Flowcode Online Code Viewer (Beta) - Flowcode Product Page - Flowcode Help Wiki - My YouTube Channel
Flowcode Online Code Viewer (Beta) - Flowcode Product Page - Flowcode Help Wiki - My YouTube Channel
-
- Valued Contributor
- Posts: 997
- Joined: Wed Dec 02, 2020 10:53 am
- Has thanked: 190 times
- Been thanked: 217 times
Re: MODBUS Confusion
Hi Ben
In your video there are numbers in the gauge. How did you do this? My gauge don't show numbers.
Regards
Stefan
In your video there are numbers in the gauge. How did you do this? My gauge don't show numbers.
Regards
Stefan
-
- Matrix Staff
- Posts: 1924
- Joined: Mon Dec 07, 2020 10:06 am
- Has thanked: 501 times
- Been thanked: 684 times
Re: MODBUS Confusion
Hello,
The way the scaling works on the gauges is a bit strange but this is how it works.
Minor tick step - Sets the number between each minor tick. On a ruler this might be 1 for a mark every 1mm. For your scale of 2000, 50 might be a nice number.
Major tick step - Sets the number of minor tick steps for each numeric marking. On a ruler this might be 10 for a number every 10mm. For your scale of 2000 with minor ticks of 50, 2 or 4 might be nice values.
Major 2, Minor 50 works well as does Major 5, Minor 20.
Hope this helps
The way the scaling works on the gauges is a bit strange but this is how it works.
Minor tick step - Sets the number between each minor tick. On a ruler this might be 1 for a mark every 1mm. For your scale of 2000, 50 might be a nice number.
Major tick step - Sets the number of minor tick steps for each numeric marking. On a ruler this might be 10 for a number every 10mm. For your scale of 2000 with minor ticks of 50, 2 or 4 might be nice values.
Major 2, Minor 50 works well as does Major 5, Minor 20.
Hope this helps

Regards Ben Rowland - MatrixTSL
Flowcode Online Code Viewer (Beta) - Flowcode Product Page - Flowcode Help Wiki - My YouTube Channel
Flowcode Online Code Viewer (Beta) - Flowcode Product Page - Flowcode Help Wiki - My YouTube Channel
-
- Valued Contributor
- Posts: 997
- Joined: Wed Dec 02, 2020 10:53 am
- Has thanked: 190 times
- Been thanked: 217 times
Re: MODBUS Confusion
Hi Ben
Perfect. It's working with the text.
The program get a string from a bluetooth Modul with values as ascci code every 500mSec.
A small code convert the string to integer and control the gauge.
I will change the program to Modbus / Wlan soon.
regards
Stefan
Perfect. It's working with the text.
The program get a string from a bluetooth Modul with values as ascci code every 500mSec.
A small code convert the string to integer and control the gauge.
I will change the program to Modbus / Wlan soon.
regards
Stefan
// receive string look like "0015,0022,0000,0022,2010,1201,\r\n)
.temp_str = Mid$ (signalstring,0,5)
.channel[0] = StringToInt$ (.temp_str)
.temp_str = Mid$ (signalstring,7,11)
.channel[1] = StringToInt$ (.temp_str)
.temp_str = Mid$ (signalstring,13,17)
.channel[2] = StringToInt$ (.temp_str)
.temp_str = Mid$ (signalstring,19,23)
.channel[3] = StringToInt$ (.temp_str)
.temp_str = Mid$ (signalstring,25,29)
.channel[4] = StringToInt$ (.temp_str)
.temp_str = Mid$ (signalstring,31,36)
.channel[5] = StringToInt$ (.temp_str)