LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Point by Point Sine Generation in RT

Hello all,

I'm doing a little proof of concept with a cRIO-9074 chassis I just got. I am using a NI 9263 module for analog outpt. Right now I'm just trying to find the most efficient way to generate a low frequency sine wave while using the NI scan interface. Here a screen shot of what I have come up with so far. This works very well right now, but having little experience with RT (and none with the new scan interface) I'm hoping for some critique of what I've done. Does anyone know of a cleaner or more efficient way to do this? If needed I could also clean up the project and send that along if anyone would like to see it.

 

Thanks in advance,

 

Andrew 

0 Kudos
Message 1 of 5
(3,579 Views)

Hi Andrew,

 

I took a look at your code. It looks fine to me. Just one thing. Global variables can overwrite the data before you read the data. This might become a problem if you start to add more loops to the program.

 

What are you tring to make deterministic? 

Warm regards,
Karunya R
National Instruments
Applications Engineer
0 Kudos
Message 2 of 5
(3,553 Views)

Hi Karunya,

Thanks for the feedback. The globals will probably go before the final version of this program. I was also playing around with doing control from a touch panel so they were a handy way to do that.

 

As far as determinism, the sine wave generated will eventually be controlling the stroke of an oscillation table, so I want to guarantee that the signal is stable and consistent. Do you think that it's overkill to use a timed structure here? 

Message Edited by a_carollo on 10-13-2008 03:19 PM
0 Kudos
Message 3 of 5
(3,546 Views)

Hi Andrew,

 

Using the timed loop is not an overkill.  In an RT program, you need timed structures to set the priorities, the timing source, period etc. You can use can build a Real-time project using the wizard by going to File-> New-> Project->Project Wizard->Real-Time Project. When you step through the wizard, you can build a single loop continuous communication architecture (which sounds like what you need).

 

Are you going to be using a stand alone system? Determinism cannot be guaranteed otherwise. 

Warm regards,
Karunya R
National Instruments
Applications Engineer
Message 4 of 5
(3,529 Views)
Yes, the system will be stand alone. Right now I am planning on all important functions being performed by the cRIO, with monitoring and human interface done on an NI touch panel. Thanks again for your feedback, it's been very helpful.
0 Kudos
Message 5 of 5
(3,524 Views)