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

Fatal Run-Time - Unknown Fault - on any CVI program close

$
0
0

I have been trying to track down a few what seem like phantom Fatal Run Time Errors on my program closes.

 

I am running LabWindows/CVI 2010 Full 10.0.1 (419)

 

I originally posted here -> http://forums.ni.com/t5/LabWindows-CVI/EasyTab-ConvertFromCanvas-memory-leak/m-p/3084769#M69465

As I thought this was related to tabs, where my resource tracker shows 'unclosed' resources.

 

Now I am opening a different program and have found that even though I put my return 0; at the top of my main loop, I still get a fatal run time error.

 

The error is exactly:

FATAL RUN-TIMe ERROR

 

Unknown source position, thread id 0x00001BB4 

The program has caused a 'Unknown' fault at 0x748A4F11

 

This occurs every time I run my program in the CVI IDE.

There are no allocated resources in my resources window.

Searching for either address in my map file brings no results.

 

Thanks,

Nick

 


Invalid use of '__declspec'

$
0
0

Hi, I am trying to compile a formerly builded project without changing anything. But I get the following error for function declarations in the header file.

 

 

int DLLSTDCALL DLLEXPORT Test_InitDevDll (int invertByteOrder);


"test.h"(36,16)   Invalid use of '__declspec'.

 

 

What can be the reason of this error?

 

 

Network-Shared Variable - 1 subscriber / variable?

$
0
0

I have been reading into the NSV Subscriber example that comes with CVI.  My question is: does each variable require 1 subscriber, or can 1 subcriber be used to read multiple NSV?  Better yet, can anyone explain to me how NSV read and write can be done?

LabWindows/CVI 2013 SP2 crashes when I call a VB dll dynamically

$
0
0

A customer using LabWindows/CVI 2013 to call a VB dll, it can call the function in the dll successfully, but leads the LabWindows/CVI Crashing when leaving the CVI.

 

 The CVI will crash after finish the last line of code. If I remove the 6th line "#define Test", the code runs ok since it will not call the function in dll. If I recover the 6th line, the code will get Error as belowError信息.PNG

 

The code is shown below.

 

 



#include <stdio.h>
#include <windows.h>
#include <ansi_c.h>
#include <cvirte.h>

#define TEST

typedef struct {
unsigned int size; //0+4
unsigned short vid; //4+2
unsigned short pid; //6+2
unsigned int friendlyNameSize; //8+4
unsigned char friendlyName[512]; //12+512
unsigned int serialNumberSize; //524+4
unsigned char serialNumber[512]; //528+512
unsigned int locked; //1040+4
unsigned int usbPrintPathSize; //1044+4
unsigned char usbPrintPath[256]; //1048+256
unsigned int usbStackPathSize; //1304+4
unsigned char usbStackPath[256]; //1308+256
unsigned int usbStackAddress; //1564+4 = 1568
}ZUsbPrinterInformation;


typedef unsigned int (* DLLFunction)(const unsigned int includeLocked,
unsigned int *deviceCount,
signed int *changedSinceLastEnumeration);

int main()
{
HINSTANCE ZusbLib = NULL;
const unsigned int index=1;
int result;
DLLFunction DLLFAddress;

unsigned int *Count;
signed int *Changed;

ZusbLib=LoadLibrary("ZUSB.DLL");

if (ZusbLib == NULL)
{
printf(" ** Failed to invoke Dll ** \n");
getchar();
return -1;
}

printf(" ** Success to invoke Dll ZusbLibx=%x ** \n",ZusbLib);
DLLFAddress = (DLLFunction)GetProcAddress(ZusbLib, "ZUsbEnumerateUSBPrinters");

if (DLLFAddress == NULL)
{
FreeLibrary(ZusbLib);
printf(" ** ZUsbEnumerateUSBPrinters is not existed ** \n");
getchar();
return -1;
}

printf(" ** Success to excute ZUsbEnumerateUSBPrinters ** \n");
#ifdef TEST
result=(DLLFAddress) (0,&Count,&Changed);

printf(" USB countu=%u\n",Count);
printf(" Changed count=%d\n",Changed);
#endif
if(ZusbLib)
{
FreeLibrary(ZusbLib);
ZusbLib=NULL;
printf("Free ZusbLib");
}
printf("End%d\n",index);
getchar();

}

 

Acquire values & store in an array

$
0
0

Hi guys,

 

Once my program execute, it constantly get values from an output.

 

1) How do I store this values in an array? For example, I may need to acquire 10 values every few ms & store them in an array.

 

2) Once array is full, I need to find the max out of all the values for display.

 

3) After which, clear the array & repeat the steps.

 

Any example I can refer to?

Many Thanks.:cathappy:

 

find matching parenthesis

$
0
0

Is there a shortcut key in the source code IDE to move the cursor to the matching opening or closing parenthesis ? Can't seem to figure out how to do this. If I position the cursor on a "{" for example, I want to find the matching "}". Is there a way to do this ?

Set Gain GigE Camera

$
0
0

Programatically Set Gain GigE Camera

LabWindowsCVI 2013
NI_IMAQdx 4.3
Camera Basler acA640-90gm

 

I've tried two different approaches for setting the raw gain programatically and neither appear to work.

 

I can set the raw gain just fine in NI-MAX, but can only see how to save a single camera configuration, typically "cam0". I can rename the one camera config, but there is still only one.

 

I can also save the icd file as another name in NI_MAX, and with this method, it looks like I am saving the config with another name, but I can only open the most recent one saved, and NIMAX only ever shows the most recent one saved.

 

The other method attempts to set the gain programatically from CVI with a call to imgGetCameraAttributeString (gSessionID, "RawGain", &gain, sizeof(gain)).  That  returns error 1074397163 "The passed in interface or session is invalid". I get the same error whether I do "int gain;" and pass "&gain", or "char gain[120} and pass "gain".

 

Thank you,

d

Setting properties of printing in Excel

$
0
0

Hello,

 

I am working with Excel through ActiveX and I am trying to set the properties of printing an Excel file to PDF file. I managed to print the document but I cannot change the default properties. I write data in many columns and when I print the document, all the columns are not printed. Specifically I want to scale the document to print. This is how I am trying:

 

 

SetPrintAttribute(ATTR_EJECT_AFTER, 0);

SetPrintAttribute (ATTR_PRINT_AREA_WIDTH, VAL_INTEGRAL_SCALE);

SetPrintAttribute(ATTR_EJECT_AFTER, 1);

 

error_print_excel = Excel_Worksheet_PrintOut (ExcelWorksheetHandle, NULL, CA_DEFAULT_VAL,
CA_DEFAULT_VAL, CA_DEFAULT_VAL,
CA_DEFAULT_VAL, CA_DEFAULT_VAL,
CA_DEFAULT_VAL, CA_DEFAULT_VAL);

 

Can anyone help me? Thanks in advance.


win 7 minimize and restore error

$
0
0

Hello,

 

This error is somewhat similar to another just recently mentioned on this board here: http://forums.ni.com/t5/LabWindows-CVI/Window-Minimize-and-Restore-issue/td-p/3085541, but not quite the same.

 

When running an application on Windows 7 created by LabWindows/CVI 2012 SP1, I have the problem of after the main execution window is minimized, that when it is restored the application is not responsive and I get the Windows spinning donut of doom. The application is sending commands to hardware via a USB serial port and waiting for responses. It all works fine, and many times even when minimizing and restoring the main window to open Notepad to write something down.

But sometimes, when restoring the main application window, it just never responds again. I have to go to Windows Task Manager to kill it.

 

In the main app, once connected to the hardware, it is reading data from the hardware to display as a graph on the screen based on a 1-10 second timer trigger.

 

Thanks for any help,

Rich

LabWindows/CVI 2013 SP2 stops working when I try to open a file using the project file menu.

$
0
0

I have windows 7 on my system and sometime late last year I starrted getting a Windows dialog telling me that LabWindows/CVI has stopped working when I try to open a file from the project file menu.  I also get an error when I run a project debug mode and use a selectFilePopup in the code.  The error says, "The program has suspended execution at address 0x75D5025E.  No source line information is available."  I've tried removing and reinstalling CVI to no avail.  Any suggestions?

ListType as parameter of a DLL-function from C#

$
0
0

I have a dll written in CVI, I should use the functions in C#. My problem is, that in some functions there is a list (ListType) as parameter.

 

CVI function definition:

int DLLEXPORT InserInList(ListType listSendRequest,char*cRequest)

Code in C#:

 

[DllImport("DLL_Test.dll",EntryPoint="InsertInList",CallingConvention=CallingConvention.Cdecl)]publicstaticexternintInsertInList(List<RequestItem> listRequest,stringRequest);

[
DllImport("DLL_Test.dll",EntryPoint="InsertInList",CallingConvention=CallingConvention.Cdecl)]publicstaticexternintInsertInList(ArrayList listRequest,stringRequest);

I've tried two kinds of implementation in C#. With the first one an exception will be thrown, that generic types can not be marshaled. The second option runs at least without an error through, but the list in C# stays empty. Is there any chance to pass a list as a parameter to a dll-function?

 

Thanks.

configure active antenna

$
0
0

Hi,

I have an antenna attached to my 5601. how do i configure it in my code as active source of RF?

 

Thanks.

 

 

 

 

 

Question for using PXIe-8135 with Linux and GNU Radio

$
0
0

Hello readers.
I am starter with NI-PXIe and NI-USRP.
I have some questions for you.

1. Can I use NI-PXIe-8135 with GNU Radio in LInux?
2. Which one, LABVIEW, LABWINDOWS/CVI, GNU radio, is more suitable program for using PXIe-8135 connected with NI USRP-2943R?

I am very new at theses things.
Please give me any comments.
Thx

Modbus exemple of communication with a security automate

$
0
0

Hi,

 

  I had to communicate with a security automate (Sick),

 

  i'm wondering if there is a Simple code exemple (cvi) , that connect read write  from and to this automate (via modbus).

 

Regards,

 

sasa 

return value =-1074135031[0xbffa0009]

$
0
0

Hi,

   My setup is configured with ivi scope driver in Ni-Max an when i execute my cvi code i get struck in the ivi function

The error message is

Function Iviscope_init(return value==-1074135031[0xbffa0009]

Kindly reply at the earliest to solve this issue


DllMain endless loop with serveral Dll files

$
0
0

Actually i am developing a Teststand project, which loads 3 dll files, compiled in LabWindows CVI.

Each dll ows a "DLLMain" function as an entry point and all 3 dlls are loaded during execution in TestStand.

 

Since 2 days i get a very strange behaviour of its execution:

In some functions it appears that my source code runs finde for some instructions, but suddenly the DLLMain entry point is called again.

Further the executions doesn't run onward again, but then the DLLMain functions of my other dlls are called.

This is done as loop, and no "normal" code is executed anymore, it loops in DllMain on dll A, then DllMain on dll B, then A again, then C... very randomly.

Some days ago my project run fine without issues, but i have no idea what causes this now.

 

I use the gerneated DLLMain and DLLEntryPoint by LabWindows, so i haven't done any changes to those.

By the way, the DllMain function will be called with DLL_THREAD_ATTACH and DLL_THREAD_DEATTACH in those loops, in each dll.

 

 

I am very new in Dll programming, for sure it is something i don't notice.

Evaluation download for labview .vi editor 64 bit?

$
0
0

I am trying to download .vi file editor for LabView. I am using windows 7, 64 bit os. I have installed LabView Runtime Engine 8.6. So please anybody can suggest from where I need to download LabView Evaluation editor. 

ComWrt randomly send twice the same string

$
0
0

Dear all,

 

I have recently ported to a Windows 7 machine an old program which communicates with an Arduino board through (virtual) serial port; the problem is that sometimes (once every about 10 times) the ComWrt function sends the same command to the Arduino board twice; I repeat: in debug mode I "step over" to a call to ComWrt once and I see on the serial line that the string is sent twice! I tried many combination of computers/cvi versions and it seems that the culprit is Windows 7, in fact the exact same program running in two different old xp machines does not show this behaviour and ComWrt seems to run smoothly. Any ideas?

 

Thanks and best regards!

 

Nicola

How to make an array with ActiveX Excel using Excel_RangeSetValue2?

$
0
0

Hello,

 

I want to make an array on Excel. For that, I'm using two functions : Excel_WorksheetGetRange and Excel_RangeSetValue2.

I write the array on Excel file but only the first case of the array is copied.

 

Here, a part of my program :

 

char * DataToWrite = {"A", "B", "C", "D"}

char cCell[10];
VARIANT             vCell, Data;

ExcelObj_Worksheet hWorksheet;

ExcelObj_Range      hRange;

 

  ...

  CA_VariantSetCString (&vCell,cCell);        //cCell = A1:A4
  Excel_WorksheetGetRange (hWorksheet, NULL, vCell, CA_DEFAULT_VAL, &hRange);
  CA_VariantSetCString (&Data,DataToWrite );
  Excel_RangeSetValue2 (hRange, NULL, Data);

 

 

Here what I obtain when I'm compiling on Excel file :

A

A

A

A
 

labview runtime engine

$
0
0

I am running CVI 2012. In the last few days whenever I start CVI, it INSISTS on wanting to install NI LabVIEW Run-Time Engine 8.2.1. I don't know how to load this element. If I just cancel out of the install attempt a few times, then CVI starts normally, and everything seems to work. I have also run the NI update manager, it installed a new LabVIEW runtime module, but this DID NOT fix the problem. I also don't know why it wants to install the LabView Run-Time engine. I am not running LabVIEW. I have reviewed some related posts, but none seem to be relevant to my issue. Please advise course of action to fix. Thanks !!

Viewing all 5334 articles
Browse latest View live


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