LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

VISA and Scan string for tokens

Hi there,

 

I am currently developing a piece of software which needs to take in data from an Arduino board via the serial port and parse the input accordingly.

 

I have the 2 pieces of code working perfectly well separately, but I can not seem to figure out why they are not functioning properly together.

 

Just now, the input is being retrieved fine and passed into the Scan string for tokens method, but it is not being split on the tokens, it is just outputting the string as a whole.

 

The input is in the form of 1:0 2:0 3:1 etc. so I am trying to split it on any spaces found.  If I attach a string to the Scan strings for tokens it works fine, just not when I am attaching the data from the serial port to it.

 

Any help would be appreciated.

 

 

0 Kudos
Message 1 of 2
(2,333 Views)

Hi,

 

In the output which you are getting from the serial port, is there space between 1:0 and 2:0 and 3:1? If there is no space between them, then it wont be able to scan for tokens and will output the whole string. I don't have the hardware here and so don't know what exactly is the output which you are receiving. Try to see in the read buffer indicator whether the tokens are seperated by a space or not.

 

I have attached your vi after adding a small part in it. If the problem is with the spacing then this will work fine for 1:0 2:0 3:1.

 

Regards,

Nitzz

(Give kudos to good Answers , Mark it as a Solution if your problem is Solved;)) 

Message 2 of 2
(2,305 Views)