Post Reply 
Modern thermal printer to emulate 82240B
02-28-2018, 09:05 PM
Post: #9
RE: Modern thermal printer to emulate 82240B
There is another way: Connect the emulated calculator and the (emulated) printer with a local socket. Here is some code from WP-34s (print.c):
Code:
/*
 *  Send printer output to emulated HP 82440B by Christoph Gieselink
 */
#undef State
#undef Alpha
#define shutdown shutdown_socket

#include <winsock.h>
#define UDPPORT 5025
#define UDPHOST "127.0.0.1"

int put_ir( int c )
{
    int s;
    WSADATA ws;
    struct sockaddr_in sa;

    set_IO_annunciator();
    WSAStartup( 0x0101, &ws );

    sa.sin_family = AF_INET;
    sa.sin_port = htons( UDPPORT );
    sa.sin_addr.s_addr = inet_addr( UDPHOST );

    s = socket( AF_INET, SOCK_DGRAM, 0 );
    sendto( s, (const char *) &c, 1, 0, (struct sockaddr *) &sa, sizeof( struct sockaddr_in ) );
    closesocket( s );
    return 0;
}
The output goes typically to Christoph Gieselink's HP 82440B emulator or its equivalent which is part of the WP-34s project. Only the latter would need to be adapted to send output to a physical printer instead of the screen.

I'm not proficient enough with Free42 to tell if the application can do the same, i. e. sent its IR output to a socket.

Marcus von Cube
Wehrheim, Germany
http://www.mvcsys.de
http://wp34s.sf.net
http://mvcsys.de/doc/basic-compare.html
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: Modern thermal printer to emulate 82240B - Marcus von Cube - 02-28-2018 09:05 PM



User(s) browsing this thread: 1 Guest(s)