LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Complex data types in CVI2015

Solved!
Go to solution

Hello...

 

The compiler (not the variable view) of CVI2013 supported the use of complex data types, see, e.g., here.

 

CVI2015 now gives an error: complex types are not supported - so the build fails...

 

What should I do? (the build option Build with C99 extensions is enabled)

0 Kudos
Message 1 of 13
(6,306 Views)

Hi, Wolfgang

 

In which version of LabWindows/CVI did you start using the complex types C99 extension?

Daniel Dorroh
National Instruments
0 Kudos
Message 2 of 13
(6,138 Views)

Hi Daniel,

 

I tried it in CVI2013, and at least in CVI2013 SP2 the following line compiles fine:

 

_Complex double z1;

 

In CVI2015 the very same line throws an error.

0 Kudos
Message 3 of 13
(6,135 Views)
To be clear, you have not done extensive development with the complex types extension; is that correct? Are you currently using the advanced analysis library's complex types?
Daniel Dorroh
National Instruments
0 Kudos
Message 4 of 13
(6,125 Views)

No, I am not using the AAL functions, but I was relying on the C99 support of clang and this document. The title of this document suggests that these extensions should also be available in CVI2015, CVI2017...

0 Kudos
Message 5 of 13
(6,122 Views)

Daniel

Any update on this discrepancy between the documentation and the behaviour of CVI2015?

 

I think it is an important issue that should not just be allowed to drop off the front page of the CVI forum.

Cheers

 

S.

0 Kudos
Message 6 of 13
(5,852 Views)

Hi, SteveD123

 

We are currently investigating the extent to which the behavior of the extensions has changed between LabWindows/CVI 2013 and 2015. Regarding the complex extensions, the following is what we currently know:

 

LabWindows/CVI Version and Configuration Complex Scalar Complex Array
2013 SP2 Release Configuration Application builds and runs without any run-time or build errors. Application builds and runs without any run-time or build errors.
2013 SP2 Debug Configuration with no Runtime checking Application builds and runs without any run-time or build errors. Application builds and runs without any run-time or build errors.
2013 SP2 Debug Configuration with Standard Runtime Checking Application builds and runs without any run-time or build errors.

Application builds without error. General Protection fault at startup when debugging application which uses complex array defined in local function scope.

 

Workaround: Application doesn't crash when defining complex array in global scope.

 

void main() {  
   _Complex double array[20];
   // ...
 
2015 Release and Debug Configurations Build error: complex types are not supported Build error: complex types are not supported

 

In all of the cases in which the application that uses complex numbers builds and runs without crashing:

  • You can add/view the complex variable in the Watch window and the Variables window.
  • You can view the type of the complex variable in the Watch window and the Variables window as complex, not as _Complex double (the latter is is the way users declare it in the source code).
  • You cannot view the value of the complex variable in the Watch window, Variables and Call Stack window or the Data Tooltip.
  • You can perform basic math operations using associated operators (e.g., +, -) with the complex numbers.

 

We are in the process of updating the KB that Wolfgang mentioned in his initial post to better reflect the state of support for extensions in LabWindows/CVI 2013 and 2015. We have opened bug reports for several issues we have found:

  • 541058—Compiler error when using C99 complex data type
  • 541867—Unable to change the value of a _Bool variable in the Data Tooltip, the Watch window, or the Variables and Call Stack window.
  • 541061—Dollar signs in variable names are not fully supported.
  • 539474—Unable to compile code with binary constants ('0b' prefixed numbers)
  • 540675—Compiler error when using compound literals

I will update this post when we have completed updating the KB with accurate information. If you have been affected by any of the previously listed bugs, please post that feedback here.

 

Thanks,

Daniel Dorroh
National Instruments
0 Kudos
Message 7 of 13
(5,837 Views)

Hi All,

 

The KB Wolfgang mentions (What C Extensions Does LabWindows/CVI 2013 and 2015 Support?) has now been updated, verified, and tested. We have updated the document with a revised definition of "supported." When we say supported in the document, we mean that code using the listed extension will compile, and the extension works with the LabWindows/CVI environment, debugger, and so on. We have marked places where the support status has changed between 2013 and 2015 in red, and have listed the bug ID we have open to address the behavior change. We intend to address the incompatibilities in a future release.

 

Please reply to this thread if you are affected by one of the incompatibilities.

 

Warm regards,

Daniel Dorroh
National Instruments
0 Kudos
Message 8 of 13
(5,592 Views)

Hi David,

 

I like the fact that the document has been updated and even been verified. Interestingly, the related link is on Clang 3.4 extensions (and actually pointing to Clang 3.8) Smiley Wink

 

As you know, my suggested compensation for these incompatibilities are here Smiley Wink

0 Kudos
Message 9 of 13
(5,580 Views)
Hi Wolfgang,

Thanks for the feedback 🙂

-Daniel
Daniel Dorroh
National Instruments
0 Kudos
Message 10 of 13
(5,551 Views)