LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

trouble in user-event from subvi

Solved!
Go to solution

I am doing a practice with user-event generated from subvi.

My simple code, which intended to display the number on the main.vi, didn't work properly.

Can you check what I need to fix?

(The stop function was not implemented yet.)

 

labmaster.

0 Kudos
Message 1 of 11
(2,408 Views)

Because your FGV doesn't work as you expected. Nobody creates User Event Ref.

 

result.PNG

 

Certified LabVIEW Developer
There are only two ways to tell somebody thanks: Kudos and Marked Solutions

GCentral
0 Kudos
Message 2 of 11
(2,379 Views)

Thank you for the check.

I changed the code a little bit with the functional global of reference.

Still had a problem.

 

labmaster.

0 Kudos
Message 3 of 11
(2,370 Views)

Why don't you use probe? When "set" method is called, what data is expected?

 

bd.PNG

 

Certified LabVIEW Developer
There are only two ways to tell somebody thanks: Kudos and Marked Solutions

GCentral
0 Kudos
Message 4 of 11
(2,362 Views)

Thanks.

 

Anyway, I have already checked with the probe and the event manager tool.

 

I am not sure if '0' value just after functional global is weird but a proper value of reference was transmitted to the subvi.

 

Maybe I can guess the reference had a problem to send the right value but I don't know why or how to resolve this trouble because of beginner in using user-event. 

 

That's my question.

 

Did you find any reason for the problem in reference?

 

labmaster.

0 Kudos
Message 5 of 11
(2,350 Views)
Solution
Accepted by topic author labmaster

Reference "0" implies that there is no active reference. This is not only user-event,
but also queue, notifier, FPGA ref, etc...

 

A cause of your problem is not related to user-event, it's FGV's.
At the first call, "set" method is called but there is no data on output terminal.
This is because "get" method is not called. No called, No data.


If you would like to get the data on "set", place the output terminal out of structure.

Certified LabVIEW Developer
There are only two ways to tell somebody thanks: Kudos and Marked Solutions

GCentral
0 Kudos
Message 6 of 11
(2,331 Views)

I was surprised from your comment and it works.

I have never seen the difference of positional effect between inside and outside of while loop in the functional global.

 

I think this should be a kind of bug in Labview.

The global ran first (set) before it ran timeout of event stucture (launching the subvi).

When subvi get is running,  then, the global should be run in the second time (get).

So it's not a 'race' condtion between set and get of the global.

 

Can you explain it briefly if my understanding is wrong?

 

labmaster.

0 Kudos
Message 7 of 11
(2,324 Views)

This is not LabVIEW Bug, is expected behavior.

 

When "set" is called, nobody assigns the input value to output terminal.

This is because "get" case is not executed.

 

You can also see the behavior with attached example.

This VI has the same unexpected behavior but it's also not bug.

Certified LabVIEW Developer
There are only two ways to tell somebody thanks: Kudos and Marked Solutions

GCentral
0 Kudos
Message 8 of 11
(2,317 Views)

Okay I understand what you mean.

 

Passing the variable through the global, this was an exceptional habit even for me. 

I had a mistake in my convention.

 

 

Thank you.

0 Kudos
Message 9 of 11
(2,313 Views)

Have a fun : )

Certified LabVIEW Developer
There are only two ways to tell somebody thanks: Kudos and Marked Solutions

GCentral
0 Kudos
Message 10 of 11
(2,309 Views)