LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

CVI 8.0 Linux runtime crashing in PlotStripChart

Solved!
Go to solution
I'm trying a quick port of some old CVI 5.5 code to the CVI Linux runtime 8.0. Building the Windows code with CVI8.0.1 on Windows 2000 in an Oracle Virtualbox-3.2 on Ubuntu 8.04 it all works so I know there are no CVI 5.5 -> 8.0 issues. But after building with cvicc the Linux code crashes when run on Ubuntu 8.04. Using the KDbg interface to gdb I've isolated it to PlotStripChart() function call. This is what is puzzling and got me stumped, if I build the stripchart.prj example on Ubuntu 8.04 it plots a stripchart just fine. I've also used the stripchart control on other CVI Linux Runtime projects and it always worked. The only difference I could find was this code is plotting VAL_INTEGER where the example and my other code was plotting VAL_DOUBLE, but modifying my plot buffer and the PlotStripChart() to use doubles still fails. If I comment out the single PlotStripChart() line in the code it runs fine and appears to work correctly. Its a fairly complicated application that communicates over TCP/IP to a networked real-time controller and provides the user interface and data saving functions for our experiment. On a couple of dry runs without the PlotStripChart() call the saved data and output commands all appear correct, so this appears to be the only issue. Any suggestions, I'm out of ideas and getting no more clues from KDbg/gdb. I'm in the process of trying out the CVI2010 Linux Runtime Beta, but since CVI2010 no longer supports Windows 2000 I'm slowed down by having had to set up an XP virtual machine (Boy there sure are a lot of patches since my last MSDN XP disk 🙂 ) and the fact that alien fails to create the 32-bit files on the 64-bit Ubuntu 10.04 I'm currently targeting. I'll have to convert the runtime rpm files on my 32-bit Ubuntu 8.04 system. Not a showstopper but a time-waster so I've had to put it aside for now. I have the 8.0 CVI Linux Runtime apparently working on 64-bit Ubuntu 10.04 so I expect the same procedures should get me going with the 2010 beta once I get alien to make the 32-bit deb files from the rpm files.
0 Kudos
Message 1 of 28
(4,521 Views)

I apologize, it seems noscript blocked a change to the forums.ni.com site that caused loss of formatting making the above about impossible to read 😞

 

Here is a fixed version:

 

I'm trying a quick port of some old CVI 5.5 code to the CVI Linux runtime 8.0. Building the Windows code with CVI8.0.1 on Windows 2000 in an Oracle Virtualbox-3.2 on Ubuntu 8.04 it all works so I know there are no CVI 5.5 -> 8.0 issues.

 

But after building with cvicc the Linux code crashes when run on Ubuntu 8.04. Using the KDbg interface to gdb I've isolated it to PlotStripChart() function call.

 

This is what is puzzling and got me stumped, if I build the stripchart.prj example on Ubuntu 8.04 it plots a stripchart just fine. I've also used the stripchart control on other CVI Linux Runtime projects and it always worked. The only difference I could find was this code is plotting VAL_INTEGER where the example and my other code was plotting VAL_DOUBLE, but modifying my plot buffer and the PlotStripChart() to use doubles still fails.

 

If I comment out the single PlotStripChart() line in the code it runs fine and appears to work correctly. Its a fairly complicated application that communicates over TCP/IP to a networked real-time controller and provides the user interface and data saving functions for our experiment. On a couple of dry runs without the PlotStripChart() call the saved data and output commands all appear correct, so this appears to be the only issue.

 

Any suggestions?   I'm out of ideas and getting no more clues from KDbg/gdb. I'm in the process of trying out the CVI2010 Linux Runtime Beta, but since CVI2010 no longer supports Windows 2000 I'm slowed down by having had to set up an XP virtual machine (Boy there sure are a lot of patches since my last MSDN XP disk :smileyhappy: ) and the fact that alien fails to create the 32-bit files on the 64-bit Ubuntu 10.04 I'm currently targeting. I'll have to convert the runtime rpm files on my 32-bit Ubuntu 8.04 system. Not a showstopper but a time-waster so I've had to put it aside for now. I have the 8.0 CVI Linux Runtime apparently working on 64-bit Ubuntu 10.04 so I expect the same procedures should get me going with the 2010 beta once I get alien to make the 32-bit deb files from the rpm files.

0 Kudos
Message 2 of 28
(4,507 Views)
Solution
Accepted by topic author wally_666

I've no explanation, but there be bugs in the UIR files when using cvicc.

 

I took an older Windows project that the one above was derived from, made the minor changes needed to compile on Linux and low and behold its stripchart control worked!  I then cut the stripchart control from this UIR file, deleted the stripchart control from the UIR file above and pasted the copied control into it.  I then dragged it to the proper size, and set the range and number of traces to what I needed.  Rebuilt the project and presto! no crash drawing the stripchart.

 

I should still have the original UIR file in my Windows file archive, so I will revisit the issue once I get the CVI 2010 beta runtime installed, which unfortunately will be a while as other projects push this down the stack but at least this port seems usable now.

0 Kudos
Message 3 of 28
(4,484 Views)

Hi Wally_666,

 

I would like to attempt to reproduce this issue to figure out exactly what is going on.  If you can provide me with the workspace, project and all necessary source files for your application (preferably in a .zip file) after you ported it to CVI 8.0.1 that would be appreciated.

 

-Hassan A.

Applications Engineer

National Instruments

Regards,

Hassan Atassi
Senior Group Manager, Digital Support
0 Kudos
Message 4 of 28
(4,475 Views)

 


@Hassan A wrote:

Hi Wally_666,

 

I would like to attempt to reproduce this issue to figure out exactly what is going on.  If you can provide me with the workspace, project and all necessary source files for your application (preferably in a .zip file) after you ported it to CVI 8.0.1 that would be appreciated.

 

-Hassan A.

Applications Engineer

National Instruments


 

I'm happy to see this follow up, but without the networked data source to connect to, my program will just quit with an error message and there will never be a call to the PlotStripChart function if I comment out the exit, as there will be no incoming TCP/IP data.

 

At one point during development I had a little program that would run on the local system and accept the TCP/IP connection, swallow any commands and fake a reasonable response,  while outputting pretend (sawtooth-wave) data on a few channels.

 

Let me try and recreate it on the 2010 beta runtime and if I can then I will be willing to put some work into trying to let you duplicate it.  If importing the Windows CVI 8.0 UIR file into CVI 2010beta fixes the issue when loaded by the Linux Runtime 2010beta its not worth either of our efforts to resolve.

 

As I said it will be next week at the earliest before I can get back to trying the beta.

 

 

Attached is the UIR file from my Windows archive, you might load it into a blank project, run the code generator and then have the timer callback plot some random data.  Then you could move the project to Linux and run cvicc and see if it locks up in the PlotStripChart function or not.

 

I could do UIR edits on Windows and added a few debugging indicators and it always worked when run on Windows and failed when run on Linux after building with cvicc until I deleted the stripchart control and pasted in a version copied from an another variaton of the code. I suspect deleting and re-creating would have worked too, but the stripchart  had a lot of color and other attribute tweaks from the defaults, all via the UIR editor long ago. 

 

I suspect there is something corrupt in this UIR file that LoadPanel on Windows fixes or ignores but causes the control to fail (lock up the process) when loaded on Linux.

 

Using CVI 8.0.1 on an Oracle Virtualbox with the source code on a network share (to the local Linux machine) was very convenient as the Virtualbox NAT let it connect to my networked data source to verify the Windows version worked.   The only real hassle was after building on Windows I had to delete the civbuild.* directory before I could run the cvicc command on the shared source directory.

 

I see some requests for "running the full IDE on Linux", but I think NI could do almost as well with minimal effort by licensing VIrtualbox  & and a Windows version to distribute a CVI "appliance VM" of the Windows IDE and appropriate CVI version.  Documenting some tips abut using gdb with KDbg or ddd or whatever on the cvicc -debug code would finish the deal.  I found KDbg easier to start with for converging on the statement causing the lockup.  But while gdb is a pretty big step down from the CVI debugger (which is by far the best I've ever used!) it is more than servicable.

 

--wally.

 

 

0 Kudos
Message 5 of 28
(4,472 Views)

Hi Wally, 

I attempted to reproduce the issue on my end and it seemed to work fine.  Using the .uir that you provided I added a PlotStripChart function to the timer call back in CVI 9.1 and then saved the .uir for previous version in 8.0.  I then complied the project using cvicc in the 8.0 CVI  runtime module running on Ubuntu 8.04 installed on virtualbox. Following this, I ran the project and it seemed to work fine and did not lock-up.  Here is a screen shot of the project running:

linux_test.JPG

 

Is there anything else you think I can try to reproduce what you are seeing?

 

 

Regards,

Hassan Atassi
Senior Group Manager, Digital Support
0 Kudos
Message 6 of 28
(4,434 Views)

The crashes/lockups only happen when ploting to the large stripchart control that was in my *.UIR file (PANEL_STRIPCHART) that was initially created in CVI5.5 and then imported into a CVI8.0.1 project to build the Linux version

 

Adding a new stripchart control worked for me too.   You have to plot to my large stripchart control to trigger the issue.  The weird Yaxis range on the control is so the screen is "divided" into four 0-64K ranges and each short int data is offset by 32K + TraceNumber*64K before plotting,  with the grid lines marking the fullscale borders.   The idea is to have four non-overlapping traces of the 16-bit integer data.

 

Its also possible that importing the UIR file into CVI 9.1 and exporting for CVI8.01 fixed the issue.

 

Can CVI 8.5.1 export the UIR files in the older formats?  If so, how? as I've never seen this option.

 

As I said, the issue is moot if a newer version of CVI fixes the issue.  Its not generic problem as other UIR files with the same stripchart control, or a variation of it (some use 8, other 4 channels)  never had the issue when ported.  This is why it was such a surprise and mystery to me.  I assume there is some kind of corruption in the UIR file for the PANEL_STRIPCHART control that causes the lockup on the Linux runtime after the panel is loaded

 

I'm trying to get the CVI 2010 Linux Runtime beta working on Ubuntu 10.04,  still got some links to fix up, but I think I'm getting close.  Basically unless I can duplicate the issue in CVI 2010 beta, this issue is clearly closed unless you can duplicate the problem with the copy of my original UIR file I posted.

 

 

Where is the appropiate place to post about the CVI2010 Linux Runtime beta?

 

0 Kudos
Message 7 of 28
(4,425 Views)

Hey wally -

 

Questions regarding the beta should be posted to the beta forum here.  If you don't have permission let me know and I'll get you added.  I think I've already added you, but the task isn't as trackable as I'd like...

 

NickB

National Instruments

0 Kudos
Message 8 of 28
(4,387 Views)

Got access denied when I tried the link.

 

--wally.

 

0 Kudos
Message 9 of 28
(4,371 Views)

Hey wally -

 

You should now have access - sorry about that.  I also just wanted to let you know that I was able to reproduce your crash with the UIR file you posted, and that a bug has been filed with ID 255697.

 

NickB

National Instruments

0 Kudos
Message 10 of 28
(4,364 Views)