02-16-2007 05:26 AM
02-16-2007 05:38 AM
I can't look at your LLB, but I have used this library and it does work, so just uploading it will not allow anyone to help you.
The reasons for not being able to communicate can be anything from having the cable disconnected to having your Modbus settings wrong (device number, etc.).
You should use probes to see if you are getting any answers back at all (I think the VIs are reentrant so you will need to change them temporarily) and see what error you're getting (you might be getting a Modbus error code). You should also try using another program which uses Modbus to see if you can talk to the device at all.
If you still need help after doing all this, you should upload more details (exactly what you are sending, what are you getting back, etc.).
02-16-2007 06:01 AM
Hiii tst,
Thanks for the quick reply, but as far as i am concern there is no problems in the cable connection, but tell me what kind of cable i should use, should it be the cross or it should be straight?
Another thing is I am getting the error in MB write.vi driver "TCP Write in MB Ethernet Transmit.vi->MB Ethernet Master Query.vi", but dont know what is that?
Do you have any idea about any other freeware software from which i can run the Modbus TCP/IP? which can give me the data? I want to take the data of 10 registers from the device with the function code 03, but it is not happening.
Another question in my mind that what about the IP address of the device, how should we specify it? because there is no option in the vi to give the IP address of the device from which we are fetching the data.
I know i have write so many things but hope that you wont mind it.
Thanks,
Nishant
02-16-2007 07:30 AM
Try my sample llb file in reply 2 of this thread.
http://forums.ni.com/ni/board/message?board.id=170&message.id=144522&query.id=35841#M144522
02-17-2007 12:03 PM
I suggest you look at Unclebump's suggestion, because the library you posted is missing a lot of files found in the original (I assume you did a "Save with Options").
As for not specifying the IP address - of course, you can't, you're expected to give the original MB Ethernet Master Query VI (before your modifications) a TCP connection reference, which you can only obtain after using the TCP VIs, where you do supply the IP address. Look at Unclebump's link for an example.
I'm not a Modbus expert, but I remember using a program called Modbus Scanner to do some quick and dirty tests. I don't know if it supports Modbus ethernet, but even if it doesn't, there are probably others which will.
Above all, my suggestion would be not to change the VIs - they should work properly.
02-18-2007 10:10 PM
Hmmm.... You are right tst, the files i have missing some the files as i look at Uncle's solution, but thing is i have download it from the Ni forum this all the files and from there onwards, these are the files. anyways, now i have download the files, so i will check them and i think they will work also.
Modbus tester is a good software to do some "quick and dirty " tests, and that software is also provided with the TCP/IP modbus, so it is good to use.
What is the Remote port, which has been given 502 in the vi? can anybody please tell me?
Thanks,
Nishant
02-19-2007 04:37 AM
I have no experience with MB ethernet, so I can't give you a definite answer, but my guess would be either that this is a standard port number (which means you can find it in the Modbus specifications) or that it depends on the device you're trying to communicate with (in which case you need to read the documentation). My guess would be the latter is more likely.
@Nishant wrote:
What is the Remote port, which has been given 502 in the vi? can anybody please tell me?
02-19-2007 04:56 AM
Hiiii tst,
I also think this is the standard port number, becuase i also found it in the Modbus tester software, which is standard one to check the Modbus data either on the serial or on the Ethernet, this could be the standard Ethernet port number.
Thanks,
Nishant