Api costants in matlab

Typically: "How do I... ", "How can I... " questions
Post Reply
ichronopoulos
Posts: 5
Joined: 15 Jan 2021, 16:12

Api costants in matlab

Post by ichronopoulos »

Hi!
I am trying to use functions like sim. simxSetBooleanParameter in matlab. Those functions require api constants like sim.boolparam_dynamics_handling_enabled as an input.
However, always an error occurs. I tried sim_boolparam_dynamics_handling_enabled but i got the same result.
How can i use api constants in remoteApi properly?
Thanks in advance!

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

Re: Api costants in matlab

Post by coppelia »

Hello,

are you using the legacy remote API or the B0-based remote API?

Also, what kind of error happens? I.e. what is the message output, and what is the return value of the function you call?

Cheers

ichronopoulos
Posts: 5
Joined: 15 Jan 2021, 16:12

Re: Api costants in matlab

Post by ichronopoulos »

Hi and thanks for your reply!
I use the legacy remote Api .
Here is the error i get:
No appropriate method, property, or field 'simx_boolparam_dynamics_handling_enabled' for class 'remApi' or
No appropriate method, property, or field 'simx.boolparam_dynamics_handling_enabled' for class 'remApi' .
Function does not returns an error, as it is not executed properly..
My command: [errorCode]=sim.simxSetBooleanParameter(clientID,sim.simx_boolparam_dynamics_handling_enabled,false,sim.simx_opmode_oneshot).

What should i do?

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

Re: Api costants in matlab

Post by coppelia »

sim_boolparam_dynamics_handling_enabled is defined as value 6, in remApi.m. So type sim.sim_boolparam_dynamics_handling_enabled instead of sim.simx_boolparam_dynamics_handling_enabled. You can also directly use the value 6.

Cheers

ichronopoulos
Posts: 5
Joined: 15 Jan 2021, 16:12

Re: Api costants in matlab

Post by ichronopoulos »

It works!
Really helpful, thanks a lot!

Post Reply