LabWindows/CVI Idea Exchange

Community Browser
cancel
Showing results for 
Search instead for 
Did you mean: 
Post an idea

Sorry for the long message.

My proposals are at the very end of this post

In order to understand the rationales I propose 2 experiments

 

Experiment #1:

In C:\Users\Public\Documents\National Instruments\CVI2013\samples\userint
Open 2yaxis project

 

Here is the code of interrest (lines 131-145):

 

int CVICALLBACK ScaleIt (int panel, int control, int event, void *callbackData,
                         int eventData1, int eventData2)
{
    int val;
    
    if (event == EVENT_COMMIT)
        {
        GetCtrlVal (panel, control, &val);
        SetCtrlAttribute (panel, PANEL_GRAPH, ATTR_ACTIVE_YAXIS,
                          VAL_RIGHT_YAXIS);   
        SetCtrlAttribute (panel, PANEL_GRAPH, ATTR_YMAP_MODE, val);
        SetActiveCtrl (panel, PANEL_GRAPH);
        }
    return 0;
}

 

Set a break point line 141 (second SetCtrlAttribute())
Then comment line 141 with 2 "/" at the beginning of the line of code
Debug the project (SHIFT+F5)
Before the code start, the breakpoint move "automatically" from line 141 to 142

 

Note : This is "OK". Indeed line 141 is no longer executable so it seems reasonable to move the breakpoint to the next valid line of code.

 

When the UIR appears, click on the scale control
Once in the editor, stop the debug session

 

At this point you should see the breakpoint moving automatically from line 142 to line 141

 

Question : Why? While the breakpoint on line 142 is enable and valid , why does the breakpoint "remember" it comes from
line 141 and then "decide" do go back on this line?


I believe it has to do with the fact that CVI try to set the environment back to the state it was before debugging the code.
IMHO this is weird.

Indeed, at the end we have a source code with a breakpoint set on a commented line.

What is the value for the user?

 

 

Experiment #2 :
If you run the same experiment but, this time, starting with a breakpoint and a comment on line 142 (last SetActiveCtrl() function call)
then the breakpoint move automatically from line 142 to line 144 (return statement)

 

The issue now is that the code stop on the return statement quite often and not only when the EVENT_COMMIT is managed

 

Based on previous experiments I would like to suggest the following 

 

Plan A :


- During code edition, commenting a line of code which have a breakpoint CVI should disable the breakpoint (grey diamond). This provide visual information to the user.
- CVI should not try to find a new line of code where to set an active breakpoint
- Uncommenting a line which had a breakpoint CVI should NOT enable the breakpoint for the user. The breakpoint should stay grey. A single click on the grey diamond should enable the breakpoint (see another proposal I made about breakpoints)

 


Plan B :


- If, before execution, one breakpoint is found on a commented line
- Disable the breakpoint on the commented line (grey diamond). This provide visual information to the user.
- Try to set an new active breakpoint to the statement right after the current line of code if and only if :

a - the statement belongs to the same current block ( {.....} )

b - the condition (if any) is still valid on the selected line of code (this is already done today by CVI)

- If this is not possible, try to set an new active breakpoint to the statement right before the current line of code if and only if :

a - the statement belongs to the same current block ( {.....} )

b - the condition (if any) is still valid on the selected line of code

- Once set, even after the debugging session ends, the new active breakpoint remains active and in place

 

 

I vote for Plan B

Best regards, Philippe

Basically the API should provide

GetCVIDir(char **path);                                    // return an array of paths to the different CVI versions installed

GetCVIFilesTemplateDir(const char *path2CVI, char *path);  // if path2CVI is NULL, path target the most recent vesion of CVI installed

GetCVIProjectTemplateDir(const char *path2CVI, char *path);

GetCVISampleDir(const char *pathchar *path);

...

 

It is always possible to write such functions but for example, for the samples directory this is a pain because you need to resolve the CVI Samples.lnk file using IShellLink interface, OLE32 etc.

Best regards, Philippe

First of all : I LOVE the Format File and Format Selection and many thanks for the existing options in the dialog box (pointer for example)

 

Here is what I propose :

 

1 - "Function calls on single line" check box in the Miscellenaous section of the dialog box so that :

 

int CVICALLBACK ScaleIt (int panel, int control, int event, void *callbackData,
                         int eventData1, int eventData2)
{
    int val;
    
    if (event == EVENT_COMMIT)
        {
        GetCtrlVal (panel, control, &val);
        SetCtrlAttribute (panel, PANEL_GRAPH, ATTR_ACTIVE_YAXIS,
                          VAL_RIGHT_YAXIS);   
        SetCtrlAttribute (panel, PANEL_GRAPH, ATTR_YMAP_MODE, val);
        SetActiveCtrl (panel, PANEL_GRAPH);
        }
    return 0;
}

 The code above comes from ..\CVI2013\samples\userint\2yaxis.prj

 

Is transformed in :

 

int CVICALLBACK ScaleIt (int panel, int control, int event, void *callbackData, int eventData1, int eventData2)
{
    int val;
    
    if (event == EVENT_COMMIT)
        {
        GetCtrlVal (panel, control, &val);
        SetCtrlAttribute (panel, PANEL_GRAPH, ATTR_ACTIVE_YAXIS, VAL_RIGHT_YAXIS);   
        SetCtrlAttribute (panel, PANEL_GRAPH, ATTR_YMAP_MODE, val);
        SetActiveCtrl (panel, PANEL_GRAPH);
        }
    return 0;
}

 

Please note this apply not only to the SetCtrlAttribute() function call but also to the ScaleIt() function itself (very first line)
A long time ago it was OK to restrict ourselves to 80 chars per line but today I feel more confortable with statements on one line

 

2 - "Insert empty line before first statement in function definition" check box in the Miscellenaous section of the dialog box
Especially usefull when you use the Java Formating Option where the '{' is at the end of the line


With the previous sample code :

 

int CVICALLBACK ScaleIt (int panel, int control, int event, void *callbackData, int eventData1, int eventData2)
{
    int val;
    
    if (event == EVENT_COMMIT)
        {
        GetCtrlVal (panel, control, &val);
        SetCtrlAttribute (panel, PANEL_GRAPH, ATTR_ACTIVE_YAXIS, VAL_RIGHT_YAXIS);   
        SetCtrlAttribute (panel, PANEL_GRAPH, ATTR_YMAP_MODE, val);
        SetActiveCtrl (panel, PANEL_GRAPH);
        }
    return 0;
}

 

The formated source (Java) should be :

 

int CVICALLBACK ScaleIt (int panel, int control, int event, void *callbackData, int eventData1, int eventData2) {
  
  int val;

  if (event == EVENT_COMMIT) {
    GetCtrlVal (panel, control, &val);
    SetCtrlAttribute (panel, PANEL_GRAPH, ATTR_ACTIVE_YAXIS, VAL_RIGHT_YAXIS);
    SetCtrlAttribute (panel, PANEL_GRAPH, ATTR_YMAP_MODE, val);
    SetActiveCtrl (panel, PANEL_GRAPH);
  }
  return 0;
}

 

Instead of : 

 

int CVICALLBACK ScaleIt (int panel, int control, int event, void *callbackData, int eventData1, int eventData2) {
  int val;

  if (event == EVENT_COMMIT) {
    GetCtrlVal (panel, control, &val);
    SetCtrlAttribute (panel, PANEL_GRAPH, ATTR_ACTIVE_YAXIS, VAL_RIGHT_YAXIS);
    SetCtrlAttribute (panel, PANEL_GRAPH, ATTR_YMAP_MODE, val);
    SetActiveCtrl (panel, PANEL_GRAPH);
  }
  return 0;
}

 

Pay attention to the "int val;" declaration with one spacing line in the first code and no spacing line in the second one.

 

Best regards, Philippe

 

To make a long story short : Breakpoints should be a kind of "3 or 4 states round-robin object" with some sort of memory regarding the condition (if any)

 

Let me explain...

 

Let start on one line with an empty margin
first click  : set breakpoint     - red diamond
second click : disable breakpoint - grey diamond
third click  : delete breakpoint  - empty margin

 

At this point, when the user click again and again in the margin he can see the red, grey and empty margin cyclically. Yes, 3 clicks are now needed in order to recover an empty margin (instead of 2 actually)


The behavior above ehance the existing behavior. Indeed, it gives more option to the user (disable breakpoint) without changing the way of working. In addition, it help users to discover breakpoints can be disable.

 

Now let's look the case where, at one point the user set a condition for the breakpoint

 

Again, let's start on one line with an empty margin
first click  : set breakpoint     - red diamond
right click  : edit breakpoint    - yellow rectangle (should be yellow diamond, small change in the display)
second click : disable breakpoint - grey diamond (instead of grey rectangle, this is a disable breakpoint)
third click  : delete breakpoint  - empty margin

 

Then, when the user click again and again in the margin he can see the red, yellow, grey diamonds and empty margin cyclically. 
Please note that the latest condition of the conditional breakpoint is set/recall automatically when the yellow diamond appears (memory effect). 

 

Again, the behavior above ehance the existing behavior. The key point is that you "do not loose" your condtionnal breakpoint when you click on it. I know it is not true since the breakpoint is still in the list of breakpoints but this is a frustrating experience when you click on a yellow recetangle and whe you see it "disapear".

Last but not least, overing a yellow diamond (rectangle) should display the condition in a tooltips (passcount = x - condition is : "sdfsdfsf"). I know it has been already propose and it is under consideration.

 

Best regards, Philippe 

Hi,

 

in many of my applications, I have to verifiy some conditions recursively and they can generate an error, for example when checking the presence of a file (see below).

Imagine to have a task doing this, and imagine the task is scheduled every 5 seconds or less.

This means you'll get the popup window continuosly and it makes almost impossible to debug your code.

I know I can reduce the Debugging level from Extended or Standard to No RunTime Checking in order to block that popup window, but sometime I need a deeper level of debug to fix my problems.

What do you think about adding a third button to ignore, for the current debugging session only, the run time errors generated from the same instruction?

More, what do you think about adding a fourth button to ignore, for the current debugging session only, the run time errors of the same type?

 

Regards

Sergio

It would be great if NI could provide standard translations of the NI runtime message file msgrte.txt in commonly-used languages.

 

Whilst we can get translations done ourselves, it is normally done by translators who have little knowledge of the runtime context so the quality is rather variable; also, I get the feeling that we are duplicating effort that may have been already spent elsewhere.

 

If it helps, I for one would be willing to pay for a decent translation.

Hi,

 

It would be nice to be able to set the ON and OFF values on toggle buttons the same way that they can be set for binary switches, instead of having them hardcoded to be 1 and 0.  Thanks..

CTRL+Q should highlight all instances of the results in the editor

Same thing with CTRL+F

This is similar to Notepad++ for example

 

I find the ALT+UP ARROW and ALT+DOWN ARROW of Visual Studio 2013 quite useful (move selected lines)

 

Please, implement CTRL + L to delete a line

I know the short cut is already owned by "go to line" but my current macro is not that good 😞

 

It seems macros are not working in the editor while debugging a code.

Could be usefull.

Will be mandatory if one day the "Comment multiple lines" is implemeted using a macro 🙂

 

Best regards, Philippe

Quite often I need to look at one project source code while working on a second one

So, I use Windows File Explorer, find my project of interrest then double click on the .cws file

In this case, CVI load the cws file in the running instance of the IDE

This is not really what I want

I would like CVI  opens the workspace in a new instance of the IDE (similar to what is done when, in a function panel help, you click on the "open sample code" button)

For what I remember I believe the above behavior is the one adopted by Visual Studio Express 2013

So far, I must remember to run a second instance of CVI first and then drag'n drop the cws file

 

Regards, Philippe

 

PS : drag'n drop a .cws or .prj should work on the CVI Welcome page

 

The search function differentiates between "xxx(..." and "xxx (..."  or  "xxx[..." and xxx [...". Frequently you find both writings in the same file.

I did not even find a way to specify the an option to ignore blanks in the regular expression search (does it exist, and I didn't find it?).

I would appreciate if the search function would ignore blanks e.g. for function calls and arrays

Up to CVI 2012 the mode of the build was shown as "create release executable" or "create debug executable". This has been changed simply to "build" without showing the mode selected. Thus it not obvious anymore, which kind of executable is being built.

Please reinstall this important little note:

Switching between debug and release is a relatively frequent action, and it should be shown clearly which mode is being built

Currently, CVI sorts all the entries from the Source Code Browser alphabetically. While this is useful for finding items, it is less practical when tracking items.

 

If we have, for instance

void foo()
{
    int a = 0, c = 0;
}

// 1000 lines of code

void bar()
{
    int b = 0;
}

In the source code browser, under Variables, we will have:

a (line 3)
b (line 1000+)
c (line 3)

 

I believe that having an option to sort the items either alphabetically or by occurence would give users a better view of their code.

Add an option in FileSelectPopup() to escape the backslash (\) to (\\) in path names.  CVI and Win-7 do not work with single backslashes in path names.

 

example: 

  fp=fopen("C:\temp\TEST.txt","w"); // open the file for writing  *** Will not work. ***

 

  fp=fopen("C:\\temp\\TEST.txt","w"); // open the file for writing  *** Good ***

 

If we can add the backslash(s) in using a FileSelectPopup() option, this problem goes away.  

We have a nice password control for user management. Alas, we are on our own when it comes to secure networking or saving/retrieving the data, passwords etc.

It would be nice to have some sort of cryptography.fp included. The simplest I found was the blowshish algorithm: it is fast and as far as I know, sound too. A crypto-module could be built around it. Moreover, it is available for Labview already...

My CVI application started to generate linker errors immediately after I upgraded from CVI 2012 to CVI 2013. A number of other people have reported exactly the same problem, with the linker unable to resolve symbols found in IMAQdx or nivision.

 

This means that the final release of the new version of CVI cannot have been tested when using the image acquisition or image processing add-ons.

 

I suggest that, in future, new versions of all tools are subjected to automatic regression tests against the examples distributed by National Instruments before release. Because it obviously doesn't happen now.

I feel that beginners might study the examples provided with CVI more frequently / in more detail if they were more aware of the Example Finder. Right now, it can be only found via the Help menu. I think that the Example Finder is as important as the Release Notes or the Readme and thus should be more visible.

 

Suggestion: Add the Example Finder to the Startup menu.

The PrintPanel function has the capability to display the print dialog box.  This would be a nice addition to PrintTextBuffer and PrintTextFile functions also.

I am facing an issue of crash using LabWindows 12.0.1 (on Windows 7 OS) with no error message at all.

Only the icon is changed into a blue-color ring, and nothing else.

Even Task manager is not able to kill LabWindows process.

The only way is to re-boot the computer.

I've contacted NI support, but I am not able to give to them any error message.

 

Hypothesis is that it is quiet long to access files, because the whole software project is stored throuh ClearCase onto a distant server.

 

This is why it could be usefull to add a mechanism which records several debug information for NI support team.

This feature is already included into other NI products, such as LabView.

For exemple, a log file could be created and filled-in with debug information each time an instance of LabWindows is loaded.

 

On the tab control property page there is no way to set the control mode as indicator.

However this can be done programmatically with SetCtrlAttribute (panelHandle, PANEL_TAB, ATTR_CTRL_MODE, VAL_INDICATOR); which has the effect of preventing the operator to change the shown page.

 

It would be handy to be able to set this attribute at design time too.

I noticed in LabView that there is a HTTP Client Palette library written with the underlying libcurl open source library. The one particular VI is the HTTP Post Multipart VI that I am interested in. Why can't Lab Windows CVI have a similar HTTP Client Library in future versions of Lab Windows CVI for HTTP Clients?