Not able to change value in Perspective numeric field control. Getting this error when change any value in HMI

33
What does this mean? Why values are not written?Connecting via OPC UA and add tag in tag browser i have added float array as a tag , but when i run perspective project then default value of CIT tha is came from OPC is 625 is showing but when i click on this numeric field box and change value (float array data type) then it giving this error .
Error writing to TO_LVF_CIT_N[0]: Error_Exception • 5 minutes ago
Error writing to tag '[Sample_Tags]TO_LVF_CIT_N': array element type mismatch

So where its type is mismatch , I dont have idea about this so if anyone have any idea , then let me know

How are you attempting to write to the tag? Is it a binding from a Numeric Entry Field? Is the binding set to "bidirectional".

Please show the binding.

Yes it is Bidirectional and I use numeric entry field for getting only first array element(0th value) so right now i used only one numeric entry field , I have attached photo here, what is missing here , I checked bidirection and try change numeric text field then giving error

36
By default comming from default value is 625 when i change it from 625 to 635 then giving this error , other control works properly when i use one float value for one numeric entry field but this float array gives error, so anything is missing here in float array??

34
35

That looks suspiciously like something you'd find in a PLC5, SLC5xx, or a Logix conversion from one of those. In which case an N file would be 16-bit signed integers, not float. Try fixing the value type.

Also note,

Array Tag Write-Back
OPC Array tags support writing back to the device. How this is done can vary, depending on the type of OPC Server in use. Some OPC Servers support writes to individual array elements, where a write would occur just like any other tag write. However, some OPC Servers do not support individual element writes, which means the whole array will need to be written back to the array tag, even if only a single element is changing.

https://docs.inductiveautomation.com/display/DOC81/Tag+Data+Types

In what PLC?
With what data type in the PLC?

Via OPC UA connectivity, and data type is float array

It means that you might not be able to write to one element of the array. You would have to write the whole array if any one element changes.

OPC UA connectivity to whose OPC server?

I mean who made the OPC UA server? Inductive Automation, Kepware, Allen-Bradley, Matrikon, somebody else? What is the name of the OPC software?

Sorry that i don't have idea , but via this opc connectivity other controls like button numeric entry field for single value, and other are worked properly , expect this float array data type...

Array tag edit

Try changing a tag value in the tag browser. If you can not do it there then you probably can't change it by a simple binding.

I think you need to find out. Then you can read the documentation for that server to see if it supports writing to one array element.

Ok , i tried to change value in Tag browser but same error occured as shown in above photos type mismatch..

When I changed its type (Double array) then this error shown
Error writing to D1[0]: Bad • 4 minutes ago
Bad_WriteNotSupported: The server not does support writing the combination of value.

37

Ok sure, i will check for this opc server, but what to do if this is not done using simple binding, What else is required?

I think you would,

  • Create onChange event on your Numeric Entry Field.
  • Read the whole array into a list.
  • Change the list element that is to be updated.
  • Write the updated list back to the array.
1 Like

I repeat ...
Swathi, when you are pasting code you need to select the code block and press the </> button. Most of your code formatted correctly because there were leading spaces but the first two lines

Use onActionPerformed (with correct spelling and capitalisation).

  • onActionPerformed does nothing if the control is disabled.
  • onClick will execute if the control is disabled. This causes much confusion to some users who are surprised when button enabled : false doesn't disable the event.
1 Like

Ohh ...sorry, Yes sure I edited code ..

Yes this is worked for me...
Actualy I get datatype mismatch error in Float array while reading and writing tag
But then I create new OPC tag which has Double Array data type and bind that tag in numeric entry field , then add script in onActionPerformed for reading and writing tags in tag browser as well as opc (using system.tag.writeBlocking and system.opc.writeValue ) so it is worked for me, values are changed while action is performed,

But I have one question regarding Bidirectional :
When I am adding script in onActionPerformed
(For this Double Array datatype individual elements read write in different numeric field)then there is no needed to check this Bidirectional checkbox right??

Correct, and it might create a fight in the logic!

Oh , Ok that means if I added script as well as check Bidirectional then both are trying to change value , so that it will create conflict, so when adding script(via Configure Event) then Bidirection checkbox must be unchecked right??