LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

calling an event structure via a LED?

Can I call a case in an eventstructure via the value change of a LED?

 

The reason for this is the following:

 

In my VI is a xy graph and the update of the dispaly and the x-scale takes a lot of time, so I would like to do the update outside of my main-loop to avoid that other processes get delayed. The attached VI is just an example.

(In my real VI, I have a consumer and producer loop and lots of data processing, so in that case the disply update should not interrupt the data processing.)

 

I tried to put the x-scale update in the event structure and call the event structure via the change of a boolean value, but that does not work. The event is not recognised and the x-scale does not change.

 

Chart_Test_16.GIF

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Johannes

 

LabVIEW 7.1

 

 

Message Edited by johanneshoer on 11-11-2009 08:20 AM
Greetings Johannes
Using LabVIEW 7.1 and 2009 recently
0 Kudos
Message 1 of 28
(5,404 Views)

You can use Value (Signaling) property of your Update boolean at the lower loop. Instead of writing straight to terminal use this property.

 

Also,

 

You must really consider cleaning up your block diagram.

1. Maintain straight wires as much as possible.

2. Reduce local variables

3. Follow left-right allignment- Its better to wire to a structure at left border of the structure

 

0 Kudos
Message 2 of 28
(5,391 Views)
If you use the Value(Signaling) Property node, it should work.  The (signaling) means it fires an event.
--
Tim Elsey
Certified LabVIEW Architect
0 Kudos
Message 3 of 28
(5,389 Views)

Antoher way would be to create and generate a User Event. If you want to know more about it just search in the Example Finder.

 

Christian

0 Kudos
Message 4 of 28
(5,379 Views)

Thank you for the answers.

 

@Vsh:

1. and 3.: Better like this?

2. How can I overgive a value to an event structure if the terminal of that value is already used somewhere else in the VI?

 

@ Tim:

Al right, yes it works! Thank you!

Chart_Test_17.GIF

 

 

Greetings Johannes
Using LabVIEW 7.1 and 2009 recently
0 Kudos
Message 5 of 28
(5,356 Views)

Hi Johannes,

 

some more notes on your code:

- there's a function that computes Sin&Cos in one block

- you can resize "index array" to output more than one element

- try to minimize type coercions, this will help a lot as soon as you work on bigger arrays

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 6 of 28
(5,341 Views)

Hello Gerd,

 

I don't understand. What do you mean by "resize index array"?

What type coercions should I mimimize? The coercions " array <--> cluster " etc.? But they are necessary...

Greetings Johannes
Using LabVIEW 7.1 and 2009 recently
0 Kudos
Message 7 of 28
(5,338 Views)

Hi Johannes,

 

- some (array) functions are resizable, like "index array". Move the mouse over the lower border of the function and you can resize it to have more outputs. Read the context help for the function!

 

- type coercions: whenever you have that small grey dot on a function input (I prefer to change that color setting to RED) LabView has to change the datatype. Look at the Q&R function in the lower part: one input is DBL, the other is INT. One input of !&R has a grey dot as the function needs both inputs in the same datatype... Or the grey dots at the wait function... Type coercions can become a major performance hit when occuring on arrays! Try searching the labview help for "coercion" Smiley Wink

Message Edited by GerdW on 11-11-2009 07:19 PM
Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 8 of 28
(5,330 Views)

I really don't understand why it has to be a parallel event structure. Why don't you just place the code of the event structure in a case structure in the main loop connected to the boolean. Keep the FALSE case empty and you get the same effect without jumping through flaming hoops. 😉

 

Overall, you biggest bottleneck, and possible performance issue, is you constant memory allocations of complicated data structures with delete from array and insert into array. Any array resizing operation is expensive. You should keep the array at a fixed size and operate in place.

 

As others have said, many of your operations are very convoluted and inefficient. I'll have a look....

Message 9 of 28
(5,321 Views)

johanneshoer wrote:

I don't understand. What do you mean by "resize index array"?


Here's one example. Your code is on the left and uses two "index array" nodes. All you need is one, configured for two outputs.

 

Also, of you want consecutive indices, starting at zero, you don't need to wire the index inputs.

 

An alternative is shown on the right.

 

 

 

 

 

Message Edited by altenbach on 11-11-2009 12:06 PM
Message 10 of 28
(5,299 Views)