LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

EtherCAT trouble converting from LV2013 to LV2017

Solved!
Go to solution

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? 

 

Screen Shot 2017-07-19 at 6.15.14 PM.png

Steve Bird
Culverson Software - Elegant software that is a pleasure to use.
Culverson.com


Blog for (mostly LabVIEW) programmers: Tips And Tricks

0 Kudos
Message 1 of 12
(3,825 Views)

Note, I have yet to update the actual box to LVRT2017, but I don't see why that would matter at COMPILE time.

Steve Bird
Culverson Software - Elegant software that is a pleasure to use.
Culverson.com


Blog for (mostly LabVIEW) programmers: Tips And Tricks

0 Kudos
Message 2 of 12
(3,820 Views)

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?

0 Kudos
Message 3 of 12
(3,795 Views)

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?

Capture.PNG

0 Kudos
Message 4 of 12
(3,755 Views)

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?

Steve Bird
Culverson Software - Elegant software that is a pleasure to use.
Culverson.com


Blog for (mostly LabVIEW) programmers: Tips And Tricks

0 Kudos
Message 5 of 12
(3,745 Views)

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.

Steve Bird
Culverson Software - Elegant software that is a pleasure to use.
Culverson.com


Blog for (mostly LabVIEW) programmers: Tips And Tricks

0 Kudos
Message 6 of 12
(3,744 Views)
Solution
Accepted by topic author CoastalMaineBird

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?

Steve Bird
Culverson Software - Elegant software that is a pleasure to use.
Culverson.com


Blog for (mostly LabVIEW) programmers: Tips And Tricks

Message 7 of 12
(3,737 Views)

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.

Steve Bird
Culverson Software - Elegant software that is a pleasure to use.
Culverson.com


Blog for (mostly LabVIEW) programmers: Tips And Tricks

0 Kudos
Message 8 of 12
(3,730 Views)

It doesn't have to be the ECAT MASTER constant - if I CTRL-drag ANYTHING on the diagram, the wire heals itself.

Steve Bird
Culverson Software - Elegant software that is a pleasure to use.
Culverson.com


Blog for (mostly LabVIEW) programmers: Tips And Tricks

Message 9 of 12
(3,725 Views)

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.

0 Kudos
Message 10 of 12
(3,704 Views)