04-13-2015 07:10 PM
Good evening,
I'm trying to integrate the functionality of the NI ELVISmx Oscilloscope into a VI, and am hitting a few bumps. I have launched the oscilloscope from the Instrument Launcher, and successfully captured the signal of interest coming into AI0, triggering on edge.
I wanted to bring this into a different VI I'm writing, and have the following difficulties/questions:
1) When I bring in the subVI (Measurement I/O -> NI ELVISmx -> Oscilloscope) onto the Block Diagram, I can no longer select the trigger options in putting on AI1 (the tab is greyed out). This means I have to use immediate triggering which makes my waveform too jumpy for visualization. If I try to manually adjust the trigger properties, I get an error. I only have the Oscilloscope block connected to a graph output, so it's as simple as possible (though perhaps now too simple?). How can I reenable the triggering?
2) I'd like to display signals from AI0 and AI1 on a single graph in my VI. What's the best way to accomplish this? I was considering bound tables and shift registers, but I'm concerned over complexities with all the other stuff the VI I want put this in is doing.
3) As long as I'm asking questions - Is there instead a way to simply place the whole of the IL version into my VI? Most of the IL controls are handy for what I'm wanting to do (and was trying to figure out how to work with the subVI version. Running it separately isn't an option because I also want to be able to run analysis on the outputs.
Thanks, and I'll keep searching the manuals in the meantime!
04-14-2015 11:40 PM
1. Could you double-check that you have Channel 1 enabled on the configuration tab? It was initially disabled for me and that prevented me from selecting Ch 1 as my trigger.
2. You're way over-complicating this. You just need to merge the two channels and display them on a waveform graph. See the attached snippet.
3. IL? Assuming you're just talking about the soft front panel for the oscope, all of the options are exposed through inputs into that express VI. Just drag down on the express vi to expose the inputs and create controls for the things you would like to be able to change.
04-15-2015 04:06 PM
1. I've confirmed my signal is going into Channel 0, and "Channel 0 Enabled" is checked. Trigger settings remain greyed out. I've dug deeper in the manual, and I think that the trigger functionality is universally disabled when you use the Oscilloscope as an ExpressVI as opposed to a standalone Instrument Launcher (IL) version. I hope I'm reading that wrong.
2. Really liking the snippet. Thanks!
3. When I pull down on the ExpressVI to expose the inputs, I get CH0 Enable, CH1 Enable, Device Name, error in, Horzontal, myDAQ Channel 0 myDAQ Channel 1 Stop, Trigger, Channel 0 Out, Channel 1 Out, error out. These seem promising at the start Diving through the context help, though, I eventually get to the appropriate help screen; which tells me that most of these cannot be changed on the block diagram.
So, where I am seems to be:
Thanks again!
04-16-2015 11:23 AM
I don't think you've read that wrong. The reality is that express VIs are great when they have the options you want, but they're impossible to modify. Both the soft panel and the express VI are built on DAQmx, I would recommend that you look in to building the functionality you want using DAQmx. You should check out the examples, and you'll likely find one that does something very close to what you're trying to do.
04-17-2015 07:56 AM - edited 04-17-2015 07:57 AM
The NI myDAQ does not support analog triggering like the ELVIS II or ELVIS II+. This is why the trigger settings are grayed out when you use the myDAQ in the Oscilloscope express VI. The triggering in the soft front panel is achieved by acquiring a larger buffer and looking for a trigger in software then updating the graph.
For your question about using the soft front panel in another VI, the source for soft front panel is installed by default when you install ELVISmx. You can use that VI just like any other subVI and you can modify it if needed. The source is installed to %Public%\Documents\National Instruments\NI ELVISmx Source Code. The VI you're looking for is Scope.llb/Scope.vi. If you drop it on a block diagram, when your calling VI gets to that call, the front panel will be opened and you can change your settings as desired.
Edit: Also, you can (kind of) modify the express VI. There is an option if you right-click on it to "Convert to SubVI." This will show you the generated code behind the express block. However, once you have done this, you will no longer be able to open the configuration dialog and make changes. It will be just like any other subVI at that point.
04-17-2015 05:32 PM
Donovan,
OK, I've semi-incorporated the soft panel, and it works within the confines of the larger VI, which is almost exactly what I'm wanting. However, it pops up as a new window.
Is there a way to lock the panel into the front panel of my VI (specifically, I'd like it in a tab for easy reference).
Thanks!
04-17-2015 08:04 PM
Been trying for a while to work out an approach where the floating oscope isn't a problem, and am running into a difficulty.
I'll need to analyze (in real time) the signal coming off the oscope, but in my VI. I tried making the relevant outputs (CH0 Vpp and freq, and CH1 Vpp and freq) as vi outputs, and then creating indicators in my VI to display those values but it looks like it only updates on the start call. I also tried simply sending the oscope display graph signal, with similar issues. Putting the subVI and indicators in a separate while loop also isn't working.
Clearly, I'm missing a piece here. How can I get a continually updating output from the subVI into mine?
Thanks!
04-22-2015 02:38 PM
Having the soft front panel return data to a calling VI will be somewhat difficult. It was designed for an interactive use case where the data contained to the panel and only accessible by logging from the soft front panel. To simply drop it in a calling VI and have data returned every iteration would require a massive rework of how the VI is designed (it would be easier to re-implement everything).
There are ways you could do it using the existing VI through VI Server, but that would require asynchronously calling the VI and then hooking into the running scope by accessing controls through VI Server, which again seems like more work than it is worth.
The simplest solution (to get triggering with myDAQ in a running VI) would be to use the Scope Express VI and implement the triggering as is done in the soft front panel. The source for how the triggering is accomplished is available in the same location the Scope.llb but is at subVIs.llb/ELVISmx_submyDAQScopeAcquire.vi. It basically acquires twice the number of samples and then searches for the trigger condition within the acquired time period and returns the data from the trigger with the appropriate horizontal position on the graph. You would simply configure the express VI with the acquisition settings you need and then take the output and run it through the code that detects the trigger.
Another example of implementing a software analog trigger is available here.