Hello,
I am trying to write to a memory tag called JobNumSelect, it is a string.
Inside of Extension Functions onDoubleClick
I have this code:
import system
system.tag.write("[PanelShop]JobNumSelect", “test”)
and it works like a charm
I put this:
import system
system.tag.write("[PanelShop]JobNumSelect", value)
and it does not work, it compiles the string does not appear as the value of the tag though. The value is from an nvarchar array.
I can get the value to come up if I right-click by using onPopupTrigger and its sample code, just inserting value instead of the string “Hello” in the code. It pops up a tooltip that says my job number which would be like 55555-1-1. So I know that value is returning this string but maybe I need to do something about datatype?
Unfortunately typecasting by using str(value) did not do the trick
post all your code
caption your code in triple backquotes (above the tab key) this will format the code to be readable
is this in a power table? if so you would need to click on the correct row and correct column to get the value correct. Or you can add something like this to always choose the value at a certain column when you click anywhere on the row. Also, I don’t think you need to import system to run the tag write.
value = self.data.getValueAt(rowIndex, "Column Name")
Thats great feedback thanks.
I fixed it by rebooting Ignition… Apparently it gets buggy when you feed non-string data types to a string memory variable.
str(value) was indeed the answer