RahulS
Registered: 15/06/12
Posts: 70
|
| Posted 30/07/12 at 02:02 PM | Reply with quote #1 |
|
haii...anybody knows any thread concept implementation in 4DGL... __________________ RHS |
| Loading... | |
ESPsupport
Moderator
Registered: 27/01/09
Posts: 4,252
|
| Posted 30/07/12 at 02:15 PM | 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 |
| Loading... | |
RahulS
Registered: 15/06/12
Posts: 70
|
| Posted 30/07/12 at 03:49 PM | 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 |
| Loading... | |
ESPsupport
Moderator
Registered: 27/01/09
Posts: 4,252
|
| Posted 30/07/12 at 03:57 PM | Reply with quote #4 |
|
| What I described should work well for you. |
| Loading... | |
RahulS
Registered: 15/06/12
Posts: 70
|
| Posted 30/07/12 at 04:00 PM | Reply with quote #5 |
|
Could plz give a sample code for a non blocking main loop... __________________ RHS |
| Loading... | |
ESPsupport
Moderator
Registered: 27/01/09
Posts: 4,252
|
| Posted 30/07/12 at 04:21 PM | 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 |
| Loading... | |
RahulS
Registered: 15/06/12
Posts: 70
|
| Posted 30/07/12 at 06:01 PM | Reply with quote #7 |
|
Yes...its working good..thanks a lot.... __________________ RHS |
| Loading... | |