MessageQue Question - VxWorks

This is a discussion on MessageQue Question - VxWorks ; Hi everyone , I have looked at the messageQue code examples. In those examples , first we declare LOCAL MSQ_Q_ID myMsgQId; then we create the msgQue and copy the return values of this func. to myMsgQId. Everything is fine up ...

+ Reply to Thread
Results 1 to 6 of 6

Thread: MessageQue Question

  1. MessageQue Question

    Hi everyone ,

    I have looked at the messageQue code examples. In those examples ,
    first we declare
    LOCAL MSQ_Q_ID myMsgQId;

    then we create the msgQue and copy the return values of this func. to
    myMsgQId. Everything is fine up to here.

    And then we add some data by msgQSend and somewhere in the program we
    read it by msgQReceive. All of this functions take myMsgQId as a
    parameter,so they know which que to access.

    This is OK for same program scope. But reason that message Que's exits
    is somehow different I believe. If I had two different programs(*.c
    files) , how could one know the QueId of the other one ?

    For example , my application(at layer-2) receives some data from
    hardware device which is in the local bus and another task runnig on
    layer-3 will send/receive some data with L1. But how can each task
    know the which Que's have data for itself

    Regards


  2. Re: MessageQue Question

    On Sep 24, 3:51 am, tguclu wrote:
    > Hi everyone ,
    >
    > I have looked at the messageQue code examples. In those examples ,
    > first we declare
    > LOCAL MSQ_Q_ID myMsgQId;
    >
    > then we create the msgQue and copy the return values of this func. to
    > myMsgQId. Everything is fine up to here.
    >
    > And then we add some data by msgQSend and somewhere in the program we
    > read it by msgQReceive. All of this functions take myMsgQId as a
    > parameter,so they know which que to access.
    >
    > This is OK for same program scope. But reason that message Que's exits
    > is somehow different I believe. If I had two different programs(*.c
    > files) , how could one know the QueId of the other one ?
    >
    > For example , my application(at layer-2) receives some data from
    > hardware device which is in the local bus and another task runnig on
    > layer-3 will send/receive some data with L1. But how can each task
    > know the which Que's have data for itself
    >


    Uh, is this a joke?
    You are familiar with the extern keyword, right?

    GV



  3. Re: MessageQue Question

    On Sep 25, 12:15 am, gvarndell wrote:
    > On Sep 24, 3:51 am, tguclu wrote:
    >
    >
    >
    >
    >
    > > Hi everyone ,

    >
    > > I have looked at the messageQue code examples. In those examples ,
    > > first we declare
    > > LOCAL MSQ_Q_ID myMsgQId;

    >
    > > then we create the msgQue and copy the return values of this func. to
    > > myMsgQId. Everything is fine up to here.

    >
    > > And then we add some data by msgQSend and somewhere in the program we
    > > read it by msgQReceive. All of this functions take myMsgQId as a
    > > parameter,so they know which que to access.

    >
    > > This is OK for same program scope. But reason that message Que's exits
    > > is somehow different I believe. If I had two different programs(*.c
    > > files) , how could one know the QueId of the other one ?

    >
    > > For example , my application(at layer-2) receives some data from
    > > hardware device which is in the local bus and another task runnig on
    > > layer-3 will send/receive some data with L1. But how can each task
    > > know the which Que's have data for itself

    >
    > Uh, is this a joke?
    > You are familiar with the extern keyword, right?
    >
    > GV- Hide quoted text -
    >
    > - Show quoted text -


    No,not a joke.
    Suppose there are 2 developers and 2 different DKM projects.
    These modules want to send/receive data to each other through
    msgQues. Would extern work in this case ?

    I thought there would be a different kind of mechanism , like a
    msgQueId tables or maybe msgQueNames that each task has prior
    knowledge which msgQue to access ?



  4. Re: MessageQue Question

    On Sep 25, 7:16 am, tguclu wrote:
    > On Sep 25, 12:15 am, gvarndell wrote:
    >
    >
    >
    > > On Sep 24, 3:51 am, tguclu wrote:

    >
    > > > Hi everyone ,

    >
    > > > I have looked at the messageQue code examples. In those examples ,
    > > > first we declare
    > > > LOCAL MSQ_Q_ID myMsgQId;

    >
    > > > then we create the msgQue and copy the return values of this func. to
    > > > myMsgQId. Everything is fine up to here.

    >
    > > > And then we add some data by msgQSend and somewhere in the program we
    > > > read it by msgQReceive. All of this functions take myMsgQId as a
    > > > parameter,so they know which que to access.

    >
    > > > This is OK for same program scope. But reason that message Que's exits
    > > > is somehow different I believe. If I had two different programs(*.c
    > > > files) , how could one know the QueId of the other one ?

    >
    > > > For example , my application(at layer-2) receives some data from
    > > > hardware device which is in the local bus and another task runnig on
    > > > layer-3 will send/receive some data with L1. But how can each task
    > > > know the which Que's have data for itself

    >
    > > Uh, is this a joke?
    > > You are familiar with the extern keyword, right?

    >
    > > GV- Hide quoted text -

    >
    > > - Show quoted text -

    >
    > No,not a joke.
    > Suppose there are 2 developers and 2 different DKM projects.
    > These modules want to send/receive data to each other through
    > msgQues. Would extern work in this case ?
    >
    > I thought there would be a different kind of mechanism , like a
    > msgQueId tables or maybe msgQueNames that each task has prior
    > knowledge which msgQue to access ?


    Yes you are right. MessageQ ID can be stored in a global table with
    some enum/name and global table can be accessed from all DKM. I have
    seen ppl using it this way.


  5. Re: MessageQue Question

    On Sep 24, 12:51 am, tguclu wrote:
    > Hi everyone ,
    >
    > I have looked at the messageQue code examples. In those examples ,
    > first we declare
    > LOCAL MSQ_Q_ID myMsgQId;
    >
    > then we create the msgQue and copy the return values of this func. to
    > myMsgQId. Everything is fine up to here.
    >
    > And then we add some data by msgQSend and somewhere in the program we
    > read it by msgQReceive. All of this functions take myMsgQId as a
    > parameter,so they know which que to access.
    >
    > This is OK for same program scope. But reason that message Que's exits
    > is somehow different I believe. If I had two different programs(*.c
    > files) , how could one know the QueId of the other one ?
    >
    > For example , my application(at layer-2) receives some data from
    > hardware device which is in the local bus and another task runnig on
    > layer-3 will send/receive some data with L1. But how can each task
    > know the which Que's have data for itself
    >
    > Regards


    Hi There,

    The easiest way to do this is to create a public msgQ. That is done
    by naming the msgQ with a / at the begining of the name. ie

    test1.cpp
    main test1()
    {
    MSG_Q_ID = msgQOpen ("/sharedMsgQ", ..,..,..);
    }

    test2.cpp
    main test2()
    {
    MSG_Q_ID = msgQOpen ("/sharedMsgQ", ..,..,..);
    }


    The creation of the msgQ will only happen once and the rest of the
    msgQOpen's will be references. Do this in all the programs that you
    want to have access to the msgQ and use it just like a normal msgQ.

    I know this works in vxWorks 6.4 and newer, but I am not sure about
    older version of vxWorks have this functionality.

    Joe


  6. Re: MessageQue Question

    On 25 Eylül, 20:04, "joseph.M.Gra...@gmail.com"
    wrote:
    > On Sep 24, 12:51 am, tguclu wrote:
    >
    >
    >
    >
    >
    > > Hi everyone ,

    >
    > > I have looked at the messageQue code examples. In those examples ,
    > > first we declare
    > > LOCAL MSQ_Q_ID myMsgQId;

    >
    > > then we create the msgQue and copy the return values of this func. to
    > > myMsgQId. Everything is fine up to here.

    >
    > > And then we add some data by msgQSend and somewhere in the program we
    > > read it by msgQReceive. All of this functions take myMsgQId as a
    > > parameter,so they know which que to access.

    >
    > > This is OK for same program scope. But reason that message Que's exits
    > > is somehow different I believe. If I had two different programs(*.c
    > > files) , how could one know the QueId of the other one ?

    >
    > > For example , my application(at layer-2) receives some data from
    > > hardware device which is in the local bus and another task runnig on
    > > layer-3 will send/receive some data with L1. But how can each task
    > > know the which Que's have data for itself

    >
    > > Regards

    >
    > Hi There,
    >
    > The easiest way to do this is to create a public msgQ. That is done
    > by naming the msgQ with a / at the begining of the name. ie
    >
    > test1.cpp
    > main test1()
    > {
    > MSG_Q_ID = msgQOpen ("/sharedMsgQ", ..,..,..);
    >
    > }
    >
    > test2.cpp
    > main test2()
    > {
    > MSG_Q_ID = msgQOpen ("/sharedMsgQ", ..,..,..);
    >
    > }
    >
    > The creation of the msgQ will only happen once and the rest of the
    > msgQOpen's will be references. Do this in all the programs that you
    > want to have access to the msgQ and use it just like a normal msgQ.
    >
    > I know this works in vxWorks 6.4 and newer, but I am not sure about
    > older version of vxWorks have this functionality.
    >
    > Joe- Al nt y gizle -
    >
    > - Al nt y göster -


    thanks
    i'll check it out.


+ Reply to Thread