From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

Industrial Communications

cancel
Showing results for 
Search instead for 
Did you mean: 

CANopen error communication between one master two slave nodes (error -2147136878)

Good Morning,

I have the following problem:

I am triing to connect a canpopen ni PCI-5831 (Master) with two slave nodes (node 1 and 2).

Using the application.vi from NI-Industrial Communications for CANopen 1.0.3 I can communicate to slave 1 and 2 separately.

I addapted the code to communicate with the two nodes, but only communicates with one, In the second I have an error (CanOpen  RPDO Create.vi:1390002) .

I am sending the file attatched.

Could any one help me please?

Thanks 

 

 

0 Kudos
Message 1 of 5
(5,840 Views)

Hello,

 

Taking a brief look at the code, it looks like you have an CANOpen Interface Close before the CANOpen RPDO Create, which causes the reference to the interface to close out, which would then cause the error -2147136878, which indicates that the "The object handle passed in is not valid. Ensure you use a correct object handle returned from the CANopen VIs and make sure the object is not closed."  I recommend closing the reference out at the end of the code, after the communication with the second device.

Matt S.
Industrial Communications Product Support Engineer
National Instruments
0 Kudos
Message 2 of 5
(5,831 Views)

Hi!

 

Sorry for reopen this topic, but could you solve it?

 

I have the same error, but I have all the close TPDOs, RPDOs and Close Interface at the end of the code. Only one node closes perfectly, the rest ( 3 nodes more) has error -2147136878.

I don't understand why.

 

ThanksCat Happy

0 Kudos
Message 3 of 5
(5,268 Views)

Hi Maria,

 

I recommend showing an image of the code or posting the code so I can take a look.  This error typically involves attempting to use an invalid reference, so I would need to see where the invalid reference is being handled.

 

Thanks!

 

Matt S.
Industrial Communications Product Support Engineer
National Instruments
0 Kudos
Message 4 of 5
(5,263 Views)

Hi Maria,

Did you create a Batch SDO for each one of the nodes?

Did you edit the Batch SDO for each one of the nodes?

Did you deploy all the batch sdo files before running the vi?

 

Best Regards,

 

Valter

0 Kudos
Message 5 of 5
(5,249 Views)