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 > Downloads > Models > Flexsim Concept
Downloads

Latest Files
Latest Files
Most Popular Files
Most Popular Files
Top Contributors
Top Contributors
Tom David 47
Tyson Nordgren 35
Paul Toone 31
Matt Long 29
Phil BoBo 18
Regan Blackett 16
Cliff King 14
Cameron Pluim 11
Alex Christensen 8
Brandon Peterson 6

Uploaded files must be in one of the following formats: zip rar jpg jpeg jpg2 gif png pdf fsm xls xlsx doc docx ppt pptx

Please no copyrighted material without author's permission!!
  
Navigation
Main | Category Tree | Stats
Downloads [Download Labels_Weight.zip]
File Name: Labels_Weight.zip (53.2 KB) Download
Author: Tyson Nordgren)
Date Added: 07-29-2008
Downloads: 2155
Grade: Not Rated
Description
This model simulates a Queue that has a weight limit (default 100 units) that cannot be exceeded. Play with the process time and maximum weight to get custom results.

Model Implementation:

  • Open the Flowitem Bin and create a label on the Textured Colored Box called weight.
  • Open the Queue’s Properties window, and create two labels, called maxweight and currentweight respectively.
  • Open the Source’s Parameters window, click the SourceTriggers tab, and add a function to the OnCreation trigger using the Set Label option. Edit the blue text to read as follows:
Object: item
Label: “weight”
Value: uniform(5,10)
Click OK
  • Open the Conveyor’s Parameters window, click the Triggers tab, and create a function on the OnConveyEnd by clicking the A| button. Enter the following code:
/**weight*/
treenodeitem = parnode(1);
treenodecurrent = ownerobject(c);

//these variable make the mathematical expression easier
double maxweight = getlabelnum(outobject(current,1), "maxweight");
double currentweight = getlabelnum(outobject(current,1),"currentweight");
double itemweight = getlabelnum(item, "weight");

//if the item's weight makes the total weight go over 100
if((maxweight-currentweight)<itemweight)
{
//close the ports because the item weighs too much
closeinput(outobject(current, 1));
}
else
{
//keep the ports open because the item will fit
openinput(outobject(current, 1));
}

Click OK on the Code Edit window, and the Parameters window.
  • Open the Queue’s Parameters window and click the QueueTriggers tab. Add a function to the OnReset trigger using the Set Label option. Edit the blue text to read as follows:
Object: current
Label: “currentweight”
Value: 0
  • Next, add a function to the OnEntry trigger using the Increment Value option. Edit the blue text to read as follows:
Node: label(current, “currentweight”)
Increment By: getlabelnum(item, “weight”)
  • Next, add a function to the OnExit trigger using the Increment Value option. Edit the blue text to read as follows:
Node: label(current, “currentweight”)
Increment By: -1*getlabelnum(item, “weight”)
  • Next, add another function to the OnExit trigger using the Send Message option. Edit the blue text to read as follows:
Delay Time: 0
To: current
From: current
Param1: 0
Param2: 0
Param3: 0
Condition: getlabelnum(current,&quot;currentweight&quot<90)
  • Next, add a function to the OnMessage trigger using the Close and Open Ports option. Edit the blue text to read as follows:
Condition: 1
Action: openinput
Object: current
Click OK to close the Parameters window
  • Open the Visual Tool’s Parameters window. Select Text from the Visual Display list, then Select Display Label Value from the Text Display list. Edit the blue text to read as follows:
Text: “Current Weight: “
Object: centerobject(current,1)
Label: “currentweight”
Images
Ben Wilson on 10-16-2008
Downloads [Download Labels_Weight.zip]


Comments

DownloadsII 5.1.2 by CyberRanger & Jelle
Based on ecDownloads 4.1 © Ronin

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.