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).
All help would be much appreciated.
PlantSim Ver 18.104.22.1684 & Windows 7 Ent. SP1
~~~~ 1st post in thread ~~~~
Solved! Go to Solution.
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
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.
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?