08-21-2025 12:22 AM
I am in the process of migrating our LabView software to a new NI hardware system. Previously, we used a PXI-8464 in a PXI-1036 chassis and LabView 2018. I'm not sure of the exact driver, but it looks to be CANopen VI driver (note that I did not set up the original system). The new system is a PXI-8531 in a PXIe-1083 chassis, and I am using LabView 2024 Q3 (32-bit) and the NI-Industrial Communications driver (2024 Q2). I have been updating the LabView code to new VI's using the equivalents specified here.
My problem is that I get an error when trying to create the interface. I can see the card in MAX and it is named "CANopen01". However, when I use CANopen Interface Create.vi to create the interface, I get error −2147136892: The CANopen hardware cannot be found. Ensure the CANopen hardware is correctly installed. Ensure you use the correct port name. You can get your device port name(s) in MAX.
The relevant part of the block diagram is here and this is where the error is generated:
This section of the block diagram grabs the card name ("CANopen01") and removes everything except the "01" at the end. This becomes the numerical value "1" (rather than 01). This is then the "interface name" input into the VI.
Any ideas of what might be wrong here?
08-21-2025 07:48 PM
I don't have the NI-CANOpen driver installed but since the Create Interface VI is accepting an enum input, by any chance CANOpen01 has a value of 0? Can you try to add a Minus 1 node after the Scan Value?
08-24-2025 06:05 PM
I tried it, but it still fails, this time with error -2147136858: The property value or the parameter value is not valid. Ensure the property value or the parameter value is in the valid range.
So I am pretty sure that the intent is for the cards to be numbered from 01, since this the documentation states:
interface name specifies the name of an interface that you want to create. The name of an interface must be CANopenXX, where XX is the interface number. The maximum interface number is 32.
The screenshot from MAX shows the card name clearly:
08-24-2025 11:34 PM
I think I have now solved the problem. What was not obvious to me from the documentation is that the input parameters are strict typedefs, rather than numerical values. This is different from the old way of doing it, which threw me off, since I have been updating existing code with seemingly like-for-like replacement VIs.
Here's what works:
It grabs the card name automatically (if you only have one card), and you can set the baud rate from the front panel.