Welcome, Guest
Username: Password: Remember me
  • Page:
  • 1

TOPIC: Fetching time values from RunTimeCounter

Fetching time values from RunTimeCounter 13 years 5 months ago #1039

  • Maden
  • Maden's Avatar
  • OFFLINE
  • Expert Boarder
  • Posts: 86
  • Karma: 0
I am trying to read the TotalRunTime parameter from a RunTimeCounter object using the GetDTv object. This should work because the parameter is of type DeltaTime.

However during the build operation I get a \"class of referenced object not allowed\" error for the GetDTv object. What am I doing wrong?

My final goal is to convert the TotalRunTime value to a float value.

Any idea on how to do this?

Ondrej
The administrator has disabled public write access.

Re:Fetching time values from RunTimeCounter 13 years 5 months ago #1040

  • claes
  • claes's Avatar
  • OFFLINE
  • Platinum Boarder
  • Posts: 3170
  • Thank you received: 497
  • Karma: 133
HI Ondrej,

Try a GetDTp instead. GetDTp is used to fetch deltatime attributes, GetDTv fetches values of DTv objects.

/Claes
The administrator has disabled public write access.

Re:Fetching time values from RunTimeCounter 13 years 5 months ago #1041

  • Maden
  • Maden's Avatar
  • OFFLINE
  • Expert Boarder
  • Posts: 86
  • Karma: 0
Hi Claes,

yes, I also tried GetDTp but I cannot connect the output of this object to the DtToA object for the conversion (\"connected attributes are not of the same type\" error).

Any other idea?

Ondrej

Looks like the output of GetDtTp is an absolute time value. Why ???

Post edited by: Maden, at: 2010/10/06 15:29
The administrator has disabled public write access.

Re:Fetching time values from RunTimeCounter 13 years 5 months ago #1042

  • claes
  • claes's Avatar
  • OFFLINE
  • Platinum Boarder
  • Posts: 3170
  • Thank you received: 497
  • Karma: 133
This is a bug, the output should of course be a DeltaTime.

A workaround is to use a DataArithm instead, with the Da1 input connected to a GetData pointing at the RunTimeCounter object. The code would be something like

[code:1]classdef Da1 RunTimeCounter;
time_DtoFloat( &OA1, &Da1->TotalRunTime);[/code:1]

/Claes
The administrator has disabled public write access.

Re:Fetching time values from RunTimeCounter 13 years 5 months ago #1046

  • Maden
  • Maden's Avatar
  • OFFLINE
  • Expert Boarder
  • Posts: 86
  • Karma: 0
Thanks Claes,

your workaround does the trick. It's just that the function time_DToFloat must be written with a capital T but then it runs.

By the way: thanks for everyone providing this great support in to us ProView beginners. I would be lost without it :laugh:

Ondrej

Post edited by: Maden, at: 2010/10/07 12:27
The administrator has disabled public write access.
  • Page:
  • 1
Time to create page: 9.603 seconds