I successfully creates a file, it has the expected length of 8192 bytes (there are 8192 entries in romOutDate.length), but hexdump shows all 8192 values with zeros (0x00) ....
Reading out with a for loop is OK:
for (var i = 0; i < romOutData.length; i ++) {
print ("romOutData [", i, "] = ", romOutData [i]);
}
print("len = ", romOutData.length);
So the fields have the correct values, but the file has only zeros. Is this a data type issue ?
What is the correct way to handle binary files and byte arrays in the script language of Discovery products ?
-----------------------
I use 3.22.23 (beta) on Linux 64bit Ubuntu 24.04 with Digital Discovery
----------------------
Question
OE3CPA
Hi to the forum,
I like my Digital Discovery and made a project to take HP Singnatures (historic method for HP instruments) and reading ROM images.
All is working well, except for the last step.
I have filled up an array called "romOutData" by:
var romOutData = []: // for init ...
romOutData.push (rgValue [i]); // to read values into OutData
And at the end I use:
FileWriteBinary("/tmp/x.bin", romOutData); // write file
I successfully creates a file, it has the expected length of 8192 bytes (there are 8192 entries in romOutDate.length), but hexdump shows all 8192 values with zeros (0x00) ....
Reading out with a for loop is OK:
for (var i = 0; i < romOutData.length; i ++) {
print ("romOutData [", i, "] = ", romOutData [i]);
}
print("len = ", romOutData.length);
... delivers ...
:
:
romOutData [ 8188 ] = h80
romOutData [ 8189 ] = hBA
romOutData [ 8190 ] = h04
romOutData [ 8191 ] = h51
len = 8192
So the fields have the correct values, but the file has only zeros. Is this a data type issue ?
What is the correct way to handle binary files and byte arrays in the script language of Discovery products ?
-----------------------
I use 3.22.23 (beta) on Linux 64bit Ubuntu 24.04 with Digital Discovery
----------------------
Greetings
Edited by OE3CPAChris
Link to comment
Share on other sites
2 answers to this question
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now