question

Skovdestudents avatar image
1 Like"
Skovdestudents asked Skovdestudents commented

return objects outport

Hello, we are 2 students trying to make a generalisable processflow that can be applied to several models unitflows, we are using tables as information to find objects and we are trying to make a "Wait for Event" inside the processflow and this wait for event should be listening for an object that is found through a table and then the last outport that was used

Our code:

  1. ...
  2. int PortUsed = token.itemCurrentOP;
  3.  
  4.  
  5. Variant tableID = /**\nTable: *//***tag:TableName*//**/ "StagesBuffer"/**/;
  6. Variant row = /**\nRow: *//***tag:row*//**/ token.Stage/**/;
  7. Variant col = /**\nColumn: *//***tag:col*//**/ token.Article/**/;
  8.  
  9.  
  10. Table table;
  11. switch (tableID.type) {
  12.  case VAR_TYPE_NODE: table = tableID; break;
  13.  case VAR_TYPE_STRING: table = Table(tableID.as(string)); break;
  14.  default:
  15.  table = reftable(tableID.as(int));
  16.  break;
  17. }
  18. Object queue = model().find(table[row][col]);
  19. Object connectedObject = queue.outObjects[PortUsed];
  20.  
  21.  
  22. return connectedObject;


We do not get this to work and if we replace last row with return

  1. model().find(connectedObject);

we get error


read earlier post on similar problem but that solution does not work for us

FlexSim 23.0.4
outport
· 2
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

Joerg Vogel avatar image
0 Likes"
Joerg Vogel answered Skovdestudents commented

I set up to listen for an entry event of queue. Then I edited the source of the event to evaluate a source code.

The global table cell datatype is set to pointer data and [Edit] with a second cell of string datatype.

wait-for-event-object-by-table.jpg

wait_for_event_object_by_table.fsm


· 1
5 |100000

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