porting libs / passing an array | 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 libs / passing an array
June 10, 2016
1:49 pm
Avatar
viwoi
Member
Members
Forum Posts: 16
Member Since:
March 19, 2015
sp_UserOfflineSmall Offline

Hello,

 

although the principle of porting an byte-array to a VI is described in the manual, could you post a simple sample code as an example (c-file & VI & settings in the translator VI)?

 

 Thanx a lot,

 

Vitali

June 11, 2016
3:23 pm
Avatar
LubomirJagos
Member
Members
Forum Posts: 21
Member Since:
August 4, 2015
sp_UserOfflineSmall Offline

Hi viwoi,

you can take look on my library for ESP8266, there is VI 'SoftAP Config' (folder Wifi Functions -> Underhood functions -> SoftAP Config) and you have to find it in translator. Or you can take look for MatrixMath library, it is using double array to compute matrices.

Basically, when you set type of input/output terminal as array, you are working same way with it like with other types terminal, so in translator if you want to access third element of it you have to write:

  %s[2] = some value; //in C/C++ array starts at index 0 so third value has index 2

Now let's say that you want to create array with some values and return it as output:

  %s = LVOneDimArray( number of elements, initial value);

So here is link for these VI packages:

  https://github.com/LubomirJagos/LabVIEW-for-Arduino-Libraries-Packages

 

I am doing there some extra things in my libraries (retype input array, ...) so I hope that you will not loose there.

 

Regards,

 

Lubomir

June 16, 2016
4:38 pm
Avatar
viwoi
Member
Members
Forum Posts: 16
Member Since:
March 19, 2015
sp_UserOfflineSmall Offline

Hello Lubomir,

 

thank you for the description and code.

Actually, I intended to port the library for the CAN-bus-shield from seeedstudio (written in C++).

Since C++ porting didn't work (trying to create an object failed), I tried to write my own native functions, which are using an array as parameter (in & output) and implement them

 

I will have a look on your comment " %s = LVOneDimArray( number of elements, initial value);" in the future. Hope to be successfull.

 

Thanks again

Forum Timezone: UTC 0
Most Users Ever Online: 100
Currently Online:
22
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