
adccommunitymod (AutomationDirect) asked a question.
Created Date: March 07,2000
Created By: Russ
**** This post has been imported from our legacy forum. Information in this post may be outdated and links contained in the post may no longer work.****
Has anyone done any work with or could point to some resources on generating PLC ladders programmatically? Mostly this is just a curiosity thing on my part, but it does have a few practical applications. As many of you have probably also done, over the years I 've developed a series of generic PLC code blocks to work with Optimate panels, Counter-Timer modules, A/D & D/A modules, communications and so on. Usually, the only thing different from one program to another is the memory map, I/O assignments and the basic logic of whatever machine or process is being controlled. It's really tedious and boring to cut and paste these blocks into a new project and then have to integrate the new memory and I/O map structure into the standard code. It would be really cool to have a set of program "wizards " that could interactively gather the information and then build and document the code block automatically. The preferred way of automatically building PLC code and documentation would be to directly generate data files, but none of the file formats DirectSoft supports are open or documented. To test and prove the overall "wizard " concept, I bypassed the file issue by using the SendKeys program interface method under Visual Basic to directly enter the data into DirectSoft. The SendKeys method basically puts keystrokes into the Windows keyboard buffer and as far as DirectSoft is concerned, looks like a person typing really fast. My VB program takes a ladder code block template, gathers the variable data and automatically generates the ladder and CSV documentation file. As a proof of concept, it works very well and is fun to watch. If anyone has any ideas, comments or suggestions on this concept, I would really like to hear from you. Thanks!
Created Date: March 07,2000
Created by: Russ
Has anyone done any work with or could point to some resources on generating PLC ladders programmatically? Mostly this is just a curiosity thing on my part, but it does have a few practical applications.
As many of you have probably also done, over the years I 've developed a series of generic PLC code blocks to work with Optimate panels, Counter-Timer modules, A/D & D/A modules, communications and so on. Usually, the only thing different from one program to another is the memory map, I/O assignments and the basic logic of whatever machine or process is being controlled. It's really tedious and boring to cut and paste these blocks into a new project and then have to integrate the new memory and I/O map structure into the standard code. It would be really cool to have a set of program "wizards " that could interactively gather the information and then build and document the code block automatically.
The preferred way of automatically building PLC code and documentation would be to directly generate data files, but none of the file formats DirectSoft supports are open or documented. To test and prove the overall "wizard " concept, I bypassed the file issue by using the SendKeys program interface method under Visual Basic to directly enter the data into DirectSoft. The SendKeys method basically puts keystrokes into the Windows keyboard buffer and as far as DirectSoft is concerned, looks like a person typing really fast. My VB program takes a ladder code block template, gathers the variable data and automatically generates the ladder and CSV documentation file. As a proof of concept, it works very well and is fun to watch.
If anyone has any ideas, comments or suggestions on this concept, I would really like to hear from you. Thanks!
Created Date: March 18,2000
Created by: lucasw
I talked to Robert Oglesby about this while Host Engineering was developing 3.0.
At that time there were no plans to add that feature and to my knowledge that remains true.
Perhaps Bob could jump in here and shed some light on the subject?
I would really like to see this feature added to DS. Applications could include the following:
Ladder PID from the autotuned loop.
Easy DV-1000 code that could survive power outages.
Code reuse. I must be the only person on earth who actually enjoys writing the same code over and over and over...
Code sharing. This forum could become a bazaar of sorts for generic, portable slices of code.
Created Date: March 20,2000
Created by: franji1
Host Engineering is looking at importing/exporting mnemonic text, allowing you to create snippets of code & reuse them easily. Also, we 're looking at generating tables of V memory data via ladder logic. Basically, you would get your V memory set up to stable values, then use a "generate " command, and it would read the V memory values and generate a bunch of , which you could tie to first scan or some other event.
Created Date: January 11,2004
Created by: znelson
I'm very interested in this thread. I have been tasked with creating an "alternative " application to DirectSoft32. While DS certainly gets the job done, our client requires something more "user-friendly " and customized. They 're in the entertainment industry, and the PLC's are used for show control. So ultimately they want a custom application tailored for that.
The software we 've written generates a file which contains output events, the start and stop time (duration), etc. These events fire in response to inputs being triggered. Everything needed for the show is contained in the configuration file. I just need to translate (compile) this down to something the PLC can run natively (Ladder?), and somehow download it to the PLC.
We 're using a mixture of 205/305 hardware that the customer already has in place.
Can anyone point me in the right direction? Thanks in advance!
Created Date: January 12,2004
Created by: Steven
Instead of using SendKeys, would it be easier to automatically generate text files suitable for importing into DirectSoft? You could automatically generate files and File->Import them as the program, documentation, and rung comments. The documentation files should be easy to create (I think they are CSV files). The program file might be harder, but you could File->Export your sample code to see how they work.
I think generating files might be more robust than sending keystrokes, but I 've never tried the latter. Best of luck!
Created Date: January 12,2004
Created by: znelson
For my application, I need to do-away with DirectSoft altogether. I need to send the instructions directly to the hardware. So I need to know the protocol etc.
Created Date: January 13,2004
Created by: znelson
Spoke to someone in tech support. I find it really hard to believe that the only way to program the hardware is with DirectSoft or a handheld. If that's the case, wouldn't it make more sense to charge>$1000 for the only software that can get the job done?
Is the PLC industry really that far behind the PC world, that it can't be programmed via ASCII over a serial port in compliance with a published protocol? Or is this just an AutomationDirect thing?
Created Date: January 13,2004
Created by: znelson
Sounds interesting, thanks for the follow-up. But can we take this a step further and generate the downloadable file via some other means (ie. our software). Then use the utility to send it back to the PLC?
We would need to know how to write the file format. I guess we could reverse engineer it by pulling a program out of the PLC and trying to understand it. Is there no other way to generate this file?
Thanks again!
Created Date: January 13,2004
Created by: franji1
Honestly, you are treading where no mortal should go ;-)
The OPCODE specification for the PLC instructions are quite complex. They CAN be reverse engineered, but they truly are proprietary for a reason. DirectSoft is much more than just a nice looking GUI to a download utility. Ladder code generation is quite complex, add that to the memory ranges of each data type, valid types in specific instructions, and different instruction support and memory ranges across different PLC types - it gets complicated REAL quick.
Yes, we could charge $1000+ like A/B and G.E. does, but just because we CAN, that doesn't mean we SHOULD.
Like you, we like good utilities that are cost effective that help us do our jobs. At some time you do get to the point of responsibility to the end-user. No PLC vendor that I know of makes their opcode specification available due to the reasons given above (and a few more I probably have not thought of).
Sometimes we pull our hair out wondering why instruction X with parameter Y works differently in PLC Z. It's our job to know. It's our job to care. It's our job to create the "fix " that does not impact existing customers and minimizes the impact on the guy trying to do "X with Y on Z ".
I have heard of some people trying to do an open source PLC - basically the Linux concept but for PLC functionality - but I think it was primarily for embedded and/or PC development, not traditional PLC hardware. I can't remember the project name, but maybe someone else out there knows.
Created Date: January 13,2004
Created by: Tech Guy
It was called the "Puffin Project ". Apparently they have now changed the name to MatPLC for some unknown reason. It runs under the Linux Operating System on a PC. The website can be found here: http://mat.sourceforge.net/