String to Byte Array Conversion Problem | 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
String to Byte Array Conversion Problem
June 29, 2020
8:26 pm
Avatar
SimonCee
Member
Members
Forum Posts: 10
Member Since:
January 17, 2017
sp_UserOfflineSmall Offline

I'm trying to port a LCD display library for use with the LCC and I'm struggling with the translation process.

The native library has a print line function that displays as string starting at the current write marker position and uses an array of characters as it's input.  When I implemented this using the LCC translation process the LCC interpreter assigned the string to a variable and then tried the pass the variable to the function which won't work, because a string isn't an array of characters and I get garbage on the display.

I then modified my interface VI for the 'println' function to use a byte array as it's input and convert the string to a byte array within the test VI using the 'string to byte array' icon from the LCC palette.  Now I get a number of compiler errors that suggest the LCC isn't converting the string to a byte array.  I've attached a screen image of the error.  If I try and generate the Arduino code I get a different error that suggests that something is wrong with the interpreter as it doesn't like any of the LCC palette functions.  I've uploaded an image of this error also.

I've also uploaded my LabVIEW library and the original Arduino LCD display library for my Maplin display.

Any help would be appreciated.

June 29, 2020
8:41 pm
Avatar
Steffan
Admin
Forum Posts: 408
Member Since:
March 12, 2015
sp_UserOfflineSmall Offline

Take a look at the user manual section "Porting an Arduino Library to LabVIEW".  It talks about using the .ptr() method to return a pointer to an array.  That may be what you are looking for in the first issue.  For the Arduino Code option, you cannot have primitive functions is the code.  That option is meant to help with the translation only and it will return an error if you include primitive LabVIEW functions in the code.  Again, this is discussed in the user manual section referenced here.  Please read it.

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