Beckhoff EPP3504-0023 Short Manual page 89

4-channel measuring bridge,(sg) full/half/quarter bridge, 24 bit, 10 ksps
Hide thumbs Also See for EPP3504-0023:
Table of Contents

Advertisement

Commissioning
         //Due to 'output = gain * input + offset', the offset have to be adapted:
         nOffset := nOffset * nGain;
          // Initiate writing to CoE:
         nSubIndex := nSubIndScalGain;
         nSTATE_WRITE_COE := 10;
         nSTATE_SCALE_GAIN := nSTATE_SCALE_GAIN + 10;
END_IF
   10:
      IF(nSTATE_WRITE_COE = 0) THEN
         IF NOT (nOffset = 0) THEN
            // (bScalingOrder is TRUE)
            nDINT_Value := REAL_TO_DINT(nOffset);
            // Initiate writing to CoE (again):
            nSubIndex := nSubIndScalOffs;
            nSTATE_WRITE_COE := 10;
END_IF
         nSTATE_SCALE_GAIN := nSTATE_SCALE_GAIN + 10;
END_IF  
   20:
      IF(nSTATE_WRITE_COE = 0) THEN       
         // Scaling gain done within CoE of the device
         bScaleGainStart := FALSE;
         bScaleGainDone := TRUE;
         nSTATE_SCALE_GAIN := 0; // Set initial state
END_IF
   END_CASE
END_IF
IF (nSTATE_WRITE_COE > 0) THEN
   IF bWriteToCoEEnable THEN
      CASE nSTATE_WRITE_COE OF
      10:
         // Prepare CoE write access
         fb_coe_write(
            sNetId:=     userNetId,
            nSlaveAddr:= nUserSlaveAddr,
            nIndex:=     nCoEIndexScaler,
            bExecute:=   FALSE,
            tTimeout:=   T#1S
         );
         nSTATE_WRITE_COE := nSTATE_WRITE_COE + 10;
      20:
         // Write nDINT_Value to CoE Index "Scaler":
         fb_coe_write(
         nSubIndex:= nSubIndex,
         pSrcBuf:= ADR(nDINT_Value),
         cbBufLen:= SIZEOF(nDINT_Value),
         bExecute:= TRUE
         );
         nSTATE_WRITE_COE := nSTATE_WRITE_COE + 10;
      30:
         fb_coe_write();
         IF NOT fb_coe_write.bBusy THEN
EPP3504-0023
Version: 1.2
89

Advertisement

Table of Contents
loading

Table of Contents