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: 

can I create a generic Point to Row Column function?

Solved!
Go to solution

I have a VI with multiple MultiColumn Listboxes in it.  One way I've seen to make the entries writeable is as follows:

mcl_write.png

 

This works fine.  The only issue is that to get the 'Point to Row Column' (PtRC) method requires (as I understand it) right-clicking on the MCL and selecting that method.

 

I have multiple MCLs, and I wanted to create an event structure that was generic and could process any of them the same way.  But the problem with that is that I don't know a way to get access to the PtRC method for each one.  The only way I know to do it would be to use VI Scripting to create the reference on the fly (not sure if that would even work), but even if that works for me, I don't think it will work with the free LV RunTime Engine (my experience is that you can't use the RTE to execute any VIs that utilize VI Scripting).

 

So my question is, is there a way to get a reference to the PtRC method - generically - without using VI Scripting, and/or is there a different way to do what I'm trying to do here (i.e. make the MCL writeable by the user and have it retain the values the user writes to it during VI execution).

 

thanks

0 Kudos
Message 1 of 16
(4,675 Views)

by the way, I know that right now my code just writes the updated value to an indicator, but in the final version I would replace the indicator with another reference to MCL.ItemNames

0 Kudos
Message 2 of 16
(4,673 Views)
Solution
Accepted by topic author bmishoe

Hello bmishoe,

 

You're almost there- just use an explicit rather than implicit method and use that CtrlRef node on the event structure to give you a reference to the control associated with the event.  At that point all you need to do is add the MCLBs to the event structure.

 

Regards,

Tom L.
Message 3 of 16
(4,668 Views)

Like this....

Example_VI_BD.png

aputman
------------------
Heads up! NI has moved LabVIEW to a mandatory SaaS subscription policy, along with a big price increase. Make your voice heard.
Message 4 of 16
(4,633 Views)

Not generic enough for you (not sure why it wouldn't be) here we can have code that finds the Multicolumn Listboxes and registers for all of them.

Dynamic Row Column MCLB.png

 

Edit: As I feared the snippet isn't exactly what I made.  The "This VI" control on the left should be the "This VI" constant.

0 Kudos
Message 5 of 16
(4,620 Views)

Here's what I ended up with...thanks everyone for the suggestions/help...I use the label field of all my controls to index into an array of all the refnums (I scan them all as the first step when my VI executes), and the event structure you see is what executes any time there's a mouse up event on an MCL (I have a separate array of all MCL events)...

mcl_es.png

0 Kudos
Message 6 of 16
(4,591 Views)

@Hooovahh wrote:

 

Edit: As I feared the snippet isn't exactly what I made.  The "This VI" control on the left should be the "This VI" constant.



Use the code capture tool rather than LV's built-in snippet tool.  CCT is much better and doesn't have this problem.

0 Kudos
Message 7 of 16
(4,573 Views)

I didn't even know there was a built in snippet tool because I've been using Code Capture Tool.  Learn something new every single day.

aputman
------------------
Heads up! NI has moved LabVIEW to a mandatory SaaS subscription policy, along with a big price increase. Make your voice heard.
0 Kudos
Message 8 of 16
(4,567 Views)

Bmishoe,

 

Did you just become an NI employee?

 

I noticed your bars are now blue.

0 Kudos
Message 9 of 16
(4,558 Views)

no...which bars are you referring to?

0 Kudos
Message 10 of 16
(4,556 Views)