Multiply Numeric Entry for Correct OPC Tag Value

I have a bunch of numeric fields on a project that are binded by Integer to OPC tags. On the HMI it may read, 15s, but on the PLC it reads 15ms. I can correct this all on the PLC side through basic MULT instructions. Is there an easier way to do this shift on the Ignition side?

If I put in 15 on the text box, I need the OPC tag to read the value of 15000 so that 15000ms = 15s

1 Like

You can scale the tag directly in the tag properties.

1 Like

I saw the linear scaling but I don’t think that will work. I haven’t been successful in only changing the tag value. Because I have the numeric field bound to the tag, any scaling on the tag changes my numeric field value too.

I need something that leaves the field value as x, but the opc tag will show x*1000

Numeric field bound to a derived tag that’s 1/100th of the OPC tag?

See Types of Tags | Ignition User Manual

What do you mean the OPC tag “will show”? Not sure what you’re after. If you scale the OPC tag by 1000, the numeric entry will show 15, and the PLC value will have a value of 15000. The tag itself in Ignition will have a value of 15 as it should. Why would you need a value of 15000 in Ignition with a value of 15000 in the PLC, but show 15 in the numeric entry?

1 Like

Please make it clear:

  • What are the units in the PLC?
  • What are the units on the OPC tag?
  • What scale factor is applied to the tag?
  • What are the units on the display?

HMI:

Screen shows entry field in (s), OPC tag shows same value. PLC see s that value as a 15ms because TIME in TIA is default ms.

I need that entry field to stay 15s (user enters delay time in seconds), the OPC tag to multiply the value of the numeric field * 1000, so that the PLC will see 15000ms = 15s.

Wouldn't you just set the tag scaling to 0.001?

Raw Low:     0.0
Raw High:    1000.0
Scaled Low:  0.0
Scaled High: 1.0
3 Likes

Thanks for marking my post as "Solution".

Note that your original post was not worded correctly. You meant,
"When I enter 15 into the text box1 I need the OPC tag to read 15 but enter 15000 into the PLC variable memory."

Getting the specification right is very important.

1 You should be using a Numeric Entry Field component, not a text box.

1 Like

You are correct. I have learned a few errors along the way and that was one of them. The scaling I was attempting on my own wasn’t producing the result I needed, but now I understand more about how the scaling actually works. I’d prefer to do the scaling on the OPC tag inside the HMI then have to create functions inside the PLC to convert everything.

Thanks again

On a philosophical level, I prefer the opposite. All tags should be scaled to engineering units in the PLC, and the HMI should always be 1:1 scaling. I understand the convenience, but if you’re trying to troubleshoot at 3am, much easier if all the math is in one place and not hidden on a tag property on a Scada Tag database.

4 Likes