Hallo
I have a problem converting a file to a readable format. Please let me know if you are up for this....I can send you the file if you are interested.
Thanx
Printable View
Hallo
I have a problem converting a file to a readable format. Please let me know if you are up for this....I can send you the file if you are interested.
Thanx
Try me...
[email protected]
and I'll have a go...
Send away.
Why don't you post the contents of it? (at least some if it's huge)
The following is what i recieved. It was all one big long line, so i have placed carriage returns in it my self to stop it running over too far.
007792203737./38<BJQY`hpx€‰‘˜
§®³¸¼¿ÀÁÂÁÀ¾»¸²¤’~kZLB>>AHQ\iu‚—ž£¦§¥¢œ”‹€wnhcaadhnt
{‚‡Œ‘’’‘Ž‹‡„{wusrrsuwz~„†ˆ‰‰‰ˆ†…ƒ€~|{zyyyz
{|~€‚ƒ„„……„ƒ‚€~~}||||}}
~€‚‚‚‚‚‚€€€~~~~~€€€€€€€€€€� �€€€€€€€€
€€€€€€€€€€€€€€€€€€€€€€€€€€€€ €€€€€€€€€€€€
€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€� ��€€€€€€€€
€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€� ��€€€€€€€€€€€€€€€€€€€€€
€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€ €€€€€€€€€€€€€€€€€€€€€€€€€
€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€� ��€€€€€€€€€€€€€€€€€€€€€€€€€€
€€€€€€€€€€GGIMQUZ_diotz€†Œ‘–› ¤§ª¬*®®®*«©§¤œ‚th]
VRQSW^emv‡Ž“–™™™˜•Šƒ|vqmkkmosw{€„‡‰‹ŒŒ‹Šˆ†ƒ€~{yxvvwxz
{~€‚„…†††……„‚~}||||||}~€‚ƒƒƒƒƒ‚€€~~~}}
~~~€€€€€€€~€€€€€€€€€€€€€� �€€€€€€€
€€€€€€€€€€€€€€€€€€€€€€€€€€€€€� ��€€€€€€€€€€€€€€€€€
€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€� �€€€€€€€€€€€€€€€€€€€€
€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€ €€€€€€€€€€€€€€€€€€€€€€€€€
€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€ €€€€€€€€€€€€€€€€€€€€€€€€€
€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€ €€€€€€€€€€€€€€€€€€€€€€€€€€
€€€€€€€€€€€€€ddefhkmpruwz}€ƒ†‰‹Ž’”•––——––� �”“’Š„}
vplihiknquy}„‡ˆ‰ŠŠŠŠ‰‡„~{ywvwxy{|~€ƒ„„„…„„ƒƒ€~}|||||}
~€€‚‚‚‚‚‚€€~~~~~~€€€€€€€€€€� �€€€€€€€€
€€€€€€€€€€€€€€€€€€€€€€€€€€ €€€€€€
€€€€€€€€€€€€€€€€€€€€€€€€€€€€€� �€€€€€€€€€€€€€€€€€€
€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€� �€€€€€€€€€€€€€€€€€€€
€€€€€€€€€€€€€€€€€€€€€€€€€€€€ €€€€€€€€€€€€€
€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€ €€€€€€€€€€€€€€€€€€€€
€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€� ��€€€€€€€€€€€€€€€€€€.25
8=CKSZahpxˆ˜Ÿ¦*²·»¾ÀÀÁÀ¿½º·²£’n\NE@?BIQ[gsŠ”œ¡¤¦¥£ž–
„yqjebbdhlrx~„‰‘’‘І‚}yvtrrrtvy{‚„‡ˆ‰‰‰‡†…ƒ€~|{zyy yz
{|~€‚ƒ„„„„„ƒ‚€~~}}|||}}
~€‚‚‚‚‚€€€~~~~~~€€€€€€€€€€� ��€€€€€€€
€€€€€€€€€€€€€€€€€€€€€€€€€€€ €€€€€€€€€€€€
€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€ €€€€€€€€€€€€€€€€€€€€€
€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€� �€€€€€€€€€€€€€€€€€€€
€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€� �€€€€€€€€€€€€€€€€€€€€€
€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€� �€€€€€€€€€€€€€€€€€€€€€€€
€€€€€€€€€GJLNRV\afjpuz€†‹‘–
šŸ£¦¨ª¬¬¬¬«©§¥£šƒvi_XTSUY_emu|„‹‘•—˜˜—•‘‹…~xsollmorvz}… ‡‰
Š‹‹Š‰‡…‚|zxwwwxy{|~€‚„……………„ƒ‚€~}|{{{||}
~€‚ƒƒƒƒƒ‚€€~~~~~~~€€€€€€~~~€€€€€� ��€€€€
€€€€€€€€€€€€€€€€€€€€€€€€€ €€€€€€€€
€€€€€€€€€€€€€€€€€€€€€€€€€� ��€€€€€€€€€€
€€€€€€€€€€€€€€€€€€€€€€€€€€€€€ €€€€€€€€€€€€€€€
€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€� ��€€€€€€€€€€€€€€€€€
€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€� ��€€€€€€€€€€€€€€€€€€€€€€€€€
€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€defgikn qsuxz}€ƒ†‰‹‘“”•–––
–•”““‘Š„}wrmkijlnquy|€ƒ†‡‰ŠŠŠŠ‰
‡…‚|zxwwxyz|~€‚ƒƒ„„„„ƒƒ‚}|||||}
~~€‚‚‚‚‚‚€€€~~~~~~€€€€€€€€€€€ €€€€€€€
€€€€€€€€€€€€€€€€€€€€€€€€€€€� �€€€€€€
€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€ €€€€€€€€€€€€€€€€€
€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€� �€€€€€€€€€€€€€€€€€€€€€€
€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€ €€€€€€€€€€€€€€€€€€€€€€€€€€
€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€� �€€€€€€€€€€€€€€€€€€€€€€€€€
€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€� ��€€€€€€€€€€€€€€€€€€€€./2
7<BJQY`howˆ˜ ¦*³¸¼¿ÁÂÂÂÀ¿¼¸³¦”€m]NC>>AGPZfr~Š”œ¢¦§¦¤Ÿ—
Ž„zqidbacglrx~…‰’’’І‚}yvsrqrsvy{‚…‡ˆ‰‰‰ˆ†„ƒ€~|{zyyy z
{|~‚ƒ„……„„ƒ‚€~}}|||}
~~€‚‚‚‚‚‚€€~~~~~~~€€€€€€€€€€� �€€€€€€
€€€€€€€€€€€€€€€€€€€€€€€€€€€€� �€€€€€€€€
€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€� �€€€€€€€€€€€€€€€€€
€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€� ��€€€€€€€€€€€€€€€€€
€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€� �€€€€€€€€€€€€€€€€€€€€€€
€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€� �€€€€€€€€€€€€€€€€€€€€€€€€€
€€IHKNRV[`ekouz€†‹‘–šŸ£¦¨«¬¬*
¬«ª¨¦£œ‘„vj`XSRTX^dlt|…‹‘•˜™™˜–‘Œ…~xsnllloruy}‚…‡Š‹‹‹� �‰
‡…‚|zywvwxyz|€ƒ„…†††…„ƒ‚€~}||{||}}
~€‚ƒƒƒƒƒ‚€€~~~~~~~~€€€€€€€€€€€� �€€€€€€
€€€€€€€€€€€€€€€€€€€€€€€€€� �€€€
€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€� ��€€€€€€€€€€€€€€€€€€€
€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€ €€€€€€€€€€€€€€€€€€€€€
€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€� �€€€€€€€€€€€€€€€€€€€€€€€
€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€� ��€€€€€€€€€€€€€€€€€€€€€€€€
€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€dde hiknpsuwz}€ƒ†ˆ‹‘“”•–––
––•”“‘‹…~wrmjiikmqtx|ƒ…‡ˆŠŠŠ‰‰ˆ…
ƒ|zxwwxyz|~€‚ƒƒ„„„„„ƒ‚€}|||||}
~~€€‚‚‚‚‚‚€~~~~~~€€€€€€€€€€€€� �€€€€€€€
€€€€€€€€€€€€€€€€€€€€€€€€€€� ��€€€€€€€€
€€€€€€€€€€€€€€€€€€€€€€€€€€ €€€€€€€€€€
€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€� �€€€€€€€€€€€€€€€€€€€
€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€ €€€€€€€€€€€€€€€€€€€€€€
€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€� ��€€€€€€€€€€€€€€€€€€€€€€€
€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€ €€€€€€€€€€€€€€€€€€€€
Do you know what kind of file type it is?
This is the layout of the file:
Surge File (.srg) Layout
Field Name Type Description
Test Result Number 4 bytes Unique Number used to Id the record
Number of bytes used 4 bytes 3 leads of 3 waves of 512 bytes +
Test result #. (3*3*512)+4 = 4612
Settings 4 bytes Knob settings for volts/div and sec/div
Wave1Full 512 bytes Full Wave form for lead 1
Wave1Mid 512 bytes Middle Wave form for lead 1
Wave1Min 512 bytes Minimum Wave form for lead 1
Wave2Full 512 bytes Full Wave form for lead 2
Wave2Mid 512 bytes Middle Wave form for lead 2
Wave2Min 512 bytes Minimum Wave form for lead 2
Wave3Full 512 bytes Full Wave form for lead 3
Wave3Mid 512 bytes Middle Wave form for lead 3
Wave3Min 512 bytes Minimum Wave form for lead 3
If you want to know more about what the software is used for, here is a website (www.bakerinst.com). Unfortunately their Technical Expert in USA could not say what format. I only received the layout of the file.
The contact person in USA tells me that the structure specified above is incorrect. There is apparently another 9 waveforms per record in the file. As soon as I receive the new information, I'll post it.
Sorry for that.
Why don't use post us the hex contents of the file?
Here's for converting...
Code:Dim buffer() As Byte
Open file For Binary As #1
Get #1, , buffer
Close #1
For x = 0 To UBound(buffer)
Debug.Print Left$("0" & hex(buffer(x)), 2);
Next x
Ok, no need, i got the file, thanks
Field Name Type Description Position
Test Result Number 4 bytes Unique Number used to Id the record 0 - 3
Number of bytes used 4 bytes 4612 4 - 7
X-Scale 2 bytes Scale for the x axis Sec/div 8 - 9
Y-Scale 2 bytes Scale for the y axis Volts/div 10 - 11
Wave1Full 512 bytes Full Wave form for lead 1 12 - 523
Wave1Mid 512 bytes Middle Wave form for lead 1 524 - 1035
Wave1Min 512 bytes Minimum Wave form for lead 1 1036 - 1547
Wave2Full 512 bytes Full Wave form for lead 2 1548 - 2059
Wave2Mid 512 bytes Middle Wave form for lead 2 2060 - 2571
Wave2Min 512 bytes Minimum Wave form for lead 2 2572 - 3083
Wave3Full 512 bytes Full Wave form for lead 3 3084 - 3595
Wave3Mid 512 bytes Middle Wave form for lead 3 3596 - 4107
Wave3Min 512 bytes Minimum Wave form for lead 3 4108 - 4619
I don't know about you, but this looks almost exactly the same as the previous one.
Hope this helps
Ok, looks good, now one qwestion before i'm doing something.
What do you mean with
Quote:
converting a file to a readable format
What I mean is that I would appreciate it if you can convert the file to understandable text. The file at this point is gibberish.
There's no way i can convert that into text if you don't explain what each of thos byte means. If some of them are values then i could get them for you but if they need to be converted to text den give me the converting method. It's not encrypted is it? Shall i put the waveforms into byte arrays? Integer arrays? And what about UDT's, do you have any kind of structure made up for this or do you just have some text boxes and list on the form you want to read the data into`?
All the waveform values is most possibily real/double values. I need to use those values to plot graphs. If you want to see how the graphs look, let me know. The reason I want it in text, is the fact that I'm using the Instream command to read the values directly into my db. From there I will manipulate the values for the graph.
There is apparently a app called Gnuplot where the converted data can be plotted (graph). Still trying to figure out how the program works.
Thanx
So you want to get the graphs plotted or? How should the graphs be plotted? What scales used? How many bits per dot? I dunno much about Gnuplot, do you need that to plot or is it just fine with setpixelv?
Once again, what do you mean by converting into understandable text? Should it be some statistics about the waveforms or what?
Kedaman
I've send you a mail to your Hotmail address. It consist of a picture of how the graph should look and a clearer explanation.
Thanx
Nothing here yet?
could you send it again?
Now i got it, just let me have a look on it and i may help you ;)
Now i want to check if these values matches yours:
IDnumber and Size are the first two fourbyte longs i got, scale and yscale are integersCode:?test.Size
808596025
?test.IDNumber
926363696
?test.Xscale
14131
?test.Yscale
14131
I'm sorry for disturbing, but kedaman when are you coming back on ICQ mate?
is that what the cable company says?Quote:
"Tuesday next week" :mad:
I have that values. But how does the scale and y-scale collaborate with the graph that I sent you?
Well, i'm sorry but haven't got any further, i had to reinstall win98 and then vb didn't work and my vb cd was back at Åland, i'll install vb today and i'll se what i can do :)
That's what i wondered, how does the y-scale and x-scale match the graphs? Should i just calculate it aritmetically from what i see in the graphs?
What about Size and IDNumber, what's the idea with those?
Yeah, they said that they just got the stuff they needed to set up the connections. And AFAIk, there's hundreds waiting for their connection and only one man to do the work :confused:
I'll check it...but i'm more concerned with the Wave reading, because they are the ones I need to use for the graph. I need to draw the graph to know whether the readings are right (nowhere on machine, that generates file, the readings are shown!!).
Thanx
[Edited by hermanvd on 10-02-2000 at 05:42 AM]
This is just a test, i want to know if you like the output. The scales aren't correct either, i just put them up so that you can see how it looks like.
Save this as a form. frmmain.frm or whatever and load it into a project. Then launch and press the command button
Code:VERSION 5.00
Begin VB.Form frmMain
AutoRedraw = -1 'True
BackColor = &H00000000&
Caption = "Form1"
ClientHeight = 8715
ClientLeft = 60
ClientTop = 345
ClientWidth = 7725
ForeColor = &H00FFFFFF&
LinkTopic = "Form1"
ScaleHeight = 581
ScaleMode = 3 'Pixel
ScaleWidth = 515
StartUpPosition = 3 'Windows Default
Begin VB.CommandButton Command1
Caption = "Command1"
Height = 615
Left = 6840
TabIndex = 0
Top = 120
Width = 615
End
End
Attribute VB_Name = "frmMain"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Type WaveForm
Amp(511) As Byte
End Type
Private Type header
IDnumber As Long
Size As Long
Xscale As Integer
Yscale As Integer
Waves(2, 2) As WaveForm
End Type
Private Sub Command1_Click()
Dim buffer As header, x As Integer, lead As Integer, y As Integer
ChDir App.Path
Open "AM004500143A.srg" For Binary As #1
Get #1, , buffer
Close #1
For lead = 0 To 2
For x = 0 To 511
'The graph
For Level = 0 To 2
PSet (x, buffer.Waves(lead, Level).Amp(x) + lead * 128), QBColor(Level + 1)
Next Level
'The scale lines, you can change this for your purpose
If x Mod Int(buffer.Xscale / 2000) = 0 Then Line (x, lead * 128 + 196)-Step(0, -5), QBColor(6)
If x Mod Int(buffer.Xscale / 400) = 0 Then Line (x, lead * 128 + 196)-Step(0, -7), vbYellow
If x Mod Int(buffer.Xscale / 200) = 0 Then Line (x, lead * 128 + 196)-Step(0, -10), vbYellow: CurrentY = CurrentY - 15: CurrentX = CurrentX - 13: Print Int(x * 1.43)
Next x
For y = -64 To 64 Step 64 / 2
Line (0, y + lead * 128 + 128)-Step(5, 0), vbYellow
Print -y / 64 * 2000
Next y
Next lead
'or n=0 to
End Sub
Will this work in VB6?
Of course! Try it :)
hallo
Int(buffer.Xscale / 2000): This part always gives a zero. Thus error...division by zero. Am I missing something?
Thanx
Is this coding used to convert *.wav files into numbers and then graph the coordinates? I don't have the answer either but I am super interested. My thing is I'm trying to brake a *.wav file down into some testable variables. Example take the wave file of someone's voice and make the computer immitate the voice and also distinguish between two different voices. Any ideas?
Well, here's something for you, where you can change some important parts of the wave structure
http://forums.vb-world.net/showthrea...threadid=14791
to convert the byte array into 16 bit amplitude or stereo channels, you could use copymemory or change the code yourself :)
herman, are you using the same file you sent me?
well you could just replace all
buffer.Xscale
with
14131
and it should work...
Hallo Kedaman
Is this code suppose to draw graph? If not please let me know...I only see the axis of the graph.
Thanx for the help
sh*t! i forgot one thing :eek:
yes it suppose to draw a graph :)
you have to have AM004500143A.srg in the same path as this project. OR you specify the path
Code:Open "c:\yourpath\AM004500143A.srg" For Binary As #1
hallo
Thanx for the code. Luckily I specified the directory. I would like to know something, is this graph only for one of the leads specified in the file layout? It seems as if the graph only shows a break-up of the graph Surge lead 1 I sent you? I have one problem...I need the values for the graph to store in a db to use at all times.
Thanx for the help...it feels as if there is a light at the end of this tunnel. Thanx again
hallo
Thanx for the code. Luckily I specified the directory. I would like to know something, is this graph only for one of the leads specified in the file layout? It seems as if the graph only shows a break-up of the graph Surge lead 1 I sent you? I have one problem...I need the values for the graph to store in a db to use at all times.
Thanx for the help...it feels as if there is a light at the end of this tunnel. Thanx again
All three leads should be shown in three graphs, full mid min are drawn in the same graph with different colors, qbcolor function you know :)
If you want them into a database then don't ask me, i've never touched any :( but they're still in an UDT and you can still access each point in each graph by using
buffer.Waves(lead, Level).Amp(x)
where x is the time, level is 0-2 the full/mid/min thing and lead is number of the surge lead graph.
Hi Kedaman
I looked at the code and I understand the logic of it. What puzzles me is that it plots all the full's on a graph, all the mid's on a seperate graph ect. But in the code the full/mid/low for every lead is grouped together. Am I missing something here?
Thanx for the help
Hmm, maybe the graphs are saved in the wrong order..
Try change the pset line to this:
I swaped level and lead so each lead will be in different graphsCode:PSet (x, buffer.Waves(Level,lead).Amp(x) + lead * 128), QBColor(Level + 1)
Thank you for all your help...now to see if the user will fall for it.