How do I modify parameters when the[ client.simxCreateSubscriber] is running

Typically: "How do I... ", "How can I... " questions
Post Reply
NOTSN
Posts: 2
Joined: 19 Jan 2021, 07:29

How do I modify parameters when the[ client.simxCreateSubscriber] is running

Post by NOTSN »

I use [ client.simxCreateSubscriber] Create a continuous dedicated topic.

I want to modify parameters in the run.So I used this method: remove and then create it.

But This will cause the simulation to jam.But it looks stupid so It doesn't seem to be the right way.
What should I do? Please give me some advice.

coppelia
Site Admin
Posts: 8446
Joined: 14 Dec 2012, 00:25

Re: How do I modify parameters when the[ client.simxCreateSubscriber] is running

Post by coppelia »

Hello,

what kind of parameters do you want to modify on the fly? What do you remove and recreate? The subscriber?
With the B0-based remote APi, you better not remove/recreate subscribers constantly. Simply create several subscribers and keep them. Or use a single one of them have have the behaviour modulated by calling simxCallScriptFunction for it: from within the called function (which will be automatically constantly called) you can decide to return valid or invalid data (e.g. if you only want to publish data every 10th simulation step instead of each simulation step, for instance)

Cheers

Post Reply