question

shanice.c avatar image
0 Likes"
shanice.c asked shanice.c commented

How to get ControlPoint Object the processor is connected with?

Hi, I'd like to write the control point name to the global table cell. What's the method I could use to get the CP each processor is connected with, such as below. So that I don't have to fill this column one by one.

1632964631846.png


cpaccess-model.fsm

FlexSim 21.2.0
cp
1632964631846.png (9.8 KiB)
cpaccess-model.fsm (31.9 KiB)
5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.

1 Answer

·
Felix Möhlmann avatar image
0 Likes"
Felix Möhlmann answered shanice.c commented

You can use the following to find a control connected to a processor:

Object CP = Processor.find(">stored/AGV/Location/1+/~")

The number (here 1) determines which control point is returned, if more than one is connected. At that point (up to and including the number) the "find" method is pointing to the link node between the object and control point. "+" then follows that link to the link node in the control points tree. And "~" returns the owner object of that node - the control point.

1632983502367.png


1632983502367.png (169.8 KiB)
· 3
5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.

shanice.c avatar image shanice.c commented ·
@Felix Möhlmann Thanks, this works very well.
0 Likes 0 ·
Patrick Zweekhorst avatar image Patrick Zweekhorst commented ·

The command:

cpconnection( processorObject, "Location", 1 )

will also do this for you. Where processorObject is the processor and 1 is again the index of the connection. If you create other connection types you can change "Location" to get those CPs

0 Likes 0 ·
shanice.c avatar image shanice.c Patrick Zweekhorst commented ·

@Patrick Zweekhorst Thank you, I also succeed in this way!

0 Likes 0 ·

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.