Jump to content
OMRON Forums

jieyueduxing

Members
  • Posts

    5
  • Joined

  • Last visited

Everything posted by jieyueduxing

  1. hello,dear fahmad,thanks for your help! Just now I tried your code and the result is the same as my previous result. this is the experiment EthCmd.RequestType = VR_DOWNLOAD; EthCmd.Request = VR_PMAC_GETRESPONSE; EthCmd.wValue = 0; EthCmd.wIndex = 0; strcpy(cCommand,"p100=30"); EthCmd.wLength = htons((u_int16_t)strlen((const char*)cCommand)); wcsncpy((wchar_t*)&EthCmd.bData[0],(const wchar_t *)cCommand,strlen(cCommand)); printf("Attempting Get Response\n"); send(sock,(const char *)&EthCmd,ETHERNETCMDSIZE + strlen(cCommand),0); recv(sock,cResponse,1400,0); printf("%s\n",cResponse); the result is the value of p100 is changed to 30,but the cResponse receive the Messy code. I do another experiment.now is strcpy(cCommand,"p100=30");and I expect the cResponse can receive the '30',but the actual is still Messy code. the conclusion is : the strange phenomenon is we can change the value of p100 in pmac,but we can't get the value of the p100 from the pmac. you know the pmacserver can finish the communication job very well through the tcp/ip. so I think there must be someplace I ignore to configure,but I don't know where.
  2. hello,dear fahmad,thanks for your help! Just now I tried your code and the result is the same as my previous result. this is the experiment EthCmd.RequestType = VR_DOWNLOAD; EthCmd.Request = VR_PMAC_GETRESPONSE; EthCmd.wValue = 0; EthCmd.wIndex = 0; strcpy(cCommand,"p100=30"); EthCmd.wLength = htons((u_int16_t)strlen((const char*)cCommand)); wcsncpy((wchar_t*)&EthCmd.bData[0],(const wchar_t *)cCommand,strlen(cCommand)); printf("Attempting Get Response\n"); send(sock,(const char *)&EthCmd,ETHERNETCMDSIZE + strlen(cCommand),0); recv(sock,cResponse,1400,0); printf("%s\n",cResponse); the result is the value of p100 is changed to 30,but the cResponse receive the Messy code. I do another experiment.now is strcpy(cCommand,"p100=30");and I expect the cResponse can receive the '30',but the actual is still Messy code. the conclusion is : the strange phenomenon is we can change the value of p100 in pmac,but we can't get the value of the p100 from the pmac. you know the pmacserver can finish the communication job very well through the tcp/ip. so I think there must be someplace I ignore to configure,but I don't know where.
  3. hello! Now it's august 16th and I am writting my own tcp/ip socket code to run on my real system.during this process, I meet some problems which I can't work out. I make use of the VR_PMAC_GETRESPONSE explained in the ninth page of ethernet protocol.pdf to send the command string like "p100=100" to the pmac and it will set the value of the register "p100" to 100,which is good ,but then the recv function recvied the string which is "error4" from the pmac.In a word, the "send"function can send the right "string" and get the right result,but the pmac didn't response a right string,I don't know the reason. Another example is that the program use the "send" function to send the string "p100",but the "recv" function just gets the string"error4" rather than "100"which should be the right value of "p100" ,and i think it's strange. The follow is my key kode,thank you for helping me to get the right response! SOCKET sockClient=socket(AF_INET,SOCK_STREAM,0); SOCKADDR_IN addrSrv; addrSrv.sin_addr.S_un.S_addr=inet_addr("192.6.94.5"); addrSrv.sin_family=AF_INET; addrSrv.sin_port=htons(1025); connect(sockClient,(SOCKADDR*)&addrSrv,sizeof(SOCKADDR)); ETHERNETCMD EthCmd; EthCmd.RequestType=VR_DOWNLOAD; EthCmd.Request=0XBF; EthCmd.wValue=0; EthCmd.wIndex=0; EthCmd.wLength=htons((WORD)strlen(outstr)); strncpy((char*)&EthCmd.bData[0],outstr,(WORD)strlen(outstr)); send(sockClient,(char*)&EthCmd,ETHCMDSIZE+strlen(outstr),0); //send the command string to pmac and it works well recv(sockClient,szPMACDATA,1400,0); //recive the reponse relative to the send string but it doesn't work well
  4. Hi,sina!Thank you very much for your guide!I will try this section!
  5. hello!Now we are taking use of the Clipper(Turbo PMAC2 Eth-Lite) as our controller and we want to write a host communication program used in IntervalZero’s RTX Real-time Platform to decrease the communiction time between the host PC and the PMAC.We had test the time the funtion GetResponseEx() takes in the Visual Studio which is about 15ms,and we want to decrease it to 1ms,so we want to write a new communication program which runs on the real time platform,but I don't know if the Delta Tau allow us to do this .If Delta Taua allows,could you please tell me how to finis it. thank you! Expect your answer. My email is 944754284@qq.com
×
×
  • Create New...