Jump to content

PLC with LV 7.1


alameer

Recommended Posts

""

We're not here to do it for you - we're here to help each other. If you've got an example of what you've already tried and what problems you're having, then we might be more inclined to help.

""

------------------------------------------------------

i don't have examples for this topic

i need examples to kwno some tools which consider important to connect with PLC

thaks for crelf

:)

Link to comment

You're very welcome. The NI Modbus library has support for both Serial and Ethernet Modbus. From your first post it appears you wil be using the Serial mode. So, start by trying out the MB Serial Example Master.vi and MB Serial Example Slave.vi first. You could use two computers -- one as Master another as Slave, or use a null-modem cable to loop from one COM port to another on the same PC.

Your goal should be to communicate between the Example Slave and Master VIs. Once you have this working, replace the Example Slave VI with your PLC.

Feel free to post any questions you may have. Again, I strongly recommend that you get the Example working first.

-Khalid

Link to comment
Alameer,

Please see the following for the various options you have. It also has the NI Modbus library saved in different versions:

http://forums.ni.com/ni/board/message?boar...ssage.id=210421

-Khalid

PS: Maybe we should clean this (it sure can use some cleaning) and put it in the CoRe (Code Repositiory) here?

Khalid,

I thought the original NI Modbus library was not working correctly in 8.x, did you fix this library for 8.x? I like the idea of cleaning up this code. I always wondered why NI decided to put all these VIs into 1 library. I think serial and TCP should be separate library's. I also think master and slave should be separate, too but that just my opinion. First step in clean would be using a .lvlib and geting this into project form with public and private VIs. Taking it one step further would be converting this library to a class.

David

Link to comment
i am use 7.1 not 8.1

but i dont how use with PLC

i need this information in the fast time

Alameer,

Sorry for the delay in getting back to you. I looked at your DeltaPLC protocol. It uses the ASCII mode of the Modbus protocol. Unfortunately, at the moment I do not have a Modbus-ASCII device to test this. But, you can try using the 'MB Serial Master Query.vi' and changing the mode to ASCII. You can add the 'MB Serial Init.vi' to this with your Serial settings. If successful, you should see the data in the Modbus Data Unit Out cluster.

Hope this gets you started at least.

Regards,

-Khalid

PS: By the way, I tried running the Master and Slave examples included in the library in ASCII mode but wasn't successful.

Khalid,

I thought the original NI Modbus library was not working correctly in 8.x, did you fix this library for 8.x? I like the idea of cleaning up this code. I always wondered why NI decided to put all these VIs into 1 library. I think serial and TCP should be separate library's. I also think master and slave should be separate, too but that just my opinion. First step in clean would be using a .lvlib and geting this into project form with public and private VIs. Taking it one step further would be converting this library to a class.

David

Hi David,

Sorry for the delayed response. I don't remember fixing anything specifically for 8.x. But, as you know, there are issues in general with this library, especially with the Slave code.

I agree with your suggestions that the Ethernet and Serial versions could be separated (even if they use some common core VIs), Slave implementation can be improved, and all these can be moved to individual .lvlibs. I also don't like the fact that pretty much every VI in the library is reentrant. Haven't studied them in detail, but I am not sure if they all have to be reentrant.

I guess as a first step, we should formalize the list of changes, and priortize them.

Regards,

-Khalid

Link to comment
  • 2 weeks later...

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.