Hi Nigel,

I am guessing that you have not connected the external port via the app.getPort("finaldata") call before issuing app.start(). Even though the xml defines the external port connection, it can't make that connection until the app actually retrieves the port using getPort, since getPort can have (optional) parameters that affect that connection.

I.e., you can't start a worker until its ports are truly ready to move data, and that can't happen until the external ports are fully "established", which means "connected to the application".

The cat_xml example is essentially what you are doing.

I made a note to clarify this in the doc, and perhaps catch/report the error at a higher level.

Let us know if this was it, or not.

Thanks,

Jim









On 4/16/12 2:25 AM, Merritt, Nigel (Contractor) wrote:

*UNCLASSIFIED*

Gents,

I have set up our test system with an RCC worker (foo_generator) that continuously generates data to its output port ("dataout").

The system is set up to either:
a) Attach an external port to dataout, which is read by the application or b) Create a second worker (foo_receiver) that accepts the data through its input port ("datain").
       In this case, there is no external port.

I.e:

[foo_generator]   --(external port)--> <foo_application>
[foo_generator]   --(dataout)--> [foo_receiver]

The difference is simply a parameter to determine the string used.

I have included the relevent code below, but in summary, a) always generates a segmentation fault during the call to 'start', for the same reasons I outlined in my previous email, i.e. the PORT_NOT_CONNECTED error in OcpiRccWorker.cxx, while b) works fine.

No worker code is reached before the seg fault occurs, so I have not included the start or run code here.

====== foo_generator.xml ======
<RccImplementation controloperations="start">
<xi:include href="foo_generator_spec.xml"/>
</RccImplementation>

====== foo_generator_spec.xml ======
<ComponentSpec Name="foo_generator">
<Properties>
<Property Name="numBuffers" type="ULong" Writable="true"/>
<Property Name="stopSending" type="Bool" Writable="true"/>
</Properties>
<DataInterfaceSpec Name="dataout" Producer="true">
<xi:include href="stream_protocol.xml"/>
</DataInterfaceSpec>
</ComponentSpec>


====== String used to create the system in OA::Application constructor -*for a)*======
std::string fooapp("<application>");

fooapp.append("<instance worker='foo_generator'>");
fooapp.append(" <property name='stopSending' value='0'/>");
fooapp.append("</instance>");

fooapp.append("<connection>"
              " <external name='finaldata'/>"
              " <port instance='foo_generator' name='dataout'/>"
              "</connection>");

fooapp.append("</application>");


====== String used to create the system in OA::Application constructor -*for b)* ======
std::string fooapp("<application>");

fooapp.append("<instance worker='foo_generator'>");
fooapp.append(" <property name='stopSending' value='0'/>");
fooapp.append("</instance>");
fooapp.append("<instance worker='foo_receiver' selection='model=="RCC"'/>");

fooapp.append("<connection>"
              " <port instance='foo_generator' name='dataout'/>"
                " <port instance='foo_receiver' name='datain'/>"
              "</connection>");

fooapp.append("</application>");

====== Text shown on error ======
Application established: containers, workers, connections all created
Communication with the application established
<<=== start called here ===>>
terminate called after throwing an instance of 'OCPI::Util::EmbeddedException'
Aborted
make: *** [run] Error 134

   Nigel

*IMPORTANT*: This email remains the property of the Department of Defence and is subject to the jurisdiction of section 70 of the Crimes Act 1914. If you have received this email in error, you are requested to contact the sender and delete the email.



_______________________________________________
opencpi_dev mailing list
[email protected]
http://lists.opencpi.org/listinfo.cgi/opencpi_dev-opencpi.org

_______________________________________________
opencpi_dev mailing list
[email protected]
http://lists.opencpi.org/listinfo.cgi/opencpi_dev-opencpi.org

Reply via email to