LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Real Time Project Common Code Organization

Solved!
Go to solution

Hi Folks,

 

I am working on a RT project using multiple cRIO chassis.

I have common RT code that I want to use with the different cRIOs.

 

What is a good way to organize the common code in the project?

 

For example. I have folder called "RT Common".

It seems that I have to place folder this folder under a particular cRIO in order for the vis to be recognized as RT.

 

Are there any other options?

 

Thanks,

steve

----------------------------------------------------------------------------------------------------------------
Founding (and only) member of AUITA - the Anti UI Thread Association.
----------------------------------------------------------------------------------------------------------------
0 Kudos
Message 1 of 8
(3,215 Views)
Solution
Accepted by topic author stevem181

No.

They will all point to the same VI and location but since each CRIO has it's own compiler you need to place the code under each cRIO.

But if you make a change to the VI under any of the cRIO it will update for the rest also.

 

 

Message 2 of 8
(3,208 Views)

@df86 wrote:

No.

They will all point to the same VI and location but since each CRIO has it's own compiler you need to place the code under each cRIO.

But if you make a change to the VI under any of the cRIO it will update for the rest also.

 

 


This isn't necessarily true. It should automatically get put into the dependencies on a per target basis, if it is referenced in a VI that is on a specific target. For organizational purposes, however, you may find it best to have the folder itself under every target.

0 Kudos
Message 3 of 8
(3,202 Views)

You can place the same code under multiple targets, which is how I would handle this.

 

However, if your common code uses OOP, be aware that loading a class in more than one instance causes the class to be locked, meaning you can't edit it.

0 Kudos
Message 4 of 8
(3,201 Views)

nathand wrote:

However, if your common code uses OOP, be aware that loading a class in more than one instance causes the class to be locked, meaning you can't edit it.


*headbang* *headbang* *headbang* *headbang* *headbang* *headbang* *headbang* *headbang* *headbang* *headbang*

 *headbang* *headbang* *headbang* *headbang* *headbang* *headbang* *headbang* *headbang* *headbang* *headbang*

 *headbang* *headbang* *headbang* *headbang* *headbang* *headbang* *headbang* *headbang* *headbang* *headbang* 

*headbang* *headbang* *headbang* *headbang* *headbang* *headbang* *headbang* 

0 Kudos
Message 5 of 8
(3,197 Views)

A bit off-topic, but Greg, that's exactly how I'm feeling at the moment. I'm working on a project that will run on a steadily-growing number of sbRIOs spread around our labs, and instead of adding new targets to my project, I'm instead stuck with a single target for which I constantly change the IP address, with the accompanying risk that I'll accidentally load a new version onto the wrong target.

 

One of the reasons I went with classes in the first place was so I could easily replace the FPGA with a simulation (all communication to the FPGA is routed through a class), then run it on my desktop - but guess what, I can't do it without breaking editing of the parent class!

0 Kudos
Message 6 of 8
(3,183 Views)

Yes, hopefully not derailing too much, but my issue normally comes about because I have a reusable network messenger, and whenever I process incoming messages I need to unflatten them. That creates a static dependency in the receiver. There is obviously already a static dependency in the sender, so there are now dependencies both on the "my computer" target and the "remote" target. This keeps me from having the ability to edit the contents of a message if need-be. This also happens when I have a "config" class on the host, and want to use that same class on the RT to load and store the config content that was configured on the host. You try to add something to the config and you can't. So, I feel your pain.

0 Kudos
Message 7 of 8
(3,178 Views)

Thanks Dan and others.

 

I didn't realize I could just put the folder under each of the cRIOs Smiley Embarassed.

 

That's exactly what I needed.

 

steve

----------------------------------------------------------------------------------------------------------------
Founding (and only) member of AUITA - the Anti UI Thread Association.
----------------------------------------------------------------------------------------------------------------
0 Kudos
Message 8 of 8
(3,135 Views)