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

Generating object code to remove the run time engine dependency

$
0
0

Hi,

 

I have 2 questions:

 

1. I want to know whether there is a method to somehow generate an object code from CVI rather than a byte code? Let us consider a simple code having the addition of 2 numbers for this question.

As far as I understand, when we generate a dll out of a CVI code, a byte code is generated which goes to the CVI Run Time Engine in the target machine and it is the CVI Run Time Engine which interprets the byte code and generates a machine level object code. 

I have seen multiple links and all of them say that to run my dll, I need to have the CVI Run Time Engine installed on the target machine. My question is, whether we can remove the dependency of the CVI Run Time Engine by directly generating an object code from CVI which can run on any target system by a call from an ADE like MS Visual Studio, etc without having the CVI Run Time Engine Installed?

There are options to change the compiler in CVI to GCC or any other external compiler. Can changing the compiler option to GCC generate an object code or will the dll generated still require a Run Time Engine?

 

2. The second question is an extension of the 1st one. What happens when an NI Instrument Driver Library (For. e.g NI VISA) is used? If the answer to the 1st question is yes, it is possible to generate an executable code which can run on a target system without any dependency for the CVI Run Time Engine, will this be valid for a code which is using an NI Driver?

 

Any help will be appreciated !


Unknown Error - NON-FATAL RUNTIME Error

$
0
0

Hello Friends,

 

I am getting a non fatal runtime error shown below in the image. Can anyone tell what am I doing wrong. I am also going to explainthe situation below the image.

NonFatal.PNG

In the main function I am calling loadDefaultFile() function which loads an XML file stored in the Working folder.

Also in my menubar I have an option of including another XML. At the start of the GUI the stored XML file is loaded. No problem till this point. But when I try to import another XML the above error occours.

The situation is best explained in the code below:

 

//============== Important is to know the loadDefaultFile() function call ============//

int main (int argc, char *argv[])
{
    int error = 0;
    
    /* initialize and load resources */
    nullChk (InitCVIRTE (0, argv, 0));
    errChk (panelHandle = LoadPanel (0, "PintschBamag.uir", PANEL));
    
    /* display the panel and run the user interface */
    errChk (DisplayPanel (panelHandle));
    loadDefaultFile();
    errChk (RunUserInterface ());

Error:
    /* clean up */
    if (panelHandle > 0)
        DiscardPanel (panelHandle);
    return 0;
}

 

// Automatic calling at the start of GUI

void loadDefaultFile()
{
    //*path = "XML.xml";
    GetElements("XML.xml");
}

 

// This function is to be called when importing another XML (error occours here)

void CVICALLBACK loadNewXML (int menuBar, int menuItem, void *callbackData,int panel)
{
     if (VAL_EXISTING_FILE_SELECTED == FileSelectPopupEx (EMPTY_STRING, XML_FILE_EXTN,
           XML_FILE_EXTN, XML_FILE_DLG_TITLE, VAL_SELECT_BUTTON, 0, 0, path))   // no &
           {
            GetElements(path);
           }
}

 

I hope someone can help me on this by understanding the situation.

 

Thanks,

Raunak

 

 

How to make Screenshots of Panel as .PDF

$
0
0

Dear Guys,

 

Can anyone give me an idea about how to generate a screenshot of a panel and save it in a .PDF format. I found that there are some options to save them in .jpg, .png etc.

Hope someone might have figured how to do that in Labwindows.

 

Thanks

Raunak

Saving an XML at a different location

$
0
0

Dear Friends,

 

If I load an XML in Labwindows from a specific position, can I change its path to to different position when saving it?

 

Regards

Raunak

How to create an intensity plot when X/Y values are not integers?

$
0
0

The data I want to plot comes from three analog input voltage channels. The first two voltages indicate the X and Y location of the third value which is the Z (intensity) voltage data. All data are float data type. The CVI function that plots intensity data on a graph requires the data to be in a three dimensional array format, where X and Y position values are integer indexes into the 3D array of intensity values. Is there a (practical) way to plot my data on a CVI intensity graph?

Question with Function GetCompName();

$
0
0

I am having some trouble when try to use the 2013 CVI function.

 

in the main routine I include the hearder file of GetCompName();

#include "toolbox.h"

defined the variable with 

char ComputerName[MAX_COMPNAME_LEN]; 

 

and in Main.c I just put GetCompName(ComputerName);

but I keep getting the error message:  error: Undefined symbol '_GetCompName@4' referenced in "f:\XXX\Test\cvibuild.test\Debug\test.obj".  everything is fine if I comment out the section of GetCompName(ComputerName);

 

Is there anything I missed?  Or is it because the system have compatible issue? I am using Windows 7 64bit environment.

 

INI file with section name without data

$
0
0

I have created an ini file using LabWindows CVI 2013 and want to create a section name that has no data similar to this:

 

[INTERFACE]

Interface Type = Serial

 

[GPIB]

 

[SERIAL]

 

 

Any ideas on how to create the [GPIB] and [SERIAL] sections without any data?

Also, is there a way to add comments to the the sectionName as well as to the tagName data?

bug with data tooltip

$
0
0

Hello NI,

 

I have found a little bug with the data tooltips (CVI2015), and I even can give a recipe to reproduce this behavior Smiley Wink

 

If running a program in debug mode, with the environment setting 'Hide windows when application is running', a data tooltip may show up although no source code window is displayed (example shown below).

 

This happens if

(1) there is a breakpoint in the source code such that the programs stops,

(2) the cursor points to a line where it is able to display a tooltip (example shown below)

(3) BUT the program is continued before this tooltip is displayed

 

then this tooltip is displayed although the source code window already has disappeared and the program GUI is shown.

If one would wait long enough with the source code window open to have the data tool tip shown then the tooltip is cleared as expected if the source code window is hidden.

 

Not crucial but a bit irritating Smiley Happy

 

data_tooltip_exe.png

above you can see the data tooltip (giving the full path of a file in the project browser) although the project browser is not visible...

 

data_tooltip_source.png

 

this happens because the cursor is located in a place where it would show a tooltip if the source code window would be open...


ON-OFF Toggle button Event left click

$
0
0

Hello Friends,

 

A small problem is troubling me a lot. I am using a Toggle OFF-ON button. I want to program it like if I perform EVENT_LEFT_CLICK, I should get in my variable attribute =1 using command GetCtrlVal (panel, PANEL_TOGGLEBUTTON,&attribute). Similarly when I release the event, i.e. if I perform EVENT_LEFT_CLICK_UP, I should get attribute value =0.

 

But everytime if I perform the first operation EVENT_LEFT_CLICK without leaving the mouse click, I get attribute =0.

 

Can someone help?

 

Best Regards

Raunak

CVI SQL Toolkit2.2 problem

$
0
0

hello ,

    About CVI SQL Toolkit2.2,why did I get the following error in my program after open it after a while?

1.jpg

Generating The Executable

$
0
0

Dear Labwindows Users,

 

I have a working project in which I have used several Instrumental libraries. How can I generate the executable for my GUI which will embedded all the used libraries so that I can use the GUI executable in any Computer without installing any Labwindows software.

 

Thanks

Raunak

Please update winnt.h

$
0
0

Hello NI,

 

the second part of my earlier post here failed to get noticed so I dedicate an extra message for it Smiley Wink

 

When compiling (in CVI2015f1) with

 

#include <windows.h>

 

and extended warning level I receive the following warnings:

 

"winnt.h"(8780,19)    warning: cast from function call of type 'LONG64' (aka 'long long') to non-matching type 'PVOID' (aka 'void *')

"winnt.h"(8791,19)    warning: cast from function call of type 'LONG64' (aka 'long long') to non-matching type 'PVOID' (aka 'void *')

"winnt.h"(8802,19)    warning: cast from function call of type 'LONG64' (aka 'long long') to non-matching type 'PVOID' (aka 'void *')

 

My suggestion is to update the include file, thanks!

 

 

How to use frequency counter

$
0
0

It's my first time start to use frequency counter based on USB-6212 under labwindows,  could any one point me to the example I could refer to? 

the frequency we try to measure is 512hz, 1hz, I assume it should be Pulse-Width Measurement by single counter application.

 

Thanks,

Low Level Support driver not found

$
0
0

I am having trouble using the StartPcSound() function in LabWindows CVI 2013. I noticed that I need the LowLevelSupport Driver installed to run this function, but when I call

CVILowLevelSupportDriverLoaded function to see if the driver is installed, it always returns 0. I verified that it is insalled, and also reinstalled it manually. When I go into Drivers & Componets, the driver is listed there so I know it is atleast somewhere. Why can't CVILowLevelSupportDriverLoaded find the driver? I tried running with admin previliges and also on a 32 bit build.

Thank you, Caleb 

Gernating a Wave Drive Signal

$
0
0

Hello,

 

in my work I have to generate a analog "Wave Drive" signal (seem in the following). I have a lot of problems with the time axis an know I would like to know if somebody already has a code for such a signal, it would be a great help.

 

I hope somebody can help me.

 

Best Regards


Less than symbol problems

$
0
0

Hello everybody,

 

ich have written a code, nothing special.

 

    if(Phi < 0.25)
    {
        A = 1;
    }

 

Now I have a problem. When I get a value Phi = 0.25, Lab Windows jumps into the bracket and writes A=1.

But that is not correct. 0.25 is not smaller, it is equal. Is this a failure of the program or have I forgotten something?

 

Best Regards

FTP transfer slows down when application is running

$
0
0

I am developing a test application for a radar project using LabWindows 2015, and I'm having an FTP problem.

 

Our radar system has a gigabit Ethernet interface. My test set software runs a test that connects to the radar and commands it via Telnet to execute a test function. This function creates a file back on the test set PC's hard drive and writes 10 MB of data to it via FTP. When the test is done, the test set measures the FTP transfer rate to verify that it is 30 MB/sec or better. My application is also running a few other programs in the background that are unrelated to this particular test.

 

We have two test set PCs with identical operating systems and network hardware (Windows 7 Enterprise, Intel I210 gigabit Ethernet adapters, driver version 12.7.28.0 dated 5/13/2013). For some mysterious reason, the test is only passing on one of the PCs. On the other one, the test passes only if I shut down my software and all its background programs, then run the test manually by typing the commands into a window in TeraTerm. If I run it the normal way, the FTP transfer quits in the middle of the file.

 

I ran data captures on both PCs using Wireshark. On the faulty PC, the FTP transfers happen much more slowly when the test set software is running in the background, and there are fewer transfers completed for each acknowledge sent by the PC. The other PC appears to be unaffected whether the test set software is running or not.

 

Both PCs are running the FileZilla FTP server, but I've repeated the test using WFTPD32 with the same results.

Nobody here can explain what we're seeing. We're running in a classified lab, so we have a suspicion that there might be a security setting to blame, but we have no idea what.

 

Can anyone shed some light?

 

Faulty PC, program not running - test passes

 

Faulty PC, program running - test fails

DAQmx DAQmxRegisterEveryNSamplesEvent when is called.

$
0
0

HI, I am confued about when is the event DAQmxRegisterEveryNSamplesEvent  called :

Here is howa create my task, with many channels:

 

DAQmxCreateTask("",&device.taskHandle);

 

DAQmxCreateAIVoltageChan(device.taskHandle,"Dev1/ai0","",DAQmx_Val_Cfg_Default,-10,10,DAQmx_Val_Volts,NULL);

DAQmxCreateAIVoltageChan(device.taskHandle,"Dev1/ai1","",DAQmx_Val_Cfg_Default,-10,10,DAQmx_Val_Volts,NULL);

DAQmxCreateAIVoltageChan(device.taskHandle,"Dev1/ai2","",DAQmx_Val_Cfg_Default,-10,10,DAQmx_Val_Volts,NULL);

 

samplesRate = 1000;

DAQmxCfgSampClkTiming(device.taskHandle,"",samplesRate,DAQmx_Val_Rising,DAQmx_Val_ContSamps,100);

                      
DAQmxRegisterEveryNSamplesEvent(device.taskHandle,DAQmx_Val_Acquired_Into_Buffer,10,0,EveryNCallback,NULL);                     

 

DAQmxRegisterDoneEvent(device.taskHandle,0,DoneCallback,NULL);
                      

data = malloc(100*numChannels*sizeof(float64));                   
DAQmxStartTask(device.taskHandle);

}

 

int32 CVICALLBACK EveryNCallback(TaskHandle taskHandle, int32 everyNsamplesEventType, uInt32 nSamples, void *callbackData)  

{

    int numRead = 0;
    DAQmxReadAnalogF64(device.taskHandle,100,10.0,DAQmx_Val_GroupByChannel ,data,100 * numChannels,&numRead,NULL);

}

 

 

When is here fired EveryNCallback, I tough when the buffer data has 10 samples, but when i call this, it has the 100 samples readed for each channel.

If the sample rate is 1000 samples per seocnd per channel it would be 0.3 seconds for 100 samples per channel(3). And if

EveryNCallback is called every 10 samples then it should be called every 0.030 seconds ??? or I am wrong.

 

Thank you very much in advance.

 

 

 

 

 

Using git as Source Code Control

$
0
0

I found this KB article describing how to use Source Code Control in CVI.

The article says that Perforce, Subversion and Microsoft Team Foundation Server 2010 have been tested with CVI.

 

Has someone successfully integrated git as SCC tool in CVI?

Is there some special configuration needed?

CVI2013 / NI-XNET - How to measure the time between calling a function to "Write frame CAN" and the real instant of output frame CAN from the port ?

$
0
0

Hello,

 

I have a wierd question, I admit Smiley Very Happy

 

Well, I'm calling somwhere in my code a function to write a signal CAN (nxt_Write_SignalSinglePoint). I'm using CVI2013 + Automotive diagnostic command set. I have a PXI 8513/2 for CAN communication.

This function works great. The problem is that I think that there is a delay between the moment of calling this function, and the real moment when the frame CAN is generated electrically. 

 

So, to get the instant of calling the Write function, I can use GetLocalTime function. Even if I really appreciate if this last function return the time in micro-seconds.

But how can I get the moment when starting generating the CAN frame physically ?

 

That's it, for the moment Smiley Very Happy

   

Viewing all 5339 articles
Browse latest View live


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