question

pc neo avatar image
0 Likes"
pc neo asked Jacob Gillespie commented

accessing global variables in process flow using Variable

The flexsim documentation mentions that process flow "Variable" activity can be used to reference to global variables. However, I do not seem to be able to get/set the global variable successfully using this approached. The value is NULL returned in "Get Variable" activity. Did I do anything wrong?

attached a sample model: sample-global-variable.fsm

attached a pic on the model for quick reference: untitled.png

FlexSim 18.2.2
process flowglobal variablesglobal variable
untitled.png (189.6 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

·
Roi Sánchez avatar image
1 Like"
Roi Sánchez answered Jacob Gillespie commented

Hi @pc neo, if you just want to get and set the value of a global variable in your model, you can do it as the attached model shows. It is not needed to use a the process flow "Variable" activity. If you want to use this activity, the variable should be a tracked variable or a process flow variable, not a global variable.

get-global-variable-value.fsm


· 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.

pc neo avatar image pc neo commented ·

thank you. Indeed that is what I want.

I read the User Manual by right click on the "Variable" activity -> Help, it writes that global variable can be used with "Variable" activity and so I tried.

untitled.png

0 Likes 0 ·
untitled.png (36.1 KiB)
Phil BoBo avatar image Phil BoBo ♦♦ pc neo commented ·

This appears to be a bug. In 18.1.2, it was working with global variables. In 18.2.2, it is not working correctly.

1 Like 1 ·
pc neo avatar image pc neo Phil BoBo ♦♦ commented ·

@phil.bobo ♦Thank you. I did remember getting to work before, however I could not recall when and which version. :)


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.