How to get Serial Read data in strings | Arduino Compatible Compiler for LabVIEW Discussions | Forum

Avatar
Please consider registering
guest
sp_LogInOut Log In sp_Registration Register
Register | Lost password?
Advanced Search
Forum Scope


Match



Forum Options



Minimum search word length is 3 characters - maximum search word length is 84 characters
sp_Feed Topic RSS sp_TopicIcon
How to get Serial Read data in strings
May 10, 2016
7:50 am
Avatar
vikas
Member
Members
Forum Posts: 4
Member Since:
May 10, 2016
sp_UserOfflineSmall Offline

Hello ,

I am simply trying to read serial data in the form of string and simply writing again in the form of string. Their is serial write data into string function but not for reading. How can I convert data into string. I have tried something by my own of which I am attaching the screenshot. Please guide me further.

Thanks

screen.pngImage Enlarger

sp_PlupAttachments Attachments
May 10, 2016
8:10 am
Avatar
lovediwan
Member
Members
Forum Posts: 14
Member Since:
March 2, 2016
sp_UserOfflineSmall Offline

Hello Vikas, 

You should use convert byte array to string. to convert the data to string.  But wait for serial data & read it as it receives. 

Beware of memory management technique else u will ran out of memory.

Regards

Love Diwan | http://www.pujacontrols.com 

May 10, 2016
8:28 am
Avatar
vikas
Member
Members
Forum Posts: 4
Member Since:
May 10, 2016
sp_UserOfflineSmall Offline

Thanks for your reply . but as you can see in the screenshot I have already used byte array to string converter and I am simply taking analog data from pin A0 but in the output serial monitor I am just getting some random numbers which is positively not the reading of the sensor which is connected. Even if I try to  take the digital reading as true or false and changing it into 0 or 1 using comparison function "select" and converting it into string I am getting again random numbers.digital-read.pngImage Enlarger

sp_PlupAttachments Attachments
May 10, 2016
10:50 am
Avatar
lovediwan
Member
Members
Forum Posts: 14
Member Since:
March 2, 2016
sp_UserOfflineSmall Offline

Hello Vikas 

Just me your VI i'll test it here & reply on that 

Regards

May 10, 2016
10:55 am
Avatar
vikas
Member
Members
Forum Posts: 4
Member Since:
May 10, 2016
sp_UserOfflineSmall Offline

Here is the vi...

from the serial monitor for getting analog data we need to send "Get_A00" similarly A02,A03... so on for other pins... and for digital "Get_D02" , D03,D04...D13

May 11, 2016
5:39 am
Avatar
vikas
Member
Members
Forum Posts: 4
Member Since:
May 10, 2016
sp_UserOfflineSmall Offline

I am able to receive and send data through serial. But when I am getting correct data then why program runs default case always in the case structure.1.pngImage Enlarger2.pngImage Enlarger

sp_PlupAttachments Attachments
May 11, 2016
2:09 pm
Avatar
filipealtoe
Admin
Forum Posts: 98
Member Since:
March 12, 2015
sp_UserOfflineSmall Offline

I'm not sure how to best help you remotely as this will requires some debugging. I would start the debugging processing by trying to understand what the read VI is outputting from the serial communication. Maybe you will need to tweak some parameters based on what you are getting.

Cheers
Filipe

October 7, 2016
6:32 am
Avatar
minakshi
New Member
Members
Forum Posts: 2
Member Since:
October 7, 2016
sp_UserOfflineSmall Offline

can i get the arduino code for receiving string data from labview.. ?

 i have completed labview part for writing string data on com port. but failed to receive it on arduino serial monitor

Forum Timezone: UTC 0
Most Users Ever Online: 100
Currently Online:
15
Guest(s)
Currently Browsing this Page:
1 Guest(s)
Top Posters:
miche91: 33
scottj: 28
scadao: 23
Member Stats:
Guest Posters: 5
Members: 202
Moderators: 0
Admins: 3
Forum Stats:
Groups: 1
Forums: 2
Topics: 266
Posts: 1222
Newest Members:
pujacontrol
Administrators: geadmin: 22, filipealtoe: 96, Steffan: 356