LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

RT programming for cRIO/sbRIO *.ctl cluster

See the attached!

 

For a *.ctl (control) that's a cluster:

 

1. How is Index Display added? For the attached example, I know it is displayed by Right Click -->Visible Items. But when created from scratch, this option is unavailable.

2. Why would one use and Index Display on such a control?

3. There's a number in the upper RH side of the icon of the *.ctl. What does this indicate and how does it change?

Download All
0 Kudos
Message 1 of 23
(3,654 Views)
  • Clusters don't have indices, only arrays.
  • The number in the icon is added whenever you create a new control. Open it in the control editor and change the icon to anything you want.

It is typically preferable if you could attach an actual VI (or control) instead of pdf documents.

0 Kudos
Message 2 of 23
(3,645 Views)

You have an array of clusters.  The cluster (I'm assuming that's what you have since that is what you said) is saved in the .ctl file as a typedef.  There was an array container dropped into the block diagram, and the control was dropped into that and set to show as an icon.

0 Kudos
Message 3 of 23
(3,638 Views)

I am not seeing this comes from an array. It's a cluster with Index Display. The code is from the 2012 cRIO Developer's Guide you can download here

 

ftp://ftp.ni.com/evaluation/crio/compactrio_developers_guide 

0 Kudos
Message 4 of 23
(3,591 Views)

As already stated, it's an array of clusters. Not sure why you don't believe this, but since you don't, look at the type of the wire. Wire that constant to the edge of a for loop. Turn on context help (control-h) and put the cursor over the wire. You'll see that the data type on the wire is an array of clusters.

0 Kudos
Message 5 of 23
(3,569 Views)

Just be careful - remember that when programming on RT there is no front panel in an RT app (except when you're remotely connected).  In RT you cannot reference front panel objects via property nodes or the like, but you can reference them like variables so long as you're just using it as data storage like a global variable but in a more "local" scope.  When using front panel objects, be very careful and be sure to keep to RT programming best practices.  

 

-Danny

0 Kudos
Message 6 of 23
(3,545 Views)

Nope, it's not an array. Download the code and have a look for yourself.

0 Kudos
Message 7 of 23
(3,508 Views)

What you have is an array, of which each element is a type defined cluster. The array contains the cluster. When you right click the array and open the type definition, it opens the element definition, which is a cluster. The item on the block diagram is an array that contains that cluster type as the array element.

 

To generate the same thing yourself, drop an array constant on the block diagram. Then drop the cluster type definition onto the block diagram as a constant. Drag the cluster into the array and you'll see the result matches what you already have.

0 Kudos
Message 8 of 23
(3,502 Views)

I've already tried that experiment. It's a cluster. Open Recipe Phase.ctl from the project tree under the RT target under the TypeDefs folder.

0 Kudos
Message 9 of 23
(3,498 Views)
Well, in that case the other possibility is that the array is party of the type definition. Sorry, posting from mobile, can't download the code right now, but I will later.
0 Kudos
Message 10 of 23
(3,492 Views)