ATTENTION

This FlexSim Community Forum is read-only. Please post any new questions, ideas, or discussions to our new community (we call it Answers) at https://answers.flexsim.com/. Our new Question & Answer site brings a modern, mobile-friendly interface and more focus on getting answers quickly. There are a few differences between how our new Q&A community works vs. a classic, threaded-conversation-style forum like the one below, so be sure to read our Answers Best Practices.


flexsim.com

Go Back   FlexSim Community Forum > FlexSim Software > Q&A
Downloads

Q&A Using Flexsim and building models

  #1  
Old 01-15-2014
Gavin Douglas Gavin Douglas is offline
Flexsim User
 
Join Date: Feb 2008
Posts: 65
Downloads: 1
Uploads: 0
Thanks: 27
Thanked 1 Time in 1 Post
Rep Power: 152
Gavin Douglas is on a distinguished road
Default Stop and Resume Object?

When an Operator leaves a network node, say NN1, I want a crane to stop working. So I have this:

OnContinue>> stopobject(centerobject(current, 1), STATE_DOWN);

When the operator returns to NN1 I would like the crane to start again so I have this:


OnArrival>> resumeobject(centerobject(current, 1));


The crane does stop when the operator walks away, however, it does not resume when the operator returns. Any Help??
__________________
"A bird is an instrument working according to mathematical law, which is within the capacity of man to reproduce." -Leonardo da Vinci, 1502
  #2  
Old 01-15-2014
Clair A Clair A is offline
Simulation Engineer
 
Join Date: Dec 2011
Location: France
Posts: 26
Downloads: 11
Uploads: 0
Thanks: 68
Thanked 90 Times in 20 Posts
Rep Power: 162
Clair A is a jewel in the roughClair A is a jewel in the roughClair A is a jewel in the roughClair A is a jewel in the rough
Default Stop/resume crane when the operator leaves/comes back

Hi Gavin,

I tried to create a sample model similar to your approach. An operator is on a network node NN1, when he leaves this network node the crane stops and when he comes back the crane resumes. "Leave" and "Come back" can be defined more precisely with if statements as below.

NN1 - OnArrival trigger:

Code:
//if the operator comes from another node and will stay at this node
if(fromedge != 0 && toedge == 0)
{
	resumeobject(centerobject(current, 1));
}
NN1 - OnContinue trigger:

Code:
//if the operator was staying at this node and will leave to another node
if(fromedge == 0 && toedge != 0)
{
	stopobject(centerobject(current, 1), STATE_DOWN);
}
Attached Files
File Type: fsm Stop and resume crane.fsm (28.5 KB, 560 views)

Last edited by Clair A; 11-12-2014 at 10:28 AM. Reason: re-uploaded attachment
The Following 3 Users Say Thank You to Clair A For This Useful Post:
Tom David (01-16-2014)
  #3  
Old 01-15-2014
Steven Hamoen's Avatar
Steven Hamoen Steven Hamoen is offline
Talumis, Flexsim Distributor, The Netherlands
 
Join Date: Aug 2007
Location: Soest, NL
Posts: 854
Downloads: 43
Uploads: 0
Thanks: 391
Thanked 661 Times in 379 Posts
Rep Power: 684
Steven Hamoen has a reputation beyond reputeSteven Hamoen has a reputation beyond reputeSteven Hamoen has a reputation beyond reputeSteven Hamoen has a reputation beyond reputeSteven Hamoen has a reputation beyond reputeSteven Hamoen has a reputation beyond reputeSteven Hamoen has a reputation beyond reputeSteven Hamoen has a reputation beyond reputeSteven Hamoen has a reputation beyond reputeSteven Hamoen has a reputation beyond reputeSteven Hamoen has a reputation beyond repute
Default

The onarrival and the oncontinue both go off when an operator goes through a node. So in your situation, first time it arrives:
OnArrival : resumeobject (has no effect because crane is not stopped)
OnContinue: stopobject (so crane stops)

The second time it arrives at the node:
OnArrival : resumeobject (crane is resumed)
OnContinue: stopobject (so crane stops immediately again after it was resumed)

So take a look at Clair's solution to specfiy better on the node what action you need.
The Following 2 Users Say Thank You to Steven Hamoen For This Useful Post:
Jörg Vogel (01-15-2014)


Thread Thread Starter Forum Replies Last Post
Resume Task sequence after being preempted mearjun Flexsim Student Forum 9 05-08-2013 01:24 AM
Stop a Transporter Nischith Kashyap Q&A 1 02-24-2011 03:05 AM
Stop and resume objects at specified time john mic Q&A 6 11-02-2010 01:48 AM
Make sure you stop model with the stop button before collecting state based statistics Paul Dowling Tips and Tricks 2 06-10-2008 08:10 AM
How to run tasks after stop time? Fadhlullah Bin Rahmat Q&A 1 02-26-2008 04:44 PM


All times are GMT -6.
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2020, vBulletin Solutions Inc.
Copyright 1993-2018 FlexSim Software Products, Inc.