07-19-2017 05:26 PM
Updating a working LV2013 program to LV2017.
I think this is the last kink to work out.
Code is intended for an RT box (PXI 8196) but fails to compile. The error is "Polymorphic VI cannot accept this data type" and this wire is broken.
I'm scanning the EtherCAT chassis for what modules are where. I have installed Ni Industrial Communications, v. 17.
No code changes - this code compiles (and runs) fine with LV 2013.
Here are three similar VIs. The one for MASTERS doesn't compile. Notice the broken wire trying to typecast the "child" to a master and checking for error. This is what was suggested by NI several years ago.
The others compile fine.
What has changed? Any ideas?
Blog for (mostly LabVIEW) programmers: Tips And Tricks
Solved! Go to Solution.
07-19-2017 05:31 PM
Note, I have yet to update the actual box to LVRT2017, but I don't see why that would matter at COMPILE time.
Blog for (mostly LabVIEW) programmers: Tips And Tricks
07-19-2017 06:33 PM
I don't have the appropriate software installed to try any of this myself, but could you see if it would work to switch the "to more specific class" node with a "Type cast" node, followed by a check to see if it's a valid reference?
07-20-2017 03:25 AM - edited 07-20-2017 03:27 AM
I happen to have a similar VI. I tested myself and the VI works fine in LabVIEW 2017. So I think your error may be caused by your software environment. Do you install LV / RT / CompactRIO / EtherCAT 2017?
07-20-2017 05:01 AM
could you see if it would work to switch the "to more specific class" node with a "Type cast" node, followed by a check to see if it's a valid reference?
Well, maybe, but why would i need to do that? Given that it works in LV2013, what is different in LV2017?
Blog for (mostly LabVIEW) programmers: Tips And Tricks
07-20-2017 05:08 AM
I think your error may be caused by your software environment.
--- Since I've just updated to LV2017, on a new Virtual Machine, that's likely.
Do you install LV / RT / CompactRIO / EtherCAT 2017?
I installed LV2017 and LVRT 2017, with Industrial Communications v. 17. I did not install any cRIO-specific stuff, I'm working with PXI.
If I was missing some EtherCAT stuff, it seems like it would complain about the conversion of SLAVES and MODULES also, not just the MASTER.
Blog for (mostly LabVIEW) programmers: Tips And Tricks
07-20-2017 06:48 AM - edited 07-20-2017 06:49 AM
Oh dear, more mystery compiler gremlins in LV2017.
The error fixes itself, if I click on the REFERENCE and ctrl-drag it.
JING:<https://screencast.com/t/WigBU1uC>
If I REVERT the file, the error comes back.
What the heck?
Blog for (mostly LabVIEW) programmers: Tips And Tricks
07-20-2017 07:04 AM
Here's the VI, if anyone is interested.
with no project open, I can load this VI and it's broken.
If I Drag the ECAT MASTER reference around, nothing changes.
If I CTRL_Drag it, the wire heals itself.
Blog for (mostly LabVIEW) programmers: Tips And Tricks
07-20-2017 07:22 AM
It doesn't have to be the ECAT MASTER constant - if I CTRL-drag ANYTHING on the diagram, the wire heals itself.
Blog for (mostly LabVIEW) programmers: Tips And Tricks
07-20-2017 09:37 PM
Interesting. I'm able to reproduce on my side. I suddenly remembered that I saw a similar problem years ago. I had a very old VI and there was an enum constant. The enum constant contained two elements: A and B. If A was specified, B would take into effect and vice versa. If I created a new constant for this enum, the problem just disappeared. I pinged the support and they told me that the VI was corrupted internally on the enum constant. The reasons are complex. One of the possible reasons is bad sectors of the hard disk and I never see similar problems later.