鍩轰簬CODESYS骞冲彴鐨凙NY鏁版嵁绫诲瀷鑷姩鐢熸垚Buffer搴忓垪-CODESYS V3-閰峰痉缃 - CoDeSys杞欢鏁欑▼涓嬭浇,CoDeSys宸ユ帶璧勮闂ㄦ埛
HSC6490-cn涓浗鍒堕狅紝涓浗鑺瘇
鏌ョ湅: 1468|鍥炲: 0

鍩轰簬CODESYS骞冲彴鐨凙NY鏁版嵁绫诲瀷鑷姩鐢熸垚Buffer搴忓垪

[澶嶅埗閾炬帴]

璇ョ敤鎴蜂粠鏈鍒

鍙戣〃浜 2023-9-22 21:57:57 | 鏄剧ず鍏ㄩ儴妤煎眰 |闃呰妯″紡
浠涔堝満鏅細鐢ㄥ埌Buffer搴忓垪锛
      Buffer搴忓垪涓鑸敤鍦ㄤ袱涓帶鍒跺櫒鎴栬2涓繘绋嬩箣闂寸殑閫氳銆傛爣鍑嗙殑閫氳鍗忚搴撲細鑷姩鐢熸垚Buffer搴忓垪锛屾兂瑕佷娇鐢ㄨ嚜瀹氫箟鍗忚鏃讹紝灏遍渶瑕佽嚜鍒涘缓Buffer搴忓垪銆
     涓嬮潰灏辨槸鍩轰簬CODESYS骞冲彴鐨凙NY鏁版嵁绫诲瀷鑷姩鐢熸垚Buffer搴忓垪婧愪唬鐮丗unction銆傚彲浠ュ埄鐢ㄨ鍔熻兘Function鏂逛究杩炵画鐨勭敓鎴怋uffer搴忓垪銆
  1. FUNCTION FC_MakeBuffer : BOOL
  2. VAR_INPUT
  3.         anyInput  : ANY;
  4.         pInPos    : POINTER TO DINT;
  5.         pInBuffer : POINTER TO ARRAY[0..255] OF BYTE;
  6.     xInVariableEn     : BOOL;       
  7.         pInVariableCount  : POINTER TO INT;
  8. END_VAR
  9. VAR
  10.         i         : DINT;       
  11.         pTemp1    : POINTER TO BYTE;
  12.         pTemp2    : POINTER TO BYTE;
  13.         VariableProperty : DataProperty1;       
  14. END_VAR
  15. VariableProperty.diLength:= anyInput.diSize;
  16. VariableProperty.pPostion := anyInput.pValue;
  17. pTemp1 := VariableProperty.pPostion;
  18. pTemp2 := pInBuffer + DINT_TO_DWORD(pInPos^);
  19. FOR i := 0 TO VariableProperty.diLength-1 BY 1 DO       
  20.         pTemp2^ := pTemp1^;
  21.         pTemp1  := pTemp1 + 1;
  22.         pTemp2  := pTemp2 + 1;
  23. END_FOR;
  24. pInPos^ := pInPos^ + VariableProperty.diLength;
  25. IF xInVariableEn THEN
  26.    pInVariableCount^ := pInVariableCount^ + 1;
  27. END_IF;  
澶嶅埗浠g爜
娉ㄦ剰锛氭墍鏈夊彉閲忛兘鏄渶浣庝綅鍦ㄥ乏渚э紝鍋氶珮浣嶅啀鍙充晶銆傚瓧绗︿覆鐨勮瘽锛屾渶宸︿晶瀛楃灏卞湪鏈宸︿晶銆
+10
涓嶈禐涓涓紵
鎵撹祻榧撳姳涓涓嬶紒
鍥炲

浣跨敤閬撳叿 涓炬姤

鎮ㄩ渶瑕佺櫥褰曞悗鎵嶅彲浠ュ洖甯 鐧诲綍 | 绔嬪嵆娉ㄥ唽 鏂版氮寰崥鐧婚檰

鏈増绉垎瑙勫垯

椤堕儴qrcode搴曢儴
鍏虫敞閰峰痉缃戣闃呭彿锛岃幏鍙栨洿澶氳祫璁紒

QQ|灏忛粦灞|鎵嬫満鐗|Archiver|閰峰痉璁哄潧 ( 鑻廔CP澶16065247鍙-1 )|缃戠珯鍦板浘

GMT+8, 2025-1-23 06:21 , Processed in 0.165686 second(s), 53 queries .

閰峰痉缃

© 2001-2013 Hicodesys. 鎶鏈敮鎸 by 閰峰痉缃

蹇熷洖澶 杩斿洖椤堕儴 杩斿洖鍒楄〃