Real-Time Measurement and Control

cancel
Showing results for 
Search instead for 
Did you mean: 

Share Target RTOS code between multiple cRIOs

I have three compactRIO units, all of which I want to run the exact same RTOS (Target) code.  The only difference between the code is that the shared variables have to point to the variables in the unit's library.  As a result, I can't execute the same vi on each unit and have to make two separate copies that reference the correct shared variables.  This is a pain to deal with as any time I make changes to the code, I must copy over to the other two units and go through and update references to all the shared variables.
 
Is there a better solution to this?  I have tried writing a script to replace the string \\cRIOUnit1\\Library with \\cRIOUnit2\\Library in the target VI but that didn't work as there must be other changes to the binary VI that happen when references to shared variables are updated.
 
Any thoughts?
 
0 Kudos
Message 1 of 6
(4,709 Views)
crock,

Please review the Using the Variable References section (defining Absolute and Target Relative) LabVIEW Shared Variable Developer Zone document. I believe this is the behaviour you are looking for.

Cheers.

| Michael K | Project Manager | LabVIEW R&D | National Instruments |

0 Kudos
Message 2 of 6
(4,705 Views)
Target-relative shared variable....that is exactly what I need!  Unfortunately
 
"Right-click a node and select Change to Target Relative "
 
Doesn't work for me.  Maybe this is an 8.5 feature?  I have 8.2.1....
 
 
Thanks!
0 Kudos
Message 3 of 6
(4,692 Views)

Hi Crock,

I've just checked in my LabVIEW 8.2 versus my LabVIEW 8.5. This is a feature added in 8.5.

Regards,

Hillary E
National Instruments
0 Kudos
Message 4 of 6
(4,674 Views)

Smiley Sad

That's too bad.  I've got about 20 nodes and would have to change each one for both slaves.  Labview takes about 20 - 30 secs to update the changes so it would take 20 minutes to make these changes each time I change the code and copy it over.  Is there any way to manually edit the vi and update the target?  Maybe someone at NI would be willing to write an app to update the target references in the vi?  I thought about writing an application to send keypresses to the labview windows and update them automatically but not all of it can be done using keypress (you HAVE to double click the node to update it). Any suggestions?  I'm trying to do as much testing as possible with one unit and only copy the changes over once its working but there's always something I have to go back and change. 

0 Kudos
Message 5 of 6
(4,652 Views)
The closest thing I can find is this Dynamic Code Updates. I don't think it'll do what you want. Sorry. Smiley Sad
Regards,

Hillary E
National Instruments
0 Kudos
Message 6 of 6
(4,636 Views)