Recently I have been looking for ways to change product properties as the simulation is running, preferably with PM statements.
Unfortunately I have not been able to do so with PM features, but only through a Property Setting Point mounted on a conveyor. This solution limits the possibilities because it can only be done in-line on conveyors.
Is it possible to change a product property based on some logic without having it go through a property setting point? Ideally with PM statements.
And why is the “Assign Variable” not able to do this, when it can be done through another component?
TransportIn: xx as ProductIn
Assign ProductIn.Property = True/123/whatever
In my opinion, this should be very basic functionality without having to make custom scripts/code etc.
In VC 4.4 the Assign statement was extended to support providing an expression that defines the target property to set. It should be now possible to set all kinds of properties, including those of Product instances.
Generally you should not rely on component properties (ProductIn.Component.PropertyName) in PM processes but use Product instance properties (ProductIn.PropertyName) instead.
The reason is that the component is considered just a visualization for the Product instance and all process logic should operate on the Product instances and their properties.
Regarding your first message @TSy about using product properties instead of component properties, I am not really sure about that. I am unable to write to product properties with the “Assign” statement by using ProductIn.testprop as an example (see below).
Where can I see that the product property actually is changed?
When using the Component property, it is possible to see the change to the flow element as it is assigned a new value and can then be used for other things such as routing on conveyor diverts.
Alright, that is what I expected. Thank you for the answer.
The inability to see the values makes it very difficult to work with and debug, which is why I have been using the Component property previously. I don’t see any issues with using component properties instead really.