LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

problem with hex string

If I read in a string of serial data as hex it always read everything okay except when there is a 0A or 0B then it stopped reading the characters after 0A. Then the next cycle, it reads in the remaining characters from the last time plus the new characters. Is there anything special about these characters that made it behave that way. Thanks,
0 Kudos
Message 1 of 10
(4,001 Views)
Is the reading done over a serial port? If it is, then you probably have termination character enabled in VISA Configure Serial Port. The default term character is x0A (LF). VISA Read will stop whenever the termination character is detected. Change Enable Termination Character to false and try it again.
Message 2 of 10
(3,991 Views)
Hi,

Its probably because you have enabled Termination Char, this will then use the termination char, which by default is set to 0x0A. You will need to either change the termination char or turn it off.

Regards
Ray Farmer
Regards
Ray Farmer
Message 3 of 10
(3,989 Views)
If you open a serial port VISA assumes you are doing a text transfer. The characters 0x0A and 0x0D are used as termination characters and end the reading on the serial port. you have to change some attributes to set your port to transfer all data and ignore any characters as termination characters.

Connect a "FALSE" constant to the "Enable Termination Char (T)" input of "VISA configure serial port" and then use a property node "ASRL End in" (Serial Settings >> Serial End Modes for Reads) and set it to "None".

The Zip file contains a bmp of the BD.
Waldemar

Using 7.1.1, 8.5.1, 8.6.1, 2009 on XP and RT
Don't forget to give Kudos to good answers and/or questions
Message 4 of 10
(3,986 Views)
I thought it was going to work for sure, but Termination Char input only accepts a constant with a blue wire. I could not wire it to the fasle constant. I saw it in your picture that you managed to wire it up. I tried but it didn't work. Can you please let me know why. I am using labview version 6. Thanks,
0 Kudos
Message 5 of 10
(3,970 Views)
You are confusing two terminals next to each other, one is termination character input (blue-numeric) and the other is Termination Character Enable (green-True/False). Wire a False constant to the Enable terminal on the topside of the icon to disable the termination character. The blue input is if you want to specify a different termination character besides the standard 0x0D. Leave this terminal unwired.
- tbob

Inventor of the WORM Global
0 Kudos
Message 6 of 10
(3,966 Views)
I don't see any Terminal Character Enable with a green wire shown in the attached picture. Do you think it's because it was not available with the older version. Or am I getting the wrong icon. Thanks,
0 Kudos
Message 7 of 10
(3,945 Views)
Look again, just to the right of the Term Character (blue wire). It is there in LV 6.1. See attached.
- tbob

Inventor of the WORM Global
Message 8 of 10
(3,924 Views)

@tbob wrote:
Look again, just to the right of the Term Character (blue wire). It is there in LV 6.1.br>

It was added in LV6.1; it wasn't there in LV6.0. In 6.0, the "Message Based Settings:Termination Character Enable" property had a TRUE constant wired to it (LV6 block diagram attached).
A work around is to set the property to true and set the "Serial End In Mode" property to None(0) as outlined by Dan Mondrik et al. in this old post.
=====================================================
Fading out. " ... J. Arthur Rank on gong."
Message 9 of 10
(3,906 Views)
Thanks everyone for your help. I just got LV version 7 so it's okay now. It looks like there are a lot more fancy stuffs with this newer version.
Thanks,
0 Kudos
Message 10 of 10
(3,870 Views)