Within my real-time project, on the host VI running on my Windows PC, I am attempting to write to a number of network-published shared variables. All of these write operations are successful (meaning that I can subsequently read them on the RT target, a cRIO-9012), with the exception of those network-published shared variables with the data type defined as variant. I'm not quite sure what is causing the problem.
I am taking the array of clusters shown here...
...and passing it through a "To Variant" VI, and then subsequently writing to the shared variable (data type: variant). Diagnosing the failure of the real-time VI to read data, I found that the shared variable write on the host VI was producing the following error:
Error -2147467259 occurred at Shared Variable in PC host TTS CTRL.vi
LabVIEW: (Hex 0x80004005) Unspecified error.
NI System Configuration: (Hex 0x80004005) Miscellaneous operation failure.
This error or warning occurred while writing the following Shared Variable:
\\My Computer\Network Shared Variables\TC Group Assignment Array - Network
\\184.108.40.206\Network Shared Variables\TC Group Assignment Array - Network
...where 220.127.116.11 is the IP address of the PC.
Solved! Go to Solution.
I did a little bit of research and found this Forum post that seems quite similar to yours. This solution suggests flattening the object to a string and passing that through. Have you tried this to see if it would work?
If it doesn't, can you provide more information? Computer OS? Attaching your VI? Anything that can allow us to see or get more information could be helpful if the other forum's solution isn't working for your.
I did see that post, and when I found myself with no other options, I redefined the variables in question to string data type, and replaced all "To Variant" and "Variant to Data" functions with "Flatten to String" and "Unflatten from String" functions respectively. At first, it didn't work - every "Unflatten from String" function would produce error 74, until I realized that the "data includes array or string size? (T)" input on every "Unflatten from String" function had to be set to FALSE. Wiring a false constant to each instance of "Unflatten to String" seems to have corrected the problem.
I still have no idea why the variant wouldn't work. The shared variable editor allows you to set a variant datatype, so I presume it is supposed to?
Hi Sean. You are correct that it is suppose to work as long as you don't have RT FIFOs enabled on the Shared Variable. However, there is a known issue where this doesn't work as expected when converting a LabVIEW class to a varient with shared variables (Ref # 443117). This could be related to that. I'm glad you were able to find a work-around.
Was someone able to resolve this without a workaround?
I'm currently facing the issue that
Error -2147467259 occurred at Shared Variable in main.vi Possible reason(s): LabVIEW: (Hex 0x80004005) Unspecified error. ========================= NI System Configuration: (Hex 0x80004005) Miscellaneous operation failure. This error or warning occurred while writing the following Shared Variable: \\NI-cRIO\networkPublishedVariables\valuesRead2 \\192.168.2.4\networkPublishedVariables\valuesRead2
Patrick, what version of LabVIEW are you using? Here is a snippet where I was able to get both setups that I believe you are describing to work without issue on LabVIEW 2015 SP1.
I'm using LabView 2015 SP1, too.
Maybe it's the type of variant that's causing issues?
I start with an empyt variant and add all my doubles as attributes via "Set Variant Attribute", then attempt to write the resulting variant to the shared variable
I see what you mean. I was able to reproduce that on my end. Do you need to create your variant data that way? If you can do the same thing by using "to Variant" I would just do it that way, because that seems to be working.