12-12-2024 02:55 AM
https://www.ni.com/docs/en-US/bundle/labview/page/flattened-data.html
In the strings and path section, it says:
For example, a path with value C:\File is flattened to 5054 4830 0000 000B 0000 0002 0143 0466 696C 65.
5054 4830 indicates PTH0. 0000 000B indicates 11 bytes total. 0000 is the type. 0002 is the number of components. 0143 indicates the letter C as a Pascal string. 0466 696C 65 indicates the word File as a Pascal string.
What is the type & component mentioned here? There is no explanation.
Solved! Go to Solution.
12-12-2024 03:49 AM - edited 12-12-2024 03:51 AM
That indicates mainly the type of the path: relative, absolute, not a Path, according to the function in the Advanced File Function palette: Path Type.
12-12-2024 02:48 PM - edited 12-12-2024 03:07 PM
I see! So the components being 2 is counting the levels in path? So "C" and "file" in this example?
This is path type documentation
https://www.ni.com/docs/en-US/bundle/labview-api-ref/page/functions/path-type.html
12-12-2024 03:11 PM
Yes, a LabVIEW path is internally a concatenated Pascal string. With an int16 indicating how many Pascal strings follow. And a Pascal string is a single byte indicating how many characters follow. Also each Pascal string is aligned to be a multiple of 2 bytes, by adding a filler byte if the number of characters was even.
It's called Pascal string, since the programming language Pascal which was quite popular as a teaching language in the 80ies of last century used this format for strings. C strings uses a terminating NULL character.
Advantages of C strings: It can contain more than 255 characters
Disadvantage: you have to scan the entire string to know how long it is