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

ODBC across firewall

$
0
0

We have an Access Database on a server and our test machines use an ODBC DSN to connect to it.  Works great, but now our company is forcing us to move test machines behind a firewall.  However the server with the database is not moving behind the firewall.

 

Does anyone know what port on the firewall must be open for ODBC connections to work?  Is there a better way than ODBC to make the connection to the database?

 

Thanks


LabWindows/CVI 8.0.1 to Visual Studio 2013

$
0
0

I have LabWindows/CVI 8.0.1 and Visual Studio 2013.  I'd like to convert a project from CVI to VS.  The wizard to do so ( in VS ) isn't present and I can't install it as the CVI installer looks for VS 2005 ( only? ).   It states you must have VS 2005 or higher installed but I'm guessing since the CVI 8 installer had no concept of VS 2013 when it was released that it doesn't realize 2013 is newer than 2005.  Is there a work-around, a patch that updates the wizard, etc. I can use?  Thanks.

active x library not registered

$
0
0

I am using CVI 2013 and I have several tools that I use to automatically generate and send emails. These tools  leverage the outlook2000.c, outlook2000.h, and outlook2000.fp modules. The code was primarily taken from the Samples directory within the CVI2013 directory.

 

Recently my company loaded Lync 2013 and since that point I am getting the "Active X - library not registered" message. My guess is that this is due to the install of Lync2013 affecting some of the modules that are using in the Outlook 2000 environment.

 

Are there new Source Modules and Instrument files to support migration to Outlook2013?

 

Thanks!

Ni CAN error

$
0
0

Hello,

 

I get an error on my CAN module after a crash system (randomly happen). An error message ask me to look at the nicanErr.txt. I have no idea of what does it mean. Anyone can help me on the interpretation of this file ?

 

Thanks,

Problem with connecting to NI USB6008 with LabWindows

$
0
0

Hi everybody,

 

I am making a program in LabWindows and so far I have got two instruments running without any problems. But I am trying to add an NI USB6008 to the program. I have downloaded something called "NIDAQmxBase" and added a file called "NIDAQmxBase.h" but I can´t find the ".fp" file and therefore I have no functions to communicate with the instrument.

 

Can anyone help me?

Re: I am getting the wrong RTE in my CVI distribution

$
0
0
You'll get a better response if you post to the cvi board instead of LabVIEW. You can click on options and request the moderator to move this.

CVI - Windows 10 - 2015 and onward

$
0
0

I'm looking at reviving my CVI support and updating from CVI 2009 to the current one.

 

To help justify the plunge I'd like to know more about plans for CVI2015:

  • Planned support for Windows 10 (desktop only, but for development platform and for target platform)
  • Distribution package sizes (for "Hello world")

Background / Context:

  • Microsoft seems to be poised to push everyone they can to Windows 10. With a two-year release cycle for CVI, my fear is that Win 10 support in CVI may come in Q3 2017. (Note that Windows 8 previews were out starting Sept 2011, and RTM was Aug 1 2012. CVI support required the next release: CVI 2013 came out in August 2013. Hence my "next release" forecast of 2017.)
  • Distribution packages have grown from 5 to 12 to 25 to 75 MB in the last several releases. The minimum size for CVI 2013 is a deal-breaker for us -- I get complaints about 25MB.

I don't mean to be overly negative - CVI does great things for us, but these two complex (and hard to control!) issues really are the two pain points that I'd like to see progress on.

 

Thanks,

Ian

 

analysis library multithreading problem

$
0
0

Hi All,

 

I'm having problems running a function in more than one thread at the same time.

 

The error is returned from the analysis library, so I guess my first question is "Is the analysis library thread safe?" (Specifically, Vector & Matrix Algebra functions.) I have looked through the documentation and cant see a statment either way.

 

Although I have a workaround using locks placed around all analysis library calls, I'd like to get to the bottom of this - it's got me a little worried because I've multithreaded other programs using matrix functions from the analysis library...

Another reason is my propgram processes quite a bit of data, so I'm confident I'll get a noticable speed improvement if I could remove the locks.

 

I've coped a chunk of code below.

The function works fine if:

a) it is run in a single thread only,

OR

b) running in multiple threads with USE_THREAD_LOCKS defined.

 

The function dosent work when: 

Running concurrently in multple threads, and USE_THREAD_LOCKS is not defined.

In this situation, I get a fatal runtime error at one of the matrix functions -Transpose(), MatrixMul(), or InvMatrix(). The error does not always occur and is rarely in the same place, but always comes with a message about an undersize output array.

 

To give one example with some detail:

A fatal run time error occured at InvMatrix(), with pointer C highlighted and error message:

   "Array argument too small (72 bytes). Arguement must contain at least 168 bytes"

But C is appropriatley sized as 9 doubles, given the matrix size is 3x3.

While other threads are running my function at the time of the error, no other threads appear to be using the analsys library. 

 

I've looked over this code a hundered times, looking for unsafe variables but cant see anything.

 

Any ideas?

 

Diz.

 

void FitParabolasToPeaks (float *inArr, int sz, int *peaks, peakScoreData_t *score, int numPeaks, float *refinedPeakPos, float *refinedPeakHeight)
{
int i, iD, ip, allocSz;
double coeffs[3], B[9], C[9], sse, rSq, rmse;

	for(i=0;i<numPeaks;i++)
	{
		allocSz = 20+(int)score->params[i].widthAtQuarterMax;
		double ptsX[allocSz], ptsY[allocSz];
/*
here, data is added to ptsX and ptsY.
the value of ip is set to the number of datapoints.
*/ //LS SOLVER // MEMORY ALLOCATIONS (size r * c) double S[ip], A[ip*3], AT[3*ip], D[3*ip]; // POPULATE INPUT MATRIX // Obtain A and S, our input and vector matricies, A[numPts][3], S[numPts] for (iD=0;iD<ip;iD++) { A[iD*3 ] = ptsX[iD]*ptsX[iD]; //x^2 A[iD*3+1] = ptsX[iD]; //x A[iD*3+2] = 1.0; //1 S[iD] = ptsY[iD]; } // LS MATRIX SOLVE { #ifdef USE_THREAD_LOCKS int res; res = CmtGetLock (gg_lockAAL); #endif //notes on comment style: //a) var[rSIZE][cSIZE] - indicates size of matrix in [r][c] //b) {eqn}{var} - indicates that 'eqn' was calculated previously, and is stored in 'var' Transpose (A, ip, 3, AT); // Obtain A^T store in A^T[3][numPts] MatrixMul (AT, A, 3, ip, 3, B); // Obtain {A^T}{AT} * A, store in B [3][3] InvMatrix (B, 3, C); // Obtain {(A^T * A)}{B}^-1, store in C [3][3] MatrixMul (C, AT, 3, 3, ip, D); // Obtain {(A^T * A)^-1}{C} * A^T, store in D [numPts][3] MatrixMul (D, S, 3, ip, 1, coeffs); // Obtain {(A^T * A)^-1 * A^T}{D} * S, gives end result, coeffs[3] #ifdef USE_THREAD_LOCKS if (res==0) CmtReleaseLock (gg_lockAAL); #endif } /* ... do stuff with the result ... */
} //end i loop return; }

 

 


I am getting the wrong RTE in my CVI distribution

$
0
0

I am using CVI 2009 and I am trying to create a distribution with CVI RTE 2009 but the cab file contains cvirte 2013.  The RTE files in the System32 folder are 2009 but I also have RTE 2013 files in the SysWOW64 folder.  How can I build a distribution with the 2009 RTE?  (Customer requirement)

Table control focus

$
0
0

Hello,

 

I have a table control on a panel with 'hot' control mode.  

 

When I use the scroll bar and scroll through the data it appears that the table loses focus after scrolling is complete.   The focus is set on another button on the panel.

 

I amupdating the table contents periodically through a timer callback.  In this routine I set ATTR_VISIBLE for table to 0 at beginning of routine and then set back to 1 at end.

 

I guess I'm expecting that the table would retain focus if the user scrolls through the data.

 

Does anybody know any tricks or workarounds to accomplish this?

 

Thanks,

 

 

new message

$
0
0

          

            Hello, I'm trying to draw an x-array and a y-array using ploXY function; but an inclined line is composing on my graph. I'm using that code:

 

plot_handle = PlotXY (testler, TESTLER_GRAPH, inputNumber, amplitude, 1024, VAL_INTEGER, VAL_DOUBLE, VAL_THIN_LINE, VAL_EMPTY_SQUARE, VAL_DOT, 1, VAL_RED);    

 

           In this code, inputNumber is an integer, amplitude is a double value. I'm drawing a point in the each 'for' loop using the plotXY in the above; but an inclined line that is between 0 and the last produced point, is also composing together with my correct points.

           

           How can I prevent this inclined line? 

 

Update increment (ATTR_INCR_VALUE) of a numeric control while holding mouse key pressed

$
0
0

Hallo,

 

here's a problem with a numeric control.

I have a control wich accepts a pretty large range of values: 0.01 to 60000.

What I want to do is changing of its incremental value in dependence on the current range.

 

So, if the control value is 2000..6000 to change it in step of 1000, if it's below 2000 but above 200 - in step of 100 etc.

 

The following code works if I change the value of the control with SINGLE mouse-clicks. But if I just press the left mouse key and hold it, it doesn't work!

 

Debugging shows, that it treats events correctly and passes the attribute to the control (also correctly). But changing of ATTR_INCR_VALUE seems to have no influence until I release the mouse key.

 

------------------------------------

int CVICALLBACK SetTint (int panel, int control, int event, void *callbackData, int eventData1, int eventData2)
{
   float dIncValue=10.0, dIncValue_temp;

   switch (event)
   {
          case EVENT_VAL_CHANGED:
           GetCtrlVal(hMainPanel, MAINP_INTTIME, &fTint);
           if (fTint>2000.0) dIncValue=1000.0;
           if ((fTint<=2000.0)&&(fTint>100.0)) dIncValue=100.0;
           if ((fTint<=200.0)&&(fTint>20.0)) dIncValue=10.0;
           if ((fTint<=20.0)&&(fTint>=2.0)) dIncValue=1.0;
           if ((fTint<2.0)&&(fTint>0.2)) dIncValue=0.1;
           if (fTint<=0.2) dIncValue=0.01;
          

           SetCtrlAttribute (hMainPanel, MAINP_INTTIME, ATTR_INCR_VALUE, dIncValue);
           break............

-------------------------------------

 

Adding events like

          case EVENT_COMMIT:
          case EVENT_LEFT_CLICK:
          case EVENT_VAL_CHANGED:
          GetCtrlVal(hMainPanel, MAINP_INTTIME, &fTint);...

doesn't help.

 

Swallowing events after setting of the attribute like

          SetCtrlAttribute (hMainPanel, MAINP_INTTIME, ATTR_INCR_VALUE, dIncValue);
          return 1;

doesn't help.

 


This stuff -

        ProcessDrawEvents();
        ProcessSystemEvents();

doesn't help also.

 

Any other suggestions? :/

ASAM ASAP Standards and LabWindows/CVI

$
0
0

I just received a book from ASAM that lists members and products.  There is a page for NI in this book and it lists the following (among others):

 

NI LabWindows/CVI

 

Type  ANSI C blah blah

Functionaties   blah blah

ASAM Standards   ASAM MCD-1 CCP, ASAM MCD-1 XCP, ASAM MCD-2 MC (ASAP2/A2L), ASAM MCD-2 NET (FIBEX)

 

I just searched this board from information on using ASAM (in my case ASAM-3MC), and nothing turned up.  I have written a library in Visual Basic .NET, but I need to port this over to LabWindows CVI.

 

Just what does NI have to offer for ASAM that works with LabWindows/CVI? 

 

P.S. My software need only commmunicate with the ASAP server, not the ECU itself.

How to get the panel resource ID from a panel handle ?

$
0
0

Hello,

Is there a way to retrieve the constant panel ID of a panel that was loaded with LoadPanel ?

I can always save this value in a variable when loading the panel, but I would have expected a better solution.

Thanks

How can I exit completely from a thread in LabWindows/CVI?

$
0
0

       

        Hello,

        I want to exit completely from a thread, that I composed in my code, when I click the 'Kapat' button that I composed in my user interface. I used 'CmtExitThreadPoolThread (0)' function and

 'CmtReleaseThreadPoolFunctionID (DEFAULT_THREAD_POOL_HANDLE, GraphLoopId)'  function; but the compiler gave an error in CmtExitThreadPoolThread (0).

 

       What is the reason of this error?

 

      

        The following is a part of the my code:

 

 

int CVICALLBACK CBTestleriKapat (int panel, int control, int event,
         void *callbackData, int eventData1, int eventData2)
{
 switch (event)
 {
  case EVENT_COMMIT:
   //CmtWaitForThreadPoolFunctionCompletion (DEFAULT_THREAD_POOL_HANDLE, GraphLoopId, OPT_TP_PROCESS_EVENTS_WHILE_WAITING);
   CmtExitThreadPoolThread (0);  
   CmtReleaseThreadPoolFunctionID (DEFAULT_THREAD_POOL_HANDLE, GraphLoopId);
   //CmtExitThreadPoolThread (0);
   
   DiscardPanel(testler);
   break;
  case EVENT_RIGHT_CLICK:

   break;
 }
 return 0;
}

 


double sonuc;
int plot_handle;
static int CVICALLBACK GraphLoop (void *functionData)                 // 'GraphLoop' function is my thread function. 
{
 FILE *fp;
 int i;
 fp=fopen(fileName,"a");
 fprintf(fp,"\n\n Input Number     Amplitude      Upper Level     Lower Level   Status\n\n");
 for(i=0;i<1024;i++)
 {
  hpe363xa_queryOutputVolt3631 (vi, 1, &sonuc);
  lowerlevel[i]=-3;
  upperlevel[i]=3;
    
  amplitude[i] = sonuc;
  if (amplitude[i] > upperlevel[i] || amplitude[i] < lowerlevel[i])
  {
   status[i]='F';
  }
  else
  {
      status[i]='P';
  }
  
  fprintf(fp,"   %d        %9.5f       %9.5f       %9.5f        %c\n",inputNumber[i], amplitude[i], upperlevel[i], lowerlevel[i], status[i]);
  
  inputNumber[i]=i+1;
  
  plot_handle = PlotXY (testler, TESTLER_GRAPH, inputNumber, amplitude, i+1, VAL_INTEGER, VAL_DOUBLE, VAL_THIN_LINE, VAL_EMPTY_SQUARE, VAL_DOT, 1, VAL_RED);
  
        //PlotXY (testler, TESTLER_GRAPH, inputNumber, lowerlevel, 1024, VAL_INTEGER, VAL_DOUBLE, VAL_THIN_LINE, VAL_EMPTY_SQUARE, VAL_SOLID, 1, VAL_RED);
   
  //PlotXY (testler, TESTLER_GRAPH, inputNumber, upperlevel, 1024, VAL_INTEGER, VAL_DOUBLE, VAL_THIN_LINE, VAL_EMPTY_SQUARE, VAL_SOLID, 1, VAL_RED);
 }
 fclose(fp);
 return 0;

 

 

int CVICALLBACK CBBasla (int panel, int control, int event,
       void *callbackData, int eventData1, int eventData2)                                        // The program will enter to the thread when the user clicks the 'Basla' button.
{
 switch (event)
 {
  case EVENT_COMMIT:
   
   CmtScheduleThreadPoolFunction (DEFAULT_THREAD_POOL_HANDLE, GraphLoop, NULL, &GraphLoopId);
   CmtWaitForThreadPoolFunctionCompletion (DEFAULT_THREAD_POOL_HANDLE, GraphLoopId, OPT_TP_PROCESS_EVENTS_WHILE_WAITING); 
   CmtReleaseThreadPoolFunctionID (DEFAULT_THREAD_POOL_HANDLE, GraphLoopId);  
   
   break;
  case EVENT_RIGHT_CLICK:

   break;
 }
 return 0;
}

  


A non-debuggable thread caused 'General Protection' fault at

$
0
0

Hi all,

 

 I'm using cvi 2013.

 

 i have a fata error saying "A non-debuggable thread caused 'General Protection' fault"

 

i had tried a patch NILWCVIRTE2013f1Patch

 

but the problem stayu the same,

 

i had heart that the problem could be in the cvrte.dll but i did not found it 

 

any help is welcom

 

Regards,

 

change global variable multithreaded

$
0
0

Hi,

I've encounterd an issue which I'm trying to end a thread from another thread

I have one main thread that calls two different threads (Thread1 & Thread2) as so:

 

 

Thread1()
{    ...   while (g_ThLoop)   {          ...Do stuff...   }   ...Cleanning memory etc....
}
Thread2()
{   g_ThLoop  = 0;
}

MainThread()
{
    ....    g_ThLoop = 1;   CmtScheduleThreadPoolFunction (DEFAULT_THREAD_POOL_HANDLE, Thread1, 0, &hFid1);   ....Do Stuff...   CmtScheduleThreadPoolFunction (DEFAULT_THREAD_POOL_HANDLE, Thread2, 0, &hFid2);
   CmtWaitForThreadPoolFunctionCompletion (DEFAULT_THREAD_POOL_HANDLE, hFid1, 0);
   CmtWaitForThreadPoolFunctionCompletion (DEFAULT_THREAD_POOL_HANDLE, hFid2, 0);
   CmtReleaseThreadPoolFunctionID (DEFAULT_THREAD_POOL_HANDLE, hFid1);
   CmtReleaseThreadPoolFunctionID (DEFAULT_THREAD_POOL_HANDLE, hFid2);
}

I've tried to debug in debug and release configuration but the change of g_ThLoop from Thread2 doesn't make Thread1 to exit

also tried to use CmtLock, Local Variable and Safe Variable but...with no success :smileysad:

 

Uriya

 

passing a variable type to a function

$
0
0

greetings,

 

i'm addressing an Ethercat device using the Beckhoff Twincat ADS dotnet library, that is linked into my project as an instrument i created.

 

The function in question reads an analog input into the variable whos handle i pass to it (&valueHandle1) , but also requires the variable type, of the type System_Type.

 

err = TwinCAT_Ads_TcAdsClient_ReadAny_1 (tc_handle, Var_handle1, UINT16,  &valueHandle1, &exception);

 

 

in C# the variable type is easily passed by e.g.     typeof(Uint16)  

but i'm having difficulty in Labwindows.  i tried passing the variable type directly, without success.

 

This is the function proto:

 

int CVIFUNC TwinCAT_Ads_TcAdsClient_ReadAny_1(

                TwinCAT_Ads_TcAdsClient __instance,

                int variableHandle,

                System_Type type,

                CDotNetHandle * __returnValue,

                CDotNetHandle * __exception);

 

 

and my code is attached below.

 

Any help will be appreciated

 

Thys

 

Status Bar in LabWindows/CVI

$
0
0

 

         Hello,

         I'm new in LabWindows/CVI. Is it possible to compose a status bar, like in C#, in LabWindows/CVI? Moreover, how can I place the buttons, that I composed before, onto the tabs or decoration tools?

         Good days...

CNV can't find variable on network

$
0
0

I'm starting my exploration of network variables (CNV) with the example projects.  Excellent examples.

 

Using the Polling project, I have the writer program running on one PC.  On another PC, I have the reader program running.  I modified it slightly so that the network path would be selectable using the Browser example project.

 

The Reader can't find the Writer network variable.  The browser popup (where Reader is running) finds the PC that is hosting the Writer program.  So this is good, in the sense that this verifies both PCs are on the same network and subnet.

 

But in the browser, the tree view can't find any attached network variables.  This seems like a simple problem, but I can't find any.

 

Also, if I run the Reader app on the same PC which hosts the Writer app, this browser popup finds the network variable attached.  So I know that on the same PC, Writer and Reader are working.  Just not over my network (which is kinda the whole point!)

Viewing all 5339 articles
Browse latest View live


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