socket functions per chance?
The trick though is sending your packets in the correct byte-order so your server can read them and I suspect it's big-endian if it's an old legacy system.
...which could be a real big pain in the ass to work with since your scripts will write out little-endian packets.
So you'll have to do some hefty bitmasking to get it all to work... and I am so not envying you right now my man.
But, If I were you I would start just by opening a socket and grabbing the initial response and seeing if you could make it intelligible and work it from there.