LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

LabView CANOpen Library ("CANopen SDO Write Object"), General error (COE_SDO_GENERAL, 134217728)

Hello,

 

i'm trying to write some parameters of a frequency converter (pDrive MX Pro 4V) over the CAN-Bus.

 

The manual of the FC shows the following (in principle):

 

Writing to a parameter should look like this:

Send SDO Request (contains request code which tells the FC if i want to write or read a param, param-id's, data, ...) -> Receive SDO Response (to verify the written data)

 

Reading a paramter:

Send SDO Request (again the request code, param-id's, ...) -> Receive SDO Response with the data i ordered

 

So basically the reading and writing of a param only differ in the request code of the 1. telegram and the data.

 

The telegrams SDO Request & Response should look like the following:

http://www.ras-kas.net/Pics/sdo_fu.jpg (sorry, i can't insert the image directely...)

 

For all those operations i only have 2 VI's in the CANOpen Library: "CANopen SDO Write Object" & "CANOpen SDO Read Object". So far, so good.

 

My 1. question:

Reading params with "SDO Read Object" works so far, whereas i actually don't follow the given norm (Send Request -> Receive Response).

I only call the VI "CANopen SDO Read Object" with the corresponding parameters and get the data from it's output.

My question now is: Is the protocoll from the above picture CAN-Standard and does the VI adhere to it (internally sending the request und receiving the response)?

If not i don't fully understand, why i receive the correct data anyway because i don't/can't tell the VI the request code, which is required as seen in the image.

 

My 2. question:

When i want the write parameters of the FC i allways receive a completion code (output of the VI "CANopen SDO Write Object") with the number 134217728 ("CANopen SDO Completion Code to String.vi" tells me, that this is COE_SDO_GENERAL or "General error"). Does anyone of you have any additional information about this error?

Neither here i understand how i should send the data to the FC anyhow:

SDO Write Obejct has the following inputs:

- SDO object in, object index, object sub-index (they are all very clear and definitely correct because i can successfully read params with those)

- data:

  Should i input here the pure data (Byte 4 - 7 in the above image) or should i input the whole telegram here (Request code, object index, sub-index & 4 data-bytes)?

  The 2. guess would be kind of inconsequential because the seperate inputs for object index and sub-index wouldn't be necessary at all, but if i only input the 4 data-bytes here i don't know how i could/should place the necessary request code into the package...

 

I've allready tried both methods in many different variations but i allways get the "general error" mentioned above...

 

I would really appreciate if someone could help me any further or give me a little hint with the 2. question!

Also i'm really curious about the 1. question but it's not that important because at least it works correct...

 

Thanks

 

mik

0 Kudos
Message 1 of 7
(5,576 Views)

Hi mik,

 

are you able to use some examples of the CANopen library for your device?

Could yopu probably post your code so I can have a look on it?

 

Kind regards

Carsten

0 Kudos
Message 2 of 7
(5,528 Views)

Hi Carsten,

 

no, i wasn't able to try the examples, because none of them was actually "suitable" for the hardware i was working with (the frequency-converter).

 

I've now attached a little test-vi which shows in particular what's not working...

0 Kudos
Message 3 of 7
(5,503 Views)

Hi mik,

 

I was able to run your example without any errors, maybe this is due to the missing hardware.

Can you please post the error code and the description?

 

Kind regards

Carsten

 

0 Kudos
Message 4 of 7
(5,470 Views)

There's no error on the error-out's!

I can only see on the completion code that the writing wasn't successful (Completion-Nr. 134217728 which is COE_SDO_GENERAL, "General error").

 

Here's a screenshot of the VI after i've executed it:

 

0 Kudos
Message 5 of 7
(5,461 Views)

Hello Mik

 

I would very much be interested if you solved your problem. I try to write from a NI compact RIO 9024 to a frequency converter (Bmaxx 4432) by using the CanOPEN protocol via an EtherCAT bus but I am getting nowhere...

 

Did you directly use the CAN bus or also CAN over EtherCAT (CoE)?

 

How did you solve the addressing problem?

 

It would be nice if you had some valuable hints for me.

 

Many cheers

 

 Markus

 

0 Kudos
Message 6 of 7
(4,989 Views)

Hallo Markus,

 

I was using the CAN bus directly.

 

My problem was that the I needed to tell the VI "CANopen SDO Write Object" explicitly the size of the the data-object I wanted to write (which had been 4 bytes in my case and was quoted in the manual of the frequency inverter).

You can do this in the context-menu of the VI "CANopen Convert to Data.vi" (Select type).

 

Therefor I just needed to set this value to "Signed 16-bit integer" or wire a variable with the correct datatype to the input...

 

Cheers,

 

mike

0 Kudos
Message 7 of 7
(4,984 Views)