Inverter power control

I have a problem.
I im using ignition 7.5.12
Connecting connecting inverters via modbus tcp.
There is a solar power plant where 80 inverters are installed. Each inverter has a power regulation function by a tag.
It is necessary to set the value for example: the power plant should work tomorrow at 11:00 with the total power of 2000 kW, 12:00 2100 kW and so on … How can this be implemented? Requires 2000KV / 80 = 25KW (this value should be automatically recorded to each inverter )

You must be mistaken on the Ignition version as presently only 8.0.1 (nightly) is available.

Without more details, I’ll give a general answer that’s hopefully useful. Scheduled control like you’re noting would be accomplished by comparing present time to times in schedule and writing values from schedule whenever present time matches a schedule time. Be careful to make sure you don’t miss a scheduled time (check often enough and don’t look for an exact equals match), and ideally only write the values for that schedule once (one shot when time > scheduledTime).

While this would be easy to do in Ignition, I don’t recommend using an HMI for control logic. Put the schedule and the logic to use it in the PLC and view/edit the schedule in Ignition.

Sorry.Ignition 7.5.12

I would like to use Ignition. Where can I find information on how to do this in Ignition? Now there is no way to put an additional PLC.

You can go thru the Inductive University and see scripting section. I think you can use gateway timers for this with a resolution of 5 to 10 seconds, depending upon the accuracy of time trigger. Compare the current time > the set trigger times to write the appropriate value in the tags corresponding to the Inverted set point.

Thank you Pramanj! You helped me a lot.
I wrote a script, it works but gives the error “name Tags is not defined”.
How can I add a value from the “PR” tag to the row of the script “Values”? The value of the tag “PR” periodically changes.

I guess you need to check the syntax of your code. It should be as per the documentation (for verion 8) https://docs.inductiveautomation.com/display/DOC80/system.tag.writeBlocking which says:

# Specify the paths
paths = [
"[default]Folder/Tag_A" ,
"[default]Folder/Tag_B"
]

# Specify the values
values = [
1 ,
2
]
# Send the writes off
system.tag.writeBlocking(paths, values)

for version 7.9 see documentation on page https://docs.inductiveautomation.com/display/DOC79/system.tag.writeAll

So you need to specify the paths for your three variables corresponding to your inverter outputs paths=["[default]P1","[default]P2",[default]P3",[default]PR"] (get paths by right-clicking on the tags in tag browser and select get tag path) and values=[15,11,9,38] and then call system.tag.writeBlocking(paths, values) in the if block when time equals hh:mm:ss (include ss also because your timer runs every 5 seconds or change timer to 60 seconds so that it will trigger once in a minute so you don’t need to compare seconds).

In the current code the inverter is getting written outside the if block! So it will overwrite same value again and again!

As @Pramanj notes, the error is because the write is happening whether the time condition is met or not. When it is not met, tags is None because it is only set when the if time condition is true.

Post your code inside triple back ticks (`, or use the </> button at the top of the post window) to make it easy for others to read and edit.

You probably want something like the following (though you may need to stick with your date code as I’m not sure these system.date functions exist in your version):

if system.date.format(system.date.now(), 'hh:mm') == '08:09':
	# Get PR value.
	PR_value = system.tag.read('PR').value
	# List tags to write.
	tags = ['P1', 'P2', 'P3']
	# Below lines are also indented so they only execute when if condition is true (like the tags line above).
	# List values. PR_value will be written to P3 tag.
	values = [15, 11, PR_value]
	# Write tags.
	system.tag.writeAll(tags, values)

This will write repeatedly at the timer event interval while the time condition remains true. You could do something like writing another tag storing the last time values were written and check that it is at least a minute ago to avoid redundant writes. Or simpler, as @Pramanj suggests, set the event script to run every 60 seconds so the event only occurs once per minute.

1 Like