LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Serial receive - ignore \r\n CR LF ascii codes

Solved!
Go to solution

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 

 

 

 

 

0 Kudos
Message 1 of 7
(6,480 Views)
Woops, here is the VI.
0 Kudos
Message 2 of 7
(6,479 Views)
All right, apparently I am a retard.  Last try.
0 Kudos
Message 3 of 7
(6,477 Views)
Solution
Accepted by topic author fvnktion

On the VISA Configure Serial Port is an input called 'Enable Termination Character'. Wire a false constant to it.

 

Message 4 of 7
(6,475 Views)
I like simple solutions!  How about a lead on where to find detailed descriptions of operations of the visa serial functionality?  The labview program help was very watered down.
0 Kudos
Message 5 of 7
(6,458 Views)

@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 Smiley Very Happy

0 Kudos
Message 6 of 7
(4,921 Views)

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.

0 Kudos
Message 7 of 7
(4,909 Views)