LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

type/component in flattened data context

Solved!
Go to solution

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.

 

 

 

0 Kudos
Message 1 of 4
(833 Views)
Solution
Accepted by topic author shuttlefan

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.

rolfk_0-1733997066474.png

 

Rolf Kalbermatter
My Blog
Message 2 of 4
(815 Views)

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

0 Kudos
Message 3 of 4
(696 Views)
Solution
Accepted by topic author shuttlefan

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

 

Rolf Kalbermatter
My Blog
Message 4 of 4
(689 Views)