LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

file dialog

Solved!
Go to solution
Attached is a program I have been writing to generate and acquire voltage signals. However, there are a few problems with it, which I need help solving. Currently, I can generate my signal, but when writing the acquired signal, I get a constant voltage reading (see attached). I am attributing this to the fact that I have a misplaced file dialog prompt. Using an oscilloscope, I can verify that I am generating the appropriate signal, but that it completes generation even before I am able to specify where to save the file (file dialog prompt) and am therefore "missing" the signal altogether (hence the constant voltage value I am seeing in column 2 of the output file. What I need to do now is to alter the program code in a way that the program knows where to write to a pre-specified file, even before I generate the signal. Does anybody know of a way to do this?
Download All
0 Kudos
Message 1 of 7
(3,609 Views)

Two choices:

1.  Don't use the File Dialog Express VI and use a file path control or constant instead that you set the filename before you run your VI.

2.  Set an order of execution so that the File Dialog runs first.  Take an error wire out of the File Dialog then split and feed that into your DAQmx functions.  The DAQ functions then can't start until the file dialog is finished.

 

Be sure to use Block Diagram cleanup, or at least manually clean up your code.  You have a bunch of backwards running and overlapping wires making your VI harder to read.

0 Kudos
Message 2 of 7
(3,596 Views)

I would also recommend using the Open/Create/Replace File function to open your file before your loop.  You can use the Write To Text File inside the loop and the use the Close File after the loop.  This way you will be sure you keep appending data and it is easier on the file system.  You also won't need the Get File Position and Get File Positiion functions.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 3 of 7
(3,590 Views)

Thanks for the advice. I cleaned up my diagram and am now being prompted to pick a file location before the signal is generated. However, I am still only seeing a constant voltage reading in my output file and I think it is because I was not using a trigger in my program. I have tried to add one in here, but I can't say that it is working correctly. If I am wanting to use an analog trigger, where I do I wire the return wire to if my live wire is in PFI 0/AI START TRIG (pin #11 on my E-Series SCB-68)?

0 Kudos
Message 4 of 7
(3,563 Views)

I can't help you there.  I've never done any DAQ with triggering.

0 Kudos
Message 5 of 7
(3,548 Views)
Solution
Accepted by UARK
Why do you think you need triggering? It's obviously not required for an acquisition. Sounds to me that you have a wiring problem. Haven't you tested the acquisition with the test panels in MAX?
0 Kudos
Message 6 of 7
(3,542 Views)

I agree. It's not required for acquisition. I think a better way of tackling the program involves some type of synchronized timing. So, I want to generate a signal (say, for example, a square wave of some frequency and voltage) and want to record both the generated signal and the acquired signal, so that I may calculate what the time difference between the first generated signal peak and the first acquired signal peak is. Any feedback regarding the attached code and dummy test? (I see only noise recorded in column 5 - my acquired signal). Thanks!

Download All
0 Kudos
Message 7 of 7
(3,498 Views)