|Re: Update of ILPer, the HP-IL peripheral simulator|
Message #26 Posted by Christoph Giesselink on 5 July 2011, 5:01 p.m.,
in response to message #25 by Marcus von Cube, Germany
How do you handle the loop setup? Is it temporary in the sense that each connection is established just for a single packet and then closed, or is permanent?
When the client get his first frame to send, the client setup the connection and stay permanent. If sending failed to an established connection, the client automatically reopens the connection and then send the frame again.
Then how do you setup the complete loop? You can't start all servers at the same time?
Yes, I can start all servers at the same time, because the clients establish their connection at the first frame and not at program startup.
I think its much easier to use UDP instead because its connectionless. A server just listens for packets, checks if it is meant, acts upon the data if necessary and sends a response or the unmodified packet to its next partner. There is no error if the partner cannot be reached but the controller will monitor the arrival of the packet it had sent and will either raise an error or try again, just as it would if the physical loop were broken. I have the feeling that the handling will be much easier for a device and the logic in the controller is already there. With this scheme, its no problem to stop a device and replace it with some other, just acting on the same ports or interfaces. If you want to add or remove a device, you need to stop and reconfigure its neighbors but the rest of the loop is not affected.
I made a proof of concept program with configurable settings of using IPv4, IPv6, TCP/IP and UDP in September/October last year. The main reason for choosing TCP/IP was, when I tried to establish a IPv6 connection, but the gateway was only IPv4, the UDP package get lost. With TCP/IP I get an error when I try to "connect" a IPv6 connection over a IPv4 only gateway. Because I implemented a dual stack (after recompiling the sources with a IPv6 capable C++ compiler) I switch back to IPv4 and establish the connection over IPv4. Furthermore TCP/IP helps to find a broken link. The program which find no server under the given IP address can pop up an error message box. Before, I preferred UDP like you, because the behavior is closer to the original hardware.
With the retry of an established connection I described above it's no problem to stop a device, replace it and start again. The problem is on the HP-IL loop controller side, because the new device has only his default HP-IL address, you have to readdress the loop, on the HP71B with "RESTORE IO".
Hope this make the interface more clear. The programs are licensed under the GPL, so you may have a look at the sources.