Oliver Barrett Posted March 14, 2009 Report Share Posted March 14, 2009 Hello all: This is my first forum post. I have a large number of Boolean indicators on the front panel of my application that simulates railroad movements and signalling on a track diagram. I want to have these indicators contained within an array so that I can write Boolean state info to each indicator without a lot of block diagram wiring, but don't know how to do this when the indicators are dispersed at various locations around the front panel (vs. adding an indicator to a rectangular array "container" in the usual way when the front panel objects are built). I would much appreciate any suggestions you may have. Thanks! Oliver Barrett CLAD www.linkedin.com/in/orbarrett Quote Link to comment
Dan DeFriese Posted March 14, 2009 Report Share Posted March 14, 2009 QUOTE (Oliver Barrett @ Mar 13 2009, 03:09 PM) Hello all:This is my first forum post. I have a large number of Boolean indicators on the front panel of my application that simulates railroad movements and signalling on a track diagram. I want to have these indicators contained within an array so that I can write Boolean state info to each indicator without a lot of block diagram wiring, but don't know how to do this when the indicators are dispersed at various locations around the front panel (vs. adding an indicator to a rectangular array "container" in the usual way when the front panel objects are built). I would much appreciate any suggestions you may have. Thanks! Oliver Barrett CLAD www.linkedin.com/in/orbarrett You could place all your booleans in a cluster (hide the frame if desired). The implement your BD logic using an array. The Cluster to Array and Array to Cluster primatives when time to update the FP control. Quote Link to comment
Mark Yedinak Posted March 14, 2009 Report Share Posted March 14, 2009 As an alternative you could keep the controls as individual controls and update them using references. If you were to do this I would probably encapsulate the management of the controls and references into a functional global and reference the specific boolean by name or some such identifier. This way they can remain as separate controls yet you would be able to manage them in a consistent and expandable manner. Quote Link to comment
TobyD Posted March 14, 2009 Report Share Posted March 14, 2009 QUOTE (Oliver Barrett @ Mar 13 2009, 01:09 PM) This is my first forum post. I have a large number of Boolean indicators on the front panel of my application that simulates railroad movements and signalling on a track diagram. I want to have these indicators contained within an array so that I can write Boolean state info to each indicator without a lot of block diagram wiring, but don't know how to do this when the indicators are dispersed at various locations around the front panel (vs. adding an indicator to a rectangular array "container" in the usual way when the front panel objects are built). Welcome to LAVA! You can do something like this: http://lavag.org/old_files/monthly_03_2009/post-8758-1236976945.png' target="_blank"> It allows you to place your indicators wherever you want, but still pass them through a state machine (or any other architecture) on a single cluster wire. Just build a cluster constant to initialize them all. Quote Link to comment
crelf Posted March 14, 2009 Report Share Posted March 14, 2009 QUOTE (Dan DeFriese @ Mar 13 2009, 03:25 PM) You could place all your booleans in a cluster (hide the frame if desired). The implement your BD logic using an array. The Cluster to Array and Array to Cluster primatives when time to update the FP control. :thumbup: Quote Link to comment
Oliver Barrett Posted March 15, 2009 Author Report Share Posted March 15, 2009 Hello all, Thank you for the the replies. I'm actually storing a composite binary code to store the signal states in a functional global already, which helps. I thought of using the phantom cluster approach, but I expect that the cluster border (even if transparent) would have to be expanded to cover a large area of the front panel where my indicators are placed. Since I actually have three groups of indicators that cover different functional purposes, their cluster boundaries would have to overlap, don't know whether that would be an issue. I'll think about this approach further though. Regards, Oliver Quote Link to comment
LAVA 1.0 Content Posted March 15, 2009 Report Share Posted March 15, 2009 QUOTE (Mark Yedinak @ Mar 13 2009, 09:43 PM) As an alternative you could keep the controls as individual controls and update them using references. If you were to do this I would probably encapsulate the management of the controls and references into a functional global and reference the specific boolean by name or some such identifier. Here is a little bit code that demonstrates what Mark is describing: QUOTE (Oliver Barrett @ Mar 14 2009, 05:55 AM) I thought of using the phantom cluster approach, but I expect that the cluster border (even if transparent) would have to be expanded to cover a large area of the front panel where my indicators are placed. Since I actually have three groups of indicators that cover different functional purposes, their cluster boundaries would have to overlap, don't know whether that would be an issue. That might introduce a speed issue, controls overlapping each will all be redrawn if one of them needs to be redrawn, I don't know how far this goes for clusters but I would discourage them. Ton Quote Link to comment
Yair Posted March 15, 2009 Report Share Posted March 15, 2009 You can also combine the FG and references method to have more readable and safer code by doing something like this. You can update the controls using the Value property. Alternatively, if you're using 8.6, you can try using tags to mark the "owner" and "position" of each boolean and iterate over their references. There should be tagging VIs in vi.lib somewhere (I think in the Utility folder), although you probably want to check that they work fast enough and that they work in an EXE as you would expect before using them extensively. Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.