Thread: Touch Screen Monitor Program

Threaded View

Previous Post Previous Post   Next Post Next Post
  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.

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, 04:56 PM
  2. char copy
    By variable in forum C Programming
    Replies: 8
    Last Post: 02-06-2005, 10: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, 04:59 PM