dahnuguy Posted December 27, 2010 Report Share Posted December 27, 2010 I am using a V350 to send and receive data from 2 can nodes for the purpose of I/O expansion. If the unitronics expanded I/O were more compact, this would never have started. The Unitronics I/O could be like the Beckoff terminal modules. That would be nice, but anyway............ I can send 8bytes of data with one PDO. I am sending a speed reference to 2 motors for differential steering with two drive wheels. (time sensitive data) If I change the data during the same scan as I want to send the data over canopen, the data is "zero". (This is confirmed and discussed with Emil, this is not speculation. I spent a long time nailing that down. The issue is the fact that the canopen PDO contains a pointer to the data and does not grab the data and put the data in a buffer to send, it only has a pointer to the data. And if you are writing to that memory location when the canopen PDO is actually sent, the data is not available and a zero is sent instead. The canopen PDO is not completed at the time the command is called in the ladder, the actual send happens sometime during the scan, somewhat independent of the ladder.) So I must not update the data on the scan that I send the data. So now my data update is every other scan. I also must send other data in other PDOs. So currently, I have a bit that allows sending can messages every other scan and then only allows updating the data on the off scan. Then I send PDO1 , scan update data, send PDO2, scan update data, send PDO3, scan update data, repeat................With a scan time of 10msec, it takes a relatively long time to get back around to the speed reference in PDO1. By the time the data is refreshed it is too late to work properly. There are other issues that contribute to the problem, but this is the canopen Unitronics portion of the issue. Questions: Is the canbus buffer 8 bytes total, or 8 bytes per PDO? Is there a separate buffer for each PDO? I think there might be separate buffers, but I am not sure. Can I write all the PDOs in one scan ? This would send for example 8 x 5 bytes total, but with 5 different PDOs. If this is possible I only have the issue of not being able to send the data every scan, but this is still much better. So I hope I will be able to send all PDOs to both nodes on every other scan. I would prefer to be able to send on every scan. When I get some time to return to this hardware, I will see if I can move the PDO send section to the last Subroutine or try to find some way to make it more solid. I remember something about some of the canopen blocks must be in the main, but I think the PDOs can be sent from a SUB. I haven't looked at this in awhile, and it is coming up soon. I will revisit the software, but I wanted to get a head start on some feedback on these issues as I begin. Thanks, Quote Link to comment Share on other sites More sharing options...
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.