toTAZ

MrPLC Member
  • Content count

    37
  • Joined

  • Last visited

Everything posted by toTAZ

  1. hi i try to swap bytes in a word with protocol macro but i cannot find how can i do it. i use swap command in plc program and then use this buffer result in cx-protocol. buts its looking hard. is there any way to change byte order thanks.
  2. SCU41 password protected

    thanks man
  3. how can i read CJ1m plc node adress ? i check plc manual and saw only changing node number via cx-programmer. but i want to learn node no in ladder program
  4. transfer compiled file to plc

    i usually use cj1m series plc. for upgrading plc programs i use cf card. is there any other program for transfering compiled obj file without cxprogrammer. command line or with interface its doesnt matter. if you know protocol also i can write. thanks
  5. transfer compiled file to plc

    hi Yair,Sleepy Wombat yair, i dont have any eth. module, Sleepy Wombat, thanks for suggestion, i download this utulity, after some tests, iwill send results
  6. cant transfer program to cj1m cpu12

    is there any other way to use it again , i didnt find digital camera, maybe any other format tool or format can repair memory card.
  7. cant transfer program to cj1m cpu12

    thanks anonymous , bit 9 is on, "Memory Card error - Is the card installed correctly / is the correct file on the card?" i think its not about installation, i can see all files in CF card with cx-programmer. this attachment show which files is loaded in card. is there any other type file, or settings, (note : "prohibit program overwrite..." or other option is disabled)
  8. cant transfer program to cj1m cpu12

    hi, i have a cj1m-cpu21, i try to load program with compact flash. i have buy a 64 mb cf and format it fat16. then load autoexec.obj and other project file in cf. i plug cf and switch 2 and reboot plc, but eccours memory error 0x80f1. where is the problem sorry for my terrible english
  9. i use cx programmer 5.0.. sometimes adrees reference tool get lost. i click shourt cut or use alt+4 but i cant see it. i delete *.opt files but it didnt work then every times i unistall all program and delete all registry settings and install it again. is it about my configuration or bug
  10. Where Is My Address Reference Tool :)

    tools - options - general : window environment : only window : ladder - adress reference tool :) then restart program. now its working :) after that
  11. OMRON CQM1H cpu51 P with C++

    if you use serial communication, i think, the best way, writing your own code :D http://forums.mrplc.com/index.php?showtopic=2231&hl=
  12. PLC PROTECTION

    http://forums.mrplc.com/index.php?showtopic...findpost&p=4748
  13. Omron Program Password Protect

    hi i have a omron cqm1h plc and cqm1-me04r memory. i want to protect my program and i used fun49 ins. but it didnt work. i have already upload my program, where is the problem? does anyone help me :*-( thank you
  14. Serial network connections

    thanks Jay
  15. Serial network connections

    hi iam again icant find k3sc-10 usb-rs485 convertors usb driver. i look omron web site and goggle but icouldnt find it. if you have driver could you sen me or upload download section thanks
  16. Omron K3GN Digital Panelmeter

    Hi everyone :) i wantto use 3 omron k3gn panelmeter on system, and using with rs485 can i collect display data this 3 panelmeter (like figure 2) in manual (page 123) show only one k3gn (figure 1) if this is possible, how must i do it, using with pmcr command ?
  17. hi, we want to mount panel pc(has a 20 gb 5400rpm notebook harddrive) on the rack, but in this panel there is 3g3mv2 2 phase 2.2 kw invertor. icant found any warn, but ithink its maybe hazardous for harddisk.. what do you think. (distance is 20~30 cm) sorry, my english may (not may,certainly) bad
  18. max analog i/o and RF modem

    actually i want to mount 20 analog input node and a analog output.. and send these value via rf modem. 1- maximum how many analog i/o can be mounted to CQM1hcpu21 plc.. 2- is there any embedded omron rf modem.. 3- which type plc more suitble for this job ? thanks
  19. max analog i/o and RF modem

    ooops sory i found first question's answer :)
  20. Serial communication between PLC's

    sorry this is correct answer :)
  21. Serial communication between PLC's

    maybe because of this
  22. Hi, this my example program for comm. pc and plc. system speaking over the DM area sorry my english still terrible because of this i cant write more english comment its only for education,, this picture show dm write package this is my example system i used Cport v3.0, LMDTools v6.11, Delphi 7 unit Unit1; interface uses  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,  Dialogs, CPort, StdCtrls, ExtCtrls, CPortCtl, LMDCustomComponent,  LMDWndProcComponent, LMDCustomFormFill, LMDFormFill, Buttons, LMDControl,  LMDBaseControl, LMDBaseGraphicControl, LMDBaseLabel,  LMDCustomSimpleLabel, LMDSimpleLabel, LMDGraphicControl,  LMDBaseMeter, LMDCustomProgressFill, LMDProgressFill, LMDBaseShape,  LMDShapeControl, LMDShadowFill, LMDLEDCustomLabel, LMDLEDLabel,  LMDScrollText; type  TForm1 = class(TForm)    ComPort1: TComPort;    TimerPLCRead: TTimer;    Panel1: TPanel;    ComLed1: TComLed;    ComLed2: TComLed;    ComLed3: TComLed;    Label1: TLabel;    Label2: TLabel;    Label3: TLabel;    LMDFormFill1: TLMDFormFill;    BitBtn1: TBitBtn;    Memo2: TMemo;    Image1: TImage;    Image2: TImage;    Image3: TImage;    LMDSimpleLabel1: TLMDSimpleLabel;    LMDSimpleLabel2: TLMDSimpleLabel;    LMDProgressFill1: TLMDProgressFill;    SpeedButton1: TSpeedButton;    SpeedButton2: TSpeedButton;    LMDShapeControl1: TLMDShapeControl;    Image4: TImage;    Image5: TImage;    LMDSimpleLabel3: TLMDSimpleLabel;    LMDSimpleLabel4: TLMDSimpleLabel;    SpeedButton3: TSpeedButton;    SpeedButton4: TSpeedButton;    LMDShapeControl2: TLMDShapeControl;    LMDSimpleLabel5: TLMDSimpleLabel;    LMDLEDLabel1: TLMDLEDLabel;    LMDSimpleLabel6: TLMDSimpleLabel;    LMDLEDLabel2: TLMDLEDLabel;    LMDSimpleLabel7: TLMDSimpleLabel;    LMDShadowFill1: TLMDShadowFill;    LMDSimpleLabel8: TLMDSimpleLabel;    Image6: TImage;    Image7: TImage;    Image8: TImage;    LMDSimpleLabel9: TLMDSimpleLabel;    LMDSimpleLabel10: TLMDSimpleLabel;    LMDProgressFill2: TLMDProgressFill;    SpeedButton5: TSpeedButton;    SpeedButton6: TSpeedButton;    LMDShapeControl3: TLMDShapeControl;    LMDLEDLabel3: TLMDLEDLabel;    LMDSimpleLabel14: TLMDSimpleLabel;    LMDLEDLabel4: TLMDLEDLabel;    LMDSimpleLabel15: TLMDSimpleLabel;    LMDShadowFill2: TLMDShadowFill;    LMDSimpleLabel16: TLMDSimpleLabel;    Image11: TImage;    LMDSimpleLabel11: TLMDSimpleLabel;    Image9: TImage;    Image10: TImage;    LMDSimpleLabel17: TLMDSimpleLabel;    LMDSimpleLabel18: TLMDSimpleLabel;    SpeedButton7: TSpeedButton;    SpeedButton8: TSpeedButton;    LMDShapeControl4: TLMDShapeControl;    Image12: TImage;    Image13: TImage;    Image14: TImage;    Label4: TLabel;    Label5: TLabel;    LMDSimpleLabel12: TLMDSimpleLabel;    LMDSimpleLabel13: TLMDSimpleLabel;    procedure FormCreate(Sender: TObject);    procedure TimerPLCReadTimer(Sender: TObject);    procedure BitBtn1Click(Sender: TObject);    Function hexToInt(hexStr: string): longint;    procedure VarstoEdits;    procedure SpeedButton4Click(Sender: TObject);    procedure Panel1Click(Sender: TObject);  private    cSendBuffer        : PChar;   // outgoing buffer    cRcvBuffer         : PChar;   // incomming buffer    CharCntReceived    : Integer; // incomming charecter count    iErrorCount        : integer; // Error Count    myReadOnlyDMArea   : array [0..14] of Word; // PLC DM area    procedure CalcCRC(sStr:PChar;iLength :Integer; var Fcs1,Fcs2:Char);    Function  CheckCRC(sStr:PChar;iLength :Integer): Boolean;    { Private declarations }  public    { Public declarations }  end; var  Form1: TForm1; implementation {$R *.dfm} {--------------------------------------------------------------------------} procedure TForm1.FormCreate(Sender: TObject); var i:integer; begin cRcvBuffer := StrAlloc(512); cSendBuffer := StrAlloc(512); for i:=0 to 511 do cSendBuffer[i] := #0; for i:=0 to 14 do myReadOnlyDMArea[i]:=0; CharCntReceived := 0; iErrorCount := 3; comport1.Connected:=TRUE; comport1.ClearBuffer(TRUE,TRUE); TimerPLCRead.Enabled := TRUE; end; {--------------------------------------------------------------------------} {Tform1.FormClose} procedure TForm1.BitBtn1Click(Sender: TObject); begin // Program kapatılmadan önce timer ve seri port kapatılmalı. // Seri portta çıkan bir hatadan dolayı kapatmadan önce Clearbuffer ile  temizlenmesi lazım TimerPLCRead.Enabled:=FALSE; comport1.ClearBuffer(TRUE,TRUE); //comport1.Connected:=FALSE; Close; end; {--------------------------------------------------------------------------} // Tüm SpeedButtonlar Bu Fonksiyna Bağlı (* DM 4: Valve and pomp output (100.00 .. )    0001 : Output 100.0  Depot 2 - out valve and pomp    0010 : Output 100.1  Depot 2 - witer valve    0100 : Output 100.2  Depot 1 - Çıkış Valfi-Pompa    1000 : Output 100.3  Depot 1 - Giriş Valfi *) procedure TForm1.SpeedButton4Click(Sender: TObject); var cFcs1 , cFcs2:Char; begin try  cSendBuffer[0] := '@';  cSendBuffer[1] := '0';  cSendBuffer[2] := '0';  cSendBuffer[3] := 'W';  cSendBuffer[4] := 'D';  cSendBuffer[5] := '0';  cSendBuffer[6] := '0';  cSendBuffer[7] := '0';  cSendBuffer[8] := '4';  if SpeedButton1.Down then cSendBuffer[9] := '1' else cSendBuffer[9] := '0';  if SpeedButton3.Down then cSendBuffer[10] := '1' else cSendBuffer[10] := '0';  if SpeedButton5.Down then cSendBuffer[11] := '1' else cSendBuffer[11] := '0';  if SpeedButton7.Down then cSendBuffer[12] := '1' else cSendBuffer[12] := '0';  CalcCRC(@cSendBuffer[0], 13, cFcs1, cFcs2);  cSendBuffer[13] := cFcs1;  cSendBuffer[14] := cFcs2;  cSendBuffer[15] := '*';                        cSendBuffer[16] := #13;  cSendBuffer[17] := #0;  label4.Caption:= cSendBuffer;  comport1.WriteStr(cSendBuffer);  iErrorCount:= 4; finally //TimerPLCRead.Enabled:=TRUE; end; end; {--------------------------------------------------------------------------} procedure TForm1.TimerPLCReadTimer(Sender: TObject); var PacketOK  : boolean;    LastCount : integer;    y         : integer; begin inc(iErrorCount); // Porttan tampona gelen veriyi alır ve tampon değişkene aktarır. // Eğer AsyncPro bileşenleri kullanılacak ise bu iki satır siline aşağıdaki ek yapıla LastCount := comport1.read(cRcvBuffer[CharCntReceived],512); CharCntReceived := CharCntReceived + LastCount; PacketOK := ((CharCntReceived = 71 ) and (cRcvBuffer[0] = '@') and (cRcvBuffer[69] = '*')); if PacketOK then PacketOK := CheckCRC(@cRcvBuffer[0],67); if PacketOK or (iErrorCount > 5 ) then  begin    //Eğer packet sağlam ise stringi parse et..      if PacketOK then      begin        for y:=0 to 14 do myReadOnlyDMArea[y] := hexToInt(Uppercase(copy(cRcvBuffer,8+(y*4),4)));        VarsToEdits;      end;    // Bufferi temizle ve PLC'den yeni paket veri iste    iErrorCount:=0;    CharCntReceived := 0;    comport1.WriteStr('@00RD0000001552*'+#13+#0);  end; end; {--------------------------------------------------------------------------} (*<<<>>><<<>>>DM Area Map<<<>>><<<>>> DM 0  : Depo 1 Analog Sıcaklık Bilgisi DM 1  : Depo 1 Analog Basınç Bilgisi DM 2  : Depo 2 Analog Sıcaklık Bilgisi DM 3  : Depo 2 Analog Basınç Bilgisi <<<>>><<<>>>DM Area Map<<<>>><<<>>>*) procedure Tform1.VarstoEdits; var tempStr : string;    y : integer; begin //<<<>>><<<>>>DEPO 1 için<<<>>><<<>>> //Sıcaklık tempStr:= Floattostrf(((myReadOnlyDMArea[0]*200/65535)-100),fffixed,8,1); while length(tempStr)<6 do  tempStr:= ' '+tempStr; LMDLEDLabel1.Caption := tempStr+' C'; //Basınçtan miktar LMDProgressFill1.UserValue := myReadOnlyDMArea[1]; tempStr:= Floattostrf(((myReadOnlyDMArea[1]*4000/65535)),fffixed,8,1); while length(tempStr)<6 do  tempStr:= ' '+tempStr; LMDLEDLabel2.Caption := tempStr+' L'; //<<<>>><<<>>>DEPO 2 için<<<>>><<<>>> //Sıcaklık tempStr:= Floattostrf(((myReadOnlyDMArea[2]*200/65535)-100),fffixed,8,1); while length(tempStr)<6 do  tempStr:= ' '+tempStr; LMDLEDLabel3.Caption := tempStr+' C'; //Basınçtan miktar LMDProgressFill2.UserValue := myReadOnlyDMArea[3]; tempStr:= Floattostrf(((myReadOnlyDMArea[3]*4000/65535)),fffixed,8,1); while length(tempStr)<6 do  tempStr:= ' '+tempStr; LMDLEDLabel4.Caption := tempStr+' L'; //Memo2 gelen DM bilgilerini ekranda göstermek için kullanılır. //Memo2 LED panele tıklayınca açılır. if memo2.Visible then begin  memo2.Lines.Clear;  for y:=0 to 14 do  memo2.Lines.Add('DM'+inttostr(y)+' = ' + inttostr(myReadOnlyDMArea[y])); end; end; (* -------------------------------------------------------------------------- -------------------------- YARDIMCI FONKSIYONLAR ------------------------- -------------------------------------------------------------------------- HexToInt : girilen Hexadesimal sayıyı integera çevirir CalcCRC  : girilem Length uzunluğunda pchar stringin 16bit CRC kodunu hesaplar ChechkCRC: girilen Length uzunluğunda pchar stringin 16bit CRC kodunu hesaplar           ve verilen CRC kodu ile karşılaştırır, doğru ise TRUE döner. *) Function Tform1.hexToInt(hexStr: string): longint; var iErr:integer; begin  Result := 0;  Val('$' + hexStr,Result , iErr); end; {--------------------------------------------------------------------------} procedure TForm1.CalcCRC(sStr:PChar;iLength :Integer;var Fcs1,Fcs2:Char); var cFcs, cTmpFcs:Byte;    i:Integer; begin cFcs := 0; for i := 0 to iLength-1 do    cFcs := cFcs XOR ORD(sStr[i]); cTmpFcs := cFcs AND $0f; if cTmpFcs > $09 then   Fcs2:=CHAR(cTmpFcs+$37) else   Fcs2:=CHAR(cTmpFcs+$30); cTmpFcs := cFcs SHR 4; if cTmpFcs > $09 then   Fcs1:=CHAR(cTmpFcs+$37) else   Fcs1:=CHAR(cTmpFcs+$30); end; {--------------------------------------------------------------------------} Function TForm1.CheckCRC(sStr:PChar;iLength :Integer): Boolean; var cFcs1, cFcs2: Char; begin result:= FALSE; CalcCRC(@sStr[0], iLength, cFcs1, cFcs2); if (cFcs1 = sStr[67]) and (cFcs2 = sStr[68]) then Result := TRUE; end; {--------------------------------------------------------------------------} procedure TForm1.Panel1Click(Sender: TObject); begin //Memo2 gelen DM bilgilerini ekranda göstermek için kullanılır. //LED panele tıklayınca açılır. memo2.Visible := NOT memo2.Visible; label4.Visible := NOT label4.Visible; end; end.  object ComPort1: TComPort    BaudRate = br9600    Port = 'COM1'    Parity.Bits = prEven    StopBits = sbTwoStopBits    DataBits = dbSeven    Events = [evRxChar, evTxEmpty, evRxFlag, evRing, evBreak, evCTS, evDSR, evError, evRLSD, evRx80Full]    FlowControl.OutCTSFlow = False    FlowControl.OutDSRFlow = False    FlowControl.ControlDTR = dtrDisable    FlowControl.ControlRTS = rtsDisable    FlowControl.XonXoffOut = False    FlowControl.XonXoffIn = False    Left = 112    Top = 16  end if you want to use Turbo power AsyncPro component, add on this form procedure TForm1.ApdComPort1TriggerAvail(CP: TObject; Count: Word); var LastCount,I : integer; begin LastCount:= Count; for I := 1 to LastCount do begin  cRcvBuffer[CharCntReceived]:= ApdComPort1.GetChar;  inc(CharCntReceived); end; end; and    ApdComPort1.OutPut := '@00RD0000001552*'+#13+#0;    //comport1.WriteStr('@00RD0000001552*'+#13+#0); and  object ApdComPort1: TApdComPort    ComNumber = 1    Baud = 9600    Parity = pEven    DataBits = 7    StopBits = 2    TraceName = 'APRO.TRC'    LogName = 'APRO.LOG'    OnTriggerAvail = ApdComPort1TriggerAvail    Left = 32    Top = 32  end i shared this example on turkish forum, and iwantto share it in here too,
  23. Omron CQM1H(DM Area) - PC Connection Example

    my programs are used in inds. field since 96, and there isnot any problem... i think delphi +turbo power async pro comport or delphi + serial comport best choice for comminication. the Most populer (and perfect)2 open source free component i think mscomm has lots of problems. it crash and its some times freeze..
  24. Omron CQM1H(DM Area) - PC Connection Example

    you can use same function on VB,(delphi is RAD too :) ) you can use mscomm component for comminication on VB but i think its very unstable.. yo should use delphi or C
  25. Omron CQM1H(DM Area) - PC Connection Example

    Our Delphi Programming Forum its only about delphi and SQL programming (we invitation all friends who know turkish )