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 05-03-2012
Peppino Peppino is offline
Flexsim User
 
Join Date: May 2012
Location: Leverkusen, Germany
Posts: 27
Downloads: 1
Uploads: 0
Thanks: 3
Thanked 0 Times in 0 Posts
Rep Power: 98
Peppino is on a distinguished road
Default 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?
Attached Files
File Type: fsm IST-Zustand.fsm (580.8 KB, 120 views)
  #2  
Old 05-03-2012
Jason Lightfoot Jason Lightfoot is offline
Flexsim Consultant
 
Join Date: Aug 2007
Location: Somerset, UK
Posts: 719
Downloads: 20
Uploads: 0
Thanks: 123
Thanked 953 Times in 446 Posts
Rep Power: 773
Jason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond repute
Default

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  
Old 05-03-2012
Peppino Peppino is offline
Flexsim User
 
Join Date: May 2012
Location: Leverkusen, Germany
Posts: 27
Downloads: 1
Uploads: 0
Thanks: 3
Thanked 0 Times in 0 Posts
Rep Power: 98
Peppino is on a distinguished road
Default

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  
Old 05-05-2012
Peppino Peppino is offline
Flexsim User
 
Join Date: May 2012
Location: Leverkusen, Germany
Posts: 27
Downloads: 1
Uploads: 0
Thanks: 3
Thanked 0 Times in 0 Posts
Rep Power: 98
Peppino is on a distinguished road
Default 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();
}
after comment out it was solved.


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


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.