Jump to content

Need help with connection with PLC by driver


Recommended Posts

Hi,

My project requires to connect with a Direct Logic PLC base on the UDP protocal. I have the driver for the PLC.

The communication is started by initialize the UDP communication and generate a connection ID. If I need to read something form the PCL by using the driver VIs, I need to connect this VI with this connection ID. The program works fine before building executable file. I have normal connection, although I have to initialize the connection with the PLC two times. I think the problem because of the UDP protocal. Then when program runs, I can get all of the data I need.

The issuse is after I build the executable file. I cannot initialize the connection anymore. I attach here the error message.

I don't understand why there is a different between program run based on executable file and based on compile form the code. Is it the problem with the driver library? I use this VI by open the functions palette, then click select a VI, then browse to the VI in the llb.

Please help me on this issue. Highly appreciate your time.

Thank you so much,

Thang Nguyen

Link to comment

QUOTE(Thang Nguyen @ Jun 22 2007, 12:08 PM)

Hi,

My project requires to connect with a Direct Logic PLC base on the UDP protocal. I have the driver for the PLC.

The communication is started by initialize the UDP communication and generate a connection ID. If I need to read something form the PCL by using the driver VIs, I need to connect this VI with this connection ID. The program works fine before building executable file. I have normal connection, although I have to initialize the connection with the PLC two times. I think the problem because of the UDP protocal. Then when program runs, I can get all of the data I need.

The issuse is after I build the executable file. I cannot initialize the connection anymore. I attach here the error message.

I don't understand why there is a different between program run based on executable file and based on compile form the code. Is it the problem with the driver library? I use this VI by open the functions palette, then click select a VI, then browse to the VI in the llb.

Please help me on this issue. Highly appreciate your time.

Thank you so much,

Thang Nguyen

.

Welcome to this library from yours truly. Why you would have to call the Open twice I'm not exactly shure. It isn't necessary for me and most probably is the cause for your runtime error since error 60 means that there is already a connection open to that specific address/port pair.

Also I recently found a bug in this library that prevented it to work with PLC Direct systems equiped with the ECOM100 interface. Attached version (LabVIEW 7.1) fixes that so that it also works with that module.

Also your attachment wouldn't help anyone not having the library much as it is missing utility functions located dnetudpu.llb.

Rolf Kalbermatter

Link to comment

QUOTE(rolfk @ Jun 22 2007, 01:15 PM)

.

Welcome to this library from yours truly. Why you would have to call the Open twice I'm not exactly shure. It isn't necessary for me and most probably is the cause for your runtime error since error 60 means that there is already a connection open to that specific address/port pair.

Also I recently found a bug in this library that prevented it to work with PLC Direct systems equiped with the ECOM100 interface. Attached version (LabVIEW 7.1) fixes that so that it also works with that module.

Also your attachment wouldn't help anyone not having the library much as it is missing utility functions located dnetudpu.llb.

Rolf Kalbermatter

Rolfk,

Thank you so much,

The reason I have to call the open twice because at the first time it cannot open the connection. In my program, I allow user retrive the connection with the device if it cannot open the connection automatically. If the connection does not open, there will be a dialog allow user to call this VI again, then it works. The only problem is it cannot work in the executable file. That make me confuse.

Base on your solution, I will try to close the connection before open it.

Could you tell me where did you fix in the library or can you remake it in the LabVIEW 8.2? I use LV 8.2.1.

Thang Nguyen

Link to comment

QUOTE(Thang Nguyen @ Jun 22 2007, 01:58 PM)

Rolfk,

Thank you so much,

The reason I have to call the open twice because at the first time it cannot open the connection. In my program, I allow user retrive the connection with the device if it cannot open the connection automatically. If the connection does not open, there will be a dialog allow user to call this VI again, then it works. The only problem is it cannot work in the executable file. That make me confuse.

Base on your solution, I will try to close the connection before open it.

Could you tell me where did you fix in the library or can you remake it in the LabVIEW 8.2? I use LV 8.2.1.

Thang Nguyen

Not sure about your problem. Since it is UDP, routing should probably not be a problem. It either works (if it is on the same subnet) or it won't. However maybe your network, device or whatever could be slow and the default timeout won't work. Ever tried to increase the timeout?

And about the LabVIEW version, higher LabVIEW versions can open lower version VIs. They have the diagram and all so you can do that conversion simply yourself. The changes were mostly in DNET UDP Get Devices.vi apart from some minor cosmetic ones. Do a VI compare on that one to see the difference.

Rolf Kalbermatter

Link to comment

I still don't know how to solve this problem.

In VI, at the first time, I meet the error 54, then after reinitializing, it works fine. But if I run in highlight execution mode, I didn't meet this error.

In executable file, at the first time, I meet the error 60, then after re_initializing, I meet the error 6003.

I tried to run with your driver, but it still the same.

Then, I tried to increase timeout, event, to 1sec.

I also add the line: SocketSetReuseAddr=TRUE into the labview.ini file.

But it still does not work.

Is there anyone have the same problem with me?

Waiting for your recommendations.

Thank you for your time,

Thang Nguyen

Link to comment

Rolf,

I now find out exactly the problem is because of the driver, or UDP protocal. I test the program with only 2 VIs UDP Initialize and UDP Close. I run it for 10 times, then the error happens for 4 to 5 times. I try to modify a little bit with add a delay part into it which very from 0.5 sec to 5 sec. The problem still happens.

And the issue happens at the UDP Read -> UDP Read Response -> UDP Get Devices -> UDP Initialize.

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.