02-12-2015 11:10 PM
First run 2 wire-auto
Second run 2 wire-EchoDTR
Thrid run 2 wire-CtrlDTR
Had to change the extension to doc
02-13-2015 07:11 PM
Just got a chance to look at this...Looks like you're sending out the request to read multiple input registers (confirmed that in the log) and it occurred to me that this code might not be supported. I looked back at the modbus RTU guide posted on pg 2 (http://forums.ni.com/ni/attachments/ni/170/840085/1/modbusrtu.pdf) and according to page 9 my hunch was correct. It says function code 4 is not supported and in the notes it says that it does not respond with error code 1. Since this is the case, I'm not surprised you're seeing a timeout -- the device is not correctly programmed to respond to the request. Unfortunately this means most of the testing you've done so far is invalid because you were changing serial settings for a device that was ignoring you 😕
To be clear, I've also confirmed this in the log you provided. As I mentioned in my previous post, VISA is going to be monitoring the port with a series of "viGetAttribute(....ASRL_AVAIL_NUM...)" calls and you can see in your log that these calls return 0, meaning we don't see *any* bytes at the port.
Recommendations:
-Change your function call from reading input registers to reading holding registers (also called output registers, but they are frequently used for both input and output).
-If you don't get communication, make a few attempts with various serial settings.
-If you *still* don't get communication, use NI I/O trace to look for data at the port. You'll see this if the last parameter is anything besides 0.
02-17-2015 09:51 AM
I've tried the various read functions along with different wiring configurations to no avail. I've also tried to read from various addresses. So my thoughts are that maybe the connection isn't working. Is their a quick and inexpensive way to hook something up to check whether or not communication is being sent.
02-17-2015 09:21 PM
Does anybody have any advice on how to troubleshoot this?
Thanks
02-18-2015 06:26 AM
Hey all,
Sorry I haven't had a chance to respond to this until now. Yes, I did come up with a sloution, might not be the best and certainly could use optimization, but hey, it works for my needs.
I think I did have to download some MB specific stuff, so let me know if you can or can't see the blocks in it.
Since my original post I have used over 12-15 of these for different applications.
This is a program I use relably for a Glucose synthesis, so I know it works. The device address has to be 1 as written.
as far as your com lines to Rs232 goes: Rx 2, Tx 3, Gnd 5. http://www.advindsys.com/Manuals/CALManuals/CALgraphixappguide.pdf
Let me know if this works and I can help you troubleshoot from there.
02-18-2015 08:46 AM
Thanks for the reply. I now know that this can be done. I can not see the MB stuff. Can you give some information on what it is and where to download it.
Thanks
02-18-2015 09:00 AM
I think this NI modbus library was used.
02-18-2015 09:22 AM - edited 02-18-2015 09:22 AM
Yep I believe that is the one!
It really helps.
02-18-2015 09:27 AM
Thanks guys. I will try it out and see if I can get something working.
02-18-2015 09:34 AM
Yep, let us know how it goes. And make sure your address, port, baud rate, etc. is set up correctly on the TC itself and in the program/computer.