11-29-2016 03:59 PM - edited 11-29-2016 03:59 PM
Hi All,
My system is:
Labview 2014 SP1
NI cRIO-9024 Controller
NI-9264
Scan Mode
I am trying to a get clean 1Hz sine wave on a chart, and get a reasonably clean output from the NI-9264. I want the data to update in realtime (1Hz sine wave should complete one oscillation in one second on the chart, and at the output of hte NI-9264). I know this could be a very simple question, but I can't for the life of me get it to work. Below image shows what I currently have, and the waveform I get on my scope from the NI-9264 is attached along with my complete project file set:
This is inside a loop with wait 100ms (yes that only gives me 10 steps for the sine wave, but when I run it faster I get a horrible output waveform on my scope).
If I run the loop with a very small wait, the sine wave in the chart oscillates much faster than 1Hz. Maybe this has something to do with sample rate vs data rate supplied by simulate signal. In any case, any help with this would be greatly appreciated.
Regards,
Stefan Hall
11-29-2016 05:45 PM
Well, you did everything right except set the simulate signal to simulate acquisition timing. then get rid of the wait.
11-30-2016 09:02 AM
Thank you Jeff!
That certainly fixed one of my two problems. It seems I overlooked this setting.
With regard to the problem of getting a clean output waveform from my NI-9264. Looking at my waveform, the waveform on my scope updates every 100ms (after getting rid of the wait loop), giving me a very 'jumpy' waveform (attached in my previous post). If I reduce the Network Publishing period to 50ms in the cRIO properties, there is no change in waveform output (still 100ms between updates). If I increase the publishing period to 200ms, I see the updates of the sine waveform on my scope every 200ms, as would be expected giving me an even more 'rough' waveform.
I assumed the system would be able to operate at a publishing rate faster than 100ms, but maybe I am missing somthing. It is connected directly to the computer via a network cable in case that is useful. If anyone has experienced a similar issue I would really appreciate any input.
11-30-2016 12:25 PM - edited 11-30-2016 12:26 PM
Stefan,
I think you are experiencing a significant loss of determinism because of the way you are sending data. If i'm interpreting your setup correctly, you push new values one at a time over a shared/network variable. The real-time system on the other end continually sets the 9264 to the shared/network variable's value.
If that's truly the case, you are introducing a significant number of non-deterministic delays that are going to create a large amount of jitter in the generation causing the waveform to come out distorted. Imagine it like this:
1. You generate a new point and begin sending it, can we precisely control how long that takes?
2. The point is sent out through ethernet, we have no way of guaranteeing how long that might take.
3. The point is received by the RIO controller and it is processed. This is another chance for a non-deterministic delay.
4. The point is written to the 9264.
The way to fix that would be to stream data points through ethernet, but have them resnychronized to a fixed update clock on the recieving end. So you have the backplane or controller generating a deterministic 100mS update period for the 9264's updates. You stream data to the controller, and IT decideds when to update to the next point, not the host side computer. Doing this will require a buffer of some size to stop underflows/overflows because of all the non-deterministic delays that are involved.
I hope that helps you understand some of your troubles.
12-09-2016
02:07 PM
- last edited on
01-09-2025
03:08 PM
by
Content Cleaner
Hi Larry,
Is there a document you can refer me to that will give me some idea of how to buffer the analog datapoints to the cRIO? And is this possible while still operating the system in scan mode? I can't seem to find the right document from the searches I've tried so far. The closest thing I have found is the Logging Data to Disk document https://knowledge.ni.com/KnowledgeArticleDetails?id=kA03q000000x0UdCAI&l=en-US that talks about using FIFO to buffer data before logging to disk.
I will give the above a shot when I have time in the next few days. Hopefully someone can chime in and tell me if I'm on the right path here.
Thanks!
Stefan