LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Unidrive SP PDO Communication

Hello,

 

I am currently working on controlling through Labview and CanOpen a testrig that includes a Control Techniques Drive, so it can act as a vehicle emulator. So far I've been able to do it through SDO, however I would like to do it through PDO. If I configure manually PDO1, I can read values stored in the drive without a problem, however when it comes to write I don't get any error but I also don't get any response. As I go through the CT CanOpen manual, there seems to be a gap in how to do the mapping for the different PDOs, and how to access the specific menu and parameter. I've also been unable to do the mappings through SDO for the other PDOs. I'm attaching what I've been working on so far, and I hope you can point me in the right direction. Probably I'm not making myself clear, so if you need any other information let me know.

 

Enrico

Download All
0 Kudos
Message 1 of 16
(5,076 Views)

Hello Enrico,

 

Which version of LabVIEW are you using?

What hardware instrument are you using to communicate with your drive?

 

I have looked at the attached VIs, however it seems that certain SubVI's are missing from the ZIP file for the PDO Write.  As you are receiving no error when running the VI, then your programming must be in the right direction.  As there is a SubVI missing, I am not entirely sure what the data packets look like that you are trying to write to the drive.  It may be that the data packet contains data, but is not enabling the drive to do anything.  Frames for PDO contain a Control bit.  If this is set to zero, it could mean that the remain bits of data are being ignored.  Can you check whether this is the issue?

 

At this point, I would also like to point out that a specific CAN section exists on the forums that is monitored by enthusiasts and users of that field.  In the future, you may wish to consider using that section for a noticebly quicker reply on the topic.

 

Regards,

George T.
Senior Applications Engineer
National Instruments UK and Ireland
0 Kudos
Message 2 of 16
(5,017 Views)

Hey George,

 

Thanks for your reply. I'm currently using LabVIEW version 8.5.

To communicate with the drive I'm using CANopen, NI-PCI-CAN Software version 1.1.1

 

I have attached now the SubVI's that were missing, I apologize for that. As for the control bit, there is a parameter in the drive that controls the motor 6.43, called 'control word enable' that sets that specific bit to 1. I've done it before the PDO configuration, but I still have the same issue, unless it has to be set at another point.

 

To make things a bit easier, I'm attaching a slight modified version of the Analogue Output VI, that's found in the CANopen examples folder. In the drive, there are 4 PDOs, each with 4 TxPDO and 4 RxPDO channels. The first PDO can be configured directly from the drive, and that's how I've been able to read parameteres. However, when it comes to write, that's when the problem comes. With this VI, the first RxPDO channel is configured to set the speed of the motor (directly configured in the drive), but I'm not getting any response.

 

Thanks again,

 

Enrico 

Download All
0 Kudos
Message 3 of 16
(5,002 Views)

Enrico,

 

What is the address number of your drive?  I haven't used CAN with CT drives before, but I have done serial communication using their ANSI protocol, so I don't know if CAN uses the slave address also.  I had started with a Commander SE and setup my LabVIEW drivers and got them working just fine.  When we got a Unidrive SP, the same drivers worked, except I had one problem to work around.  If I remember correctly, I couldn't get a response when my drive was set to the default value of 1.  But when I changed it to another address (11 in my case), I was able to get a response.  I have no idea whether my issue was a programming problem or a quirk of the drive.  I suspect a quirk of the drive, but once I got it working, I didn't go any deeper in trying to figure it out.

 

This may or may not help you.  But it was such an odd thing and really non-intuitive thing, that maybe you are having the same issue.

0 Kudos
Message 4 of 16
(4,997 Views)

RF,

 

Thanks for sharing that! Unfortunately that's not the case here. I'm guessing that you're talking about the Node Address (at least in my case or how I know it). The drive addresses are set to 60 and 61. Probably it's a matter of how I'm configuring the PDO, or something that I'm doing wrong when I'm mapping them..

 

Cheers,

 

Enrico 

0 Kudos
Message 5 of 16
(4,991 Views)

In my manual, the parameter I was talking about is called serial address at menu 11.23.  I am using the RS-485 serial communication with ANSI protocol.  The terminology for CAN is probably different and may be under its own set of menu parameters.

 

I was hoping your problem would be as simple but impossible to figure out as mine was.

 

Good luck with solving it.  And please report back with the solution once you are able to figure it out.

Message Edited by Ravens Fan on 07-23-2009 11:13 AM
0 Kudos
Message 6 of 16
(4,989 Views)

I'm working on controlling a unidrive sp through labview 10. I can use the software supplied from control techniques to read and set parameters on the drive using a serial 485 connection, both ANSI and MODBUS work. I am having a hard time understanding the protocol for either ansi or modbus so I can build labview drivers. I also had to set my drive to address 11 when using their ansi protocol.

 

Would it be possible for you to post some of your driver vi's?

Why do geeks think Halloween and Christmas occur on the same day?
Because 31oct = 25dec!
0 Kudos
Message 7 of 16
(4,384 Views)

Are you asking Enorav or me for drivers?

 

I came across the same situation with the Unidrive SP where I had to make the address 11 to get responses.  With the default address of 1, I just never seemed to get replies back from the drive. (Though I don't remember any problems with the Quantum 3 drives that use the dame protocol.) 

0 Kudos
Message 8 of 16
(4,382 Views)

I was asking you Ravens. I thought it would fit inside of this thread so I didn't want to create another. I've tried using the MODBUS drivers with the drive set up for RTU but always received a timeout error.

 

Ok, while I was replying I decided  to  try the MODBUS drivers and had sucess in reading a register. Forgive me but this is both a new instrument and new protocol for me. I've only dealt with GPIB and basic RS232 scpi commands in the past.

 

It could be a great help to have a peek at those drivers though so I can have an idea of where to continue.

 

Thanks!

Why do geeks think Halloween and Christmas occur on the same day?
Because 31oct = 25dec!
0 Kudos
Message 9 of 16
(4,375 Views)

Sure.  Let me dig those up, zip them up, and post them to the thread.

0 Kudos
Message 10 of 16
(4,373 Views)