LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Problems using PCOMM32.DLL Delta Tau PMAC Driver Library

Recently I have been been trying to create vis that use Delta Tau's PCOMM32 DLL to communicate with and control various PMAC motion controllers.  I want to make an application that can poll various status variables as well as send commands and download motion program/plc files.  I was able to initialize communications and get the polling routine to work but when I try to add in the send command and receive response portion LabView gives me errors saying either that LabView does not have enough memory to complete the operation or that referenced memory could not be read.  I have been careful to not use any special string formatting routines to maintain compatibility between LabView and the C-based library.  The functions that I am calling from the dll (pmacgetresponseExA)  are supposedly thread safe and I have sequenced the execution of the vi so that the function calls do not occur in parallel.  In addition, I have added a PMACFlush command in between the function calls to clear the PMAC's communication buffer.  Has anyone out there seen these problems or been successful creating vis of similar purpose? 

0 Kudos
Message 1 of 12
(11,428 Views)
Labview drivers are available from Delta Tau, and they are quite extensive.  I'm not sure how much they cost, though.  To try and answer your question, you need to add dummy inputs to the dll.  Here is an example.  You may need to configure the dll call to look at your dll.  I have used this with 2 different versions of the pmac dll.
0 Kudos
Message 2 of 12
(11,422 Views)
Thanks Brian for your quick response and help.  I had pretty much the same setup but I wasn't using the string length function to write to the maxchar input on the call library function node.  Once I used that configuration I was able to run both a polling routine and a command terminal in the same while loop.  I guess that wiring the maximum number of characters as default was causing my memory problems.  Hopefully once my boss sees the utility of my programs the money (~$800) might come for the LV drivers from Delta Tau. 

0 Kudos
Message 3 of 12
(11,411 Views)

Brian:

I think I am experiencing the same dll-related issue that member Nkdnihil wrote about regarding problems using Delta Tau's pcomm32.dll driver library.  Reading your response and then his, it seems your example VI lead Nkdnihil to a solution!

Unfortunately, when I attempt to open your

PMAC status.vi

that you supplied, my 6.0.2 LabVIEW complains that it cannot open the 7 version.  Might you be so kind as to save it in an earlier version for me?

Sincerely,

Jordan

 

0 Kudos
Message 4 of 12
(11,359 Views)
Here is a 6.02 version.  Again, you may need to redirect the dll call to the proper PMAC dll.
0 Kudos
Message 5 of 12
(11,350 Views)

Brian:

Much appreciated!  After looking at your example, it turns out I was doing the DLL call "correctly", except that I was calling the "wrong" function!  Instead of calling PmacGetResponseA, I was calling PmacGetResponseExA.  It seems that in this latter case, a dummy string of arbitrary-length does not work for input as maxchar.  It seems that one must know precisely the length of the response string and use this for maxchar.  If so, that seems rather non-useful for my application and practically causes labview to crash frequently!  Delta Tau defines this latter function as:

"PmacGetResponseExA () always matches the command string with the response string or else it times out."

The former function does not have this restriction and I suspect it is why it works with your approach.

Many thanks,

Jordan

0 Kudos
Message 6 of 12
(11,342 Views)

Jordan-

Where did you find the definitions for the function calls?

Brian

0 Kudos
Message 7 of 12
(11,091 Views)
If I look long enough, I guess I will find it.  The Delta Tau website has a manual for this.
0 Kudos
Message 8 of 12
(11,083 Views)
What you want is the PCOMM32Pro driver library manual.  See attached.
0 Kudos
Message 9 of 12
(11,078 Views)

Hello.

 

I am having a similar problem, but with the PmacDownloadA() command in the PMAC Driver library. I am trying to download .pmc text files (containing motion programs) via labview. However I cannot get the connections with the driver library correct. Any ideas??

 

Thanks

 

Martyn

0 Kudos
Message 10 of 12
(10,053 Views)