question

chao.g avatar image
1 Like"
chao.g asked Adrian Haws edited

How to change the travel speed of forklift when empty VS loaded?

Forklift travels 4 ft/s loaded, 8 ft/s empty, to have different speed, I am doing two triggers on load, on unload with the code, setvarnum(current, "maxspeed", empty speed/loaded speed); is this the right way to accomplish the objective here or there are better ways to do this?

Thanks,

Chao

FlexSim 16.1.2
forklift travelsetvarnum
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

Sam Stubbs avatar image
3 Likes"
Sam Stubbs answered Sam Stubbs commented

Yes this is the best way to accomplish this. You just use the commands getvarnum() and setvarnum() to reference the value of an object's variables. Transporters have a variable called "maxspeed" as well as "acceleration" that can be changed.

So in the transporter under the OnLoad and OnUnload triggers, you can set the transporters speed by calling the setvarnum() command. It would look something like this.

setvarnum(current,"maxspeed",1);

And then in the OnUnload trigger you can call the same command to reset the maxspeed.

As a side note, you might also want a code in the OnReset trigger to set the maxspeed back to it's default, as it won't update on it's own when you reset the model.

· 2
5 |100000

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

chao.g avatar image chao.g commented ·

that's what I am doing right now, just want to confirm if this is the way you guys will do. thanks.

1 Like 1 ·
Sam Stubbs avatar image Sam Stubbs ♦ chao.g commented ·

Great! Yeah you're doing it the way we would. I just posted this answer in case any other users have the same question, it'll be easy to reference in the future.

1 Like 1 ·