From 11:00 PM CST Friday, Feb 14th - 6:30 PM CST Saturday, Feb 15th, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Help! How to read CSV file and use as input?

Solved!
Go to solution

Hello,

I want to read CSV file and plot it using Python.

How can I read CSV file and use it as Python node input?

like this csv file

wzh0053auburnedu_0-1686255165460.png

How can I read it and use X, Y values as input to Python node?

Thanks

 

0 Kudos
Message 1 of 9
(2,047 Views)

wzh0053@auburn.edu wrote:

Hello,

I want to read CSV file and plot it using Python.

How can I read CSV file and use it as Python node input?

like this csv file

wzh0053auburnedu_0-1686255165460.png

How can I read it and use X, Y values as input to Python node?

Thanks

 


That's 3 pythons in 1 request. Why not just use python? pandas.read_csv()

 

https://pandas.pydata.org/docs/reference/api/pandas.read_csv.html

 

then use the plot() method

 

https://pandas.pydata.org/docs/reference/api/pandas.DataFrame.plot.html

 

Wow, look at that, no Labview involved. 

______________________________________________________________
Have a pleasant day and be sure to learn Python for success and prosperity.
0 Kudos
Message 2 of 9
(2,039 Views)

Hello,

Yeah I know how to do it with Python.

I am just trying to learn how to use LabView and integrate with python..

wzh0053auburnedu_0-1686256251083.png

 

0 Kudos
Message 3 of 9
(2,034 Views)

wzh0053@auburn.edu wrote:

Hello,

Yeah I know how to do it with Python.

I am just trying to learn how to use LabView and integrate with python..

wzh0053auburnedu_0-1686256251083.png

 


ok I see, you need to use a python node, have you tried that? 

______________________________________________________________
Have a pleasant day and be sure to learn Python for success and prosperity.
0 Kudos
Message 4 of 9
(2,031 Views)

Yes I am trying to use the python node. 

As far as I know, I can read the csv file using this Read Delimited. However, I don't know how I can use its output to use as input to Python node. Sorry, I am a very newbie to Labview..

wzh0053auburnedu_0-1686256442111.png

 

0 Kudos
Message 5 of 9
(2,025 Views)
Solution
Accepted by wzh0053@auburn.edu

wzh0053@auburn.edu wrote:

Yes I am trying to use the python node. 

As far as I know, I can read the csv file using this Read Delimited. However, I don't know how I can use its output to use as input to Python node. Sorry, I am a very newbie to Labview..

wzh0053auburnedu_0-1686256442111.png

 


Try something like this, you will need to add some things to this, like your paths, to make it work but its a starting point

 

snip.png

______________________________________________________________
Have a pleasant day and be sure to learn Python for success and prosperity.