LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

search element in array and convert to booblean and memorize this boolean

Hi,
 
I have an array with X cells (variable).On the other hand I have a control string. I want search this control in the array. If I meet it, in the array, a LED will switch on. For example:
 
cicle nº 1
Array       Control
a                 b                  LED (a): off
b                                     LED (b): on
d                                     LED (c): off
                                       LED (d): off
                                       LED (e): off
cicle nº 2
If this control changes, now is "d", the LED (d) will switch on, but the LED (b) wil keep switched on.
Array       Control
a                 d                  LED (a): off
b                                     LED (b): on
d                                     LED (c): off
                                       LED (d): on
                                       LED (e): off
cicle nº 3
If this array changes, all the LEDs will switch off and will start the "memory" of the LEDs.
Array       Control
a                 a                  LED (a): on
b                                     LED (b): off
c                                     LED (c): off
e                                     LED (d): off
                                       LED (e): off
cicle nº 4
Array       Control
a                 c                  LED (a): on
b                                     LED (b): off
c                                     LED (c): on
e                                     LED (d): off
                                       LED (e): off
 
Thank you, and sorry for my english...
0 Kudos
Message 1 of 8
(3,400 Views)
Hi Vicens,

there are search functions (search array element)...
To memorize the last state of your LEDs you should use a shift register in your loop. If the LEDs should only switch on you can use an OR-operation to include newer results.

What's the condition for switching LEDs off? Your question is not very specific on that... Should they switch off after 2 iterations of your loop (AND with FALSE in this case)?

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 8
(3,385 Views)
Hi Vicens,

be more specific. Attacheded VI's might help you.

Message Edited by ceties on 10-18-2006 07:38 AM

LV 2011, Win7
Download All
0 Kudos
Message 3 of 8
(3,383 Views)
I changed Led2

Message Edited by ceties on 10-18-2006 07:42 AM

LV 2011, Win7
0 Kudos
Message 4 of 8
(3,371 Views)

Hi, GerdW and cities

sorry for my awful explanation.

Every X time the array update (and can changes the values) only one once. This array contains 7 differents cells (a, b, c, d, e, f and g), and some cells can be empties.

During this time, I recibe, via Data Socket, messages, named string control in the vi added. So in each iteration the program can read only one message.The content of the message is any cell (a, or b, or f,...).

The objective is to show which message are in the array.

PD: I've replace DS by the string control in the vi added.

PD2 (to cities): can you convert your 'vi' to LV 7.1?

Thank you

LV 7.1 /Xp

0 Kudos
Message 5 of 8
(3,360 Views)
I am sorry. But I can't, from 8.2 i can downgrade only to 7.1. Can anyone other?
LV 2011, Win7
0 Kudos
Message 6 of 8
(3,346 Views)
There you have the vis in 7.1
Download All
Message 7 of 8
(3,320 Views)
Thank you! AitziberH
0 Kudos
Message 8 of 8
(3,289 Views)