LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

RT programming for cRIO/sbRIO *.ctl cluster

I can't find your code to be able to check for sure.  You need to attach it here rather than point to the ftp site.

 

But I'm quite sure by the image you have an array of that control.  You may have opened up the typedef .ctl file and see it is a cluster.  But the image you posted shows an array of those controls.

 

Drop an empty array container on a block diagram.  Now drag that .ctl file into the container.  Then you can right click on the cluster and select view as icon.  It should then look exactly like what was in your image.

0 Kudos
Message 11 of 23
(641 Views)

@Russ_in_Louisville wrote:

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.


If you want us to download the code, either attach it directly, or be more specific about where it's located. The link you provided is to a folder containing multiple zip files and there's no quick way to find the file you mentioned.

0 Kudos
Message 12 of 23
(626 Views)

It turns out it is a cluster plopped into "Array Constant" on the block diagram

0 Kudos
Message 13 of 23
(617 Views)

So back to the original question No. 2

 

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

0 Kudos
Message 14 of 23
(615 Views)

It's a constant, not a control. I'm not sure you can hide the index display on an array constant, and even if you can, why would you want to? It has no effect on the constant's value, and it shows you quickly that it's an array and how many dimensions it has.

0 Kudos
Message 15 of 23
(603 Views)

I am not trying to hide this feature. I am interested to know what it is used for because I have never seen this before. Take the cRIO User Guide example, bioreactor I uploaded. What is this constant's purpose in this code?

0 Kudos
Message 16 of 23
(594 Views)

It's the same as with any other constant - it holds some pre-defined value. In this case the constant value is an array of clusters, rather than the number 5 or the string "Hello" or some other simpler data type. In the code I see that in the Recipe Engine loop, in the Initialize case, there is a Recipe array constant that has 8 elements (right-click, advanced, show last element brings you to element 7, and if you set the index to 8 or greater you'll see the element is dimmed meaning not defined). It sets the shift register to contain a pre-defined array of 8 Recipe elements.

 

Right-click the type definition icon inside the array constant and uncheck "View Cluster as Icon." That might make things clearer. The ability to view a cluster constant as an icon was introduced in a recent version of LabVIEW, so if you were working with an older version you would never have seen this before. It helps clean up the block diagram when you have a large cluster constant and you don't need to see the value inside it (for example, because it's just being used to initialize a wire and the values will get overwritten later).

0 Kudos
Message 17 of 23
(587 Views)

That is an interesting point, that the cluster in the array becomes grey if a number is selected beyond the number of elements in the cluster.

 

What would cause it to be grey if you select a number that's within the number of elements?

0 Kudos
Message 18 of 23
(573 Views)
You'll never get a dimmed element in the middle of a group of undimmed elements. You'll only get dimmed elements at the end of the array. If the array contains a typedef that had unapplied changes or some other problem, then all instances of the typedef may be dimmed.
0 Kudos
Message 19 of 23
(568 Views)

That must be the issue I am getting, an unresolved typedef or change. Is there a way to see exactly where that is occurring? Like a diagnostic tool similar to the context help?

0 Kudos
Message 20 of 23
(545 Views)