LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

FGV giving Zero Value

Hi

 

I am using Functional Global Variable in Real time cRIO, during run sometime the FGV is giving null output or empty array for a some iteration. 

 

I am positive the null data is not written to the FGV, I have tried writing constant value and tried reading, still the issue persist.

 

Please give your suggestions if the similar issue is faced.

 

Thanks in advance.

0 Kudos
Message 1 of 10
(2,746 Views)

Do you have any example code that shows the issue?  My guess is you did something wrong.  But impossible for us to say until we can dig around your code.


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 10
(2,728 Views)

Yeah.  Kind of difficult to help troubleshoot something when you don't attach any code.

 

I going to take a WAG that you forgot to wire through from shift register to shift register on at least one of your cases in the FGV.

0 Kudos
Message 3 of 10
(2,722 Views)

Hi,

i have attached snippet of FGV.

 

the null value is generated in random iteration, the FGV logic I have checked.

 

I am unable to find the cause, please give your suggestions.

0 Kudos
Message 4 of 10
(2,687 Views)

There is nothing obviously wrong with that FGV  (other than I saw you spelled "safety" wrong).

 

If you are getting default zero values, that tells me you are using it properly and failed to Write to whatever parameter you are reading that didn't give you the answer you expected.

 

That data structure is very large.  Are you sure all of those items belong together in one super-cluster like you have?  There are so many things stored in there, you had to create a huge number of cases to be able to set them all.  My guess is that you forgot to write to one or more of those cases with data.

 

Make your cluster on the front panel large enough so you can see everything in it.  Then use the debugging tools available to you like viewing that front panel, highlight execution, pause and breakpoints, to see if the cluster actually contains the data you think it does.

0 Kudos
Message 5 of 10
(2,677 Views)

Hi Thanks for the review,

 

I checked on the cases, all are linked to the super cluster.

 

The issue I am facing is not only getting zero, but instead I am getting null/empty values for array.

 

Is this due to cluster size or the number of execution could cause the issue?

 

Should I change the VI execution property? I have configured as high priority now.

0 Kudos
Message 6 of 10
(2,659 Views)

The problem is in your larger application.  Are you sure you are putting values into that array?

 

Something that tells me your cluster is way too big is that because you didn't include all the typedef's, I have to click IgnoreAll or Stop every time it looks for a typedef.  I had to click probably 50 times to get through it.

 

Other issues "common" not "comman".

Your "Vibration" element is in the "Vibration Raw" case and your "Vibration Raw" element is in your "vibration" case.

 

You are packing to much data into a single cluster.  And you are using the mega-cluster as an input when you want to just change one element, which means you have to bundle your element into the mega-cluster.  You'd be better off if your input was a variant, and used Variant to Data in each case to convert to the correct datatype you want to bundle in.

 

But really, you need to make a much more manageable-sized cluster.

 

No, don't use special subVI priorities.  Just use the standard one.

0 Kudos
Message 7 of 10
(2,649 Views)

@RavensFan wrote:

But really, you need to make a much more manageable-sized cluster.


Personally, I'm not even seeing a reason for this FGV.  It could be managed just a easily (maybe even more simply) with Global Variables or keeping the megacluster on the top-level state machine.  Hard to say which is better without seeing the architecture of the application.


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 8 of 10
(2,612 Views)

In my Nugget about Action Engines (see here) I make a distinction between FGVs and Action Engines pointing out that FGV can suffer from race conditions just like global variables since In the case of FGVs changes to the contained data is made OUTSIDE the FGV while in the case of an Action Engine, the data is encapsulated and all interaction with the encapsulated data is done inside the AE and protected from Race conditions.

 

What may help trace down where the issue may be hidden, is to set break points in the FGV and monitor when the data is being stepped on. The drop-down that is normally the font drop-down turns into a call chain indicator when the break point fires. Using the breakpoint and the drop down will let you discover WHEN the data is being stepped on and knowing the call chain WHO is stepping on the data.

 

Just trying to help,

 

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
Message 9 of 10
(2,590 Views)

What Ben said.  The possibility of adding debug breakpoints and probes inside an FGV is a valuable (but oft-overlooked) advantage over regular globals.  (And is similarly helpful in Action Engines).

 

 

- Kevin P

CAUTION! New LabVIEW adopters -- it's too late for me, but you *can* save yourself. The new subscription policy for LabVIEW puts NI's hand in your wallet for the rest of your working life. Are you sure you're *that* dedicated to LabVIEW? (Summary of my reasons in this post, part of a voluminous thread of mostly complaints starting here).
Message 10 of 10
(2,567 Views)