Modbus drivers for NF 9000 VFD

More
12 May 2018 16:10 - 12 May 2018 16:32 #110608 by Grotius
Grotius replied the topic: Modbus drivers for NF 9000 VFD
@Hi Donno,

Nice work !!

Minimalmodbuss is a nice tool used with python.
I also made a moddbus example in pymodbuss. A step higher then the minimalmodbuss.
Here you see the example of pymodbuss with a more complex i/o device, ananog in/out, digital in/out, etc. : forum.linuxcnc.org/32-documents/34462-li...or-remote-i-o-module
Feel free to upgrade your example to pymodbus.

For us next step is to write a component. That is real time playing around in linuxcnc. Just like ethercat devices.
A linuxcnc comp. file that is loaded by : loadrt modbuss_your_device
and addf.. modbuss_your_device....

I think it will be better to load it in the servo-thread.....
Then it is really going fast !!!

Take for example the thcud.comp make a copy for safety and do a compile on this exact name.
You will see you need to write some code in c....
But if you are done, you can do real time modbuss in linuxcnc.
The modbuss ladder diagram is for me too complicated to understand.

A few person's are as clever to write the code for component's in C. I think John Thornton can do this, but you can do this also.
If you have the example that works, we can build it out. We have a link made by Rodw :
linuxcnc.org/docs/html/man/man9/hostmot2.9.html
I never looked at this link before. But i will read it coming time.
Last Edit: 12 May 2018 16:32 by Grotius.
More
13 May 2018 04:32 #110642 by rodw
rodw replied the topic: Modbus drivers for NF 9000 VFD

Grotius wrote: A few person's are as clever to write the code for component's in C. I think John Thornton can do this, but you can do this also.
If you have the example that works, we can build it out. We have a link made by Rodw :
linuxcnc.org/docs/html/man/man9/hostmot2.9.html
I never looked at this link before. But i will read it coming time.


Anybody who can program in C or program an Arduino can write a Hal component. Python is a much higher level language so what takes 1000 lines in C may take 100 in Python. If you know how to code, a new language is not hard to pick up. Hostmot2 is Andy's baby. Most Mesa cards have a UART (Universal asynchronous receiver-transmitter) on board that drives the smart serial RS422 interface on the Mesa Board. With the right bit file loaded onto the mesa card using mesaflash. Hostmot2 then creates read and write functions that can be used to send data out or read data from the mesa RS422 interface. These do not appear as pins but show up on startup if you watch the terminal window on startup fronm the command line. RS422 and RS485 are very similar protocols so if a RS485 device supports a 4 wire interface PCW says you can talk to it across the MESA RS422. Most RS485 interfaces are only 2 wire devices so take care with hardware selection (The good news for Grotius is that the Hypertherm plasma machines use a 4 wire interface). From memory, this method is limited to maximum packets of up to 64 characters or so (which is enough for most modbus applications). There is an example HAL component that reads a gyroscope that serves as an example on how to talk to a device using the hostmot2 RX and TX functions.

The problem with using a serial device in real time is the link speed. This VFD is talking across a 19200 baud link, the maximum throughput (from which you must deduct the handshaking overhead is 1920 characters per second. Unless you configure to use a high speed serial link (Mhz maybe) there is very little you can do between calls of the servo thread usually happening 1000 times per second. I think then that while a hostmot2 aware RS485 RX/TX component would be a nice way to talk to a RS485 device like a Hypertherm plasma cutter (becasue there is no need for an external USB or RS232 interface, I think a user space component (eg like this one written in Python) is adequate. I doubt that the Hypertherm RS485 was designed with real time adjustments in mind.

I do think that the Hostmot2 pathway would be great if you were using a Mesa 7i76e or 7i92 ethernet card being controlled by a USFF PC that has limited USB ports and no serial port on board.
Moderators: cncbasher
Time to create page: 0.059 seconds
Powered by Kunena Forum