LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

CDB Engineering notation digit limit

Solved!
Go to solution

Hopefully this is an easy question.    I have an output array which contains Complex DBL data points, that I'm trying to format to match a CITIfile format:

 

http://cp.literature.agilent.com/litweb/pdf/ads2004a/cktsim/ck0419.html

 

This format limits the data to no more than 11 ASCII characters in Engineering notation.

 

The problem that i'm having with LabVIEW is that it is inexplicably adding characters ahead of the decimal point (should just be one character), which then truncates the Exponent.   How do I limit a CDB number to 6 digits in the following format (the little "x"s):   Sx.xxxxxEsX    ?

 

I have attached a testing VI, which generates the Array data, then tries to format the data, and write to a ASCII file.   NOTE:   Please be aware, This VI will prompt you to create a file to write data to on your PC.   I have attached two sample files showing the correct output that i need ("correct"), and what it is currently doing ("test").   These can be opened with notepad to review before running the VI.

 

Any help would be appreciated.   I'm sure this is something simple that I'm overlooking.

0 Kudos
Message 1 of 3
(3,620 Views)
Solution
Accepted by topic author SparkyOne

Hi One,

 

why do you convert to string instead of using FormatIntoString properly?

 

check.png

Edit: you can even use ArrayToSpreadsheetString here…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 2 of 3
(3,607 Views)

The easy answer is, "Because i don't know any better".

 

I'm learing things on the fly....which means I don't always use "proper" methods.  

 

Thanks for the formatting lesson.  Kudos.

0 Kudos
Message 3 of 3
(3,589 Views)