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

driver issue

$
0
0

In windows 10   i need to work with cvi exe file alone in that but I did not install the cvi in that pc 

when I open my cvi exe file i got an error " the code cvirte.dll was not found reinstall the program may fix the problem " system error

whether error i got is because of the driver or i need install the cvi in that pc

 if it is driver issue please let me know how to update the driver so that driver problem is solved 

 

 


graph zooming & panning programmatically

$
0
0

I haven't quite found what I'm looking for on the forums. I am aware of interactive graphs and use them myself.  But for my users who aren't very bold when it comes to keyboard shortcuts, they just aren't aware of the power of CVI graphs. I've even tried help popups that instruct them what those keys + mouse buttons are, and they are still instinctively trying to just LEFT CLICK + drag on a graph to move it.

 

So that got me to thinking.  What if I tried to programmatically allow them to do just that.

 

What I can do is have a basic toolbar with mutually exclusive toggle buttons (one for move, one for zoom to a point, one for zoom out, etc).  Then with a combination of EVENT_LEFT_CLICK, EVENT_MOUSE_MOVE, and EVENT_LEFT_CLICK_UP on the graph control, it would be conceivable to make an "easy" pan/zoom set of tools for these users.

 

Trouble is, I'm a little stumped about how to go about this with the relative mouse position.  Do I need to dynamically find the min/max of the axis range with respect to the mouse's position?

Error -200525 when calling DAQmxReadCtrFreqScalar function

$
0
0

_TestMan__0-1582565873119.png

 

When executing line 27. What am I missing?

HW works fine and frequency value is OK in MAX.

 

Capturing Raw Input Messages

$
0
0

I'm trying to capture messages from the keyboard in my CVI application regardless of where the user touched the screen.  I found an article on using the raw input API to do this.  I made the call to RegisterRawInputDevices to tell Windows to send raw input to my CVI program.  That seemed to work correctly.  Then I called InstallWinMsgCallback to setup my callback function for WM_INPUT messages.  When the program runs I hit keys on the keyboard but my callback never gets called.  I'm not sure if the issue is with the way I'm registering the raw input or with the way I setup the WM_INPUT callback.  Code snippets are below.  Any suggestions on how to figure out what's going wrong would be appreciated.

 

In main:

WindowsHandle = GetCVIWindowHandle();

RAWINPUTDEVICE RawInputDevice[1];
RawInputDevice[0].dwFlags = RIDEV_NOLEGACY|RIDEV_INPUTSINK;
RawInputDevice[0].usUsagePage = 0x01;
RawInputDevice[0].usUsage = 0x06;
RawInputDevice[0].hwndTarget = WindowsHandle;
if (RegisterRawInputDevices(RawInputDevice, 1, sizeof(RawInputDevice[0])) == FALSE)
{
    MessagePopup("Crap!", "Didn't register");
    Error = GetLastError();
} /* if-then */
else
{
    MessagePopup("Yes!", "Success");
} /* if-else */


intptr_t TempHandle;
if ((stat = InstallWinMsgCallback (panelHandle, WM_INPUT, MainPnlMsgCallback, VAL_MODE_IN_QUEUE, NULL, &TempHandle)))
{
    MessagePopup ("Error", GetGeneralErrorString (stat));
}

 

My callback:

int CVICALLBACK MainPnlMsgCallback (int panelHandle,
                                    int message,
                                    unsigned int* wParam,
                                    unsigned int* lParam,
                                    void* callbackData)
{
    /* Pay attention if our Windows handle was changed... */
    if (message == EVENT_NEWHANDLE)
    {
        MessagePopup ("","New handle!!!");
    }
    else
    {
        char Buff[100];
        sprintf(Buff,"msg=%d", message);
    }
    return 0;
}

 

How to declare CString compatible type

$
0
0

I am trying to call a function in a DLL that I do not control.  The interface for the DLL is in ANSI C.  One function takes a void pointer.  When I looked at some MFC example code provided with the DLL, the struct being passed as the void pointer includes several CStrings.  I need to create a compatible struct that I can pass to this function in the DLL.  I tried just using void * in place of each CString like this:

 

struct MyStruct

{

    void *Name;  // originally CString Name;

}

 

The call to the DLL function does not work correctly.  I don't know if the issue is the struct I am passing or not, but that seems likely. 

 

What type should I use in C in place of CString that I can pass to the DLL function?

plot values in array of different data types on stripchart

$
0
0
I have diffferent types of array which i need to plot on left or right y axis at the same time as defined by user  when a plot button present on screen is press. here in code  index 1 and index 2 are number of elements read. Also arr1_int is interger array and arr3_float is float array.when i write above code i am getting output graph as shown in the figure attached here.Value of id is 129   and value of speed is 0.2 . but i need to plot two different traces for this two values either on same Yaxis or different y axis.
 
Code:
if(Index1>0)
PlotStripChart (gpanelHandleStatus1,CHILDPANEL_STRIPCHART,arr1_int,Index1, 0, 0, VAL_INTEGER);
if(Index3>0)
        PlotStripChart (gpanelHandleStatus1,CHILDPANEL_STRIPCHART,arr3_float,Index2, 0, 0, VAL_FLOAT)
error.jpg 

LabWindows/cvi

$
0
0

Hello, my question is how can i access to the MyRio onboard accelerometre through C programming in LabWindows/cvi ?

making OPC Server by Labwindows

$
0
0

Hi

I desperately looking for a simple example for making an OPC Server by Labwindows. Every examples discuss about make OPC client.

Please some one tell me first is it possible  to make  OPC server with Labwindows with datasocket lib? and if possible please give me a sample.

Tks


Does anyone know how I could make style of control?

$
0
0

Hello All,

 

I am trying to create a graphical control that would allow the user to access the peptide fragmentation data is a very natural way for the user. I have included an image of the type control I would like to create.

 

Each letter represent a single amino acid in a peptide sequence.  These letters would form the framework for the control. The letters for and length of the framework would be generated from an input sequence or database query.The colored hash marks denotes that a fragment was observed in the data. Each hash can denote a fragment in the forward, reverse, or both directions.  It would be awesome if the user could select the top "half" of the hash as a hot key to pull up verification data for  forward fragments, and similarly bottom for reverse data.

 

The ability to have multiple colors and type as shown  (for different fragmentation methods) would be a bonus. 

 

Thanks for any advice on how to recreate this in a CVI control would be greatly appreciated.

Greg

Peptide fragment map.jpg

How to SPI Waveform Generation on PXI-6220 Port 2 using C function calls only

$
0
0

I am currently using a system that has a PXI-6220 card to be used for digital output. I cannot use LabView for this application, I need to do everything in C. I am already using the DaqMX C library to configure the channels to write to. (I have everything working as desired for Port0 and Port1, it's port2 that I'm having issues with)

 

I have a digital waveform I need to write out on Dev1/port2/line1 (which is pin PFI-9). I need to write out the waveform on PFI-9 at the same frequency of a clock signal that I already write out on PFI-8 at 2Mhz. (I need to use these specific lines because all other lines are used up for something else on this card, and everything is already wired up for this configuration).

 

The problem is, PFI lines do not support buffered operations, so I cannot simply use DAQmxCfgSampClkTiming on the channel and write it out with a buffer.

 

I know this can be done in LabView using the SPI Digital Waveform Reference Library by generating an SPI waveform and writing out on PFI-9 at the frequency of 2Mhz. I've even seen it done in LabView and seen it work with this PXI-6220 card, so I know the functionality that I'm going for is possible with this card. But is it possible without LabView? (Unfortunately I can't just swap the wires on Port2 with Port0 which does support buffered operations, since the system is already configured to do it with port 2 and I'm not in a position where I can change that.)

 

Ultimately, my question is whether or not there exists a counter-part to the SPI Digital Waveform Reference Library but with C function calls rather than LabView. Similar to the DaqMX library that has support in LabView or in C. If so, could someone point me in the direction of that library? I haven't been able to find it anywhere on here. If it doesn't exist, I'm not positive on how to accomplish my goal, which is to write out an 8-bit waveform on PFI-9 synced to the clock I already output on line PFI-8. Can it be done without LabView?

StartTask error -88701 when using RegisterEveryNSamplesEvent

$
0
0

Hi,

 

I have two DAQmx tasks running on CompactDAQ modules:

1) Analog input (voltage), continuous acquisition, external clock (NI-9205)

2) Counter input (linear position), continuous acquisition, external clock (NI-9401)

 

I want to use RegisterEveryNSamplesEvent with both tasks. I have no issue with the analog one but I have an error (-88701) when calling StartTask for the counter one (using same algorithm).

 

I have tested both tasks separately.

 

Is it possible to use RegisterEveryNSamplesEvent with a CI task (especially Linear position) ?

 

 

Button and If()

$
0
0

Good day,

do you know how to modify the if () condition when I press a button to execute it?

 

if(EVENT_COMMIT == CallbackProtokolSklon) { WordRpt_GoToCell (tableHandle,1, 3); WordRpt_SetTextAttribute (g_docHandle, WR_ATTR_FONT_BOLD,WRConst_TRUE); WordRpt_SetTextAttribute (g_docHandle, WR_ATTR_FONT_UNDERLINE,WRConst_UnderlineNone); WordRpt_SetTextAttribute (g_docHandle, WR_ATTR_FONT_NAME, "Times New Roman"); WordRpt_SetTextAttribute (g_docHandle, WR_ATTR_FONT_SIZE, 9.0); WordRpt_SetTextAttribute (g_docHandle, WR_ATTR_TEXT_ALIGN,WRConst_AlignLeft); WordRpt_WriteToCell (tableHandle, 1, 3, "Mezní sklon [‰]: "); }
I write the word about 6 buttons anyway, but I need to say one more thing after pressing one button.
It must remain in the one method, I do not want to call it via the button function.

not sure how to do this?
provedla.jpg
Thank you

Time function

$
0
0

Hi there,

I want to get and set the current date in the numeric indicator like shown down below (day in the first numeric indicator, month in the second one and year in the third indicator) . After many searches, I found functions related to time like "time" or "localtime". Problem is that I don't know how to use them although I looked at the NI help.

I wanted to look at the examples provided by NI but the pages don't display !

So here are two questions :

  •  Can anyone explain to me how do we use "time" function ?
  • How can we see examples of functions to better understand them ?

 

Thank you 

 

Capture.JPG

Math Functions for NI-Scope

$
0
0

I am just beginning to program a PXIe-5160 and don't see any math functions in NI-Scope.  I am used to a Tektronix or LeCroy scope where the math functions are built into the scope. 

 

Do I have to write my own math functions like "Add" and "Difference"?

 

Thanks,

 

Paul

program is crashing while using Fillbytes

$
0
0

Program is crashing during the execution of this function. When tried in debug mode found that its crashing during the Fillbytes function. ( FillBytes(readback, 0, 2, 0x00); )

 

 

int test_1_041_av850(tData *data)
{
char readback[2];
TestComplete[1][5]=1;
if (TEST_RUN_MODE == PARTIAL_TEST)
{
if (TestComplete[1][4] == 0) test_1_040_av850 (&dummy);
}
// SetCtrlVal(MainPanelHandle,MainPanel_RunTimeMessagesText,"Readback created");


FillBytes(readback, 0, 2, 0x00);

RTIU_Change_Page ("N");

Delay(1.0);



/*if (ConfirmPopup ("",
"Is EMRG MIC RET on video monitor is LOW?"))
data->iMeasurement = 1;
else
data->iMeasurement = 0;*/
SetCtrlVal(MainPanelHandle,MainPanel_RunTimeMessagesText,"Reached RTIU Loc 1_041");

if (RTIU_Read_Loc (36, 9, 1, 1.0, readback) < 0)
return (-1);

SetCtrlVal(MainPanelHandle,MainPanel_RunTimeMessagesText," RTIU Loc Completed 1_041");

if (CompareStrings (readback, 0, "L", 0, 0) == 0)
data->iMeasurement = 1;
else
data->iMeasurement = 0;

return (0);
}


build does not create executable

$
0
0

Hi, I am moving from Labwindows 2012SR1 to Labwindows 2019

When i try to compile and run or debug (both 32 and 64 bit)I get the message

 

Build Status (multicars.prj - Debug)
Link multicars_dbg.exe
Failed to copy d:\Users\Langbein\MultiCars\cvibuild.multicars\Debug\multicars_dbg.exe to d:\Users\Langbein\MultiCars\multicars_dbg.exe. File not found
Build failed.

 

No further information about the issue is given. There are compiler warnings, but no errors

 

This is not a access rights issue, and the project compiles fine with Labwindows/CVI 2012 SR1

Programme for SMC 100 newport rotation stage

$
0
0

Hi,

 

I have been working on the shg(second harmonic generation). As part of experimental setup i have Newport single axis rotation stage. I want to control this stage using LabView. 

 

The program should have step size and range of rotation. please help.

 

Thank you  

Arrays of Hex numbers

$
0
0

Hello,

I was wondering if anyone could give some help as to how I could send an Array of hex numbers to a Serial Port.

I have the array data type as unsigned char, which is correct in this instance.

However using the ComWrt( function, the buffer is required to be data type char.

How is it possible to change from an unsigned char data type to char? and ultimately will this solve my problem and allow me to send packets to the serial port?

Thank in advance.

 

 

 

source code charset/encoding problems

$
0
0

Hello. My name is KB from South Korea.

I have a problem about customer's source code from French.

I've faced the messages that "The file contains characters that are invalid th the current charset/encoding and were replaced with '?'. The first invalid character is located at line xx, column xx. The file has been set to read-only. Opening the file with a different charset/encoding might fix the problem. " when I open the source code.

I've used Labwindows CVI 19 and Windows 10 64bit. I aleady installed language pack for French.

But it couldn't solve the problem.

How can I do?

 

Thanks.

Regards

KB

génerer un signal arbitraire avec le AG 33521B

$
0
0

comment faire ça avec le AG3352x

 

Send GFSK frame

AAAAB2271F2041843268C5BA53AE79E7F6DD9B

at RX_frequency at level -120dBm

Viewing all 5368 articles
Browse latest View live


Latest Images

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