DIAdem

cancel
Showing results for 
Search instead for 
Did you mean: 

data format

I have quite a few data channels. I am trying to save them in ASCII format. The problem i face is that i want to save them in the following format: if greater than 0 then +2.32E-02 and if not then -2.32E-02 (Note they have to be same length in characters). I am using "chdx" right now but it is making it very slow. I tried using "datasavesel" but i cant choose the format to be what i want it to be. Any suggestions will be appreciated. Thanks SN
0 Kudos
Message 1 of 4
(3,847 Views)
Hi MGA,

I would calculate the values before saveing as follows:

Call formulacalc("ch('Name'):= (ch('Name')>0)* 2.32E-02 - (ch('Name')<0)* 2.32E-02")

The calculation via formulacalculator is much faster than chdx.
If you’ve finish the calculation you can store the data.

I hope this can help you.

Best regards

Walter Rick
0 Kudos
Message 2 of 4
(3,847 Views)
Hi Walter,

I am sorry i dont think my question was clear. I have data channels which i need to store with their own numbers but with a + (if greater than 0) or a - (if less than 0) in front of it. For eg: if my channel1 has following numbers: 0.062358,2.3578,-2.6477 then my ascii file (named xxx.1) would read:
+6.23E-02
+2.36E-00
-2.65E-02
and so on so forth.

I apologize for the confusion.
Thanks SN
0 Kudos
Message 3 of 4
(3,847 Views)
Hi Shefalika,

Sorry, but as I know there doesn't exist a function like this. I think chdx is the right way. Maybe the following script can give you some ideas:

Dim iLineNo, intMyHandle, intMyText, sTextLine, iChNo
iChNo = Cno(ChannelName)
intMyHandle = TextFileOpen("d:\temp\NewText.txt",tfCreate OR tfWrite OR tfANSI)
For iLineNo = 1 To 20
sTextLine = chdx(iLineNo, iChNo)
if sTextLine > 0 then
sSign = "+"
else
sSign = "-"
end if
sTextLine = sSign & cstr(sTextLine)
intMyText= TextfileWriteLn(intMyHandle, sTextLine)
Next
intMyText = TextFileClose(intMyHandle)

Greetings

Walter
0 Kudos
Message 4 of 4
(3,847 Views)