LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

"Invalid error code" when creating a shared variable from custom data type

Solved!
Go to solution

I am trying to create a shared variable with a data type of 2d array of double. I created a custom control containing a 2d array with numeric type to do this. From Distributed System Manager  v12 I select 'add a variable', then select 'from custom control'. Once selecting my control I receive the following error: "Invalid data type. Would you like to select another data type". Any advice as to why this is not working? Thanks.

0 Kudos
Message 1 of 7
(3,427 Views)
Solution
Accepted by topic author amazinjon

This seems to be recorded in CAR#405941.  The whole thing is a bit strange but I will try to go over the potential workarounds as best as I can.  I tested a lot of these myself and here is what I found.

 

1. Make sure the custom control you have made was created in LabVIEW 2012 or you save it to a previous version.  If you save it to a previous version you might also need to open the .ctl in LabVIEW 2012 and resave it (I needed to do this).  I tried creating my own control in 2012 as well as saving the control to a previous version, both worked but I did not end up with the same result (I don't understand this but I wanted to mention it so that you knew).

 

2. It seems that you are able to make the shared variable programmatically by modifying the community example to fit your needs.  If you do not need to create many variables this may be the best option if it works for you.

 

I would also try adding the variable from the LabVIEW project you are working on.  This was not a direct troubleshooting step but there are multiple ways to do things in LabVIEW and sometimes one of them works while the other does not.

 

Edit: Community Example is here https://decibel.ni.com/content/docs/DOC-16863

Matt J | National Instruments | CLA
0 Kudos
Message 2 of 7
(3,408 Views)
Functional Global Variables don't have "invalid error code" problems -- just saying'...

Mike...

Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
0 Kudos
Message 3 of 7
(3,397 Views)

If you are creating a SV in DSM it has to be network-published.  Can you use an FGV in the same way?

 

If so how because I think that would be a good thing to know.

Matt J | National Instruments | CLA
0 Kudos
Message 4 of 7
(3,388 Views)
Yes, you can. Use VI Server to access it. Very, simple, very stable. No separate engine to deploy.

Write to the global from one side, read from it on the other side.

Mike...

Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
0 Kudos
Message 5 of 7
(3,371 Views)

Thanks Jacobson. Different versions was the problem. I was confused as why this error was happening because it was working in a different scenario. Turns out the PC I previously was doing this on had Labview 2010, I copied the customized 2D array from this PC and was trying to create the variable on another PC that has Labview 2012. I simply made a new custom control in v12 and all works fine now.

 

In response to mikeporter, the variable is shared across multiple platforms, ie. Labview, .Net, etc..., is this something you can accomplish with an FGV. You will have to excuse my ignorance, I am very much a Labview novice.

0 Kudos
Message 6 of 7
(3,342 Views)
I have never tried it specifically with a .net assembly, but if the software was created with LabVIEW and the execution environmrnt supports VI server the answer is yes.

Mike...

Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
0 Kudos
Message 7 of 7
(3,327 Views)