Porting Ethernet Library - pass Strings | 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 4 characters - maximum search word length is 84 characters

sp_Feed Topic RSS sp_TopicIcon
Porting Ethernet Library - pass Strings
August 24, 2015
7:11 am
Avatar
tpostman
Nuremberg, Bavaria - Germany
New Member
Forum Posts: 1
Member Since:
August 21, 2015
sp_UserOfflineSmall Offline

Hello,

i am trying to port the Arduino Ethernet library. My step by step approach for this is to take the "UDPSendReceiveString" as an example.

At the moment i fail at the point passing a string pointer or char array to the read function. In the porting library part of the manual the "LVArray.h" is mentioned but i did not find an example. Maybe somebody can have a look at my code and give me some hints for further programming.

Thanks in advance.

Tobias

August 24, 2015
2:22 pm
Avatar
Steffan
Admin
Forum Posts: 304
Member Since:
March 12, 2015
sp_UserOfflineSmall Offline

Please refer to the Porting an Arduino Library to LabVIEW section of the user manual.  Specifically the paragraph below.  It specifies the syntax to use to obtain a C pointer to an array by using the ptr() member.  For a string, this goes a little deeper in the implementation of the Arduino String class.  Refer here for details.  You can use a similar member c_str().

A special case to be aware of is the use of array datatypes as inputs or outputs.  This gets more advanced since the LabVIEW array implementation is handled in a C++ class, located in “[LABVIEWDIR]\vi.lib\Aledyne-TSXperts\Arduino Compatible Compiler for LabVIEW\Arduino Libraries\LVArray\LVArray.h".  Common needs may be to index a certain element of an array, get the size of the array, or obtain a pointer to the array within the C code in the Translator.vi.  For example if an input array is called Array123, one can index the 10th element of that array using the syntax Array123[10].  One can obtain the size of the array with the syntax Array123.size() and can obtain a C pointer to the array using Array123.ptr().  These may be required in order to pass array data to C functions that expect it.  You can refer to LVArray.h for a complete list of available array C++ methods.

January 27, 2016
8:31 pm
Avatar
pboughner
New Member
Forum Posts: 2
Member Since:
December 4, 2015
sp_UserOfflineSmall Offline

Did you get this resolved?

I plan on tackling this after the current FRC build season to introduce new programmers to our team. I would like to use a W5100 Ethernet Shield /w SD Card to plug into a TL-WR702N for wireless connectivity. This will hopefully replicate the current control system with LabView enough to make the jump to the RoboRIO less challenging.

 

Paul

June 29, 2016
8:29 pm
Avatar
jared.ocampo
Member
Forum Posts: 4
Member Since:
May 4, 2016
sp_UserOfflineSmall Offline

Was anybody able to port succesfully the Ethernet library to use the Ethernet shield??

Jared

July 4, 2016
11:13 pm
Avatar
jared.ocampo
Member
Forum Posts: 4
Member Since:
May 4, 2016
sp_UserOfflineSmall Offline

tpostman said
Hello,

i am trying to port the Arduino Ethernet library. My step by step approach for this is to take the "UDPSendReceiveString" as an example.

At the moment i fail at the point passing a string pointer or char array to the read function. In the porting library part of the manual the "LVArray.h" is mentioned but i did not find an example. Maybe somebody can have a look at my code and give me some hints for further programming.

Thanks in advance.

Tobias

Hi Tobias,

were you successful in the porting of the arduino ethernet library??

Jared

Forum Timezone: UTC 0

Most Users Ever Online: 33

Currently Online:
2 Guest(s)

Currently Browsing this Page:
1 Guest(s)

Top Posters:

John: 18

RTSLVU: 15

Dan6077: 11

Member Stats:

Guest Posters: 0

Members: 80

Moderators: 0

Admins: 3

Forum Stats:

Groups: 1

Forums: 2

Topics: 58

Posts: 289

Newest Members: Geraldkix, ThomasSoogs, Angelvor, AngelaMuh, Nsneilohone

Administrators: geadmin: 5, filipealtoe: 35, Steffan: 89