Cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted

10=How can SimTalk insert a conveyor that acquires the intra-WS separation

Genius
Genius

Hi,

I'm trying to use SimTalk to create a conveyor to pass MUs from one WS to another.

The purpose being that the transport time should be automatically determined by the conveyor length, which is tied at its ends to the WS that it connects to.

It all seems to connect but there is nothing in the conveyor's [F8] properties that seems to indicate that the conveyor has the required length (25 metres, or 125 pixels).

Screenshot attached for context (SimTalk code fragment as well as model schematic).

conveyor connected on right.Gif

All help would be much appreciated.

 

____________________________________________
PlantSim Ver 14.1.0.1294   &  Windows 7 Ent. SP1

~~~~  1st post in thread  ~~~~

5 REPLIES 5

Re: 10=How can SimTalk insert a conveyor that acquires the intra-WS separation

Gears Esteemed Contributor Gears Esteemed Contributor
Gears Esteemed Contributor

you need to change the segments table and re-assign it e.g.

 

var line:=.Materialfluss.Förderstrecke.createObject(root,Einzelstation.xpos, Einzelstation.ypos)

var t:=line.segmentsTable
t[1,2]:=einzelstation1.xPos
t[2,2]:=einzelstation1.yPos
t[3,2]:=0
line.segmentsTable:=t
Steffen Bangsow
freelance simulation specialist  
web: www.bangsow.eu
mail: steffen@bangsow.net

Re: 10=How can SimTalk insert a conveyor that acquires the intra-WS separation

Genius
Genius

Thanks Steffen,
That solved the problem - I don't know why yet, and I looked but cannot find documentation to understand how SegmentTable actually works.

For example, I did not clear the [3,2] entry - will I pickup runtime problems later if I don't?

So I confirmed that the conveyor acquired the 6.25 m separation between the entry side positions of the two WS it services (as per image).

I noticed that the WS_Left object was apparently displaced by the conveyor since it has the same (X,Y) coordinates as the conveyor. 
It now lives underneath WS_Right according to the reported value of  WS_Left.XPos (in image).

However segTab[1,1] still shows it in its original position - leaving room for future pain I guess.   (ed.  and line_Left_Right.SegmentsTable[1,1] is also 30 pixels, the original position)

So I will experiment with offsetting the conveyor start to the exit side of the feeder WS, hopefully no new dramas there.


Conveyor gets length between WS_L and WS_R.gif

Re: 10=How can SimTalk insert a conveyor that acquires the intra-WS separation

Gears Esteemed Contributor Gears Esteemed Contributor
Gears Esteemed Contributor
segmentsTable is deprecated but still supported. From version 13 the segments table works totally different, that makes it difficult to create tracks and lines on the fly.
The third value is the z-position, to avoid problems, you need to set zero here.
After each update of the segmentsTable, the length is calculated and you can correct it, if necessary.

Starting from version 14 or 14.1 createObject doesnt exist anymore, you need to use derive to create new objects and you cannot pass a position, so you will need one additional step to create conveyors dynamically (set the start position).
Steffen Bangsow
freelance simulation specialist  
web: www.bangsow.eu
mail: steffen@bangsow.net

Re: 10=How can SimTalk insert a conveyor that acquires the intra-WS separation

Genius
Genius

Thanks again - very fruitful discussion.  Some more thoughts :-

 


segmentsTable is deprecated but still supported.

If it is still supported, but not superseded with anything better, in what sense is it deprecated? Is there another / better way to do what I want to?


From version 13 the segments table works totally different, that makes it difficult to create tracks and lines on the fly.


I'm running PlantSim Ver 14.1 - it seems to work as per previous worked examples!


Starting from version 14 or 14.1 createObject doesnt exist anymore, you need to use derive to create new objects and you cannot pass a position, so you will need one additional step to create conveyors dynamically (set the start position).

Ditto here - am using createObject in SimTalk 2.0 code fine for now.  By passing start position too.

It's a pity that PlantSim is making the same mistakes (IMHO) that Matlab did, changed the functionality of existing library methods - so all old code is not safely obsoleted, but still runs and unfortunately produces different results.  Can SW people not use overloading to distingiush between versions in the upgrade path of the few decent CAE suites that are still around?

 




Re: 10=How can SimTalk insert a conveyor that acquires the intra-WS separation

Gears Esteemed Contributor Gears Esteemed Contributor
Gears Esteemed Contributor
"From version 13 the segments table works totally different, that makes it difficult to create tracks and lines on the fly."
"I'm running PlantSim Ver 14.1 - it seems to work as per previous worked examples!"

try this in V14.1 (the new syntax is getCurveSegments - setCurveSegments):

var t:table
conveyor.getCurveSegments(t)
t.openDialog
Steffen Bangsow
freelance simulation specialist  
web: www.bangsow.eu
mail: steffen@bangsow.net