05-03-2010 01:08 PM
Is it possible to run ni-scope in simulation mode in Labview (cfr. niScope Initialize with Options.vi, option string="Simulate=1") and obtain as output an arbitrary predefined waveform, different than the usual sine+noise on CH0, square+noise on CH1, or to control anyhow the parameters of the simulated signal?
I thought it was contemplated, but couldn't find any relevant lead - except what looks to me the hard way, build an IVI dll as described in Creating Custom IVI Class Simulation Drivers
Isn't there any easier, LV-programmatic way?
Thanks, Enrico
05-04-2010 11:25 AM - edited 05-04-2010 11:26 AM
I made little progress, and discovered in MAX the option of doing the following:
However, I had no success in achieving a different waveform in either the 5122 soft panel or in my VI reading a simulated waveform. Could someone kindly walk me through, or point me at a relevant resource?
Thanks in advance, Enrico
05-05-2010 04:38 PM
Hello Enrico,
You are on the right track,
- First of all create Driver session in MAX select "nisScope" as an option within 'Simulate With' property in General tab. Also select appropriate hardware.
- save IVI Configuration.
- create a new logical name in MAX as well, and in that for driver session select the name of the Driver Session that you saved in the previous step.
Go over this tutorial in case if you have any questions on the above step.
then in LabVIEW you can look for scope IVI examples from example finder and run them this will prompt you a window where you can change the signal you want to acquire. Unfortunately you cannot generate arbitrary waveform, you will still have to select the typical waveform. Another good resource is IVI Driver Help, in your National Instrument Folder under start menu.
In future, for IVI related questions you can post it on this forum.
Cheers
NI-khil
05-06-2010 07:00 AM
Thanks a lot NI-khil - but unfortunately that doesn't bring me too much forward.
On one side, I can't understand what is the chicken and what the egg in the MAX IVI Drivers tree.The tutorial is of limited help to me (notably - about setting default values for the optional parameters in IVI Drivers/Simulation Driver Session/niScope/Initial Settings). Moreover, my MAX (4.6.2.4915 on XP32) seems to have glitches in the comboboxes behavior, for example in Advanced/Instrument Driver Software/niScope/Configurable Settings - you type into a text box and that stays stuck in input state, and the like. Not the best user experience.
Anyway, most important - I've looked at the Iviscope examples, and they use IVI Oscilloscope VIs, not NI-SCOPE Vis. My program is currently written using the latter, since it is geared for a specific card (PCI-5122 as a matter of fact). Though it may be argued whether reimplementing it using the former may add generality, this is not what I have in mind now. I mentioned in my initial post niScope Initialize with Options.vi, perhaps I should have remarked that. This is why I would say that my question belongs better to this forum, but please correct me if I'm wrong.
What also confuses me is that you can create a NI-DAQmx Simulated Device in MAX under Device and Interfaces/NI-DAQmx Devices.
The practical difference between creating one such devices or not, as I was able to understand it, is that, if you don't have a simulated device, niScope Initialize with Options.vi returns an error (resource not present) unless it is called with option Simulate=1, while if the simulated device is created, you get normal-looking answers from it. But as for receiving from it waveforms different than sinusoid and square wave (and to be able of controlling frequency, etc.), I'm clueless.
A further fact that puzzles me is the following: if I create this NI-DAQmx Simulated Device in MAX, the test panel there shows me clean sinusoids for both channels, whereas the LV readout through niScope Multi Fetch WDT.vi returns me one sine and one square wave plus some amount of noise, of different period than seen in MAX. Shouldn't the two for consistency return the same signals?
Enrico
05-13-2010 03:35 PM
Hi Enrico,
Sorry for all the confusion on this. I think the main point of confusion is distinguishing between simulating the device using the niScope/IVI simulation driver and creating a DAQmx simulated device in MAX. While they both allow you to run NI-SCOPE code with simulated hardware, they are implemented different and have different behavior. The simulation you were initially referring to is the IVI simulation where you set the Initialize with Options string to have Simulate=1 and then you have to use a string such as "Simulate = 1, DriverSetup = Model:5102; BoardType: PXI" (had to add space between colon and 'PXI' to avoid emoticon). This is the simulation you can control and configure under the IVI Drivers section in MAX.
The other way to simulate a digitizer is to create a DAQmx simulated device. Many DAQ devices and modular instruments can be simulated this way that are built upon DAQmx, such as is the case with non-legacy digitizer boards. Notice that in the DAQmx simulated devices list, you cannot select some of the legacy devices such as the 5102 or 5112 since they are built on Traditional-DAQ and not DAQmx.
The most interesting difference is that if you create the DAQmx simulated device in MAX, you can run NI-SCOPE code without changing the Initialize with Options string or setting the code to run in simulation mode. You simply select the device from the drop-down list like any physical hardware. The same behavior is true if you simulate a Multifunction DAQ card and want to run DAQmx code. DAQmx is not an IVI driver so the way they do simulation is completely different than the IVI simulation way. However, you will not be able to change any behavior of the DAQmx simulated device like you can when running the niScope simulation code (remember, niScope is built upon the IVI standard so it has a simulated driver version in order to maintain compatibility with IVI standards).
Hopefully this cleared up some of the confusion. NI-SCOPE, while being IVI compatible and able to run in simulation mode like an IVI driver, is also built upon DAQmx and so DAQmx simulated devices may be used for non-legacy boards. However, using a DAQmx simulated device will not give you as much flexibility in changing the properties of the simulation, and will not have the same behavior as an IVI simulation.
Hope this helps!
05-14-2010 03:04 AM
Thanks Daniel for the exhaustive explanation. What you wrote matches also my observations and attempts.
Summing up, I conclude that it is NOT possible to use the niScope VIs (not IVI) and achieve control of the simulated waveform parameters. Am I wrong? That is, is anyone able to suggest a snippet on the lines of for instance "niScope EX Configured Acquisition.vi" in the LV9 examples, acquiring, say, a simulated sawtooth of predefined amplitude from CH0?
To move on in my application, I resorted to a quick & dirty replacement of "niScope MultiFetch WDT.vi" with a drop-in equivalent providing the simulated waveforms I needed. The solution is suboptimal, as this simulation is not affected by all other channel settings (e.g. vertical scale, timebase, trigger) as it would be convenient for full testing, but at least allows me to go on with development.
Enrico
05-14-2010 11:15 AM
Hi Enrico,
You are correct that you are unable to change the simulated waveforms when running an niScope VI. Your workaround is really the only suggestion I could make, but you are also correct that it is suboptimal since you are no longer even really testing the niScope part of your code with your processing code (or whatever it is you need to feed the signal to). At least if you have the niScope section in the code, you can make sure that certain properties and settings will work and that your niScope code should be ready to run with physical hardware. Best of luck with your application!
Regards,
08-09-2012 08:02 AM
Hiiiiiii...
i have build few labview vi's and those contains simulated signals..so i just want to know is there any way that i can view control these simulated signals from my ni elvis hardware scope ????
Thanks in advance.....
sunny
08-10-2012 12:35 PM
Hi sunny87,
If you are trying to control the frequency and amplitude of a waveform with your Elvis 2 board, you can put the board into manual mode to use the knobs on the board to control the waveform. You can use a NI ELVISmx Function Generator VI and set the manual input to true and this will allow you to send out a waveform from the selected route on the board and control the frequency and amplitude with the knobs on the board.
Regards,