SDL-News: Communication between processes in different blocks


Subject: SDL-News: Communication between processes in different blocks
From: Sergio Lopes (Sergio.Lopes#dei.uminho.pt)
Date: Tue Aug 04 1998 - 19:25:17 GMT


The originator of this message is responsible for its content.
-----From Sergio Lopes <Sergio.Lopes#dei.uminho.pt> to sdlnews -----

Dear SDLers,

I have the following problem:

I two processes in different blocks with 2 instances of each in the
block. I want to establish communication between them in a deterministic
way, this is, I want the instance 1 in the 1st block to communicate with
the instance 1 of the 2nd block. As I cannot create a child process in
different block, how do I solve this? I looking for the most efficient
manner to do it.
To better clarify the problem I've included the PR description of an
example matching the problem:

SYSTEM examplesystem;

  newtype ExampleType
   struct
   field1 natural;
   field2 integer;
  endnewtype;
  
  signal
  mesg1(ExampleType), mesg2;

  CHANNEL ch
    FROM block1 TO block2 WITH mesg1;
    FROM block2 TO block1 WITH mesg2;
  ENDCHANNEL;

  BLOCK block1;

    SIGNALROUTE r1
      FROM process1 TO ENV WITH mesg1;
      FROM ENV TO process1 WITH mesg2;

    CONNECT ch AND r1;

    PROCESS process1
    (2,2);
      dcl a ExampleType;
      START ;
        NEXTSTATE state1;
      STATE state1;
        INPUT mesg2;
          TASK 'do something';
          OUTPUT mesg1(a);
          NEXTSTATE -;
      ENDSTATE;
    ENDPROCESS;

  ENDBLOCK;

  BLOCK block2;

    SIGNALROUTE r2
      FROM ENV TO process2 WITH mesg1;
      FROM process2 TO ENV WITH mesg2;

    CONNECT ch AND r2;

    PROCESS process2
    (2,2);

      dcl a ExampleType;
      dcl b natural, c, d integer;

      START ;
        NEXTSTATE state1;
      STATE state1;
        INPUT mesg1(a);
          DECISION a;
            ( (. b, c .) ):
              TASK 'do something';
            ( (. b, d .) ):
              OUTPUT mesg2;
            ELSE:
          ENDDECISION;
          NEXTSTATE -;
      ENDSTATE;
    ENDPROCESS;

  ENDBLOCK;

ENDSYSTEM;

By the way, I have another problem still: how can avoid the GROUND
EXPRESSION EXPECTED warning in the decision of process2?
That is, Is it possible to have decision answers with variables?

Thank you in advance.

Best regards,
Sergio Lopes.

=====================================================
Name: Sergio Adriano Fernandes Lopes
Address: Dpto Electronica Industrial e-mail:
sfl#dei.uminho.pt
        Universidade do Minho Tel.: +351 53 510190
        Campus de Azurem Fax: +351 53
510189
        4800 Guimaraes
        PORTUGAL
                      
=====================================================

-----End text from Sergio Lopes <Sergio.Lopes#dei.uminho.pt> to sdlnews -----
For help, email "majordomo#sdl-forum.org" with the body of your email as:
    help
or (iff this does not answer your question) email: owner-sdlnews#sdl-forum.org



This archive was generated by hypermail 2a23 : Sun Jun 16 2013 - 10:41:40 GMT