8:31 am
August 29, 2015
I have a couple of problems regarding string handling:
1) Byte Array to String - The byte sequence I am converting is 36,77,60,0,100,100,13. The converted sequence is 36,77,60,0,0,0,0.
2) A string constant of '$M<' appears to the compiled program as '$M'. i.e. the < character seems to be dropped.
Help appreciated.
Target - Atmega2560. Compiler - V1.0.0.18. LabView - V2014
3:20 pm
August 29, 2015
5:49 pm
March 12, 2015
For #1, this is a good catch that we don't have well documented. But since LabVIEW uses the length value and not a terminating character to determine the end of the string, you can embed all characters that include the NULL character, or ASCII character 0, in the string in the LabVIEW environment. However, since the code is ultimately converted to C++, the NULL character is interpreted as a termination character in the String, as this is how the String class is handled in C++. As documented here, when passing LabVIEW strings to external code that expects a C string, the embedded NULL characters cause the code to interpret the string as terminating at the first NULL character. This is the same way the String will be interpreted by the Arduino Compatible Compiler for LabVIEW. We will add some documentation to the Byte Array to String function to help clarify this. Hopefully you can workaround this by removing the NULL characters in your arrays before converting to Strings.
For #2 I have created Case 119. In fact, any characters after a '<' in a String constant will be dropped. This will hopefully get resolved in the next release. For the interim, here is a workaround. Use a byte array to represent the '<' character instead and concat the strings:
Please let me know if this answers your questions.
7:10 pm
August 29, 2015
OK, understand that now. I have implemented a solution based on byte array handling rather than string handling.
It might be an idea to add a generic section on the differences between LabView strings and C strings rather than confine it to the Byte Array to String function alone.
I am in the process of developing some software for an arduino based IMU & flight controller. It is called the Multiwii Pro and has accels, servo drives, gyros and pressure on board. Of course there is readily available software for it but it is more fun to develop from scratch. The idea of LabView for micros appeals to me too, and this is an ideal test bench.
I hope you don't mind but as I go through this I will probably have a few more questions for you!
Target - Atmega2560. Compiler - V1.0.0.18. LabView - V2014
3:52 am
March 12, 2015
FYI, version 1.0.0.19 has been released which resolves Case 119 above and should be available for download on the LabVIEW Tools Network and VI Package Manager in the next few days. See here for complete release notes.
32
1 Guest(s)