Sonsivri
 
*
Welcome, Guest. Please login or register.
Did you miss your activation email?
December 08, 2016, 10:46:49 10:46


Login with username, password and session length


Pages: [1]
Print
Author Topic: Modbus Master program  (Read 2662 times)
0 Members and 1 Guest are viewing this topic.
dipchip
Junior Member
**
Offline Offline

Posts: 71

Thank You
-Given: 92
-Receive: 25



« on: February 11, 2014, 07:43:53 19:43 »

  This is not done by a long shot, but I wanted to show it off Wink
Anyone familiar with Modbus will recognize most of the screen elements.
Things I'd like to draw attention to:
   o Log Window, notice the format... it's CSV.
   o Log Configuration, can log to screen, file, or serial.
   o Register Aliases

Logging to serial was inspired by MakerPlot.  I'm almost there and can't wait to plug it in.
A virtual serial cable (such as com0com) will direct the output to MakerPlot.
Logging data in CSV format to a file will let Excel to open it directly and allow for plotting or charting.

Currently the program only works in RTU mode, but adding TCP/IP capability to it later will be fairly easy.
I have this program attached to a PIC18F46K22 based PLC of my design.  It's smaller than a credit card and
has full Modbus RTU capability, albeit limited in input/output(s) and memory.
It also works with most other Modbus test programs I've come across.  For those that are interested in anything
Modbus, I'll post some links I've found useful, later.

Last thing I'll mention, working in VS2012 is a freaking riot!
More later.

--Chip
   
Previous post searching for a scheduler (no longer needed), note the new face on this program Wink
http://www.sonsivri.to/forum/index.php?topic=48561.msg140652#msg140652
« Last Edit: February 11, 2014, 07:46:57 19:46 by dipchip » Logged
Gallymimu
Hero Member
*****
Offline Offline

Posts: 579

Thank You
-Given: 101
-Receive: 151


« Reply #1 on: February 15, 2014, 11:01:29 23:01 »

Cool,

There are not that many modbus tools out there.  I've used modbus poll but it is mediocre and NOT free!
Logged
dipchip
Junior Member
**
Offline Offline

Posts: 71

Thank You
-Given: 92
-Receive: 25



« Reply #2 on: March 10, 2014, 04:08:06 16:08 »

Update 3

Major changes:
  Supports up to 10 devices simultaneously!
  Lua scripting for logging... DONE!
  status bar updating properly
  Alternate display for registers, scrollable so viewing all registers will not be a problem.
  cleaned up serial RTU interface and codebehind.
  Device aliases as well as register aliases.
  unified panel style and layout.
  CommsSetup getting ready for TCP/IP support.
  simplified Gauges.

--Chip
« Last Edit: March 10, 2014, 04:11:52 16:11 by dipchip » Logged
koky
Active Member
***
 Warned
Offline Offline

Posts: 157

Thank You
-Given: 83
-Receive: 115


WWW
« Reply #3 on: March 10, 2014, 05:06:08 17:06 »

very nice, i have used some times profilab expert, but with rtu often display random value
Logged
dipchip
Junior Member
**
Offline Offline

Posts: 71

Thank You
-Given: 92
-Receive: 25



« Reply #4 on: March 10, 2014, 09:12:32 21:12 »

You know how salesmen can be... persistant and "... when you gonna buy this?"
Well... the guy at AzeoTech DAQ Factory was no exception.  But when I explained his product didn't work with my equipment he asked some very good questions.  One of which was what USB to Serial chip you using?  I got to thinkin' about it and it crossed my mind that I had not tried the PL2308 I had laying around.  So, unplugged the FTDI and plugged in the PL2308 ... low and behold the SOB started working!

The point, even the ubiquitous FTDI FT232RL isn't 100% compatible... or rather the other way 'round.  I guess it doesn't hurt to have a few different brands laying around the toolbox Wink

--Chip

Posted on: March 10, 2014, 08:41:22 20:41 - Automerged

Speaking of equipment... you guys might get a kick out of this too.
This is a PIC18F46K22 running firmware of my design also.  It has worked with every (now anyway) Modbus program I've tied it to.
It has 8 coils, 8 discrete inputs, 32 input registers, and 32 holding registers.  I have the I2C bus running also and tied to an MCP7940 RTC chip and an MCP9801 temperature chip.  Both are easy to work with.  The value from these get plugged into the input registers and read by dMod.

The board behind the PLC is my FT232RL to RS485 board, I used to think it worked great ..hehe.  The small board in the bottom left is the other end of a RS485 cable and goes to the PLC.  The breadboard is just some leds to show coil output states.

http://www.mouser.com/ProductDetail/Hammond-Manufacturing/1591XXCFLBK/?qs=sGAEpiMZZMsrGrAVj6eTvdeggvXHcbvBTtr88blnAn4%3d

... are on my shopping list to finish off this project.

These things are small... as you can see by the Bic lighter sitting next to the board.  I hope to market some of these for home automation where you don't need a lot of I/O and cost is .. as always... a consideration.

(picture quality bad... on purpose.. keeps it small)

--Chip
Logged
Some Anon Guy
Junior Member
**
Offline Offline

Posts: 39

Thank You
-Given: 45
-Receive: 16



« Reply #5 on: March 12, 2014, 05:51:52 05:51 »

Looks great.
I am just starting down this path myself.

Are you interested in sharing the firmware and info on the PIC board, as well as the windows app?

Thanks!
Logged
koky
Active Member
***
 Warned
Offline Offline

Posts: 157

Thank You
-Given: 83
-Receive: 115


WWW
« Reply #6 on: March 12, 2014, 06:59:40 06:59 »

yes, i'm interested
Logged
dipchip
Junior Member
**
Offline Offline

Posts: 71

Thank You
-Given: 92
-Receive: 25



« Reply #7 on: March 16, 2014, 08:13:35 20:13 »

  Hmmm... somebody named "Some Anon Guy" .. been with Sonsivri for 6 months, has 5 posts
is asking for the source and drawings for my last year and a half's work...
... let me think about that.

Hehe... I'm pulliing your leg, SAG.
Actually, I am not sure how this is gonna go down.  I can post drawings of the PLC, no problem.
But source to dMod or the firmware....hmm.  Maybe you missed the part where I said I would like to market these.

I may also solicit to some of the bigger companies in the industry and see if they want to buy it.
The second question they will ask... (first being how much) will be "Are there any licensing issues and are there any
other copies of this code floating around out there?"  As you might imagine, that conversation would go to hell in a
handbasket if I were to post it here and now.  So, this is somewhat thin ice for me... never done this before.

If after some time I don't get any bites, I will consider something like the Creative Commons license.  Not sure, but if
someone is gonna make money with my work... I want some!

Meanwhile I will do what I can to get the artwork for the PLC posted.  And, if my coding skills get a little better and I
learn how to use the Installer in VS2013, and a bunch of other things... like obfiscating, licensing, and the list goes on
and on...   I will post a time limited copy of dMod.  This way I maintain control over it and you guys get to play with it.

I know this all sounds like I am a paranoid greedy SOB.  Maybe, but like I said it's all new ground for me and I just want
to be cautious.  Hope you guys understand.

--Chip
Logged
Some Anon Guy
Junior Member
**
Offline Offline

Posts: 39

Thank You
-Given: 45
-Receive: 16



« Reply #8 on: March 16, 2014, 11:06:54 23:06 »

Gotcha! I did miss the part that you are hoping to market the product...

Good luck, I hope you are able to make some money for your effort.

It looks really interesting.

On side note, I did find a project with code for modbus on the PIC over at libstock (www.mikroe.com) that I am modifying for my needs...



Logged
dipchip
Junior Member
**
Offline Offline

Posts: 71

Thank You
-Given: 92
-Receive: 25



« Reply #9 on: March 19, 2014, 03:22:57 03:22 »

As promised... sorta Wink
attached is a link to the schematic and artwork for the PLC.  This is an updated version with all the bells and whistles
and is still only about 3.5 inches square.  So, still small enough to fit into project boxes.
The RS232/485 is built onto the board and has surge protection and termination.  I like the MCP7940 enough to keep it on this version
I have added a MCP23017 port expander, and a 24LC32AF I2C 32k eeprom.  The board also sports a USB connector and wired to the
appropriate pins on the PIC.  The battery holder has been moved to the top and given ample room.

I'll see about putting together some basic libs for this and post those also... see you in few days.

--Chip

Posted on: March 19, 2014, 03:05:23 03:05 - Automerged

Good news on the dMod front.  After a week of pulling my hair out, ok.. what was left from the last fiasco.. I now have a working installer.  Learning WiX and writing code in XML is a serious departure from what I am used to.

I have ran Dofiscator against my code also and it seems to work, still not to happy with the output.  At this stage Optikon and Nemo would prolly laugh at it... but it's a start.

Next is to build in some License/Activation scheme, and ultimately a time limited demo.
I find it somewhat amusing in a way to be thinking about all this for my program and writing about it on Sonsivri.

Cheers

--Chip

----------------------
25 downloads and just 1 thank you... would it really kill you guys?!?!?!  Makes me want to post more... sure it does.
« Last Edit: April 15, 2014, 06:13:01 18:13 by dipchip » Logged
max
Active Member
***
Offline Offline

Posts: 223

Thank You
-Given: 602
-Receive: 32


« Reply #10 on: March 19, 2014, 11:02:16 23:02 »

Hello dipchip

Please upload the PDF files, I do not have protel.

Regards
« Last Edit: March 20, 2014, 06:53:33 18:53 by max » Logged

Fate arrived and made the conscious unconscious It silenced the activity of life.
dipchip
Junior Member
**
Offline Offline

Posts: 71

Thank You
-Given: 92
-Receive: 25



« Reply #11 on: March 20, 2014, 12:44:11 00:44 »

@max

  I've printed all the schematic pages to pdf's and zipped them up, see the attachment.
It would be pointless to print pdf's of the pcb.

--Chip
« Last Edit: March 20, 2014, 12:49:50 12:49 by dipchip » Logged
max
Active Member
***
Offline Offline

Posts: 223

Thank You
-Given: 602
-Receive: 32


« Reply #12 on: March 20, 2014, 06:59:28 18:59 »

Hi dipchip

For the pcbs you can share the gerber files, like sch pdfs, gerber format
is universal many pcb programs have the gerber import functions.

Regards
Logged

Fate arrived and made the conscious unconscious It silenced the activity of life.
dipchip
Junior Member
**
Offline Offline

Posts: 71

Thank You
-Given: 92
-Receive: 25



« Reply #13 on: March 22, 2014, 04:11:45 16:11 »

Max,
  After giving this some thought... no, I will not post the gerbers.
I've posted the project files and printed the schematics to PDF for you.
If you don't have a method of importing a Protel/Altium file and generating your own gerber files, I can't believe your serious about design.
I'm not trying to be rude, but my project is not for the whim of everyone that looks at it.

Regards

--Chip
Logged
Pages: [1]
Print
Jump to:  


DISCLAIMER
WE DONT HOST ANY ILLEGAL FILES ON THE SERVER
USE CONTACT US TO REPORT ILLEGAL FILES
ADMINISTRATORS CANNOT BE HELD RESPONSIBLE FOR USERS POSTS AND LINKS

... Copyright 2003-2999 Sonsivri.to ...
Powered by SMF 1.1.18 | SMF © 2006-2009, Simple Machines LLC | HarzeM Dilber MC