LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Can I Bind a Front Panel LED to a specific element in an array of booleans?

Solved!
Go to solution

 

In LabVIEW 2010 I have a string of LEDs. I have and array of boolean values that contain the values that the LEDs should indicate.

 

What is the best way to connect the LEDs to elements in the array of booleans?

Can I Bind a Front Panel LED to a specific element in an array of booleans?

How is this done?

Can anyone show sample code?

0 Kudos
Message 1 of 11
(3,481 Views)

I think Index Array will do what you want.  "Binding" is not a term which is typically used for this in LV.  Either update the display periodically from the array or update the display when the boolean is changed.

 

Lynn

0 Kudos
Message 2 of 11
(3,475 Views)

If I can bind each LED to a specific element shared array of booleans then I woundn't have to wire each LED individually using a Index Array or Decimate Array function for each LED.

 

Imagine how difficult it would be to wire 100 LEDs individually. What about 1000 or more LEDs?

 

Wouldn't it be much easier to Bind the LEDs to their values in a shared variable and then let PSP update them?

Isn't that what binding is for?

 

The problem is, I don't know how to Bind an LED Indicator to a specifc element in a Array of Booleans.

Like LED S7 binds to mycomputer/.../myBoolArray[7]. How do I do this?

0 Kudos
Message 3 of 11
(3,463 Views)

I cannot help with shared variables because they are not available for my platform.

 

Can a user really make meaningful sense of a panel with hundreds or thousands of LEDs?

 

Lynn

0 Kudos
Message 4 of 11
(3,451 Views)

 


@dbaechtel wrote:

If I can bind each LED to a specific element shared array of booleans then I woundn't have to wire each LED individually using a Index Array or Decimate Array function for each LED.


 

Yes, that would be nice.

 

 


Imagine how difficult it would be to wire 100 LEDs individually. What about 1000 or more LEDs?


 

I would approach the problem differently and more intelligently. I wouldn't have 100 LEDs on the front panel.

 

 


Wouldn't it be much easier to Bind the LEDs to their values in a shared variable and then let PSP update them?

Isn't that what binding is for?


 

That depends on what you mean by binding. Data binding in the strictest sense is a link between a UI and business logic. If one side changes, then the other side gets updated. A shared variable is not business logic. It's a source of a value. A class is business logic.

 

 


The problem is, I don't know how to Bind an LED Indicator to a specifc element in a Array of Booleans.

Like LED S7 binds to mycomputer/.../myBoolArray[7]. How do I do this?


You can't.

 

0 Kudos
Message 5 of 11
(3,430 Views)

Imagine that you have an I/O card that provides 128, 256 or 1024 digital inputs and the requirement is to have an LED on the front panel to represent the state of each digital input. This frequently occurs.

 

Wiring that many digital inputs individually is a royal pain and then some !

 

It would make sense to have one shared variable as an array of Booleans that represents the status of all inputs and then use data binding instead of wiring each individually. The individually wiring would violate all recommendations on diagram size and fan out.

 

Frequently scanned For loops to update all of the LEDS would take alot of CPU time.

 

Wouldn't it be MUCH better if PSP could be used to update the LEDs whenever the data changed (as it is supposed to do) ?

 

In my case I have a LabVIEW Yaskawa servo driver that provides me information about 16 servo drives that may be connected. I have LEDs on the front panel to represent some of that status for each individual drive. But Yaskawa provides the information on the drives as an array of clusters of information for each drive, which I perform some business logic on and turn into shared array of Booleans to feed the LEDs (and some banks of switches as well).

 

Unfortunately LabVIEW does not seem to have any way to bind the LEDs (and Switches) to individual elements in the shared array of Booleans. It is just not that smart. Even with only several banks of 16 LEDs and Switches, wiring them individually using Decimate Array of Index Array functions is a royal pain and makes the block diagrams very large. It would be much worse and almost unreasonable to do if the size of the information was much larger.

0 Kudos
Message 6 of 11
(3,393 Views)

Is there really any need for inividual indicators? Why can't you use an array for each? Creating 16 shared variables for each drive would probably be simpler and you could bind those to 16 different arrays on your front panel.

 

Providing details on the actual model of your servo driver could help in finding an alternative.

0 Kudos
Message 7 of 11
(3,375 Views)

@Dennis Knutson wrote:

Is there really any need for inividual indicators? Why can't you use an array for each? Creating 16 shared variables for each drive would probably be simpler and you could bind those to 16 different arrays on your front panel.

 

Providing details on the actual model of your servo driver could help in finding an alternative.


Yes, there is a need for individual LEDs and Switch for each drive.

 

Yaskawa (or someone for Yaskawa) wrote the LabVIEW driver for MetroLink II that returns the status of the servo drives as an Array of Clustered data for each servo drive. Since the servo data is already in an Array and I have a bank (array) of LEDs and Switches on the front panel, it is much easier to work with the system using and Array of Booleans instead of individual booleans for each servo drive. Converting the Array of Servo Data into individual shared variables is worse than wiring the individual LEDs.

 

It is too bad the LabVIEW had the foresight to allow the existence of a Shared Array of Booleans, but apparently did not anticipate the need to bind to indiviual elements in such a Shared Array of Booleans.

0 Kudos
Message 8 of 11
(3,366 Views)

That makes no sense. First you say you have individual Booleans and now you say you have a bank of array on the front panel.

 

I never said to convert into individual shared Booleans.

 

If you really and truly do not see a way to use arrays of LEDs and switches, then that is what you have wire. It takes a single index array.

0 Kudos
Message 9 of 11
(3,358 Views)

I think that you have misunderstood what I have said.

 

No matter.

 

It appears that individually wiring the LEDs and Switches is the only way in LabVIEW 2010. 

I have resigned myself to the tedium and boredom of doing so.

 

It is too bad that LabVIEW requires so much work to do so little when much better ways seem just out of reach.

 

 

0 Kudos
Message 10 of 11
(3,356 Views)