Change ProductVariableName during Process

Hy,

is it possible to change the ProductVariableName during the runing Process?

image

In this example the ProductVariableName is “ProductIn” and I want to change it to “ProductIn1”.

This is because I have a more complex process with two different “ProductIn” and I later have to merge this… -> I now have already a solution but it’s not clean at all. :wink:

Thx & Regards
Feature

No, and the solution shouldn’t be to change the variable name in the statement but have such statements that you can change the variable’s content based on some logic.

Hy,

how would handle two different transportedIn Products?

Thx & Regards
Feature

You would have variables prod1, prod2 and then create a third variable prod3.
Then copy value from either prod1 or prod2 to prod3 and use only prod3. These variables hold only references so the product instances don’t get copied on variable assignment.

However, I’m not sure if this is currently possible with the Assign statement.

Another approach would be to just have a list variable that can hold any number of product instance references. We already have some statements for manipulating product instance lists and basically all statements support them too.

Hy,

a litte example of how to deal with the lists would be great, I lokked for it but unfortunately can’t find it…

Maybe I can handle my problem with it. :slight_smile:

Thx & Regards
Feature

@TSy

Hy again,

this my unclean working solution for my complex Process:

image

You can see that there is some overlapping process necessary and I realised it with an ugly while True otherwise it’s not working. Additionaly there are some PROCESS-Steps are twice…

My target is to clean up this and realise it with the standardfuncionality. -> Remove the while-loop and remove the double PROCESSes.

For your help I would be very happy. :slight_smile:

Thx & Regards
Feature

Since you are using custom statements and Python scripting already, you can basically do whatever. However, custom statements aren’t really intended to be used with Process Modeling so there are no guarantees they will work in the future.

All the properties of statements should be possible to modify through the generic vcStatement API.
All the process variables are also properties of the process routine object so you can access and modify those at will as well.

Note that variables created by statements will be deleted on simulation reset, and any property values you change from Python will be changed permanently.

Hy,

but I wasn’t able to find how to get the vcproduct to modify it.

I would be happy if I could realise all my stuff with the standards, unfortunatly I can’t for complex machines. I hope the possibilties for customizing everything will never be stoped, because it’s one of the biggest advantages of Visual Components!

Thx & Regards
Feature

2 Likes