Labview 2010: Is there a way to create an IMAQ Image Control from the blocks editor

StackOverflow https://stackoverflow.com/questions/18899780

  •  29-06-2022
  •  | 
  •  

سؤال

I am trying to create something to simulate drawing cards until the face values add up to at least 21 (like blackjack, but you are dealt until you get 21 or bust). However, I don't want to show extra IMAQ image Controls on the front panel if possible, which begs these questions:

Is there a way to create a control during the execution of the VI?

Sample situation:

Place 9 IMAQ Image Controls and create an inconveniently long sequence to pick a random card that is still in the deck, then place it in Control1 and add its value to the total value, then duplicating this process and placing it next in the sequence, until you reach a total value of 21.

That would take an extremely long time.

9 Cards is the maximum number one can have draw and have just over 21

I don't want those extra green IMAQ Controls if I don't need them.^

My ideal structure have some sort of for loop that would create a new Image Control for each iteration (1 iteration = drawing 1 card), then execute the commands to display the picture of the card drawn.

Any help would be much appreciated.

Thanks in advance,

Trojan

هل كانت مفيدة؟

المحلول

In your particular case, I would just create an array of regular picture controls (I'm not sure if the IMAQ picture control can be in an array, but if it can then you can use that) and then simply use the array's Number of Columns property to control how many elements are visible.

نصائح أخرى

You can't create new controls or indicators dynamically, but you can use property nodes to programmatically show and hide individual controls.

From the block diagram, right click on the IMAQ control's terminal and select Create -> Property Node -> Visible.

Right click on the property node and select "Change to Write". You can now use block diagram logic to show and hide the control.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top