11-24-2008 01:46 PM
11-25-2008 04:28 PM
Hello, I have a couple of questions for you. First of all, which register are you reading from? If you would like to read from two registers have you tried including the neighboring register and concatenating them? Let me know which register you are using because there may be a way to set up DSC to automatically return a 32-bit.
11-26-2008 06:10 AM
Burt,
I can read two adjacent registers and concatenate but I am developing an application that will read and write at least 100 registers. That kind of extra handling should not be necessary with Modbus. I am reading and writing registers in the range 400001 to 400054 and I am reading registers in the range 300001 to 300018 from up to 10 different IP addresses. All the data from the Modbus devices in these registers are U32. I have set up a series of U32 shared variables linked to an Ethernet Modbus I/O server. There will be a similar setup for each IP address. Standard Modbus protocol calls for the server to read two registers and concatenated them into a U32 value. The DSC I/O servers are OPC servers and should do this automatically given the var type and Modbus register address. There must be some configuration that is wrong in my DSC instance.11-26-2008 09:02 AM
Hello,
Another thing I wanted to verify is that you are familiar with the following document http://zone.ni.com/reference/en-XX/help/371618D-01/lvmve/dsc_modbus_using/ and are using the addresses with the "D" prefix. If you are doing this but it is still not working correctly, I am going to need to get more information about how your project is set up in order to be able to figure out what is wrong. Could you attach your project so that I can take a look at the options you are using?
11-26-2008 12:17 PM
Hi Burt,
I have seen the document and I did once try using the D prefix on the address. A simple project with a single server and a single variable gives a server failed error (0X8BBB0003) with the D and returns only 16 bits set when the D is removed. I also tried an array of U32 of length 1 and 2 with the same error. I assumed that the document you refer to was for LV version 8.6 and did not apply to my version 8.2.1. I have attached the files for the simple project. I have never tried to attach a project to a post so I'm not sure I got all the necessary files. Let me know if you need anything else.
I am now assuming that I will need to set up a Lookout OPC server and use data sockets to run this project. I would prefer the convenience of the DSC I/O server. I hope you can spot my error!
Regards
Len
11-26-2008 02:48 PM
Hello agin Burt,
I seem to have something more serious going on. I tried writing to a U32 variable and only 8 bits get set in the device. I am completly confused by this. There are no 8 bit registers in Modbus! My DSC must be corrupted in some way. I have tried repairing it once before.
Regards,
Len
12-01-2008 11:42 AM
Lenvno,
The error your getting (0X8BBB0003) is consistent with an error thrown by a modbus device that is not happy with spitting out 32 bits of information from the address it was asked to. Check the modbus map of your device and see if it is consistent with the address you are reading from.
You can find some more information about this error here: http://digital.ni.com/public.nsf/allkb/B9366256C53D95CA8625725A007C0287?OpenDocument
Additionally, some modbus devices will only take 8 bits of data if they only 'care' about 8 bits of data in specific addresses. So if you write 16 bits of data to address X and the device only really cares about the first 8, it ignores the last 8 bits you wrote. Check the modbus map of your device and see if this could be the case.
12-01-2008 02:37 PM
Stephen,
Thank you for the comments. I know this device intimatly since I programmed it. The read and write operation that are causing trouble with the I/O server work perfectly with Lookout and Kepware. I can snoop the packet sent by the I/O server when I ask for a U32 value and the Modbus command is asking for only 16 bits while Lookout and Kepware send a packet asking for 32bits. One un-answered question is should the D prefix in the modbus address work for the I/O server in LV version 8.2.1? When I try to use it,I get a failure but it works as expected for Lookout.
Regards,
Len12-03-2008 12:40 PM
Hello Levno,
I wanted to let you know that I am going to do some more research into this issue. The D prefix should work properly in 8.2 but the error you are getting is likely expected behavior based on the information in this document. http://digital.ni.com/public.nsf/allkb/4EF459F549FCC7028625660A000A7629?OpenDocument
Unfortunately, this still does not explain why you are only getting half of the information you expect when doing a read. I have been unable to find any documentation on this issue, but I will continue to do more research.
12-03-2008 02:18 PM
Hello Levno,
After doing more research, it appears that 32 bit Modbus support was not added to DSC until 8.5. I found this information in the 8.5 release and upgrade notes.
http://www.ni.com/pdf/manuals/374128c.pdf
It seems that your only option is to either upgrade or read from neighboring registers and concatenate them.