Currently strugglening with the FHPP myself, would you be willing to share your code ? I understand that Peter can not share his, although the bits he left were imensly usefull.
In advance thanks.
I recently wrote my own driver for a Festo CMMO-ST device.
As the Modbus messages used by the device are so easy to build/parse I went for simple TCP messages (instead of any Modbus library in between).
Parsing the FHHP message looks like this:
(Basically get the 8 data bytes of the FHPP message and put them in a cluster.)
Creating the FHPP bytes is also quite easy:
I'm using the CMMO-ST to drive a stepper motor. I only need to go to certain positions and use it's semi-automatic auto-referencing at startup.
When following the Festo manual it's really easy to develop your own driver as they provide you with good information about the internal controller states you have to complete/follow!
That's brilliant, very much a KISS solution. I did find myself changing back and forth between U8 and U16 for no particular rason here... If you can share your FHPP cluster (input/output) also that would be great.
Thanks a bunch...
First off apologies for the slow reply - some other duties meant I did not log into the forums for a while.
I think you may already have an excellent solution from Gerd and have already implemented it! However, if not, I attach some screen-shots from my code. I doubt it is as elegant but if you are going for the modbus commands here is what I did.
The obvious - this is the vi I am using for reading and writing - unput and output are U16 arrays.
First of all FESTO provided me with this very nice 'cheat sheet' for FHPP commands which can save some time going through the manual! They also have their own modbus TCP client that they can provide to you - it is a good way of figuring out the commands to you need to get the motor running! All of my inputs in the first 3 bytes are false except for Brake, Stop, Enable, Halt, Start, Reset and Home. They are changed based on if you are starting, homing or stopping the drive.
So I'm just converting these bytes into u16 (probably badly and inefficiently ;-)).
The velocity is a percentage of the maximum you set using the Festo Configuration Tool - so hardwired into my vi is 20mm/s - this is why I divide by 20 and multiple by 100. Position is multipled by 1000 as this is the accuracy I set in the FTC factor group! (10-3) so 10.00mm is written as 10000
This is the code I use to configure the U16 input array!
Above is what my front-panel looks like for the input conditions selected......also I think I'm using FHPP+ rather than FHPP which is the reason for elements 5-8 in the array. These are not needed (as far as I can recall) if you just go with FHPP control.
For parsing the data received back I used the following vi:
And here is what the front panel looks like for a typical read of data
Hope this all helps,
i recently have to do the same as you and find the screenhot of GerdW very helpful on how to build the modbus words and how the extract the data of the response.
But what VIs do i have to use to create a connection to the drive and which VIs are used to write and read from the drive?
@GerdW: You wrote that you use "simple TCP messages". So just
TCP open connection
TCP Write (data in: string created via GerdWs example)
TCP Read (data out:string converted via GerdWs example
TCP Close connection
Thanks for your help
Thank you very much with this Help. Today I can control the basics parameter of my Festo Controller without problems.
I want to take more features under control and in the future, I will need to read and write Holding Register of Festo using Labview. I would like to control all the necessary driving´s PNU from my VI, such as Record Table, Group Factors, software and Hardware Limits, max. (and min.) Velocity, and max. (and min.) Acceleration.
There is someone who knows basically how to begin this Odyssey?
Thank everyone very much.
thank you for your tip, but I have read the manual more than a couple of times and I can´t find the answer in. I have no problems to control my FESTO motor with Modbus, but when I want to change parameters like "Factor Units" or "Maximal Velocity" with Labview, I don´t reach my goal. I can change this PNU parameter just using the FESTO software, but I can not see how to manage this PNU paramers with Labview wires.
Now a leave my current questions, in order to expose better my blurred lines and state of confusion:
Should I send 4 or 8 words? Should I send more bytes?
How operate FHPP+ with Labview and which Labview Modbus Function should I use to read/write PNU parameters?
I hope someone can help me!
Thanks everyone. I wish you all a great week!