05-19-2016 09:37 AM
Hi,
I'm working on a VI to pull data from a commercial bench scale and store it inside an array until I get 10 readings, the thing is that I keep getting a 0 after each reading occupying an additional space in the array, I assumed its the LF and CR causing this problem but I haven't been able to remove it. I followed another post solution where a search and replace string was used but so far I couldn't make it work. Data on serial terminal and NI MAX looks fine. I'm attaching both my VI and a screen shot of putty terminal. Any advice is greatly appreciated.
Regards,
Alberto.
Solved! Go to Solution.
05-19-2016 10:59 AM
Try using Trim Whitespace. That should also get rid of the spaces it looks like you have before your number.
05-20-2016 08:36 AM
Hi Crossruiz,
Just added the trim whitespace and didn't solve the issue, I even try adding a string subset function after the trim whitespace and no improvement. Is there a way to limit what goes into the build array conditioned to values larger than zero?, something after the string to number function.
Thanks.
Alberto.
05-20-2016 09:08 AM
This is what I get on the Visa Test Panel
1: Read Operation
Return Count: 27 bytes
\s\s\s\s\s262.30\sg\s\s\s\s\sG\s\s\s\s\s\s\r\n
2: Read Operation
Return Count: 2 bytes
\r\n
3: Read Operation
Return Count: 27 bytes
\s\s\s\s\s262.25\sg\s\s\s\s\sG\s\s\s\s\s\s\r\n
4: Read Operation
Return Count: 2 bytes
\r\n
5: Read Operation
Return Count: 27 bytes
\s\s\s\s\s262.25\sg\s\s\s\s\sG\s\s\s\s\s\s\r\n
05-29-2016 04:43 PM
Finally nailed it, I just had to change the enable termination Char to "F" in the Visa Configure Serial Port.