Porting library error when verifying | Arduino Compatible Compiler for LabVIEW Discussions | Forum

Avatar
Please consider registering
guest
sp_LogInOut Log In sp_Registration Register
Register | Lost password?
Advanced Search
Forum Scope


Match



Forum Options



Minimum search word length is 3 characters - maximum search word length is 84 characters
sp_Feed Topic RSS sp_TopicIcon
Porting library error when verifying
August 30, 2016
11:42 am
Avatar
Urabus
Member
Members
Forum Posts: 5
Member Since:
August 30, 2016
sp_UserOfflineSmall Offline

Hi All,

I'm trying to port a library that init and read a IMU board. The library works well on Arduino IDE (check my arduino test example).

But when I try to verify it in Arduino compiler there's error. I uploaded my complete folder containing the two function to port : init and read.

What's wrong with my vilib ?

Thanks

August 31, 2016
6:32 pm
Avatar
Steffan
Admin
Forum Posts: 408
Member Since:
March 12, 2015
sp_UserOfflineSmall Offline

I get an error due to L3G library missing.  You have not included that as part of the libraries for the addon.  Maybe that is your issue.

September 2, 2016
8:02 pm
Avatar
Urabus
Member
Members
Forum Posts: 5
Member Since:
August 30, 2016
sp_UserOfflineSmall Offline

Thanks for the support. No, this is not my error. I installed L3G library and LSM303 library before designing ma IMU lib that's why no pb with it.

Please find in the attached files the missed librairies.

 

Regards.

September 2, 2016
9:04 pm
Avatar
Steffan
Admin
Forum Posts: 408
Member Since:
March 12, 2015
sp_UserOfflineSmall Offline

You are missing this line in your Translator.  You need to create the IMU object.

IMU exampleIMU;

 

You can do this in your translator by placing it on the last line of the includes like this:

 

includes.pngImage Enlarger

sp_PlupAttachments Attachments
September 3, 2016
12:29 pm
Avatar
Urabus
Member
Members
Forum Posts: 5
Member Since:
August 30, 2016
sp_UserOfflineSmall Offline

Thank you. I will try that next Monday and keep you updated.

Best regards.

September 5, 2016
7:59 am
Avatar
Urabus
Member
Members
Forum Posts: 5
Member Since:
August 30, 2016
sp_UserOfflineSmall Offline

Hi,

it doesn't work. If I checked the arduino code example in Arduino IDE and the arduino code given in the compiler, it's exactly the same:

Arduino example in arduino IDE (that compiling):

#include <IMU.h>

IMU exampleIMU;

float roll3;
float pitch3;
float yaw3;
int accx;
int accy;
int accz;

void setup() {
exampleIMU.init();

}
void loop() {
exampleIMU.read(roll3, pitch3, yaw3, accx, accy, accz);

}

Arduino code given in the compiler:

#include "LVArray.h"
#include "A4Lhelper.h"
#include "IMU.h"
#include "Arduino.h"
#include "Wire.h"
#include "L3G.h"
#include "LSM303.h"
IMU exampleIMU;
void setup()
{
signed long accz4_483;
signed long accy4_424;
signed long accx4_365;
float yaw4_306;
float pitch4_254;
float roll4_105;
boolean Const609;
exampleIMU.init();
signed long LoopCounter570 = 0;
boolean LoopEnd609 = false;

do
{

accz4_483 = 0;
accy4_424 = 0;
accx4_365 = 0;
yaw4_306 = 0.000000;
pitch4_254 = 0.000000;
roll4_105 = 0.000000;
Const609 = false;
exampleIMU.read(roll4_105,pitch4_254,yaw4_306,accx4_365,accy4_424,accz4_483);
if(Const609)
{
break;
}

LoopCounter570=LoopCounter570+1;
} while(1);
}

void loop()
{
}

But I get these errors when compiling:

1.0.0.21, Arduino Due (Programming Port)
Chargement de la configuration
Initialisation des paquets...
Préparation des cartes
Vérification...
C:\Users\Admin\AppData\Local\Temp\58e9973bb6e2e908c6c199f5a9d39075.tmp\temp\temp.ino: In function 'void setup()':

temp:32: error: no matching function for call to 'IMU::read(float&, float&, float&, long int&, long int&, long int&)'

exampleIMU.read(roll4_105,pitch4_254,yaw4_306,accx4_365,accy4_424,accz4_483);

^

C:\Users\Admin\AppData\Local\Temp\58e9973bb6e2e908c6c199f5a9d39075.tmp\temp\temp.ino:32:84: note: candidate is:

In file included from C:\Users\Admin\AppData\Local\Temp\58e9973bb6e2e908c6c199f5a9d39075.tmp\temp\temp.ino:3:0:

C:\Users\Admin\Documents\Arduino\libraries\IMU/IMU.h:13:7: note: void IMU::read(float&, float&, float&, int&, int&, int&)

void read(float &roll2, float &pitch2, float &yaw2, int &accx2,int &accy2,int &accz2);

^

C:\Users\Admin\Documents\Arduino\libraries\IMU/IMU.h:13:7: note: no known conversion for argument 4 from 'long int' to 'int&'

exit status 1
no matching function for call to 'IMU::read(float&, float&, float&, long int&, long int&, long int&)'

 

Thank you

September 5, 2016
8:27 am
Avatar
Urabus
Member
Members
Forum Posts: 5
Member Since:
August 30, 2016
sp_UserOfflineSmall Offline

It looks like a problem of variables types. It seems there's no pb with float type, but I don't manage to get the same type for integer (int).

If I put all I32 (example VI and read in IMU.vilib) it doesn't work, if i put I16 everywhere it's the same ...

September 7, 2016
8:43 pm
Avatar
Steffan
Admin
Forum Posts: 408
Member Since:
March 12, 2015
sp_UserOfflineSmall Offline

It is because your library uses the int datatype for these parameters where the Compiler uses short for I16 and long for I32 because int can mean different things on different Arduino platforms.  But you can see the code conversion so you just need to do some C casting in your translator or make modifications to the library if necessary.  This is outside the scope of normal support so you will have to determine the best way to integrate with 3rd party libraries.

Forum Timezone: UTC 0
Most Users Ever Online: 100
Currently Online:
7
Guest(s)
Currently Browsing this Page:
1 Guest(s)
Top Posters:
miche91: 33
scottj: 28
scadao: 23
Member Stats:
Guest Posters: 5
Members: 202
Moderators: 0
Admins: 3
Forum Stats:
Groups: 1
Forums: 2
Topics: 266
Posts: 1222
Newest Members:
pujacontrol
Administrators: geadmin: 22, filipealtoe: 96, Steffan: 356