Jump to content
OMRON Forums

fahmad

Members
  • Posts

    21
  • Joined

  • Last visited

Posts posted by fahmad

  1. I have a legacy application that used the old PCOMM32.dll library. According to the PCOMMServer Pro 2 documentation, PCOMM32W is "A wrapper for the IPmacDevice Interface for legacy programs." So I am guessing what I am doing is exactly what PCOMM32W was meant for. I should note that the legacy application has been used for years successfully before the upgrade to the new Pcommserver Pro 2 Library.

     

    I have been able to successfully link to the PCOMM32W.dll library with the existing code, but I have noticed some discrepancies.

     

    OpenPmacDevice(gDeviceId)

    Under PCOMM32.dll this returned 0 for false and 1 for true. Under PCOMM32W.dll this returns 0 for false and 0xFFFF for true. I can work around this one easy enough, and after opening the device I can use the PmacGetResponseExA successfully.

     

    PmacDPRGetMem(gDeviceId, gPmacFromOffset4, gNFromPmac4,gFromPmac.f)

    Under PCOMM32.dll this would successfully fill gFromPmac.f with data from the DPR. With PCOMM32W.dll this fails to fill gFromPmac.f with any data at all.

     

    Are there any appnotes on PCOMM32W.dll covering problems such as this? Is there a change in the behavior of DPRGetMem? Any help on this would be appreciated.

     

     

    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

     

    Hello,

     

    I'm trying to develop a Python application that will control the Turbo PMAC2 and some other devices.

    This Turbo PMAC2 is installed inside a machine, and works very well with PWin32Pro2.

    I'm trying to use a dll to do this, is this the best option?

    I downloaded a lot of Turbo PMAC2 manuals, and I found the PComm32PRO manual:

    http://www.deltatau.com/manuals/pdfs/PCOMM32%20PRO.pdf?id=635415374139453187

    But a think it's obsolet, it talks about the PComm32.dll, and some examples that should be in the library, but it doesn't exist. I found just the PComm32W.dll and PcommServer.exe (that starts when I try to open a communication with PMAC2).

    These two, PWin32PRO2, are installed by PMAC Executive Pro2 Suite.

     

    Sometimes my application works, and I can read and change the value of a P variable(it was all that I could do until now), but it's totally unstable. It just works when it wants.

     

    Is there a new manual or a example about how to do this?

    Is a dll the best option?

     

    *I can not uninstall PWin32PRO2. The machine must work in the both options without reconfiguration.

    **The conection is USB.

     

    Thank you!

    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

     

    Hello,

     

    I'm trying to develop a Python application that will control the Turbo PMAC2 and some other devices.

    This Turbo PMAC2 is installed inside a machine, and works very well with PWin32Pro2.

    I'm trying to use a dll to do this, is this the best option?

    I downloaded a lot of Turbo PMAC2 manuals, and I found the PComm32PRO manual:

    http://www.deltatau.com/manuals/pdfs/PCOMM32%20PRO.pdf?id=635415374139453187

    But a think it's obsolet, it talks about the PComm32.dll, and some examples that should be in the library, but it doesn't exist. I found just the PComm32W.dll and PcommServer.exe (that starts when I try to open a communication with PMAC2).

    These two, PWin32PRO2, are installed by PMAC Executive Pro2 Suite.

     

    Sometimes my application works, and I can read and change the value of a P variable(it was all that I could do until now), but it's totally unstable. It just works when it wants.

     

    Is there a new manual or a example about how to do this?

    Is a dll the best option?

     

    *I can not uninstall PWin32PRO2. The machine must work in the both options without reconfiguration.

    **The conection is USB.

     

    Thank you!

  8. Farooq,

     

    Can you give me the timeout value used in Pcomm32 ?

     

    Thanks

     

    Gilles

     

    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

     

    Hi

     

    I use Pcomm32 with Ethernet to communicate with a geobrick.

     

    Sometimes I get a WSAETIMEOUT error popup windows :

    see attached file.

     

    I think I have some dropped packets, but this is not a problem. My application is not a GUI and run on a computer with no screen, keyboard and mouse, so nobody can valide this popup message and my application is blocked.

     

    Can I configure Pcomm32 to remove this popup window when a dropped packet occurs ?

     

    Thanks

     

    Gilles

  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

     

     

    Hi All,

    I would like to know the installation procedure for Win7-64Bit processor. Also I wold like to get the latest installation package for the same. I'm using Turbo PMAC2 CPU ith Acc-24E2A axis card. Hoping to get a quick response and the needed software as we have started with a new project.

     

    Thank you all in advance.

     

    Regards,

    Raghav

  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);

     

     

     

    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

  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.

     

     

    We have a utility we wrote to download code upgrades to our customers so they do not have to get involved with the intricacies of PEWin and multiple commands/downloads. They just click a button.

     

    It uses uses the old PMACServer DLL library communications method. We build it in Borland C++ Builder 3. I know these are old.

     

    Now we are in the situation where an important customer found it didn't work on their PC and are now broadcasting our system is poor.

     

    We narrowed down the differences in the program on their system between working and not working to one section. Basically in simplified pseudocode we have:

     

    Initialisation Code

    FPMAC->GetResponse("m800", &Response, &Error)

    Check response is good

    FPMAC->GetResponse("ver", &Response, &Error) !!!!!

    Check response is good

    FPMAC->GetResponse("$$$", &Response, &Error)

    Sleep 2s

    FPMAC->GetResponse("p7001..7109", &Response, &Error)

    Store response

    FPMAC->GetResponse("$$$***", &Response, &Error)

    Sleep 2s

    FPMAC->GetResponse("PASSWORD=xxxxxxxx", &Response, &Error)

    FPMAC->GetResponse("i5=0", &Response, &Error)

    Sleep 1s

    FPMAC->DownloadFile(MsgProc, ProgProc, "#XXOMNI.PMC", True, True)

    etc

     

    On particular PCs (these happen to be Intel Atom PCs) the program fails if the line marked !!!!! is not included.

     

    The failure symptom is that based on the output from the message callback and log file, the file is compiled ok but when download occurs we get 'Downloaded 0 lines'. Then no warnings no errors. The PMA file is zero bytes.

     

    Put the ver command back in and all is fine again.

     

    We cannot see how that line and the position it is in could affect anything unless it is clearing a buffer or something. We have lost all confidence in using this library. Can anyone explain this?

     

    Also do you have any examples which actually use the DLL PmacDownloadA function we can see in case we are not doing something quite right?

     

    Thanks

    Dave

     

     

  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

     

     

    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;

    }

     

     

    Using PcommServer to replace PTalk and rewriting to .NET 3.5

    I don't understand the usage of DPRGetShort().

    It uses an integer value for 'address' as opposed to an 'offset' value. No variable to identify X/Y memory bank.

     

    How is 'address' used to specify which bank the 16bit short is in ??

     

    Also, is there an updated manual for PCommServer ? Mine is dated Feb '06 and is not very thorough or complete.

    The only other related manual I can find is PComm32 from April '05.

     

    Thanks

     

     

     

     

  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;

    }

     

     

    Using PcommServer to replace PTalk and rewriting to .NET 3.5

    I don't understand the usage of DPRGetShort().

    It uses an integer value for 'address' as opposed to an 'offset' value. No variable to identify X/Y memory bank.

     

    How is 'address' used to specify which bank the 16bit short is in ??

     

    Also, is there an updated manual for PCommServer ? Mine is dated Feb '06 and is not very thorough or complete.

    The only other related manual I can find is PComm32 from April '05.

     

    Thanks

     

     

  19. What version of .net is supported in PcommServerPro2 v4.2 ?

    Can it be used in 3.5, or do I need to target an earlier version ?

     

     

    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...