| | |
| | | return 0;
|
| | | }
|
| | |
|
| | | inline void SetAddrBit(unsigned short * pW, unsigned char bitAddr)
|
| | | {
|
| | | (*pW)|=1<<(bitAddr&0xf);
|
| | | }
|
| | |
|
| | | inline void ResetBit(unsigned short * pW, unsigned char bitAddr)
|
| | | {
|
| | | (*pW)&=~(1<<(bitAddr&0xf));
|
| | | }
|
| | | static inline void SetBitValue(unsigned short * pW, unsigned char bitAddr, unsigned char Value)
|
| | | {
|
| | | if (Value) { SetAddrBit(pW, bitAddr);}
|
| | | else {ResetBit(pW, bitAddr);}
|
| | | }
|
| | |
|
| | | static inline unsigned char GetBitValue(unsigned short W, unsigned char bitAddr)
|
| | | {
|
| | | if (W&(1<<(bitAddr&0xf))) return 1;
|
| | | else return 0;
|
| | | }
|
| | |
|
| | |
|
| | | int ProcessPLCBinProg(const stBinProg1 * pBinprog, int nStepSize)
|
| | | {
|
| | | if (!PLCMem.bPLCRunning) return 0;
|
| | |
| | | break;
|
| | | }
|
| | |
|
| | | lastScanInputVal = PLCMem.ProgTrace[CurPos];
|
| | | lastScanInputVal = PLCMem.ProgTrace[CurPos]; //GetBitValue(KMem.WDFs);
|
| | | PLCMem.ProgTrace[CurPos] = KMem.CurVAL;
|
| | | CurPos += nNextPos;
|
| | | }
|