LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

arduino relay control with serial communication(without using LIFA)

Hi,

I tried to control my relay card with labview manually.For example there is a button and if I press it relay open and again press button relay close.I will use serial communication Visa blocks.I search some of examples about serial communication from labview to arduino but a bit I feel confused.For example If i push the button in labview, how i define this button in my arduino code for controlling relay?

Thanks.

0 Kudos
Message 1 of 5
(3,696 Views)

If you're not using LIFA, you need to define the serial protocol for controlling your arduino. You need to specify which commands will be sent to the arduino and the format of them and then implement that on the arduino.

 

Once you've done that, write your LabVIEW program to send those commands. An event structure will help you here, create an event structure with the button's 'value change' event and have it send the command for that button using VISA in that case. Each time the button is pressed, it will send the command.


LabVIEW Champion, CLA, CLED, CTD
(blog)
0 Kudos
Message 2 of 5
(3,688 Views)

@tolgaozzer wrote:

Hi,

I tried to control my relay card with labview manually.For example there is a button and if I press it relay open and again press button relay close.I will use serial communication Visa blocks.I search some of examples about serial communication from labview to arduino but a bit I feel confused.For example If i push the button in labview, how i define this button in my arduino code for controlling relay?

Thanks.


1. LIFA is depracated. LINX is the new driver.

2. Why are you insisting on re-inventing the wheel?

0 Kudos
Message 3 of 5
(3,671 Views)

Because I tried to do charge control hybrit system and I use arduino for taking sensors data and showing them by means of labview.And according to these data i will write my energy control algorithm for controlling battery,solar power and fuel cell.At first i search can i do these process with using only LIFA or LINX but i saw i cant do that i desired process with only using LIFA.If you use LIFA you have to instal LIFA_BASE arduino program to your arduino board.You cant do a few process while using LIFA.Now i take data with arduino and i saw them on Labview and i saved with using VISA serial communicating.Perhaps there is a solution for doing these process with using LINX but i cant find.

0 Kudos
Message 4 of 5
(3,657 Views)

Arduino coding is outside the scope of this forum. If you want to get into that, go to an Arduino forum.

 

As far as communicating with an Arduino with serial, I would first run up and understand the serial examples that ship with the Arduino. The arduino IDE provides a terminal that allows you to type serial commmands and see the response. Once you understand that, writing the serial commands from LabVIEW is a piece of cake.

0 Kudos
Message 5 of 5
(3,644 Views)