Go Down

Topic: Interfacing an Arduino MEGA 2560 with LabVIEW (Read 3175 times) previous topic - next topic


Hello everyone,

I hope that I am posting this in the correct forum and if not, then please move it to the appropriate one. The project that I am working on is to construct a circuit that is made of the following parts:

Five IRF9540 p-type MOSFETs (represented by M1, 3, 5, 7, 9 in the circuit diagram)

Five IRF510 n-type MOSFETs (represented by M2, 4, 6, 8, 10 in the circuit diagram)

Five D1N4006 diodes

Five 1k ? resistors

Five 280 ? resistors

R591763400 (RF switch from Radiall)

The RF switch is represented by L1, L2, L3, L4, and L5, which correspond to the following pins on this switch respectively: 1, 2, 4, 5, and R (which resets the switch).

This circuit will receive a 5 volts output from an Arduino MEGA 2560 (which is represented by the V2 function generator in this circuit as you can see from the provided attachment), and what I need to do is to have LabVIEW communicate with the Arduino by sending instructions to the Arduino so that it outputs 5 volts to pins 1, 2, 4, 5, and R whenever needed by the person controlling this interface. I already have LabVIEW 2009 installed on my computer, along with LabVIEW Interface for Arduino (LIFA) v2.2.0.79 which I obtained via VI Package Manager.

I've been going through a lot of tutorials about interfacing LabVIEW with the Arduino, but I cannot find what I am looking for exactly, which I think that it should be some sort of a code that will enable me to achieve this communication between LabVIEW and the Arduino if I am correct. Also please keep in mind that I am not good at programming at all, so detailed instructions would be extremely helpful here. I hope that I explained everything clearly and if you have any questions then please ask; thanks in advance for your help.


Previous labview post that might be of interest.

Google forum search: Use Google Search box in upper right side of this page.
Why I like my 2005 Rio Yellow Honda S2000  https://www.youtube.com/watch?v=pWjMvrkUqX0


Thanks for your help and sorry for the late reply, as it took a while to finish this project. I am including a picture of the circuit representation, along with the LabVIEW VI that was used to achieve communications with the Arduino, and a brief explanation of what I did in case someone comes across a similar issue; thanks again for the help.

The attached VI shows the configuration that was used to achieve the communication between LabVIEW and the Arduino, where, starting from the left, we have five I/O sub VIs (Set Digital Pin Mode) whose purpose is to instruct the corresponding pins on the Arduino to act as input or output pins; in this case pins 9 through 13 were instructed to act as output pins in the following manner:

Pin 13 maps to pin R, the reset pin on the RF switch, pin 12 maps to pin 5, pin 11 maps to pin 4, pin 10 maps to pin 2, pin 9 maps to pin 1. Note that the mapping is from the Arduino to the RF switch. 

Next, the following five Write sub VIs (Digital Write Pin) can instruct the Arduino pins (9 through 13) to output a value of five volts or zero volts to one pin on the RF switch at a time. These Write sub VIs will initially instruct the Arduino pins to output zero volts to all five pins on the RF switch; then pin R on that switch is reset in the process by supplying five volts to it first, and then zero volts; this is done by using a stacked sequence structure that is described below. This way we ensure that all five pins on the switch are reset and that no pin had acquired a value other than zero volts, which eliminates the possibility of this particular pin being latched. Where latching is the process of allowing one of ports 1, 2, 4, or 5 to act as an output port to whatever signal that was received on the input port, which is the central one on the RF switch.

We then use a stacked sequence structure, which consists of one or more sub diagrams, or frames, that execute sequentially. Using the stacked sequence structure, the following seven operations are now performed:

1- Supply five volts to pin 13 on the Arduino, which corresponds to pin R on the switch.

2- Wait 100ms.

3- Supply zero volts to pin 13 one more time to cause it to reset.

4- Wait 100ms.

5- Supply five volts to the Digital I/O Pin (0), which will in turn enable us to input the number of the Arduino pin that we need to instruct to supply five volts to the 
corresponding pin on the switch via the front panel.

6- Wait 100ms.

7- Terminate the operation.


I didn't upload the circuit picture correctly in the previous post; sorry about that.

Go Up