I'm currently finishing my simlation for a beerbrewery with some great help from Mr. Bangsow and Siemens.
I'd like to put I few things in it, I am not that good in PlantSim as you are. Here are the things I'd like to put in it:
- A counter that counts the times the drain has to work (the batches made).
- A button that starts the simulation and a Textbox in which I can fill in the simulation time, also a button that stops and resets the simulation so I don't need to use the EventController.
- A counter that shows me the simulated time and the amount produced.
See the image for my model.
How do I make this?
Thanks in advance!
Solved! Go to Solution.
not exactly sure about the 1st question, but here are some hints:
is strInput : string; do -- prompt for simulation start-date strInput := prompt("Please input simulation start-date: "); if executeSilent("(p: string): boolean is do result := isDate(str_to_date(p)); end;",strInput) then root.eventController.date := str_to_date(strInput); else promptMessage("Invalid date was entered. No changes made."); end; end;
myFluidDrain.statThroughputas Path and "Throughput of drain #1: " as Comment (without quotation marks).
Hope this helps, regards:
Thanks for your help. What I meant by the textbox is a box where I can fill in for example 120 hours. The simulation duration will be 120 hours, just like I put in the text box. Is this maybe easier to make?
Is there also maybe a control that executes the simulation very fast, maybe even without animation? So you don't have to speed up the eventcontroller?
to speed up the simulation, you could add buttons to do the following:
root.EventController.realTime := false; root.EventController.speed := 100;
is strInput : string; do -- prompt user for simulation duration strInput := prompt("Please enter simulation duration in hours:"); v_simDuration := str_to_num(strInput); root.eventController.end := 60*v_simDuration; end;
Does that work for you?
I think I'll use the second option, the speed up option. But is it also possible to do this with a check box. When I press on the check box and see the green sign the model speeds up. And when I click again on the check box the normal time starts again. Because when I use the button I can't go back to the normal speed without opening the eventcontroller.
yes you can also use a checkbox, where you can also define a (OnClicked)-Control. If you want to switch between "Highspeed (no animation)" and "Realtime (with animation)" you could do this:
is do -- Checkbox active = Highspeed mode if ?.value then eventController.speed := 100; end; eventController.realTime := not ?.value; animMU(not ?.value); animIcon(not ?.value); end;