LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Why does indicator show uninitialized array?

Here is the Main.vi for my Real-Time Model Module in DQMH. This is running on a PXIe-8861 using NI RT OS.

dakotasmith2_0-1733846314853.pngdakotasmith2_1-1733846330264.png

 

In the INIT MODEL subVI I am initializing an array that should be a length 4 and all zeros. The size of those two channels are currently both 2 which is hardcoded inside the Settings DQMH module.

dakotasmith2_2-1733846445591.png

The array indicator here always shows this after it gets initialized

dakotasmith2_3-1733846580643.png

This is the EXECUTE MODEL subVI where in the READ FROM AI subVI I'm building the array from the INIT MODEL with the data read from the AI card. Here number of rows and counter refer to iterating through another array which was populated from reading a csv and works fine. The enabled part of the diagram disabled structures are just the tunnels wired straight across.

dakotasmith2_4-1733846726910.png

Here is the READ FROM AI subVI where the first part of the array is being populated with the data read from the AI card.

dakotasmith2_5-1733846812986.png

While the EXECUTE MODEL timed loop from the Main.vi is running, the values inside the AI and Bridge Input Raw indicator seems to be correct and nonzero. 

dakotasmith2_7-1733846948933.png

After the EXECUTE MODEL timed loop finishes its execution, the same indicator now shows an uninitialized array. Why does this happen?

dakotasmith2_8-1733846994841.png

 

 

0 Kudos
Message 1 of 5
(150 Views)

Hi dakota,

 

Most people responding on the forum don't have the last version of LabVIEW installed (here 24.0), so please attach your VIs saved for a previous version (preferred 21.0). To do that, go to File > Save for Previous Version... > 21.0 on your main VI.

 

Just by looking at the screenshots, I would say maybe your Model Data is cleared in the "Enabled" cases of your Diagram Disable Structures (DDS):

 

raphschru_1-1733850567666.png

 

When you wrap code within a DDS, the wires are reset to their default value, so you have to manually add wires to make your data pass through.

 

Regards,

Raphaël.

0 Kudos
Message 2 of 5
(122 Views)

Hi Raphaël,

 

I believe I have saved them in version 21.0 like you asked. Also, for the DDS Enabled I have just wired the tunnels straight across so I don't believe they should be receiving default values.

dakotasmith2_0-1733852207780.png


As for versioning, should I save all my code in 21.0 to allow for the most compatibility for everyone on the forum?

Thanks,
Dakota

0 Kudos
Message 3 of 5
(108 Views)

@dakotasmith2 wrote:

As for versioning, should I save all my code in 21.0 to allow for the most compatibility for everyone on the forum?

Thanks,
Dakota


I personally recommend 2019 for the version to pick.  I am on 2021, but I know some contributing forum dwellers are still on 2020 or 2019.

 

There are very few features that were in 2021 but not 2019 (Interface classes are the only big one I can think of) so there's a very small chance that the extra two versions of backsaving will cause problems.  

Message 4 of 5
(103 Views)

@Kyle97330 wrote:

@dakotasmith2 wrote:

As for versioning, should I save all my code in 21.0 to allow for the most compatibility for everyone on the forum?

Thanks,
Dakota


I personally recommend 2019 for the version to pick.  I am on 2021, but I know some contributing forum dwellers are still on 2020 or 2019.

 

There are very few features that were in 2021 but not 2019 (Interface classes are the only big one I can think of) so there's a very small chance that the extra two versions of backsaving will cause problems.  


Concatenating strings through tunnels didn't become available until 2021:

paul_a_cardinale_0-1733865341998.png

0 Kudos
Message 5 of 5
(69 Views)