LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Labview python node multiple outputs of different data type

My python node takes a bunch of inputs and calculates a 20x20 array, a boolean and double value. How can I return all these items at once? I can only see the option for one output!

 

Thanks

0 Kudos
Message 1 of 18
(4,848 Views)

To the best of my memory, you have to return a delimited list and then post process in your LabVIEW vi to separate the results.

0 Kudos
Message 2 of 18
(4,838 Views)

Better yet would be to return a JSON formatted result. You can define the correct cluster definition and use the Unflatten JSON VI to parse the data.



Mark Yedinak
Certified LabVIEW Architect
LabVIEW Champion

"Does anyone know where the love of God goes when the waves turn the minutes to hours?"
Wreck of the Edmund Fitzgerald - Gordon Lightfoot
0 Kudos
Message 3 of 18
(4,829 Views)

Or even better yet, attach your VI that has everything in it including the Python script you run. NO SCREEN CAPTURES.

0 Kudos
Message 4 of 18
(4,825 Views)

Thank you all for the quick replies. It seems like ill need to do additional processing in any case. Is it possible to have multiple outputs in a MATLAB script node? I would prefer to use that then

0 Kudos
Message 5 of 18
(4,812 Views)

Why not just use the mathematical functions right in LabVIEW? Is there a reason to have the MATLAB script?

0 Kudos
Message 6 of 18
(4,741 Views)

Eric,

there are many good reasons to call a matlab functions in labview, this comment is unhelpful

 

rpdp: see the documentation for the call matlab function https://www.ni.com/docs/en-US/bundle/labview/page/glang/run_matlab_function.html

 

It is possible to receive multiple values from the call matlab subvi, but you have to tell it what type it should expect from the matlab function. For example, if you have an array, you need to initialize an array prior to calling the matlab function. For multiple variables, you use a cluster

0 Kudos
Message 7 of 18
(2,754 Views)

I disagree on using the MatLab functions and I strongly disagree that this isn't helpful.

 

I find that users, more likely than not, don't need to use the matlab functions. It's usually just simple Algebra that users have leaned on MatLab to get the answer and think they need to use those functions. There hasn't been much need for me, as I can only lean on my own experience, to use ANY third-party functions that LabVIEW can't do natively. And, even if I think I do, there are many brilliant people here that can assist with usually any kind of mathematical (or non-math) help and try to steer users away from third-party software for functions unless it is absolutely necesary.

Message 8 of 18
(2,721 Views)

@Eric1977 wrote:

I disagree on using the MatLab functions and I strongly disagree that this isn't helpful.

 

I find that users, more likely than not, don't need to use the matlab functions. It's usually just simple Algebra that users have leaned on MatLab to get the answer and think they need to use those functions. There hasn't been much need for me, as I can only lean on my own experience, to use ANY third-party functions that LabVIEW can't do natively. And, even if I think I do, there are many brilliant people here that can assist with usually any kind of mathematical (or non-math) help and try to steer users away from third-party software for functions unless it is absolutely necesary.


I also agree with Eric on this.

---------------------------------------------
Former Certified LabVIEW Developer (CLD)
0 Kudos
Message 9 of 18
(2,715 Views)

labview has this functionality though, and this is what the question was asking. It was well posed as well, asking about a specific function of a specific feature of labview.

 

0 Kudos
Message 10 of 18
(2,713 Views)