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

disallowing panel resize below minimum?

$
0
0

Is there a way to forbid active resizing of a panel below minimums?  I've read this post and looked up example projects, but they mostly deal with the EVENT_PANEL_SIZE event (after the resize is done).  

 

I'd like to utilize the EVENT_PANEL_SIZING event which is while the resizing is happening.  The idea is this:

 

As you click and drag the size of a panel, I would like the panel to stop resizing with your mouse cursor once the minimum height and width dimensions are reached.  This seams like it should be easy.  But I can't quite crack it.


NIDAQmx version numbers

$
0
0

Hello all again,

I have a bunch of brand new NI devices which come with a NIDAQmx DVD version 9.9 dated 10 months ago. But if I do a search on NIDAQmx to get the latest, I find a version 14.1. I find it strange that it would have gone up so many versions in less than a year. Are those two different things or should I get the 14.1 ?

Thanks.

Looking for 9184/9263/9215 examples

$
0
0

Well, looks like I'm swamping the forum tonight.

I've never used NiDAQmx before, so I'm looking for sample codes in CVI for a cDAQ-9184 with an AO 9263 module and an AI 9215 module. I imagine there are sample code for compatible hardware with different names but after a cursory search using [Help][NI Example Finder] I couldn't come up with anything.

Thanks

Cannot find 32-bit program file for library

$
0
0

Hello,

 

It is a long time since I worked with CVI, but today I opened a old project in CVI 2013 SP2. On project load I got two library load errors: "Cannot find 32-bit program file for library 'Menu Utility' " and "Cannot find 32-bit program file for library 'Excel Report'. "
I see both libraries in "Customize Library Menu" dialog. They are loaded from "C:\Program Files (x86)\National Instruments\CVI2013\toolslib\toolbox\menuutil.fp" and "C:\Program Files (x86)\National Instruments\CVI2013\toolslib\activex\excel\excelreport.fp".

On disk I find those files, but I do not find corresponding *.obj files, which I see for other custom libraries.

 

I think I do need those *.obj files, don't I? Where can I find those files? Or how do I create those files?

 

UliB

Intensity plot out of memory issue

$
0
0

Hi,

 

I have an Out of memory issue with the PlotScaledIntensity function and I couldn't fint reason. I'm using CVI 2013.

 

I have extracted the problem from the complete and large project in order to make it more easy to explain and understand.

 

I have a graph on which I can display either a bitmap picture or an intensity plot.

If I display first the Intensity plot and then the picture it works fine but doing the opposite first the bitmap and then the intensity plot I get an Out of memory error and the plot is not displayed.

 

I have added the complete project in case someone wants to test it.

 

I spent a lot of time trying to find out what was wrong but I couldn't see it.

 

Maybe someone can help me.

 

Thanks in advance

Bertrand

 

 

Can NIDAQmx do multiple things in sequence ?

$
0
0

Hello all,

I'm learning NIDAQmx and I wonder if it's possible to program in a single task a complex set of events such as [Generate Analog Out signal from array during T1], [Wait T2], [Receive Analog In signal into array during T3], [generate callback when finished].

 

After just a few hours I managed to to this as a sequence of 2 different tasks and it works fine, but to be able to do other things at the same time WHILE ensuring precision of operation (the wait sequence in the middle), the best would be for the whole thing to run independently.

 

So what solutions are there ? Entire sequence in a NIDAQ task ? TaskOut+wait+TaskIn in a thread ? TaskIn started by an async timer launched at the same time than the start of TaskOut ?

 

Thanks.

Waveform Comparison

$
0
0

Hello 

 

I have acquired a particular waveform and stored as a TDMS file on my computer. I would like to compare this acquired waveform value by value with another wavefrom to be acquired. 

 

My aim is to conclude whether the two waveforms are the same.

 

Valuable inputs please.

 

Thanks 

vision

$
0
0
We have a 16-bit image and trying to process that image using Vision module LabVIEW 2010. Is 16-bit image possible to process in Vision toolkit ?
We are buying Biomedical Toolkit for LabVIEW 2014, We are not aware of processing 16-bit images in that toolkit.
 
When I am opening and saving the 16-bit tiff image, intensity values of image are varied 10 times of original image intensity ( example: from 3,200 to 35,000). Why it is happening. I have attached screen shots of small code and inverse help context.
 
 

error: conflicting types for 'myFunctionOne'

$
0
0

Hello,

 

The LabWindows/CVI 2013 help page for C Language Extensions appears to show function overloading being supported in the C99 extensions:

 

 "Function Overloading in C | Yes"

 

The table in the following link shows the same thing:

http://digital.ni.com/public.nsf/allkb/73AEAD30C8AF681A86257BBB0054A26B

 

I tried compiling a source file with the following overloaded function definitions with C99 extensions enabled in the Build Options:

 

 void myFunctionOne(double d) {
  printf ("Value = %f\n", d);
 }

 void myFunctionOne(int d) {
  printf ("Value = %d\n", d);
 }

 

and I get the error:

 "conflicting types for 'myFunctionOne'

 

Is function overloading truly supported, and if so, how does one enable it?

Thanks,
Mark B.

reservation program

$
0
0
Hi to all; From 2 days, i started to develop a program for my office of real estate, this program for reservation of villas. İ want to make an application theat show the disponibility of every villa. After ican make a resrvation, i put the check in and check out dates. Ths program check if this time is free then i can make thsreservation, My big prblem now is how i can check if the period of reservation is free or no,,,,,,,,,,, İ'am bloqued. Help pleaeeee :'( Thks lot.

Please help me to solve screen shot errors...

$
0
0

HI All,

 

Please find the attached screen shot.

 

Please assist me to solve screenshot errors.

 

I am really struggling to solve errors.

 

Thanks for your help in advance.

 

Regards

Durai S

 

 

Please help me to solve screen shot errors...

$
0
0

HI All,

 

Please find the attached screen shot.

 

Please assist me to solve screenshot errors.

 

I am really struggling to solve errors.

 

Thanks for your help in advance.

 

Regards

Durai S

 

 

NIDAQmx non-blocking read ?

$
0
0

Hello all,

I'm tring to do fairly simple things with NIDAQmx, but that thing's a beast and not all the functions are in the FP.

 

I managed to do a non-blocking signal generation like this, where a callback is called when the generation is finished:

 

DAQmxCreateTask("AnalogTask", &Task);
DAQmxCreateAOVoltageChan(Task, PhyChan, ChanName, -10, 10, DAQmx_Val_Volts, "");
DAQmxSetChanAttribute(Task, ChanName, DAQmx_AO_TermCfg, DAQmx_Val_RSE);
DAQmxCfgSampClkTiming(Task, "OnboardClock", Rate, DAQmx_Val_Rising, DAQmx_Val_FiniteSamps, NbSamplesPerChan);
DAQmxSetWriteAttribute(Task, DAQmx_Write_RegenMode, DAQmx_Val_AllowRegen);
DAQmxRegisterDoneEvent (Task, 0, CBD_AnalogEnd, NULL);
DAQmxWriteAnalogF64 (Task, AOSamples, 0, 0, DAQmx_Val_GroupByChannel, WriteArray, &SamplesWritten, 0);
// this returns immediately
DAQmxTaskControl (Task, DAQmx_Val_Task_Commit);	// Necessary ?
DAQmxStartTask(Task); // this returns immediately
// Do something else - CBD_AnalogEnd will be called

 

 

But I can't do the same with analog input:

 

DAQmxCreateTask("AnalogTask", &Task);
DAQmxCreateAIVoltageChan(*Task, PhyChan, ChanName, DAQmx_Val_Cfg_Default, -10, 10, DAQmx_Val_Volts, NULL);
DAQmxCfgSampClkTiming (*Task, "OnboardClock", Rate, DAQmx_Val_Rising, DAQmx_Val_FiniteSamps, NbSamplesPerChan);
DAQmxSetReadAutoStart(Task, FALSE);	// Undocumented function
DAQmxReadBinaryI16 (Task, AISamples, -1, DAQmx_Val_GroupByChannel, ReadArray, AISamples*4, &SamplesRead, 0);
DAQmxTaskControl (Task, DAQmx_Val_Task_Commit);
DAQmxStartTask(Task);

 I get the following error message when calling ReadBinaryI16:

 

Read cannot be performed when the Auto Start property is false and the task is not running or committed.
Start the task before reading, or set Auto Start to true.
Property: DAQmx_Read_AutoStart
Corresponding Value: 0
Task Name: AnalogInTask
Status Code: -200473

 

If I place StartTask/TaskCommit before the ReadBinary call, I don't get any error but the read still takes the entire time before it returns. How does a non-bloacking read work ?

 

Thanks

Upgrade of CVI / Win: now receiving VISA error: insufficient location information...

$
0
0

Dear all,

 

I'm facing the following issue:

 

We have replaced our old lab computer by a new model and used the opportunity to also move to a more current operating system (from Win XP to Win 7 64 bit) and to the current version of CVI (2013 SP2), its runtime engine, and all the device drivers (latest 2014 versions of VISA...).

 

One of our data acquisition software (written many years ago in CVI 2009, 32 bit) now on startup shows an error message:

 

VISA error: insufficient location information or the device or resource is not present in the system.

 

Unfortunately, for me this information is not detailed enough: we do have six boards from NI, the same we have used before. MAX shows all the boards, so at first glance it is not so obvious to me what to learn from this error message, or how to continue...

 

Any advice is welcome :smileywink:

Reading a tdms file in C++: TDMS C DLL

$
0
0

Hello,

 

I am trying to read a TDMS file in a Visual Studio C++ 2012 program.  I downloaded the DLL from http://ni.intellisurvey.com/run/2007codelicenseagree and attempted to run the example program: readfile.c

 

I got many build errors and I have listed few of them here.

Error 16 error LNK1120: 15 unresolved externals
Error 1 error LNK2019: unresolved external symbol _DDC_CloseFile@4 referenced in function _ReadFile 
Error 11 error LNK2019: unresolved external symbol _DDC_GetChannelGroupProperty@16 referenced in function _ReadGroups 
Error 4 error LNK2019: unresolved external symbol _DDC_GetChannelGroups@12 referenced in function _ReadGroups 

 

 

It would be of great help to me if anyone could guide me to resolve this

 

Regards

Padma Priya

 


Create directory in CVI

$
0
0

Hi,

I want to create directory in CVI.  did not know that C does not have a native function for it.  I tried this code (with some built-in error checks) but it seems to have some errors:

 

int Folder_Make (char Folder[])
{
    //this function takes in argument with single forward slash(es) (FS),
    //replaces them with double FS, then try to create intended folder
    int     result      =   0;
    int     len_Folder  =   strlen (Folder);
    int     len_New;    
    int     FS_count    =   0;
    int     FS_last     =   0;  //last FS flag
    int     FS_max      =   5;  //max FS
    int     FS_pos [FS_max];
    char   *MyFolder;

    //count FS
    for (int i = 0; i < len_Folder; i++)
    {
        if (Folder [i] == '\\')
        {
            FS_pos [FS_count] = i;  //FS position
            FS_count++;             //FS count
        }
    }

    //add last FS if necessary
    if (Folder [len_Folder - 1] != '\\')    FS_last = 1;
    if ((FS_last) && (FS_count < FS_max))
    {
        FS_pos [FS_count] = len_Folder; //FS position
        FS_count++;
    }

    //check for consecutive FS prior to correction
    for (int i = 0; i < (FS_count - 1); i++)
    {
        if (FS_pos [i] == FS_pos [i + 1])   result = -1;
    }

    if (!result)    //still no error
    {
        len_New     =   len_Folder + FS_count;      if (FS_last)    len_New++;
        MyFolder    =   malloc (len_New + 1);

        for (int i = 0, j = 0; i < len_Folder; i++, j++)
        {
                                        MyFolder [j]        =   Folder [i];
            if (Folder [i] == '\\')
            {                           j++;
                                        MyFolder [j]        =   '\\';
            }

            if (i == len_Folder - 1)
            {                           j++;
                                        MyFolder [j]        =   '\\';
                if (FS_last)
                {                       j++;
                                        MyFolder [j]        =   '\\';
                }
            }
        }
                                        MyFolder [len_New]  =   '\0';   //null-termination
    }

    //create folder
    MakeDir (MyFolder);

    return result;
/*  error value
    -1      consecutive FS found
*/
}

 

please help.

Cascaded counters to produce critical timing on a PCI 6601 with nidaqmx functions

$
0
0

I have an instrument that uses  NI PCI 6733 and PCI 6601 cards that controls a camera, an electronic shutter, current control FET and power supplies.  Control and timing was performed by traditional nidaq functions.  I have now updated to windows 7 and the latest Labwindows with NIDAQmx.  Part of the control involves cascaded timers outputing invidual pulses for control with critical timing in the microsecond range.  All of the experimental sequences were implemented with hardware timing using pulses generated by the various traditional daq counter application like FSK, triggerable, retriggerable.  Two timers on the PCI 6733 cascaded and produced timing/ control input to the four times on the 6601.

 

I can no longer implement the timing using the nidaqmx.  The same applications are missing and the nidaqmx functions do not seem to be capable of cascading the counters to that one counter can trigger a selectable pulse on another.  In fact going through all the examples I do not think that it is possible for one timer pulse to trigger another timer pulse on the 6601.  I know there are trigger functions but these apply to the whole task and if you have more than one counter then the trigger is configured for the whole task.  The retriggerable pulse example with the external trigger suffers from this problem because it requires a signal to be placed on the external terminal for it to run.

 

I am wondering why a multiple timer card is sold if cascaded hardware critical timing is not possible.  It seems simple but  the question boils down to "Can one counter pulse trigger another counter or trigger two counters for that matter?"

error 6210 using TDMS C DLL

$
0
0

Hi,

I am trying to read a TDMS file using TDMS C DLL in visual studio 2012. I am getting the following error message. Error 6210 : The file passed to library is read only and cannot be modified, when I try to open the file using DDC_Openfile.The program I used is TDMSTesting.zip downloaded from this link

http://forums.ni.com/t5/LabWindows-CVI/TDMS-DLL/td-p/792269

 The sample code given in the Zip file is properly running with the testtdms.tdms available in the file but I am getting the error 6210 with any other tdms files generated from labview.

It would be of great help if anyone could help me to resolve this and I have attached the sample tdms file which I used to run the code.

 

 

Thank you

Padma Priya

unable to load dll

$
0
0

I created a CVI dll to be called by C#.net and VB.net.

Runs ok on my laptop, when called by LabVIEW, and LabVIEW -> C#.net wrap.

 

Getting the following error on customer's pc:

 

load error.png

 

looks like some dll is missing.

Is there a way to look into the import table of my CVI dll ?

 

 

How to use .dll created in LabVIew with string array output using LStrHandleArray

$
0
0

I have a .dll made in LabVIEW that I want to use in CVI.  I have been able to use the rest of the functions without problem, but there is one that returns an array of ints and an array of strings.  I have access to the LabVIEW source code so there is potential to attack this from either end but first I'd prefer to just learn how to use this datatype.  Below is my header file with just the one function I'm concerned with along with the autogenerated functions and typedefs.

 

#include "extcode.h"
#pragma pack(push)
#pragma pack(1)

#ifdef __cplusplus
extern "C" {
#endif
typedef uint16_t  Mask_Type;
#define Mask_Type_SetMaskOff 0
#define Mask_Type_SetMaskOn 1
#define Mask_Type_SetMaskAll 2
typedef struct {
	int32_t dimSize;
	LStrHandle SerialNumber[1];
} LStrHandleArrayBase;
typedef LStrHandleArrayBase **LStrHandleArray;

/*!
* rb_GetDeviceInfo
*/ uint32_t __cdecl rb_GetDeviceInfo(uint32_t devices, uint32_t deviceIdx[], LStrHandleArray *deviceSerial); /* * Memory Allocation/Resize/Deallocation APIs for type 'LStrHandleArray' */ LStrHandleArray __cdecl AllocateLStrHandleArray (int32 elmtCount); MgErr __cdecl ResizeLStrHandleArray (LStrHandleArray *hdlPtr, int32 elmtCount); MgErr __cdecl DeAllocateLStrHandleArray (LStrHandleArray *hdlPtr); #ifdef __cplusplus } // extern "C" #endif #pragma pack(pop)

 

You might as well say I'm clueless as to how to allocate and use the LStrHandleArray type in the function. From my other functions, I  know in my C code how many devices there are ahead of time so I used the AllocateLStrHandleArray function with the number of devices and then passed it into rb_GetDeviceInfo function (below is a partial snippet of this part).

 

ftStatus = rb_GetNumDevices(&numDevices);
uint32_t deviceIdx[numDevices];
LStrHandleArray deviceSerialNumber = AllocateLStrHandleArray(numDevices);
ftStatus = rb_GetDeviceInfo(numDevices,deviceIdx,&deviceSerialNumber);

 

The function runs succesfully and I get the deviceIdx values back but the deviceSerialNumber remains the same as it was before the function ran.

 

I'm not sure how to allocate and use this data type so if anyone can explain it to me I'd appreciate it.  The other possibility would be to change the LabVIEW code so that it was a different type - basically this would be a char** if everything was written in C.  Is there anyway I can convert it to be a char** in my .dll?  A solution for either of these would work fine for me.

 

Thanks for the help in advance.

Viewing all 5339 articles
Browse latest View live