LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Newbie Questions on Labview

This is the way.

Message 21 of 29
(296 Views)

@jcarmody wrote:

jcarmody_0-1771349769695.png

 


Like you, I am a big fan of vertical wires (e.g. the 2D array dropping in from the top) and I really hate that auto-routing fights me on that more and more (... and more and more) with each new version. 😄

0 Kudos
Message 22 of 29
(293 Views)

@altenbach wrote:

@jcarmody wrote:

jcarmody_0-1771349769695.png

 


Like you, I am a big fan of vertical wires (e.g. the 2D array dropping in from the top) and I really hate that auto-routing fights me on that more and more (... and more and more) with each new version. 😄


I could never stand the auto-routing.  I always have it turned off.

0 Kudos
Message 23 of 29
(281 Views)

@jcarmody wrote:

@altenbach wrote:

 

[...] a pedantic programmer who spends 95% of time perfectly aligning and spacing things. [...]

 


Each object needs to be eight pixels apart.  If there's a wire between them, the wire should just disappear when moved eight pixels.  Containing diagrams must border its contained objects by eight pixels all around.  It's not pedantry, it's what separates us from animals.

 

jcarmody_0-1771349769695.png

 


Well, I like diagrams to be neat and tidy, but I don't have exact-pixel-spacing OCD.

0 Kudos
Message 24 of 29
(279 Views)

Did you get your code working?

If you still need help, I would recommend running pre-built tools (all free (or included with LabVIEW)).
Dynamic Signal Generator (DSG) will output sine waves on your outputs. Free Download
Use FlexLogger Lite to record your inputs and the accompanying DIAdem Lite to view the logs. LabVIEW's TDMS File Viewer can also be used to view data stored in a TDMS file.

 

If you need to write the data to a custom text format, you can write a much simpler VI to read from TDMS and write to your custom format. You can do that without gating your data collection.

Doug
Enthusiast for LabVIEW, DAQmx, and Sound and Vibration
0 Kudos
Message 25 of 29
(167 Views)

dsb@NI wrote:

Did you get your code working?

If you still need help, I would recommend running pre-built tools (all free (or included with LabVIEW)).
Dynamic Signal Generator (DSG) will output sine waves on your outputs. Free Download
Use FlexLogger Lite to record your inputs and the accompanying DIAdem Lite to view the logs. LabVIEW's TDMS File Viewer can also be used to view data stored in a TDMS file.

 

If you need to write the data to a custom text format, you can write a much simpler VI to read from TDMS and write to your custom format. You can do that without gating your data collection.


Hi Doug,

 

Thank you for checking in on me, as this has been a rather frustrating journey, and it's nice to have help! I have been able to create a code with at least mostly working portions (see attached VI), but I'm having trouble specifically with the function generator outputs, as they are either not registering or are not sine waves and not outputting the requested frequency/amplitude. I've attached a snip of my output voltage (AOs.png) which shows the outputs recorded by my .CSV write for the two AO ports (generated in MatLab). ElecIn is AO1, MechIn is AO0, for reference.

 

In addition, it looks like my DAQ is not collecting data at the specified rate (200kS/s).

 

I realize I'm trying to sample at high rates, and this may not work well with DAQ Assistant, so this may be one of the major issues. However, I've attempted to apply DAQmx in the past and have been unable to achieve useful results either.

 

Any suggestions on how to proceed?

 

Thanks,

 

Joseph

Download All
0 Kudos
Message 26 of 29
(144 Views)

Change Acquisition Mode in Both DAQ Assistant Express VIs to Continuous Samples!
Continuous Samples.png

Make sure that the samples to generate is equal in both simulate sine Express VIs and the AI DAQ Assistant. I recommend 20000 samples (to achieve an overall loop rate of 0.1 s).

 

Simplify your logging. I stripped out logging to csv files and enabled logging in the AI DAQ Assistant block:
StimResp.png

 

Logging.png

 

The modified code runs, and the logged data looks like sine waves:
TDMSFileViewer_All.png

 

Zoom for High-Frequency.png

 

 
 
Doug
Enthusiast for LabVIEW, DAQmx, and Sound and Vibration
Message 27 of 29
(104 Views)

Oh, and make sure you add a timestamp to the file name or find some other way to uniquify the file name so you never (unintentionally) overwrite previously recorded data files!

Doug
Enthusiast for LabVIEW, DAQmx, and Sound and Vibration
0 Kudos
Message 28 of 29
(96 Views)

dsb@NI wrote:

Oh, and make sure you add a timestamp to the file name or find some other way to uniquify the file name so you never (unintentionally) overwrite previously recorded data files!


Hi Doug,

 

Thank you for the simplified program and explanation. I am still having some issues with implementing LabView to get the functionality I need for my testing. When I attempt to implement this code, however, I get an error -200279, which says the software's reading too slowly and the buffer overflows. I've heard the way to remedy this is to use DAQmx and simpler functions rather than DAQAssistant and ExpressVIs (though AI may be off-base on that suggestion). I've attached the modified code you provided which is throwing this error (...RespDoug.VI). I noticed when taking a closer look at outputs that it seems like there's still a phase mismatch, especially in the 10 Hz region. It's important I'm able to phase match as otherwise I worry about overaccelerating my equipment with a mismatch voltage jump.

 

I've also attempted to create a code which takes care of both the DAQmx substitution and the pre-buffer issue while generating phase-matched sine waves within the loop (...SinBuf.VI), but that's also throwing a similar error (-200279, on the AI error branch). I've tried increasing the buffer size, but to no avail.

 

Finally, I'd prefer to use either .CSV or .txt files for output, as these are easier to process down the line. Working with long waveforms in Excel is... not great, due to character line limits.

 

I know this is... a lot, and I totally understand if you don't have time to take a look. If you can look at my code and let me know any suggestions, though, I would certainly be grateful!

 

Thanks again,

Joseph

 

PS. SineWave and tarray are custom VIs used in ...SinBuf.

0 Kudos
Message 29 of 29
(69 Views)