4D SYSTEMS FORUM

Register New Posts
 
 
 


Reply
 
Author Comment
 
RahulS

Registered: 15/06/12
Posts: 70
Reply with quote #1 
haii...anybody knows any thread concept implementation in 4DGL...
__________________
RHS
ESPsupport

Moderator
Registered: 27/01/09
Posts: 4,252
Reply with quote #2 
What are you trying to achieve?

You would tend to code a non blocking main loop checking the touch panel.

If you were using serial comms, you could also add a non blocking check/read for the comms buffer within the main loop.

So most other things could go in the same place, maybe
RahulS

Registered: 15/06/12
Posts: 70
Reply with quote #3 
Thanks for ur reply...I am designing a GUI application and in that, first i want to display a splash screen at the same time in the back side a comport polling has to occur. So when the COM get a value, then it has to switch to another screen from the currently running splash screen. For that, i want to process has to run in parallel...splash screen and comport reading...thanks..
__________________
RHS
ESPsupport

Moderator
Registered: 27/01/09
Posts: 4,252
Reply with quote #4 
What I described should work well for you.
RahulS

Registered: 15/06/12
Posts: 70
Reply with quote #5 
Could plz give a sample code for a non blocking main loop...
__________________
RHS
ESPsupport

Moderator
Registered: 27/01/09
Posts: 4,252
Reply with quote #6 

    repeat
        // check comms for command, how to NAK invalid command
        if (com_Count() != 0)
            cmd[cmdi++] := serin() ;

            if (cmdi == 3) // assumes all serial commands are 2 bytes long
                // process command in 'cmd'
                cmdi := 0 ;
            endif
        endif

        // touch code processing, more detail in many Visi samples
        state := touch_Get(TOUCH_STATUS);               // get touchscreen status
        n := img_Touched(hndl,-1) ;

        if ((state == TOUCH_PRESSED) || (state == TOUCH_RELEASED) || (state == TOUCH_MOVING))
            // do whatever is required
        endif

    forever

RahulS

Registered: 15/06/12
Posts: 70
Reply with quote #7 
Yes...its working good..thanks a lot....
__________________
RHS
Previous Topic | Next Topic
Print
Reply

Quick Navigation:

Powered by Website Toolbox - Create a Website Forum Hosting, Guestbook Hosting, or Website Chat Room for your website.