LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Pacific Scientific OC930 controlled by dll with labview?

I have a SC903 Servomotor driver with a OC930 option card. Pacific
Scientific has a DLL on their website for the OC930 option card. Can I
control my motor via the serial port using the Call Library Function Node?
The DLL supplies various functions including InitComPort, GetVar930,
PutVar930, ExeCmd930,SetAxis930.
Any help would be appreciated.
0 Kudos
Message 1 of 6
(4,577 Views)
Jack,
If the DLL you have from the Pacific Scientific website is for that particular servomotor, then you can use Call Library Function Node in LabVIEW to control it. You will need to know the functions and parameters this dll expects as inputs and also what output types it returns.

Zvezdana S.
National Instruments
0 Kudos
Message 2 of 6
(4,566 Views)
I have opened the dll in Labview 6.1with the Call Library Function mode.
I am lost as to what to do next.  I have some notes from the Pac Sci website that may help.  Here are some excerpts.
int stat = GetVar930("AInNull",&AInNull);   
The C / C++ interface is as follows:
int InitComPort930(int argPortNum);
int ExeCmd930(const char *cmd);
int GetVar930(const char *name, double *value);
int PutVar930(const char *name, double value);
int SetAxis930(int a);
By default, each thread or process that maps the DLL starts out talking to
axis 255 on com port 1.
I have the Hardware and Software manual the discusses the comands in what they seem to indicate is some form of basic.
Any suggestions?
0 Kudos
Message 3 of 6
(4,451 Views)
Hey Jack,

Have you checked out the Calling External Code in LabVIEW tutorial?  If you select Help » Search the LabVIEW Bookshelf, you should bring up a PDF that you can search for "external".  This should bring up the Using External Code in LabVIEW tutorial.  There is an enture section in the manual about using the Call Library Function node.  Since you have all of the information about how to call these functions, all you need to do is match the Function Prototype to the calls that you have in the manual.  The one thing that can be tricky is using getting the datatypes matched up.  For example the char data type isn't native to LabVIEW so you would need to use the string instead.  One suggestion that I would have is to save before attempting to run the VI since if the datatypes aren't matching LabVIEW will simply disappear.

Hope this helps!
Andy F.
-----------------------------------------------------------------
National Instruments
0 Kudos
Message 4 of 6
(4,433 Views)

Still working on this challenge.  I have been able to use functions InitComPort930, CommDLLVersion930, and SetAxis930  from the Call Library function in Labview with the 930 Comm32 .dll.

 

Pacific Scientific provides variable / commands with their manual (pdf and HTML form) on their website.  However, looking at the programming notes I don't believe the command / variables are simple strings.  See attachment    A.txt

 

In the C, C++  interface notes it seems to indicate for the PutVar930 function that a signed 8 bit interger for the Variable and double precision as the pass pointer value.  I found an old header file that contains variable ID numbers.              see attachment  SC930.H   

 

Can this information be used in some fashion?  

Many thanks in advance for a shove in the right direction, 

 

Jack

 

Download All
0 Kudos
Message 5 of 6
(4,146 Views)

Thanks all for trying. I am simply going to use simpler serial commands.  Thanks again!

 

jack 1911

0 Kudos
Message 6 of 6
(4,085 Views)