L2SS-220: Writing to a CP fails on OPC-UA level but no exception is thrown in itango
I just did this:
In [90]: sdp = startup(device = 'LTS/SDP/1', force_restart = True)
Forcing device LTS/SDP/1 restart.
Device LTS/SDP/1 is in OFF, performing initialisation.
Device LTS/SDP/1 is in STANDBY, performing on.
Device LTS/SDP/1 has successfully reached ON state.
In [91]: scrap = sdp.fpga_scrap_r
In [92]: scrap
Out[92]: array([0, 1, 2, ..., 0, 0, 0], dtype=int32)
In [93]: scrap[111] = 31415
In [94]: sdp.fpga_scrap_rw = scrap
In [95]:
Looks as if there was no problem. But the Device shows this:
2021-02-09 13:57:10 [140085970323200] DEBUG lts/sdp/1 <- SDP.Off()
2021-02-09 13:57:10 [140085970323200] DEBUG lts/sdp/1 -> SDP.Initialise()
2021-02-09 13:57:10 [140085970323200] DEBUG lts/sdp/1 Connecting to server opc.tcp://dop36.astron.nl:4840/
Requested secure channel timeout to be 3600000ms, got 600000ms instead
2021-02-09 13:57:10 [140085970323200] DEBUG lts/sdp/1 Connected to server. Initialising.
2021-02-09 13:57:10 [140085970323200] WARN lts/sdp/1 Cannot determine the OPC-UA name space index. Will try and use the default = 1.
2021-02-09 13:57:10 [140085970323200] DEBUG lts/sdp/1 Mapping OPC-UA MP/CP to attributes...
2021-02-09 13:57:10 [140085970323200] DEBUG lts/sdp/1 Mapping OPC-UA MP/CP to attributes done.
2021-02-09 13:57:10 [140085970323200] DEBUG lts/sdp/1 <- SDP.Initialise()
2021-02-09 13:57:10 [140085970323200] DEBUG lts/sdp/1 -> SDP.On()
2021-02-09 13:57:10 [140085970323200] DEBUG lts/sdp/1 <- SDP.On()
2021-02-09 13:57:51 [140085970323200] ERROR lts/sdp/1 Function failed. Trace: Traceback (most recent call last):
File "/opt/lofar2.0/tango/SDP/SDP/wrappers.py", line 47, in error_wrapper
return func(self, *args, **kwargs)
File "/opt/lofar2.0/tango/SDP/SDP/SDP.py", line 310, in write_fpga_scrap_RW
self.attribute_mapping["fpga_scrap_RW"].set_value(value.tolist())
File "/home/tango/.local/lib/python3.7/site-packages/opcua/common/node.py", line 217, in set_value
self.set_attribute(ua.AttributeIds.Value, datavalue)
File "/home/tango/.local/lib/python3.7/site-packages/opcua/common/node.py", line 263, in set_attribute
result[0].check()
File "/home/tango/.local/lib/python3.7/site-packages/opcua/ua/uatypes.py", line 218, in check
raise UaStatusCodeError(self.value)
opcua.ua.uaerrors._auto.BadTypeMismatch: "The value supplied for the attribute is not of the same type as the attribute"s value."(BadTypeMismatch)
2021-02-09 13:57:51 [140085970323200] DEBUG lts/sdp/1 -> SDP.Fault()
2021-02-09 13:57:51 [140085970323200] DEBUG lts/sdp/1 <- SDP.Fault()
The question is now how we can forward this to a client that made that call?