LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Save/Restore Multiple Waveforms Chart History

Solved!
Go to solution

Ok folks, just as the title say .. can labview save and restore a history and settings of multi-waveform chart?

i've searched allover google, this forum, and long tutorials, there is no one sample for such thing

 

i don't know how we are in 2016 and there is no simple way or sub VI that save the application configuration (controls, chart config, and history), every time i reopen my compiled app it reset to defaults?, and any saving/restore samples are limited and complicated!, i hope that there is secret method i don't know about or magic VI for such thing

 

I'm open for suggestions ...

0 Kudos
Message 1 of 13
(5,173 Views)
Solution
Accepted by topic author Mr-FoX!

You could program some configuration method yourself, I suggest to use ini files. There is even some toolkits if you do not want to program yourself, download them via VIPM.

Check out this thread for an example:

http://forums.ni.com/t5/LabVIEW/How-to-convert-binary-data-from-the-front-panel-controls-into/m-p/32...

Message 2 of 13
(5,159 Views)

thankyou for fast reply

Sadly I can't install it, i got message from the vipm that it's not compatable, i'm on windows 10x64 with labview2016x32

 

i'm more interested in saving my chart history, can i save it as TDMS file, so i can open it with any TDMS viewer? if yes could you please tell me how?

i'm attaching my vi, i want to save chart history as TDMS

0 Kudos
Message 3 of 13
(5,129 Views)
Solution
Accepted by topic author Mr-FoX!

I have also LabVIEW 2016, but I am able to install all MGI toolkits via VIPM... Maybe the problem is that you use Windows 10? (i use Windows 7 x64 plus LV2015/2016 32bit).

 

In my previous post I was refering to configuration settings, and not the chart history. The chart history is simply the data of the waveforms. You can easily save it to a TDMS file. Another advice is to decouple the data display/analysis/file saving from the DAQ part. See the example below, as a possible solution using Producer/consumer design. I did not have a closer look at your DAQ code, neither what you "play" with the "evil" dynamic data, and why you have a 60 msec wait in the while loop, etc...So it is either a valid DAQ technique, or wrong, no idea... (the png is a snippet below, contains the VI too, the TDMS file is closed in the Error case of the consumer while loop).

 

MicDAQ_Producer_consumer_design_BD.png

Message 4 of 13
(5,121 Views)

I did manage to instal MGI, seems to be network issue, after some tries it installed, and it worked like charm, i can now save all controls and chart values thankyou

 

i'm using 60ms in while loop to balance chart update and CPU usage, and i'm converting from dynamic data so that i can save the signal as TDMS, Can i save history in dynamic data form?

 

however i don't understand why using "sound input clear and decoupling" ? signal aquiration is working just fine without them, i'm fairly new to labvew so i'm sorry if that's such newbee question to ask

 

also can you provide me the code in VI? as there is some symbols i don't understand and don't know where to get it

 

thanks

0 Kudos
Message 5 of 13
(5,093 Views)

@Mr-FoX! wrote:

I did manage to instal MGI, seems to be network issue, after some tries it installed, and it worked like charm, i can now save all controls and chart values thankyou

Good!

 

i'm using 60ms in while loop to balance chart update and CPU usage, and i'm converting from dynamic data so that i can save the signal as TDMS, Can i save history in dynamic data form?

Well, how you do your DAQ is up to you, but you have to keep in mind, if you use a 60 ms Wait, that interval is a "gap" in your data, so actually you are missing data from your measurement periodically! You set your microphone at the init to take 1000 samples with a rate of 11 kHz, and the default measurement mode is "continuous". So delete the 60msec Wait function from the top loop, and just let the DAQ "time itself".

 

however i don't understand why using "sound input clear and decoupling" ? signal aquiration is working just fine without them, i'm fairly new to labvew so i'm sorry if that's such newbee question to ask

No, you think it is working fine, but that is not necessarily true. Imagine you would use a single While loop for your DAQ (audio input), and also for signal processing/display/file saving:

  • If you try to continuously acquire the signal, the signal processing and specially the File saving part would cause some occasional jitter in your data, some delay!
  • Yes, as you did, you could put some msec Wait in your loop to give time for these processes beside the DAQ, but then as I wrote above, you have a periodic gap in your data!

That is the nice idea behind a Producer/consumer design: you acquire signal in the top "producer" while loop, and Enqueue it into a Queue. Then, this data will reach lossless way the bottom "consumer" loop, where you can do signal processing, displaying and File recording without disturbing the signal acquisition!

 

also can you provide me the code in VI? as there is some symbols i don't understand and don't know where to get it

As I wrote before, that png file contains the VI itself, save it to your PC, and drag&drop into an empty block diagram to get the code: http://www.ni.com/tutorial/9330/en/

 

thanks


 

0 Kudos
Message 6 of 13
(5,070 Views)

OK, All now is good and working thanks .. one last question though

 

audio device is default to 0, i can change it to 1 or 2, but changes will not take effect until i restart the app, and even that failed because the audio device cofigurator loads before app settings .. is there a way to change audio device while the app is running? or delay audio device configurator until app cofig loads?

 

thank you

0 Kudos
Message 7 of 13
(5,053 Views)

What you want is to add states to your application, like "Idle (no measurement running, application waits for user inputs and parameters), initialize (initialize the signal acquisition based on user inputs), run (acquire data), stop (Stop actual measurement, and go back to Idle state) and Exit (stop applicaton).

 

Search for the key words: "LabVIEW state machine". Check the examples and make sure you understand how to program a state machine. Either you can use a very basic state machine with some buttons which are polled, or you could use a more advanced design involving Event Structure.

 

I let you study through these concepts, try to create such State Machine. When you get difficulties with the code, attach your VI here so we can have a look and help...

0 Kudos
Message 8 of 13
(5,051 Views)

Such state machine is very comblicated for me, i tried to read, see examples and google, but never liked it, too much complications, isn't there  a simple way? may be delaying sound input configurator? or even restart it once at startup

0 Kudos
Message 9 of 13
(5,037 Views)

@Mr-FoX! wrote:

Such state machine is very comblicated for me, i tried to read, see examples and google, but never liked it, too much complications, isn't there  a simple way? may be delaying sound input configurator? or even restart it once at startup


A state machine is very simple. Do you wanna learn LabVIEW programming? Then you cannot live without a state machine.

As a kind of UGLY workaround, see the following modification not involving a state machine (which would be the proper way to go):

 

Example_VI_BD_dfd.png

 

0 Kudos
Message 10 of 13
(5,030 Views)