I feel like I am making something that should be simple way more complex than it needs to be.
I have a memory tag that is a float and I want another tag (short) to have that value but multiplied by 1000.
The below is what I want..
MemoryTag = 3.125
OPCShortArray = 3125
What is the best way to accomplish this?
I have attempted putting a change script into the Memory Tag, but I have had no success with that. When I run the script in the script console it works but nothing happens when I put the same script in the change script for the memory tag. I have tried changing it to tell it that the path is [Edge]Path, [~]Path, and [Gateway Scripting Project Name]Path.. none of the above is working.
Actually, your problem may be the use of a short array. OPC array tags are notoriously fickle when it comes to writing to single elements (or anything less than the entire array). Test with a simple integer tag.
I got it working with a derived Tag, but I feel like I am doing it incorrectly:
I have my memory tag that has the float value
Then I have my OPC array which has the value I want to write to.
I made a separate derived tag with the read/write using the memory tag * 1000, then the source is set to the OPC array element I want to work with. However to get the tag to update I have to set the value of the derived tag to any arbitrary value and it will then read/write the memory tag...
I feel like I am setting something up incorrectly, but it is doing what I want it to do..
The issue is that the OPC server is set up by another device which I don't have any control over.
I was attempting to break the array into individual tags by using reference tags which reference specific elements in the array that I want to be able to use. However I had the same issue when using the reference tag.
Let's back up. Please show your script that you originally tried, that worked in the script console. In a tag's value change, that would likely work if indented properly, and there was no reliance on any project defaults.