Modbus process kills stdTV!
Charles Edmondson
Posts: 46
Hi All,
Well, another thrilling descent into the abyss of debugging! A really strange one...
I am adding MODBUS to an existing product that was using CAN before. I am using Pacman's MODBUS RTU code, which I have expanded to handle a custom group of registers. The product also uses the standard stdTV, stdGraphics and stdTerminalMgr spins to generate a TV display of local status. When I add in my MODBUS code, it somehow breaks the TV code! I just get a blank screen output.
Now, try as I might, I can not find any way my code would interact with the TV code. They are on different physical pins (the same ones used by the old CAN software) and I don't see any code overlap between them. No common variable names, except in their respective assembler code. Any ideas out there what could be causing this? Could I be running out of cogs? How can you tell from the compiler????
Any ideas would be appreciated.
BTW, my MODBUS code works fine, even with the screen down...
Well, another thrilling descent into the abyss of debugging! A really strange one...
I am adding MODBUS to an existing product that was using CAN before. I am using Pacman's MODBUS RTU code, which I have expanded to handle a custom group of registers. The product also uses the standard stdTV, stdGraphics and stdTerminalMgr spins to generate a TV display of local status. When I add in my MODBUS code, it somehow breaks the TV code! I just get a blank screen output.
Now, try as I might, I can not find any way my code would interact with the TV code. They are on different physical pins (the same ones used by the old CAN software) and I don't see any code overlap between them. No common variable names, except in their respective assembler code. Any ideas out there what could be causing this? Could I be running out of cogs? How can you tell from the compiler????
Any ideas would be appreciated.
BTW, my MODBUS code works fine, even with the screen down...
Comments
-Phil
I tried downloading one of the four serial port objects to replace my two separate serial port routines, which should have restored at least one cog, but still have the same errors - when I add in the start routine for the modbus, I get no TV. comment out the start routine, and I have TV.
So, how can a Modbus routine interfere with the TV routine?????
It is interesting that the TV routines, while OBEX, are old, dated 2004! Too bad there isn't some history somewhere that I could see what updates have been made since then, and why!
-Phil
Thanks for the suggestion though!
mod.Start
If you comment it out, the TV runs. If you don't, it doesn't
!TV_MODBUS_PROBLEM.zip
I split the Start routine into two parts, the initializer and took the bottom half with the receive process and call it MODBUS and started it in a new cog. It works! Now to go back to my original code and fix it there...
My problem now is that there seems to be corruption of the packet. I can see the packet getting to the processor receive pin, but I keep sending exception errors back. Since I get enough of a packet to be able to process it, this is driving me crazy. Earlier today, with the same code, I was actually replying correctly, but my receive channel kept giving me an error of 'packet too long' which didn't help a bit!
Anyone worked with RS485 lines that knows what problems I could be running into?
THANKS FOR ANY HELP YOU CAN GIVE ME!!