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

Font Resizing - TSUI.h

$
0
0

I'm trying to change the font size when a caption has been updated inside a label box.

The properties image allows me to change the font size to 39.75 as shown; however, it seems that when I do a post to the caption, the size gets set to a default value.

 

I checked to make sure that the font source is still set to 0 (FontSource_UseFontProperty).

Now, interestingly enough, I'm able to set the fore color of the caption, but any other attributes doesn't work. For example: TSUI_LABELSETENABLE.

 

Does anyone ever have the same situation? I've looked through the forumn and online and it doesn't seem to have information.

 

Side note: It seems that NI doesn't support Vertical Align properties yet either Smiley Sad


How to use the NI - VISA PXIE driving and using LabWindows CVI realize communication program?

$
0
0

I want to use the NI - VISA Driver Wizrard PXIE Driver, and using LabWindows CVI realization of PC interface to write, but I don't know what to do, where there is NI - VISA PXIE drive and LabWindows CVI code examples?

Pirani / Penning numeric meters

$
0
0

Hello all,

In the user interface I have to represent a Pirani pressure gauge and a Penning pressure gauges. They are some kind of weird non-linear indicators. Given a 0 to 10V value, the range is something like 1e-2 to 100 for the Pirani and 1e-8 to 1e-4 for the Penning. See pic.

 

Any idea what the best way to represent this may be ?

I couldn't think of a better way than to overlay a numerical meter with a transparent background to a picture of the meter in a Picture control.

integrating a usb camera to labwindows CVI

$
0
0

Hello

I'm starting work in vision industry project 

I want to know how can i integrate a usb camera into labwindows CVI

Thank you

Create/USE XML initialization file

$
0
0

Hello everyone,

 

I have a request to create configuration file using XML format. I am familiar with *.ini files for now, and didn't use XML yet. 

The primary objective of that file is to initialize program parameters/variables on startup. 

 

I am following this XML topic regarding XML advantages and fp file location.

I would kindly appreciate any simple example that provides a functionality that I described above. 

 

Thanks in advance for any tip or example.

DAQmxWriteAnalogF64 returns error -200288 when called the second time.

$
0
0

I'm using DAQmxWriteAnalogF64() to write arrays of values to an analog output channel. It works fine the first time DAQmxWriteAnalogF64() called. The second call fails as follows:

 

Function DAQmxWriteAnalogF64: (return value == -200288)

Attempted to write a sample beyond the final sample generated. The

generation has stopped, therefore the sample specified by the

combination of position and offset will never be available.

 

Specify a position and offset which selects a sample up to, but not

beyond, the final sample generated. The final sample generated can be

determined by querying the total samples generated after a generation

has stopped.

Attempted to Write Sample: 101

Property: DAQmx_Write_RelativeTo

Corresponding Value: DAQmx_Val_CurrWritePos

Property: DAQmx_Write_Offset

Corresponding Value: 0

 

If I delete the task and create it again every time I call DAQmxWriteAnalogF64() everything works fine. But surely that's not the "right" way. Or is it?

 

The error message seems to indicate that subsequent calls to DAQmxWriteAnalogF64() add the new array of samples to the end of some output buffer. How do I tell it to start over at the beginning of the buffer each time DAQmxWriteAnalogF64() is called?

 

All I want DAQmxWriteAnalogF64() to do is transmit an array of samples I provide each time I call it. It works on the first call only.

 

How do I "specify a position and offset" as directed in the above text?

 

How do I "querying the total samples generated" as directed?

 

Is it possible to reset the task without deleting and recreating it each time I call DAQmxWriteAnalogF64()?

 

I found a function that appears to change an attribute of the task from "relative" to "offset" positioning of the buffer pointer. But the function doesn't provide enough parameters to do what it says it does. The function is DAQmxResetWriteAttribute(). It has an attribute called "Relative To". The help text says to specify a value for the attribute of either DAQmx_Val_FirstSample or DAQmx_Val_CurrWritePos, but there's no parameter available to do that.

 

Please help, I'm lost!

 

 

 

Documentation for instrument drivers

$
0
0

Hello everybody,

 

I have a question to the instrument drivers I can use in Labwindows like NIDAQmx I/O Controls --> daqmxioctrl.fp.

There are often functions that I really need but they are not part of the normal libraries. When I search in the internet I find then a link to the .fp data. But the problem is, that I can not found a documentation where I can see where these .fp data are and what they do. I must always guess what it is. When I include it in the program I have some information over the help. Is there a documentation where I can see a short description about the instruments and where I can find them? I use two instruments an both of them have a complete different path.

 

Hope somebody can help.

 

Best Regards

 

Getting the original size of an image in a picture control

$
0
0

Hello all,

how do I get the original size of the image contained within a picture control (which has been resized) ?

I thought I could simply do:

 

SetCtrlAttribute(pnl, ctrl, ATTR_FIT_MODE, VAL_SIZE_TO_IMAGE);
GetCtrlAttribute(pnl, ctrl, ATTR_WIDTH,  &W);
GetCtrlAttribute(pnl, ctrl, ATTR_HEIGHT, &H);

But I still get the size of the control, not the image. Even if I call ProcessDrawEvents in between.


连续采集模式

$
0
0

        请问在模拟输入任务中连续采集模式下,如果调用了DAQmxConfigureLogging()函数用TDMS文件保存数据的情况时,数据是如何写入TDMS文件中的,是否时在模拟任务开始后,系统会自动开辟一个专门的线程,将数据会自动的保存至TDMS文件中?

        如果出现调用了DAQmxConfigureLogging(gTaskHandle,TDMSfilePath,DAQmx_Val_LogAndRead,"GroupName",DAQmx_Val_OpenOrCreate)函数,但是在模拟任务开始后,TDMS文件中有写入关于任务的组、通道等信息,但是却没有数据,可能的原因是什么呢?

        我在一个程序中出现了上述问题,因为设置为了 LogAndRead模式,我用DAQmxReadAnalogF64()函数也能够读取到有效的数据,唯独在TDMS文件中没有数据。。。。Help,Help, Help

 

How to show the result from FFT2D ?

$
0
0

Hi,

I used this function on my project:

 

FFT2D(signal, NUM_ROWS, NUM_COLS, NUM_ROWS, NUM_COLS, 0, fftOut);

 

Now I want to show the result (fftOut) on picture.

 

for example (matlab code):

fftOut= fftshift(fft2(signal));
imagesc(abs(fftOut));
 
What should I do?
 
Thanks,
Or

 

How to convert DOS file to UNIX file?

$
0
0

Hi everyone,

I want to create a text file which has LF character as EOL. But in LabWindows the "\n" or "0x0A" generate CR/LF as EOL. How can i solve this problem?

Or can we convert this text file with windows command prompt?

Function for extracting a character string???

$
0
0

Good evening I'm a beginner to learn "CVI " i need your help
My question is how to extract a string of characters like "good evening" I want to read "ood evenin "??  plz do answear me 

Conflict between LabWindows and LabView on Linux

$
0
0

Hello all,

I've had CVI running on a Linux machine for a while, but we needed to also install LabView (ver 2014). During the install there were plenty of conflicts, so we tried doing the opposite: I removed CVI and installed LV. Now that I try to reinstall CVI I get the same kind of conflicts:

        file /usr/local/natinst from install of nicvirte-13.0.0-29.i386 conflicts with file from package nigmpi-14.0.0-f0.i386
        file /usr/local/natinst from install of nicvirte-13.0.0-29.i386 conflicts with file from package niwebpipelinei-2.0.5-f3.i386
        file /usr/local/natinst from install of nicvirte-13.0.0-29.i386 conflicts with file from package nitdmsi-14.0.0-f0.i386
        file /usr/local/natinst from install of nicvirte-13.0.0-29.i386 conflicts with file from package lvsupport2014-vianalyzer-14.0.0-f0.i386
        file /usr/local/natinst from install of nicvirte-13.0.0-29.i386 conflicts with file from package nipalerri-14.0.0-f0.noarch
        file /usr/local/natinst from install of nicvirte-13.0.0-29.i386 conflicts with file from package nispyi-2.8.1-f0.i386
        file /usr/local/natinst from install of nicvirte-13.0.0-29.i386 conflicts with file from package nimdnsresponder-2.2.0-f0.i386
        file /usr/local/natinst from install of nicvirte-13.0.0-29.i386 conflicts with file from package nikal-bin-14.0.0-f0.x86_64
        file /usr/local/natinst from install of nicvirte-13.0.0-29.i386 conflicts with file from package nikali-14.0.0-f0.noarch
        file /usr/local/natinst from install of nicvirte-13.0.0-29.i386 conflicts with file from package nipalki-14.0.0-f0.x86_64
        file /usr/local/natinst from install of nicvirte-13.0.0-29.i386 conflicts with file from package nipali-14.0.0-f0.i386
        file /usr/local/natinst from install of nicvirte-13.0.0-29.i386 conflicts with file from package niorberri-3.1.0-f0.noarch
        file /usr/local/natinst from install of nicvirte-13.0.0-29.i386 conflicts with file from package niorbki-3.1.0-f0.x86_64
        file /usr/local/natinst from install of nicvirte-13.0.0-29.i386 conflicts with file from package niorbi-3.1.0-f0.i386
        file /usr/local/natinst from install of nicvirte-13.0.0-29.i386 conflicts with file from package nidimerri-3.1.0-f0.noarch
        file /usr/local/natinst from install of nicvirte-13.0.0-29.i386 conflicts with file from package nidimki-3.1.0-f0.x86_64
        file /usr/local/natinst from install of nicvirte-13.0.0-29.i386 conflicts with file from package nidimi-3.1.0-f0.i386
        file /usr/local/natinst from install of nicvirte-13.0.0-29.i386 conflicts with file from package nimdbgerri-3.1.0-f0.noarch
        file /usr/local/natinst from install of nicvirte-13.0.0-29.i386 conflicts with file from package nimdbgki-3.1.0-f0.x86_64
        file /usr/local/natinst from install of nicvirte-13.0.0-29.i386 conflicts with file from package nimdbgi-3.1.0-f0.i386
        file /usr/local/natinst from install of nicvirte-13.0.0-29.i386 conflicts with file from package nimxdferri-3.1.0-f0.noarch
        file /usr/local/natinst from install of nicvirte-13.0.0-29.i386 conflicts with file from package nimxdfki-3.1.0-f0.x86_64
        file /usr/local/natinst from install of nicvirte-13.0.0-29.i386 conflicts with file from package nimxdfi-3.1.0-f0.i386
        file /usr/local/natinst from install of nicvirte-13.0.0-29.i386 conflicts with file from package nipxipfki-2.1.0-f0.x86_64
        file /usr/local/natinst from install of nicvirte-13.0.0-29.i386 conflicts with file from package niapalerri-2.3.1-f0.i386
        file /usr/local/natinst from install of nicvirte-13.0.0-29.i386 conflicts with file from package nipxipfi-2.1.0-f0.i386
        file /usr/local/natinst from install of nicvirte-13.0.0-29.i386 conflicts with file from package nipxirmi-2.8.0-f0.i386
        file /usr/local/natinst from install of nicvirte-13.0.0-29.i386 conflicts with file from package nimxdfi-3.1.0-f0.x86_64
        file /usr/local/natinst from install of nicvirte-13.0.0-29.i386 conflicts with file from package nimdbgi-3.1.0-f0.x86_64
        file /usr/local/natinst from install of nicvirte-13.0.0-29.i386 conflicts with file from package nidimi-3.1.0-f0.x86_64
        file /usr/local/natinst from install of nicvirte-13.0.0-29.i386 conflicts with file from package niorbi-3.1.0-f0.x86_64
        file /usr/local/natinst from install of nicvirte-13.0.0-29.i386 conflicts with file from package nipali-14.0.0-f0.x86_64
        file /usr/local/natinst from install of nicvirte-13.0.0-29.i386 conflicts with file from package niiotracei-14.0.0-f0.i386
error: Failed dependencies:
        nicvirte >= 13.0.0-29 is needed by nicvi2013-core-13.0.0-29.i386

How do I install both. With NiDaqMx.

Using launchExecutable to call cygwin with commands

$
0
0

Hello all,

 

I want to be able to press a button & I want the system to call cygwin & then trigger a .sh file.

 

Two sh files shall be run consecutively.

 

Whereby the first is used to start a service

Whereby the second is used to run some bespoke command.

# step1

launchexecutable("$pathtoCYGWIN") 

# within cygwin run ./esidebug.sh (In the home directory that becomes path on initiation of cygwin)
# NOTE LaunchExecutable("C:\\cygwin64\\bin\\bash.exe \c C:\\cygwin64\\home\\wesleyt\\esidebug.sh" DOESN'T WORK
#Step2
launchexecutable($pathtoCYGWIN") // with different cmd (gdb -targ $userspecifiedtarget ....etc)

Any help will be greatly appreciated.

 

Regards,
Wes

NI USB-8452 SPI clock rate

$
0
0

Hello everyone,

I have a NI USB-8452 SPI device, and the hardware and software manual states that the supported clock rates for SPI for this device are:

48 kHz, 50 kHz, 60 kHz, 75 kHz, 80 kHz, 96 kHz, 100 kHz, 120 kHz, 125 kHz, 150 kHz, 160 kHz, 200 kHz, 240 kHz, 250 kHz, 300 kHz, 375 kHz, 400 kHz, 480 kHz, 500 kHz, 600 kHz, 750 kHz, 800 kHz, 1 MHz, 1.2 MHz, 1.5 MHz, 2 MHz, 2.4 MHz, 3 MHz, 4 MHz, 6 MHz, 12 MHz

However if I use ni845xSpiConfigurationSetClockRate to set the clock rate to 1 (meaning 1 KHz) there is no error. If I retrieve the current clock rate with ni845xSpiConfigurationGetClockRate it confirms that the current clock rate is 1 KHz.

Even weirder is that if I set the clock rate to 48 (which the manual says that the board supports), I get an error:

"The passed-in clock rate was lowered to a clock rate value that the hardware supports. Refer to your hardware documentation for supported clock rates."

If I set to 15KHz it gives me the same error. For clock rates of 2, 3, 5, 10, 20, 100 or 1000 KHz it does not complain.

Am I missing something? It seems that the driver behavior does not match what is specified in the manual.

Best regards,
André


How to load wav file on CVI

$
0
0

Hello, 

I have a project on uploading two diffrent audio files, and combining them together. 

Is there a way to upload the wav file as an array on CVI?

 

Second, I would like to active the mix file on the UIR, is there a way to play the record on some kind of a media player? or anything on active X on CVI?.

 

Thanks for your help!

labwindows generic function

$
0
0

hiiii,I want some examples to create a generic function with switch case thx . 

Feature Request, Graph border

$
0
0

With a graph control with a white plot background and white graph background
the right and lower plot box borders disappear (see attached example).  I contacted support and they tell me the border color cannot currently be changed and I should submit a feature request.

Left mouse click+canvas

$
0
0

Hello.

I have been making this mini game where you have a black ball on a black canvas which moves according to the timer and gets brighter and brighter.

The user need to click on the ball (somewhere on it, it has a diameter of about 30) to stop the clock and end the game.

I've tried using GetRelativeMouseState to get the mouse coordinates and then comparing them to the x,y co of the ball.

Then checking if they match (or within the diameter) the ball and the timer should stop.

For some reason it doesn't work and I'm fairly new to using left mouse click and state.

here is the part of the code that I need help with:

 

int CVICALLBACK timerFunc (int panel, int control, int event, //circle game timer func (move ball)
void *callbackData, int eventData1, int eventData2)
{

    switch (event)
   {
   case EVENT_TIMER_TICK:
   circleCount=circleCount+0.01;
   colorCirc=MakeColor (r, g, b);
   SetCtrlAttribute (panelHandle_circ, PANEL_CIRC_CANVAS_CIRC, ATTR_PEN_COLOR, colorCirc);
   SetCtrlAttribute (panelHandle_circ, PANEL_CIRC_CANVAS_CIRC, ATTR_PEN_WIDTH, 100);
   CanvasStartBatchDraw (panelHandle_circ, PANEL_CIRC_CANVAS_CIRC);
   CanvasClear (panelHandle_circ, PANEL_CIRC_CANVAS_CIRC, VAL_ENTIRE_OBJECT);
   x=x+vx;
   y=y+vy;
   CanvasDrawPoint (panelHandle_circ, PANEL_CIRC_CANVAS_CIRC, MakePoint(x,y));
   if(x>=canvasW-15)
      {
         vx=-(vx);
      }
   if(y>=canvasH-15)
      {
        vy=-(vy);
       }
    if(x<=15)
      {
       vx=-(vx);
      }
    if(y<=15)
     {
       vy=-(vy);
      }
 switch (event)
    {
       case EVENT_LEFT_CLICK:
      GetRelativeMouseState (panelHandle_circ, 0, &mousePosX, &mousePosY, NULL, NULL, NULL);
      if ((mousePosX<=x+15)&&(mousePosX>=x-15)&&(mousePosY<=y+15)&&(mousePosY>=y-15))
            {
                SetCtrlAttribute (panelHandle_circ, PANEL_CIRC_TIMER, ATTR_ENABLED, 0);
                MessagePopup ("All Done!", "Good job! Play Another Game!");
            }
    }
break;
}
return 0;
}

How to include wchar.h

$
0
0
Is there a way to include this header file? There is some code that I'm porting over that uses that library and I'm wondering if anyone has found a way around this? The closest solution I've found is using mbsupp.h for multibyte characters in the ansi_c.h library.
Viewing all 5339 articles
Browse latest View live


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