LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Ignore Characters Read by VISA

Hello,
  I am reading data using through my serial port, my problem is that my source is constantly pushing out data most of which is garbage.  I want to ignore all text that is a ~ hex value 7E and only read and display what is between that character.  I am new to labview and have not been able to find out how to do this.  Please let me know if there is a VISA comand that could do this.  Thank you.
0 Kudos
Message 1 of 9
(4,690 Views)
Mess88,

There will not be a VISA command for that, but it should be fairly easy to put together code using string functions. Or you could convert the string to a byte array and use numeric comparisons.

Lynn
0 Kudos
Message 2 of 9
(4,683 Views)
I'll work on putting together to code to do that then,
thank you very much for the help.
0 Kudos
Message 3 of 9
(4,681 Views)
Starting point for you.
 
 
 


Message Edited by Mythilt on 05-23-2008 12:05 PM
Jon D
Certified LabVIEW Developer.
0 Kudos
Message 4 of 9
(4,678 Views)

Hi,

 

I was not able to identify how to create a new topic , so I'm going to start from here.

I'm pretty much new with labview, but I've been studying this week to get solution for my problems.

Here we go: I have a Texas USB microcontroller connected in my computer with Windows 7. I have the driver and I can see the 8 bytes when I interface with Realterm program.

The config is Baud 38400, Parity None, D8,STP1, Flow ctrl RTS/CTS. Attached you can see the screen and the data that I should read.

 

I have 8 bytes of a hex word coming. Attached is the Example that I modify to use reading with Labview.

The problem is that I receive garbage in the 2,3,4 and 5 byte.I Tried to change baud rate, flow control and nothing get solved, but i stil get the same garbage.

The 3 last bytes they may change because this will be the temperature, voltage and RF signal quality. But the first 5 bytes should be constant since is the address.

 

Could somebody try to help me, I now got stuck and this is just the beginning of the code.

 

Thanks,

 

Luiz

Download All
0 Kudos
Message 5 of 9
(4,416 Views)

Luiz,

 

String indicators in LabVIEW have several display modes.  The one shown in the Basic Serial example is called '\' Codes.  The '\' Display shows printable characters as in the normal way (4Vx in your example) and other characters as \ followed by the hex code (\12   \9A  \0E... ). The one you want is called 'Hex' Codes.  The others are 'Normal' and 'Password.'  If you pop-up on the indicator you will see the Display options about half way down the menu.

 

When I enter your values into a string indicator and change from '\' to 'Hex' I get: 1234 5678 9A0E 1A0E

 

Lynn

0 Kudos
Message 6 of 9
(4,388 Views)

 


@lnick wrote:

Hi,

 

I was not able to identify how to create a new topic , so I'm going to start from here.


I would have thought the words "New Message" were pretty clear...

0 Kudos
Message 7 of 9
(4,384 Views)

Hi Ly,

 

First of all i would like to thank you so much... I'm just in the beginning and having somebody in the other end of line it's always important. I fill that this Labview is the best program to design what I need now. I'll try what you mention and I'll let you know.

Also thanks for the message... I think I was sleeping yesterday...and couldn't see it.

I'm sorry to answer at night,but this is the only time i can do it.. this is my part time business.

 

Talk to you soon...

 

Thanks,

 

Luiz

0 Kudos
Message 8 of 9
(4,365 Views)

Hi Ly,

 

I'm very glad to tell you that starts working fine. Still a lot ot learn...I'll keep posting question if i didn't find the answers.

 

Thanks,

 

Luiz

0 Kudos
Message 9 of 9
(4,360 Views)