11-05-2018 05:50 AM
Hai
Good evening. I started working on new project that is to establish a two way communication from LabView to Arduino and from Arduino to Labview. I am successful with Arduino to labview communication and failed in writing the data in Labview and reading that data in Arduino. Searched many websites but i couldn't find any help so anyone please help me for finding the solution and i just want to send simple text data either it may be my name or any other data
thank you in advance
11-05-2018 07:07 AM
On the LabVIEW side, use the VISA Write to send your data. On the Arduino side, use the Serial.readStringUntil() function to read the data. I recommend concatenating an End Of Line to the end of the string and use the Line Feed (0xA) as the "until" on the Arduino.
11-05-2018 11:47 PM
Good morning
sir tank you for your response actually i have less knowledge in coding of Arduino and i already applied the visa write in Labview but the Arduino is not able to receive the data and i will attach my screenshots to this and sir help me out for doing this and thank you in advance
11-07-2018 11:01 PM
good morning sir
I am done with programming too in Arduino but i am finding difficulty in seeing the output can u please tel me this how can i able to see the outputs in parallel that is in Arduino and Labview and also i am using the same COM port for both of them and i will attach my VI and Arduino programming to this once go through that sir
thank you
11-08-2018 06:18 AM
Can you please use punctuation and capitalization in your messages so we can see where one sentence ends and another begins? It is quite difficult to read your message as it looks like one run-on sentence.
In your Arduino code, you should use Println so that it puts a termination character at the end of your message. This will allow LabVIEW to know when the incoming message ends and not timeout.
When you say you are "finding difficulty", you should provide some details as to what is happening wrong so we know what your problem is.
11-09-2018 01:32 AM
good afternoon
Hai sir and I am sorry sir for my English. I included "Serial.println" but still then it shows the same Error.
The work till now I have done related to my project and Explanation of that.
I am working on two way communication from Arduino to Labview and Labview to Arduino. I am using "Arduino UNO" and I programmed that in such a way it will first receive the data from "Labview" and later after receiving the data it will send an acknowledgment to Labview that "I RECEIVED" data.
In Labview I used the same COM port that is used for Arduino and here I Build my VI such that first it will send data to Arduino and next it will read the data from Arduino.
Here I need to see the output in both the Software's but in Arduino it is showing the error "PORT BUSY".
I dont know whether I should use different Ports?????? or I should change my VI???? in Labview. Help me Out.....in this
11-09-2018 05:09 AM
Since this is a "two way communication", you need to share your Arduino code as well.
Have you defined how the messages should be formatted? That is the first step when you are trying to get two things to talk with each other.
11-11-2018 10:43 PM
Hai sir
Good morning
And yes I defined the text format but i am not knowing exactly what is correct and what is wrong, when i am trying to attach my code this forum is not accepting that so I will attach the code snipping picture
11-12-2018 06:34 AM - edited 11-12-2018 06:34 AM
So you are trying to do a formatted echo.
1. Change your code to use an Event Structure so that you only send the data when you want to. Otherwise you are just constantly sending data and possibly overflowing the buffer on the Arduino.
2. No need to close the port twice. In fact, don't even branch the VISA Resource in this application. You send the data, then you read it back.
3. Let's simplify your code some:
void loop() { if (Serial.available() > 0) //See if data is there { incomingByte = Serial.read(); //Read a byte Serial.print("I received: "); Serial.println(incomingByte); //println appends the termination character } }
This will work as long as your LabVIEW code only sends 1 byte.
11-12-2018 11:16 PM
good morning
Sir I modified my program in Arduino and also changed my VI but the output in Labview seems to be null. It is neither showing any output nor error in Labview. The output in Arduino also not coming. Whats the reason for this???????
I will attach the picture of that just have a look on it sir.
Thank you