LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

User Event Generate gives error 1 (reference passed by global variable)

Good day everybody

 

I had following issue with User Event passed by global variable or FGV.

 

1. In main application User Events are obtained and send to external app to appropriate control. References are stored in global variable

User Event obtain and send to external app.png

2. Start external app in which User Events are register: 

User Events registered in external app.PNG

 

3. In Main application Event User named "Control Mode" is generated based on reference read from global variable:

User Event Genarate.PNG

 

Unfortunatelly I am getting the error number 1

"Possible reason(s):

LabVIEW:  An input parameter is invalid. For example if the input is a path, the path might contain a character not allowed by the OS such as ? or @.
=========================
NI-488:  Command requires GPIB Controller to be Controller-In-Charge"

 

I checked synchornization run of main code versus external application.

The flow is as described above.

I have tried global FGV with no differences.

 

Remark

I noticed also when casting User Event reference to variant (for FGV purpose) then it was not possible to cast it back to reference (error 91).

It looks like the reference passed by any means is then not recognized when received.

 

When reference is connected directly from Obtain to Generate Event the it is OK !!

 

Has anybody experienced similar issue?

Do I miss something?

I appreciate any suggestion

 

MM

0 Kudos
Message 1 of 3
(3,356 Views)

Based on what I have seen, I think I would use the Asynchronous Call By Reference.  That would allow you to use the connector pane to pass the references into your called VI.


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 2 of 3
(3,327 Views)

Hi Crossrulz

 

Thank you fro remark. Started external app. vi method Run VI which was beyond the first screenshot area. This old school aproach works fine.

Using asynchronous call with connector pane is just more compact on block diagram.

 

My problem with User Event Generate (error 1) when reference is passed via global, FGV still remains.

I tried also FVG with Obtain function and Generate Event inside. It does not help.

See pictures below:

FGV with Obtain and Generate Event inside - Obtain.PNG

 

FGV with Obtain and Generate Event inside - Generate.PNG

 

Notice please, on picture above casting from variant to User Event reference is giving already error 91. I mention that in previous post.

User reference constant has been created from the output of Obtain function.

User reference constant should be same type as references created from Obtain function, however constant contains zero value whlist reference created each time, some number.

Can it be that LabVIEW treats those two references (constant and newly created) as a different type?

I think I have gone too far ;-/

 

Another FGV that I tried to use to pass User Event references is typical:

FGV - Collect.PNG

 

FGV - Return.PNG

 

At the moment I don't see any better solution like creating additional booleans in external app. sending the data to them from Main app. and use of value signaling property to make external app. reactive.

 

I appraciate any suggestion.

 

MM

 

 

 

 

 

 

0 Kudos
Message 3 of 3
(3,308 Views)