From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Help Tweaking Model for Simulated Stimulation Output

Solved!
Go to solution

Hello,

 

I would first like to say that I am new to LabVIEW, and so my VIs might not be the "best way" to do things. I am attempting to send a simulated signal to a device through the use of a PXIe-6363. This simulated signal should be sent continuously, but the two waveforms are supposed to appear only once every second. The simulated signal should be able to have a varying latency between the gaussian monopulse and the sine pulse following it, which I believe is working correctly. 

 

Furthermore, I am attempting to trigger this simulated signal using the input from a PXI-5122. The PXI-5122 reads in an analog signal similar to the gaussian monopulse that is part of the waveform in the VI. As soon as the analog signal is read in (which also occurs once every second, although i can very my device to have it done twice every second) the simulated signal is supposed to being being sent back into the input of the device. I do not believe that I am doing this triggering correctly right now. 

 

The issues: Currently, my device is reading the simulated signal in but there are a lot of missed readings. I believe this is because the signal is not being sent close enough to "real-time" for the device to be able to get a consistent reading. Furthermore, I do not believe that the "triggering" I am attempting is doing anything meaningful. I am using producer-consumer to try and accomplish this task, but as stated above I am new to LabVIEW as well as the producer-consumer architecture. Any help is greatly appreciated. Attached are the VI (for LabVIEW 2016) and a VISnippet just in case.

Download All
0 Kudos
Message 1 of 5
(2,509 Views)
Solution
Accepted by topic author mariux

A few comments:

  1. The title of your post probably scared some people away from reading it because it sounds like you are having a problem with modelling, when actually it's a pretty straight-forward DAQ problem.
  2. The DAQ problem: I has come time to take off the training wheels - which is to say, loose the express VIs and the associated dynamic wires. This is likely why your code can't keep up with the VERY leisurely 1 Hz processing rate. The express VI is likely reinitializing itself with each iteration. 
  3. ...Something I noticed your DAQ code in the lower loop is also doing. What you want is to initialize once outside the loops, do all the reading and writing needed inside the loops and then deinitialize them when the loops stop.
  4. (This is a minor point) You are using the wrong delay function. Don't use the metronome unless you are wanting and intending to synchronize things. Use the one that looks like a stop watch.

Mike...


Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
Message 2 of 5
(2,441 Views)

Mike,

 

Thanks for your reply, and sorry for my delayed response. Through your suggestions and a few modifications of my own, I've changed my VI a little and it works much better, being able to send the generated waveform using the APFI0 trigger to sync with my external device. 

 

I have one last issue I'm running into, which is having my signal be sent only when my trigger level is met. The trigger source is a pulse that can happen once, twice, or four times every second. I want my function generator to be able to send the generated signal once, twice, or four times as needed by the trigger source. Right now, it just sees the trigger signal and begins writing the generated signal once every second, independent of whether the trigger source then begins sending the pulse twice every second.. Any suggestions?

 

0 Kudos
Message 3 of 5
(2,421 Views)
Message 4 of 5
(2,409 Views)

Andres, 

 

Thanks for the links. While they didn't exactly have what I need, they did lead me to a different way of phrasing my question and finding out about the "Start.Retriggerable" property which was exactly what I needed. My VI works perfectly now.

 

 

0 Kudos
Message 5 of 5
(2,394 Views)