Click here to Skip to main content
13,509,265 members
Rate this:
Please Sign up or sign in to vote.
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
1)inputX outputY DO func(W)
2)inputX2 outputY outputYi ... Func(W2)

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
Updated 27-Jan-13 3:26am
Andreas Gieriet 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.

1 solution

Rate this: bad
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[^] for some information.
Andreas Gieriet 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.
Richard MacCutchan 28-Jan-13 4:32am
True, thanks for reminding me.
Andreas Gieriet 28-Jan-13 4:53am
You are welcome!

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

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy |
Web04 | 2.8.180417.1 | Last Updated 27 Jan 2013
Copyright © CodeProject, 1999-2018
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100