Mesa modbus and pktUart

  • vre
  • Away
  • Platinum Member
  • Platinum Member
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.

  • vre
  • Away
  • Platinum Member
  • Platinum Member
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.

Time to create page: 0.086 seconds
Powered by Kunena Forum