From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
03-08-2010 03:37 PM
I am trying to write my own binary file saver and I need to list the data type in the custom header. How do you do this in labview?
03-08-2010 03:54 PM
03-08-2010 04:07 PM
03-08-2010 04:15 PM
03-08-2010 04:28 PM
03-08-2010 04:38 PM
kameronrausch wrote:
The data acquistion spits out data in several different formats so a priori, I do not know the data type. It can be either a 32-unsigned int, 16-bit unsigned int, 8-bit unsigned int or the signed version of each one of these. To make the program general purpose however, I would like to incorporate floating point data points as well.
At some point you have to know what the data type is before start collecting data. If all you have is a stream of bits there is no way to determine what the data type is. What controls how the data acquistion is getting its data? If it is test specific you could use an external configuration file to store this and use that to determine how the data should be interpreted. If you have arrays of specificdata types you could use a polymorphic VI for your data writes. Based on teh wire type of the input the appropriate VI would be called. How is your data being passed from your data acquistion to the VI that will write it to a file?
03-08-2010 04:41 PM - edited 03-08-2010 04:43 PM
I can think of two ways to return the "type" of data programaticaly.
1) Flatten to string- Will output a string of the data type that you could use in a case statement to generate your "1=U8, 2=U16....Enum.
2) the "To XML" fucntion Will also output the data type as a portion of the output string and allows you to select the XML schema. You could parse the XML for the data tye.
It seems you almost might want to programatically determine the instance of a polymorphic VI (Like "Daqmx Read Single Chan Single Sample (U8).vi" that is used in a upper level vi.. You COULD use the "Call Chain" function to output the exact instance of the poly-morphic f you wrote the VI or, do this with some invoke nodes .
03-08-2010 05:02 PM - edited 03-08-2010 05:02 PM