question

Michael O'Connell avatar image
0 Likes"
Michael O'Connell asked Phil BoBo commented

Any thoughts on why not all labels are being initialized in Reset Trigger after Reset?

I have a kinematic device on which I have a mix of labels: one for kin data, some numeric, some string.

I have a Reset Trigger assigned to reset numerics to zero, assign a value or NULL to strings and initialize kinematics.

After resetting, the labels retain their previous values, not those defined in trigger.

FlexSim 16.1.0
labelsreset trigger
· 3
5 |100000

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

Adrian Haws avatar image Adrian Haws commented ·
@Michael O'Connell

To see what's going on it would be helpful for us to see your model. Also, have you tried using the "Automatically Reset Labels" option on the object?

0 Likes 0 ·
Michael O'Connell avatar image Michael O'Connell Adrian Haws commented ·

It's a pretty big model, but I'll see if I can extract critical elements and post.

Regarding Auto Reset, I want to be able to define the value to be assigned in the trigger based on model parameters. Is there a way to accommodate that?

0 Likes 0 ·
Adrian Haws avatar image Adrian Haws Michael O'Connell commented ·

@Michael O'Connell What sort of "model parameters" are you basing the label reset values on?

0 Likes 0 ·

1 Answer

Jeff Nordgren avatar image
1 Like"
Jeff Nordgren answered Phil BoBo commented

Have you tried putting in a "Break Point" in the OnReset code? To make sure that it is firing and that the variables are being set properly. If this is happening, then something is happening to those variables AFTER the reset code is executed.

· 3
5 |100000

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

Michael O'Connell avatar image Michael O'Connell commented ·

I thought I had stepped through it, but it doing it now I see that the treenode variable (involved=current) is not being set. So all references to labels on "involved" can't be completed.

I'd prefer not to hard code the device name. Any ideas why "current" comes back NULL?

Adrian, I expect to look at the reset location, orientation, number of vehicles, etc. to determine the reset value to be assigned.

0 Likes 0 ·
Phil BoBo avatar image Phil BoBo ♦♦ Michael O'Connell commented ·

Is current defined? The top of a reset trigger on an object should set current, such as:

treenode current = ownerobject(c);
0 Likes 0 ·
Michael O'Connell avatar image Michael O'Connell Phil BoBo ♦♦ commented ·

Bingo, Phil.

Must have overwritten it at some point.

0 Likes 0 ·