LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

To CR or not to CR, A Tip....

I am relatively new to LV so likely all of you gurus know about this...
 
I built a vi to capture a number of waveforms and write them to a binary file on an RTOS system, based on an external trigger turning ON. When the trigger turned OFF this state triggered an FTP transfer to my Windoze Host system, and then deleted the file on the RTOS system to keep the disk clear. During the development of this vi I built sections of it for testing and later put them all together.
 
The experimental section I built to write the file used the Write Binary File.vi and when I used WS-FTP to do the transfer I could then pull it into my Read.vi, which uses the Read Binary File.vi, and it displayed correctly. However, when I combined this with the other sections, suddenly I could not display these files any more. A probe showed me that all of the info was there but it just wasn't being displayed.
 
I ran both my "section" and the whole thing several times to get a few files to play with. Then I used a fancy editing program to display these files in several different formats, trying to find out what the story was. Eventually I discovered that the files which WOULD NOT display all had CR/LF combinations. The files which worked only had LF.
 
The Write Binary File.vi doesn't have any way to specify this so I looked a bit deeper. I noticed that, by default, WS-FTP transfers in BINARY format unless you specify diferently. I then took a look at the FTP Put File.vi and saw that it defaults to ASCII format. I added a TRUE constant to the "binary(F)" input and now everything works perfectly.
 
I hope this may be of some help to someone else in the future. It gave me fits for several days....
 
technomage
Message 1 of 4
(2,971 Views)
Hi technomage,
 
That was a subtle thing to catch -- I bet that would have had many of us stumped pretty bad as well...Thanks for posting your solution!
Charlie S.

Visit ni.com/gettingstarted for step-by-step help in setting up your system
0 Kudos
Message 2 of 4
(2,926 Views)

Thanks for the reply Charlie. Even though I found the problem, and solution, it still has me a bit baffled as to why the chart wouldn't display it with the CR/LF combo. I know that this tidbit sure isn't written into the help file. As I said I hope the info helps somebody else down the road...

technomage

0 Kudos
Message 3 of 4
(2,905 Views)


@technomage wrote:

Thanks for the reply Charlie. Even though I found the problem, and solution, it still has me a bit baffled as to why the chart wouldn't display it with the CR/LF combo. I know that this tidbit sure isn't written into the help file. As I said I hope the info helps somebody else down the road...

technomage



By inserting extra data you got corrupted binary data and the chart got apparently confused by that. Binary data is always very sensible to even single bit modifications.

Rolf Kalbermatter
Rolf Kalbermatter  My Blog
DEMO, Electronic and Mechanical Support department, room 36.LB00.390
Message 4 of 4
(2,881 Views)