Problem Analyzing Serial Input of a Spectrum.

Hello everyone, I am new to arduino.I have been in trouble for quite a long time with this. I have a project which consists of obtaining Labview serial input of a Spectrum .I need to take each value (x,y)=(dB,Hz) of the real time Spectrum and check if it is over a reference value. This Spectrum input is sent as a string at my Arduino Uno. I know I have established communication. What i don't know is how i would be sure that the first two values that come to Arduino are dB and then Hz (or the opposite) and if that's the way that the values are arriving to Arduino how i am going to store it as a double (or float) and deal with each seperately.

I am looking forward to hearing from all of you. You would be of a GREAT help ! Thank you very much in advance.

See Serial Input Basics.

What i don't know is how i would be sure that the first two values that come to Arduino are dB and then Hz

You must make sure that the two values are uniquely identified, as transmitted.

Hi and thank you very much for your imidiate reply. I have read this post and i am not sure how this can help me. Ok it says a lot about receiving characters but i don't understand how i am supposed to distinguish the points (x,y) or (dB ,Hz) from each other so that i can process them. Thank you in advance

Ok it says a lot about receiving characters but i don't understand how i am supposed to distinguish the points (x,y) or (dB ,Hz) from each other so that i can process them.

Step 1: Send them intelligently. Step 2: Parse the KNOWN string that you get.

Which step are you stuck on?

it says a lot about receiving characters

So, you did not even notice the part about the packet start and end markers?

I suggest to read it more carefully.

RaMoNikOs: but i don't understand how i am supposed to distinguish the points (x,y) or (dB ,Hz) from each other so that i can process them.

That depends on the format you're using to send them, which you haven't told us.

gfvalvo: That depends on the format you're using to send them, which you haven't told us.

Hello again, i am a newbie so i am not so sure about what the format is and how i am supposed to find out. I know that the information is being sent in ASCII. Do you have any ideas of how i can find out about the format??

Thank you all for your imidiate replies.

This Spectrum input is sent as a string at my Arduino Uno.

Do you mean that the Uno sends a string to Labview? If so, you establish the format. Read the serial input basics tutorial. It explains why and how to use start markers, delimiters and end markers.

groundFungus: Do you mean that the Uno sends a string to Labview? If so, you establish the format. Read the serial input basics tutorial. It explains why and how to use start markers, delimiters and end markers.

No No , Labview sents a Power Spectrum as a string to Arduino and i cannot find how to deal with it. I don't know what the first thing that arrives is, what the second and etc... My work is to take it and be sure that the first 16 characters are reffering to the first X coordinate, the second 16 to the first Y coordinate of spectrum . And so on..

RaMoNikOs: No No , Labview sents a Power Spectrum as a string to Arduino and i cannot find how to deal with it. I don't know what the first thing that arrives is, what the second and etc... My work is to take it and be sure that the first 16 characters are reffering to the first X coordinate, the second 16 to the first Y coordinate of spectrum . And so on..

It's pretty hard to receive serial data if you don't know how the sender is sending it. Perhaps look in the Labview documentation or visit a Labview forum?

Do you know the baud rate?

Can you access the Labview VI code? You should be able to see the format of the transmission defined in the VI.

If not, we need to see a sample of the received data and the Uno code for the receiver.