From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
01-14-2010 07:43 PM
Hello,
I am trying to read an array of characters including carriage return and line feed into one array into labview. I receive the command then wait x miliseconds until all data has been received and then read all data in the buffer using the serial read function. An example sequence of series of characters is as follows:
printf("RTCC time date\r\n35:6c:53\r\n0d/02/cb\r\n")
I need to receive this exact set of characters and store them into one array in labview. It appears that labview automatically breaks from the read routine when it receives the Carriage return or line feed code. Which, when writing to an array only gives the characters up to the line feed, then overwrites them upon exiting and returning the receive the next set of chars up to the next line feed. Which, in this case would require to have 3 separate arrays in order to store all of the data. Which ends up looking like this:
array1 "RTCC time date\r\n"
array2 "35:6c:53\r\n"
array3 "0d/02/cb\r\n"
It seems like there should be a setting to disable the read function response to the \r\n, but I cannot find any. For that matter, Can someone please guide to documentation that details this type of functionality using the VISA functions? I have searched the help and it gives a very very superficial explanation. I have found the VISA manual, but it only details C code implementation.
Attached is a VI that flows as explained.
Thanks
Solved! Go to Solution.
01-14-2010 07:45 PM
01-14-2010 07:46 PM
01-14-2010 07:50 PM
On the VISA Configure Serial Port is an input called 'Enable Termination Character'. Wire a false constant to it.
01-14-2010 08:53 PM
06-18-2013 03:20 PM
@Dennis_Knutson wrote:
On the VISA Configure Serial Port is an input called 'Enable Termination Character'. Wire a false constant to it.
Thank you! This worked like a charm
06-18-2013 04:27 PM
If you can convince your sending device to terminate a message with a non-printing ASCII character, you can have the best of both worlds. I use ASCII 4, EOT.
You can create a property node for the Instr class. Right click on the wire leading to the VISA Resource Name terminal of your VISA Read vi. Under "Message Based Settings", select "Termination Character". Set it to the character you have chosen. Then leave Termination Character enabled.