taskSpawn in C++ is not working.... - VxWorks

This is a discussion on taskSpawn in C++ is not working.... - VxWorks ; taskSpawn in C++ is not working.... hello. i am a newbie in using vxWorks and i am having some difficulties using taskSpawn command in a C program that i made. I have created hello.o and test.o where void hello() { ...

+ Reply to Thread
Results 1 to 2 of 2

Thread: taskSpawn in C++ is not working....

  1. taskSpawn in C++ is not working....

    taskSpawn in C++ is not working....

    hello. i am a newbie in using vxWorks and i am having some
    difficulties using taskSpawn command in a C program that i made. I
    have created hello.o and test.o where


    void hello()
    {
    printf("Hello vxWorks!\n");
    }


    void test()
    {
    char file[20] = "hello";
    ld(0,0,"hello.o");
    sp(file);
    }

    if i load test.o from shell and execute it, ld part works but spawning
    hello does not work.
    i have tried it with taskSpawn command as well


    void test()
    {
    char file[20] = "hello";
    ld(0,0,"hello.o");
    taskSpawn("App",100,0,20000,file,0,0,0,0,0,0,0,0,0,0);
    }

    but this test.o file does not work as well.

    so i have tried it in a different way with a test.o file with the
    hello() part inside it. this time, sp command worked just fine.


    void hello()
    {
    printf("Hello vxWorks!\n");
    }
    void test()
    {
    char file[20] = "hello";
    sp(file);
    }


    is there a way to spawn a task that has been already loaded by another
    *.o file?
    can anyone help me with this problem?


  2. Re: taskSpawn in C++ is not working....

    On Apr 15, 11:05 am, "chasingS2" wrote:
    > taskSpawn in C++ is not working....
    >
    > hello. i am a newbie in using vxWorks and i am having some
    > difficulties using taskSpawn command in a C program that i made. I
    > have created hello.o and test.o where
    >
    >
    > void hello()
    > {
    > printf("Hello vxWorks!\n");
    >
    > }
    >
    >
    > void test()
    > {
    > char file[20] = "hello";
    > ld(0,0,"hello.o");
    > sp(file);
    >
    > }
    >
    > if i load test.o from shell and execute it, ld part works but spawning
    > hello does not work.
    > i have tried it with taskSpawn command as well
    >
    >
    > void test()
    > {
    > char file[20] = "hello";
    > ld(0,0,"hello.o");
    > taskSpawn("App",100,0,20000,file,0,0,0,0,0,0,0,0,0,0);
    >
    > }
    >
    > but this test.o file does not work as well.
    >
    > so i have tried it in a different way with a test.o file with the
    > hello() part inside it. this time, sp command worked just fine.
    >
    >
    > void hello()
    > {
    > printf("Hello vxWorks!\n");}
    >
    > void test()
    > {
    > char file[20] = "hello";
    > sp(file);
    >
    > }
    >
    > is there a way to spawn a task that has been already loaded by another
    > *.o file?
    > can anyone help me with this problem?


    See if you can make your char* into a funcptr in your taskSpawn()
    arguments.

    int HiWorld(void)
    {
    int checkTaskErr = 0;
    checkTaskErr = taskSpawn("Saying_Hi", 200, 0, 2000, (FUNCPTR)SayHi,
    0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0);
    printf("\n");
    printf("%x\n", checkTaskErr);
    return 0;
    }

    /* This function will print a hello message and return */
    int SayHi()
    {
    printf("Hey world what's happenin?\n");
    printf("I'm going to take a nap!\n");
    return 0;
    }


+ Reply to Thread