From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Unspecified error when writing variant shared variable

Hi everybody,

I'm getting an unspecified error (-2147467259) when trying to write a variant to a shared variable hosted on my cRIO device.

 

I'm using a cRIO chassis as a headless controller that dynamically finds remote ScanIO chassis at startup. Similar to the LabVIEW example, the cRIO finds the chassis and generates clusters containing the IO container refnums as well as other information about the modules. I generate two arrays (local and remote) of these clusters, turn them into a variant, and publish it as a network published shared variable so they can be used in a remote PC to add or remove remote channels as needed.

 

Has anyone had this sort of issue before? I'm new to real-time so I'm not sure if I have violated some canon here or not 🙂 Thank you for your help

 

-Jordan

 

0 Kudos
Message 1 of 7
(2,852 Views)

Hi Jordan,

 

Could you provide screenshots of the error and your code? This will give us a better idea of what is going on.

0 Kudos
Message 2 of 7
(2,796 Views)

Apologies, I opened it up but did not add it

0 Kudos
Message 3 of 7
(2,794 Views)

Are you saying the error is occurring when writing the data to the shared variable?  I don't know why that would happen.

 

But I'm not sure what you are planning to do with some of the data you are trying to write.  If one target is generating a reference to an item, I don't think that reference is going to mean absolutely anything to the other target when it gets it and unbundles those references.

0 Kudos
Message 4 of 7
(2,775 Views)

Jnelson,

 

There appear to be a few Corrective Action Requests (CARs) associated with using shared variables of the variant data type.  The closest one I could find related to your issue was CAR #291679 where Wiring FieldPoint IO Point into shared variable throws error -2147467259.  All CARs that I could find about using shared variables of the variant type threw the same error you are seeing and are feeding into it less standard datatypes (FieldPoint IO, LVClasses, IMAQ references).

 

To get a more general overview of your problem, does this error come up the first time you try to write to this shared variable or does it come up somewhat randomly?  It would help if you could tell us exactly what hardware you are doing and if you can recreate this issue by simply deploying a program that writes a constant cluster with the same data types into that shared variable.

 

A possible workaround for you to try would be using the Flatten to String and Unflatten from String functions and pass that through a string shared variable.  This has seemed to work for others in the past.

Matt J | National Instruments | CLA
0 Kudos
Message 5 of 7
(2,771 Views)

Sorry for the delay RavensFan and thanks for the response.

 

I'm trying to figure out a way to use a desktop client to remotely set up ScanIO variable reads on a cRIO system. I want the user to be able to give the cRIO-9068 a list of expansion chassis (NI-9148) and then let the cRIO find and use all its c-series module IO variables using the code I posted earlier. Basically I'm trying to make the system such that the user can hot swap c-series modules and expansion chassis and the cRIO will automatically find and sample the right variables. Does that make sense? Am I heading down a rabbit hole here?

0 Kudos
Message 6 of 7
(2,701 Views)

Thank you Matt, I see the CARs you have indicated.

 

The error pops up every time the either the desktop client or the RT target tries to write to the shared variable. The shared variable library is stored on the RT target.

 

I'll give the flatten/unflatten scheme a try.

0 Kudos
Message 7 of 7
(2,697 Views)