I had some Arduino source code for measuring greenhouse environmental parameters such as temperature-humidity, CO2, solar radiation, etc. I heard these source code could be added using data communication options in Labview. I am searching for the proper way. I found an example of this topic (link attached) but that is in the Korean language and not properly described. Would anyone give me some suggestions and some examples link about this topic, please?
Thanks in advance.
usually you use serial communication between Arduino and the connected PC (running your LabVIEW code).
So all you need is to implement some serial.write(ln) commands in the Arduino and some VISARead in LabVIEW…
Gerd is right, think of the Arduino as any other instrument with an RS-232 serial interface.
In fact this should be easier because YOU have full control of the data format, query commands and responses coming from the Arduino.
Here's some hints:
Also the example you linked to was an Arduino Yun (I think) because it has an Ethernet interface. If you are using an Arduino Uno your board only has a serial interface. So nothing LabVIEW wise in that example really applies to your board.
Respected Gerd and RTSLVU,
Thanks for your reply. Sorry, I couldn't express my query properly. In the formula node, we usually write some equations or code. I want to paste the Arduino source code in the LabVIEW. Is there any option like formula node in LabVIEW for this purpose. I have idea about serial communication of Arduino or LabVIEW-Arduino interface. But I don't want to use those ways.
I want to paste the Arduino source code in the LabVIEW.
Use a string constant and paste the code in there…
What should be the result from that Arduino code? Arduino is NOT the same as LabVIEW so what do you want to achieve with some Arduino code in LabVIEW???
Is there any option like formula node in LabVIEW for this purpose.
Use a string constant (or even a comment in the block diagram)…
Respected Mr. Gerd,
Sorry for the misunderstanding. During the coding using Arduino options, we usually follow this sequence: init>set pin mode>read/write pin>close. As I have Arduino source code, I don't want to follow this sequence. I want to know, does LabVIEW have any option like 'formula node.vi', where I can paste/write the source code directly and that "vi" will give me the output result? Is it clear?
Sorry for my poor English and poor explanation.
Is it clear?
No, not yet…
does LabVIEW have any option like 'formula node.vi', where I can paste/write the source code directly and that "vi" will give me the output result?
What is the expected result?
Do you expect your LabVIEW VI to read/write any pins on your Arduino? If this is the case, then you need to use LINX instead of some "formula node"…
Respected Mr. Gerd,
I have attached two pictures here. 1st one is formula node and the 2nd one is Arduino code. I have pasted the Arduino source code into the formula node, although I know formula node will not work. I want to know, is there any coding process in LabVIEW where I can paste the Arduino source code and get output value according to the Arduino code?
I want to know, is there any coding process in LabVIEW where I can paste the Arduino source code and get output value according to the Arduino code?
The short answer is "No!".
The longer story is: LabVIEW cannot directly access any Arduino hardware, you need a (kind of) device driver. And I already mentioned that device driver: it's called LINX!
With LINX you can try to replace your Arduino code by LabVIEW code…
A "Formula Node" is just that, a node for entering complex mathematical formulas into LabVIEW.
It is NOT an "Any text language Node" that can turn text based source code into LabVIEW or simulate that code running on a device.
Linx allows you to program Arduinos and other microcontrollers with LabVIEW instead of the native Arduino language