gates index out of range

51 views
Skip to first unread message

Rico Hartono

unread,
Mar 13, 2014, 1:16:40 AM3/13/14
to omn...@googlegroups.com
Hello guys.. Right now I am working a project with Omnet++ 4.2.2, and I have a problem with this gates index.
I always got this kind of error:

Error in module (d) Testnet.f.d ... Gate index ... out of range when accessing vector gate 'out[]' with size 4

Here is my ned file code, hopefully somebody can help me with this problem,

module f
{
    @display("bgb=272,261");
    gates:
        input in[];
        output out[];
    submodules:
        c: c {
            parameters:
            @display("p=75,121");
            gates:
                in[sizeof(in)];
        }
        d: d {
            parameters:
            @display("p=185,121");
            gates:
                out[sizeof(out)];
        }
    connections:
        for i=0..sizeof(in)-1 {
            in[i] --> c.in[i];
        }
        for i=0..sizeof(out)-1 {
            d.out[i] --> out[i];
        }
        c.out --> d.in;
}

Rico Hartono

unread,
Mar 13, 2014, 1:31:48 AM3/13/14
to omn...@googlegroups.com
Oh I forget to tell. the gate index is always shows a big number despite i just use this compound module to connect with 4 nodes

Michael Kirsche

unread,
Mar 14, 2014, 4:14:31 PM3/14/14
to omn...@googlegroups.com
Hard to fully grasp as you did not provide the network configuration or the NED definition of your submodules c and d.
First thought... the line c.out --> d.in;
But without complete source code or minimal example... hard to say.

Anurag Singh

unread,
Jun 16, 2016, 4:26:49 PM6/16/16
to OMNeT++ Users
I have similar problem but after 10 second during simulation.
Reply all
Reply to author
Forward
0 new messages