Mesa modbus and pktUart
- PCW
-
- Offline
- Moderator
-
Less
More
- Posts: 18558
- Thank you received: 5099
14 Mar 2025 17:42 - 14 Mar 2025 20:10 #323940
by PCW
Replied by PCW on topic Mesa modbus and pktUart
I'll try setting the update rate to .1 in the hal file
(I've set it later to .1 without any issue)
Setting the update rate to .1 in the hal file works fine here.
( Of course it only updates the outputs every 10 seconds so you need to wait
from 0 to 10 seconds after you update an output for the physical output to get updated )
loadrt mb25ioc32 ports=hm2_[HOSTMOT2](BOARD).0.pktuart.0
addf mb25ioc32.00 servo-thread
setp mb25ioc32.00.baudrate 9600
#setp mb25ioc32.00.baudrate 115200
setp mb25ioc32.00.parity 0
setp mb25ioc32.00.address 1
setp mb25ioc32.00.update-hz 0.1
#setp mb25ioc32.00.setbaud 7 # 7 is 115200
(I've set it later to .1 without any issue)
Setting the update rate to .1 in the hal file works fine here.
( Of course it only updates the outputs every 10 seconds so you need to wait
from 0 to 10 seconds after you update an output for the physical output to get updated )
loadrt mb25ioc32 ports=hm2_[HOSTMOT2](BOARD).0.pktuart.0
addf mb25ioc32.00 servo-thread
setp mb25ioc32.00.baudrate 9600
#setp mb25ioc32.00.baudrate 115200
setp mb25ioc32.00.parity 0
setp mb25ioc32.00.address 1
setp mb25ioc32.00.update-hz 0.1
#setp mb25ioc32.00.setbaud 7 # 7 is 115200
Last edit: 14 Mar 2025 20:10 by PCW.
Please Log in or Create an account to join the conversation.
- PCW
-
- Offline
- Moderator
-
Less
More
- Posts: 18558
- Thank you received: 5099
14 Mar 2025 20:54 #323957
by PCW
Replied by PCW on topic Mesa modbus and pktUart
A quick way to verify that you have fixed the divide by 0 issue
is to set the update rate to 0 in say halshow, and the set it back to say 1
If communication continues at 1 Hz, then the issue has been fixed.
(I say this because at least in a RIP installation the
mesa_modbus.c.tmpl file used is not the one in the
LinuxCNC sources)
is to set the update rate to 0 in say halshow, and the set it back to say 1
If communication continues at 1 Hz, then the issue has been fixed.
(I say this because at least in a RIP installation the
mesa_modbus.c.tmpl file used is not the one in the
LinuxCNC sources)
Please Log in or Create an account to join the conversation.
- vre
- Away
- Platinum Member
-
Less
More
- Posts: 653
- Thank you received: 17
14 Mar 2025 22:28 #323964
by vre
Replied by vre on topic Mesa modbus and pktUart
Yes works but it is practically unusable with 10sec intervals
also the problem of random data to encoder input it is unknown if resolves
completely or just happens in these long intervals and it is difficult to detect..
With update-hz set to 0.05 does not work.
also the problem of random data to encoder input it is unknown if resolves
completely or just happens in these long intervals and it is difficult to detect..
With update-hz set to 0.05 does not work.
Please Log in or Create an account to join the conversation.
- PCW
-
- Offline
- Moderator
-
Less
More
- Posts: 18558
- Thank you received: 5099
14 Mar 2025 22:38 #323965
by PCW
Replied by PCW on topic Mesa modbus and pktUart
Yes, I would test at say a 100 Hz update rate.
I was just checking the 0.1 Hz update rate, as you said
it did not work, but it seems OK.
So if you can change the update rate from 0 to some positive number
while running and it keeps working, that indicates that at least one
divide by zero issue has been fixed.
The bad data error you have may be unrelated but the divide by zero fix
seems to have solved the very similar error finnengineering had with the stepgens
I was just checking the 0.1 Hz update rate, as you said
it did not work, but it seems OK.
So if you can change the update rate from 0 to some positive number
while running and it keeps working, that indicates that at least one
divide by zero issue has been fixed.
The bad data error you have may be unrelated but the divide by zero fix
seems to have solved the very similar error finnengineering had with the stepgens
Please Log in or Create an account to join the conversation.
- vre
- Away
- Platinum Member
-
Less
More
- Posts: 653
- Thank you received: 17
14 Mar 2025 22:49 #323966
by vre
Replied by vre on topic Mesa modbus and pktUart
try this to mesa_modbus.c.tmpl i think works?
// timer = 1e9 / inst->hal->rate;
timer = (inst->hal->rate == 0) ? 0 :1e9;
Please Log in or Create an account to join the conversation.
- PCW
-
- Offline
- Moderator
-
Less
More
- Posts: 18558
- Thank you received: 5099
14 Mar 2025 22:58 #323969
by PCW
Replied by PCW on topic Mesa modbus and pktUart
That does not set the rate though, what I did for testing was:
if (inst->hal->rate > .001) {
timer = 1e9 / inst->hal->rate;
} else {
timer = 1e9 / 1000; # 1 ms
}
if (inst->hal->rate > .001) {
timer = 1e9 / inst->hal->rate;
} else {
timer = 1e9 / 1000; # 1 ms
}
Please Log in or Create an account to join the conversation.
- vre
- Away
- Platinum Member
-
Less
More
- Posts: 653
- Thank you received: 17
15 Mar 2025 00:29 #323973
by vre
Replied by vre on topic Mesa modbus and pktUart
My observation is the fastest ioc32 data rate led blicks(more speed)
the numbers of encoder read go more crazy.
the numbers of encoder read go more crazy.
Please Log in or Create an account to join the conversation.
- PCW
-
- Offline
- Moderator
-
Less
More
- Posts: 18558
- Thank you received: 5099
16 Mar 2025 01:15 #324032
by PCW
Replied by PCW on topic Mesa modbus and pktUart
Are you setup to build LinuxCNC from source?
I have a patch from a LinuxCNC developer that may fix this issue.
I have a patch from a LinuxCNC developer that may fix this issue.
Please Log in or Create an account to join the conversation.
- vre
- Away
- Platinum Member
-
Less
More
- Posts: 653
- Thank you received: 17
16 Mar 2025 02:01 #324035
by vre
Replied by vre on topic Mesa modbus and pktUart
2.9.4 but can apply patch to 2.9.4 source.
Please Log in or Create an account to join the conversation.
- PCW
-
- Offline
- Moderator
-
Less
More
- Posts: 18558
- Thank you received: 5099
16 Mar 2025 02:21 #324038
by PCW
Replied by PCW on topic Mesa modbus and pktUart
Attachments:
The following user(s) said Thank You: vre
Please Log in or Create an account to join the conversation.
Time to create page: 0.141 seconds