Hi, I have a Trinamic PD42-4-1140 stepper motor which I am trying to control with my cRIO 9066 using a NI 9871 serial module (RS 485 connection). I have been unable to achieve any control at all so far. I have attached an image of the VI I built, a basic state machine to send different commands to the motor. I am able to compile the VI successfully but the motor does not move at all. I would appreciate any help at all in this regard. Thanks.
Solved! Go to Solution.
Looking at the manual that I found for your motor, it looks like it uses a 2-wire RS 485 connection, whereas the NI-9871 has RJ-50 pins. What are you using to connect to these?
Have you taken a look at the requirements for the 2-wire configuration?
Also, how are you terminating the bus? According to the motor's manual, you can't have floating bus lines.
I used a RJ50 cable to connect the motor to the 9871 module. I wired the motor's RS 485+ to TXD+ and RXD+ on the 9871, and RS 485- to TXD- and RXD-, as suggested in "Pins Used for 2- and 4- Wire Transmission with RS-485".
I know that the manual asks for a 120 ohm resistor, but I thought this was only for multiple devices. I have only the one motor that I am trying to control. Do you think I should add the resistor?
Can you post some info about the command structure?
Is the checksum calculation correct, does it give any response at all to your commands?
Can you communicate with it from windows with hyperterminal or anything like that?
I took a look at the code but I cant tell anything from it without knowing what the drive expects.
This is what the firmware manual for the motor says, which is what I have tried in the VI.
The binary command format for R485 is as follows:
|1||Motor or Bank number|
|4||Value (MSB first!)|
The checksum is correct. I have attached the manual and an image of the front panel. The FPGA led is also flashing so I am sure the VI is executing properly.
The RTS line might be an issue:
6.3 Using the RS485 Interface With most RS485 converters that can be attached to the COM port of a PC the data direction is controlled by the RTS pin of the COM port. Please note that this will only work with Windows 2000, Windows XP or Windows NT4, not with Windows 95, Windows 98 or Windows ME (due to a bug in these operating systems). Another problem is that Windows 2000/XP/NT4 switches the direction back to receive too late. To overcome this problem, set the telegram pause time (global parameter #75) of the module to 15 (or more if needed) by issuing an SGP 75, 0, 15 command in direct mode. The parameter will automatically be stored in the configuration EEPROM.
You can change the flow control and tranceiver mode programmatically though a property node.
Worth a look.
Just to add, yes there is a property node for VISA from PC/RT but there is a property node of the module too on FPGA - its a property of the module if I remember correctly.
I dont have FPGA on this PC but if you cant find it let me know. I will look it up on my machine at work.
I assume you are speaking about the properties of the module in the project tree, which I found. I can't find a telegram pause time on there, or any of the other stuff you mentioned. I have attached an image of the properties window as it is currently set.
I am going to attempt changing the Flow control to Software controlled and see what happens.
Were you able to find the flow control and tranceiver mode using a property node in your LabVIEW code that deceased mentioned? If so, can you post a screenshot of your setup? Or post your code?