5 ms·
> that sniffing the protocol would be fairly simple ah yes, "fairly simple". The protocol is not the issue, the data within is. There are hundreds of datapoint
by parker_mountain 4y ago
> that sniffing the protocol would be fairly simple
ah yes, "fairly simple". The protocol is not the issue, the data within is. There are hundreds of datapoints, various switching logic, and tons more of 50 years of accumulated cruft. At least. All in a well tested, stable, and understood package. The documentation is probably pretty good but likely has small (but crucial) errors.
It's easy to assume that this would be a simple rewrite, but real engineering (not the kind we do on hacker news! lol) requires tons of planning, testing, and phasing in. This is dealing directly with people's safety after all! It's interfacing with a train control system, not a webapp that turns markdown into memes.
also
> RS-232 is my guess (could be the parallel port)
RS-232 is inherently a serial protocol. If you're using RS-232 since basically ever, it's either a built in serial port, some sort of serial headers, or some sort of usb-to-serial adapter. The parallel port has never been directly used for RS-232 - they are fundamentally different technologies.
- midoridensha 4y agoIn 1990, RS-232 used 25-pin ports (DB25), and the DB9 ports were "new". Why they used 25-pin ports for RS-232 I'm not sure, since only a fraction of the lines (less than 9) were actually used, probably some silly historical reason. 25-to-9-pin adapters were very common then. The DB25 connector was also used for parallel ports as you said, which caused confusion sometimes. But on a standard PC, the printer port (parallel) was a 25-pin female port, whereas the serial ports (25 or 9 pin) were male.
- parker_mountain 4y agoI guess around 1995 then? Whenever they switched to DB25 to DE9 for serial. > probably some silly historical reason original rs232 spec had a lot more signals and capabilities that very few consumer products implemented. So you were expected to have the full connector, even if the lines weren't hooked up.
- midoridensha 4y ago>I guess around 1995 then? Whenever they switched to DB25 to DE9 for serial. There was a transition during the 90s where the DB25s were phased out and replaced with DE9s. Computers became more commonplace and popular, and they also became smaller, so the bulky 25-pin port fell out of favor.
- hulitu 4y agoThe bulky 25 pin fell out of favor because some of its pins function was implemented in SW (new SW appeared which used SW flow control).
- II2II 4y agoHardware flow control was retained with DE-9. The lines that were dropped included an entire secondary communications channel and timing signals, the sorts of features that I doubt saw much use in personal computers in the 1980's (when it was mostly used for things like modems and printers) and would see even less use today (when it seems to be mostly used for diagnostics ports).
- Gordonjcp 4y ago> I guess around 1995 then? Whenever they switched to DB25 to DE9 for serial. 1984.
- deleted 4y ago[deleted]
- joezydeco 4y agoI own a wacky serial cable that has both DB25 and DB9 connectors on both ends and it has saved my ass more than once in the last decade or so. I'm never giving it up.
- fsckboy 4y ago> DB9 port trivia: believe it or not, it's actually called DE-9
- teddyh 4y agoYes, but usage of the incorrect “DB-9” terminology was very widespread, almost to the extent that it could be considered an alternate term.
- jchw 4y agoAs far as I understand there were actually lots of different "RS232" variations. Nowadays I believe everything is asynchronous, which makes many of the pins that used to be connected redundant; lines that carried things like clock or additional flow control related signals. I'm not an expert, I just noticed this looking at old NEC computers.
- retrac 4y agoRS232 itself is a well-defined spec. But you're right. An lot of equipment existed that was only vaguely RS232 compatible. Some of it even predates RS232. For example, the old electromechanical teletype machines send and receive something close enough to RS232 line signalling that you can connect them to a modern computer's RS232 port, if you wire up a tiny analog circuit to convert from telegraph-style current impulses to RS232-style voltage levels. Just set the UART to 50 bps with 5 bit data and 2 stop bits. And don't send anything too soon after a carriage return! Not all UARTs can handle those settings, but that's why such options were in terminal programs back in the day.
- ghaff 4y agoDB25 ports were also used for different (although related) standards like RS-422.
- dfox 4y agoOne particular thing to note is that on anything IBM PC related the DB25 RS-232 connector has the wrong gender (apparently so that it can be connected directly to modem with DB25 extension cable instead of 1:1 M-M cable as would be expected for RS-232).
- Gordonjcp 4y agoDE9 ports - get the terminology right! - were introduced on the IBM PC/AT in 1984 so they weren't especially new in 1990. Indeed, by 1990 DB25 serial had pretty much vanished from PCs, and only existed as a thing that was a pain in the arse to connect to over existing cabling.
- HeyLaughingBoy 4y ago> DE9 ports - get the terminology right! Warms my heart to see that I'm not the only person who's a stickler for this :-)
- rramadass 4y agoWell said! Kids nowadays don't understand what it takes to build, battle-test and maintain complex systems over decades in operation. It is a marvel of Engineering (both HW and SW) and the experts are worth their weight in gold. There is much to learn from them. Do you have any links to where we can read about its architecture and system as a whole?
- jalk 4y agoThey were using a ThinkPad from 2000, therefore I was guessing RS232 and not RS-424 or other industrial ports. A laptop for that age would also have a parallel port, so in theory it could be some bespoke parallel protocol, but pretty unlikely. > It's easy to assume that this would be a simple rewrite, but real engineering I said - "If all they are using the DOS software for, is to get a log-file from the train, then its probably easy". The system is from the 70'ies so its very possible that they originally hooked up dumb terminals. Those are even harder to come by today and had no real way of getting data out of (hard-copy of what was on the screen to line-printer perhaps). Old terminal are also very clunky to haul around compared to even an old laptop. So the DOS program could very well just be a VT05 emulator, without any actual program logic built into it. So no I was not suggesting a rewrite but rather hack something together like some of us old greybeards here on hackernews like to do.
- akiselev 4y agoA lot of old industrial equipment used PCs with parallel ports in place of custom controllers. Parallel ports that were on the motherboard and hooked into the southbridge chipset could be accessed by DMA and driven in hard real time which is otherwise practically impossible to achieve on a speculative processor running Windows. The drivers could convert some gcode to digital signals in a ring buffer driven by an interrupt and just let the parallel port output the 5V logic signals to amplifiers, motor drivers, and so on. This was especially important for a lot of machinery because only mass market CPUs were fast enough to i.e. run computer vision to calibrate and then interpolate tool paths for a pick and place machine that placed thousands of components a minute. MachCNC was a popular CNC controller among hobbyists that exploited this feature, for example. It wasn’t until the explosion in the popularity of 3D printers that open source CNC controllers that could run on a cheap MCU became widely available (Klipper, Marlin, etc) The manufacturers saved a lot in NRE and manufacturing costs because a driver is a lot cheaper to write than a low volume controller design - with the parallel port they just had to design a board with a parallel port input that fanned out to a bunch of connectors going to off the shelf motor drivers and stuff. It also meant a much better user experience for users and devs alike but starting with Windows 8 drivers could no longer access LPT via DMA for security reasons (everything on the southbridge was exposed including USB iirc). I suspect theres some proprietary component for which the driver source code was lost so they can’t adapt it to run off a PCI parallel port card (my memory is fuzzy but DMA to southbridge works differently enough from PCI DMA that it’s not as simple as changing the port number) and USB adapters can’t provide the timing guarantees. They could use an off the shelf PCI FPGA card but parallel ports were extremely common all over industry especially with offices printers so it’s very battle tested hardware. Replacing that is just too risky because redundant safety systems are far better at covering for failures than making sure new bugs don’t slip through.