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 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
  #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: 642
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
The Following 2 Users Say Thank You to Jörg Vogel For This Useful Post:
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
  #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: 145
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
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: 642
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
The Following 2 Users Say Thank You to Jörg Vogel For This Useful Post:
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.
The Following 4 Users Say Thank You to Jing Chen For This Useful Post:
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: 1174
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");
The Following 5 Users Say Thank You to Phil BoBo For This Useful Post:
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
  #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.
The Following User Says Thank You to Jing Chen For This Useful Post:
Jörg Vogel (06-06-2016)

Tags
conveyor module, decisionpoint


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.
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2020, vBulletin Solutions Inc.
Copyright 1993-2018 FlexSim Software Products, Inc.