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

SetCtrlVal() with textbox - function does not work as intended?

$
0
0

I use this command to update a textbox with a timer:    

 

SetCtrlVal   (MyPanel,  MyPanel_MyTextBox,  SomeText);

 

It keeps adding 'SomeText' into MyTextBox instead of setting it with that value.  It only works as I want when I use:

 

ResetTextBox   (MyPanel,  MyPanel_MyTextBox,  SomeText);

 

Is this supposed to be the way SetCtrlVal() work, because that is how I understand it?

 


Relocatable distribution settings

$
0
0

I consider the following a bug:

CVI is fairly well done in respect to .prj and .cws files in the sense that if you move a project directory, it adjusts all relative paths without complaining (while leaving alone the absolute paths which are outside of the project tree).

 

But that doesn't work with .cds (distribution) files. It makes putting a cds file under version control fairly useless as you need to edit the file with a text editor to adjust the paths each time. This should be fixed.

Thanks.

Accessing Adlink PCI 7250 card in Labwindows 8.0

$
0
0

How to access Adlink PCI 7250 card in Labwindows 8.0? Which driver need to be used? Any exaple can be shared?

COMUNICACION ARDUINO Y LABWINDOW/CVI10

$
0
0

Hi everyone,
I am trying to communicate with Arduino and LabWindowCVI10. Just want to send integers for my Arduino to read. It is not clear how it works the ComWrt function.
You can give me a hand?

 

This is my code LabWindow

 

int CVICALLBACK Frecuencia (int panel, int control, int event,
void *callbackData, int eventData1, int eventData2)
{
switch (event)
{
case EVENT_COMMIT:
double x;
GetCtrlVal(panelHandle, PANEL_FRECUENCIA, &x);
char info[10];
Fmt(info, "%s<%f[p0]", x);
/*for(int i=0; i<strlen(info); i++){
int c = info[i];
ComWrtByte(COM, c);
Delay(0.1);

}*/

ComWrt(COM,info, strlen(info));
break;
}
return 0;
}

 

And this on my Arduino

 

char cadena[8];
byte posicion;
unsigned long valor;

void loop() {
if (Serial.available())
{
memset(cadena, 0, sizeof(cadena));

while (Serial.available() > 0)
{
delay(5);
cadena[posicion] = Serial.read();
posicion++;
}
valor = atol(cadena);
AsignarFrecuencia(valor);
posicion = 0;
}
}

 

Not if I'm working properly with LabWindow. I would appreciate any help.

Regards from Spain ¡¡¡

 

Mouse event

$
0
0

Hi,

 

On a control, I need a click to switch display between 2 values, and a double click to enter a new value for the value actually shown.

 

I wrote something like that :

 

int CVICALLBACK OkCallback (int panel, int control, int event,  void *callbackData, int eventData1, int eventData2)
{
switch (event)
{
case EVENT_COMMIT:
// do something
break;
case EVENT_RIGHT_CLICK:
// If value A displayed, display value B else display value A
break;

case EVENT_RIGHT_DOUBLE_CLICK:
// If value A displayed, enter new value A else enter new value B
break;
}
return 0;
}

 

 

The problem is that if I double click on the control, the callback is called twice. A fisrt time with EVENT_RIGHT_CLICK and a second time with EVENT_RIGHT_DOUBLE_CLICK event

 

How can I do ?

 

I tried to replace EVENT_RIGHT_CLICK with EVENT_MOUSE_WHEEL_SCROLL but when I scroll the wheel this event is not sent. Why ? 

 

Regards.

square command button

$
0
0

i want to write a code which consists of many text messages and two command buttons named "Next Instruction" and "Previous Instruction". Text messages are already written and will hide when program will start. when i press next instruction button the second instruction will appear and first one will hide, when i press the button second time third instruction will come and second will hide. when i press previous instruction button it will go backwards. Kindly help me in writing this code. I am stuck here. 

setting the DPI of a picture

$
0
0

I am trying to create an image and then save that to a file to be printed later.  I notice that the picture functions seem to default to a 96 DPI image.  Is there some way to increase that?  I need to add some pretty small text to the picture and it is turning out eligible.

Missing 'const' causes no compile error in some cases - maybe give a warning then?

$
0
0

These two cause errors:

 

extern int const constint_var;

// error: redefinition of 'constint_var' with a different type
int constint_var;

 

void test_constint_ptr(int const *i);

// error: conflicting types for 'test_constint_ptr'
void test_constint_ptr(int *i) { *i = 3; i = NULL; }

 

But the following not:

 

void test_constint(int const i);

// NO ERROR
void test_constint(int i)
{
  i = 3;
}

 

void test_int_constptr(int *const i);

// NO ERROR
void test_int_constptr(int *i)
{
  *i = 3;
  i = NULL;
}

 

I see that the ones which don't cause an error have no impact on the caller and thus it doesn't matter to them (and the compiled code there) if the functions modify their local values.

 

Yet I find this confusing because the prototype doesn't match the function. A compiler warning would be nice, like Visual Studio has.


Simulate Movement (rotation,translation) of object with images or similar

$
0
0

Hello guys, I'm trying to develop an app where I specify certain distance (in pixels or similar) so an image or object can move in the Y and X axis and can also rotate. For example Move 9 , Rotate 50, Move Backwards 39. Is this possible in Labview and if so what's the easiest way in your opinion I can accomplish it?. I appreciate any link or info you can provide me so I can start with the development, thanks in advanced !

Solution: Visual C++ Runtime Error: R6030 -CRT not initialized

$
0
0

I'm starting this thread as information for others. I had an issue in CVI2013 that I didn't have with CVI8.1:

 

I have a project that uses NI libraries (vision and imaqdx amongst others) and two 32bit libraries (one is for a USB motion controller and the other for an ethernet motion controller). In CVI8.1, this compiles and runs fine, but in CVI2013, it compiles but when I execute it, I get a Visual C++ Runtime Error: R6030 -CRT not initialized. I uninstalled and re-installed all of the VC++ redistributables from 2005 to 2013 with no luck. I also removed my AVG antivirus and replaced it with MSE with no luck. UAC is off on this machine.

 

1) I have a small test application with just the ethernet library (and some NI libraries but NOT the vision) and it runs fine in CVI2013

2) If I use just the USB library, my project (which also uses the vision library) works fine

2) If I use just the ethernet library, my project (which also uses the vision library) has the VC++ error

 

After a lot of searching on the Windows side of things, I realized that I might have the same problem as this thread:

http://forums.ni.com/t5/LabWindows-CVI/CVI-EXE-producing-R6030-CRT-not-initialize-d/m-p/2304730/highlight/true#M60843

 

The underlying reason for the crash might be here:

https://social.msdn.microsoft.com/Forums/vstudio/en-US/99029f46-bf9c-48f6-9351-1f5c7f61d946/choosing-runtime-library-options
https://msdn.microsoft.com/en-us/library/abx4dbyh.aspx

 

Solution:

Since I could not rewrite the DLL (supplied by 3rd party), I decided to try a few things. I was initialliy linking the DLL statically by adding the .LIB file to my project so I switched to using dynamic linking with the Windows API (LoadLibrary()). Writting the necessary GetProcAddress() calls for all of the functions is the worst part in going this route, but some headers include those...

 

This resolved the crash issue in CVI2013 and works in CVI8.1 as well.

Good luck!

How to start application on a defined panel

$
0
0

Hi,

I have an application which creates new panel on the second monitor an then starts an application on this panel.

The function to start the application is a part of DLL and I don't have sources.

 

How can I start any application on defined pannel?

 

Thanks

 

 

From UI editor to UI browser

$
0
0

I may be missing something, but... if you double click on a UI browser element you'll go to the corresponding panel or control in the editor. I can't find a way to go the opposite way (from a control in the user interface editor to the corresponding item in the user interface browser tree): this could be useful in case of complex UIR files with several panels and controls, especially if you have more than one control array in it.

Can you point me to the correct method of getting it apart from manually searching in the tree?

Generate/Goto panel callback

$
0
0

Today I was digging in the CVI Idea Exchange board and came across this suggestion declared as completed, however I can't seem to find this realized in my CVI2013SP1 install:

 

Screenshot 2015-03-04 09.35.12.jpg

 

What am I missing?

niseCfg library link errors - will not compile working code on replicate system

$
0
0

i have working software trying to install on a replicate system.    it does not compile on the replicate system.   the problem is nise, niseCfg link errors  for example:  

Undefined symbol:  '_niseCfg_GetVirtualDeviceProperty@20' referenced in "TestSystem_Config.c"

originally it complained it couldn't find the nise.h and niseCfg.h header files.   i copied the header and some other object and fp files (yeah, yeah, i know :-/ from my working system to the replicate system (in the NI/Shared/CVI directory path).

it then found the header file and prototypes but now the undefined link errors.   i have nise.dll in my WIndows System directory.

Please help.   what do i do to fix this?   thanks!

 

 

How do I control the run button of my project VI from a C# application onclick event?

$
0
0

We am working on a project on eye tracking. We run a labVIEW vi through which the co ordinates of the path of eye movenment are added to a txt file and we process the text file in run-time for getting the path in my C# application.

This requires us to run the VI when I click a button in the c# application window. and stop running it when I press another.
We haven't been able to interface the C# application with LabVIEW. The ready made app dll's didnt come of help because of our inexperience.
We have tried using the Process.start(in C# diagnostics) functions to run LabVIEW onclick,but still doesnt solve our problem clicking the run button in background.

Any stepwise guide would be appreciated,concerning labVIEW dll or,other.

Just to make things clear,
Our project GUI is a C# wpf application. We need to run a labVIEW vi in background. (need control over run)
Any help would be appreciated. Thanks a lot!

Our system:
Windows 8/8.1
NI LabVIEW 2014 Student edition(with Vision assistant,mathscript,Vision development module)
Microsoft Visual Studio 2013 Professional (WPF C# application)


Ctrl-I, Ctrl-F1 stop working after a while

$
0
0

Hello all,

using CVI 2013sp2. After working a while on source code (multiple modifications, save and debug runs), the Ctrl-I and Ctrl-F1 start to behave erratically. Some existing functions are found, but others are not anymore. Or it just goes to the declaration and not the definition. I have to quit and restart the IDE every hour or so because of this annoying problem. We are talking a project with 200 source files and 30k lines of code, so not something gigantic.

 

I remember having had this problem on older versions, but much less commonly.

Thanks.

CVI Runtime slowing down a program

$
0
0

I just started working for a company as a test developer and they seem to be using CVI along with TestStand. They also have there own test software that uses TestStand and CVI together along with some SAP integration. I am using the software to test some computer that is connected to a test station via a serial port. The serial port monitos the activities of the uut and I am able to read the timestamps from the logs

 

The problem that I am facing at this moment is that the timestamps from my computer are different compared to the timestamps from other peoples computers. I installed TestStand and CVI runtime engine on my own and I have found that different people have different versions of the runtime engine. I tried installing various versions of the runtime engine but none of them seem to give me the right time stamps. Basically the amount of time taken for my sequence to generate timestamps is more than twice the time taken by other people. 

 

If there is someone out there that can help me out, I won't be able to thank you enough in words.

 

 

Powered by...

$
0
0

I just received a bunch of CompactDAQ devices, and in the box were also a bunch of stickers "Powered by LabView", but no sticker "Powered by LabWindows". Where's the love ?!?

CompactDAQ via virtual machine

$
0
0

Hi all,

before I dive into the documentation, how do I connect an ethernet CompactDAQ to a virtual machine ?

In other word, what kind of ethernet setup is necessary ?

Does the device have a static address (on what subnet ?),

does it use DHCP (do I need a DHCP server on my host ?),

can I run my guest in NAT or does it need to be bridged ?

Or is the protocol entirely different, non-IP based (in which case how do I pass it to a VM ?).

 

Thanks

ReadFile return empty string

$
0
0

Try to read a binary file.

OpenFile with VAL_BINARY.  file handle returned is NOT -1 (is 3).

ReadFile returns 4, but the string is empty.

 

 

iFileHandle = OpenFile(szPath, VAL_READ_ONLY, VAL_OPEN_AS_IS, VAL_BINARY);

if (iFileHandle < 0)

    err = ERROR_FILE_NOT_FOUND;

 

SetFilePtr(iFileHandle, 0, 0);

 

nSize = ReadFile(iFileHandle, szSize, 4);

 

Wher nSize is 4, but szSize is empty.

StringLength is 0

 

The first byte is NULL.  That might be the problem.

How do I get around this ?

TIA.

 

 

Viewing all 5339 articles
Browse latest View live