How to write a 2-D Array of Doubles to a binary file in LabView 8.5?
Okay, this is driving me nuts. I got a program that worked fine in LabView 8.0 but refused to write any data after my institute upgraded to LabView 8.5. The data is stored in a 2-D array of doubles and is supposed to be written to a binary file, that has been correctly opened and got a header written to it containing some meta-data of the measurement. But when the doubles from the array should be written to the file, nothing happens. All I get is an (except for the header) empty file of 786 kB. I found out that writing works if I convert the data from the array to singles right before wiring them to the "write to binary file" VI, but for several reasons I need the data as doubles. Can anyone help me? I've tried everything anyone has written here about writing to binary files and more.
Remember, it worked perfectly fine with an older version of LabView. Any ideas?
It is possible that you run into a known memory optimization bug.
Try to place an "always copy" primitive as discussed here.
Message Edited by altenbach on 11-18-2008 09:11 AM
LabVIEW Champion . Do more with less code and in less time .
Similar Messages
-
How do I find out the exact path of each and every file that LabVIEW finds and loads into memory for a given top level vi? There is probably a trivial, easy way to get this info, but I have not yet found it! Thanks..
Or if you want to grab all the paths programatically, try the attached VI.
Open the top level that you want all the paths from and close all others, then open the
attached and run it. It will return an array of all the VIs that the VI
in question uses, including vi.lib VIs. You can filter these as well if
you like.
Ed
Message Edited by Ed Dickens on 08-01-2005 07:01 PM
Ed Dickens - Certified LabVIEW Architect - DISTek Integration, Inc. - NI Certified Alliance Partner
Using the Abort button to stop your VI is like using a tree to stop your car. It works, but there may be consequences.
Attachments:
Get all paths.vi 29 KB -
Help:how to use java.util.jar to zip or unzip a binary file.
how to use java.util.jar to zip or unzip a binary file or a file contain native code.
It may help you to know how I add JARs
1. I open my Project (myProject)
2. I Mount the JAR to the FileSystem (like mypackages.jar = which includes com.mus.de.myClass.java)
3. I Mount the File to the FileSystem (like c:\..myfiles..\myProject)
3.1 I add the File to my Project
4. I select File | New -> Classes | Main
4.1 I typed "import com.mus.de.myClass.java" to refer to this package.
4.2 I called some of the public methods
thats it
Andreas -
How to write values to an array and call these to produce an xy graph
Hi, Hopefully someone can help. I have attahced my VI.
I am happy with how to write data to a file, which I have already done. The next thing I want to do, is write the pressure and acoustic values to an array for the duration of my testing (Testing is when the log switch is on). Once I switch the log button on my front panel off, I want to be able to call another VI which will display an XY graph of the Pressure and acoustics Vs Time. This will be populated from the array I create. Can anyone please help.
Thanks in advance.
Attachments:
PSV TEST MAIN.vi 203 KBSince you are acquiring one point at a time, use a shift register and build an array of points , bundle it and display on XY graph
As shown in attached VI
Attachments:
PSV.vi 250 KB -
How do i install powersearch toolbar properly, it only instal a binary file
i try downloading powersearch toolbar but it only downloads a binary file and then it says it cant download because it has no update information how do i get it the toolbar on my browser?
== This happened ==
Every time Firefox opened
== i installed it the first timeWhat you need is a correct path to the directory
inside of the jar. This can be accomplished by adding
a line to your main program like this:
URL
url=myProgram.class.getResource("images/New16.gif");
Dummy = new JButton(new ImageIcon(URL));
where myProgram.class is the name of the class
file that contain the main method.
Hope this helps....
;o)
PS: I don't want your dukes...I got them coming out of
my ears!
O.K, that works thank you.
I put something like:
for all the 'buttons' in the toolbar
URL url = null;
Class ThisClass = this.getClass();
url=ThisClass.getResource("images/New16.gif");
Dummy = new JButton(new ImageIcon(url));
Dummy.setActionCommand("New");
Dummy.addActionListener(this);
Dummy.setToolTipText("New Database");
bar.add( Dummy );
etc for all the rest of the 'buttons'
After Reading the API docs on URL's etc I'm still not sure as to why it works, but it does....
I am able now to place the class files in a jar along with the images and it all works fine
although now I don't quite follow all my code....................
I assume that
url=ThisClass.getResource("images/New16.gif");
returns some sort of 'relative url ' ???
Thanks for the help though. -
How do I open a LeCory .trc binary file in labview
We have several Lecory scopes witch create large binary files to save room on there hard drive. the files are .rtc. I would like to open these files using labview
Alan from LeCroy Tech Support here...
Attached is a decode I put together, mostly using code from the lcwave driver. The VI will read a binary file, and return the voltage array, horizontal offset (aka "t0") and the horizontal interval (dt), among other things. It'll handle both BYTE and WORD mode files, as well as hi-Lo and Lo-Hi byte ordering.
If what you are needing is a tool to decode a large number of files that already exist, then all you need to do is use the "Batch Waveform Conversion" feature of LeCroy's ScopeExplorer application. This is available at http://www.lecroy.com/tm/Library/Software/home.asp?menuid=8. This will convert all trc files in a folder to ASCII with columns for time and voltage.
If instead you are needing to decode files so that you can then analyze the data, then the attached VI or the diadem plug in is certainly a better solution. I couldn't tell you which is faster...
Feel free to contact me directly if you have any questions!
Best Regards,
Alan
Alan Blankman, Technical Product Marketing Manager and LabVIEW Developer
LeCroy Corporation
800-553-2769 x 4412
http://www.lecroy.com
[email protected]
Attachments:
Decode waveform from file.vi 173 KB -
How to write ticked checkbox data in a servlet to a flat file
I display data on the screen with check boxes beside each name. When i check the neccessary check boxes how can i write only the cked ones to a text file
I display data on the screen with check boxes beside
each name. When i check the neccessary check boxes how
can i write only the cked ones to a text fileTWO THINGS: If you ALREADY have data in the textfields/textareas BEFORE you check the checkbox, then have an Actionlistener ready for the relevant checkbox, so that as soon as its checked:
//In the action listener for the checkbox
String the_data = jTextField.getText();
//Now call your serializer
If you dont have data ready, and you put it on and then check the checkboxes you want or you check the checkbox to enable its jtextfield, then you'll need some other mechanism to activate the serialization through the actionlistener, like a button.
In either case, its the same old story......an ActionListener that just calls a serialization mechanism for a simple string into a file. -
How to write the output of an SQL query to a text file?
I am using Oracle 11g and SQL plus.
I have a large table called rating.
Whenever I do
SQL> select * from rating;
The output goes much beyond what the SQL Plus screen can show. I want to therefore store the output of this query into a text file.
How can this be done? Please help. Thanks.SQL> SPOOL results.txt
SQL> select * from rating;
SQL> SPOOL OFF -
How do you write to a 3D array?
I know this is probably a very simple questions, but for some reason I can not think of how to write to a 3D array. The application that I am going to use this for is that I have multiple graphs with x and y data points, and I want to be able to write all the graphs with their data points to a 3D array instead of having a large amount of 2D arrays. My main goal is to be able to use this 3D array with a graph so that I can click through all the graphs after I have done my measurements. I appreciate anyone that can give me help on this matter.
3D array handling is not much different from 2D, you just have another coordinate to specify - "page" (row, column, page). Create a 3D array constant and wire it to e.g. the replace function and it will automatically scale up to show you the index and length options involved...
PS. If you have XY arrays why not just have a 1D array of XY sets (as one would use for multiplot XY graphs)?You could even write the whole array to a graph (save you the extraction operations) and then choose to see whatever combination you would like by setting the color of the plots you want to hide to transparent.
MTO -
Hello All...........,
I have done some code for applet and servlet communication in which i writes "String " as an object and gets reply from servlet as a string as follows:
// send data to the servlet
String input="hello there.....";
URLConnection con = getServletConnection();
OutputStream outstream = con.getOutputStream();
ObjectOutputStream oos = new ObjectOutputStream(outstream);
oos.writeObject(input);
oos.flush();
oos.close();
// receive result from servlet
InputStream instr = con.getInputStream();
ObjectInputStream inputFromServlet = new ObjectInputStream(instr);
String result =(String) inputFromServlet.readObject();
outputField.setText(result);
//outputField.setText("good morning");
inputFromServlet.close();
instr.close();This code is same at servlet end.
But now i want to pass an int array.How to pass int[] as an object.
It is giving me error if i pass int array as int array[]={1,2,3}; oos.writeObject(array); Why is it so?
Can anybody tell me how to write and read int array[].
Thanks.
Shraddha.hello kaj,
I am trying to write as follows
while writting:
int array[]={1,2,3,4,5};
URLConnection con = getServletConnection();
OutputStream outstream = con.getOutputStream();
ObjectOutputStream oos = new ObjectOutputStream(outstream);
oos.writeObject(array);
oos.flush();
oos.close();
while reading:
InputStream instr = con.getInputStream();
ObjectInputStream inputFromServlet = new ObjectInputStream(instr);
int result[] =(int []) inputFromServlet.readObject();
Thanks,
Really imp for me. -
Multiple writes of a DBL 2D array to binary file
Hello.
Does anyone have an example of writing a 2D array to a binary file multiple times?
Specifically, I need to write a 2D array of DBL to a binary file mulitple times and then (later) be able to read it back (reconvert to DBL). All of the examples that I've found only do one write and then close the file. I need to leave the file reference open and write data to it over the period of a few days. The data comes out of a queue that is fed from a DAQ loop. (In an acquistion loop I feed a queue and in a slower loop I dequeue the data and write it to disk)
I believe it has something to do with the pos mode and offset mode but I can't figure it.
I haven't been able to successfully read the data back yet from the .bin file so I'm not sure if I'm even writing it correctly.
The closest example that I've found is the High Speed Data Logger and High Speed Data Reader but I haven't had any luck with those.
Thanks in advance.
Steve
LabVIEW 7.1
Solved!
Go to Solution.To change the representation of a number, use the Numeric > Conversion sub-palette.
The example below shows that the wires contain the representation info independently of the destination indicators : you can connect different types of numerics to the same wire and LabVIEW will automatically adapt to the type (the coercion dots indicate that a convertion has been done). Everything you should want to know about converting numbers is explained in the LabVIEW Help : "Conversion VIs and Functions"
Message Edited by chilly charly on 07-30-2005 10:57 AM
Chilly Charly (aka CC)
E-List Master - Kudos glutton - Press the yellow button on the left...
Attachments:
Convert to single.png 27 KB -
How to write the jndi lookup for ejb using oc4j server in jdeveloper
Hi All,
i am new to the JDeveloper. i want to develop the session bean in JDeveloper using the OC4J server. how to write the jndi lookup in cllient. what are the xml files need to deploy the application. where can i mention the JNDI name in xml file. so please provide the information as soon as possible.
regards
ramThere is quite in-depth information in the Enterprise JavaBeans Developer's Guide.
Section 2 (Understanding EJB Application Development) explains the xml files needed and Section 29 (Accessing an EJB from a Client) explains how to do a JNDI lookup.
Hope this helps. -
Would like to know how to write a Proportional Integral control VI
Please would some one show me how to write a Proportional Control Vi
Check out this:
http://forums.ni.com/t5/LabVIEW/How-to-build-a-PID-controller/td-p/608537
http://zone.ni.com/devzone/cda/epd/p/id/2382
Br,
/Roger -
Write to binary file different from 8.0 to 8.2?
I am communicating with a device via USB and am using a method setup by the USB driver programmer. To communicate, I write to a binary file with a filename of \\?\COMx. This has been working fine for about a year in mfg with Labview 8.0. I recently "upgraded" to 8.2 and now it does not work. If I save for a previous version and run 8.0 it works fine. How can I make this work with 8.2?
Yi Y,
The USB device is one of the instruments we manufacture. The USB driver is written so writing to the USB port is just like writing to a file. I use the binary read/write VI's to send and receive commands to this USB device. The filename I use is \\?\COM#. I am told by the USB driver creator that this is common for low level C. I have been using this VI for that last year and recently upgraged from 8.0 to 8.2 and it does not work. I run the same vi under 8.0 and it works fine. This is not a common way to communicate, so will probably not get an answer.
My next question is, is there any way to run an 8.0 dll or vi from an 8.2 executable?
Thanks
Hi dgtest1,
Which USB device you are using, and which driver are you using? I'm trying to figure out specifically how you are communicating with the USB device by writing a binary file and how was the binary file written. Could you please post more information to describe in more details about what your set up is doing?
Thanks!
Yi Y.
Applications Engineer
National Instruments
http://www.ni.com/support -
How can I, depending on the elemnts of an array, write into the same array
Hi everyone, to make this a little clearer, consider a 2*2 I8 array, many y objective is the following:
1) connect the array to the case structure, and depending on a specific case that's value of element of indeces (0,0), write over the same array in this way
1 0
2 3
for example, note that in (0,0) there's 1, so my decision is to make the array (same array) as:
0 0
2 3
any ideas?
Thanks.
T. A.toniaz wrote:
... should I add the array itself inside the loop or should I add its local variable?
The array data is in the shift register or wire!
Any controls or indicators of the array just lets you interface to it via the front panel. Don't use controls or indicators as data storage via local variables, that's not the right way.
Here's a very simple demo (LV 8.0) that shows one possibility how to do this. See if it makes sense.
LabVIEW Champion . Do more with less code and in less time .
Attachments:
changeArrayElement.vi 18 KB
Maybe you are looking for
-
Mac OS X 10.6 will not install updates
I continue to get an error message when installing software updates for Java Update 10 and iTunes telling me the selected updates could not be installed due to an unknown error.
-
I have created several i-photo albums with subtitles and proceeded to burn them to a CD. The CD burned with the correct subtitles, however, the photos did not appear in the same sequence. I tried another method and the photos appeared in the pr
-
TS3367 FaceTime texting no longer mirroring on devices
Just changed my Apple ID password and it has now stopped mirroring text messages on my iPad and iPhone devices. It is one or the other now. It is not a big deal but I am communicating with someone overseas and it is nice to keep the same conversatio
-
Illustrator CS3 crashes after Yosemite upgrade
I have just upgraded to Yosemite on my 2010 Mac book pro. Everything seems to be running ok, slightly slower but ok, the main issue I have is that Adobe Illustrator CS3 has stopped working. The rest of the Adobe creative suite works fine - Photosho
-
I hate FileVault - I can't get rid of it
I had to restore my laptop system running 10.4.11 due to problems with files disappearing associated with FileVault. After I restored it, I turned OFF Filevault. It did its thing and it all worked. No sparseimage any longer.I also fixed all permissio