12-28-2019 03:19 PM
hello,
l am a student in Germany and l want to write code with SMCI-36 controller in LabVIEW by using CompactRIO but actually l do not know how can l learn to write it? l want to control the time and the speed of stepper motor. What should be my steps? If anyone could help me. l would be very appreciated.
By the way : My stepper motor name is linearaktuator L2818L0604-T5X5"
thank you
Solved! Go to Solution.
12-30-2019 04:24 AM - edited 12-30-2019 04:27 AM
Well that controller has an RS-485 interface and seems to be controllable through a proprietary protocol or CANOpen over this connection.
So the first thing would be to make sure you have an RS-485 port on the CompactRIO side. Some have one build in otherwise you would need to purchase a NI-9871 module.
Next step is building the correct cable with proper termination resistors. The Technical Manual to your controller should give you the necessary info for that.
And then you can start digging in the Programming Manual to see what strings you need to send through the RS-485 port to do what you want. You could also use CANOpen but if you haven’t used CANOpen in LabVIEW before it definitely won’t be easier than using the native RS-485 command interface.
For development of a LabVIEW driver I would personally choose to buy a galvanic isolated USB to RS-485 converter (read the note in the doc to the controller about this!) to connect to my development PC first and do the basic development there. Then once you have a working driver library you can start developing on the CompactRIO.
01-13-2020 04:53 PM
Dear Rolf,
Thank you for your reply.
l've been trying to learn how to write correct code in labview for 2 months. l think my answer is in the datasheet but l could not find it. As you said, l would like to use CANopen as a protocol and RS485 cable but after when l make a connection between RIO and PC and then l do not know which string and graph l need in labview. For example, Could make an example to control clockwise-anticlockwise rotation in LabVIEW for RIO-9024. l sure that in this way, l am going to understand some important things. It is my first embedded project that is why it is really hard for me.
thanks
hakan
01-14-2020 01:54 AM
Hi hakan,
@hakandemir wrote:
l think my answer is in the datasheet but l could not find it.
Nanotec has a nice website. On this website you find your SMCI36 controller. In the technical documents you find a manual…
In this manual both RS485 and CAN are mentioned, with notes to find more information in other documents. Call Nanotec for those other documents!
@hakandemir wrote:
It is my first embedded project that is why it is really hard for me.
You really should go through the Training material offered by NI to learn RIO basics. Then you should start with an easier project than communication with an external controller using CANopen…
(That SMCI36 also offers digital and analog IO: for simple requirements it could be sufficient to control your motor using these IO pins.)