LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

imaq example in x64 environment of visual studio 2019

Solved!
Go to solution

Hello everyone,

 

 

Currently, I am using C++ in visual studio 2019 to develop the application of imaq related. I can compile and run all the imaq ansi C examples in x86 mode, and the GUI came out. But when I switched the same example to the x64, it can be complied but no error jumped out and no GUI came out. Could anyone have any idea about this. Thank you very much.

0 Kudos
Message 1 of 16
(2,195 Views)

when I run the examples, it seemed that lots of dll files can not be loaded.

=============

x64

===================================

'snap imgplot.exe' (Win32): Loaded 'C:\Windows\System32\ntdll.dll'.
'snap imgplot.exe' (Win32): Loaded 'C:\Windows\System32\kernel32.dll'.
'snap imgplot.exe' (Win32): Loaded 'C:\Windows\System32\KernelBase.dll'.
'snap imgplot.exe' (Win32): Loaded 'C:\Windows\System32\user32.dll'.
'snap imgplot.exe' (Win32): Loaded 'C:\Windows\System32\win32u.dll'.
'snap imgplot.exe' (Win32): Loaded 'C:\Windows\System32\gdi32.dll'.
'snap imgplot.exe' (Win32): Loaded 'C:\Windows\System32\imaq.dll'.
'snap imgplot.exe' (Win32): Loaded 'C:\Windows\System32\gdi32full.dll'.
'snap imgplot.exe' (Win32): Loaded 'C:\Windows\System32\msvcp_win.dll'.
'snap imgplot.exe' (Win32): Loaded 'C:\Windows\System32\ucrtbase.dll'.
'snap imgplot.exe' (Win32): Loaded 'C:\Windows\System32\advapi32.dll'.
'snap imgplot.exe' (Win32): Loaded 'C:\Windows\System32\msvcrt.dll'.
'snap imgplot.exe' (Win32): Loaded 'C:\Windows\System32\nipalu.dll'.
'snap imgplot.exe' (Win32): Loaded 'C:\Windows\System32\sechost.dll'.
'snap imgplot.exe' (Win32): Loaded 'C:\Windows\System32\rpcrt4.dll'.
'snap imgplot.exe' (Win32): Loaded 'C:\Windows\System32\setupapi.dll'.
'snap imgplot.exe' (Win32): Loaded 'C:\Windows\System32\cfgmgr32.dll'.
'snap imgplot.exe' (Win32): Loaded 'C:\Windows\System32\nipalut.dll'.
'snap imgplot.exe' (Win32): Loaded 'C:\Windows\System32\bcrypt.dll'.
'snap imgplot.exe' (Win32): Loaded 'C:\Windows\System32\msvcp140.dll'.
'snap imgplot.exe' (Win32): Loaded 'C:\Windows\System32\vcruntime140.dll'.
'snap imgplot.exe' (Win32): Loaded 'C:\Windows\System32\shell32.dll'.
'snap imgplot.exe' (Win32): Loaded 'C:\Windows\System32\vcruntime140_1.dll'.
'snap imgplot.exe' (Win32): Loaded 'C:\Windows\System32\version.dll'.
'snap imgplot.exe' (Win32): Loaded 'C:\Windows\System32\imm32.dll'.
'snap imgplot.exe' (Win32): Loaded 'C:\Windows\System32\uxtheme.dll'.
'snap imgplot.exe' (Win32): Loaded 'C:\Windows\System32\combase.dll'.
'snap imgplot.exe' (Win32): Loaded 'C:\Windows\System32\msctf.dll'.
'snap imgplot.exe' (Win32): Loaded 'C:\Windows\System32\oleaut32.dll'.
'snap imgplot.exe' (Win32): Loaded 'C:\Windows\System32\kernel.appcore.dll'.
The thread 0x164c has exited with code 0 (0x0).
The thread 0x650 has exited with code 0 (0x0).
The thread 0x8354 has exited with code 0 (0x0).
The thread 0xabc4 has exited with code 0 (0x0).
The thread 0x8944 has exited with code 0 (0x0).
The thread 0x69f0 has exited with code 0 (0x0).
The thread 0x9318 has exited with code 0 (0x0).
The thread 0x1194 has exited with code 0 (0x0).
The thread 0x55f8 has exited with code 0 (0x0).
The thread 0x63c has exited with code 0 (0x0).
The thread 0x4a9c has exited with code 0 (0x0).
The thread 0xaed4 has exited with code 0 (0x0).
The thread 0x48bc has exited with code 0 (0x0).
The thread 0x7158 has exited with code 0 (0x0).
The thread 0xc64c has exited with code 0 (0x0).
The thread 0x1e00 has exited with code 0 (0x0).
The program '[33144] snap imgplot.exe' has exited with code 0 (0x0).

=====================================

x86

''snap imgplot.exe' (Win32): Loaded 'C:\Windows\SysWOW64\ntdll.dll'.
'snap imgplot.exe' (Win32): Loaded 'C:\Windows\SysWOW64\kernel32.dll'.
'snap imgplot.exe' (Win32): Loaded 'C:\Windows\SysWOW64\KernelBase.dll'.
'snap imgplot.exe' (Win32): Loaded 'C:\Windows\SysWOW64\user32.dll'.
'snap imgplot.exe' (Win32): Loaded 'C:\Windows\SysWOW64\win32u.dll'.
'snap imgplot.exe' (Win32): Loaded 'C:\Windows\SysWOW64\imaq.dll'.
'snap imgplot.exe' (Win32): Loaded 'C:\Windows\SysWOW64\gdi32.dll'.
'snap imgplot.exe' (Win32): Loaded 'C:\Windows\SysWOW64\gdi32full.dll'.
'snap imgplot.exe' (Win32): Loaded 'C:\Windows\SysWOW64\msvcp_win.dll'.
'snap imgplot.exe' (Win32): Loaded 'C:\Windows\SysWOW64\ucrtbase.dll'.
'snap imgplot.exe' (Win32): Loaded 'C:\Windows\SysWOW64\advapi32.dll'.
'snap imgplot.exe' (Win32): Loaded 'C:\Windows\SysWOW64\msvcrt.dll'.
'snap imgplot.exe' (Win32): Loaded 'C:\Windows\SysWOW64\nipalu.dll'.
'snap imgplot.exe' (Win32): Loaded 'C:\Windows\SysWOW64\sechost.dll'.
'snap imgplot.exe' (Win32): Loaded 'C:\Windows\SysWOW64\rpcrt4.dll'.
'snap imgplot.exe' (Win32): Loaded 'C:\Windows\SysWOW64\setupapi.dll'.
'snap imgplot.exe' (Win32): Loaded 'C:\Windows\SysWOW64\oleaut32.dll'.
'snap imgplot.exe' (Win32): Loaded 'C:\Windows\SysWOW64\nipalut.dll'.
'snap imgplot.exe' (Win32): Loaded 'C:\Windows\SysWOW64\combase.dll'.
'snap imgplot.exe' (Win32): Loaded 'C:\Windows\SysWOW64\cfgmgr32.dll'.
'snap imgplot.exe' (Win32): Loaded 'C:\Windows\SysWOW64\bcrypt.dll'.
'snap imgplot.exe' (Win32): Loaded 'C:\Windows\SysWOW64\shell32.dll'.
'snap imgplot.exe' (Win32): Loaded 'C:\Windows\SysWOW64\nipal32.dll'.
'snap imgplot.exe' (Win32): Loaded 'C:\Windows\SysWOW64\msvcp140.dll'.
'snap imgplot.exe' (Win32): Loaded 'C:\Windows\SysWOW64\vcruntime140.dll'.
'snap imgplot.exe' (Win32): Loaded 'C:\Windows\SysWOW64\version.dll'.
'snap imgplot.exe' (Win32): Loaded 'C:\Windows\SysWOW64\imm32.dll'.
'snap imgplot.exe' (Win32): Loaded 'C:\Windows\SysWOW64\uxtheme.dll'.
'snap imgplot.exe' (Win32): Loaded 'C:\Windows\SysWOW64\msctf.dll'.
'snap imgplot.exe' (Win32): Loaded 'C:\Windows\SysWOW64\kernel.appcore.dll'.
'snap imgplot.exe' (Win32): Loaded 'C:\Windows\SysWOW64\bcryptprimitives.dll'.
'snap imgplot.exe' (Win32): Loaded 'C:\Windows\SysWOW64\TextInputFramework.dll'.
'snap imgplot.exe' (Win32): Loaded 'C:\Windows\SysWOW64\CoreMessaging.dll'.
'snap imgplot.exe' (Win32): Loaded 'C:\Windows\SysWOW64\CoreUIComponents.dll'.
'snap imgplot.exe' (Win32): Loaded 'C:\Windows\SysWOW64\ws2_32.dll'.
'snap imgplot.exe' (Win32): Loaded 'C:\Windows\SysWOW64\SHCore.dll'.
'snap imgplot.exe' (Win32): Loaded 'C:\Windows\SysWOW64\ntmarta.dll'.
'snap imgplot.exe' (Win32): Loaded 'C:\Windows\SysWOW64\WinTypes.dll'.
'snap imgplot.exe' (Win32): Loaded 'C:\Windows\SysWOW64\WinTypes.dll'.
'snap imgplot.exe' (Win32): Unloaded 'C:\Windows\SysWOW64\WinTypes.dll'
'snap imgplot.exe' (Win32): Loaded 'C:\Windows\SysWOW64\TextShaping.dll'.

0 Kudos
Message 2 of 16
(2,190 Views)

I just two computers installed with LabVIEW and visual studio, and both computer have the same problem. The image ansi examples can not run in x64 enviroment

 

0 Kudos
Message 3 of 16
(2,173 Views)

I have a car, it doesn’t work. Can you tell me why?

What examples, which software have you installed, which versions? Why do you post in the LabVIEW forum when you try to compile a Visual Studio C program?

it would seem that there are no obvious missing dlls, imaq.dll is loaded successfully and Windows does not report missing DLL dependencies but your app rather decides to quit immediately after gdtting control. Why you ask? We haven’t seen the project nor any source code! I refer you back to my first sentence in  my post!

And yes not a picture of it but the actual code files. Also you are aware that Visual Studio allows you to compile as debug version and then set breakpoints in the source code? Try that and set a breakpoints early in your main() function and then follow in single step mode where your program decides to quit and jump to the end of your main function!

 

Rolf Kalbermatter
My Blog
Message 4 of 16
(2,123 Views)

When you go to the car shop and want to have a drive test for the brand new car called imaq. Everything is the newest(LabVIEW 2020, visual studio 2019, imaq 20.5). The sales give you one car called HLGrab, you test it in low speed at 32 mile/h(x32) which works well. Then you want to test it in high speed at 64 mile/h(x64), it failed and you can not run it. You are wondering why, but you still want test this brand and buy this brand car. The sales the give you another test car called HLSnap, but the same problem occur. After you test every car (example) in this shop, so nothing happens. You thought maybe this car shop (computer) is problematic. Then you change to another car shop(computer). Your request is always the same, just want to confirm that if the official examples offered by NI can work in x64 mode. If everything is newest, but the official examples can still not work, how can you integrate the related imaq c functions in your own program?

 

If they are the official examples, the only difference is compiling the x86 and x64, but one works and the other did not.

0 Kudos
Message 5 of 16
(2,090 Views)

@rwe wrote:

 

If they are the official examples, the only difference is compiling the x86 and x64, but one works and the other did not.


I still have no idea which of the many possible examples you are trying, nor which version of the various software you install! So don't try to be smart about this.

 

You have a problem. You want others to help you solve it! Then try to help them to help you, don't just sit there and claim: "It is my d*mn right to be helped and you all should get your lazy ass out of the sofa to do that, while I sit here!"

 

Software development is about finding the reason why it doesn't work, because it generally doesn't work for a zillion possible reason. If you just push the compile button and then post the startup log messages when it doesn't work, without even trying to do any debugging of your own, you should not be surprised if nobody else can help you.

 

There are differences in what DLLs get loaded in both versions but no error message anywhere. Windows 32-bit has a long history of development with a lot of cruft having accumulated in the course of 25 years. With Windows 64-bit Microsoft certainly tried to clean up some of that stuff and that also resulted in old legacy DLLs simply being sacked and the according functionality being now unsupported. As most applications never made use of that functionality since a long time, it is not something you are ever likely to notice about, except when trying to compare startup logs between 32-bit and 64-bit compiled applications. But that difference you noticed is a so called red herring. It says almost for 100% absolutely nothing about why your executable is immediately quitting after starting up.

Rolf Kalbermatter
My Blog
Message 6 of 16
(2,071 Views)

just as I clarified in the 5th floor, I tried EVERY official examples in imaq ANSI C from name "color" to name "snap" in both x64 and x86 modes. All of them can work in x86, but all failed in x64. I also noted that every software was newest(LabVIEW 2020, Visual Studio 2019, IMAQ 20.5). I have listed all needed information, but you ignored them.

 

It is not my program which came from NI official examples. If NI official examples still failed, how can these functions be integrated into other projects? I am not an expert in LabVIEW, so stupid question is common for fresh. But try to solve problem, not to educate. If you think it's wasting time, it's fine.

 

I did this post just want to confirm this someone has the problem because I have tried the official examples in different 3 computers which all installed LabVIEW 2020, Visual Studio 2019 and IMAQ 20.5. I want to confirm whether it is my personal problem or many others have the same situation, so it is possible to be NI's faults. If it is, hope NI can solve it. 

 

I admired those who are the volunteer in this forum, but my problem is not a personal problem, the problem is from NI itself. If no NI customer service is offered here, so I will call them tomorrow because the products from NI were bought.

 

If it is NI official program, why should I debug it? Should not NI technician or engineer make sure it can work? Why does NI not offer the users this useful information in the manual? I have detailly went through the imaq manual already, but not find this problem.

 

Just you mentioned in the last paragraph, it indeed is easy to have this problem. I am also surprising to see the imaq ansi C examples were all almost developed more than 10 years ago. It know it is costing tp update the program. But I can say, it is official program, please make sure it can work.

0 Kudos
Message 7 of 16
(2,053 Views)

I have no idea what is the 5th floor you mention where you claim you provided all the information. And I never saw anything about LabVIEW 2020 before, which I think is unrelated here, nor anything about IMAQ 20.5.

 

Considering the version number you probably mean the Vision Acquisition Software 20.5, which is not would be more accurate than IMAQ 20.5. There used to be an NI-IMAQ software, which is legacy software and an IMAQ Vision Software which NI now calls NI Vision Development Module.

 

And you still are posting to the LabVIEW forum about a problem with C programming. So you have LabVIEW installed but for whatever reason try to use the C applications? Why is that? What is the purpose of that?

 

Why should you debug a program? Maybe because you want it working? Just a guess really. But then since you have LabVIEW installed and probably want to use LabVIEW instead, it may be indeed not what you wanted? Why even bother to compile the C program examples?

Rolf Kalbermatter
My Blog
Message 8 of 16
(2,032 Views)

You used the car as the metaphor, so did I in the fifth floor.  I mentioned LabVIEW 2020 and IMAQ 20.5 to show that I should have all the files including header, lib, or dll to run the imaq ansi C official example code.

 

In the past, our group used to develop control programs using LabVIEW. But with the increasing demand of complex functions and requirement of high speed acquisition, our group decide one of LabVIEW programs changes to C based program, and we have successfully worked it out in x86 (32bits). However, we have higher ram demand, so we want modified it which can work in x64(64bits), then problem came. We traced it, and found it may relate to the imaq x64 ansi C function. So I tried to test the official ansi C examples, that's this topic came from.

 

I know someone may think if we can do a good optimization of ram management, x86 c based program can be enough, but I do not have a solid background of computer science, so we just want the program can work instead of caring the computing cost.

 

I saw imaq has the x64 lib files in LabVIEW folder which should be compatible in x64 environment. I searched key words in NI forum, and there is no similar question, but I do believe imaq x64 ansi C should work as more than ten years ago someone has asked questions about x64 development. The reality is I am still  facing this problem. I tried my best to figure it out before this post  including testing all the official examples, testing on 3 computers, but no any clues.

 

The final problem is not my personal project, but it is about why NI official IMAQ  ANSI C examples can not work on my 3 computers in x64 mode. This is not a technique support (I mean charged here), but more like a basic customer service as I tried and believe it is not the problem of configuration, or missing files in my 3 computers. If I need to call for the customer service to solve this, I apologize to post here.

 

  

0 Kudos
Message 9 of 16
(2,013 Views)

@rwe wrote:

You used the car as the metaphor, so did I in the fifth floor. 

 

  


Do you mean message #5?   I'm guessing you are not a native English speaker and are using a bad translator to translate your language into English.

0 Kudos
Message 10 of 16
(1,993 Views)