Hi,I'm trying to use Danaher Motion's NT8000 client to read four boolean values from an Allen Bradley CompactLogix PLC via Rockwell Software's RSLinx OPC server. I can now successfully read booleans into the client however I have a single boolean value I need to write back to the PLC. Sounds simple enough? The problem I am getting is RSLinx fails to wite the value due to a datatype conversion error. When I use Rockwell's OPC test client and I browse to the offending item the datatype reported is VT_EMPTY. The datatype in the PLC is configured as BOOL. The Client does not seem to be able to write to this datatype. So I tested the OPC server with a number of other test clients and they all seem to work fine. I then tested the NT8000 client with a number of other OPC servers and it worked fine with them too! One of the OPC servers I tried was KEPServerEx talking to the same CompactLogix processor. The Rockwell OPC test client reports the datatype as VT_BOOL. So my question is who is not following the rules? Should the client be able to handle VT_EMPTY? Should the server report the datatype as VT_BOOL? Am I completely confused and working down the wrong path? Is there a work around?Looking forward to an answer!Cheers,Alistair.
Should the quality (and not the value) be used to indicate 'no value exists' ? I would have thought that a server that is passing back a good quality and a VT_EMPTY value is being rather unkind and liable to cause problems to clients.
There are many situations were a "NULL" value is not an abnormal situation and returning VT_EMPTY with a Good quality makes sense. More importantly you should never write a client that assumes the server will always give you 'correct' data. A client that blindly accepts whatever values the server provides would not pass the certification tests.
I agree that the client should be coded defensively. I guess on reading the original post again it's not clear if the client requested the data as a type *other* than VT_EMPTY. I believe doing so should result in the server reporting OPC_E_BADTYPE since it could not perform the requested data conversion. If the client had requested VT_EMPTY it would be defensible for the server to return a VT_EMPTY assuming it was treating the point as having a canonical type of VT_EMPTY even if the intent via the DCS configuration was for it to be VT_BOOL. Do this mean we we have a tri-state BOOL?.
I agree that a server is wrong to return something other than a VT_BOOL when you have explicitly asked for a VT_BOOL. Unfortunately the CTT should test for the same behavoir during a Read with ReqType explicitly set but it can only do that if the items selected by the tester contain a VT_EMPTY value. Many servers have not been tested with these kinds of values.
Thanks for the feed back. We bought KEPServer and is works great!How can I tell what data type the client is requesting?It was the server that was complaining about a data type conversion error when the client was trying to write a boolean value to a boolean tag in the PLC. How can a VT_EMTPY datatype be valid for a boolean tag? I understand that in a database you can configure a column to be of boolean datatype but allow nulls but not in this PLC. I have recommended to both the client and server suppliers they get OPC Foundation certified!Thanks,Alistair.
Forex Groups - Tips on Trading
Related article:
http://www.opcfoundation.org/forum/viewtopic.php?p=7767#7767
comments | Add comment | Report as Spam
|