ATTENTIONThis 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 |
#1
|
|||
|
|||
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
|
||||
|
||||
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
|
|||
|
|||
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
|
||||
|
||||
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
|
||||
|
||||
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); 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
|
|||
|
|||
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
|
||||
|
||||
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
|
|||
|
|||
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"); Axel |
#9
|
|||
|
|||
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 |