I’m sure I’m missing something basic, but am really hoping someone can point out a basic mistake I’m making.
I located the X-modem protocol, https://www.ghielectronics.com/community/codeshare/entry/697 , and downloaded it, calling it from the main code done in VB. Using a wired connection, (via null modem, (fyi, don’t try to find one at Bestbuy, they think your the idiot, and maybe I was for trying to find one there)), finally was able to get it work by calling the routine in a thread. It absolutely would not work if I didn’t call it in a thread, but in calling it, it worked reliably.
That said, moved out to the real world, using radio’s, and working around large steel structures, the reliability went way down. (For example, detecting end of files, where there shouldn’t have been, ect). So, after trying to troubleshoot, I finally decided to convert the entire project into VB, where for the most part, it became stable again (with the exception of running in a thread) as I made small changes to it. At this point, it was calling exceptions, and when I would try to put in breakpoints, most items were unable to evaluate, followed by a Visual Studio Crash. So I moved it out of a thread, and just called it directly. At this point, was happy, was able to talk with all devices on a site, but got tired of replicating code between different slave devices, & the master, and moved it all to a separate project.
Now I can talk to all the devices, but now that it’s a separate project, it and the Ethernet Connection back to a web server are fighting, No changes to the code. So, decided to try putting the X-modem routine back into a thread. First time thru, executes great. Second time thru, fails miserably, to the point, it takes a minute after Control-Alt-Delete, to tell my computer to reboot. In diagnostics, the first time thru, I debug print the thread’s id on initialization, and watch, and it terminates fine, and just for kicks & giggles, run the GC, before initializing it again. I guess, one of the big questions I’m asking, are there hidden glitches in VB, that I should bite the bullet and stop using it all together, as for me its just such an easier language to think in.
Anybody with any thoughts.