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

NI-VISA vs HID detection

$
0
0

Hello, hello,

OK, not really a CVI question, but here goes...

 

I have a custom USB device for which I defined a custom driver with the VISA wizard. On one version of WinXP (sorry, this stuff doesn't work on Win10, I gave up) it shows as a [NI-VISA USB devices][Simple HID Device Demo] and it gets detected fine by VISA and MAX.

 

On another WinXP, it shows as two separate HID devices and doesn't work.

 

I've tried uninstalling the drivers, reinstalling VISA, etc, but it still doesn't work. Any idea ? I think some other driver is grabbing it but I can't tell what (libusb ? libhid ?)

 

Thanks


CVI Network Streaming -- Bidirectional communication between 2 applications?

$
0
0

I'm looking at using CVI Network streaming to pass data between a master application and a slave that would connect to a device under test.  Working with the cnsWriter/cnsReader samples in CVI, I can get communication to go one direction only -- either from master to slave, or from slave to master.  However, when trying to enable both streams simultaneously, I keep getting errors saying that an application is already streaming to an endpoint in the specified context.  

 

Master code to open writing stream to slave reader:

CNSNewScalarEndpoint("ni.dex://127.0.0.2:cvi_writer/writer", "//127.0.0.2/CommandReader", CNSTypeInt32, 1000, 0, CNSDirectionWriter, CNSWaitForever, 0, &WriteEndpointID);

 

Corresponding code in slave to connect as reader:

CNSNewScalarEndpoint("CommandReader", "", CNSTypeInt32, 1000, 0, CNSDirectionReader, CNSWaitForever, 0, &ReadEndpointID);

 

Slave code to open a writing stream back to the master application:

result = CNSNewScalarEndpoint("ni.dex://127.0.0.5:cvi_writer2/writer2", "//127.0.0.5/DataReader", CNSTypeInt32, 1000, 0, CNSDirectionWriter, CNSWaitForever, 0, &WriteEndpointID);

 

And Master code to connect to data stream from slave as a reader:

result = CNSNewScalarEndpoint("DataReader", "", CNSTypeInt32, 1000, 0, CNSDirectionReader, CNSWaitForever, 0, &ReadEndpointID);

 

Is it possible for an application (or 2 simultaneous applications) to have both writer and reader streams active at the same time?

 

Thanks!

copy menubar item from one menu to another

$
0
0

I have a menu created in my UIR file.  In the same UIR (or hypothetically another), I want to programmatically copy a menubar item to the other.

 

I'm not seeing a DuplicateMenuItem or similar function.  Am I missing something?  Surely there's a way to do this.

CVI 2017 The program has caused a 'General Protection' fault.

$
0
0

Function A calls function B which calls a function in a DLL.

The DLL function returns to function B.

When Function B tries to execute its return statement, I receive the GP message.

 

I am using the debugger to step through the source code instructions so I know that the message appears at the return.

I have commented-out everything between the call to the DLL function and the return.

The problem does not occur when I skip over the DLL function call.

The address where the fault occurs is not within the address space of any module listed in the Modules window.

 

Can anybody give me further suggestions of what to try.

Thank you.

Missing #endif

$
0
0

Hello Everyone,

 

when I call include third part head file,the below error is occurred when I try to build the project.

 

I used the  CVI 2012.

Multiple Versions of cvirte.dll - Compatibility Question

$
0
0

I have LabWindows/CVI 2009 version 9.1.0 (427) installed on my machine.  However, I have two versions of cvirte.dll.  One version is 9.1.0.427, and the other is 9.1.1.450.

 

Somehow, 9.1.1.450 got onto my machine; maybe when I installed other NI products.

 

My question is this: does it matter which of these two versions of cvirte.dll that I distribute with my applications built with with LabWindows/CVI 2009 version 9.1.0 (427)?  Or should I stick with cvirte.dll version 9.1.0.427, since it matches my compiler version?

 

Thank you.  I'm actually delaying a software delivery until I can find out for sure what I should do.

Error in communicating with Spectral Measurement Toolkit

$
0
0

I get the following error when SmtCreateHandle function is called

Error code xFFFFAFE2: Function not found in nismt.dll (invalid DLL version?)

 

Looks like appropriate version of nismt.dll has to be used.

How to resolve the error?

How to use DebugView with Labwindows CVI ?

$
0
0

Hi all,

I have to PC (under Seven Pro 64bits) with Labwindows 2012 installed on both.

I wrote a little program which send a debug message when I click on a button.

The code is {DebugPrintf("....")} very simple of course !!!

But I don't understand why I can use correctly "DbgView.exe" on a PC but not on the other ?

On one I see correctly debug message but on the other one nothing in the log window.

For information : Settings in DbgView.exe are same on both PC and I use only my Program in release mode.

 

An other information : I can see messages in labindows CVI "debug window"

 

Could you help me ?

 

Best Regards,

 

Nicolas


ATTR_CTRL_MODE Fonctionne pas/ Comment utilisé

$
0
0

Bonjour, j'essai d'utiliser l'attribut ATTR_CTRL_MODE mais a chaque fois, sa n'a aucun effet.

In mon GUI, j'ai 1 numeric et 1 String.

 

Sur un clic de checkbox je veux changer le mode  :  Indicator -> Hot.

 

Voici un code  :

void xxxxxxx

{

  GetCtrlVal(PanelHandle2, PANEL_2_CHECKBOX,&status);      
   if(status==0)
    {

    SetCtrlAttribute(PanelHandle2, PANEL_2_STRING,ATTR_CTRL_MODE ,VAL_HOT);
    SetCtrlAttribute(PanelHandle2, PANEL_2_NUMERIC_4,ATTR_CTRL_MODE ,VAL_HOT);

 

    }

 

else {

       SetCtrlAttribute(PanelHandle2, PANEL_2_STRING,ATTR_CTRL_MODE ,VAL_INDICATOR);

      SetCtrlAttribute(PanelHandle2, PANEL_2_NUMERIC,ATTR_CTRL_MODE ,VAL_INDICATOR);

    }

 

 

}

Est ce que c'est correcte ?  - Dans mon cas, cela n'a aucun effet.

------------------------

Merci pour vos réponse.

The format of file in newer than this version of CVI Runtime error-114 UIEFileFormatIsTooNew

$
0
0

On my Windows 10 system my CVi application throws the error above at startup.

 

Other users in my office have no problems running the exact same version of the application with the exact same version of the CVI runtime on Windows 10.

I have the application running properly on several Windows 7 systems.

 

I have tried 2010,  2015, and 2017 runtimes.

 

After some combination of installs and uninstalls of the runtimes and the application, the application started working correctly

 

Then my disk crashed, and after restoring every thing, I'm getting the same runtime error again.

 

We have customer systems running Windows 10 and this application and this problem has never been encountered on a customer system.

 

It seems to be specific to my Windows 10 system. But starting from a fresh Windows 10 installation didn't seem to have any affect on the problem.

 

Anyone have any ideas as to what might be going wrong?

 

 

Can't call function from dll or lib file

$
0
0

Hello,

I am trying to call c++ function SendCANMessage from .lib file into my CVI project by following steps from this link:

Link (Part: 2nd way to use a DLL).

I have included 2 .h and 2 .c++ files into DLL project in Visual Studio, added __declspec(dllexport) in front of functions that I want to use in CVI

and built project successfully. Then I have added .lib and .dll files that I got from this build into my CVI project. and tried to call one of functions from .c file (from CVI). When i build project, it says:

Capture.JPG

 

Function declaration in .h file is: CAN_ERROR SendCANMessage(CAN_msg *pMsg, DWORD dwTimeout); and I have 

defined CAN_ERROR, CAN_msg and DWORD earlier in my .c file.

I found that -10 means this: "Identifier not defined globally in the module.", but i don't know what to do about it.

I think that CVI don't see any of functions in .lib and .dll files and i need help how to include it properly, because I just added

these files by Edit->Add Files To Project and added files. I provided archive with all files that are included in CVI project.

Best regards,

Igor

 

problem with ATTR_CTRL_MODE - don't work

$
0
0

Hello, I try to use the attribute ATTR_CTRL_MODE but each time, its has no effect.
In my GUI, I have 1 numeric and 1 String.
On a checkbox click I want to change the mode: Indicator -> Hot.

 

code sample :

void xxxxxxx

{

  GetCtrlVal(PanelHandle2, PANEL_2_CHECKBOX,&status);      
   if(status==0)
    {

    SetCtrlAttribute(PanelHandle2, PANEL_2_STRING,ATTR_CTRL_MODE ,VAL_HOT);
    SetCtrlAttribute(PanelHandle2, PANEL_2_NUMERIC_4,ATTR_CTRL_MODE ,VAL_HOT);

 

    }

 

else {

       SetCtrlAttribute(PanelHandle2, PANEL_2_STRING,ATTR_CTRL_MODE ,VAL_INDICATOR);

      SetCtrlAttribute(PanelHandle2, PANEL_2_NUMERIC,ATTR_CTRL_MODE ,VAL_INDICATOR);

    }

 

 

}

Is this correct? - In my case, it has no effect.

-----------------------

Thank you for your answers.

GetMonitorAttribute return error value

Can the PCI-8532 use at Labwindows/CVI programming environment

$
0
0

Hi

I am a new use for NI PCI-8532 card, I installed the NI industrial communication for DeviceNet, bur I can't find any Labwindows/CVI sample code for it. So I am not sure the card can programmed by the CVI and where can find some sample code.

Finally I want to know how to config the PCI-8532 in NI-MAX, like set the interface name/baud rate and so on....

Export Variable or Struct from CVI DLL to TestStand

$
0
0

I am using LabWindows/CVI 2012 and TestStand 2012.  Is there a way to export a variable or structure using DLLEXPORT (or some other method) and access it from TestStand the way you access exported functions?  Thank you.

 


Problem with driver of Chroma DC power supply

Shortcut Keys Not Working In CVI 2013 Linux

$
0
0

I have an application that utilizes shortcut keys. In CVI 2013 for Windows they work fine. However when using CVI 2013 for Linux they do not work. If I revert back to utilizing CVI 2010 for Linux they do work again. I believe that this is a BUG within CVI 2013 for Linux.

 

I have created a simple test program with a togglebutton. The togglebutton has a callback and the main function additionally loops infinitely while calling GetUserEvent. The application is very mature and originally used the loop with GetUserEvent. Some functionality from mouse movements was required later in its life so callbacks were introduced for particular controls.

 

Anyways, I made the example program's event handling use callbacks and GetUserEvent same as the actual application for testing and the results came up the same - the shortcut key does not work when used with CVI 2013 for Linux. However, in CVI 2010 for Linux the shortcut key works fine.

 

I have uploaded a compressed tarball with the self contained example. It has a build script to build the test using both CVI 2010 for Linux and CVI 2013 for Linux. The scripts expect the root location of the NICVI installations to be /usr/local/natinst/NICVI2010 and /usr/local/natinst/NICVI2013. Thus, in order to try it out, you may have to alter the path based on your local installation path for NICVI20(10/13).

 

I am about to temporarily implement a workaround with one of the callbacks already used and the EVENT_KEYPRESS event. I say temporarily since this fix idea is a kludge for something that was caught by GetUserEvent prior to using 2013.

 

Someone please steer me in the right path or help with a patch.

 

Thanks,

-shrew

 

EDIT

I also tried the CVI 2013 for Linux f1 patch found here to no avail.

LON manager DDE server error

$
0
0

i tried running the code in CVI i'm getting this error 

 

Fatal error opening database

The database path name is invalid or longer than 38 character (error #24)

 

please can someone help me resolve this issue 

Thank you so much

 

DDE server error

$
0
0

hello there 

whenever i run a program there is this error popping up

 

Fatal error opening databse

The database path name is invalid or longer than 38 characters (error #24)

 

anyone knows to fix this issue

 

thank you so much 

 

Debugger & global **variable

$
0
0

While working through some code examples in the book "21st Century C, 2nd Edition", using LabWindows/CVI 2017, I stumbled upon an interaction between the CVI debugger and globally declared pointers to pointers variables (**variable) that I don't understand.  Below is a snippet of code that will replicate the observed behavior:

#include <stdio.h>
// Declare and initialize a global string array:
char **stringArray = (char* []) {"One", "Two", "Three"};

int main ()
{
	for (int i=0; i<3; i++) 
		printf("Item %d: %s\n", i, stringArray[i]);
	getchar(); // Allow the user to see the standard IO window
}

When the above code is built and run with the 32-bit debug configuration, with the Debugging Level set to "No run-time checking", the code outputs as expected:

Item 0: One
Item 1: Two
Item 2: Three

 When run with the Debugging Level set to "Standard", the following error occurs:

NON-FATAL RUN-TIME ERROR:   "StringArray.c", line 9, col 36, thread id 11656:   Pointer is invalid.

So my questions are:

1.) Why does debugger throw this error on code that functions properly?

2.) Is there any way to selectively tell the debugger to ignore sections of code during runtime checking (e.g. with DEFINE's)?

 

 

 

Viewing all 5341 articles
Browse latest View live


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