Integrating KollMorgen AKD Basic motor drive using TCP/IP protocol in LabVIEW

StackOverflow https://stackoverflow.com/questions/21144769

  •  28-09-2022
  •  | 
  •  

سؤال

Myself and my team are new to Kollmorgen AKD Basic motor drive and are working with this drive for the first time using TCP/IP protocol interface with LabVIEW.

We could write/set various variables succesfully but are facing an issue while reading settings and variables from the drive. Problem we are facing is because we are not getting exact number of bytes to read from Kollmorgen AKD Basic drive for a particular command. Actual number of bytes written and returned back by Kollmorgen AKD Basic drive is different than what is documented. e.g. As per Kollmorgen AKD Basic drive documentation, read request to read value stored in USER.INT6 variable should write back a DWORD or 4 Octates. If USER.INT6 variable contains value of 1, then I am getting value of '{CR}{LF}--' when I read 4 bytes. If I try to read 8 bytes, then I get '{CR}{LF}-->1{CR}{LF}' Where {CR} is 'carriage return' character and {LF} is 'line feed' character. If USER.INT1 contains value of 100, then I am getting value of '{CR}{LF}-->100'on reading 8 bytes. And so if USER.INT6 contains value of 1000, then I have to read 9 bytes.

This is happening to all other variables as well. Real problem is I don't know at run-time exactly what value a variable would have and to get complete value how many bytes I need to read. I am sure I am not the first to face this issue, and there would be a way to overcome it. So seeking help of seasoned experts. Please let me know.

Thanks and Regards,

Sandeep

هل كانت مفيدة؟

المحلول 2

I would suggest altering the TCP/IP read mode from standard to CRLF, I have a feeling that your device terminates the messages with a CRLF string. If you insert a large enough number of bytes to read (eg. 20), it will try to read all those bytes or until it receives the CRLF combo.
Drag&Drop snippet
Could you alter the display to HEX, I have a feeling that your --> actually are the number of bytes in the response.
It would help if you post your code!

نصائح أخرى

I have no experience with that particular device, but in general, if it doesn't return a known number of bytes, then you're basically down to reading one byte at a time until you see the terminator.

In the specific case of CRLF, you can configure the TCP Read primitive to use a terminated mode using the mode input, so I believe that should work in your case, but I never tried it myself.

From a quick glance at the Kollmorgan site looks like this drive uses Modbus TCP/IP. I suggest using the LabVIEW Modbus Library http://sine.ni.com/nips/cds/view/p/lang/en/nid/201711

Check out Modbus on Wiki to learn the specs http://en.wikipedia.org/wiki/Modbus

You can get the support for this from Kollmorgen itself. They have Application Engineers based in Pune.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top