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.
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.
04-22-2014 01:32 PM
I have a VI with multiple MultiColumn Listboxes in it. One way I've seen to make the entries writeable is as follows:
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
Solved! Go to Solution.
04-22-2014 01:36 PM
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
04-22-2014 01:41 PM
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,
04-22-2014 03:08 PM
Like this....
04-22-2014 03:35 PM - edited 04-22-2014 03:36 PM
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.
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.
Unofficial Forum Rules and Guidelines
Get going with G! - LabVIEW Wiki.
16 Part Blog on Automotive CAN bus. - Hooovahh - LabVIEW Overlord
04-23-2014 06:47 AM
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)...
04-23-2014 08:56 AM
@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.
04-23-2014 09:02 AM
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.
04-23-2014 09:48 AM
Bmishoe,
Did you just become an NI employee?
I noticed your bars are now blue.
04-23-2014 09:49 AM
no...which bars are you referring to?