Default values for add-on instructions don't work

rollex

Member
Join Date
Mar 2014
Location
Australia
Posts
55
I've created my own analog alarm add-on block that has some default values, namely the input scaling of 4000,20000. When I use this add-on block in my code the default value does not load and everythings defaults to 0.

I don't want to lock these values by writing 4000 and 20000 to them in code, I want the user to be able to edit them via SCADA, I however do not feel like manually entering all 96x2 of the values.

How can I make the default values work?

edit: it seems any new instances are set to the correct default values, however all my existing ones are not. How can I 'reinitialise' all my existing add-on blocks to suck in the default values, is there any way to do this?

I've tried exporting and importing my variables but this does not load the default.

edit: I renamed the module, deleted them all, reimported and it seems to have set the default value, unsure why it wouldn't work before.
 
Last edited:
I've created my own analog alarm add-on block that has some default values, namely the input scaling of 4000,20000. When I use this add-on block in my code the default value does not load and everythings defaults to 0.

I don't want to lock these values by writing 4000 and 20000 to them in code, I want the user to be able to edit them via SCADA, I however do not feel like manually entering all 96x2 of the values.

How can I make the default values work?

edit: it seems any new instances are set to the correct default values, however all my existing ones are not. How can I 'reinitialise' all my existing add-on blocks to suck in the default values, is there any way to do this?

I've tried exporting and importing my variables but this does not load the default.

edit: I renamed the module, deleted them all, reimported and it seems to have set the default value, unsure why it wouldn't work before.

You'll remember that next time...


Because of what you wrote that I highlighted in red

The "default" values are only applied when an instance is created...

However, if you look at the bottom of the "Parameters" tab of the Add-On definiton dialog, there is a check box that says "Copy all default values of parameters and local tags whose values were modified to all tags of this instruction type."

That may be what you are looking for....
 
I found that while editing the parameters of the AOI I actually had to change a default - then you can change it back - for the box to be enabled.
 
"Copy all default values of parameters and local tags whose values were modified..."

I'm suggesting it only does ones you modify.... If you are using the function to initialise AOI tags that didn't "get" the default values, then you'll have to modify them all, with the check-box ticked.
 

Similar Topics

On our system, on the HMI we've got a page of setpoints. These are the values at which alarms are set (e.g. a high temperature alarm or a low...
Replies
4
Views
1,225
Hi guys, Making a bunch of AOI's for company and I was wondering if there was a way to make them pre-populate their input requirements with the...
Replies
5
Views
2,347
I am working with Twincat 3. I am trying to store some images in files and when PLC restarts I want to read those files and get the images...
Replies
0
Views
44
Hello all, I am looking for a way to have a user get logged out after an X amount of time because to default so that user privilages are no...
Replies
4
Views
563
I've got a G4(board only)with a MMI port problem. I do not know the IP, but I believe that port works. Is there a way to reset the device to...
Replies
1
Views
539
Back
Top Bottom