LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

array and cluster compatibility problem

Are you able to post your code?

 

0 Kudos
Message 11 of 15
(825 Views)
again problem is boolean isn't working it stays as default initialized value

0 Kudos
Message 12 of 15
(811 Views)
added some code to try to detect boolean correctly but still doesn't work
0 Kudos
Message 13 of 15
(804 Views)

Without going into proper coding style, here is how you can get the selection to work (see diagram below):

 

 

Message Edited by JoeLabView on 07-06-2007 11:43 AM

0 Kudos
Message 14 of 15
(794 Views)

Explanation of code change:

1.  The Array within the "Remove" selection contained the information prior to making a selection, which meant no selection was ever made.  So creating a new local variable (we'll talk about proper style later) will take a snapshot of the new values within "Array" and thus handle any selection.  You have to set the local variable to READ.

2.  The buttons should appear in their associated cases, see the "Remove" button in the "Remove" event case.

3.  The logic has been reversed for the case statement.  Although the selection appears red on the front panel, it's value when selected is TRUE, therefore, you should remove the values when the boolean is TRUE.

Coding Style:

There are many things to cover on the coding style, but I'll stick to the basics.  The event structure is a good approach. 

1.  Try to stay away from local / global variables as much as possible.  A Functional Global would be quite useful for this implementation.  It would hold the values that can be called anywhere in your program.

2.  The use of a local variable in the first loop where you actually populate the array is not a good idea.  As I mentionned in #1, local variables are not a good idea, as you can get the wrong / unexpected values in your code, as seen in the original version.  I'm not sure if you wanted to retain any previous values from calling the function.. which would be better suited for a Functional Global...

3.  The use of a Stacked Sequence Structure is not necessary and not recommended.  The only item in there is the indicator.  You should put the indicator in place of the "Array" local variable at the right of the Event Structure. Wel... as a matter of fact, the "Array" indicator should really go after your first loop which populates the array.  You would have a copy of the original (unmodified) data... that you could use later-on in your code...

Question:

>>> so, when "Removing" an item, do you want to preserve the XRay composition % data?? <<<

 

 

0 Kudos
Message 15 of 15
(786 Views)