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

Latest runtime engine not supporting XP

$
0
0

Hi all,

 

some days ago I started to create a dll using LabWindows/CVI 2015 (Evaluation Version, Version 15.0.1(239), runtime engine 15.0.1.239) , installed on a Windows 7 Professional SP1 system.

The dll will be used within an CVI-based application running on target system with Windows XP Professional SP3 as OS. The runtime engine there has version 12.0.0.422 (CVI 2012). 

As the version of runtime engine on target system should match or exceed the one on development system, I tried to install the CVI SP1 runtime "NILWCVIRTE2015SP1.exe" on the target system. But I got message "This installation requires Windows 7 SP1 or later", what in the end corresponds to the given system requirement regarding OS (-> Windows 8.1; Windows 8; Windows 7; Windows Server 2012 R2 64-bit; Windows Server 2008 R2 64-bit).

 

What can I do to get my dll run on XP-target system ?

Probably the 2015 runtime engine usable for XP does not exist ? 

Installing CVI 2012 on development system and compile/build there the dll is probably one solution, but are there other possibilities ?

 

 

Thanks for your help,

NewInCVI


Corrupted cvicc output

$
0
0

Hello, hello,

I have a weird problem on a recently installed machine. OS is Scientific Linux 7.2 64 and using cvicc 2013.30

The lines written to stdout by the compiler are garbled, some characters are missing, others are redondant. Some lines are fine, but it's all perfectly reproduceable.

 

$ cvicc -rebuild -lusb QueDoVL.prj                            
Building Release configuration of /home/plasma/akido/QueDoV2/QueDoVL.prj
Compiling /home/plasma/akido/QueDoV2/API/CypressLibUsb.c
Compiling /home/plasma/akido/QueDoV2/GenericStripChart.c
Compiling /home/plasma/akido/QueDoV2/ColorScale.c
Compiling /home/plasma/akido/QueDoV2/EditAxisSettingsPopup.c
GenericStripChart.c:82:2: error: unknown type name ‘BOOL’
BO Customize; ;      // Show more controls
*** instead of BOOL Customize; *** GenericStripChart.c:504:2: error: unknown type name ‘BOOL’ BOOL Visible; /home/plasma/akido/QueDoV2/GenericXYplot.h:33:1: error: unknown type name ‘BOOL’ extrn BOOL NoXYYPlots; // Debug only
*** instead of extern BOOL NoXYPlots; *** QueDoV2.c:18:27: fatal error: GenericXYPlot.h: No such file or directory #inlude "GeneriicXYPlot.h"
*** instead of #include "GenericXYPlot.h" *** compilation terminated. Build failed. plasma@lpsc6028x:~/akido/QueDoV2

I first thought is was something to do with my terminal, but it happens also if I redirect stdout to a file. I haven't checked yet if I have this issue on other machines.

 

Link Against Third-Party Library

$
0
0

I need to use the WinPcap library in a LabWindows project. I have successfully compiled a very simple design, but it falls over during linking, giving me "Undefined symbol" messages. What do I need to do to get LabWindows to link correctly?

 

Thanks,

Steven

Porting LabWindows/CVI Application to another platform

$
0
0

Hello,

 

I have an application written using Labwindows/CVI. Is it possible to port the application to run on Mac OSx? I am very inclined to say no, considering the CVI runtime does not run on mac OSx, but I wanted to verify. 

 

Thank you for your time.

Nidaqmx controls cause resource leak

$
0
0

Hi,

I have some string controls on my UIR, which I convert to daqmx device and channel selection controls using the functions like NIDAQmx_NewPhysChanAICtrl, NIDAQmx_NewDeviceCtrl, etc. So far so good..

Upon exiting my execution (which I started from the cvi ide) the resource tracker warns me about 8 different thread lock objects remaining in memory, and all point to those daqmx control functions (which are called exactly 8 times). Photo attached Smiley Happy

 

Is NI aware of such a leak? Is it solved in later versions of CVI?

 

I am running win7-64 bits, CVI 2012 sp1, Daqmx 15.0.0f2 (as seen from MAX)

Can I use PXI-8232 for GPIB on a Real-Time PXI chassis?

$
0
0

I'm having trouble communicating GPIB via PXI-8232 on a Real-Time PXI chassis. I originally had hypervisor and always used the card to communicate but on the Windows side. Because of a lot of issues with hypervisor I had to convert it to a RT Target and use a PC Host. I've got the NI-488.2 Driver installed as well as the appropriate ethernet drivers. I can see the card as PXI-GPIB "PXI15::4::INSTR". I can enable the ethernet port, but have had trouble communicating via GPIB. When I looked at the GPIB.ini file in /ni-rt/system/ it had these contents

[^INFO]
Driver = GPIB
Type = 0xFF
NumGpibBoards = 4
NumGpibDevices = 32

[GPIB0]
AUTOPOLL = "Yes"
BoardName = "PCI-GPIB"
BoardType = "0x5B"
CICPROT = "No"
CompatibleType = "0xFF"
EOSchar = "0"
EOScmp = "7-bit"
EOSrd = "No"
EOSwrt = "No"
EOT = "Yes"
HSCableLength = "Off"
IPAddress = "xxx.xxx.xxx.xxx"
PAD = "0"
PPollTime = "Default"
SAD = "None"
SC = "Yes"
SerialNumber = "0x03027ED1"
SRE = "No"
TIMING = "500nsec"
TMO = "10sec"

[GPIB1]
AUTOPOLL = "Yes"
BoardName = "PXI-GPIB"
BoardType = "0x61"
CICPROT = "No"
CompatibleType = "0x5B"
EOSchar = "0"
EOScmp = "7-bit"
EOSrd = "No"
EOSwrt = "No"
EOT = "Yes"
HSCableLength = "Off"
IPAddress = "xxx.xxx.xxx.xxx"
PAD = "0"
PPollTime = "Default"
SAD = "None"
SC = "Yes"
SerialNumber = "0x0160C816"
SRE = "No"
TIMING = "500nsec"
TMO = "10sec"

It seems to me the microGPIB on the embedded controller is GPIB0 though I'm not sure if that's correct and GPIB1 is the PXI-8232. When I use ibdev I get some weird results. First, I have tried calling board 0 and 1 with no luck. When I call 

result = ibdev(1,PRIM_ADD, 0, 13, 0)

result will return as something like 31265 and act like it's talking to the instrument even if I unplug the GPIB cable entirely. Every subsequent call afterwards result will increment from the last value.

 

Any ideas on how I can talk to the instrument from the RT Target? 

Hamamatsu dcamusb library

$
0
0

Dear all,

I would like to control an hamamatsu camera (Driver circuit for CCD image sensor C11165) by means of cvi. Hamamatsu gives dll (Dcamusb.dll), static library (Dcamusb.lib), header files (Dcamusb.h). I wrote a basic program, including in the cvi project the Dcamusb.lib and the Ddcamusb.h (here attached). After compiling, severarl errors occur in Dcamusb.h (extraneous formal parameter specification).

Is there anybody that worked with these libraries and could help me in solving this problem.

Thanks a lot,

Cosimo

Discard Panel question

$
0
0

Hello,

 

when I close my program (QUIT Button LabWindows) I thought with the line "DiscardPanel (MainPanelHandle); " the program gets closed and the application does not run anymore. But now I have seen that after this call every button I have in my application gets called and closed with the return 0. Can somebody explain why I have this and if this is normal? Every button of my application works with the event "EVENT_COMMIT".

 

Hope someone can help me.

 

Best regards


Problems with a console application

$
0
0

Hello,

 

I have developed a application in LabWindows. Now I would like to link it with the console. I do know how I can call  my *.exe Data and the files the program needs. When I start the program there is a problem. I generate a signal for example 10 seconds but in reality I generate only 550 ms. So the conclusion is, that the program ends before it really should end.

I have no idea where this behavior comes from. I tried to toggle the stop moment but the program didn't run in any of my breakpoints.

So I think I have a failure in the main menu. In the following you can see the test how I tried to run it. (Here I can toggle my program)

 

int main (int argc, char *argv[])
{
    // **********************************************************************************
    // Calls the interface
    // **********************************************************************************

    if (InitCVIRTE (0, argv, 0) == 0)
        return -1;    /* out of memory */
    if ((PanelHandle = LoadPanel (0, "AWG.uir", MainPanel)) < 0)
        return -1;
    argc = 2;

    argv[1] = "test.uir";
    if(argc == 1)
    {
        DisplayPanel(PanelHandle );
        RunUserInterface ();
        DiscardPanel(PanelHandle );
        return 0;
    }
    else if(argc > 1)
    {
        // Load the file the program needs

        if(RecallPanelState (PanelHandle , argv[1], 0) <  0)
            MessagePopup("Error","File could not be loaded!");

        // Gets a value that is important for the program
        GetCtrlVal (PanelHandle , MainPanel_TREE, &g_Mode);

       // Starts the program
        ChooseMode(MainPanelHandle);
    }    
}

 

My courser runs into ChooseMode and the program starts. It runs to all funktion and I see the little part of the signal I described above.

Did I made a mistake when I wrote this part or is there a part absence for running my program correct?

 

Best regards

 

 

 

 

 

SQL Toolkit DBFetchRandom causes GPF when records exceed 10

$
0
0

I'm using CVI2013 SP1 and the SQL Toolkit 2.2 on a Win7 machine. 

Basically what  I'm doing is searching the database for records matching a tag and inserting those in a listbox.  This function works as expected when there are just a few records.  However, when the number of records is 11 I get a General Protection Fault when calling DBFetchRandom().  This happens in both Release and Debug modes.  Is there some limitation on the number of records that DBFetchRandom can access?

 

The error occurs at the first call of DBFetchRandom:

...

else if ( 1 < iNumRecs )
{         
            iReturn = DBFetchRandom( iHandleSQLStatementADS, iNumRecs ) ; // Go to the last item

...

int CVICALLBACK SearchForADs (int panel, int control, int event,
                              void *callbackData, int eventData1, int eventData2)
{      
   int iTargetADS = 0 ;
   char caSQLStatement[128] ;
   char caTimestamp[23] ;
   int iNumRecs = 0 ;
   int iCounter ;
   int iReturn = 0 ;
   switch (event)
   {
      case EVENT_COMMIT:
         // Get the serial number of the IMU whose data to show
         GetCtrlVal( panel, PANEL_ADS_SERIAL, &iTargetADS ) ;
         // Clear the multiple items list boxes
         DeleteListItem( panel, PANEL_ADS_LIST_DATES_ADS, 0, -1 ) ;
         // Clear data fields, keep the serial number
         v_ClearDataADS ( panel ) ;
         SetCtrlVal( panel, PANEL_ADS_SERIAL, iTargetADS ) ;
         // Establish connection with the database
         iHandleDatabaseConnectionADS = DBConnect ("DSN=ASIDatabase; UID=IMUATPProgram; PWD=hic3zerh");
         if ( 0 >= iHandleDatabaseConnectionADS )
         {
            MessagePopup( "Connection Error", "Couldn't connect to database" ) ;    
         }
         else
         {
            // Allow bidirectional search
            DBAllowFetchAnyDirection ( iHandleDatabaseConnectionADS, 1) ;
            // Get a handle to the SQL statement that looks up the selected IMU and get a count of the items that statement returns
            Fmt( caSQLStatement, "SELECT * FROM ADS_ATP_Table WHERE SerialNum = %i\0", iTargetADS ) ;
            iHandleSQLStatementADS = DBActivateSQL ( iHandleDatabaseConnectionADS, caSQLStatement ) ; 
            if ( iHandleSQLStatementADS > 0 ) 
            {
               iNumRecs = DBNumberOfRecords ( iHandleSQLStatementADS ) ;
            }
         }
         if ( 0 >= iNumRecs )
         {
            MessagePopup( "No Records!", "No ADS records were found for that serial number. " ) ;
            v_ClearDataADS( panel ) ;
         }
         else if ( 1 == iNumRecs )
         {
            // Update data display
            i_UpdateDataADS( panel ) ;
         }
         else if ( 1 < iNumRecs )
         {         
            iReturn = DBFetchRandom( iHandleSQLStatementADS, iNumRecs ) ; // Go to the last item
            SetCtrlAttribute ( panel, PANEL_ADS_LIST_DATES_ADS, ATTR_DIMMED, 0 ) ;
            // put timestamps into PANEL_ADS_LIST_DATES_ADS, starting with the latest
            for ( iCounter = iNumRecs; iCounter > 0; iCounter-- )
            {
               DBGetColCharBuffer( iHandleSQLStatementADS, 5, caTimestamp, 23, "" ) ;
               InsertListItem ( panel, PANEL_ADS_LIST_DATES_ADS, -1 , caTimestamp, iCounter ) ;
               DBFetchPrev( iHandleSQLStatementADS ) ;   
            }
            iReturn = DBFetchRandom( iHandleSQLStatementADS, iNumRecs ) ; // Go to the last item
         }
         else 
         {
         }

         break;
   }
   return iReturn ;

USB serial number will mutation at USB RAW device running

$
0
0

Hello, I had some questions regarding communication with a USB Raw Device.

The PC is WIN7
The USB device connected with PC and then the USB device is shown in NI MAX as USB::0x0525::0xA4A6::NI-VISA-40004::RAW
Then USB device could read or write data
Some time later,The device can't read or write data, then the device USB is shown in NI MAX as USB::0x0525::0xA4A6::NI-VISA-30004::RAW,the serial number have changed.

突变前.PNG

 

突变后.PNG
How to make the serial number remain the same?

Any help will be appreciated.

Double slider

$
0
0

Hello, hello,

what's the best way to do a double slider to select a range of values ?

By that I mean you have a slider with MIN / MAX values, and two cursors, a LOW one and a HIGH one. The first one being obviously always lower than the other one (strict or not).

 

I've tried a simple way with 2 separate sliders (named LOW and HIGH) and to set the MIN of the HIGH one to the current value of the LOW one, and to set the MAX of the LOW one to the current value of the HIGH one. But since their min/max change, they kind of change dynamically in annoying ways.

 

Do you have better suggestions ?

Dimming of menu items of menubar generated by Right-Click event in LabWindows/CVI

$
0
0

Good morning,

I created a context (right-click) menu which is a menubar wih four options. In case the user rigth clicks in a row of a table control, all four options have to be able to be selected. Otherwise, in case the user rights click beyond (outside) a row of the table control, only two options have to be able to be selected (2 options have to be dimmed).

Piece of code i am using for creation of context menu:

ContextMenuBar = NewMenuBar (0);
ContextMenuID = NewMenu (ContextMenuBar, "ContextMenu", -1);

NewMenuItem (ContextMenuBar, ContextMenuID, "Connect", -1, 0, Connect_RightClickCallback, 0); //three more options are created here in the same way

I need to know how i can dimm/undimm or remove/insert those 2 options programmatically depending on the position the right click was done (i can detect the position of the mouse when EVENT_RIGHT_CLICK_UP is triggered to determine if it is over or outside a row of table control).

Regards!

Alejandro Pinto

 

DLL and exported character array ... "Out-of-bounds pointer argument (before start of array)"

$
0
0

I've got an error handler library that I use in all my projects.  I've extended it to include a pathname it can use to output errors to the caller's preferred log file name.  This works fine when the library source is attached to a project that needs it.

 

However, when I move to a DLL project which uses the same library, I'm running into problems.

 

I've simply done some DLLEXPORT / DLLIMPORT to expose this pathname to the DLL for its internal use.  But when I do, I get errors when trying to strcpy or sprintf to it.

 

ErrorHandler.c

char errLog[MAX_PATHNAME_LEN] = {ERROR_LOG_FILE};

 

ErrorHandler.h

 

#define ERROR_LOG_FILE "error.log" // default output log file
extern char errLog[MAX_PATHNAME_LEN];
void ErrorMessage(char* logFile, double code, err_type_enum type, int line, char* function, char* file, int flags, char* string);

DLL source file.c

char DLLEXPORT errLog[MAX_PATHNAME_LEN]; 

DLL source file.h

char DLLIMPORT errLog[260];

The above is compiled into a DLL.  Now at the test project which has this DLL attached, here are my tests...

 

ErrorMessage("C:\\Users\\user\\Desktop\\ERROR_NEW.log", 666, 1, 1, __FUNCTION__, __FILE__, ERR_OUT_LOG, "Oops!");

 

Passing this literal works!

 

sprintf(errLog, "C:\\Users\\user\\Desktop\\ERROR_2.log");

This gives a GPF, "FATAL RUN-TIME ERROR: "test.c", line 375, col 38, thread id 0x00002528: Out-of-bounds pointer argument (before start of memory block).

 

I get the same results for strcpy.

 

Now, check out my debugger... the errLog array can't be viewed in a Watch window:

 

2016-10-13 09_57_03-Watch.png

 

Yet in the Variables window, you can clearly see both the correct size of the array (260) and the initialized contents...

 

2016-10-13 09_56_50-Variables and Call Stack.png

 

What's going on here?

Plus/minus box and check box size in Tree control

$
0
0

Hi,

In order to make the UIRs more readable on high resolution screens (4K) I have added a feature to change the size of the text and label fonts. Unfortunately I did not found a way to change the size of the plus/minus box and the check box in a tree control, see attached picture.

Is there a way to do it?

Thanks


High resolution screen issue

$
0
0

Hi,

 

I'm working with CVI 2013 and got a request from a customer about an issue on his new laptop with a high resolution screen.

Th panel which is causing the issue is set to "Scale contents on resize" and "Resolution adjustments" = 100%.

On my PC with a resolution of 1920x1080 I get what you can see on the attached picture 1.

What he gets on his screen of 3200 x 1800 is what you can see in picture 2.

How can I solve this issue?

return statement gives error

$
0
0

 

#define OPEN 0
#define CLOSE 1
#define BITMAP 2

void CreateFiles (int state) { if (state == OPEN) { DoStuff(); } if (state == BITMAP) { DoDifferentStuffAnd(); return; } if (state == CLOSE) { CloseFile (x); CopyFile (x,y); } } // Create Files

I have the code above. When executing, say the value OPEN is passed to the state variable. DoStuff() executes fine, and the program moves on to check the BITMAP and CLOSE statements.

 

The BITMAP statement checks as false, the program jumps out of that if, and moves on to the CLOSE statement.

 

When checking the CLOSE statement however (which is false) the program jumps into the if statement braces as if it were true, but it skips past the first function CloseFile() and executes the second function CopyFile() .

 

If I get rid of the return in the BITMAP chunk, it executes as it should and jumps out of the CLOSE statement properly.

 

If I add thereturn back into the BITMAP chunk above it, it again jumps into the CLOSE chunk upon execution (even though it's false), skipping the first line and executing the second line.

 

Anybody know what's going on here? It works fine if I put the CLOSE chunk before the BITMAP chunk which is an easy fix, but I need to understand this. Was lucky to find the error before the app went live.

Signal to a PFI output

$
0
0

Hello,

 

I use the PCIe-6342 card. I have a sinus signal that I send to 7 digital outputs. Now my problem is that, I need some more digital outputs. So I decided to try the PFI ports on my card. I adressed my 7 digital ouputs to the PFI ports and now I got the following error:

"Selected lines do not support buffered operations.  Ensure only lines that support buffered operations are being used in the task. If using change detection timing, the task must be changed to non-buffered to support these lines. Device: Dev1 Physical Channel: port1/line0"

I read something about in the forum but I didn't understand that, so can somebody help me?

 

Here you can see how I set up my digital outputs.

DAQmxErrChk(DAQmxCreateTask ("", &DigitalOutTaskHandle));
            DAQmxErrChk(DAQmxCreateDOChan (DigitalOutTaskHandle, DigitalChannel_1, "", DAQmx_Val_ChanPerLine));
            DAQmxErrChk(DAQmxCfgSampClkTiming (DigitalOutTaskHandle, "", g_SampleRate, DAQmx_Val_Rising, DAQmx_Val_FiniteSamps, Samples));
            DAQmxErrChk(DAQmxCreateDOChan (DigitalOutTaskHandle, DigitalChannel_2, "", DAQmx_Val_ChanPerLine));
            DAQmxErrChk(DAQmxCfgSampClkTiming(DigitalOutTaskHandle, "", g_SampleRate, DAQmx_Val_Rising, DAQmx_Val_FiniteSamps, Samples));
            DAQmxErrChk(DAQmxCreateDOChan (DigitalOutTaskHandle, DigitalChannel_3, "", DAQmx_Val_ChanPerLine));
            DAQmxErrChk(DAQmxCfgSampClkTiming(DigitalOutTaskHandle, "", g_SampleRate, DAQmx_Val_Rising, DAQmx_Val_FiniteSamps, Samples));
            DAQmxErrChk(DAQmxCreateDOChan (DigitalOutTaskHandle, DigitalChannel_4, "", DAQmx_Val_ChanPerLine));
           DAQmxErrChk(DAQmxCfgSampClkTiming(DigitalOutTaskHandle, "", g_SampleRate, DAQmx_Val_Rising, DAQmx_Val_FiniteSamps, Samples));
            DAQmxErrChk(DAQmxCreateDOChan (DigitalOutTaskHandle, DigitalChannel_5, "", DAQmx_Val_ChanPerLine));
            DAQmxErrChk(DAQmxCfgSampClkTiming(DigitalOutTaskHandle, "", g_SampleRate, DAQmx_Val_Rising, DAQmx_Val_FiniteSamps, Samples));
            DAQmxErrChk(DAQmxCreateDOChan (DigitalOutTaskHandle, DigitalChannel_6, "", DAQmx_Val_ChanPerLine));
            DAQmxErrChk(DAQmxCfgSampClkTiming(DigitalOutTaskHandle, "", g_SampleRate, DAQmx_Val_Rising, DAQmx_Val_FiniteSamps, Samples));
            DAQmxErrChk(DAQmxCreateDOChan (DigitalOutTaskHandle, DigitalChannelZ, "", DAQmx_Val_ChanPerLine));
            DAQmxErrChk(DAQmxCfgSampClkTiming(DigitalOutTaskHandle, "", g_SampleRate, DAQmx_Val_Rising, DAQmx_Val_FiniteSamps, Samples));
            DAQmxErrChk(DAQmxSetWriteAttribute(DigitalOutTaskHandle, DAQmx_Write_RegenMode, DAQmx_Val_DoNotAllowRegen));
            // Allocates memory for the device         

DAQmxErrChk(DAQmxRegisterEveryNSamplesEvent(DigitalOutTaskHandle, DAQmx_Val_Transferred_From_Buffer, SAMPLESNB, 0, OnEveryNSamplesEvent_DigitalOut, NULL));
            DAQmxErrChk(DAQmxCfgOutputBuffer(DigitalOutTaskHandle, 15*SAMPLESNB));

 

On this line I get the error:

                    DAQmxErrChk(DAQmxWriteDigitalLines(DigitalOutTaskHandle, (newPointer-g_Pointer), 0, 10.0, DAQmx_Val_GroupByScanNumber, g_TotalPatternDigitalOut, NULL, NULL));

 

I hope somebody can help me?

Best regards

 

 

 

Interface the VNA with the PC using LabWindows/CVI

$
0
0

Hi friends,

I have a Vector Network Analyzer Keysight Technologies / Agilent Technologies N5230A. I want to run it with the LabWindows/CVI so to measure the 40 GHz channel. I would like to interface the VNA with the PC using LabWindows/CVI. It's really essential role for measurements and I have no experience doing these things. Would you please direct me to the best, easy possible way of these work? I shall really appreciate that and thanks for your time and concern.

Mohamed

Application Design In LabWindows/CVI

$
0
0

Hello Smiley Happy,

 

I have been using LabVIEW for almost 5 years as part of academic and professional projects.

Recently i have kickstarted test and measurement system development using LabWindows CVI.

Given that i have only some basic knowledge in C- programming, i'm finding it a little difficult to understand concepts like multithreading and all. I'm familiar with c programs using a top down approach and some function calls, but nothing like mutithreading or any other advanced concepts. Hence i need some guidance in designing a large application in LabWindows CVI.

 

Assume that my application consists of 5 modules, all of them should be running in parallel. 

I'm planning to write seperate c source files for each of them and call/control them from a main code. Is this approach correct? If not what is the best approach or design pattern that should be followed.

 

Below are some queries

  1. How to run the 5 modules in parallel?  multi threading?
  2. If i'm creating header files(.h) for each of the 5 modules and include the headers in main code(.c) using #include , does that mean that all the 5modules will run in parallel, once the main code starts running.?

Regards

Deepu Jacob

 

Viewing all 5374 articles
Browse latest View live


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