leon78

MrPLC Member
  • Content count

    40
  • Joined

  • Last visited

Everything posted by leon78

  1. MinutesHours := BCD_TO_INT(%SW51); Hours := INT_TO_REAL(MinutesHours/100); Minutes := INT_TO_REAL(MinutesHours MOD 100);
  2. See help about %SW51 %SW51 = 16#HHMM
  3. The Standby PLC have IP address + 1. For example, 191.168.1.1 for the primary and 192.168.1.2 for the standby. Maybe you write data to the standby, and the primary rewrite it every scan. I think both the PLC are standby if you remove CHS card and you can write data.
  4. Concept V2.2 SP2

    FOR MODERATORS: IT IS NOT A PIRATED SOFTWARE! IT IS ONLY A FREE UPDATE SR2 FOR CONCEPT 2.2! https://cloud.mail.ru/public/7KRg/R8Z2Tjj7W
  5. Concept V2.2 SP2

    (deleted  - was moderator mistake)
  6. Concept V2.2 SP2

    You need *.asc file for import to other version of Concept.
  7. Exuse me, but I have C code only with Russian comments: {       UINT i;     UINT uTemp;     UINT uPriorMax;     *pLastPollErr = FALSE;         //ОПРЕДЕЛЕНИЕ ПРИОРИТЕТА     if (*pAbort || AliGetProgState()->coldInit || AliGetProgState()->warmInit)     //Требуется прервать опрос     {         //Остановка опроса при необходимости         *pStart = FALSE;         *pDev_Num_poll = 0;         for (i = 1; i <= *pDev_Num; i++)         {              //Выставить приоритет             (*pVar)[i-1].Prior = (*pCnst)[i-1].Prior_Beg;              //Сбросить состояние             (*pVar)[i-1].Stat = 0;         }     }     else     {         for (i = 1; i <= *pDev_Num; i++)         {             //Сбросить флаги завершения опроса             (*pVar)[i-1].Stat &= ~(MBP_POLL_SCAN_OK | MBP_POLL_SCAN_ERR);             if ((( (*pVar)[i-1].Stat & MBP_POLL_RUN ) == 0) && (*pVar)[i-1].Prior != 0)             //Устройство требуется опрашивать и оно не опрашивается             {                 //Увеличить приоритет опроса                 if ((*pVar)[i-1].Stat & MBP_POLL_LAST_OK)                     uTemp = *pSys_Time_Delta_100 * (*pCnst)[i-1].PriorAdd_Ok;                 else                     uTemp = *pSys_Time_Delta_100 * (*pCnst)[i-1].PriorAdd_Err;                 if ((*pVar)[i-1].Prior < 0xFFFF - uTemp)                     (*pVar)[i-1].Prior = (*pVar)[i-1].Prior + uTemp;                 else                     (*pVar)[i-1].Prior = 0xFFFF;             }         }     }     //РАБОТА С УСТРОЙСТВАМИ     if (!*pXXMIT_Activ  && !*pAbort)     //Блок XXMIT не запущен     {         if (*pStart && *pDev_Num_poll)         //Ранее отпрашивалось устройсво         {             (*pVar)[*pDev_Num_poll-1].Stat &= ~MBP_POLL_RUN;             if (!*pXXMIT_Code_Err)            //Опрос завершился без ошибок             {                 (*pVar)[*pDev_Num_poll-1].Stat &= ~(MBP_POLL_SCAN_ERR | MBP_POLL_LAST_ERR);                 (*pVar)[*pDev_Num_poll-1].Stat |= MBP_POLL_SCAN_OK | MBP_POLL_LAST_OK;                 (*pOK_Count)[*pDev_Num_poll-1] ++;             }             else            //Опрос завершился с ошибкой            {                    //Код ошибки                 (*pErr)[*pDev_Num_poll - 1] = *pXXMIT_Code_Err;                 (*pVar)[*pDev_Num_poll-1].Stat &= ~(MBP_POLL_SCAN_OK | MBP_POLL_LAST_OK);                 (*pVar)[*pDev_Num_poll-1].Stat |= MBP_POLL_SCAN_ERR | MBP_POLL_LAST_ERR;                 (*pErr_Count)[*pDev_Num_poll-1] ++;                 *pLastPollErr = TRUE;                 *pLastPollErrCode = *pXXMIT_Code_Err;                 *pLastPollDev = *pDev_Num_poll;            }            //Выставить приоритет            (*pVar)[*pDev_Num_poll-1].Prior = (*pCnst)[*pDev_Num_poll - 1].Prior_Beg;         }         //Поиск следующего опрашиваемого устройства         uPriorMax = 0;         uTemp = 0;         *pDev_Num_poll = 0;         *pStart = FALSE;         for (i = 1; i <= *pDev_Num; i++)         {             if ((*pVar)[i-1].Prior > 0 && (*pVar)[i-1].Prior > uPriorMax)             //Требуется опрос устройства и у него более высокий приоритет             {                 uPriorMax = (*pVar)[i-1].Prior;                uTemp = i;             }         }         if (uTemp)         //Найдено устройство, требующее опроса         {                 //Запуск нового опроса             (*pVar)[uTemp-1].Prior = 0;             *pXXMIT_Command =(*pXXMIT_PAR)[uTemp - 1].Command;             *pXXMIT_MsgLen =(*pXXMIT_PAR)[uTemp - 1].MsgLen;             *pXXMIT_Port =(*pXXMIT_PAR)[uTemp - 1].Port;             *pXXMIT_Baudrate =(*pXXMIT_PAR)[uTemp - 1].Baudrate;             *pXXMIT_Databits =(*pXXMIT_PAR)[uTemp - 1].Databits;             *pXXMIT_Stopbits =(*pXXMIT_PAR)[uTemp - 1].Stopbits;             *pXXMIT_Parity =(*pXXMIT_PAR)[uTemp - 1].Parity;             *pXXMIT_RespTour =(*pXXMIT_PAR)[uTemp - 1].RespTour;             *pXXMIT_RetryLmt =(*pXXMIT_PAR)[uTemp - 1].RetryLmt;             *pXXMIT_StartDly =(*pXXMIT_PAR)[uTemp - 1].StartDly;             *pXXMIT_EndDly =(*pXXMIT_PAR)[uTemp - 1].EndDly;             for (i = 1; i <= 5; i++)                 (*pXXMIT_MsgOut)[i - 1] =  (*pXXMIT_PAR)[uTemp - 1].MsgOut[i-1];             (*pVar)[uTemp - 1].Stat |= MBP_POLL_RUN;             *pDev_Num_poll = uTemp;             *pStart = TRUE;         }     }     return; }  
  8. Hi! I think you must use only one instance of the XXMIT block. Please, read help: 'Several XXMITs can not be activate at the same time. If more than one XXMIT is activated, the first scanned block will operate and prevent operation of all other XXMITs until it has completed. The next block in the scan that is called will generate an immediate fault code 150' Many time ago I had wrote a block for Concept. The block is manager for XXMIT. http://forums.mrplc.com/index.php?/files/file/271-management-of-the-block-xxmit/
  9. This is not possible. You must use mask for your case:   FOR (WordIndex :=0 TO 63) DO   FOR (BitIndex :=0 TO 15) DO       wMask := SHL(16#0001, BitIndex );      IF A[WordIndex] AND wMask  NE B[WordIndex] AND wMask  THEN         B[WordIndex] :=(B[WordIndex] AND NOT wMask) OR (A[WordIndex] AND wMask) ;         Res := (WordIndex*16) + BitIndex;         (other stuff) ;      END_IF;   END_FOR;END_FOR;
  10. Hi! I can try to help you. I have Concept 2.2 and I can export your project to ASCII file.
  11. Hi Atticuss, The Quantum Hot Stanby PLC has 3 modes: Primary, Standby, Offline. You can see it on a LCD display. If your PLC has connect with IO drop(s), and did start first, it is Primary. If your transfer project from Primary PLC to other PLC, other PLC is Standby. If your PLC has no connect with IO drop(s) after start or see other Primary PLC after start and has different project in memory, it is Offline
  12. The  PLC  scan IO in the Primary mode only. What is mode of your PLC?
  13. File Name: Modbus Master for Excel File Submitter: leon78 File Submitted: 10 Dec 2005 File Category: Demo Software Program for polling Modbus RTU Device for Excel. Click here to download this file
  14. See example without OPC: http://forums.mrplc.com/index.php?autocom=...mp;showfile=504
  15. You must delete input module with %IW1 register from configuration.
  16. Unity Pro XL

    If Primary PLC have address 1 in Modbus Plus, Standby PLC have address 33. For hot standby illustration see EFB HSBY_ST.
  17. See www.automatedsolutions.com/products/modbusplus.asp
  18. You can remove battery and power down. The program will be erased in 5 minutes (if it not in flash). The default settings: PLC Node 1, baud rate 9600, 8 data bit, 1 stop bit, even.
  19. File Name: The counter of time scan. File Submitter: leon78 File Submitted: 3 Nov 2006 File Category: Demo Software Copy lib\URET_LIB to dirctory Concept\Lib and delete all files ~*.*. The block T_SCAN output is time scan in units: TimeScan[0] - 1us TimeScan[1] - 10 us TimeScan[2] - 100 us TimeScan[3] - 1 ms TimeScan[4] - 10ms TimeScan[5] - 100ms TimeScan[6] - 1s Click here to download this file
  20. The counter of time scan.

    Version

    576 downloads

    Copy lib\URET_LIB to dirctory Concept\Lib and delete all files ~*.*. The block T_SCAN output is time scan in units: TimeScan[0] - 1us TimeScan[1] - 10 us TimeScan[2] - 100 us TimeScan[3] - 1 ms TimeScan[4] - 10ms TimeScan[5] - 100ms TimeScan[6] - 1s
  21. The example have limit 10 devices. But you can have greater limit. Notes: 1. The XXMIT read from 1 device during minimum 5 scan time period . 2. RS485 serial is typically limited to 32 devices. You must use repiter. 3. See Bridge Multiplexer for better.
  22. You must copy folder "URET_LIB" from site to folder "Concept\lib". And delete all ~*.* files from folder "Concept\lib". Block CRNTL_XM FFB will accessible after it.
  23. See example: http://forums.mrplc.com/index.php?autocom=downloads&showfile=271
  24. File Name: Lib for Concept 2.5 or 2.6 for write 1x and 3x registers. File Submitter: leon78 File Submitted: 24 Aug 2006 File Category: Demo Software Blocks for write 1x and 3x registers. 1. Copy URET_LIB in Concept\lib directory. 2. Delete all ~*.* files. 3. Open WRT_IN project. Click here to download this file