News:

SMF - Just Installed!

Main Menu
Menu

Show posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Show posts Menu

Messages - sxbug

#1
I have solved all problem, mainly because there are too few documents provided by you.
Thanks。
#2
I also have a suggestion: don't have too many compilation conditions in the example program, and don't use multithreading in the example program, which will cause too many problems in some programs integration. thank you

Now, after integrating the SocketServerDemo and the DataProc DEMO program, I find that the acquisition function does not execute.( TForm1.nrDataProcessor1DataPacket(Sender: TObject;  Packet: TnrDataPacket);)Why?



Thanks for your help
#3
@Roman Novgorodov,Thanks

I've tried for a long time, but I still haven't solved this problem,Thank you for your help.


     sxbug
#4
I have seem these  example SocketClientDemo and SocketServerDemo . In the SocketServerDemo, it can only send characters to the client by manually entering characters through the terminal. I want to send arbitrary data to the client on the servermode, including invisible characters. How do I realize it?

I try to changed memo to nrTerminal

mystr:='12345678';
  //mystr[1]:=#01;  mystr[2]:= #03;   mystr[3]:= #00;   mystr[4]:= #00;
  //mystr[5]:= #00; mystr[6]:= #$2A ; mystr[7]:=#$C4;   mystr[8]:= #15;
  //nrSocket1.SendString(mystr);           //In ServerMode ,  What can this function do?
  if pgConnections.PageCount > 0  then begin
    myTerm:= form1.FindComponent('myTerm1');   //myTerm1 was Automatically generated
    If myTerm is TnrTerminal then begin
       TnrTerminal(MyTerm).SetFocus;
       TnrTerminal(MyTerm).BeginUpdate;
       TnrTerminal(MyTerm).TerminalInputStr(mystr);   //These char only display in server Terminal, but NOT send to client
       TnrTerminal(MyTerm).EndUpdate;
       keybd_event(65,0,0,0);                                       //Only this char send to Client
       //TnrTerminal(MyTerm).
       //TMemo(MyMemo).
    end;
  end;
#5
Can't the nrsocket servermode send data to the specified client? I think nrSocket's Server can create a list of clients and send data to the  specified client.
#6
I have a nrSocket Server, and  some clients connected to him,  How can I send string to a client?
#7
Hi Roman Novgorodov
  Thank you very much!

     sxbug
#8
Hi Roman Novgorodov

    Happy new year !

      sxbug@163.com
#9
Hi Roman Novgorodov
I just saw your reply. This is a great work to achieve these functions, I hope to be able to achieve,  enter values($12,$A5,$00 etc),  also enter ASC characters('ABC123abc' etc), to send information by nrcomm . It can also display hexadecimal number and character information in the memo.
Has solve the problem : the dataprocessor display timeout after received datas?

Could you pleased send me your program to learn?
Thanks

   sxbug@163.com
#10
After I used array of byte as the parameter to senddata() function, it was OK(could send these BIN data).But I don't understand why the dataprocessor after received data packets , displayed 'Timeout' error msg too?

Thanks
#11
mystr:pansichar;
mystr:=#$5A#$31#$80#$32#$33#$34#$FE#$EF;
  if nrComm1.Active then
    //nrComm1.SendString(mystr)
    nrComm1.SendData(mystr,8)

         5A 31 80 32 33 34 FE EF
recv:5A 31 C2 80 32 33 34 C3 BE C3 AF

There are still problems. And Why nrDataProcessor1 show Timeout?
Thanks
#12
send:5A A5 0A 00 05 C2 00 D0 FE EF
recv:5A 3F 05 3F C3 90 C3 BE 3F

Why? Thanks
#13
I used nrComm and data processor  to send and receive data(dataprocessor DEMO ,delphi 10.2 ). After testing on a computer, the RX and TX of the serial port are short circuited. The memo is used as the terminal of nrComm, and the nrComm is set to 115200bps,parity=none,stopbits=1,streamprotocol=none,bytesize=8。
  nrDataProcessor1.DataPackets[0].PacketBegin:=#$5A;
  nrDataProcessor1.DataPackets[0].Packetend:=#$FE;
  nrDataProcessor1.DataPackets[0].Active:=True;

Send with the following command:
mystr:=#$5A#$31#$80#$32#$33#$34#$FE#$EF;
  if nrComm1.Active then
    nrComm1.SendString(mystr)
  else
    ShowMessage('serial not open');

send:5A 31 32 33 34 FE EF
recv:5A 31 32 33 34 C3 BE C3 AF

send:5A 31 80 32 33 34 FE EF
recv:5A 31 C2 80 32 33 34 C3 BE C3 AF
#14
Hi

Thank you for your help. Let me test it again. Find out why.

    sxbug
#15
Hello
It has been checked in  v9.58 , and all the problems have been solved.
THANKS!!!
But there is one thing I don't understand: No matter what mode(ASC or RTU) is set, PLC can be read. What's the use of this setting(nrModbus.ASC)?
Thanks


     sxbug