13
LV2IDL, a software LV2IDL, a software package for automatic package for automatic data transfer between data transfer between LabVIEW and IDL LabVIEW and IDL Gelu M. Nita Gelu M. Nita New Jersey Institute of New Jersey Institute of Technology Technology

LV2IDL, a software package for automatic data transfer between LabVIEW and IDL Gelu M. Nita New Jersey Institute of Technology

Embed Size (px)

Citation preview

LV2IDL, a software package for LV2IDL, a software package for automatic data transfer between automatic data transfer between

LabVIEW and IDLLabVIEW and IDL

Gelu M. NitaGelu M. Nita

New Jersey Institute of New Jersey Institute of TechnologyTechnology

PurposePurpose

To provide several means of in-line or off-line To provide several means of in-line or off-line automatic data transfer between the automatic data transfer between the LabVIEW and IDL programming LabVIEW and IDL programming environments.environments.

Retrieving LabVIEW datalog recordsRetrieving LabVIEW datalog records

Any LabVIEW 7.x datalog file record can be Any LabVIEW 7.x datalog file record can be restored as an IDL structure without any restored as an IDL structure without any prior knowledge of the original record prior knowledge of the original record template. Since this option is not currently template. Since this option is not currently provided by the LabVIEW environment, one provided by the LabVIEW environment, one may also use this feature to recover data may also use this feature to recover data stored in undocumented LabVIEW datalog stored in undocumented LabVIEW datalog files.files.

Retrieving and returning LabVIEW Retrieving and returning LabVIEW variant records using temporary filesvariant records using temporary files Any arbitrary LabVIEW data structure Any arbitrary LabVIEW data structure

converted in a variant variable and stored as converted in a variant variable and stored as a data file record may be restored as an IDL a data file record may be restored as an IDL structure, processed inside IDL, and saved structure, processed inside IDL, and saved as a LabVIEW variant record.as a LabVIEW variant record.

Provided that IDL does not change the Provided that IDL does not change the original template of the data, one may return original template of the data, one may return the processed variant variable back to the the processed variant variable back to the LabVIEW application.LabVIEW application.

Storing the variant record in Storing the variant record in LabVIEWLabVIEW

Restoring and processing the variant Restoring and processing the variant record in IDLrecord in IDL

Retrieving in LabVIEW the variant Retrieving in LabVIEW the variant record processed by the IDL record processed by the IDL

applicationapplication

Adding flexibility to the IDL Adding flexibility to the IDL Scriptnode for LabVIEWScriptnode for LabVIEW

The IDL Scriptnode for LabVIEW allows the user The IDL Scriptnode for LabVIEW allows the user to perform in-line data transfer between LabVIEW to perform in-line data transfer between LabVIEW 7.x and IDL. However, the user has to explicitly 7.x and IDL. However, the user has to explicitly define at the development stage the data types of define at the development stage the data types of input and output terminals of the script node, input and output terminals of the script node, which are limited to a few basic unstructured data which are limited to a few basic unstructured data types. types.

This package allows the user to pass any This package allows the user to pass any LabVIEW data structure in a variant format, LabVIEW data structure in a variant format, dynamically process it inside the script, and pass dynamically process it inside the script, and pass the result back to LabVIEW, as well as any the result back to LabVIEW, as well as any dynamically created variables, as variant dynamically created variables, as variant structures.structures.

Data type incompatibility issues Data type incompatibility issues The LV2IDL package does not provide support for special data The LV2IDL package does not provide support for special data

types that would be out of scope outside the LabVIEW types that would be out of scope outside the LabVIEW environment, such as variable or file references.environment, such as variable or file references.

Since IDL does not support the unsigned short integer data type Since IDL does not support the unsigned short integer data type (i8), such LabVIEW variables are automatically converted to (i8), such LabVIEW variables are automatically converted to unsigned IDL byte variables, while a warning message is issued. unsigned IDL byte variables, while a warning message is issued. It is the full responsibility of the user to convert these variables to It is the full responsibility of the user to convert these variables to any of the available IDL signed integer data types (integer or any of the available IDL signed integer data types (integer or long).long).

LabVIEW empty arrays are converted to a special IDL structure LabVIEW empty arrays are converted to a special IDL structure named “empty_array” which contains only the element named “empty_array” which contains only the element descriptor.descriptor.

LabVIEW variants are converted to anonymous IDL structures LabVIEW variants are converted to anonymous IDL structures that combine the variant data fields and its attributes. Empty that combine the variant data fields and its attributes. Empty variants are converted to a special IDL structure named variants are converted to a special IDL structure named “empty_variant” which contains only a null pointer field.“empty_variant” which contains only a null pointer field.

The LabVIEW extended numerical data types (8 bytes) are not The LabVIEW extended numerical data types (8 bytes) are not supported by the current version, but they could be converted in supported by the current version, but they could be converted in a {Lo32,Hi32 } IDL structure in a future release.a {Lo32,Hi32 } IDL structure in a future release.

LabVIEW 8.x compatibilityLabVIEW 8.x compatibility

Starting with version 8.0, National Instruments Starting with version 8.0, National Instruments changed the LabVIEW’s internal type descriptors, changed the LabVIEW’s internal type descriptors, which makes the current version of the LV2IDL which makes the current version of the LV2IDL package being incompatible with the LabVIEW 8.x package being incompatible with the LabVIEW 8.x data types. data types.

However, any data structure may be still passed However, any data structure may be still passed between the LabVIEW 8.x and IDL applications as between the LabVIEW 8.x and IDL applications as a variant file record provided it is explicitly a variant file record provided it is explicitly converted to the 7.x format by using the LabVIEW converted to the 7.x format by using the LabVIEW 8.x flatten to string function with the appropriate 8.x flatten to string function with the appropriate option selected.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.