10-23-2007 04:58 AM
10-23-2007 09:38 AM
Hi,
If you get the 0xBFF62017 eror this has only one reason, you created a PDO with the same ID twice.here are some rules about PDO handles with the CANopen Library:
1. The CANopen Library uses the NI-CAN driver underneath and therefore it uses objects whenever it needs to transmit periodically or to receive a specific ID.
2. If you create a non periodic Rx PDO (period=0) there is no need to close the PDO handle. (close gets ignored)
3. If you create a periodic Rx PDO (period >0) or a Tx PDO you need to close the PDO handle, if you need to get rid of the handle. (CANopen close.vi for the PDO handle, before you open a PDO with the same COB ID. (PDO type +node ID)
4. You can create a maximum of 49 objects per device. If you use a two port board and both ports, you can share 48 objects for both ports and between all functions of the CANopen Library. (one object is allways used for the Interface create function.)
5. If you do not create PDOs periodically and you do not exceed the maximum objects you can call the CANopen Close VI ones for the Interface handle. This will stop and close all objects created before as well.
7. If you are unsure how many objects you have created already, use the NI-SPY Tool to log the API calls for your code. It shows every single object created as follows:
ncConfig ("CAN0::STD0x202", 9, {0x8000000F,0x80000013,...}, {0x00000064,0x00000000,...})
ncOpenObject ("CAN0::STD0x202", 87949556)
See the attached VI for an example of how to create a PDO dynamically and close the handle, to create another one with the sme COB ID.
10-23-2007 04:28 PM
Thanks for the information.
I am still using Labview 7.1.1, so I was not able to open attached file.
I downloaded the latest version of NI-CAN and will upgrade from 2.5.0 to 2.5.2. This may not solve the problem but you never know... ![]()
I checked the "create PDO" function with probing both error cluster and node-id passed to it. I saw no PDO created twice for same ID at application start.
The error always occurs when creating a TxPDO never for a RxPDO in different Vis.
It is not always for the same node. I use one non-periodical RxPDO and one non-periodical TxPDO to get access to ControlWord and StatusWord of motor drives as defined in the DS402.
Whenever I create a PDO in the Vi, I take care of deleting it after use and before leaving the subvi.
Is it possible that the board does not free immediatly the PDO handle or communication object ? According to me, that would explain the "multiple CAN object" error.
Do you recommand to create all PDOs at application start ( up to 49 maximum ) instead ?
Is it possible to call PDO functions in Vis running parallel ?
I will continue investigation using NI-SPY and probing the "create PDO" function with a pause in case of error.
10-24-2007 09:43 AM
Creating 49 objects is not recommended because it has a big performance impact on the NI-CAN driver. In fact it is recommended to use only a few objects at a time.
I thing creating them dynamically should be fine. If you could make your Spy log file with the error in it and the complete configuration, you should find the problem easily.
Yes you can use parallel loops but you have to be careful with creation and close.
Attached you find the 7.1 version for the VI.
DirkW