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
|
|||
|
|||
Seek for some help in a simple question
Hi all,
As in the attached simple model, i want to filter out flowitems with different label In the on entry trigger i put: if (content(outobject(current,1)) ==0) /** first flowitem entry and set compare value) **/ {moveobject(item,outobject(current,1)); settablestr("Globalvariable",1,1,getlabelstr(item, "In"));} msg("initem",getlabelstr(item,"In")); msg("current",gettablestr("Globalvariable",1,1)); if (getlabelstr(item,"In") == gettablestr("Globalvariable",1,1)) {moveobject(item,outobject(current,1));} /** From 2nd flowitem only move when label value match**/ But all flowitem will go to "current" queue.....even the message shows from the two "msg" commands are different. What's wrong in my logic?? Thanks. Kelvin |
#2
|
|||
|
|||
Hi,
When comparing text you need to use comparetext and not ==. Try using comparetext instead of Code:
getlabelstr(item,"In") == gettablestr("Globalvariable",1,1) Lars-Olof |
The Following User Says Thank You to Lars-Olof Leven For This Useful Post: | ||
KelvinHo (01-20-2010) |
#4
|
|||
|
|||
Hello Kelvin,
If I understand correctly, you create items with different item types and different values for the label "In". If the second queue is empty you want to set your GlobalVariable table value to the value of the first item entering the second queue and only items with the same label value may also move to the second queue. Other items have to remain in the first queue, is this correct? Because in your sample model the second queue has no output port, this would mean that you want all items with label "aa" in the second queue and all other items in the first queue. The problem lies in the fact that you use the moveobject command in the onentry trigger. Take a look at the following post: http://www.flexsim.com/community/for...ght=moveobject This post might also give you some insight, although it is about opening and closing ports and not the moveobject command http://www.flexsim.com/community/for...hread.php?t=51 Esther |
Thread | Thread Starter | Forum | Replies | Last Post |
A simple question about “block” | Vic Li | Q&A | 10 | 08-27-2009 11:20 AM |
The "Simple Question" Thread | Xavier Jackson | Q&A | 202 | 08-10-2009 09:44 AM |
simple pallet question (i think) | bsantens | Q&A | 2 | 03-23-2009 11:39 AM |
simple question about "Separator" | Vic Li | Q&A | 5 | 01-14-2009 09:45 PM |
simple question for operators | Kang Han | Q&A | 1 | 10-23-2008 08:35 AM |