I'm exactly in that situation... I'm trying to fix an old single cell peltier machine. It works perfectly on its own, so hardware wise, it's good. It can communicate with the computer via a RS232 port, but the existing software to control does not have the capability I need. I decided to make my own control software.
Being a beginner, I did some searching to find that there is a python library for serial communications. I installed python and the library on the windows 98 computer. Interestingly, this windows computer is the only one with the RS232 9 pin com port out of the 6 computers inside the lab space. In any case, I think I have succeeded in opening communication between the two. The reason I think the communication is established is because the instrument is unavailable to the other software (although this might be just because I am trying to open two communications on the same port). The problem is that I have no idea what codes to send or how to interpret msg that it spits out... But I thought that it might be possible to hijack the msg that the already existing software is exchanging with the instrument. So looked into serial port listeners and found one which I tried (and not many were for windows 98), but didn't work. I think I was using it incorrectly... Finally, I found out that for Portmon you need to have all the windows closed before running portmon.exe... Why? I don't know, but it worked. One more important note is that you need to start collecting on Portmon first before establishing the software's connection to the instrument.
Anyhow, I put some of the results at the end. But I realized that I need to do it in hex rather than ascii. I did that today, but I don't have it with me right now, but the results shown clearly demonstrated what kind of data flows and how simple this communication is. From what I understand, the computer only sends two different requests: 1. ask for temperature data; 2. tell it the temperature set point.
I think I can easily get it working. I just need practical info on how to send data in hex, etc. Based on the ascii data it's clear what info I need. Other things are... I'll just ignore them I guess. I guess I'll post again once I get it to work (and have a bit of time). I hope this helps whoever is trying to resurrect old instruments. I had trouble finding detailed information on how to do this, which is one of the reasons why I'm writing.
15 0.00000810 scan.exe IOCTL_SERIAL_SET_LINE_CONTROL Serial1 SUCCESS StopBits: 1 Parity: NONE WordLength: 8
16 0.00000615 scan.exe IOCTL_SERIAL_SET_CHAR Serial1 SUCCESS EOF:0 ERR:0 BRK:0 EVT:0 XON:11 XOFF:13
17 0.00000922 scan.exe IOCTL_SERIAL_SET_HANDFLOW Serial1 SUCCESS Shake:0 Replace:0 XonLimit:1024 XoffLimit:1024
18 0.00000251 scan.exe IOCTL_SERIAL_SET_QUEUE_SIZE Serial1 SUCCESS InSize: 4096 OutSize: 2048
19 0.00005839 scan.exe IRP_MJ_WRITE Serial1 SUCCESS Length 6: .a.{..
20 0.00001648 scan.exe IOCTL_SERIAL_WAIT_ON_MASK Serial1 SUCCESS
21 0.00006509 scan.exe IRP_MJ_WRITE Serial1 SUCCESS Length 2: .a
22 0.00006314 scan.exe IRP_MJ_WRITE Serial1 SUCCESS Length 14: .a.x 25.00..
23 0.00002905 scan.exe IRP_MJ_WRITE Serial1 SUCCESS Length 2: .a
24 0.00001872 scan.exe IOCTL_SERIAL_GET_COMMSTATUS Serial1 SUCCESS
25 0.00001983 scan.exe IOCTL_SERIAL_WAIT_ON_MASK Serial1 SUCCESS
26 0.00000698 scan.exe IOCTL_SERIAL_GET_COMMSTATUS Serial1 SUCCESS
27 0.00001369 scan.exe IRP_MJ_READ Serial1 SUCCESS Length 26: ..x.!{ 0....x.!x 0..
28 1.94195128 scan.exe IOCTL_SERIAL_WAIT_ON_MASK Serial1 SUCCESS
29 0.00005448 scan.exe IRP_MJ_WRITE Serial1 SUCCESS Length 6: .a.$.V
30 0.00003213 scan.exe IRP_MJ_WRITE Serial1 SUCCESS Length 2: .a
31 0.00001676 scan.exe IOCTL_SERIAL_GET_COMMSTATUS Serial1 SUCCESS
32 0.00001844 scan.exe IOCTL_SERIAL_WAIT_ON_MASK Serial1 SUCCESS
33 0.00000754 scan.exe IOCTL_SERIAL_GET_COMMSTATUS Serial1 SUCCESS
34 0.00001425 scan.exe IRP_MJ_READ Serial1 SUCCESS Length 16: ..h.$ 40.5@..
35 1.78213125 scan.exe IOCTL
...
9563 0.00005308 scan.exe IRP_MJ_WRITE Serial1 SUCCESS Length 6: .a.$.V
9564 0.00004190 scan.exe IRP_MJ_WRITE Serial1 SUCCESS Length 2: .a
9565 0.00001537 scan.exe IOCTL_SERIAL_GET_COMMSTATUS Serial1 SUCCESS
9566 0.00001788 scan.exe IOCTL_SERIAL_WAIT_ON_MASK Serial1 SUCCESS
9567 0.00001816 scan.exe IOCTL_SERIAL_GET_COMMSTATUS Serial1 SUCCESS
9568 0.00001481 scan.exe IRP_MJ_READ Serial1 SUCCESS Length 16: ..h.$ 35.9@..
9569 0.76596243 scan.exe IOCTL_SERIAL_WAIT_ON_MASK Serial1 CANCELLED
9570 0.00001956 scan.exe IOCTL_SERIAL_GET_COMMSTATUS Serial1 SUCCESS
9571 0.00001229 scan.exe IOCTL_SERIAL_PURGE Serial1 SUCCESS Purge: TXABORT RXABORT TXCLEAR RXCLEAR
9572 0.00000754 scan.exe IRP_MJ_CLEANUP Serial1 SUCCESS
9573 0.02937049 scan.exe IRP_MJ_CLOSE Serial1 SUCCESS
No comments:
Post a Comment