ATTENTION

This FlexSim Community Forum is read-only. Please post any new questions, ideas, or discussions to our new community (we call it Answers) at https://answers.flexsim.com/. Our new Question & Answer site brings a modern, mobile-friendly interface and more focus on getting answers quickly. There are a few differences between how our new Q&A community works vs. a classic, threaded-conversation-style forum like the one below, so be sure to read our Answers Best Practices.


flexsim.com

Go Back   FlexSim Community Forum > FlexSim Software > Q&A
Downloads

Q&A Using Flexsim and building models

  #1  
Old 08-27-2008
Nico Zahn's Avatar
Nico Zahn Nico Zahn is offline
Flexsim User
 
Join Date: Sep 2007
Location: Bingen am Rhein, Germany
Posts: 179
Downloads: 19
Uploads: 4
Thanks: 66
Thanked 60 Times in 32 Posts
Rep Power: 201
Nico Zahn has a spectacular aura aboutNico Zahn has a spectacular aura about
Default Memberadd

Hi,
I try to dynamicaly add members to the MTTRMTBF list. As they add themself 'onReset' I have to clear the list in a 'userevent' first.
I can now see the member in the 'MTBFMTTR'-table but the breakdown is not executed?
Please take a look at the attached modell...
Attached Files
File Type: zip Memberadd.zip (47.8 KB, 293 views)
__________________
kind regards Nico.
  #2  
Old 08-27-2008
Lars-Olof Leven Lars-Olof Leven is offline
Flexsim Distributor
 
Join Date: Aug 2007
Location: Sweden, Borlnge
Posts: 312
Downloads: 278
Uploads: 2
Thanks: 300
Thanked 256 Times in 139 Posts
Rep Power: 330
Lars-Olof Leven is a splendid one to beholdLars-Olof Leven is a splendid one to beholdLars-Olof Leven is a splendid one to beholdLars-Olof Leven is a splendid one to beholdLars-Olof Leven is a splendid one to beholdLars-Olof Leven is a splendid one to beholdLars-Olof Leven is a splendid one to behold
Default

Hi Nico,

I had the same problem in a model I created and using buildnodeflexscript helped for me.

Try to add this line after your code:
buildnodeflexscript(node("/Tools/MTBFMTTR/MTBFMTTR",model()));

Lars-Olof
  #3  
Old 08-27-2008
Lars-Olof Leven Lars-Olof Leven is offline
Flexsim Distributor
 
Join Date: Aug 2007
Location: Sweden, Borlnge
Posts: 312
Downloads: 278
Uploads: 2
Thanks: 300
Thanked 256 Times in 139 Posts
Rep Power: 330
Lars-Olof Leven is a splendid one to beholdLars-Olof Leven is a splendid one to beholdLars-Olof Leven is a splendid one to beholdLars-Olof Leven is a splendid one to beholdLars-Olof Leven is a splendid one to beholdLars-Olof Leven is a splendid one to beholdLars-Olof Leven is a splendid one to behold
Default

Hi,

I tested my suggested solution and it does not work.

I know that it worked in version 4.3 to use memberadd, but it look likes it is not working in 4.32.
Will check my old model to see if they still work with memberadd.

Lars-Olof
The Following User Says Thank You to Lars-Olof Leven For This Useful Post:
Nico Zahn (08-28-2008)
  #4  
Old 08-27-2008
Jason Lightfoot Jason Lightfoot is offline
Flexsim Consultant
 
Join Date: Aug 2007
Location: Somerset, UK
Posts: 719
Downloads: 20
Uploads: 0
Thanks: 123
Thanked 953 Times in 446 Posts
Rep Power: 773
Jason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond repute
Default

Hi Nico,

If you un-check the option to break down members individually it will work.

If you do not, then unfortunately you are adding the members after the MTBF has been scheduled (at reset). This is because the MTBF is in the Tools folder and is higher in the tree than the processor.

Note - to see what's really happening with the scheduled events, you should really have the UserEvents folder above the MTBFMTTR folder within the Tools folder. This way the members are cleared out before the MTBF is scheduled and you don't get a false positive event created.

The only way to add individually breaking members dynamically is to accompany the memberadd function call with a createevent call on the MTBF that samples the breakdown time and sets involved to be the processor member coupling, with the correct event code :

Code:
treenode current = ownerobject(c);
string mtbfname="MTBFMTTR";
treenode mtbf=node(concat("/Tools/MTBFMTTR/",mtbfname),model());
memberadd(current,mtbfname,2);
treenode coupling=last(getvarnode(mtbf,"members"));
createevent(mtbf,nodefunction(getvarnode(mtbf,"firstmtbf")),EVENT_BEGINDOWNTIME,"DownEvent",coupling);
This will not work where you're using state subsets, as more information needs to be stored relating the state totals.
The Following 6 Users Say Thank You to Jason Lightfoot For This Useful Post:
Tom David (08-27-2008)
  #5  
Old 08-27-2008
Normand Côté Normand Côté is offline
SNC-Lavalin GTS
 
Join Date: Aug 2007
Location: Montreal, Canada
Posts: 17
Downloads: 21
Uploads: 0
Thanks: 1
Thanked 24 Times in 13 Posts
Rep Power: 170
Normand Côté will become famous soon enough
Default

Similarly, if you dynamically add a member to a timetable (with the memberadd function) that is already in a down state then the newly added member will not go down until the next down cycle. The timetable object also does not memorize its current state (up or down). If you need the new member to go down immediately like other members then you have to yourself memorize the state of the timetable (for example in a label) and , if down, explicitly call the timetable's downfunction on this member. We recently use the following C++ code to do it
Code:
 
...
memberadd(newmember,timetablename,1);
if(timetableisdown)
{
  TimeTable *thisobjectdata=&o(TimeTable,timetable);
  nodefunction(thisobjectdata->node_v_downfunction,tonum(newmember),STATE_ON_BREAK,0, 0);
}
...
I don't know if the counterpart memberremove function handles the situation correctly (e.g. removing an already down member).



All times are GMT -6.
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2020, vBulletin Solutions Inc.
Copyright 1993-2018 FlexSim Software Products, Inc.