LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Conflict of 2 control events

Solved!
Go to solution

Hello,

 

 

Event from B0max control provoke actionning of Regenerate B0 button. Should I create additional event case for B0max and put there the same code as for Regenerate B0.

 

Thanks in advance.

 

Pavel

 

venBloch_Eq_FP.JPG

 

Bloch_Eq_BD.JPG

 

0 Kudos
Message 1 of 18
(3,660 Views)

Hi Pavel,

 

Event from B0max control provoke actionning of Regenerate B0 button.

Why should B0max create an action of the "Regenerate B0" button?

Both controls are set to call the same event case and so the event case is executed on value change of any of those two controls…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 18
(3,642 Views)

Hi GerdW,

 

When I change B0max, the values of B0x, B0y and B0z are also randomized as if Regenerate B0 button were also clicked.

I want that modification of B0max only scale the values B0x, B0y and B0z.

Actually it do both - scaling and randomizing.

Should I separate B0max and Regenerate B0 into different cases.

 

Best Regards

 

Pavel

0 Kudos
Message 3 of 18
(3,623 Views)

Hi Pavel,

 

I want that modification of B0max only scale the values B0x, B0y and B0z.

When you WANT something you need to program it!

 

Should I separate B0max and Regenerate B0 into different cases.

This would be one solution to the problem. And it would be a clear solution with better separation of program steps and documentation what happens in your VI.

The other is to use a case structure in the event case to only randomize B0 values when button was pressed…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 4 of 18
(3,612 Views)

This would be one solution to the problem. And it would be a clear solution with better separation of program steps and documentation what happens in your VI.

So with this solution, the code for 2 event cases, i.e. B0max and Regenerate B0 will be the same (i.e. duplicated)

 

The other is to use a case structure in the event case to only randomize B0 values when button was pressed…

Case structure variable - output from Regenerate B0 ?

FALSE case - empty

TRUE case - dices

Correct ?

 

Thanks

Pavel

0 Kudos
Message 5 of 18
(3,592 Views)

Hi Pavel,

 

So with this solution, the code for 2 event cases, i.e. B0max and Regenerate B0 will be the same (i.e. duplicated)

No.

With Regenerate you will create random numbers

With B0max you will create a new curve…

 

Case structure variable - output from Regenerate B0 ?

FALSE case - empty

TRUE case - dices

In FALSE case you should keep the last random numbers, in TRUE case you will generate new ones…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 6 of 18
(3,583 Views)

Thanks GerdW,

 

I've succeed in 2nd solution (i.e. using case structure).

Concerning 1st one (i.e. separate event cases), it requires creating of 2 additional indicators to be used as local variables - phi and theta. Correct ?

 

Best Regards

 

Pavel

 

 

 

 

Bloch_Eq_BD(2), case solution - FALSE case.JPG

 

Bloch_Eq_BD(2), case solution - TRUE case.JPG

0 Kudos
Message 7 of 18
(3,569 Views)

Hi Pavel,

 

Concerning 1st one (i.e. separate event cases), it requires creating of 2 additional indicators to be used as local variables - phi and theta. Correct ?

Not at all!

You only need to add shift register(s)…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 8 of 18
(3,562 Views)

Hi GerdW,

 

"2 separated event cases" solution doesn't work (of course if I correctly implemented your suggestion).

Best Regards

Pavel

 

Bloch_Eq_BD(3), event case solution - regenerate case.JPG

 

Bloch_Eq_BD(3), event case solution - B0max change case.JPG

 

0 Kudos
Message 9 of 18
(3,544 Views)

You need to wire your values through each event case.  If you don't, the values will basically be erased.  I think you also need to use a BOmax Value (Signaling) property node in order to have the Regenerate button force the BOmax Value Channge event to happen.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 10 of 18
(3,533 Views)