LabVIEW Interface for Arduino Discussions

cancel
Showing results for 
Search instead for 
Did you mean: 

Sending an INT from labview to Arduino Mega2560

Hello all,

I am working on a project using labview and arduino mega2560.

Currently,  I am trying to send an int from Lbaview to Arduino. Could you please help me on that.

Thanks Alot.

Zohair

0 Kudos
Message 1 of 5
(4,410 Views)

What type of integer?  Are you using LIFA or LINX or just the VISA driver?

0 Kudos
Message 2 of 5
(3,333 Views)

Dear Nathan,

Really apreciate your help.

I am using LIFA.

As a matter of fact, I am working in a project in which i am controling 6 RCservo motors with  external potiometer, which means addintion to the fact that servo already doing position control, I am looking for speed control as well. ( I am already doing position control on all servos using the provided function blocks by LIFA in Labview)

As you may now, there is Library in Arduino sketch called VarSpeedServo in which you may control the speed of a servo.

So here in my labview file i have to calculate a CONTROL formulation in a matlab script and then i want to send it to Arduino, so then I may use the speed that is being calcualted in each loop of communication and send it to Arduino  and then I can use it in some optional command code in LabviewInterface.ino file and used the 6 integers (the speed of each servo)  that has been calculated in matlab script and use it inside the code of

write(Position, speed) (https://github.com/netlabtoolkit/VarSpeedServo)

At this stage only i need to send the speed but want to know if possible to send two ineger for example both Position and Speed that needed for function code of write.

Also i have to ask if i have to use "send recive" function that is inside the LIFA.?

I am really stuck in it, i would graetly apprecote if you can help.

Kind Regards,

zohair

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

Hey huys, i am still having problem regarding my diacussion.

I found something intrestig

https://decibel.ni.com/content/thread/16932?start=0&tstart=0

That i hope some one can help through.

The full problem has been explained in above commenta, but for a quick overview, i am just trying to send a array of integers to arduino and read it in each buffer. I am kinda know hoe to recived the array in arduino sketch,

But having problem on figuring out how to send an array in labview using LIFA.

I would greatly appreciate if aomeone can help me through.

Regards,

Zohair

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

LIFA (or LINX for that matter) isn't designed to send just data to the Arduino.  They are designed to work with a specific sketch (called "firmware") is running on the Arduino.  If you have you own code, which is sounds like you do, you'll need to manually send the data using the VISA commands.  You can find a few examples using the VISA serial commands that come with LabVIEW.

If you want to implement your other servo library into LINX, you can do that by creating a custom command.  There is a tutorial for creating custom commands in LINX on the official LINX page at http://www.labviewmakerhub.com/linx.

I say LINX because LIFA is no longer supported and is generally slower than LINX.

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