View unanswered posts | View active topics It is currently Mon Sep 21, 2020 3:18 pm

Reply to topic  [ 2 posts ] 
Reading floats through datalogging 
Author Message

Joined: Mon Feb 16, 2009 10:05 am
Posts: 8
Post Reading floats through datalogging
I'm trying to use datalogging to debug some issues within my code. I've used the AddToDatalog() function to read out sensor values successfully. When I try to pass any float variable to this method though I get an error stating

"Multiple overloads for 'AddToDatalog' match"

Is it possible to read out floats this way? Are there additional methods required to initialise the datalog that I am missing, currently I am just using the AddToDatalog() method for the sensors then SaveNxtDatalog() at the end of my code.

Thank you for any help

Sun Aug 16, 2009 8:18 am
User avatar

Joined: Tue Oct 14, 2008 7:16 pm
Posts: 171
Location: Investigating an unidentified ship sighted in Sector 31428
Post Re: Reading floats through datalogging
As you may or may not know, functions can exist in multiple versions, under the same name as long as they have different argument lists, these are called overloads and the function is said to be overloaded. This is the case with the AddToDatalog function, it has a version which accepts a variable of type long and one which takes type int as well as versions which take two arguments, the first being an index of some sort, the second the data to be written as either a long or an int.

The problem is that there is no overload which specifically accepts type float and so it's trying to convert to another data type, but doesn't know which type it should convert to since it could convert to either type int or long.

If you right click on the function name and select Go to definition/declaration, you could try copying one of the definitions and change it to float; that may not work though. Otherwise you will have to convert your variables to either type int or long. You may have to call the CreateDataLog method as well before writing to the datalog, though I'm not sure.

Captain, Head programmer, School of the Arts, Silverbots Robtics Team #2890
using namespace System;
using namespace Genius;
using namespace Personality;
public ref class Nerd : Geek, IAnserable
    Geek::Type brainMode = Geek::Type::Programmer;

Sun Aug 16, 2009 2:17 pm
Display posts from previous:  Sort by  
Reply to topic   [ 2 posts ] 

Who is online

Users browsing this forum: No registered users and 2 guests

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  

Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by ST Software for PTF.