Jump to content
OMRON Forums

fahmad

Members
  • Posts

    21
  • Joined

  • Last visited

Everything posted by fahmad

  1. In Pro2 library, PcommServer is the core engine and has all the required functions for data transfer between PMAC and host computer. Pcomm32W.dll contains few functions such as Open(), close and GetResponse() etc and provides support for only some legacy applications. No new applications should be developed using Pcomm32W.dll. This is why there is no documentation and no example programs available for Pcomm32W.dll. Pcommserver based software development kit supports all modes of communication and provides plenty of sample programs for VB, C# and C++ environments. Please refer to PcommServer manual for attaching to GetMem() and SetMem() methods for data transfer between PMAC controller and host computer.
  2. After I posted the response I noticed that this text box ate all my control characters Correct sequence of response with I3=2 is (I removed <> around the control characters) With I3=2: P1..3 CR ...... ; Valid command requiring data response 25 CR 50 CR 75 CR ACK ; PMAC responds with requested data
  3. After I posted the response I noticed that this text box ate all my control characters Correct sequence of response with I3=2 is (I removed <> around the control characters) With I3=2: P1..3 CR ...... ; Valid command requiring data response 25 CR 50 CR 75 CR ACK ; PMAC responds with requested data
  4. PMAC's handshake control variable I3 controls handshake characters that come back from PMAC along with the response. For I3=2 (Pewin32Pro2 default), response to multiple queries are as follows: With I3=2: P1..3...... ; Valid command requiring data response 255075 #1J+........ ; Valid command not requiring data response ....... ; Acknowledging character UUU .......... ; Invalid command ............. ; PMAC reports error It is responsibility of caller to handle all control characters. TextBox does not add line with . In GetResponseEx() if you pass the bAddlf flag as TRUE then it will replace with . See the code bellow from PcommServer getResponseEx() function. rret = GetLineEx( dwDevice, str, 255); cc = COMM_CHARS(rret); if(cc > 0) { // Change '\r' or add linefeed if requested if(bAddLF && str[cc - 1] == '\r') str[cc - 1] = '\n'; ret += cc; answer += str; }
  5. PMAC's handshake control variable I3 controls handshake characters that come back from PMAC along with the response. For I3=2 (Pewin32Pro2 default), response to multiple queries are as follows: With I3=2: P1..3...... ; Valid command requiring data response 255075 #1J+........ ; Valid command not requiring data response ....... ; Acknowledging character UUU .......... ; Invalid command ............. ; PMAC reports error It is responsibility of caller to handle all control characters. TextBox does not add line with . In GetResponseEx() if you pass the bAddlf flag as TRUE then it will replace with . See the code bellow from PcommServer getResponseEx() function. rret = GetLineEx( dwDevice, str, 255); cc = COMM_CHARS(rret); if(cc > 0) { // Change '\r' or add linefeed if requested if(bAddLF && str[cc - 1] == '\r') str[cc - 1] = '\n'; ret += cc; answer += str; }
  6. The best way to communicate with Turbo PMAC while having Pewin32Pro2 active is to use PcommServer.exe (Pcomm32Pro2 library). Pcommserver.exe is a COM Interface. It does have wrapper dll (Pcomm32W.dll). The wrapper dll has some (not all) core functions exposed for external applications. Pcommserver.exe (Pcomm32Pro2 library) is a purchasable product with Delta Tau part number 3A0-9PPRO2-35x. I comes with multiple examples in Microsoft C++, C#, VB, and CBuilder along with complete documentation. I have attached a sample template for PcommServer based example using C++ for your reference. Farooq BinRotLoad.zip
  7. The best way to communicate with Turbo PMAC while having Pewin32Pro2 active is to use PcommServer.exe (Pcomm32Pro2 library). Pcommserver.exe is a COM Interface. It does have wrapper dll (Pcomm32W.dll). The wrapper dll has some (not all) core functions exposed for external applications. Pcommserver.exe (Pcomm32Pro2 library) is a purchasable product with Delta Tau part number 3A0-9PPRO2-35x. I comes with multiple examples in Microsoft C++, C#, VB, and CBuilder along with complete documentation. I have attached a sample template for PcommServer based example using C++ for your reference. Farooq
  8. Gilles, There are several timeout values for socket timeouts. #define FLUSH_SOCKTO 250 #define SENDLINE_SOCKTO 500 #define GETBUFFER_SOCKTO 2000 //(This is a 2 second wait time while receiving data from PMAC before you get an error message) #define GETSETMEM_SOCKTO 500 #define SENDCHAR_SOCKTO 250 #define INPORT_SOCKTO 500 #define FLUSH_TIMEOUT 10 Can you also tell me what version of Pcomm32 library ( Pro or Pro2) are you using? Farooq
  9. Gilles, The socket timeout message pops up if the communication is lost and is not re-configurable unless we recompile Pcomm32. What needs to be investigated is why the communication is lost in the first place. Farooq
  10. "getsends" has been replaced with new process "sendgetsends". This process can send and receive messages on 8 ports Port0 - Port7. Latest PowerPMAC IDE (due to be released withing this month) supports all 8 ports. From within the IDE, Port0 is enabled by default for debug messages and all other ports are disabled at startup. These ports port1-port7 are available for users' messages. Further, if the port is in use then user gets a port-busy error message and will not be able to connect to it until previous client has closed the connection. Although "sendgetsends" is an independent process, I will update everyone after talking to Ed Lay regarding load issue.
  11. Scott, During your installation a vital library "msflxgrd.ocx" failed to register. There could be two reasons for for this error. Either Pewin32PRo2 Suite installation was done as normal user and NOT as and administrator or Computer did not restart properly after installation before launching Pewin32PRo2 executable To resolve the problem do the following: 1. Remove previous installation and re-install Pewin32PRo2 Suite with administrative privileges and restart the computer, if the problem does not go away then 2. Launch command Window with administrative privileges and issue the command regsvr32 C:\Windows\System32\msflxgrd.ocx (32-bit Windows) or regsvr32 C:\Windows\SysWow64\msflxgrd.ocx (64-bit Windows) This should resolve the issue. Farooq
  12. Raghav, The latest Installation of Pewin32PRO2 is true for 32-bit as well as 64-bit operating systems. It is available on Delta Tau's website under software downlaods at following URL. http://www.deltatau.com/DT_Products/SoftwareDetails.aspx?CatID=500-PMAC%20EXECUTIVE%20PRO2%20SUITE Also, look at the 64-Bit update NOTE. http://www.deltatau.com/Common/Product%20Bulletins/Updates/PMAC%20Executive%2064-Bit%20Drivers%20upgrade.pdf
  13. Error4 comes back from PMAC if you send some (erroneous) binary number on the socket. Please check your code and make sure that no such number is being transmitted to PMAC. Also look at the following sequence for correct method to connect to a socket and use the VR_PMAC_GETRESPONSE call. typedef struct tagEthernetCmd { u_int8_t RequestType; u_int8_t Request; u_int16_t wValue; u_int16_t wIndex; u_int16_t wLength; u_int8_t bData[1492]; } ETHERNETCMD,*PETHERNETCMD; #define ETHERNETCMDSIZE 8 #define VR_PMAC_GETRESPONSE 0xBF #define VR_UPLOAD 0xC0 #define VR_DOWNLOAD 0x40 int result,sock,length; struct sockaddr_in client; ETHERNETCMD EthCmd; char cCommand[256],cResponse[2048]; printf("PMAC Ethernet communication test\n"); sock = socket (PF_INET,SOCK_STREAM, 0); client.sin_addr.s_addr = inet_addr("192.6.94.5"); client.sin_family = PF_INET; client.sin_port = htons(1025); length = sizeof(client); result = connect (sock,(__CONST_SOCKADDR_ARG)&client, (socklen_t)length); if(result ==0) printf("connect successful\n"); else printf("connect failed with result = %d\n",result); EthCmd.RequestType = VR_DOWNLOAD; EthCmd.Request = VR_PMAC_GETRESPONSE; EthCmd.wValue = 0; EthCmd.wIndex = 0; strcpy(cCommand,"RHX$0"); EthCmd.wLength = htons((u_int16_t)strlen((const char*)cCommand)); strncpy(&EthCmd.bData[0],cCommand,strlen(cCommand)); printf("Attempting Get Response\n"); send(sock,&EthCmd,ETHERNETCMDSIZE + strlen(cCommand),0); recv(sock,cResponse,1400,0);
  14. This message appears when serious communication error occurs due to following reasons 1. Unplug or other wire breaks Sol: Make sure that all wires are good and connections are tidy. Also, you can eliminate any switch or hub issue by replacing the extra hardware by a single crossover cable. 2. Pmac is non-responsive due to watchdog tripping or excessive servo load Sol: Check the status of watchdog LED (red) when problem occurs. Normal mode is OFF. Also, try to turn off PLCs and run your test again. You can achieve it by simply setting I5=0 I hope it helps Farooq
  15. Unsolicited Event is an Async Event. To launch the application user must specify which port to listen to. User can specify any or all of the available ports (0 thru 4). Once the applications is running, Power PMAC Firmware will scan the connected ports every millisecond and send messages to the user immediately. There is no delay at this point. PowerPMACIDE can be used as benchmark test for reliability and speed of these messages.
  16. Dave, I need more info regarding your problem, for example: 1. Version of PMAC Communication Library (Pro1, or Pro2) with exact version number? 2. Mode of communication (Serial, Ethernet, USB, PCI or ISA)? 3. The function in question is a legacy one and has been replaced by the new function GetResponseEx(). GetResponseEx() has slightly different specs. than the old function. Please the Library document for correct prototype. 4. The updated function for Downloading a file or files is PMACDownload() or Download(), again based on the library revision and is explained in the document accordingly.
  17. DPR offset in PMAC starts with Y address (16-bit wide) and then X address (16-bit wide). For example, RX:$60000 is same as DPRGetShort(dwDevice, 2, 2, bSuccess). Please notice that PC offset is 4 times the PMAC offset. Please verify these e numbers by launching DPRViewer from Pewin32Pro2's view menu. Farooq
  18. Parameters of DPRGetShort() include the device number, offset address, variable to hold two bytes, and boolean flag to indicate success od failure. There is no need to specify an X or Y register. The address parameter is to indicate the start address and next two bytes are to be read and casted ad 16 bit integer value. See the following code for prototype. Farooq STDMETHODIMP CPmacDevice::DPRGetShort(LONG dwDevice, LONG address, SHORT* pVal,VARIANT_BOOL *pbSuccess) { CHECKDEVICEPARAM(dwDevice); CHECKPOINTER2(pVal,pbSuccess); (theApp.DPRGetMem(dwDevice,address,sizeof(short),pVal) != NULL) ? *pbSuccess = VARIANT_TRUE : *pbSuccess = VARIANT_FALSE; return S_OK; }
  19. fahmad

    pcomm32

    PcommServer should work fine with .Net frameworks 1.1 (VS 2003), 2.0 (VS 2005) , 3.5 (VS 2008) and 4.0 (VS 2010) See following link for detailed instruction on how to integrate PcommServer under VS 2010. http://forums.deltatau.com/showthread.php?tid=234 Farooq
  20. Unplug notification is an event which is raised by the OS and duly captured by PcommServer. PcommServer has five types of common events: 1. Message Event 2. Error Event 3. ProgressEvent 4. Unsolicited message event 5. Interrupt event Unplug event is part of Error event and can be decoded by following identifier: MSG_ERR_USB_UNPLUGGED We have several examples in VB , C++ and C# illustating these events as part of Pcommserver library installation. I will try to put together a LabView VI to capture these event and post it soon. Farooq [quote='steve.milici' pid='980' dateline='1293730385'] [quote='franz91' pid='978' dateline='1293612714'] Thank you very much all for your explanations. One more question: I working with LabVIEW and PMAC2 Turbo with USB connection. How can I know with LabVIEW if USB was disconnect during runtime? [/quote] The PcommServerPro2 library has a function that will report when the USB/Ethernet communication has been interrupted. [/quote]
  21. Hi Ian, Non-Turbo PMACs' serial speed varies greatly from board to board. For older boards, the default speed is 9600 baudrate. For newer boards including most of PMAC lite boards the default speed is 38400, but speed really depends on CPU type, speed, and jumper settings. PMAC ISA and PMAC PC104 are identical as far as serial communication is concerned. PC104 is essentially an ISA bus. The difference is that PMAC PC104 is set at 38400 baudrat as default. PMAC lite with Flex CPU are also set at 38400 as default while for older boards serial speed is set at 9600 and is adjusted by jumpers as opposed to I variables. In Pewin32Pro and Pewin32Pro2 serial communication is optimally configured at 38400 baudrate and should work fine both with and without checksum. If you have the exact specification then call our customer support or any of software person and we will be able to help solve serial comm. problem. Farooq
×
×
  • Create New...