question

sanaz karamimoghaddam avatar image
1 Like"
sanaz karamimoghaddam asked Jason Lightfoot commented

How to connect the TEs to a Control point on AGV path using code?

Hi,

My TEs are created using a process flow when the model runs, I add the required connection to objects using the "contextdragconnection" command. But for the AGV paths, since the connection needs to be defined as either "AGV Traveler", or "Location" on the pop up, the connections couldn't be created. Is there a way to do this using a custom code?

FlexSim 16.2.0
control pointstask executorsagv connectiondrag connections
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

·
Sam Stubbs avatar image
6 Likes"
Sam Stubbs answered Jason Lightfoot commented

The AGV network has a command that can be used to add members to the network. We can call this command using the function_s() command, and passing it some specific parameters.

function_s(controlpoint,"addConnection",-1,agv);

Where 'controlpoint' is a reference to your Control Point on the AGV network, "addConnection" is the command being called. The '-1' is the kind of connection we're making. (Which means it will be a "traveler AGV" connection. Another number greater than 0 would correspond to the list of connection types found in the AGVNetwork Properties window, in the Control Point Connections tab.) And finally the 'agv' is a reference to the AGV or Task Executer you are adding to the network.

I've attached a sample model demonstrating this in action.

createte.fsm


createte.fsm (20.9 KiB)
· 13
5 |100000

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

jacopo-r avatar image jacopo-r commented ·
Hi @Sam Stubbs , what about deleting that connection? I tried to type "removeConnection", but it didn't work. Is there a list of all the commands we can call in the function_s() ? Thanks
0 Likes 0 ·
Joerg Vogel avatar image Joerg Vogel jacopo-r commented ·

I guess without knowledge, I would try to parse ‘0‘ into the Type parameter instead of ‘-1’. Perhaps you find the function under the library tree in main tree for a control point. @jacopo_r but you want to delete a connection, did you try command contextdragconnection?

0 Likes 0 ·
jacopo-r avatar image jacopo-r Joerg Vogel commented ·
I tried with '0' and it doesn't work.

Yes, I also initially tried with contextdragconnection but every time this function runs, a small pop up window appears for me to manually choose the type of connection (AGV Traveler, Location, ...). I need the control point to be on the AGV network and for creating the connection function_s() works perfectly.

Also, I did not found the library tree you mentioned, can you give more information on how to access it, please?

0 Likes 0 ·
Show more comments

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.