|
From: Luc E. <luc...@en...> - 2008-03-12 08:46:14
|
Hi Rolf, thank you for your answer. I am using the script note box (LV 8.0 ; Python 2.5). Here are two examples that describe you the situation : if I put in the script box the following code : from numpy import random #numpy is version 1.0.5 a = list(random.permutation(23)) #<-I cast to a list and I output 'a' to Labview as a Float Vector, everyting goes well, and I collect the requested vector in Labview. In the contrary, if I use the following code in the script node (still outputing 'a' as a Float Vector): from numpy import random a = random.permutation(23) #<-I don't cast to a list I get a nice Labview crash instead of an error ! (notice that by using scipy instead of numpy, it usually also crashes) Attached is a vi that contains the "crashing" example. Thank you very much for your kind help, luc > Hi Luc, > >> I am using the excellent Labpython to run python 2.5 scripts >> in Labview 8.0 Overall, it works very well. I have however one issue : >> When I output a variable from python to Labview, and I forget >> to match correctly the types in the two softwares (for >> example, output a python numpy array as a Labview float >> vector), I get a Labview crash. >> >> Would it be possible to ensure that Labview simply throws an >> error in this case ? > > Can you elaborate a bit more about this? Are you using the script node > box or the VIs? Can you provide an example of what you try to do? > > Rolf Kalbermatter > |