Our full technical support staff does not monitor this forum. If you need assistance from a member of our staff, please submit your question from the Ask a Question page.


Log in or register to post/reply in the forum.

RTMC Pro expression windgust direction


Makada Aug 22, 2018 06:57 PM

Hi,

I would like to know how i can get the gust direction form the last 10 and/or 60 minutes form a one minute table in the form of a rtmc expression.

The datatable is: "Server:CR1000.TableMinute.Windskm_Max"

With kind regards.


Makada Aug 26, 2018 08:06 AM

Hi,

Is it possible someone can point me in the right direction please?

Thanks in advance. 


Makada Aug 30, 2018 05:22 PM

...there must be a way to get this working...


Makada Sep 7, 2018 11:12 AM

Please someone can shine a light on it? 😁


Makada Sep 29, 2018 08:26 AM

Hi, still struggling with it.

i honestly havent got a clue how to solve this...:(


CBO Oct 2, 2018 06:21 PM

Hi Makada, I do not fully understand your question, you can add me to the chat to see if I can help you.

http://t.me/cranbelo


Makada Oct 3, 2018 08:31 AM

Hi CBO, 

I dont onderstand, you can reply here.....


Makada Oct 3, 2018 08:31 AM

Hi CBO, 

I dont onderstand, you can reply here.....


nsw Oct 12, 2018 02:39 PM

Hello Makada, I am not sure I completely understand your request here. However, perhaps if you look at it from the datalogger side, there is an output instruction which may get you what you want.

Look in CRBasic Help for the "SampleMaxMin" instruction. This instruction follows a "Maximum" or "Minimum" instruction in the output table. See the CRBasic Help > Example program for where it should be used.

This may help you get the value you are looking for.


Makada Oct 13, 2018 04:08 PM

Hi NSW, 

Thanks for your reply.

Yes i know how to do it in crbasic, but i want to do it in rtmc pro.

With kind regards.


Makada Mar 26, 2019 12:34 PM

Hi,

Im still searching for this instruction. 

With kind regards.


Makada Mar 26, 2019 03:46 PM

I came up with this, but unfortunately that didnt work:(

It came up with a value, but from the gustdirection from the minute table ("Server:CR1000.TableMinute.Windr_SMM")

which change that value every minute. Not from the maxrun gust...

IIF(Maxrun("Server:CR1000.TableMinute.Windskm_Max")>"Server:CR1000.TableMinute.Windskm_Max", "Server:CR1000.TableMinute.Windr_SMM", 0)


Makada Mar 26, 2019 08:14 PM

Hi,

Maybe Andrew or Smile can help me with this?

You have helped me out in the past 😁


Makada Mar 29, 2019 02:40 PM

Hi,

Any solution for this please?


Makada Apr 2, 2019 08:10 PM

Hi,

Any solution for this please?


Vim Apr 3, 2019 06:58 AM

Have you tried something along the lines...

StartRelativeToNewest(nsecPerHour, OrderCollected); MaxRunOverTime("Server:CR1000.TableMinute.Windskm_Max",Timestamp("Server:CR1000.TableMinute.Windskm_Max"),nSecPerHour)


Makada Apr 3, 2019 01:48 PM

Hi Vim, 

Your example doesnt result the winddirection from max windskm .


Vim Apr 3, 2019 03:28 PM

What did it result in when you tried it and what is the difference between...

"Server:CR1000.TableMinute.Windr_SMM" and "Server:CR1000.TableMinute.Windskm_Max"?


Makada Apr 3, 2019 04:42 PM

The difference is as follow:

"Windskm_Max" is the maximum windspeed. 

"Windr_SMM" is the direction from maximum windspeed.

Your example just result in the maximum windspeed.


Vim Apr 4, 2019 07:15 AM

Try...

StartRelativeToNewest(nsecPerHour, OrderCollected); MaxRunOverTime("Server:CR1000.TableMinute.Windr_SMM",Timestamp("Server:CR1000.TableMinute.Windr_SMM"),nSecPerHour)


Makada Apr 4, 2019 08:40 AM

Hi,

Ive tried that already. 

That gives the maximum winddirection in degrees...


Makada Apr 7, 2019 09:57 AM

Hi,

Any solution for this please?


Makada Apr 14, 2019 11:32 AM

Hi,

Any solution for this please?


Makada Jun 12, 2019 09:33 PM

Anyone please?


Makada Jun 29, 2019 08:35 AM

Anyone please:)


JDavis Jul 1, 2019 09:17 PM

What makes it difficult in RTMC is there is not a Find function.

You have already worked out how to calculate the maximum gust. The next step is to then find the timestamp of a gust that is equal to that value. The only way I can think to do it in an RTMC expression is with a lot of IIF functions.

Once you have the timestamp, you can use the ValueAtTime expression to read the direction out of the table.


Makada Jul 2, 2019 04:04 PM

Hi JDavis, thanks for your reply.

I tried the function below but that didnt work...

The gust winddirection is in:     "Database:CR1000_Table1.WindDir_SMM" 

The gust windspeed is in:  "Database:CR1000_Table1.WS_kph_3s_Max"

ValueAtTime("Database:CR1000_Table1.WindDir_SMM",Timestamp(MaxRun("Database:CR1000_Table1.WS_kph_3s_Max")))


Terri Jul 5, 2019 06:52 PM

This is from one of the engineers:

Can you add to your program? 

The SampleMaxMin instruction is used to sample one or more variable(s) when another variable (or range of variables) reaches its maximum or minimum for the defined output period. A common use-case for this instruction is to output the wind direction at the time the maximum or minimum wind speed is recorded.

DataTable (HOUR,1,720)
  Maximum (1, Windskm, FP2, 0, True)
  SampleMaxMin(1, Wind_Deg, FP2,0)
EndTable


Makada Jul 5, 2019 07:41 PM

Hi,

Thanks for your answer. 

Yes i have the samplemaxmin in my program. 

And i have the timestamp from the max gust. 

But i cant get the valueattime to find the gustdirection in the table to work which JDavis suggested, see my previous post.

I want to have the gust direction calculated in rtmc. 

I have a report range in my rtmc pro screen in which i can change the timespan.

I have all the data shown fine when i change the timespan from hour to week to month to year,  but the only data i cant show in those timeframes is the gustdirection...


bvo Jan 16, 2024 06:15 PM

Another customer pointed me to this forum post since they were wanting to do the same thing.

The solution is to use the ValueAtTime() function where the item being returned is the wind direction, but the third parameter (interval) is where the magic happens.  The interval needs to be the difference in time between the most recent record's timestamp and the timestamp of the max wind as found by the MaxRunOverTime() instruction as follows.  If I wanted to find the max wind direction for a day, then the formula is:

StartRelativeToNewest(nsecPerDay, OrderCollected);
ValueAtTime(
  "WD_Source",
  Timestamp("WD_Source"),
  Timestamp("WD_Source") - Timestamp(
                                    MaxRunOverTime(
                                                  "WS_Source",
                                                   Timestamp("WS_Source"),
                                                   nsecPerDay
                                                   )
                                    ),
  "$invalid"
)

 

Log in or register to post/reply in the forum.