(hp50g) HPGCC and User RPL - Hewlett Packard

This is a discussion on (hp50g) HPGCC and User RPL - Hewlett Packard ; I discovered HPGCC yesterday and so i though I can speed my project using HPGCC. The project ist a mechanical engineering program to calculate the ISO tolererances of holes and rods. For example input: 100. H7/g6 output: Hole 0 -7 ...

+ Reply to Thread
Results 1 to 4 of 4

Thread: (hp50g) HPGCC and User RPL

  1. (hp50g) HPGCC and User RPL

    I discovered HPGCC yesterday and so i though I can speed my project
    using HPGCC.
    The project ist a mechanical engineering program to calculate the ISO
    tolererances of holes and rods.

    For example input: 100. H7/g6

    output: Hole 0 -7 um; Rod -5 +9 um

    (the values are from fantasy)

    I wrote this program just in many languages (Basicalc, .NET OPL) and
    also in C.

    So I would like to reuse the C code.

    My question is:
    How can I manage the input/output on the HP50g with a C programm?
    Should I mix C compiled functions in a User RPL program?

    Someone can give me hints or suggestions?
    guilippo

  2. Re: (hp50g) HPGCC and User RPL

    guilippo@vtxmail.ch wrote:
    > I discovered HPGCC yesterday and so i though I can speed my project
    > using HPGCC.
    > The project ist a mechanical engineering program to calculate the ISO
    > tolererances of holes and rods.
    >
    > For example input: 100. H7/g6
    >
    > output: Hole 0 -7 um; Rod -5 +9 um
    >
    > (the values are from fantasy)
    >
    > I wrote this program just in many languages (Basicalc, .NET OPL) and
    > also in C.
    >
    > So I would like to reuse the C code.
    >
    > My question is:
    > How can I manage the input/output on the HP50g with a C programm?


    HPGCC has an extensive interface to the HP 50's stack.
    Please refer to the sat_* functions in the documentation.

    You could also read variable values via console style functions, but I
    strongly recommend using the stack interface.

    > Should I mix C compiled functions in a User RPL program?


    While this is technically well possible, it's probably not advisable.
    Simply stay with a pure C program, unless you have good reasons for a mix.

    > Someone can give me hints or suggestions?
    > guilippo



    --
    Ingo Blank

    http://hpgcc.org
    http://blog.hpgcc.org

    Public Key ID: 14137F7D
    http://hpgcc.org/pgp_key_14137F7D.txt
    Fingerprint: FEA5 B074 1EB2 29B3 1FAB CFD3 AFD6 E2D0 1413 7F7D


    To reply by email, please substitute "spam" with my first name in the
    'Reply-To' address.

  3. Re: (hp50g) HPGCC and User RPL

    On Mar 22, 5:16 pm, guili...@vtxmail.ch wrote:
    > I discovered HPGCC yesterday and so i though I can speed my project
    > using HPGCC.
    > The project ist a mechanical engineering program to calculate the ISO
    > tolererances of holes and rods.
    >
    > For example input: 100. H7/g6
    >
    > output: Hole 0 -7 um; Rod -5 +9 um
    >
    > (the values are from fantasy)
    >
    > I wrote this program just in many languages (Basicalc, .NET OPL) and
    > also in C.
    >
    > So I would like to reuse the C code.
    >
    > My question is:
    > How can I manage the input/output on the HP50g with a C programm?
    > Should I mix C compiled functions in a User RPL program?
    >
    > Someone can give me hints or suggestions?
    > guilippo


    Check out http://sense.net/~egan/hpgcc/. There are a lot of examples.

  4. Re: (hp50g) HPGCC and User RPL

    Just to add a second concurring opinion.

    > HPGCC has an extensive interface to the HP 50's stack.
    > Please refer to the sat_* functions in the documentation.


    Like Ingo said, most things you'll want done are already implemented.
    To take a set of three real numbers from the stack, you'd use
    something like:

    double stack1 = sat_pop_real(), stack2 = sat_pop_real(), stack3 =
    sat_pop_real();

    And to push a result:

    sat_push_real(result); //returns real to stack


    > > Should I mix C compiled functions in a User RPL program?

    >
    > While this is technically well possible, it's probably not advisable.
    > Simply stay with a pure C program, unless you have good reasons for a mix.


    An example of a good reason would be that you have a really
    complicated set of inputs and want to use a custom input form to get
    data. Making one in C would not have the same flexibility, and be
    much larger. Then your interface would be a few hundred bytes, and
    once calculations start it would be essentially instantaneous.

    TW

+ Reply to Thread