Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: EmbeddedC++CPLC
Hello everyone
I'm trying to build PLC that can be programmed through using GUI made in C++
I had an idea that using the GUI i'll create a txt file will contain a parsing of the commands that the user wants that the plc will do
in such manner the user can use multiple commands set and also store them for future use

I hope you manage to understand what i'm trying to say
 
My problem is how to write a C program that will convert to txt file into commands that now i can transfer into the chip
what do i need to do or where can i read about those types of programs?
 
thank you for your help
 
Matan F
example
txt-->
1)inputX outputY DO func(W)
2)inputX2 outputY outputYi ... Func(W2)
3)etc...
.
.
.
 
code to convert txt to C embedded --> what do you think need to go here
 

 

ps. i had an idea to do it with xml instead of txt
if it helps
Posted 24-Jan-13 0:44am
Edited 27-Jan-13 3:26am
v2
Comments
Andreas Gieriet at 27-Jan-13 10:01am
   
What exectly is your problem? Where are you stuck? It's not clear if you don't know how to Cross Comile C code or how to burn the object code to the PLC or ...? Or do you want to invent some own language that should translate into C, which you then feed into your corss compilation and burnig tool chain? You need to clarify where you got stuck, otherwise you won't get any useful answer. Cheers Andi

1 solution

Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

You need to write (or implement) a language parser, that will convert the user input into your target commands. Take a look at http://www.antlr.org/[^] for some information.
  Permalink  
Comments
Andreas Gieriet at 27-Jan-13 12:50pm
   
For C/C++ environment, Lex and YACC or the equivalent open source versions Flex and Bison are more common. Using ANTLR for something other than Java is still a bit of a pain for non-Java runtimes. Cheers Andi
Richard MacCutchan at 28-Jan-13 4:32am
   
True, thanks for reminding me.
Andreas Gieriet at 28-Jan-13 4:53am
   
You are welcome! Andi

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Your Filters
Interested
Ignored
     
0 Sergey Alexandrovich Kryukov 367
1 Abhinav S 226
2 thatraja 220
3 OriginalGriff 195
4 Peter Leow 160
0 Sergey Alexandrovich Kryukov 8,849
1 OriginalGriff 5,035
2 Peter Leow 3,949
3 Maciej Los 3,535
4 Abhinav S 3,148


Advertise | Privacy | Mobile
Web04 | 2.8.140415.2 | Last Updated 27 Jan 2013
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Use
Layout: fixed | fluid