question

Hoang Nk avatar image
0 Likes"
Hoang Nk asked Jeanette F commented

Add Array Data to a Node

Hello guys,

I'm having trouble adding array data to a node in the model tree.

1665286393832.png

As you can see from the screenshot, I have a GUI from which I can write values to the 2 nodes "loadLoc" and "unloadLoc" (in red circles). It worked well when data types of the nodes were number, however I cannot write new values into these nodes when I change the data types to Array data. It keeps showing "array: Array[0]: {}".


Please can anyone help me on this?

Many thanks,

Hoang Nguyen


FlexSim 22.1.2
add array data
1665286393832.png (90.3 KiB)
· 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.

Hoang Nk avatar image Hoang Nk commented ·

@Jason Lightfoot could you help me with this? it seems to have something to do with data structure of Flexsim. Many Thanks!

0 Likes 0 ·
Jeanette F avatar image Jeanette F ♦♦ commented ·

Hi @Hoang Nk, 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

Can't see the end of your Array assignment - you should have .value on the end of the treenode expression if you don't already.

· 8
5 |100000

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

Hoang Nk avatar image Hoang Nk commented ·
I do have the .value at the end of the expression in the code, but I cannot assign values to the node var, either by directly typing into the model or by using the GUI
0 Likes 0 ·
Jason Lightfoot avatar image Jason Lightfoot ♦♦ Hoang Nk commented ·

Can you post the model with the steps you're taking to test it? Have you tried debugging your code using breakpoints to see what's going on?

0 Likes 0 ·
Hoang Nk avatar image Hoang Nk Jason Lightfoot ♦♦ commented ·

GUI_example.fsm

here's the model I'm doing, could you tell me what I'm doing wrong here?

0 Likes 0 ·
gui-example.fsm (35.9 KiB)
Show more comments