예제 #1
0
bool CScriptEngine::RunScript(LPCSTR pstrCode)
{
   Clear();
   int cchLen = strlen(pstrCode) + 1;
   pstrStore = pstrScript = (LPWSTR) malloc((sizeof(WCHAR) * cchLen));
   if( pstrStore == NULL ) return false;
   pstrStore[0] = '\0';
   ::MultiByteToWideChar(::GetACP(), 0, pstrCode, cchLen, pstrStore, cchLen);
   __run(pstrStore);
   return strlen(m_szErrorMsg) == 0;
}
예제 #2
0
void PLC_task_proc(void *arg)
{
    PLC_SetTimer(common_ticktime__, common_ticktime__);

    while (!PLC_shutdown) {
        PLC_GetTime(&__CURRENT_TIME);
        __run();
        if (PLC_shutdown) break;
        rt_task_wait_period(NULL);
    }
}
예제 #3
0
bool CScriptEngine::Evaluate(LPCSTR pstrCode, VARIANT* pRet)
{ 
   ::ZeroMemory(m_szErrorMsg, sizeof(m_szErrorMsg));
   int cchLen = strlen(pstrCode) + 1;
   LPWSTR pwstr = pstrScript = (LPWSTR) malloc((sizeof(WCHAR) * cchLen));
   if( pwstr == NULL ) return false;
   pwstr[0] = '\0';
   ::MultiByteToWideChar(::GetACP(), 0, pstrCode, cchLen, pwstr, cchLen);
   int iStack = __pushstack();
   __run(pwstr);
   ::VariantCopy(pRet, &m_Stack[iStack - 1].vRet);
   __popstack(iStack);
   free(pwstr);
   return strlen(m_szErrorMsg) == 0;
}
예제 #4
0
void runPLC(void)
{
    PLC_GetTime( &__CURRENT_TIME );
    __run();
}
void GPSingleParallelMachineTest::run()
{
    __run();
}