LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Labview 7.1 crashes when I enter table in a global VI

Hey guys, I have the following problem: I'm running LV 7.1 and when I try to insert a table in a VI of a global variable, the LV crashes (both on XP and Vista). The idea was to read data from an SQL database to tables in a global variable. I need to use LV 7.1 for compatibility reasons. Any guess?
 
Thanks,
simon
0 Kudos
Message 1 of 17
(3,373 Views)
Since a table is nothing but a 2D array of strings, did you try putting a 2D array of strings in your global?
Message 2 of 17
(3,370 Views)
Matthew, thanks for the tip, this works now but I still can't figure out why a table can't be put into a global variable. It seems like a nasty bug 😉
0 Kudos
Message 3 of 17
(3,340 Views)

Hi latlov,

Thanks for contacting National Instruments.  I have been looking into your question and I have some information for you.  Like it was mentioned earlier, the data inside of the table is simply passed as a 2-D array of strings and that is why you are able to handle it in that way when you pass the 2-D array.  This is very similar to if you are using a slider as a control and passing the value as a global variable.  When reading the data from that variable, it is just output as a Double value, not as a slider output.  This is expected behavior for the LabVIEW environment.  However, there may be a workaround for you.  One thing you can do is create a custom control that is a 2-D array of strings and save it as a type def.  Then, when you create your variable, you can make the data type for that variable a custom control and then select the custom 2-D array of strings that you saved previously.  Next, when you want to read data from this variable, you can place a table on the front panel of a VI and then go to the block diagram and right-click on the table and select "Change to Indicator."  You can then wire the variable into this table indicator and it will read the data properly.  In this case, the data is not passed through the variable as an actual table, but this may help you if you want to display the data in a table on the front panel of a VI.  Also, we are always very appreciative of feedback and product suggestions that we receive and you can provide us with some if you go to www.ni.com and select "Contact NI" from the top menu.  On this page, you can click on the link to provide some feedback to us.  I hope some of this helps you with your application.  Thanks!

Regards

Noah R
Applications Engineering
National Instruments
0 Kudos
Message 4 of 17
(3,318 Views)

Many thanks, Noah! I solved the problem by using 2D arrays of strings. However, a similar problem appeared when I wanted to store a waveform in a global variable. After measuring voltage I get a waveform output where the dimensions (number of measurements and channels used) are dependent on the parameters, defined in a database. This data is supposed to be stored in a global variable and analysed later separately, channel by channel, depending on the testing procedure (also defined in the database and diferent for each product). What happens is that when I direct the waveform output into the global variable, where I put a waveform graph variable, the data cannot be read in a waveform form. Is there a way to be able to read such data from a global variable, say, I store a 24-channel waveform and then read 2nd and 4th channel when its demanded by the procedure?

Regards,

Simon

0 Kudos
Message 5 of 17
(3,303 Views)
Hi Simon,
 
Thanks for the response!  I have been looking into your question a little more and I do have a suggestion for you.  What I would suggest is making a global variable that has the waveform data in the information for the variable.  I would not use a waveform graph variable for the data type for your global variable, but I would use the actual waveform data control.  This way, when you read the data out of this control using the Get Waveform Attributes function, you should be able to index the resulting array and access the channels that you want.  Each channel will correspond to a row inside of the array that you have for your global variable.  I hope some of this helps and if you are still not sure, please feel free to reply back.  Thanks!
Regards

Noah R
Applications Engineering
National Instruments
0 Kudos
Message 6 of 17
(3,284 Views)

Thanks, Noah. I tried the proposed solution and it works!

Regards, Simon

0 Kudos
Message 7 of 17
(3,266 Views)
Hi!
   I've (quickly....) read your post, and I'm interested in why Lv crashes.  My LV 7.1 doesn't crash if i put a table inside a global.  Can your problem be about RAm usage, or does it depend upon table dimension?  When does it crash, when you just insert table into variable, or when you actually try to use it?

   Of course, the advice of using a 2D string array is realy helpful, but is also nice to find why some things happens (if you've time to spend, of course Smiley Wink ).


   Have a nice day!

graziano
0 Kudos
Message 8 of 17
(3,258 Views)

Hi, graziano!

It happens the moment I drag an empty table into the VI of my global variable and release the mouse button 😉 As soon as I do this, LV crashes with no warning whatsoever. I use 2 GB of RAM so I don't suppose it should cause any problems. I've tried this routine several times on both XP and Vista and there were no differences every time I tried it. That's why I wanted to know if this is a common thing that was fixed in higher LV versions or it's just my installation of LV that causes it. However, as I mentioned before, I can't use higher LV versions due to the limitations of the company I'm doing this project for.

Thanks for the comment anyway!

Simon



Message Edited by latlov on 11-09-2007 09:40 AM
Message 9 of 17
(3,253 Views)
Hi Simon,
   I can only report that in my LV version, I can do it.  Maybe, it depends on some minor patch I've installed.... I don't track patches Smiley Tongue so I am unable to assure this. I can send you my VI, with global with table! try to open it, see if LV crashes (just for curiosity.....).

   Have a nice day!

graziano
0 Kudos
Message 10 of 17
(3,247 Views)