question

mary avatar image
0 Likes"
mary asked Jason Lightfoot edited

AGV Network Properties

Hi

I want to read this speed through global table. How can I do that and what is the code.

1666431756905.png

FlexSim 20.0.10
agvagv network
1666431756905.png (26.9 KiB)
· 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.

Jacob W2 avatar image Jacob W2 ♦ commented ·

Hi @mary, was Jason Lightfoot's answer helpful? If so, please click the "Accept" button at the bottom of their answer. Or if you still have questions, add a comment and we'll continue the conversation.

If we haven't heard back from you within 3 business days we'll auto-accept an answer, but you can always unaccept and comment back to reopen your question.

0 Likes 0 ·

1 Answer

·
Jason Lightfoot avatar image
0 Likes"
Jason Lightfoot answered Jason Lightfoot edited
string agvType="DefaultAGV";
Table speeds=Model.find("AGVNetwork>variables/agvTypes/"+agvType+"/speeds");
· 4
5 |100000

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

mary avatar image mary commented ·
@Jason Lightfoot how it works can you send a model? I am using the code but it is not working. Can you tell me in brief.
0 Likes 0 ·
Felix Möhlmann avatar image Felix Möhlmann commented ·

Jason's code gets a reference to the table as a table class variable. You then read the values as you would normally by sepcifying the row and column, either by name or number.

1666596958209.png

If you are using different AGV Types you have to adjust the path in the "find" method.

0 Likes 0 ·
1666596958209.png (25.6 KiB)
mary avatar image mary Felix Möhlmann commented ·
@Felix Möhlmann I don't want to read the value I want to change that value through global table. Ex. Acceleration should write value from global table. Global table as 5 then that value should be written in Acceleration
0 Likes 0 ·
Jason Lightfoot avatar image Jason Lightfoot ♦ mary commented ·

Here's an a fuller example with macros for the standard number of path types


#define AGVSPEED_FWD_STRAIGHT 5
#define AGVSPEED_FWD_CURVED 6
#define AGVSPEED_FWD_SPUR 7
#define AGVSPEED_REV_STRAIGHT 10
#define AGVSPEED_REV_CURVED 11
#define AGVSPEED_REV_SPUR 12
string agvType="DefaultAGV";
Table speeds=Model.find("AGVNetwork>variables/agvTypes/"+agvType+"/speeds");
speeds[AGVSPEED_FWD_CURVED]["Loaded"]=5;
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.