06-02-2018 05:07 AM - edited 06-02-2018 06:11 AM
Hello.
since the regular writing formate of time does not work in methods
(example, for 8 hours 8:00:00:0000) because the ":" is not accepted;
I do not use the colon ( : ), so my time looks like 80000, (or 0800
or 08 00 00 0000)and its a bit confusing how many "zeros"
I actually need, and how SimPlant is reading it, digit-wise.
Thanks for help ;-)
Solved! Go to Solution.
06-03-2018 01:36 AM
I'm not sure I understand what exactly you're trying to do. Defining a time-variable in a method for 8hr could be done like this, e.g.:
So what do you mean with ":" is not accepted?
06-03-2018 05:30 AM - edited 06-03-2018 05:30 AM
He is giving me a syntax error warning for line 11 if I do it that way.
That is why I was asking. It will be red and not usable if I use a colon ( : ).
06-03-2018 08:53 AM
06-03-2018 10:56 AM
Version 11 (64bit).
06-03-2018 01:49 PM - edited 06-03-2018 01:50 PM
why? So the third option with directly using the ":" was introduced in Plant Simulation 14 (or maybe 13.2 or something, I don't use those). In Plant 11 you can only use the first 2 options (using str_to_time or entering the time in seconds); does that still solve your problem?
06-07-2018 06:12 AM
since I defined it as time above already, he is complaining if I convert again.
I put in the 8 00 0000 (without spaces) for eight hours and at least he formally does not complain.
Or do I have to type 8 x 3600 to get the numerically correct value?
06-07-2018 06:15 AM
8 * 3600 equals 8 h
06-07-2018 09:16 AM
@Hannes821 schrieb:
since I defined it as time above already, he is complaining if I convert again.
That should not happen, if you do it like I showed in my first post; if your variable (on the left) is really of type "time" and then you assign str_to_time("8:00:00") to it, then this must be valid code.
@Hannes821 schrieb:
I put in the 8 00 0000 (without spaces) for eight hours and at least he formally does not complain.
Or do I have to type 8 x 3600 to get the numerically correct value?
As shown in my first post, you must use 8x3600! What you put in there equals ~92 days (because it simply means 8000000 seconds).
06-08-2018 09:36 AM
To the first part, maybe this picture illustrates why it is not a valid input;not working
not working
working, thank you
to the second part, thank you, this solved the problem.
Now I finally know how to (in which formate/ shape to) insert time. Thank you.