From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

Real-Time Measurement and Control

cancel
Showing results for 
Search instead for 
Did you mean: 

TCP/IP MULTIPLE SENSORS ARDUINO

PLEASE SOMEONE KNOW HOW TO READ THREE POTENTIOMETERS VIA TCP / IP WITH ARDUINO, I AM USING EHTERNET SHIELD.....I NEED HELP, I AM NEW IN LABVIEW.....I DID THIS...

 

LABVIEW.PNG

 

ARDUINO.PNG

Download All
0 Kudos
Message 1 of 3
(3,566 Views)

Hello Dany_bond!

 

First of all, I would recommender it to use a General VI. 

General VI pattern.PNG

On the start up, make the open connection, and on the Shut down make the close connection. Inside the loop, make a State machine. Like this example:

State Machine _ TCI_P communications.png

On the main state put an Event Structure with the actions of Potentiometers' number (0,1,2). In each event send the machine state to his unique state where you send (write in labview, read on Arduino) to Arduino the selector case. Then (maybe in this same case) Read (read in labview, write on Arduino) from Arduino and put the value on some indicator. Finally, return to the main state to again read the value.

 

Of course this solution only make tha reading of the values one by one. If you want to obtain all the values all the time, just make a while or for cicle to do the previous mentioned. 

The state machine ends with a STOP button. 

 

Now in your code you need to make the following:

- After opening the TCP communication, you need to send the case code to Arduino. Use the Write TCP function.

- Then, Arduino recive (read) your number of case and execute the if function and send to LabVIEW. You will recive with the Read TCP Function and execute your conversion code.

- Finally return to the principal state and wait the next action.

 

I hope this can solve your questions. If not answer here and we will try to help you.

 

Best regards!

 

PS. I attach some links that can assist you.

Tutorial of state machine.

http://www.ni.com/tutorial/7595/en/  

Help for TCP

http://www.ni.com/white-paper/2710/en/

 

 

0 Kudos
Message 2 of 3
(3,492 Views)

THANK YOU SO MUCH, IM SORRY BY THE ANSWER TOO LATE.

0 Kudos
Message 3 of 3
(2,221 Views)