Spinroot

A forum for Spin users

You are not logged in.

#1 2011-01-03 06:17:38

rangu
Member
Registered: 2011-01-03
Posts: 6

Message Between Processes

I want to send a string between 2 processes. Please any one help me for this. I am not getting how to send a bulk of character at a time between processes.

Offline

#2 2011-01-04 17:22:05

spinroot
forum
Registered: 2010-11-18
Posts: 691
Website

Re: Message Between Processes

a String is not a basic data type in Promela, so I'm afraid that you cannot do this.
You could of course send a byte array, for instance by definiting a data structure with a typedef that holds the byte array:
   typedef String { byte word[32]; };
and then declare an instance of that type:
   String mystring;
Now you can fill in the characters in the word and send the String over a channel:
    chan c = [2] of { String };

    c!mystring;

etc. (but this is of course not really a convenient way to do things).

Better is to use mtype declaration for fixed terms, that otherwise you'd use a string for:

  mtype = { Apple, Pear, Hello_World };

  mtype mystring = Hello_World;

and then use the mtype in the channel and for communications.

Offline

#3 2011-01-25 07:13:47

rangu
Member
Registered: 2011-01-03
Posts: 6

Re: Message Between Processes

Thanks for yous reply sir.........

Offline

Board footer

Powered by FluxBB