LabVIEW Interface for Arduino Discussions

cancel
Showing results for 
Search instead for 
Did you mean: 

Sending String Array to and from Arduino

I want to be able to do it programmatically though. I do not want to have to copy and paste the signals into the arduino source code.

If I can't do it through LabVIEW, I will look to the SD card option.

Even if it takes 5 minutes to load all of the 2D array from a file on the computer through LabVIEW to the arduino.

It will be better than having to recieve the signals then copy and paste it into the source code, then upload to the arduino.

CLD Certified 2014
0 Kudos
Message 31 of 46
(3,420 Views)

Ok in that case I would continue with the approach you were using to write the arrays using LabVIEW. I would think it would be more useful to add the arrays to the source code since then those values are just downloaded once and don't have to be downloaded every time you want to use this functionality but maybe I am missing something.

Kevin Fort
Principal Software Engineer
NI
0 Kudos
Message 32 of 46
(3,420 Views)

How do I create a global 2D array of unknown row size?

So lets say I want only to store 5 signals and each signal may have different indices.

CLD Certified 2014
0 Kudos
Message 33 of 46
(3,420 Views)

hello,

You can declare a variable of type string and then store it in the reading obtained serial port, sending word to the arduino and this can be interpreted, it can increase the speed of the port, this is just one example

String dato;

void setup()

{

Serial.begin(9600);

}

void loop(){

      dato="";

        if (Serial.available() > 0)

  {

         int h =Serial.available();  

  for (int i=0;i<h;i++){

         dato += (char)Serial.read();

         }

  Serial.println(dato);

  }

  delay(10);

}


0 Kudos
Message 34 of 46
(3,420 Views)

Hi.

Please help me.

I downloaded the firmware, but I don't know which part to edit (in the firmware)in order to get the readings on arduino serial monitor. It;s full of motor and servo and lcd codes

0 Kudos
Message 35 of 46
(3,420 Views)

You can add a case to do what every you want. Keep in mind the case numbers are in hex. I think the cases are within the LabVIEWInterface.ino file.

CLD Certified 2014
0 Kudos
Message 36 of 46
(3,420 Views)

LIFA, in and of itself, is not a "serial monitor" so you should create a new discussion explaining, in detail, exactly what you are trying to do so that we can better help you.

0 Kudos
Message 37 of 46
(3,420 Views)

This is an example to send "Y" to Case 30 or 0x1E.

Capture.PNG

In the Arduino case, you would capture the the string. Something like this:

// Initialize myString

char myString[];

// Receive data from LabVIEW

case 0x1E:

myString = command[2]; <This reads the incoming byte from LabVIEW and stores it into myString

Serial.write(0); <This sends 1 byte back to LabVIEW

break;

CLD Certified 2014
0 Kudos
Message 38 of 46
(3,420 Views)

Hi sir
Can u send me the full code of arduino and labview for the same problem my email id is karthik.raja230@gmail.com else pls post here

0 Kudos
Message 39 of 46
(3,420 Views)

Sorry, I do not have the code anymore. I haven't worked on this project for 3+ years.

There is plenty of documentation on this board as well as toolkits with examples to help you:

Tethered toolkit: http://sine.ni.com/nips/cds/view/p/lang/en/nid/212478

Embedded toolkit: http://www.tsxperts.com/arduino-compatible-compiler-for-labview/

Good luck!

CLD Certified 2014
0 Kudos
Message 40 of 46
(3,420 Views)