06-25-2015 08:14 AM
I have a scripting function that is suppose to create a constant (think type cast or variant to data) from a provided sink. It then connects that constant to a designated terminal.
I'm getting this error when I try to grab the terminal of the object that I just created. (just before the error dialog that I placed)
I've tried a handful of things and I have an assumption at the moment. LabVIEW handed me a constant with a control reference.
More specific errors out when I try to turn it into a constant. Guess that makes sense since it's not moving up or down the tree.
Did I use the "Create from Data Type" incorrectly? Is there a way to force the reference to still point at the object but be recognized as a constant?
Thanks,
Solved! Go to Solution.
06-25-2015 09:40 AM
Doh, LabVIEW 2013
06-25-2015 12:54 PM
Ok, I have a solution, but I'm not sure if it's correct, or robust.
More Generic to GObject
then
More Specific to Constant
So it works, but I'm not sure if the "Create from Data Type" method will suddenly create a control and throw my code into errors again.
I still think it's a little odd that it comes out as a Control when it could be a constant. Should this be a GObject reference?
06-25-2015 02:10 PM
This is a known bug with the Create from Data Type method. The prescribed workaround is exactly what you have done...cast the control reference to GObject, then cast that reference to Constant.
06-25-2015 02:58 PM - edited 06-25-2015 03:00 PM
@Darren wrote:
This is a known bug with the Create from Data Type method. The prescribed workaround is exactly what you have done...cast the control reference to GObject, then cast that reference to Constant.
While we're on the topic, is it also known that the "Create from Data Type" method crashes my LabVIEW when done on a data variant from a TypeDef Enum control terminal?
(my searching is coming up blank... is there a place to search these?)
Thanks in advance
06-25-2015 04:06 PM
I'm not aware of that issue. I recommend starting a new thread on the NI Forums giving steps to reproduce the crash, so one of the AEs can file a bug report.