ATTENTIONThis 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 |
#1
|
|||
|
|||
How to get label of a processor?
In my model, I set a label to decide the breakdown time of the server, I hope the server check is it will breakdown every 8 hours. And The breakdown percentage will change monthly. I set a label called "breakdown" in the processor, and I want to call and update it in the MTBF MTTR table, I write the code in onDown function in the table as:
Code:
if(randomNumber <= check){ return/**/0.00001/**/; setlabelnum(current,"breakdown",0.00001); } else { return/**/8/**/; setlabelnum(current,"breakdown",8); But it doesn't work as the label doesn't change.Can anyone teach me the coding of this? Thanks in advance. |
#2
|
|||
|
|||
Try replacing current with 'involved' (which is assigned the parameter that is passed into the trigger in the header). If you accessed this through the Processor GUI, I know that's a little confusing, but the MTTR is actually an object that is stored elsewhere and current refers to that object.
|
The Following User Says Thank You to Jason Lightfoot For This Useful Post: | ||
Jack Lai (02-22-2012) |
#3
|
||||
|
||||
Maybe it is a good idea to place the return command after setlabelnum(..) instead of before. Return finish the further execution of code.
Jörg |
The Following 2 Users Say Thank You to Jörg Vogel For This Useful Post: | ||
Steven Hamoen (02-23-2012) |
#4
|
|||
|
|||
Thanks for advice. I use "involved" and then can update the label now. Can I know more how it works? Waht is the meaning of "trigger in the header", will "involved" also affect the flowitem in the server? Thanks.
|
#5
|
||||
|
||||
involved is a pointer parsed as a parameter, when the function is called. The parameter is accessed by the command parnode(num index). Some values are parsed as numbers, too. Those values can you get with the function parval(num index). Please have a look at the online help > Users Manual, Commands.
Jörg |
Thread | Thread Starter | Forum | Replies | Last Post |
Cannot use label | Jack Lai | Flexsim Student Forum | 7 | 11-24-2011 03:41 AM |
Problem with the value of a label | Clement Schaller | Q&A | 3 | 03-15-2011 09:44 AM |
Add Label | Nischith Kashyap | Q&A | 4 | 03-14-2011 07:16 PM |
Record label | manuel fernandez | Q&A | 1 | 03-21-2010 12:29 PM |
how to set preempt by label? | Vic Li | Q&A | 4 | 10-19-2008 01:51 AM |