Mesa modbus and pktUart

More
16 Mar 2025 19:11 #324067 by vre
Replied by vre on topic Mesa modbus and pktUart
yes this patch works..
the strange is that works very fast with update-hz 1000

Please Log in or Create an account to join the conversation.

More
16 Mar 2025 20:28 #324069 by PCW
Replied by PCW on topic Mesa modbus and pktUart
At update-hz = 1000 the update rate will be limited by the data communication time plus the response time.
(9600 baud is about 1 ms per character so probably something like 100Hz would be the max communication rate
if the I/O device had no delays in responding to commands)
 

Please Log in or Create an account to join the conversation.

More
16 Mar 2025 23:30 #324076 by vre
Replied by vre on topic Mesa modbus and pktUart
with update-hz 0 all work fine if set it to possitive i get
call/response function number mismatch but this didn't hurt is the known bug..
What does this code that removing it fixes the problem?
        // Check for Send Count FIFO error
//		r = hm2->llio->queue_read(hm2->llio, hm2->pktuart.instance[inst].tx_mode_addr,
//                                     &buff, sizeof(rtapi_u32));
//        if ((buff >> 4) & 0x01) {
//            HM2_ERR_NO_LL("%s: SCFFIFO error\n", name);
//            return -HM2_PKTUART_TxSCFIFOError;
//        }

Please Log in or Create an account to join the conversation.

More
16 Mar 2025 23:44 - 17 Mar 2025 00:32 #324077 by PCW
Replied by PCW on topic Mesa modbus and pktUart
Edit: The test code was removed because it was in
the wrong place, it will be restored to the correct
place later. its not a very important test.

The error was that the code accessed a RX buffer
that was not filled yet, this trashed the stack under
some circumstances, causing random garbage
in other functions.

The function miss-match is unrelated. This happens
because the PKTUART RX FIFO is not cleared before
the modbus driver starts, so may have left over characters
from the last time LinuxCNC was run, power cycle garbage
charcters etc. Its not harmful and will be fixed soon.
Last edit: 17 Mar 2025 00:32 by PCW.

Please Log in or Create an account to join the conversation.

More
28 May 2025 21:12 - 29 May 2025 14:35 #329329 by PCW
Replied by PCW on topic Mesa modbus and pktUart
I wanted to say that there is a new Modbus interface: hm2_modbus
available for all Mesa cards, and that fixes a lot of the issues with mesa-modbus.
hm2_modbus needs the latest snapshot of 2.9.4 or master. and may require
a firmware upgrade to at least V2 PktUART.

It adds the ability to have multiple devices on the same RS-485 interface,
device initialization/setup code that only runs once, plus many bug fixes.
Its been running a 25IOC32_PNP for a more than a week now with 0 issues.

The configuration file has a different format (XML) than mesa-modbus.
This format is documented in the mesambccc man page ( mesambccc is
the hm2_modbus configuration file compiler)
 
Last edit: 29 May 2025 14:35 by PCW.
The following user(s) said Thank You: COFHAL

Please Log in or Create an account to join the conversation.

More
29 May 2025 03:16 #329342 by COFHAL
Replied by COFHAL on topic Mesa modbus and pktUart
Interesting. But for us newbies, how do we use this mesambccc command? There's a detailed description, but no example of how to use it.

Please Log in or Create an account to join the conversation.

More
29 May 2025 14:25 #329367 by PCW
Replied by PCW on topic Mesa modbus and pktUart
mesambccc compiles the modbus device(s) specific xml source file
to data files that hm2_modbus uses.

Typical mesambcc usage would be something like:

mesambccc  -o ~/linuxcnc/configs/mb25ioc32.mbccb mb25ioc32.mbccs

Where mb25ioc32.mbccs is the xml source file and mb25ioc32.mbccb is the resulting
data file that the driver uses. 

Hal file setup is described in the hm2_modbus manual page:

man hm2_modbus

A minimal 25IOC32 xml source file looks like this:

<mesamodbus baudrate="9600" parity="N" interval="1000" >
 <devices>
  <device name="mb25ioc32" address="0x01"/>
 </devices>
 <commands>
  <command device="mb25ioc32" address="0x0000" function="R_INPUTS" name="input" count="32" />
  <command device="mb25ioc32" address="0x0000" function="W_COILS" name="output" count="32" resend="true" />
 </commands>
</mesamodbus>



 
The following user(s) said Thank You: tommylight, COFHAL, Aciera

Please Log in or Create an account to join the conversation.

More
29 May 2025 15:41 #329370 by langdons
Replied by langdons on topic Mesa modbus and pktUart
I once tried to communicate with an Arduino over USB.

Anything below 9600 baud was 100% broken.

Not sure why.

9600 baud is the lowest you should use IMO.

Please Log in or Create an account to join the conversation.

More
31 May 2025 19:54 #329466 by SebastianM
Replied by SebastianM on topic Mesa modbus and pktUart
Hello y'all!
I just received my new mesa 7i76eu, and I have a huge CNC with a durapulse GS10 vfd (until now it was runnnig with grblhal).

Does "pktUart" allow me to connect my GS10 vfd directly to the mesa without a usb dongle?

Regards!

Please Log in or Create an account to join the conversation.

More
31 May 2025 22:56 #329475 by PCW
Replied by PCW on topic Mesa modbus and pktUart
Yes

Please Log in or Create an account to join the conversation.

Time to create page: 0.081 seconds
Powered by Kunena Forum