question

Preet avatar image
0 Likes"
Preet asked Preet commented

Way to change the definitions of state engine

I have a setup with a robot, processer and a task executor. Here are the details on what each object does.


1. Robot takes a tote from queue and puts on the processer.
2. Processer process the tote using the operator.
3. Operator does the work on the tote. In addition to that, operator fixes the robot when it goes down based on given MTBF/MTTR.

My goal is to have a different states when the operator works on the processer vs when they work on a faulted robot. However by default, both situations for the operator I mentioned are categorized as utilize state. I am also clear that it is not the aggregated Utilized state as shown in the image.

My questions are
1. What should I change and how to ensure the operator working time on processer is tagged as separately from operator working on fixing the faulted robot.
2. Where can I see the logic on each states and possibility modify the definitions of state engine? state-engine.jpg

FlexSim 23.0.0
state engine
state-engine.jpg (38.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

Jason Lightfoot avatar image
1 Like"
Jason Lightfoot answered Preet commented

You can create a state_profile for your custom states - then this can be referenced using standard options in charts and state functions.

Here's a script that will assert a state profile tracked variable on "Operator1" called "SplitUtil" and open it for you to edit the states.

Object current=Model.find("Operator1");
string tvname="SplitUtil";
treenode sp=assertsubnode(stats(current),"state_profiles");
treenode tv=sp.subnodes.assert(tvname);
TrackedVariable.init(tv,STAT_TYPE_CATEGORICAL,0,STAT_USE_PROFILE);
createview( "VIEW:/standardviews/documentwindows/GlobalTableView",  tv.first.getPath(),tv.first.getPath());


· 5
5 |100000

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

Preet avatar image Preet commented ·

Hi @Jason Lightfoot . Thanks for the answer. I ran that script and that opened a new window. Being very new to Flexim, I am not sure how would I wrote the logic or annotate that when the operator fixes the equipment, mark that state as "X". I am also wondering that there is already a state named repair in the state table. Is there any way to tag this repair state as to what I mentioned as a repair state for the operator?
repair-state.jpg

0 Likes 0 ·
repair-state.jpg (39.6 KiB)
Jason Lightfoot avatar image Jason Lightfoot ♦♦ Preet commented ·

Sorry I thought you needed to add your own new states and define how they aggregated to your custom overall utilization. Please post your model for us to see how you've implemented the repair. It may just be a case of telling the operator that the state to use for TASKTYPE_UTLIZE is STATE_REPAIR instead of STATE_UTILIZE.

0 Likes 0 ·
Preet avatar image Preet Jason Lightfoot ♦♦ commented ·

Hi @Jason Lightfoot . You were correct on understanding the question. In my original question, I did ask to add a new state. However, in the comment to your first answer, I asked out of the curiosity to see if that repair state can be used when the operator repairs the equipment since that state is already present. I am attaching the sample model.

sample_model.fsm

If you can also show me how to add a custom state and how to change the definition of existing state that would be really helpful. Overall below are the things I am looking for.

1. How I can assign existing repair state when the operator repairs the equipment. Current this is tracked as utilize.

2. How can I add a new state with a new definition.

3. How can I change the definition of existing states mentioned in the state table.

0 Likes 0 ·
sample-model.fsm (110.9 KiB)
Show more comments