03-18-2025 04:26 AM
Hi Michael,
@Michael_Smith wrote:
Dear,
- myRIO
- RS485
- USB to Serial Connector
- Because I've to rotate a something which is time critical and requires accuracy aswell
In general the FPGA has no connection to USB or LAN port of your myRIO.
Please define "time critical" and why you don't want to handle this in the RT (=Realtime) part of your myRIO! Here you can access the RS485 port (more) easily…
03-18-2025 10:35 AM - edited 03-18-2025 10:38 AM
@Michael_Smith wrote:Dear,
- myRIO
- RS485
- USB to Serial Connector
- Because I've to rotate a something which is time critical and requires accuracy aswell
You talk over RS-485, a serial port electrical interface, typically talking at maybe 38.4 kBaud, but almost certainly never more than 115.2 kBaud. Sending a Modbus command and receiving its answer will typically be in the milli-second range, so FPGA really won't add much of an advantage. But implementing Modbus on FPGA is going to cost you A LOT of development effort. For one you wouldn't be able to use your USB to RS-485at all from the FPGA. There is no way to get that handled from your FPGA code, as FPGA has no access to serial ports, except if you would use a NI-9871 C series module. Still, implementing the Modbus protocol on FPGA is even then a major development effort that will be hard to justify, even if you are a student, whose hours "cost" nothing. It would cost even more effort if you use a generic digital IO C series module and have to handle the bit level protocol too yourself.
03-19-2025 04:14 AM
@GerdW wrote:
Hi Michael,
In general the FPGA has no connection to USB or LAN port of your myRIO.
Please define "time critical" and why you don't want to handle this in the RT (=Realtime) part of your myRIO! Here you can access the RS485 port (more) easily…
Hello Gerd,
By time critical I mean, I've to point my flashlight mounted on servo motor instantaneously to certain degrees. Changes won't be abrupt but achieving a accurate postion is the key.
Btw I've these parameters.
03-19-2025 04:16 AM
Hello Rolfk,
I've these parameters and provisions to work with. I understand it's difficult to implement on FPGA but I'm confused when I will access it from RT then how do I start with?
@rolfk wrote:
@Michael_Smith wrote:Dear,
- myRIO
- RS485
- USB to Serial Connector
- Because I've to rotate a something which is time critical and requires accuracy aswell
You talk over RS-485, a serial port electrical interface, typically talking at maybe 38.4 kBaud, but almost certainly never more than 115.2 kBaud. Sending a Modbus command and receiving its answer will typically be in the milli-second range, so FPGA really won't add much of an advantage. But implementing Modbus on FPGA is going to cost you A LOT of development effort. For one you wouldn't be able to use your USB to RS-485at all from the FPGA. There is no way to get that handled from your FPGA code, as FPGA has no access to serial ports, except if you would use a NI-9871 C series module. Still, implementing the Modbus protocol on FPGA is even then a major development effort that will be hard to justify, even if you are a student, whose hours "cost" nothing. It would cost even more effort if you use a generic digital IO C series module and have to handle the bit level protocol too yourself.
03-19-2025 04:29 AM
Hi Michael,
@Michael_Smith wrote:
By time critical I mean, I've to point my flashlight mounted on servo motor instantaneously to certain degrees. Changes won't be abrupt but achieving a accurate postion is the key.
The ServoDrive will handle the positioning (accuracy and timing), so you don't need any of this inside a FPGA!
@Michael_Smith wrote:when I will access it from RT then how do I start with
You need to follow your ServoDrive manual with all needed settings to initialize the drive and set/command the required movements…
(Use the Modbus library on your RT target, it will do the communication stuff.)
03-19-2025 04:35 AM
@GerdW wrote:
@Michael_Smith wrote:when I will access it from RT then how do I start with
You need to follow your ServoDrive manual with all needed settings to initialize the drive and set/command the required movements…
(Use the Modbus library on your RT target, it will do the communication stuff.)
And most importantly, you can simply use the NI Modbus library mentioned by ZYong in the 3rd post in this thread. It can have its tricky aspects to use, but believe me trying to implement your own Modbus library in LabVIEW through VISA and even more so in FPGA, is going to be hyper-exponentially more tricky.
03-19-2025 04:38 AM
@rolfk wrote:
@GerdW wrote:
@Michael_Smith wrote:when I will access it from RT then how do I start with
You need to follow your ServoDrive manual with all needed settings to initialize the drive and set/command the required movements…
(Use the Modbus library on your RT target, it will do the communication stuff.)
And most importantly, you can simply use the NI Modbus library mentioned by ZYong in the 3rd post in this thread. It can have its tricky aspects to use, but believe me trying to implement your own Modbus library in LabVIEW through VISA and even more so in FPGA, is going to be hyper-exponentially more tricky.
And what about the hardware aspect. I still connect it via USB to Serial?
03-19-2025 04:53 AM - edited 03-19-2025 04:56 AM
@Michael_Smith wrote:
@rolfk wrote:
@GerdW wrote:
@Michael_Smith wrote:when I will access it from RT then how do I start with
You need to follow your ServoDrive manual with all needed settings to initialize the drive and set/command the required movements…
(Use the Modbus library on your RT target, it will do the communication stuff.)
And most importantly, you can simply use the NI Modbus library mentioned by ZYong in the 3rd post in this thread. It can have its tricky aspects to use, but believe me trying to implement your own Modbus library in LabVIEW through VISA and even more so in FPGA, is going to be hyper-exponentially more tricky.
And what about the hardware aspect. I still connect it via USB to Serial?
Yes! Unless you want to buy a NI-9871 module (and have a free slot in the cRIO chassis) or have a cRIO chassis with an actual RS-485/422 port already build in (such as the cRIO-9066 for instance).
Since you use the myRIO, another option might be to interface to one of the build in UARTs on the MXP-A or MXP-B connectors. But you would have to do some TTL to RS-485 translation, for instance with something like this: https://www.otronic.nl/nl/max485-ttl-to-rs485-converter-module.html
Or you can implement your own circuit using a MAX485 or similar chip on the according MXP breadboard that your myRIO should have come with.
03-20-2025 04:08 AM
@rolfk wrote:
@Michael_Smith wrote:
@rolfk wrote:
@GerdW wrote:
@Michael_Smith wrote:when I will access it from RT then how do I start with
You need to follow your ServoDrive manual with all needed settings to initialize the drive and set/command the required movements…
(Use the Modbus library on your RT target, it will do the communication stuff.)
And most importantly, you can simply use the NI Modbus library mentioned by ZYong in the 3rd post in this thread. It can have its tricky aspects to use, but believe me trying to implement your own Modbus library in LabVIEW through VISA and even more so in FPGA, is going to be hyper-exponentially more tricky.
And what about the hardware aspect. I still connect it via USB to Serial?
Yes! Unless you want to buy a NI-9871 module (and have a free slot in the cRIO chassis) or have a cRIO chassis with an actual RS-485/422 port already build in (such as the cRIO-9066 for instance).
Since you use the myRIO, another option might be to interface to one of the build in UARTs on the MXP-A or MXP-B connectors. But you would have to do some TTL to RS-485 translation, for instance with something like this: https://www.otronic.nl/nl/max485-ttl-to-rs485-converter-module.html
Or you can implement your own circuit using a MAX485 or similar chip on the according MXP breadboard that your myRIO should have come with.
I mean what software programming scheme I should follow, If I implement this Hardware Hierarchy?
03-20-2025 04:54 AM
@Michael_Smith wrote:
I mean what software programming scheme I should follow, If I implement this Hardware Hierarchy?
You really keep changing the specifications on a whim!
First you talk about controlling the Modbus directly from the FPGA on the myRIO because you are concerned about latency.
Suddenly you want to connect the Modbus to the PC instead. That is quite a fundamental change in specifications. And poses the additional question what you want to use the myRIO for.