Hello everybody !
I'd like to ask You for some feedback on my wierdo problem that I got with my program.
I have built a device that detects changes in magnetic field. It is used for detecting vehicles passing it on a highway. Generally the main components communicate with each other by RS-485 protocol, but I would like to connect the device to a PC. To do so I am using a RS-232 protocol (I have a RS485=RS232 hardware converter).
Now, I made the program (even two), which generally works, BUT some wierd things are going on sometimes; it happens that I have a problem to get a communication (after that, resetting the device by un-powering it helps, sometimes I have to restart the PC as well) but overall it happens quite not so often. The project itself is for passing one of my subject on the university - so I have to run the whole thing over there, here comes another problem : the program did not work on all of the bunch of PC's that are there. Same thing happens on my notebook. The effect of 'non working' is : I am recieving same data packet that is beeing sent... BTW : notebook does not have a RS232 port and I am using a USB-RS232 calbe converter (to count it out from the reason of problems I have checked it on my main PC and it works almost fine - almost because ocasionally I am getting the same sympthomps as I mentioned before ).
Other problem is, when it works, that I am loosing communication for couple of hundreds of miliseconds and then it comes back to normal (i can see it on the osciloscope).
I alredy looked for some answears here and there, and I found some suggestions about using 'buffer cleaning method', unfortunatelly I kinda do not know how to do it, and might that help anyways ?
I also thought about using VISA drivers, but I am having trouble with it as well - the damn thing just does not work.
My very bling guess is that everyting that I am expierencing is about using the communication protocol and seting it right. I am attaching both of the programs, PLEASE anyone pretty pretty help I totally ran out of ideas and knowledge and day after day I am turning it on and off on my PC and notebook hoping some miracle will occour ... 😞
.
Many many thanks in advance !
Best regards
Tom
P.S. the program is very unfinished (man things are just put in), the main thing I am struggling now is getting, and setting the communication protocol right.