LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

LabWindows/CVI Tips 'n Tricks

This last tip is effective at least from CVI 6 (I cannot test for previous versions at the moment Smiley Wink )


Proud to use LW/CVI from 3.1 on.

My contributions to the Developer Community
________________________________________
If I have helped you, why not giving me a kudos?
0 Kudos
Message 11 of 42
(22,589 Views)
Situations where your CVI program is instantiated outside your control (like ActiveX) and you want to debug it are tricky because the CVI debugger does not support attaching to running modules. One trick to debugging such cases is to add an assert(0) statement where you want to break into the program and then let it run. When the assertion is hit, you will get a dialog box allowing you to debug the program, if no other debugger is currently attached to the process.

Message Edited by Support on 03-26-2007 08:58 AM

Message 12 of 42
(20,715 Views)
Using "Set Next Statement" to decide the next line to execute during debugging
 
In CVI 8.0.1, when you are running your code in debug configuration, after you hit a breakpoint you can freely choose the next line that will execute.
 
Simply place the cursor on the next line you want to execute and press Ctrl+Shift+F7 or select it from Run menu.
You will see the execution highlight moving to that line and if you press F8 or F10 to single-step, only that line will execute.
 
Together with debug-time variable editing (that always existed) this provides great flexibility during program development and saves a lot of time since you do not have to run the program from the begining to try a new variable value.
 
I could not see this in version 6.0, but I am not sure in exists in 7.x
S. Eren BALCI
IMESTEK
0 Kudos
Message 13 of 42
(20,496 Views)
Ian,
I could not understand exactly what does "Auto hide Project and Library Trees" do? Can you clarify with a snapshot?
 
I also could not find "Tools > Preprocess Source File" in the menu and Ctrl+Tab does not do anything. Are they available in 8.1?
Could you edit your post to include the information.
Thanks...
S. Eren BALCI
IMESTEK
0 Kudos
Message 14 of 42
(20,499 Views)

Eren,

Thanks for the question. It shows how we all have different workflow practices. Due to time limits I could not go back and edit the post, so here is the much-needed clarification: 

  • When the "View >>Window Confinement Region" option is selected in the workspace window, then the "Autohide Project and Library Trees" causes the left pane with those trees displayed to collapse to the left, leaving a larger screen space to edit the source, uir, etc. (Display of those trees is enabled through the View menu in the workspace window.)
  • When the "View >>Window Confinement Region" option is selected in the workspace window, Ctrl+Tab cycles between open source and uir file windows.
  • And finally, the "Tools > Preprocess Source File" is available only when editing a .C source file (i.e. that window has input focus).

--Ian

P.S. These features are certainly available in version 8.0, and were I believe introduced in 7.0 or 7.1.

Message Edited by Ian W on 04-13-2007 09:54 AM

Message 15 of 42
(20,472 Views)
One can use SetCtrlAttribute to change the color of a control and even make it transparent.
This is also possible in design time. It is the leftmost cell in the bottom (grayscale) line in the color palette.
 
There is a letter 'T' over there. If you click it, every control you click afterwards with the paintbrush will become transparent.
Together with assigning transparent color for a .ico or .png files this possibility helps you to design better looking UI designs.
 
In the attachments, palette.bmp shows the location of the T in the palette and before/after.jpg shows 2 picture command buttons before and after applying transparency.
Finally they become round and octagonal command buttons and they look good on the UI.
S. Eren BALCI
IMESTEK
Download All
Message 16 of 42
(20,281 Views)
When trying to design a graphical user interface for an application of mine I came into this suggestion from LuisG that in my opinion it's worth a mention into this thread.
 
Luis has published some undocumented attributes of ring controls that may come in handy especially for larger controls as they permit to alter the dimensions of up and down arrows for ring controls which normally keep original size even when using larger fonts. Here an example of the results:

Message Edited by Roberto Bozzolo on 05-25-2007 03:38 PM



Proud to use LW/CVI from 3.1 on.

My contributions to the Developer Community
________________________________________
If I have helped you, why not giving me a kudos?
Message 17 of 42
(19,975 Views)
If you are experiencing problems on integrating your CVI application in its target environment (which is probably not your local code development PC) this facility might be a life saver for you.
 
It enables you to debug your code, either DLL or EXE, while it is running on your target environment (computer and hardware) as if it is running on your local PC.
 
Together with Windows XP Remote Desktop tool, remote debugging might help you understand what is going wrong in your code without leaving your safe cubical/room/etc.
All you need is a TCP/IP connection between the two computers (local: one with the development environment and debugger and target: one with your test hardware).
 
To start remote debugging you need to:
  1. Copy the ConfigureRemoteDebugging.exe file from your CVI/bin directory to the target computer and execute
  2. Type in your local PC's IP address which you can get using the ipconfig command in DOS prompt
  3. In the local PC, open the project and build a debuggable EXE/DLL and copy it to the target.
  4. From the CVI menu go to Run>Switch Execution Target>Select Target with Options. Type your target computer IP address.
  5. From the CVI menu go to Run>Debug.
  6. Run your application in the target computer. If it is a DLL run the program that uses it.
  7. If the connection is successfull you have all the debugging facility of CVI in your hands while your code is running in your target hardware.
You can do all these from your local or target computer through Remote Desktop. If your program requires user intervention to advance; like buttons, switches, etc it would be wiser to work on the target computer.

For a more complete guide you can read the Remote Debugging topic in CVI help.
Hope this helps.

Message Edited by ebalci on 07-26-2007 08:41 AM

S. Eren BALCI
IMESTEK
Message 18 of 42
(18,159 Views)
When using a tree control with multiple columns, clicking on a column generates an EVENT_COMMIT with eventData1=COLUMN_LABEL_CLICK and eventData2=index of the column.
You can now sort data in the tree when the user clicks the column header...

(as of LabWindows 8.1.1, this value is not documented...)

Message Edited by dummy_decoy on 08-02-2007 04:29 AM

Message 19 of 42
(18,038 Views)
Although the default control labels and text messages of a LabWindows/CVI UIR are single-line,
you can make them multi-line by pressing <Ctrl> + <Enter> in the text edit mode while creating your UIR using the editor.
 
This way you do not need to put two text message controls or use a list box to display a simple 2-line message.
A sample UIR appearance is attached.
S. Eren BALCI
IMESTEK
Message 20 of 42
(17,652 Views)