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
FAQ Downloads Calendar Search Mark Forums Read

Q&A Using Flexsim and building models

Reply
 
Thread Tools Display Modes
  #1  
Old 12-06-2015
Jing Chen
Guest
 
Posts: n/a
Downloads: 2
Uploads: 0
Red face Move Decision Point along the Conveyor by code

Hello everyone,

I was wondering in Conveyor Module if it is possible to change the position of Decision Point along the conveyor by code rather than by dragging?

I would like the position of DP in the conveyor depend on a dynamic value rather than a fixed value.

Is there a solution?
Thanks.

Jing Chen
Reply With Quote
  #2  
Old 12-13-2015
Jörg Vogel's Avatar
Jörg Vogel Jörg Vogel is offline
Flexsim User
 
Join Date: Sep 2007
Location: Hannover, Germany
Posts: 643
Downloads: 35
Uploads: 0
Thanks: 802
Thanked 665 Times in 410 Posts
Rep Power: 634
Jörg Vogel has a reputation beyond reputeJörg Vogel has a reputation beyond reputeJörg Vogel has a reputation beyond reputeJörg Vogel has a reputation beyond reputeJörg Vogel has a reputation beyond reputeJörg Vogel has a reputation beyond reputeJörg Vogel has a reputation beyond reputeJörg Vogel has a reputation beyond reputeJörg Vogel has a reputation beyond reputeJörg Vogel has a reputation beyond reputeJörg Vogel has a reputation beyond repute
Default

Independent of a Test, you have to know flexsim is a discret Event Simulation. Thus the events are created upon Events. If an Item enters a conveyor the events are created, too. If you then change the position of photo eyes the previous events still exists. The new positions doesn't count at all, until a new event take a credit from the change. There positions get only an effect if the engine computes those new positions and remove existing old events automatically. If you test on your own such behaviour you can use it in your models, otherwise it won't work. in contrast to Flexsim 7.5 you can use the process flow in Flexsim 7.7, which has the ability to change the models in smaller time steps than the Flexim standard model. But that have you test on your own, too.
Generally, changing photo eyes positions works only on items that haven't entered a conveyor at all. In contrast to that statement Flexsim must have the ability to predict what an user want achieve. That is impossible.
Jörg
Reply With Quote
The Following 2 Users Say Thank You to Jörg Vogel For This Useful Post:
Jing Chen (12-13-2015), sagar bolisetti (12-30-2015)
  #3  
Old 12-13-2015
Jing Chen
Guest
 
Posts: n/a
Downloads: 2
Uploads: 0
Default

Thanks, Jörg.
In fact, I don't want to change the position dynamic during model running. I want to change the position of Decision Point in Conveyor Module before model running, cause I may change the layout of model.
I had change the position of DecisionPoint in BasicConveyor by code, and it works well. So I also want to change the DP in Conveyor Module.

I will further test on my own.
Thank you for other reply. ^_^

Jing
Reply With Quote
  #4  
Old 12-14-2015
arunkrmahadeva's Avatar
arunkrmahadeva arunkrmahadeva is offline
CCS, India
 
Join Date: Sep 2013
Location: India
Posts: 71
Downloads: 67
Uploads: 0
Thanks: 285
Thanked 101 Times in 51 Posts
Rep Power: 136
arunkrmahadeva is a jewel in the rougharunkrmahadeva is a jewel in the rougharunkrmahadeva is a jewel in the rougharunkrmahadeva is a jewel in the rough
Default

Dear Jing,

Have you tried setloc() command on the reset trigger of the decision point? Choose the model coordinate system instead of conveyor coordinate system.

Regards,

Arun KR
Reply With Quote
The Following User Says Thank You to arunkrmahadeva For This Useful Post:
Jing Chen (12-14-2015)
  #5  
Old 12-14-2015
Jörg Vogel's Avatar
Jörg Vogel Jörg Vogel is offline
Flexsim User
 
Join Date: Sep 2007
Location: Hannover, Germany
Posts: 643
Downloads: 35
Uploads: 0
Thanks: 802
Thanked 665 Times in 410 Posts
Rep Power: 634
Jörg Vogel has a reputation beyond reputeJörg Vogel has a reputation beyond reputeJörg Vogel has a reputation beyond reputeJörg Vogel has a reputation beyond reputeJörg Vogel has a reputation beyond reputeJörg Vogel has a reputation beyond reputeJörg Vogel has a reputation beyond reputeJörg Vogel has a reputation beyond reputeJörg Vogel has a reputation beyond reputeJörg Vogel has a reputation beyond reputeJörg Vogel has a reputation beyond repute
Default

Hello Jing,

next line changes the distance of a decision point. But it doesn't change the visual position.
Code:
set(node("/StraightConveyor4>variables/conveyorPoints/2/distAlong",model()),7);
Wherein 2 is the rank in the container node "conveyorPoints" and 7 is the set distance from the entry point.
The code works, too, while the model is running. You have to test on your own, which entered item uses the changed location firstly.

Jörg
Reply With Quote
The Following 2 Users Say Thank You to Jörg Vogel For This Useful Post:
Jing Chen (12-14-2015), Sebastian Hemmann (12-14-2015)
  #6  
Old 12-15-2015
Jing Chen
Guest
 
Posts: n/a
Downloads: 2
Uploads: 0
Talking Find a method!

Many thanks to advice of Arun KR and Jörg.
I try to combine the advantage of two methods, and it works well!
Now I share with everyone.


treenode conveyor = node("Conveyor1", model());
treenode dp = node("DP1", model());
double distance = 9;
double x = distance - 0.5*xsize(dp);
double y = 0.5*ysize(dp);
double z = x/getvarnum(conveyor, "length")*getvarnum(conveyor, "rise")+0.01;

double model_x = vectorprojectx(conveyor,x,y,z,model());
double model_y = vectorprojecty(conveyor,x,y,z,model());
double model_z = vectorprojectz(conveyor,x,y,z,model());

setloc(dp,model_x,model_y,model_z);
set(node("/distAlong",node(">variables/conveyorPoint/1+",dp)),distance);


Node "dp" is the reference of the decision point want to edit, node "conveyor" is where the dp on, the value distance is the set distance from the entry point.
Reply With Quote
The Following 4 Users Say Thank You to Jing Chen For This Useful Post:
arunkrmahadeva (12-15-2015), Jörg Vogel (12-15-2015), Sebastian Hemmann (12-15-2015), Sung Kim (12-21-2015)
  #7  
Old 12-15-2015
Phil BoBo's Avatar
Phil BoBo Phil BoBo is offline
Flexsim Development
 
Join Date: Jan 2008
Posts: 756
Downloads: 109
Uploads: 18
Thanks: 385
Thanked 1,483 Times in 525 Posts
Rep Power: 1166
Phil BoBo has a reputation beyond reputePhil BoBo has a reputation beyond reputePhil BoBo has a reputation beyond reputePhil BoBo has a reputation beyond reputePhil BoBo has a reputation beyond reputePhil BoBo has a reputation beyond reputePhil BoBo has a reputation beyond reputePhil BoBo has a reputation beyond reputePhil BoBo has a reputation beyond reputePhil BoBo has a reputation beyond reputePhil BoBo has a reputation beyond repute
Default

Rather than explicitly setting that variable, you should call this:

function_s(dp,"finalizeSpatialChanges");
Reply With Quote
The Following 5 Users Say Thank You to Phil BoBo For This Useful Post:
arunkrmahadeva (12-18-2015), Jing Chen (12-15-2015), Jörg Vogel (12-16-2015), Sebastian Hemmann (12-16-2015), Sung Kim (12-21-2015)
  #8  
Old 06-06-2016
Axel Kohonen
Guest
 
Posts: n/a
Downloads: 22
Uploads: 0
Default

Hi,

I was not sure what all code was needed, but it seems that at least in Flexsim 2016 the only code that is needed for setting the x location along the conveyor is

Code:
//define the position along the conveyor
double dpPositionAlongConveyor= 4;
//the x position is the position along the conveyor
setloc(dp,dpPositionAlongConveyor,0,0);

//update the spatial changes (the decision point is 
//on the conveyor so update the conveyor)
function_s(newConveyor,"finalizeSpatialChanges");
Is this correct?

Axel
Reply With Quote
  #9  
Old 06-06-2016
Jing Chen
Guest
 
Posts: n/a
Downloads: 2
Uploads: 0
Default

Hi,Axel
I think your code maybe not you needed. Because DP is under the model rather than the conveyor. Your code would move the DP out of conveyor.

I suggest you try this:

set(node("/distAlong",node(">variables/conveyorPoint/1+",dp)),distance);
function_s(conveyor, "clearNonLockedPoints");
function_s(conveyor, "notifyEdgePointsOnEdgeMoved");
function_s(conveyor,"finalizeSpatialChanges");

Node "dp" is the reference of the decision point want to edit, node "conveyor" is where the dp on, the value "distance" is the set distance from the entry point.
Reply With Quote
The Following User Says Thank You to Jing Chen For This Useful Post:
Jörg Vogel (06-06-2016)
Reply

Tags
conveyor module, decisionpoint

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Control Point AGV Rahel Carolina Q&A 1 08-25-2015 07:59 AM
Conveyor decision - allow entry by predicate Mischa Spelt Q&A 2 06-26-2015 08:30 AM
problem to fix errors in decision point mefhsmflexsimbr Q&A 0 05-22-2014 08:33 PM
Decision point in Basic conveyor Manoj Kumar Q&A 3 02-29-2012 10:31 AM
Using Queue in a decision tool George Serhan Q&A 8 01-06-2012 10:31 AM


All times are GMT -6. The time now is 03:16 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2019, vBulletin Solutions Inc.
Copyright 1993-2018 FlexSim Software Products, Inc.