LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

concatenate succesive strings from the serial port

Hi i want to know how one can concatenate succesive strings that are being transferred from the serial port.I am using a microcontroller to transfer Strain readings which has a 10bit ADC.So i want to display the with the same precision.I want to concatenate 2 strings from a total of 4 string in such a way that the first two are concatenated and the other two are concatenated.A

 

Also i want to know how we can seperate succesive strings (data for the xaxis and y axis of an xygraph).

 

Thanks.

LabVIEW 8.2,8.6,2009...still learning 😛
0 Kudos
Message 1 of 16
(3,958 Views)

Well, there is a "concatenate strings" function in the string palette. That should do what you need. 🙂

 

I don't know what you mean by "... separate successive string ...", because I don't know what that is....

 

  • If it is an array of strings, use index array.
  • if it is a single string, you need to either know the field lenths or know the "delimiter character" so we can tell where one string ends and the next one starts

 

Can you give an example string and tell us how you want to seperate and what kind of output you want.

 

 

Message Edited by altenbach on 09-19-2009 11:55 PM
Message 2 of 16
(3,954 Views)

Then doing data communication you have to have some protocol describing how data is transferred. If the transmitter and receiver comes out of sync, you are able to resync(as an example). This do not have to be advanced. It could be so simple as separating every number with some character appearing only for this purpose. Then you set up the serial read function to read x bytes or until termination character.

I do not know how your program(s) works. But something tells me that your solution may not be optimal 

 



Besides which, my opinion is that Express VIs Carthage must be destroyed deleted
(Sorry no Labview "brag list" so far)
0 Kudos
Message 3 of 16
(3,943 Views)
Hi, i have looked at the concatenate strings function already.About the seprate succesive strings  i mean that i am sending data of temperature readings through the serial port which i want to display on an xy graph(done this part) now what i want to do is send the time values at which the temo was read and plot the temp readings against them, for which i need to seperate succesive elements.
LabVIEW 8.2,8.6,2009...still learning 😛
0 Kudos
Message 4 of 16
(3,919 Views)
You really need to provide more detail. How does the string look like?
0 Kudos
Message 5 of 16
(3,911 Views)

By NOT posting any code and some additional information, you are actually wasting time on your behalf but also time for people trying to help you. If you wait much longer, people trying to help will just get tired of this thread and ignore it.

Just do it;)



Besides which, my opinion is that Express VIs Carthage must be destroyed deleted
(Sorry no Labview "brag list" so far)
0 Kudos
Message 6 of 16
(3,890 Views)

Hi i obviously want help...thats why i am posting it here.I did do some experiments but i made a mistake in the case select part as seen in this VI(the display part is seperate and i will integrate it with this). The string is supposed to be like this

 

Tempstart....96 temp readings(8 bit each)....TempstopSG1start....2readings(10 bit each)...SG1stopSG2start..2reading(10 bit each)...SG2stop

 

After this it is supposed to display the values( that part i have done).Since an attempt i on changing using cases for differentiating the 3 readings failed.I intend to use stacked structures now.Will upload a Vi soon.Sorry:(

 

 

LabVIEW 8.2,8.6,2009...still learning 😛
0 Kudos
Message 7 of 16
(3,871 Views)

As people are telling please post your code or atleast a snapshot of the code where you need real help.

 

Mathan

0 Kudos
Message 8 of 16
(3,865 Views)

Hi are a few VI's that form parts of my final VI.I am also having a problem in reading serially.

 

'1073807298 in read visa 'is the error i get most of the time but not always when i read the data 'AAAAA'(just dummy for the real thing). From file serial1 byte.
LabVIEW 8.2,8.6,2009...still learning 😛
Download All
0 Kudos
Message 9 of 16
(3,821 Views)

A lot of your code makes little sense. Apparently, you read 5 bytes at serial1byte.vi and I imagine that'll be the input to String_compare..." where you assume it is 8 bytes.

 

  • The while loop in both VIs has no purpose. Why are they there? Please explain.
  • Why do you have a delay in the FOR loop?
  • Since your X are equally spaced, you can use a waveform graph or even a chart instead of an xy graph.
  • Your FOR loop makes no sense. Simply use a "string to byte array".

 

the entire VI could possibly look like as follows:

 

 

Can you please re-attach the VI again, this time include a few typical strings as diagram constants.

Message Edited by altenbach on 09-21-2009 09:51 AM
0 Kudos
Message 10 of 16
(3,811 Views)