Showing results for 
Search instead for 
Did you mean: 

Converting regular LV code to RT

I have a large machine control code developed in LV2009 and with PCI 6229 + PCI 6518. The main sequence is a Queued State Machine and has about 78 different states. Not exactly simple as the code has to control about 12 solenoids, acquire 10 AI channels , write  data to an Excel file, update graph on the FP, and  take in readings from a particle counter through RS232 sent in by a DDE server. The saving grace is that the QSM runs inside a Hardware Triggered Timed Loop at 10ms intervals.


10ms is not blazing fast, but still the time stamps in Excel are not exactly spaced at 10ms. In short the Timed loop is not deterministic.


There is a repeat order for  the machine and I was wondering if I can go the cRIO way in Scan Mode using  RT Module. Of course cost will increase but apart from that I would like to know how difficult it is to port the regular code to RT code ? I am sure there is no convertor that takes in regular code and outputs RT code ( though I wish for one !!) Would it simply mean redoing the whole code again ?? Any serious traps to watch out ?? 

LabVIEW to Automate Hydraulic Test rigs.
0 Kudos
Message 1 of 3



Without actually seeing the code (and with 78 states, I'm not sure I want to see it), it's hard to say exactly how hard this task might be.  However, most of what you describe should be able to run on a cRIO without any modification at all (acquire data, run a state machine, write files, etc).  What will have to change is and interaction with a user (i.e. updating the FP).  You will probably have to split your existing code into two different VIs: one for RT and one for a user interface.


If I were you, I'd take the opportunity to learn RT & FPGA, they are my favorite module to use.



0 Kudos
Message 2 of 3

1000 hz is about the fastest you want to go in scan mode. So it sounds like you can do what you want to do. However, I would talk to NI about this because often you can accomplish what you want with other modules.


Anyways, a piece of advice -- spec out the bare minimum cRIO that can handle what you want but then actually purchase one a couple steps up in terms of memory and processing power. This is just IMO of course but what I have learned is not only does it give you room for scalability of the code and processing for future additions, but often the time I spend trying to squeeze out every last bit of memory or streamlining the code to make it work efficiently on a lower end RIO would have, itself, paid for the price difference!

0 Kudos
Message 3 of 3