Jump to content

robotic - Labview drivers for FANUC LR mate robot


E-man

Recommended Posts

hello,

new member here.

Does anybody have experience with Labview and robotics...more precisely I am trying to control a FANUC LR mate robot with Labview and my knowledge in robotic is very limited to say the least.

thanks for the help

E-man

Link to comment
  • 8 months later...

I have been programming Fanuc Robots and communicating between them and LabVIEW for about a year now.

We use LabVIEW to publish data to the robots, as well as start and stop them, and are able to view their status in a LabVIEW FP. We use Fanuc's PCDK (PC Development Kit) for all communications between LabVIEW and the robot controllers. The PCDK is designed to be used with MS Visual Basic, but since the libraries are ActiveX, it is fairly simple to develop a set of drivers to do the dirty work (which is what I've done). The PCDK uses the existing Ethernet ports on the Fanuc robot controllers coupled with their own proprietary protocol to perform robust communication between systems. Using the ActiveX components means I don't have to write low-level protocol specific code to read and write to the robots; the framework handles this transparent to the user.

I took the samples in their lengthy documentation for the PCDK and converted them to LabVIEW equivalent sub-VI's. I took the time to make them application-independent (functions like 'Run Program', 'Reset Alarms', and 'Get Numeric Register Value') so they can be reused readily.

As for the availability of the framework I created, I'm pretty sure I am bound by company policy not to release it (I'd like to offer it for sale, but I would need to discuss it in length with my superiors). I will try to give any assistance I can for anyone interested, however.

-Ian

P.S. I have only implemented a subset of the available functionality in Fanuc's PCDK; nearly all of the features of the controllers are available to access through code using the PCDK.

Link to comment
  • 2 weeks later...

P.S. I have only implemented a subset of the available functionality in Fanuc's PCDK; nearly all of the features of the controllers are available to access through code using the PCDK.

MM:

Is there anyway I might be able to see an example VI or talked to you about creating instances of the Fanuc VB classes in Labview?

I can create the robot class and connect but when I try to call ANY other calls like set a digital output I get an Unkown PCDK kit error.

Do I have to create a new automation open block each time or just use keep passing the RefNum generated from the connect method?

Any help or guidance is appreciated bigtime!

thanks

mike

Link to comment

QUOTE (iannicholson @ Dec 8 2008, 01:25 PM)

I have been programming Fanuc Robots and communicating between them and LabVIEW for about a year now.

We use LabVIEW to publish data to the robots, as well as start and stop them, and are able to view their status in a LabVIEW FP. We use Fanuc's PCDK (PC Development Kit) for all communications between LabVIEW and the robot controllers. The PCDK is designed to be used with MS Visual Basic, but since the libraries are ActiveX, it is fairly simple to develop a set of drivers to do the dirty work (which is what I've done). The PCDK uses the existing Ethernet ports on the Fanuc robot controllers coupled with their own proprietary protocol to perform robust communication between systems.

This protocol is called SRTP and is indeed proprietary. However it is based on the older serial port protocol which is documented in the programming manuals and also through some unsupported Visual Basic examples from Fanuc itself.

I have recently written a VI library to control Fanuc Controllers over the LabVIEW build in TCP/IP functions. It works well for what we had to do but is far from throughly tested.

I really couldn't recommend anyone to use it who isn't well into low level programming including TCP/IP protocols and since there is no real documentation about it I will refrain from posting it here.

Rolf Kalbermatter

Link to comment

Basically what I am looking for is ANY help someone may offer as to why I can not use the child classes of the pcdk kit in labview.

I am able to open a valid connection using the FRCRobot Class (from the COM object frrobot.exe)

I get an error trying to use any of the other classes - I get an "unknown error" yet these classes work fine in my VB driver (a subset of the PCDK example VB program).

The documentation says I should only need to instantiate the main class (FRCRobot) but I can't get beyond basic connection to read a register numeric or digital output etc.

Fanuc said every method & property is available from the main class of FRCRobot but it seems to me that I have to use the "Automation Open" to instantiate the main class AND others such as the IIOTypes class etc - this method did not work either.

ANY insight as to what I should try is appreciated whether its labview related advice or Fanuc driver advice.

thanks.

mike

Link to comment

QUOTE (Wedge @ Dec 21 2008, 07:30 PM)

Basically what I am looking for is ANY help someone may offer as to why I can not use the child classes of the pcdk kit in labview.

I am able to open a valid connection using the FRCRobot Class (from the COM object frrobot.exe)

I get an error trying to use any of the other classes - I get an "unknown error" yet these classes work fine in my VB driver (a subset of the PCDK example VB program).

The documentation says I should only need to instantiate the main class (FRCRobot) but I can't get beyond basic connection to read a register numeric or digital output etc.

Fanuc said every method & property is available from the main class of FRCRobot but it seems to me that I have to use the "Automation Open" to instantiate the main class AND others such as the IIOTypes class etc - this method did not work either.

ANY insight as to what I should try is appreciated whether its labview related advice or Fanuc driver advice.

thanks.

mike

I'm really sorry. But I have not used the PCDK nor even seen it so I can be of little help here. Basically ActiveX has two different types of interfaces. one is the Automation interface and the other are ActiveX Controls. The first you have to instantiate using Automation Open and the second is instantiated at the momen it is loaded into an ActiveX container. At least under .Net you also have static interfaces. They do not need to be instantiated (created) as they are not an object in the normal sense but simply a collection of methods to do something that is not inherently tied to data that the object would maintain.

For an Automation Interface, and I'm sure the PCDK does implement such an interface, you usually have an object hierarchy. The root object is usually something like IApplication or something like this. You always have to instantiate that object using Automation Open in LabVIEW. Once opened you usually have methods or properties in that interface that return among other things also references to subobjects from that object hierarchy. These objects you do not have to instantiate again since that would be the task of the object who returns an object reference.

However just because you have opened a root object reference does not mean that you can add additional Automation Refnum controls in your application and connect them to subobjects interface types and expect them to be vallid. The connection to an interface only defines what methods and properties that refnum can provide but does not yet create a valid object reference. You only get a valid object reference from either Automation Open or another already instantiated object in the object hierarchy that returns an object reference.

Rolf Kalbermatter

Link to comment

QUOTE (Wedge @ Dec 24 2008, 01:49 PM)

Ok - here is the code for my question.

I attached my (very basic) VB code with a couple of functions that work when run in VB and the fanuc help file.

I also attached a snapshot of my labview code with errors.

Any advice is appreciated.

thanks

mike

Your XyzWpr class is probably not instantiable through a class factory of your DLL but instead only available as subclass of the main object hierarchy. Try to connect a property node to the CurPosition property of the main instance instead for instance. It could be likely the same class (big guess from my side though) and see what you get there.

In order to be able to instantiate classes as top level classes they need to be supported by the class factory of the automation server (your ActiveX DLL). For many subclasses that makes little or no sense since they are only meaningful in the context of a higher class.

Rolf Kalbermatter

Link to comment

QUOTE (rolfk @ Dec 24 2008, 07:23 PM)

Your XyzWpr class is probably not instantiable through a class factory of your DLL but instead only available as subclass of the main object hierarchy. Try to connect a property node to the CurPosition property of the main instance instead for instance. It could be likely the same class (big guess from my side though) and see what you get there.

In order to be able to instantiate classes as top level classes they need to be supported by the class factory of the automation server (your ActiveX DLL). For many subclasses that makes little or no sense since they are only meaningful in the context of a higher class.

Rolf Kalbermatter

ok - I have tried that also - I think there is something wrong with the COM object itself - I will re-install tomorrow and see if that helps.

Thanks a ton for the info! Will post soon.

mike

Link to comment
  • 1 month later...

Keep in mind when using the FRROBOT object, you need to chain everything together from the original FRROBOT.IRobot2 interface.

In the example screenshots Wedge posted above, I see that he is trying to use an 'Automation Open' block to instantiate the IXyzWpr class. All robot-specific classes must derive from the IRobot2 class, which means that you need a handle (refnum) from the IRobot2 object, which is what you will operate on. The functionality you need for the PR[] access is in the RegPositions collection (at least I think it is a collection, LabVIEW isn't installed on my home PC).

Right-click the RegPositions property, and create a new method "Item" (I think). Then wire an Index to get at the specific PR[]. I believe this will be "0" based (i.e. for PR[1], wire in "0" to the Index input). The output from this method node will be a reference to the specific PR[]. From here you need to access the "Format..." method, and supply it with an integer (it's actually an Enum, but I'm not sure it ports over to LabVIEW).

Remember to type-cast the output of the "Format..." method with a "Variant to Data" node, supplying for the data type a class-constant of the type you wish to use; i.e. IXyzWpr. This is a little tidbit I learned while trying to use the PCDK--some properties and methods of the FRROBOT object return a Variant, and others return PCDK-specific class refnums; this is to support multiple output types with less effort from the Fanuc developers. These variants will need to be type-cast into the proper class to be able to use them, but you won't be able to use the type-casting functions in the .NET pallette (as I originally tried to do); this is where the "Variant to Data" node comes in.

If necessary, I can post an example the next time I am near my LabVIEW development PC. I hope this explains a few things, however.

-Ian

  • Like 1
Link to comment
  • 5 months later...

Hello,

I have currently problems with Fanuc PCDK and LabView. Ians post opened the syntax of LabView ActiveX handling really well, but I still can't read any I/O or register data from robot. I can read alarms from robot, so my connection is working. I think my problems relate to that Type casting what Ian mentioned. Any example screenshots from variant to data type casting in LabView?

And how can you access f.e.x FRCIOSignals if everything has to use IRobot2 as refnum? If I try to open new automation reference, all I get is Class not registered error. Sorry about my stupid questions but Im not that experienced coder.

Big thanks in advance!

Link to comment

Hello again.

I got it working after all. I was right that my object structure was messed up. Now I am able to read DO[#] from my robot.

I attached a screenshot from my LV code. It is very basic, but I hope it helps someone to get started using Fanuc PCDK through LabView.

post-16219-124965262293_thumb.jpg

Link to comment
  • 3 weeks later...
  • 1 year later...

QUOTE (iannicholson @ Dec 8 2008, 01:25 PM)

This protocol is called SRTP and is indeed proprietary. However it is based on the older serial port protocol which is documented in the programming manuals and also through some unsupported Visual Basic examples from Fanuc itself.

I have recently written a VI library to control Fanuc Controllers over the LabVIEW build in TCP/IP functions. It works well for what we had to do but is far from throughly tested.

I really couldn't recommend anyone to use it who isn't well into low level programming including TCP/IP protocols and since there is no real documentation about it I will refrain from posting it here.

Rolf Kalbermatter

Hi Rolf,

It's been a long time since your post, but I was wondering if you could share some of your knowledge on how to communicate over TCP/IP directly to the Fanuc controller without using the PCDK API.

We have used PCDK for many years, but we are now facing the need to update the robot's numeric registers from a non-Windows platform - and therefore we can't use PCDK and the Robot Server.

I really appreciate anything (dirty code is okay) you can give me or point me to that will help me do a simple update of a numeric robot register. Thanks in advance!

Cheers,

- Philip

Link to comment

I have not had experience on your specific robot, but I would think the only thing you would have to worry about is a LabVIEW-compatible motion controller. Many manufacturers sell LV SDK's for their controllers. I found this link with a Google search (FANUC LR mate robot LabVIEW):

http://sine.ni.com/c...doc/p/id/cs-810

It's been done and it's a start.

That isn't a robot controller... it's just an interface that can communicate with it via standard I/O's such as Modbus. (I know, I work there :P ). We don't even use the NI Robotics toolkit, or the PCDK API (I didn't know there even was such a thing...).

With a protocol like Modbus TCP, we can send data to the Group Inputs (GIN) of the robot, and we have Karel tasks that run on it that can do stuff with that data (i.e. execute action #X with parameters Y,Z). You could probably do some basic similar operations with a TP Program, though.

Edited by Samapico
Link to comment

Well there are two open sources projects you can try to find and check out. The first one is libopenSRTP and the second one is Visual HMI, both from the same author. There also used to be a GEFCOMM Visual Basic example around from someone from GE Fanuc support but not sure if this is still available anywhere.

I found the VB example here: http://forums.mrplc.com/index.php?app=downloads&showfile=574

Link to comment
  • 1 year later...

Hi Rolf,

It's been a long time since your post, but I was wondering if you could share some of your knowledge on how to communicate over TCP/IP directly to the Fanuc controller without using the PCDK API.

We have used PCDK for many years, but we are now facing the need to update the robot's numeric registers from a non-Windows platform - and therefore we can't use PCDK and the Robot Server.

I really appreciate anything (dirty code is okay) you can give me or point me to that will help me do a simple update of a numeric robot register. Thanks in advance!

Cheers,

- Philip

 

Philip - I'm running into a similar situation. Were you ever able to write to Fanuc registers on a non-Windows platform?

 

Did you do this via TCP/IP?

 

Thanks.

Link to comment
  • 7 years later...

Hi,

I am doing a similar work with an R-30iB FANUC robot controller. As a first step, I am trying to connect to the robot but I keep getting the following error:

"Automation Open: Object specified is not creatable in Establish_Connection.vi"

I tried to register .ocx and .dll files manually but that did not help. I was wondering if you ever had this issue, and if yes, how did you fix it?

Many thanks

 

 

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.