07-25-2018 06:37 AM
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
07-25-2018 07:33 AM
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
07-25-2018 09:11 AM - edited 07-25-2018 09:20 AM
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
07-25-2018 10:55 AM
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
07-25-2018 12:59 PM
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
07-25-2018 01:17 PM
Try right-clicking your indicator and choose [ "\" code display].
It will show what the termination character is.
\Ben
07-25-2018 02:26 PM
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.
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
07-25-2018 04:41 PM
@Bob_Schor wrote:
The first function is the VISA Serial Open (found on the Data Communications, Protocols, Serial Palette).
Actually, that function is VISA Configure Serial Port.
07-26-2018 04:54 AM
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
07-26-2018 04:59 AM
one more picture for reference