130 likes | 142 Views
A software package for automatic data transfer between LabVIEW and IDL programming environments. It provides means of retrieving LabVIEW datalog records, storing and processing variant records, adding flexibility to IDL.Scriptnode for LabVIEW, and resolving data type incompatibility issues.
E N D
LV2IDL, a software package for automatic data transfer between LabVIEW and IDL Gelu M. Nita New Jersey Institute of Technology
Purpose To provide several means of in-line or off-line automatic data transfer between the LabVIEW and IDL programming environments.
Retrieving LabVIEW datalog records Any LabVIEW 7.x datalog file record can be restored as an IDL structure without any prior knowledge of the original record template. Since this option is not currently provided by the LabVIEW environment, one may also use this feature to recover data stored in undocumented LabVIEW datalog files.
Retrieving and returning LabVIEW variant records using temporary files • Any arbitrary LabVIEW data structure converted in a variant variable and stored as a data file record may be restored as an IDL structure, processed inside IDL, and saved as a LabVIEW variant record. • Provided that IDL does not change the original template of the data, one may return the processed variant variable back to the LabVIEW application.
Retrieving in LabVIEW the variant record processed by the IDL application
Adding flexibility to the IDL Scriptnode for LabVIEW • The IDL Scriptnode for LabVIEW allows the user to perform in-line data transfer between LabVIEW 7.x and IDL. However, the user has to explicitly define at the development stage the data types of input and output terminals of the script node, which are limited to a few basic unstructured data types. • This package allows the user to pass any LabVIEW data structure in a variant format, dynamically process it inside the script, and pass the result back to LabVIEW, as well as any dynamically created variables, as variant structures.
Data type incompatibility issues • The LV2IDL package does not provide support for special data types that would be out of scope outside the LabVIEW environment, such as variable or file references. • Since IDL does not support the unsigned short integer data type (i8), such LabVIEW variables are automatically converted to unsigned IDL byte variables, while a warning message is issued. It is the full responsibility of the user to convert these variables to any of the available IDL signed integer data types (integer or long). • LabVIEW empty arrays are converted to a special IDL structure named “empty_array” which contains only the element descriptor. • LabVIEW variants are converted to anonymous IDL structures that combine the variant data fields and its attributes. Empty variants are converted to a special IDL structure named “empty_variant” which contains only a null pointer field. • The LabVIEW extended numerical data types (8 bytes) are not supported by the current version, but they could be converted in a {Lo32,Hi32 } IDL structure in a future release.
LabVIEW 8.x compatibility • Starting with version 8.0, National Instruments changed the LabVIEW’s internal type descriptors, which makes the current version of the LV2IDL package being incompatible with the LabVIEW 8.x data types. • However, any data structure may be still passed between the LabVIEW 8.x and IDL applications as a variant file record provided it is explicitly converted to the 7.x format by using the LabVIEW 8.x flatten to string function with the appropriate option selected.
Saving a variant structure as a LabVIEW 7.x variant record using the flatten to string LabVIEW 8.x function. Restoring the variant record as an IDL structure, modifying its contents while preserving its original template, and saving it as an LabVIEW 7.x variant record. Restoring the LabVIEW 7.x variant record as a binary string, converting it to a LabVIEW 8.x variant using the unflatten from string function, and to its original data format using the variant to data function.