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.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Termination Char

Hello,

I have some small problem where I don't know really how to choose the termination char can u plz suggest for below point and I am new to LabView

 

I working on DAQ for one of the machine where machine will give output at every 5 minutes and the data looks like as shown below

00187D2AAD4C.11300|SERVER|PARAMETERS|1|1|0|
00187D2AAD4C.11300|SERVER|PARAMETERS|1|2|30|
00187D2AAD4C.11300|SERVER|PARAMETERS|1|3|2|
00187D2AAD4C.11300|SERVER|PARAMETERS|1|4|1|
00187D2AAD4C.11300|SERVER|PARAMETERS|1|5|80.0|
00187D2AAD4C.11300|SERVER|PARAMETERS|1|6|95|
00187D2AAD4C.11300|SERVER|PARAMETERS|1|7|1000.0|
00187D2AAD4C.11300|SERVER|DATA|1|1|180.525|0.00000|
00187D2AAD4C.11300|SERVER|DATA|1|2|1|2.24000|0.00000|
00187D2AAD4C.11300|SERVER|DATA|1|3|1|57237.80000|0.00000

 

First 7 lines will read first and after 1 second the another 3 lines will read but problem is I don't know what should I give as termination Char

so some time I miss the last three lines

regards

vinay

0 Kudos
Message 1 of 16
(3,204 Views)

Hello Vinay,

 

Could you please precise a bit more your setup so we can help you? (Are you using only National Instruments software and hardware?)

How are you transmitting these lines to your acquisition machine? (USB, Ethernet, etc.)

Which functions are you using in your program?

 

Have a nice day,

 

Armando

0 Kudos
Message 2 of 16
(3,187 Views)

I am guessing there is a line feed or carriage return probably both at the end of those lines...

 

If not the data would look like this:

 

00187D2AAD4C.11300|SERVER|PARAMETERS|1|1|0|00187D2AAD4C.11300|SERVER|PARAMETERS|1|2|30|00187D2AAD4C.11300|SERVER|PARAMETERS|1|3|2000187D2AAD4C.11300|SERVER|PARAMETERS|1|4|1|00187D2AAD4C.11300|SERVER|PARAMETERS|1|5|80.0|00187D2AAD4C.11300|SERVER|PARAMETERS|1|6|95|00187D2AAD4C.11300|SERVER|PARAMETERS|1|7|1000.0|00187D2AAD4C.11300|SERVER|DATA|1|1|180.525|0.00000|00187D2AAD4C.11300|SERVER|DATA|1|2|1|2.24000|0.00000|00187D2AAD4C.11300|SERVER|DATA|1|3|1|57237.80000|0.00000

========================
=== Engineer Ambiguously ===
========================
Message 3 of 16
(3,167 Views)

The data that you showed us has two additional characters that make the lines "line up nicely on the screen", namely <CR> and <LF> (Hex 0D and 0A).  Many Serial Devices transmit "lines" with this sequence (or sometimes just one of them) as the String Terminator -- if so, that is what you should use.  I wonder if you are using fixed-size Reads, which might cause the end of longer strings to be lost.

 

Of course, I could just look at your VI, but you didn't attach it!  So I'm "guessing" at the issue.  Please attach your VI.

 

Bob Schor

0 Kudos
Message 4 of 16
(3,139 Views)

hi 

the data i attached is reading from machine using DAQ card rs232/4 and labview software 2015

and i using Visa function to read this data but i dont know how to read full data without any missing data.

 

regards,

vinay

 

0 Kudos
Message 5 of 16
(3,125 Views)

Try right-clicking your indicator and choose [ "\" code display].

 

It will show what the termination character is.

 

\Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 6 of 16
(3,120 Views)

Well, we still cannot "see" your LabVIEW code (and code is important, after all).  I don't normally do this, but I'm attaching a Snippet, with explanation, for you to consider.

VISA Read.png

The first function is the VISA Serial Open (found on the Data Communications, Protocols, Serial Palette).  The vanilla VISA Open might also work, but this one allows you to set the Baud Rate, Data Bits, Parity, and other miscellaneous Serial Parameters (just use the defaults if you aren't sure).  The second and third Top connectors are to specify the Termination Character (<LF>, 0A by default, probably OK) and a Boolean, Use Termination Character (True by default, and the Secret to Serial Joy).  The next function is where you send whatever Commands your VISA device requires before it starts talking to you.  I'm assuming that once started, it keeps talking, but if you need to give a command for every request, put that command inside the loop.

 

The trick is what you do in the loop.  You tell VISA to read an "unreasonable" number of characters (I often use 1024, but I'm being lazy and only typing 3 digits).  If the device sends a Termination Character, you'll get exactly one line (of however many characters, less than the amount requested, of course), and you can process them as soon as the Read returns the line.  This lets you "read full data without any missing data".

 

Bob Schor

Message 7 of 16
(3,110 Views)

@Bob_Schor wrote:

VISA Read.pngThe first function is the VISA Serial Open (found on the Data Communications, Protocols, Serial Palette).  


Actually, that function is VISA Configure Serial Port.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 8 of 16
(3,097 Views)

hello Bob_Schor,

attached the Visa read Vi picture I tried to attach whole VI but couldn't able to do tat

in the picture as u can see it worked for me if I operate it manually. means after every test run I need enable Write Button to write/Save the data in to txt file as you can see in the picture

only thing I don't have control on automatic read when data arrived

let me know your feed back plz

 

regards

vinay

 

0 Kudos
Message 9 of 16
(3,077 Views)

one more picture for reference

0 Kudos
Message 10 of 16
(3,075 Views)