LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Controlling Arduino with LabWindows

Solved!
Go to solution

To whom it may concern:

 

I have seen a lot of way to comunicate with the Arduino microcontroller using Labview. But I am having a lot of trouble of finding ways and examples using LabWindows CVI, can anybody help me with the #include files that I need to use in order to comunicate with the microcontroller?

 

Regards

 

Francisco

Francisco J. Sanchez, Ph.D., MCIC
0 Kudos
Message 1 of 5
(8,336 Views)
Solution
Accepted by topic author F_J_Sanchez

Hi Francisco,

 

Arduino connects like a virtual COM port. So the RS-232 library of LabWindows is capable of communicating with the Arduino.

See the instrument help for the RS-232 (serial) library.

There is also nice examples about using that library. They are installed together with the CVI environment.

 

See if you can find them and post back if you need more help.

 

Regards,

S. Eren BALCI
IMESTEK
Message 2 of 5
(8,301 Views)

Thank you very much ebalci, the RS232 library worked awesome:

 

First I program the arduino using the arduino software

 

I use:

// in the main section

DisplayPanel (...) //then i added the next line to open the port COM15 (Location of the Mega 2560 microcontroller)

OpenComConfig (15,"COM15", 9600, 0, 8, 512, 512);

 

To send instructions

ComWrt(15,"0",1)

 

To read values 

ComRd(15,HandShake, 256)  //HandShake is a 256 char.

 

In the exit button I added

CloseCom(15);

 

This work fine for controling relays

 

 

Francisco J. Sanchez, Ph.D., MCIC
0 Kudos
Message 3 of 5
(8,242 Views)

Thank you very much ebalci, the RS232 library worked awesome:

 

First I program the arduino using the arduino software

 

I use:

// in the main section

DisplayPanel (...) //then i added the next line to open the port COM15 (Location of the Mega 2560 microcontroller)

OpenComConfig (15,"COM15", 9600, 0, 8, 512, 512);

 

To send instructions

ComWrt(15,"0",1)

 

To read values 

ComRd(15,HandShake, 256)  //HandShake is a 256 char.

 

In the exit button I added

CloseCom(15);

 

This work fine for controling relays

 

Francisco J. Sanchez, Ph.D., MCIC
0 Kudos
Message 4 of 5
(8,242 Views)

Thank you very much ebalci, the RS232 library worked awesome:

 

First I program the arduino using the arduino software

 

I use:

// in the main section

DisplayPanel (...) //then i added the next line to open the port COM15 (Location of the Mega 2560 microcontroller)

OpenComConfig (15,"COM15", 9600, 0, 8, 512, 512);

 

To send instructions

ComWrt(15,"0",1)

 

To read values 

ComRd(15,HandShake, 256)  //HandShake is a 256 char.

 

In the exit button I added

CloseCom(15);

 

This work fine for controling relays

 

Francisco J. Sanchez, Ph.D., MCIC
0 Kudos
Message 5 of 5
(8,242 Views)