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
|
|||
|
|||
Transporter Problem (Invalet Pointer)
Hallo Flexsim User´s,
i have a littel Problem but for me it´s a big thing, it´s my first big model. The Problem ist between a Queue, Rack, Sink and the Transporter wich manage the Transport between. The task is to transport from Queue to Rack to Sink. The Queue get accidentally three different item typs. By on entrytriger in the Rack it checks a global table witch is created by sink in that is writen the releas order. If this Item is next the Transporter will bring it directly to the Sink, if not it will stay ther. When an Item arrived by Sink, the Sink will send a message to Rack and the Rack will ckeck if it have all ready the next Item in the content. When it is in the content it will releas the specific Item. Everything is working fine but after a short while i get an error on an invelid pointer to the Rack. By "profiletasksequence" on the Transporter i get this: Task Sequence: Total number of tasks = 5, Priority = 1, Preempt = None Currently active task = 1, Tasks left to finish = 5 ACTIVE >>> Travel involved1: Rack107 involved2: NULL var1: 0.00 var2: 0.00 var3: 0.00 var4: 0.00 FRLoad involved1: invalid pointer involved2: Rack107 var1: 1.00 var2: 0.00 var3: 0.00 var4: 0.00 Break involved1: NULL involved2: NULL var1: 0.00 var2: 0.00 var3: 0.00 var4: 0.00 Travel involved1: si_Vertrieb involved2: NULL var1: 0.00 var2: 0.00 var3: 0.00 var4: 0.00 FRUnload involved1: invalid pointer involved2: si_Vertrieb var1: 1.00 var2: 0.00 var3: 0.00 var4: 0.00 I have no idea what is wrong here. Please help? |
#2
|
|||
|
|||
I think you're releasing the item twice.
Try adding this to the condition in the message trigger: getitemstate(item)!=FRSTATE_MOVEREQUESTED |
The Following User Says Thank You to Jason Lightfoot For This Useful Post: | ||
Peppino (05-05-2012) |
#3
|
|||
|
|||
Thanks for your fast answer, but it is not working. I get the same error.
Task Sequence: Total number of tasks = 5, Priority = 1, Preempt = None Currently active task = 1, Tasks left to finish = 5 ACTIVE >>> Travel involved1: Rack107 involved2: NULL var1: 0.00 var2: 0.00 var3: 0.00 var4: 0.00 FRLoad involved1: invalid pointer involved2: Rack107 var1: 1.00 var2: 0.00 var3: 0.00 var4: 0.00 Break involved1: NULL involved2: NULL var1: 0.00 var2: 0.00 var3: 0.00 var4: 0.00 Travel involved1: si_Vertrieb involved2: NULL var1: 0.00 var2: 0.00 var3: 0.00 var4: 0.00 FRUnload involved1: invalid pointer involved2: si_Vertrieb var1: 1.00 var2: 0.00 var3: 0.00 var4: 0.00 I wrote this code in the OnMessage Triger in the Rack: (I know, i dont need that all in if()) Code:
treenode item = parnode(1); treenode current = ownerobject(c); int port = parval(2); for(int i = 1; i <= content(current); i++) /* for Schreife für Inhaltsdurchgang*/ { treenode item = rank(current, i); int j = getitemtype(item); if((j==gettablenum("gt_prog",gv_abruf,1))&&(getitemstate(item)!=FRSTATE_MOVEREQUESTED) &&(getitemstate(item)!=FRSTATE_READY)&&(getitemstate(item)==FRSTATE_INQUEUE)) { pt("Erfolg auswurf von:"); pd(j); pr(); releaseitem(item,1); gv_abruf++; break; } } |
#4
|
|||
|
|||
Problem solved
Thanks for your help Jason Lightfoot, that was the Problem i release the Item really twice.
The Problem was the OnEntry Trigger in my Rack, i had this code in it Code:
/**Prüft ob Eingangsobjekt benötigt wird*/ treenode item = parnode(1); treenode current = ownerobject(c); int port = parval(2); int pick= getitemtype(item); if(pick == gettablenum("gt_prog",gv_abruf,1)&&(getitemstate(item)!=FRSTATE_MOVEREQUESTED)) /* Prüft ob aktuelles Item benötigt wird */ { pt("E_erfolg auswurf von:"); pd(pick); pr(); releaseitem(item,1); /* Gibt das Item frei */ gv_abruf++; /* Zählt auf den nächsten Abruf in der Tabelle */ pt("E_nächstes:"); pd(gettablenum("gt_prog",gv_abruf,1)); pr(); } |
Thread | Thread Starter | Forum | Replies | Last Post |
transporter travel problem | Nicky Yen | Q&A | 2 | 02-07-2012 03:03 AM |
Capacity of Transporter | Gutirallo | Q&A | 3 | 01-09-2012 12:22 PM |
Problem with Transporter pickup & unload sequence | Tan Chun Hua | Q&A | 3 | 06-14-2011 12:15 AM |
Storing a C++ class pointer in a flexsim object | Steven Hamoen | Q&A | 2 | 04-15-2010 09:19 AM |
I think an easy question... - how to pointer to objects | david_white | Q&A | 21 | 08-18-2008 12:20 PM |