Dear All!
I am trying to publish some sensor data via DDS from Python code.
Basically, the relevant parts of the code are:
with rti.open_connector(config_name="MyParticipantLibrary::MyPubParticipantT", url="Definition.xml") as connector:
self.output=connector.get_output("a::MyWriterT")
self.output.wait_for_subscriptions()
self.dds_instance=self.output.instance
And after some steps within the statemachine:
self.dds_instance.set_number("temperature",30)
self.output.write()
On both red lines it throws an exception of access violation with traceback to:
File "...\site-packages\rticonnextdds_connector\rticonnextdds_connector.py", line 944, in set_number
_check_retcode(connector_binding.set_number_into_samples(
OSError: exception: access violation reading 0x066E10B0
The strange thing is that if I copy the red lines right after the first code, it runs correctly.
Do you have any idea what can be the issue?
Thanks in advance:
Benedek
Hey,
Are you able to share your Definition.xml file?
sure, however I don't think that causes the error, because if I copy the red lines right after the first code, it works.
Ok, sorry I missed that.
So if you don't do the steps within the state machine it works? In which case, what do you do within the state machine? Are you modifying any of the Connector objects?
Since you have said that the exception occurs on both of the red lines, I would guess it could be related to the output object (since that object is common between both operations)
Basically, not that much:
For me, it seems I cannot access to any methods related to the connector I previously opened, altough I can access the attributes.
I think I got it:
I should use
self.connector=rti.Connector(config_name="MyParticipantLibrary::MyPubParticipantT", url="Definition.xml")
instead of rti.open_connector method.
Thanks anyway,
Benedek