Quantcast
Channel: LabWindows/CVI topics
Viewing all 5339 articles
Browse latest View live

PeakDetector output arrays

$
0
0

PeakDetector function search an input array for peaks (or valleys) and returns 3 arrays

  • peakLocations
  • peakAmplitudes
  • peakSecondDerivatives

How are the peaks listed?

I mean: I think that every peak has the same position in all the 3 output arrays:

  • peak #1 - peakLocations[0], peakAmplitudes[0], peakSecondDerivatives[0]
  • peak #2 - peakLocations[1], peakAmplitudes[1], peakSecondDerivatives[1]
  • ...

but how are the peaks listed?

Ordered by increasing peakLocations?

Ordered by increasing or decreasing peakAmplitudes?


Need example code to use" LStrHandleArray" type structure

$
0
0

I have created a LabVIEW VI to perform sorting on a 1 Dimensional string arry . The only Input\Output of the function is a string array. Once the function is converted to DLL to be accessed from  CVI, I found that the string is declared as structure with double pointer to access the array content. I am in need of example code as I am not well versed with such complex C structure. Attaching the Lib, Header and DLL files here.

 

A simple example to initialise and display my string array using the function named "Test(LStrHandleArray *StringArrayIn, LStrHandleArray *StringArrayOut); " will be appreciated.

 

Thanks in advance,

Manu Mohan

C.L.A

TDMS running parallel instances from same AI Handle

$
0
0

HI all

Senario:

i have a AI handle that is recodring multiple channels. i would like to record one set of channels with one TDMS call , and than another TDMS call to record a different set of channels. Can this be done? . The two TDMS functions will be running at different time but will be running at the same time.

VISA Error: 1073807195

$
0
0

Hola,

trabajo con Labwindows CVI. En mi programa intento comunicarme con un LCR 8101G vía GPIB con las funciones que ofrece VISA; cuando envío:

viOpen(defrm, "GPIB0::6::INSTR", 0, 0, &LCR8101G_id);

me sale el error: 1073807195. Interfacetyp es valido, pero el número de Interface no está configurado.

A que se debe este error?

Gracias por toda ayuda.

Abel

CVI 2013 SP1 crashes when opening file

$
0
0

LabWindows 2013 SP1 has suddenly stopped functioning on my PC.  Any time I try to open a file, either by clicking Browse on the welcome page, clicking the File Open icon, or selecting File - Open or File - Save As from the main menu, I get a popup Windows message that says "LabWindows/CVI 2013 has stopped working".

 

Clicking on "Show problem details" shows this:

 

Problem signature:
  Problem Event Name: BEX
  Application Name: cvi.exe
  Application Version: 13.0.1.201
  Application Timestamp: 52d6eeab
  Fault Module Name: CVI.dll
  Fault Module Version: 13.0.1.201
  Fault Module Timestamp: 52d6eea1
  Exception Offset: 00a4ecd0
  Exception Code: c0000409
  Exception Data: 00000000
  OS Version: 6.1.7601.2.1.0.256.48
  Locale ID: 1033
  Additional Information 1: 417a
  Additional Information 2: 417afcd3ce602885d582521ac0f0405e
  Additional Information 3: 39bb
  Additional Information 4: 39bb24ea28d79f3c45538f96792cdc59

 

These values are always the same.

 

I am running Windows 7 Professional, SP 1.

 

 

Ring slide changes on panel resize

$
0
0

Hi all!

 

I start the app with a maximized panel. When I bring the panel to normal size using the minimize button, a ring slide with three positions changes his state to the topmost. The underlaying variable who's representing the ring slide position is not touched (so the callback is not executed). Everything works fine until I read the position of the ring slide in a different callback. How can this happen? How can I prevent the controls of beeing changes while a simple resize of the panel?

 

Best regards,

Thomas

[CVI2013] DeleteFile() error

$
0
0

Hello all,

 

I'm using the DeleteFile () function to delete few files. The problem is when I call this function, i get this error :

Error -6   "Attempted to make an inoperable control the active control"

Here is the calling : 

DeleteFile (tcCheminBase);

tcCheminBase = "C:\file.mdb" and the file exist for sure, I check it. 

 

So I get these errors windows : This one when I debug the code 

Error_DeleteFile.png

 

and this one when I Test the UIR

Error_DeleteFile2.png

 

Can any one help me to solve that please ? 

 

Best regards, 

ansi c best practices

$
0
0

I've been programming in CVI for awhile and have a computer science background. 

 

I'm looking to see if someone has some books, sites that talk about ansi c, specifically c99, best practices.  

 

 


How can I debug memory when using CVI w/ visual studio?

$
0
0

Hello.

 

I'm trying to use CVI with visual studio 2010.

When I use CVI alone, "resource tracking" was so nice to debug memory.

However, when using Visual studio 2010, how can I debug memory?

Common memory debugger for vs2010 such as VLD (vlsual leak detector) doesn't work with cvi project.

 

Thank you.

Distribution Setup Installation Fail

$
0
0

I am currently using the distribution feature inside CVI LabWindows 2013 for a test procedure that involves various lab equipment (oscopes/sensors/power supplies). I have managed to include all the proper drivers, so I think, inside of the distribution. When I run the final setup.exe file on a different machine, I am able to install the entire test procedure. However, at the very end of the installation, I am given a message that says that the installation failed to install and prompts me to restart the machine. When I restart the machine, the test procedure is successfully installed as a program on the machine and the proper program files for the test procedure is also on the machine. The test procedure will then open up and function properly. I am just wondering why this fail message comes up at the end of the installation if everything seems to be fine after the machine restart. This test procedure is for customers so I would like to remove this "fail" message if possible.

using niimaq, program compiles, but when I run it, I get errorcode -1074396857, 32 bit device operating on 64 bit OS. What I am doing worked on XP.

$
0
0

I am using framegrabber 1428 with windows 7 64 bit.  What do I need to set up in CVI to get this going?  MAX provides me with a good image (camera link imager) with signed 16bit 60 frames per second.

CVI 2010 - problem running MIDL compiler

$
0
0

I have a problem in CVI 2010 when it tries to run the MIDL compiler. When CVI runs the compiler, it displays the message:

 

 Error generating type library.  Midl.exe failed while compiling the odl file used to create the type library.

 Note: The error indicates that the odl file has unknown types. This error is possible when

 functions with non-standard types are exported using the export qualifier method from files in

 release configuration that have not been recompiled during the build process. You can mark all

 files for recompilation and repeat the build. To avoid this situation, it is recommended that

 you export these functions using the include file method.

 Use the generated odl file "c:\TEMP\TEST\Modules\3010\3010CVI\CVI2010\af3010_32.odl" with the command line:

 c:\program files (x86)\national instruments\cvi2010\sdk\bin\midl.exe "c:\TEMP\TEST\Modules\3010\3010CVI\CVI2010\af3010_32.odl" /win32 /mktyplib203 /tlb "af3010_32.tlb" /Ic:\program files (x86)\national instruments\cvi2010\sdk\include /cpp_cmd c:\program files (x86)\national instruments\cvi2010\bin\preprocessor.exe

 to see what errors midl.exe reported.

 

When I run the command-line, it displays the following:

 

midl : command line warning MIDL1009 : unknown argument ignored "files"
midl : command line warning MIDL1009 : unknown argument ignored "(x86)\national"

midl : command line warning MIDL1009 : unknown argument ignored "instruments\cvi2010\sdk\include"
midl : command line warning MIDL1009 : unknown argument ignored "files"
midl : command line warning MIDL1009 : unknown argument ignored "(x86)\national"

midl : command line warning MIDL1009 : unknown argument ignored "instruments\cvi2010\bin\preprocessor.exe"
Processing c:\TEMP\TEST\Modules\3010\3010CVI\CVI2010\af3010_32.odl
midl : command line error MIDL1004 : cannot execute C preprocessor c:\program

 

This clearly indicates that there are missing " marks round the arguments and when I add these to the command line, it works fine, so it appears that CVI is not quoting the arguments correctly iwhen it runs the MIDL compiler.

 

The strange thing is that this only happens on a new PC that has recently been built. I have another Win7/64-bit system with exactly the same version of CVI 2010 which works fine. I have also checked the CVI2010 folder contents (recursively) on both PCs and they are identical, so there must be some difference in the configuration to cause this.

 

 

Rob.

Set a background graph for a strip chart

$
0
0

Hi,

Is there anyway to set a background graph on a strip chart? I tried to set the graph to be transparent,

but it always covers the chart if I put it on.

Thanks

Set a picture as background on a strip chart

$
0
0

Hi,

I try to set a picture under a strip chart, but the picture always covers grid area of the strip chart. 

Anybody knows how to solve this issue?

Thanks 

 

How to read 5000bytes using CVI

$
0
0

 

I want to read more number of data bytes from com port which is sent by microcontroller in my test board. I am using CVI to read all bytes and log the data. I have set time out as 5s. Input queue = output queue = 32767, baud rate = 38400. First I send a command to micro requesting data from it, then i read the bytes sent. Below is the code. when i am sending command to micro, it is receiving and send the bytes, but CVI is not reading properly. Below is the code.

 

bytes_sent = ComWrt (comport, send_data,(No_of_CAN_FD_bytes_Ecu2+6));
bytes_read = ComRd (comport, read_data, (No_of_CAN_FD_bytes_Ecu2+6));
bytes_read = ComRd (comport, read_data,(No_of_CAN_FD_bytes_Ecu2+6));

 

Can anyone help me??


saving jpeg from the web

$
0
0

I am trying to save images from web pages to a local drive

i have tried using the inet.fp and can successfully load the jpeg from a url to a panel containing an activex webcontroller item. The jpeg is displayed correctly using : 

 

GetObjHandleFromActiveXCtrl (phMap2, pMap2_WEBBROWSER,&webHandle);

Fmt (strUrl, "%s<%s/%i/%i/%i%s","http://tile.openstreetmap.org",zl, x, y, ".png");

inet = INET_IWebBrowser2Navigate (webHandle, NULL, strUrl, CA_DEFAULT_VAL, CA_DEFAULT_VAL,
CA_DEFAULT_VAL, CA_DEFAULT_VAL);

 

using the following command i can save the file but am always prompted with the file save as pop up

 

INET_IWebBrowser2ExecWB (webHandle, NULL, INETConst_OLECMDID_SAVEAS,
INETConst_OLECMDEXECOPT_DODEFAULT, CA_VariantNULL(),
&vOut);

 

is it possible to fix the file path and filename so this process can be automated ? or is there a better way of doing this ?

tooltip multiline error

How to preserve panel/controls look across smaller-medium-larger display font changes done through a Personalize window of Windows OS?

$
0
0

Hello,

My application uses edit, numeric, ring and other controls with control/label strings mostly made of EditDialogMetaFont size=11 (all optimized for smaller font setting in a Personalize window of Win OS). When user changes the font setting to for example medium the font of all labels and controls changes to size=13 and all panel labels are misaligned with some labels even extending panel margins and hence become partially visible. How to cope with this situation please?

Thanks,

Martin M.

How to create a movie .avi and save images in that movie with labwindows/CVI ?

$
0
0

Hi,
I am writing a labwindows/CVI 2012 code that drives a camera using the Imaqdx functions. I need to record a sequence of grabbed images as a movie .avi.
I don't understand how to use the imaqCreateAVI function or the imaqWriteAVIFrame function.

An example of such a labwindows/CVI program showing how to use these two functions would be very helpful. Does such examples already exist ? if yes where ? if no, could somone give me some tips ?
How can I write the images grabbed with the camera directly in the movie without saving the whole images sequence ?
Thanks for your help.

LabWindows 2015 warnings

$
0
0

Hello all,

I just received CVI 2015 and I'm trying to recompile one of my projects with it. I receive some new warnings. Some justified, others less so. Yes, I know I can make error messages disapear, but I rather just fix them !

 

First one is that whenever I use #include <windows.h> I get the following:

 

 WaveFile.c - 5 warnings
      7, 1   In file included from c:\Users\dargaud\Devel\Sodar\Sodar2016\Source\WaveFile.c:7:
  "Windows.h"(213,1)   In file included from C:\Program Files (x86)\National Instruments\Shared\MSDTRedistributables\SDKHeaderFiles\8.1\windows.h:213:
  "windef.h"(24,1)   In file included from C:\Program Files (x86)\National Instruments\Shared\MSDTRedistributables\SDKHeaderFiles\8.1\windef.h:24:
  "minwindef.h"(182,1)   In file included from C:\Program Files (x86)\National Instruments\Shared\MSDTRedistributables\SDKHeaderFiles\8.1\minwindef.h:182:
  "winnt.h"(5320,19)    warning: cast from function call of type 'LONG' (aka 'long') to non-matching type 'PVOID' (aka 'void *') [-Wbad-function-cast]
  "winnt.h"(5345,19)    warning: cast from function call of type 'LONG' (aka 'long') to non-matching type 'PVOID' (aka 'void *') [-Wbad-function-cast]
  "winnt.h"(8682,19)    warning: cast from function call of type 'LONG' (aka 'long') to non-matching type 'PVOID' (aka 'void *') [-Wbad-function-cast]
  "winnt.h"(8693,19)    warning: cast from function call of type 'LONG' (aka 'long') to non-matching type 'PVOID' (aka 'void *') [-Wbad-function-cast]
  "winnt.h"(8704,19)    warning: cast from function call of type 'LONG' (aka 'long') to non-matching type 'PVOID' (aka 'void *') [-Wbad-function-cast]

 

Then the following pragma does not seem to work anymore:

            #pragma DisableUninitLocalsChecking

Still gives me a warning later on:

  365, 25    warning: variable 'Wave.Data.Mono16' may be uninitialized when used here [-Wuninitialized]

 

Also the following code now gives me a warning:

 

void OutputLogMsg(const char *fmt, ... ) {
   ...
   va_start( str_args, fmt );
   Nb=vsnprintf(Msg, 1022, fmt, str_args);
66, 29    warning: format string is not a string literal [-Wformat]

Reading around I apparently need to use the following:

__attribute__((__format__ (__printf__, 3, 0)))

But it generates:

  42, 16    error: 'format' attribute parameter 2 is out of bounds

Viewing all 5339 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>