From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

OGLControlPanel inside a tab window?

Hi,

 

I'm trying to get a working OGL panel inside a tab, but I keep getting errors. According to http://forums.ni.com/t5/LabWindows-CVI/CVI-OpenGL-control-on-child-panel/m-p/98192/highlight/true#M7... it's just how it works, but there are ways around it.I've downloaded example http://sine.ni.com/devzone/cda/epd/p/id/1061 , but its not exactly what I need - it creates a child panel window inside main window.

 

So, my question is - is there a way to put a OGL panel inside a tab window?

 

Regards, Benji.

0 Kudos
Message 1 of 3
(2,838 Views)

Somebody? Anybody?

0 Kudos
Message 2 of 3
(2,809 Views)

Dear BenjiF!

 

Sorry for the late reply, I tried to insert the OGL control on a tabpanel in CVI built in OGL example: Ogldemo.

I got the following error: 

NON-FATAL RUN-TIME ERROR: "ogldemo.c", line 259, col 5, thread id 0x00002478: Function OGLConvertCtrl: (return value == -1003 [0xfffffc15]). Only a canvas or picture can be converted into an OGL control

 

If you have a look on the help of OGLConvertCtrl >> Panelhandleparameter, you will see the following:

The panel has to be a parent panel and should not be the child of any other panel. The panel cannot be scrollable or resizable.

 

Maybe this restriction  is the reason, why is it not working.

 

3D Graph custom control could be an alternative, if it is suitable for your application. An example for this: https://decibel.ni.com/content/docs/DOC-6452

 

In the linked topic I found a useable workaround:

"The fact that the OGL control is only available on parent panels is not necessarily a problem with CVI. Instead, it is simply a limitation of the OGL control. Likewise, a limitation of the easy tab control is that it takes in child panels. I would suggest copying the final image to the tab panel (as mentioned by PaoloB), or possible use a separate panel to display your 3D images."

 

 

Some material related to OpenGL.

 

Please go through this KB: http://digital.ni.com/public.nsf/allkb/D369558F34AA3264862565FC007CBB33?OpenDocument

You can find built in examples in the folder: 

C:\Users\Public\Documents\National Instruments\CVI"version"\samples\userint\custctrl\cviogl

 

 

Best Regards,

CLA, CLED
0 Kudos
Message 3 of 3
(2,774 Views)