question

Jean-Baptiste G avatar image
0 Likes"
Jean-Baptiste G asked Axel Kohonen commented

Change a Marks

Hi all,

I need to change the Marks of a Tank depending in wich case I'm. If I want a Mid Mark = 12000L, 12000 is stored in a label. I know how to sample this value, but I can't sample the location of the Mid Mark, I only can sample the value of the Mid Mark. How can I do that ?

Thank you in advance for your answer.

FlexSim 18.0.3
fluidtanksmarks
5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.

1 Answer

·
Clair A avatar image
0 Likes"
Clair A answered Axel Kohonen commented

Hello Jean-Baptiste,

I wonder from which field are you using the sampler. In the screenshot below I used the sampler from a script window and it provides several options:

getvarnum(model().find("FluidTank1"), "midmark") will return the value of the Mid Mark.

getvarnode(model().find("FluidTank1"), "midmark") will return the node where the Mid Mark is stored.

model().find("FluidTank1>variables/midmark") will also return the node where the Mid Mark is stored.


· 1
5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.

Axel Kohonen avatar image Axel Kohonen commented ·

Hi @Jean-Baptiste G

As Clair A suggests, use the sampler, but if you want to set the value instead of get it then use

setvarnum(...) instead of getvarnum(...)
1 Like 1 ·

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.