From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Problem with dynamic events registration ?

Solved!
Go to solution

How to dynamically register large amount of FP control simple way. See example. This example doesn't work and I don't know why...


*** LV2018 ***
0 Kudos
Message 1 of 7
(2,157 Views)

Hi petmowak,

 

I use this to register a large amount of FP controls to a ValueChange event:

check.png

(Still in German LV2011, so no concatenating output tunnels at loop borders.)

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 2 of 7
(2,137 Views)

Don't use a type cast to cast classes. It will work, but isn't very nice.

 

Use "To More Specific Class" (or "To More General Class"). It (TMSC, not TMGC) has error handling (during editing when possible) and it's actually made for doing this...

Message 3 of 7
(2,116 Views)

I don't know why this doesn't work. Clicking on 3 clusters or their parts doesn't show label string.  Any hint, help ???



*** LV2018 ***
0 Kudos
Message 4 of 7
(2,094 Views)

sorry, example missing....


*** LV2018 ***
0 Kudos
Message 5 of 7
(2,092 Views)
Solution
Accepted by topic author petrnowak

Put a probe on the array of controls you're registering. HINT: it's empty...

 

Replacing elements in an empty array doesn't work well. Use concatenate array, or even better, use auto indexing (in the for loop)...

Register Cluster.png

Message 6 of 7
(2,064 Views)

Thanks wiebe@CARYA !!! 
"Replacing elements in an empty array doesn't work well." I always learn something new.... 😞


*** LV2018 ***
0 Kudos
Message 7 of 7
(2,043 Views)