I have an external exe program that reads from the stdin and produces a result. It works like the wc
program and reads until the EOF. (Or End of Stream, rather.
If I understand correctly you are trying to re-use port connection between several calls like echo 339371249625 | LookupProj.exe, but afaik the only way to close the stdin is actually to close the port with port_close/1, so all this dance around ports is not any better than launching that commands with os:cmd/1.
If you can modify that LookupProj.exe you'd want to make consider some predefined byte sequence at stdin as an end of command and just send it each time you're done instead of EOF.