question

Vothan Salomão avatar image
0 Likes"
Vothan Salomão asked Jonah K commented

The global table is not updating correctly with control points

Hello!!AGV GlobalTable.fsm
I'm trying to fill in two columns of the global table with the following information:


In the CP column, I want the column to update in real-time with the information from destination.CP.

In the LastCP column, I want the column to update in real-time with the information from the last CP that the AGV passed, I'm using recentCP.


However, when running the code, both columns still have the same information. Could someone help me by telling me what's wrong with my code and how I could fix it?

https://prnt.sc/0hQawjGVDalY





FlexSim 23.2.0
agvglobal tablecontrolpoint
agv-globaltable.fsm (14.5 MiB)
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

·
Jason Lightfoot avatar image
1 Like"
Jason Lightfoot answered Jonah K commented

The exception message tells you exactly the problem - the token doesn't have the label 'destination'. You can verify this by putting a breakpoint in your code.

1695655164466.png

and then click on the token when it fires the code.

When an exception occurs the rest of the code is not executed.



1695655164466.png (5.8 KiB)
· 6
5 |100000

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

Vothan Salomão avatar image Vothan Salomão commented ·

Hello @Jason Lightfoot. thanks for the answer

My question is specific about globalTable. How a i can modify the columns LastCP and CP in real time?

The value Token. destination i understand the problem. But dont understand how modify the columns CP and LastCP, what is problem with my code? global-table.png

0 Likes 0 ·
global-table.png (241.9 KiB)
Jason Lightfoot avatar image Jason Lightfoot ♦ Vothan Salomão commented ·

Put breakpoints on lines 25 and 44 - you will see that your code is updating the table correctly up to the point where the lack of the label 'destination' causes the exception.


Of course these triggers make the code look complicated. In fact it could just be a line for each:

Table("AGVs")[current.name]["cp"]=agv.destinationCP;
Table("AGVs")[current.name]["lastCP"]=agv.recentCP;
0 Likes 0 ·
Vothan Salomão avatar image Vothan Salomão Jason Lightfoot ♦ commented ·

The problem is, my global table dont update with correct value of CP and LastCP1695668583159.png

0 Likes 0 ·
1695668583159.png (253.9 KiB)
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.