Touch Screen Monitor Program

This is a discussion on Touch Screen Monitor Program within the C++ Programming forums, part of the General Programming Boards category; I have a touch screen monitor (HMI) that I am tinkering with. It programs a series of tempurature controllers I ...

  1. #1
    Registered User
    Join Date
    Sep 2006
    Posts
    6

    Touch Screen Monitor Program

    I have a touch screen monitor (HMI) that I am tinkering with. It programs a series of tempurature controllers I have. I got it to talk to one controller but it doesn't pass on the info to 1 other controller I have attached for practice. Here is the code I have.

    Code:
    int range = 5;
    
    while(State != 3)
    {
    	switch(State)
    	{
    		case 0:
    			if((Abs(PV1-ActiveSP) < range)&&(Abs(PV2-ActiveSP1) < range)) // wait until PV is with range
    			{
    				State = 1;
    				FinishTime = GetNow() + ActiveSoak;
    			}
    			break;
    
    		case 1:
    			if(GetNow() >= FinishTime)	
    			{
    				RunningStep++;
    				State = 2;
    			}
    			break;
    		case 2:
    			if((SPs[RunningStep] == 0)&&(SPs1[RunningStep] == 0)&&
    			(Ramps[RunningStep] == 0)&&(Ramps1[RunningStep] == 0)&&
    			(Soaks[RunningStep] == 0)&&(Soaks1[RunningStep] == 0))
    			{
    				State = 3;
    				CTL = 0;
    				ActiveSP = 0;
    			}
    			else
    			{
    				State = 0;
    				ActiveSP = SPs[RunningStep];
    				ActiveRamp = Ramps[RunningStep];
    				ActiveSoak = Soaks[RunningStep];
    				ActiveSP1 = SPs1[RunningStep];
    				ActiveRR1 = Ramps1[RunningStep];
    				ActiveSoak1 = Soaks1[RunningStep];
    			}
    			break;
    	}
    }
    The HMI has a TAG section and all of my TAG's are associated correctly.

    This may be odd since it's not a OS specific problem.

    Any help is appreciated. Just a warning, I will have many more questions I am sure. Plus if you can help with this I can direct you to the program software that is free with this HMI and you can view my Database completely.

    Thanks,

    EW
    Last edited by EWTexas; 09-15-2006 at 03:31 PM.

  2. #2
    (?<!re)tired Mario F.'s Avatar
    Join Date
    May 2006
    Location
    Portugal
    Posts
    7,436
    Please use code tags. I'm sure this is not the first time ever you post on a forum.
    The programmer’s wife tells him: “Run to the store and pick up a loaf of bread. If they have eggs, get a dozen.”
    The programmer comes home with 12 loaves of bread.


    Originally Posted by brewbuck:
    Reimplementing a large system in another language to get a 25% performance boost is nonsense. It would be cheaper to just get a computer which is 25% faster.

  3. #3
    Registered User
    Join Date
    Sep 2006
    Posts
    6
    Actually, this is the first time I have posted to a message board.

    Hard to believe, but true. I haven't even established a cute litte quip to sign my message with like all the bright individuals I see here.

  4. #4
    Frequently Quite Prolix dwks's Avatar
    Join Date
    Apr 2005
    Location
    Canada
    Posts
    8,046
    Not much can be determined from that code. Can you post some more information?
    dwk

    Seek and ye shall find. quaere et invenies.

    "Simplicity does not precede complexity, but follows it." -- Alan Perlis
    "Testing can only prove the presence of bugs, not their absence." -- Edsger Dijkstra
    "The only real mistake is the one from which we learn nothing." -- John Powell


    Other boards: DaniWeb, TPS
    Unofficial Wiki FAQ: cpwiki.sf.net

    My website: http://dwks.theprogrammingsite.com/
    Projects: codeform, xuni, atlantis, nort, etc.

  5. #5
    Its hard... But im here swgh's Avatar
    Join Date
    Apr 2005
    Location
    England
    Posts
    1,475
    On another note, wouldnt you be better posting this on the windows programming board?
    It sounds like somthing a windows procedure might handle.

  6. #6
    Frequently Quite Prolix dwks's Avatar
    Join Date
    Apr 2005
    Location
    Canada
    Posts
    8,046
    This may be odd since it's not a OS specific problem.
    It doesn't seem like Windows code.

    [edit] Besides:
    On another note, wouldnt you be better posting this on the windows programming board?
    If the OP took your suggestion, [s]he'd get in trouble for cross-posting. If it belongs on the Windows forum, a moderator will move it. [/edit]
    dwk

    Seek and ye shall find. quaere et invenies.

    "Simplicity does not precede complexity, but follows it." -- Alan Perlis
    "Testing can only prove the presence of bugs, not their absence." -- Edsger Dijkstra
    "The only real mistake is the one from which we learn nothing." -- John Powell


    Other boards: DaniWeb, TPS
    Unofficial Wiki FAQ: cpwiki.sf.net

    My website: http://dwks.theprogrammingsite.com/
    Projects: codeform, xuni, atlantis, nort, etc.

  7. #7
    Registered User
    Join Date
    Aug 2006
    Posts
    99
    What HMI Package? What are you trying to write? What OPC (or DDE) server? Do you have your topics properly addressed to the correct device? Correct port? What protocol? Profibus? Modbus? ModbusTCP?

    Your sample program has nothing to do at all with communications to a field device on an industrial control system.

  8. #8
    Registered User
    Join Date
    Sep 2006
    Posts
    6
    Good day! I appreciate all the responses so far and realize I have not given enough data.

    The HMI database is Crimson 2.0 from redlion. The programming is in C++ for Modbus communications from the Red Lion HMI to a series of Ramp to Set Point Controllers. I have the addresses for the controllers for the program to talk to. The program will build a recipe to pass to the controllers to heat to a certain temperature, check to make sure all the thermocouples are reading the same temperature, then move on to the next step going to 1125 degrees, then cooling down over a period.

    The program Database can be downloaded for free at http://www.redlion.net/Support/Softw...n2.0/Setup.exe
    and I have my database file that can be uploaded to any interested parties.

    Thanks again for your responses.

  9. #9
    and the hat of wrongness Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    32,484
    But where is YOUR code you wrote to actually talk to the devices?
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.
    I support http://www.ukip.org/ as the first necessary step to a free Europe.

  10. #10
    Registered User
    Join Date
    Sep 2006
    Posts
    6
    I believe the answer is that the code is inside the HMI device. Within the Crimson 2 program. The Crimson 2 program has 7 interface sections one of which is the programming section. One is interface design, one is communications setup, one is data logger, one is web server, and the last one is security. All of the programming code is done in the programming section.

  11. #11
    Registered User
    Join Date
    Sep 2006
    Posts
    6
    Here are other code variables entered

    This is "begin"

    Code:
    State = RunningStep = 0;
    ActiveSP = SPs[RunningStep];
    ActiveSP1 = SPs1[RunningStep];
    ActiveRamp = Ramps[RunningStep];
    ActiveRR1 = Ramps1[RunningStep];
    ActiveSoak = Soaks[RunningStep];
    ActiveSoak1 = Soaks1[RunningStep];
    
    MainProgram();

    The code entered in my first post was called "main"

    and I wrote this to "clear" data entered

    Code:
    
    int i;
    
    for(i = 0; i < 16; i ++)
    {
    	SPs[i] = 0;
    	Ramps[i] = 0;
    	Soaks[i] = 0;
    }


    thanks!

  12. #12
    and the hat of wrongness Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    32,484
    All that seems to be doing is altering a few variables.

    I'm beginning to think this has nothing to do with C++ at all, and it's just some simple scripting language which vaguely resembles C++.

    Nor am I interested in downloading 30MB of application just to find out.
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.
    I support http://www.ukip.org/ as the first necessary step to a free Europe.

  13. #13
    Registered User
    Join Date
    Sep 2006
    Posts
    6
    It would appear that I posted this problem to the wrong group of programmers. I do apologize for wasting time. I was told by the HMI company that the programming language was C++ and I took that at their word.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Feedback: Functional Specification Wording
    By Ragsdale85 in forum C++ Programming
    Replies: 0
    Last Post: 01-18-2006, 03:56 PM
  2. char copy
    By variable in forum C Programming
    Replies: 8
    Last Post: 02-06-2005, 09:18 PM
  3. i am not able to figure ot the starting point of this
    By youngashish in forum C++ Programming
    Replies: 7
    Last Post: 10-07-2004, 02:41 AM
  4. Converting from Screen to World Coordinates
    By DavidP in forum Game Programming
    Replies: 9
    Last Post: 05-11-2004, 12:51 PM
  5. DOS, Serial, and Touch Screen
    By jon_nc17 in forum A Brief History of Cprogramming.com
    Replies: 0
    Last Post: 01-08-2003, 03:59 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21