Lengthy Template question

I have created a template for Motor Control and Status. It has a custom property assigned called “MotorTag” that I would like to be able to bind to once I create an instance. There are multiple parts to this question, but they all relate to one another, so I’ll group them here.

  1. I have three different PLC’s that will be providing the data I am displaying (I. E. PLC1, PLC2, PLC3). Within the PLC I have a user created Add-On instruction (CompactLogix PLC) called Motor_Control that contains all the control and status elements (start/stop commands, auto/man, runtimes, fault status, motor status, etc.) In my tag structure for Ignition, I have created a folder for each PLC and then completed the OPC browse and drag and drop to get the tags into the database. My path for a tag would look like “PLC1/M011/MOTOR_STATUS” . M011 shows in my tag list as a folder. I can directly link to a sub element, but am not sure how to set up the indirect tag and the custom property binding. I was attempting to use {1}/MOTOR_STATUS as the indirect so that the custom property would bind {1} to “PLC/M011”. When I attempt that, I get an error “You must choose a non-folder tag or tag property in the tree”. What is the best method to solve this?

  2. On the template, I have created a two position rotary switch that uses the following script to toggle a bit within the Add-On instruction in the PLC:

x = system.tag.read (“PLC1/M011/PROG_AUTO”)

if x.value is True:
system.tag.write(“PLC1/M011/PROG_AUTO”, 0)
else:
system.tag.write(“PLC1/M011/PROG_AUTO”, 1)

How do I change that script so that it uses the same indirect tag {1}?

  1. Is there a tutorial somewhere that gives more information on templates/custom properties/Drop Targets?

Thanks!

  1. Where are you trying to do this? I don’t remember seeing this error.
    Are you trying to bind a background color or text field using Property binding on the button itself?

2)You have to bind to the template custom properties. Code would look like:

x = system.tag.read(event.source.parent.MotorTag +"/AUTO")

if x.value is True:
	system.tag.writeToTag(event.source.parent.MotorTag +"/AUTO", 0)
else:
	system.tag.writeToTag(event.source.parent.MotorTag +"/AUTO", 1)
  1. The user manual is a tad behind.
    They have great videos on the web site.
    http://www.inductiveautomation.com/support/videos/5
    But they are behind, but will help you get started.
    This forum is the best place to keep up with the latest news.

Cheers,
Chris

I added the custom property “MotorTag” to the entire template. (Right clicked on a blank area of the template and selected custom properties) I added it as a “String” type, expecting that the tag name path would be a string. I am then setting all my various template bindings to use the {1} as the indirect tag with the property path being “MotorControl.MotorTag” and once I add an instance to a screen, would try to then bind my custom property of "MotorTag to the actual motor “PLC1\M011” That is where I get the error.

I will assume this issue is impossible to resolve. It’s a shame since other software packages handle this type of issue with ease.

I appreciate the folks who at least looked at the issue.

I have tried to recreate that error and can not.
Ignition version 7.5.6

If you could post the entire error message, give me a screen shot, or explain further.

I have over 100 templates. All aspects are indirectly addressed for control / status talking to multiple PLC’s, systems, areas, etc…

Cheers,
Chris

The issue here appears to be associated with the Add-On instruction. I had to create a UDT within Ignition to set up the template. Thanks for the help!

By the way, you can create a custom property in your template that is one of your UDT (data) types. Then you can simply pass a UDT to your template instead of trying to work with indirect binding.