06-29-2016 03:22 PM
I have been working with this for a couple weeks. I am a student doing research for a professor and I am new to LabVIEW (about a month).
We are trying to calculate impeadance in an object with a pulsar. The pulsar will go through a resistor box before and after the load to calculate v1 and v2. This will help us find the current which will help us find the impedance of the load. In this case, the load will be a potato. The pulsar will send out piulses so we want the program to save the waveform on the trigger. We need two channels v1 and v2. We need to save the results of v1 and v2 as well as a time stamp. Also, if v1, v2, and timestamp were in the same excel file then our life would be easier. One waveform per file.
-TL;DR Two channels need to be saved with a time stamp
The oscilloscope is the LeCroy_64xi WaveRunner.
We are using LabVIEW 2014 SP1.
I am connecting to an oscilloscope via ethernet connection. The connection should not be the problem, but I connected the oscilloscope using NI-MAX. The oscilloscope is a VICP device with a remote system, passport, and alias. The step by step instructions are http://forums.ni.com/ni/attachments/ni/140/43120/1/VICP-NI-MAX.doc.
After connecting the oscilloscope, we picked a example program from the driver and modified that to do what we want. We have come to a couple results. FetchWaveform works to get the waveform but after four or so waveforms it gives both errors. We have tried adding delays, loops, and running the program once at a time. I am willing to retry any of these though. It was working well enough at one point, but I think it was because we had a few labVIEW programs open and it was capturing the waveform about every second. I think it was because the LABVIEW program was slowed down by natural delay. It wasn't exactly what we were looking for, but errors did not happen often. After restarting the computer and program, the waveforms are saved extremely fast and errors occur. It is not consistant and we do not know how to make it save only when the waveform is triggered. Ill upload my code here.
Moving from this, we tried ReadWaveform. For some reason, we cannot get readWaveform to work. It will not display the waveform and it gives the second error or timeout error. We are working to figuring out why it won't really connect with the oscilloscope. I didn't change any of the examples that use readWaveform for this problem.
I'll be here tomorrow, but I am almost done for today. If there is anything I missed, I am sorry and I will upload it tomorrow. I have run out of ideas. Please message me and thank you very much for your effort.
Solved! Go to Solution.
06-30-2016 01:46 PM - edited 06-30-2016 01:47 PM
Hi Tnorm007,
I appreciate the level of detail you included; it sounds like there is a lot going on here. However, there still seems to be inconsistency and ambiguity in the errors that you are receiving. Are you able to get a consistent result by running the code you provided?
For example, if you run the code once, does it work as desired?
If you press run again, does it work as desired? (I'd assume you configure the write to measurement file VI to append the data to the current file?)
Does it fail after a consistent number of iterations, or does it seem to depend on how quickly you run it, back to back? Which of the two errors are being thrown in this case?
Also, just as a general tip, if you want to acquire waveforms continuously, you would want to only loop the read/write portions of the code (and initialize/close the task only once), rather than putting all the code in one big loop or pressing the run button repeatedly
Best,
David Randolph
Applications Engineering
National Instruments
07-05-2016 08:48 AM - edited 07-05-2016 08:54 AM
So I believe I was adding the loop around the close when I tried it and when I put both the close and the initialize outside the loop then it worked. I kept a delay in there so the files wouldn't be written so fast. Thank you!
Currently, the program runs without errors but saves the waveforms about every .5 second which is from the delay. I want the entire waveform to be saved on the trigger using fetchwaveform and maybe a condition. Where should I start?
07-05-2016 09:15 AM
I added a condition before the wite to file command and it looks like it only saves the file on that condition. Everything seems to be working fine now. Thanks again!