PWS Hex string array with 5 elements not compiling | 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
PWS Hex string array with 5 elements not compiling
July 3, 2018
11:13 am
Avatar
Chrisreed
Member
Members
Forum Posts: 19
Member Since:
March 23, 2015
sp_UserOfflineSmall Offline

I've got a really weird issue with a very small array of Hex Strings that I'm trying to index.  (I eventually want to have about 30 array elements).

If I have four elements in this array the compiler tells me how much space the Sketch/Global/Local variables I have used in the Status window and the program works on the PWS stamp.

However if I just add one more element to the array (ie. 5) the compiler seems to stop at the "Found library 'Ole32' at Ole32.dll" and it is not downloaded onto the PWS Stamp.

It doesn't matter what the actual value of each element in the array is and it doesn't matter if the array constant is inside or outside the While Loop.

It can't be a memory size issue, because I can't have say a 10 element array of normal text and each element can be several characters long and it compiles with no issues.

Is there something special about Hex strings in arrays that I'm missing?

ChrisFailed-Compiled-with-5-Element-array2-1.jpgImage EnlargerGood-Compile-with-4-Element-array2-1.jpgImage Enlarger

July 4, 2018
2:16 am
Avatar
Chrisreed
Member
Members
Forum Posts: 19
Member Since:
March 23, 2015
sp_UserOfflineSmall Offline

Actually with further testing it seems it is the NULL (0x00) string character that is causing all the issues.  If I try to do any sort of operation (except sending it straight to the Serial Write VI) the program will not compile properly.

This includes the indexing array VI above, concatenate string, Case statement and probably other LabVIEW VI's.

Why is it so - Chris?

July 4, 2018
2:46 am
Avatar
Chrisreed
Member
Members
Forum Posts: 19
Member Since:
March 23, 2015
sp_UserOfflineSmall Offline

And just to prove it, I changed the NULL (0x00) characters to something else (0x11) and it all compiled fine and worked properly.

July 4, 2018
4:34 am
Avatar
Steffan
Admin
Forum Posts: 408
Member Since:
March 12, 2015
sp_UserOfflineSmall Offline

This post may answer your question.

https://www.geverywhere.com/for.....functions/

There is also a note in the user manual about using NULL characters in a string array:

NOTE: Any NULL (0x00) bytes in an array cannot be represented in Arduino language and will cause the string to be prematurely terminated during conversion.  

Looks like you are sending packets.  Best thing to do would be to use hex byte arrays instead of string arrays.

July 4, 2018
9:31 am
Avatar
Chrisreed
Member
Members
Forum Posts: 19
Member Since:
March 23, 2015
sp_UserOfflineSmall Offline

Hi Steffan,

It worked fine when I converted the NULL strings into a byte array - this will save me a lot of grief - thanks a packet (pun intended).

Chris

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