Page 1 of 2

Modbus

Posted: Sun Aug 18, 2013 7:45 am
by Steve001
Morning guys,

looking at data sheet and you tube video V6 looking good :)

is there a modbus component ?

Steve

Re: Modbus

Posted: Mon Aug 19, 2013 10:48 am
by Benj
Hello,

Should be easy enough to add, what comms bus were you thinking of using?

Re: Modbus

Posted: Mon Aug 19, 2013 12:42 pm
by Steve001
Hello Ben,

Was thinking of RS485 Modbus / Jbus RTU ,depending on the register been used that could be 2,3 or 4 words

Regards

Steve

Re: Modbus

Posted: Wed Aug 21, 2013 8:23 pm
by Benj
Hello,

I've been doing some reading and it looks like this would make a great addition. Especially if I can tap into existing features such as COM port and Ethernet communications so you can actually talk to the devices in simulation and from on-board the microcontroller. Do you know of any reasonable priced and popular modbus devices I could get hold of to do some developing?

Re: Modbus

Posted: Thu Aug 22, 2013 10:33 am
by tello
Hello Steve001 and Benj, I work a lot in the industrial and Modbus RTU protocol is very used, many manufacturers use this protocol to control peripherals, from input-output modules and analog digital, electrical network analyzers, frequency converters for motors , programmable logic controllers or single temperature and humidity sensors.
I think it's very interesting to create a component Modbus RTU master and slave to open the industrial sector projects created with Flowcode PIC and ARM.
Some time I've been trying to make a macro for basic function of slave PIC, but I do not program in C and there is much information modbus protocol programming in C.
If I can help with anything to do this I would like to make it cooperate.

thank you very much

PD. I like the new Flowcode6

Re: Modbus

Posted: Fri Aug 23, 2013 6:24 pm
by artose
Yo cree un pequeño programa F5 MODBUS RTU. haciendo el calculo del CRC16.

I created a small program MODBUS RTU F5. making the calculation of CRC16. Edited by dazz(english translation) editado por Dazz(traducción Inglés)

Re: Modbus

Posted: Sat Aug 24, 2013 5:23 am
by Mantas
Hello Gent,

If we started talking industrial protocols then why not add CANopen, Profinet, ethernetCAT. They are all like MODBUS a more advanced industrial control protocols which need a high degree of coms knowlage by using CAN, ETHERNET or RS485 interfaces.

Best regards,
Mantas

Re: Modbus

Posted: Sat Aug 24, 2013 3:27 pm
by Benj
Hi Mantas,

Thanks to v6 we should be able to cover pretty much any communications busses like this. The great thing is that you can even create them yourself.

We will obviously continue to take requests seriously and do what we can to get as much out the box functionality as possible, I'll make a start on Modbus next week and see how far I get, If it's quick and easy enough then I might be able to roll out a few more protocols.

Re: Modbus

Posted: Sat Aug 24, 2013 7:44 pm
by Steve001
Hi Benj,

just a thought would it be possible to modify the coms setup's

ie

adjustable Baud rates
parity odd, even , none

I know that this depends largely on the uarts

Not sure on how easily it is to implement, but it would be nice

Steve

Re: Modbus

Posted: Sat Aug 24, 2013 7:53 pm
by Benj
Hi Steve,

Yes this should all be possible.

For sim the COM port component currently accepts variable bauds but I would have to add options for controlling the parity into the DLL, shouldn't be too much of a problem.

For download we could put the CAL UART into 9-bit data mode and automatically work out the parity as part of the component's inner workings.

Re: Modbus

Posted: Sun Aug 25, 2013 5:32 pm
by Mantas
Hi Benj,

I hope you will have time to do CANopen as well. If you want I can send you some C code and documentation regarding this. Recently I had to do a lot of studying on CANopen to control BLDC servos, but due to lack of time I couldn't accomplish this task, as it is pretty tricky, >300 pages of reading documentation :mrgreen: I understood almost all the SDO and PDO functionality, but still need to roll out how to fit it all in CAN message. If you could accomplish all those industrial protocols and V6 would come out with it I bet you would receive a lot of new user interest from industry!

Regards,
Mantas

Re: Modbus

Posted: Sun Aug 25, 2013 11:45 pm
by Benj
Hi Mantas,

Yes your welcome to send me anything you have. If it's too large to send via a PM then you could either email to me or send via a dropbox or similar site.

Re: Modbus

Posted: Mon Aug 26, 2013 9:49 am
by Mantas
Hi Benj,

Here is a Dropbox link: https://dl.dropboxusercontent.com/u/104 ... ANopen.zip

Best regards,
Mantas

Re: Modbus

Posted: Tue Aug 27, 2013 7:02 pm
by Benj
Hello,

Modbus pretty much in there now, wasn't too bad after all but i'm guessing there will be a few issues at the mo, e.g. simulating parity which requires DLL mods. Just trying to add the ASCII mode as well as the RTU mode but shouldn't be much of an issue. Hopefully include it in the upcoming patchset 3 release tomorrow so you can have a play.

I'll start having a look into CANopen tonight and see if I can make head or tail out of it. Thanks for the files :D

Re: Modbus

Posted: Wed Aug 28, 2013 8:22 am
by Mantas
Good luck Benj,

I hope you will succeed:) That will make my life a lot easier;)

Cheers,
Mantas

Re: Modbus

Posted: Thu Aug 29, 2013 8:38 am
by tello
Good morning guys and thanks to all

Thanks Benj for your work, I am currently working on several projects and seriously need Modbus Rtu and Asci communication to communicate the microcontroller with industrial equipment.

I have really wanted to work with Modbus because it greatly simplifies my projects and my life jejejejeje :D :D :D

Thank you again.

Re: Modbus

Posted: Fri Aug 30, 2013 6:25 pm
by Benj
Hello,

Ok in PatchSet 4 the Modbus component should be complete and should work correctly. I'm a bit unsure as the guide I was following sent the data MSB first but then sent the CRC LSB first so might be a few remaining issues to iron out.

If anyone tries the component with Modbus hardware then let me know how your getting on and I will do my best to help out.

Modbus slave component would also be a nice feature so I will make sure it is on the list.

Re: Modbus

Posted: Fri Aug 30, 2013 8:50 pm
by Steve001
Thanks for that benj ,

i have some hardware and software that you are more than welcome borrow that we use at work for testing modbus loops

let me know if you would like to borrow it

steve

Re: Modbus

Posted: Sat Aug 31, 2013 6:42 am
by Mantas
Benj,

I think you and other MM crew will win a Nobel prize next year! :mrgreen:

BR,
Mantas

Re: Modbus

Posted: Mon Sep 02, 2013 9:26 am
by Benj
i have some hardware and software that you are more than welcome borrow that we use at work for testing modbus loops
That would be fantastic Steve if you wouldn't mind doing that, really appreciated.
I think you and other MM crew will win a Nobel prize next year! :mrgreen:
Cheers Mantas, that would be a nice feather for the bow indeed. Still I would be happy just to have some customers who enjoy using the product.

Re: Modbus

Posted: Mon Sep 02, 2013 12:20 pm
by Mantas
Hi Benj,

You certainly do have more than one :wink: How is the progress on CANopen?

Regards,
Mantas

Re: Modbus

Posted: Mon Sep 02, 2013 2:28 pm
by Benj
Hi Mantas,

Cheers :D Good to know.

Progress on CANopen is not great at the moment but we are pushing for the release build today and then I will aim to get it in for v6.1. Got a bit sidetracked by the MPU6050 sensor arriving for my quadcopter project I hope to publish on the Flowcode blog.

Hopefully shouldn't take too long from what I have seen on the specification so far but I will do more research and try and get out some code for you to play with. Do you have any or know of any good yet low cost CANopen hardware.

Re: Modbus

Posted: Mon Sep 02, 2013 6:59 pm
by Mantas
Hi Benj,

I received my MPU6050 today as well :D I want to upgrade my ITG3200 + BMA180 + RM3000F which was an amazing combo! I was looking for MPU6000 breakout which is set for SPI protocol, and allows for higher sample rate. As far as CANopen goes, I was aiming for servo motors. There are plenty of them on the market, but I know only the price for Dunkermotor BG75x25 which is the biggest from their BLDC motor series - 1310 euros, which is expensive, but it is a very clever, has many different working modes, even stepper mode :) Let me know how it goes with you quadrocopter :wink:

P.S. I saw an amazing video on youtube, were a presenter controls two quads with hands using XBOX kinect, and much more crazy stuff :)

Best regards,
Mantas

[edit by moderator to remove profanity]

Re: Modbus

Posted: Tue Sep 03, 2013 10:48 am
by Benj
I want to upgrade my ITG3200 + BMA180 + RM3000F which was an amazing combo!
If you do any integration between the MPU6050 and the magnetometer sensor that that would be really interesting. The component to drive the MPU 6050 should be in the v6 release if you want to have a play and let me know how you get on.
As far as CANopen goes, I was aiming for servo motors.
Ok I will try and develop some code and probably pass it over for testing. Might have a quick look around and see what is out there.
I saw an amazing video on youtube, were a presenter controls two quads with hands using XBOX kinect
I have also seen some very cool stuff using the kinect like scanning in real world models etc, I also have one sat on my shelf at home that rarely gets used so I feel a project coming on. Be nice if we could somehow pass the data into v6.

Re: Modbus

Posted: Tue Sep 03, 2013 7:04 pm
by Mantas
Hi Benj,

I have made a board with GPS, BMP085 pressure sensor, BMA180 acc, ITG3200 gyro, RM3000F mag. It working wonderful, at 100Hz. Now I am writing a code in flowcode for geomagnetic earth model so it would calculate the declination angle regarding on the date and position, so it would know the true north. Its called 11th Gen International Earth geomagnetic model IGRF11, or WMM2010 used by NATO and others. So you can make a drone for flying to programmed destination, fully autonomously. Also developed realy good calibration algorithms for magnetometers, accelerometers and gyros, to be able withstand accidental magnetic interference and not loose direction.

If we had a component for Kinect in FC it would be really cool! :D

P.S. you can try to contact Dunkermotors regarding their smaller BLDC which should be cheeper: http://www.dunkermotor.com/default.asp? ... 120&lang=2

Cheers,
Mantas