# Error convert to int

**URL:** <https://forum.inductiveautomation.com/t/error-convert-to-int/5268>\
**Category:** Ignition\
**Created:** [October 12, 2012, 4:27pm UTC](https://forum.inductiveautomation.com/t/error-convert-to-int/5268 "2012-10-12T16:27:35Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![caritoel27](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/caritoel27/32/3430_2.png) [@caritoel27](https://forum.inductiveautomation.com/u/caritoel27)\
**Post date:** [October 12, 2012, 4:27pm UTC](https://forum.inductiveautomation.com/t/error-convert-to-int/5268/1 "2012-10-12T16:27:35Z")

</div>

Hi, I write to you because i have a problem with a numeric text field, i call the window where is the numeric text field, and appears a message with error, after it I close i try once more, and it’s ok i can work with that numeric text field, and it ocurs again if I save de proyect in the designer, or I logout and log in again with another user, or the user. i try again and it works until i save the project again or the other actions.

the message says:

Traceback (most recent call last):

File “event:internalFrameOpened”, line 2, in

TypeError: can’t convert 63.5 to int

Ignition v7.5.1 (b1122)  
Java: Sun Microsystems Inc. 1.6.0\_31

I can’t understand, because everything is with its respective type integer

I will appreciate you help please what this message means.

---

<div class="post-metadata">

**Author:** ![Kevin.McClusky](https://avatars.discourse-cdn.com/v4/letter/k/47e85d/32.png) [@Kevin.McClusky](https://forum.inductiveautomation.com/u/Kevin.McClusky)\
**Post date:** [October 12, 2012, 4:44pm UTC](https://forum.inductiveautomation.com/t/error-convert-to-int/5268/2 "2012-10-12T16:44:22Z")

</div>

Hi caritoel27,

That message normally comes from trying to cast a float to an int.

Can you copy the script from internalFrameOpened and paste it in this thread?

---

<div class="post-metadata">

**Author:** ![caritoel27](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/caritoel27/32/3430_2.png) [@caritoel27](https://forum.inductiveautomation.com/u/caritoel27)\
**Post date:** [October 12, 2012, 5:10pm UTC](https://forum.inductiveautomation.com/t/error-convert-to-int/5268/3 "2012-10-12T17:10:47Z")

</div>

The thing is that i’m not converting from float to int . I’m sending every value for that is a float

Velocidad is the value i’m sending to the numeric text field Temperatura, both float in the BD is also Float(Mysql) y shows me the error 1 time , after it works without message of error.

the error appears if a save a change or only save the project in the designer.

I send you the full message error, 2 pictures one is the parameters that i send when i clic the button to the window add\_curva\_calibre, the others is the window that contains the button error  
also I send the window ADD\_punto called if it helps.

* * *

the message more detailed  
Traceback (most recent call last):  
File “event:internalFrameOpened”, line 2, in   
TypeError: can’t convert 0.0 to int

```
at org.python.core.PyException.fillInStackTrace(PyException.java:70)
at java.lang.Throwable.<init>(Throwable.java:181)
at java.lang.Exception.<init>(Unknown Source)
at java.lang.RuntimeException.<init>(Unknown Source)
at org.python.core.PyException.<init>(PyException.java:46)
at org.python.core.PyException.<init>(PyException.java:43)
at org.python.core.PyException.<init>(PyException.java:61)
at org.python.core.Py.TypeError(Py.java:221)
at org.python.core.Py.tojava(Py.java:501)
at org.python.core.PyBeanProperty._doset(PyBeanProperty.java:63)
at org.python.core.PyObject. __set__ (PyObject.java:3678)
at org.python.core.PyObject.object ___setattr__ (PyObject.java:3742)
at org.python.core.PyObject.object ___setattr__ (PyObject.java:3732)
at org.python.core.PyObject$object ___setattr___ exposer. __call__ (Unknown Source)
at org.python.core.PyObjectDerived. __setattr__ (PyObjectDerived.java:990)
at com.inductiveautomation.factorypmi.application.script.PyComponentWrapper. __setattr__ (PyComponentWrapper.java:139)
at org.python.pycode._pyx67.f$0(<event:internalFrameOpened>:2)
at org.python.pycode._pyx67.call_function(<event:internalFrameOpened>)
at org.python.core.PyTableCode.call(PyTableCode.java:165)
at org.python.core.PyCode.call(PyCode.java:18)
at org.python.core.Py.runCode(Py.java:1261)
at com.inductiveautomation.ignition.common.script.ScriptManager.runCode(ScriptManager.java:539)
at com.inductiveautomation.factorypmi.application.binding.action.ActionAdapter.runActions(ActionAdapter.java:155)
at com.inductiveautomation.factorypmi.application.binding.action.ActionAdapter.invoke(ActionAdapter.java:266)
at com.inductiveautomation.factorypmi.application.binding.action.RelayInvocationHandler.invoke(RelayInvocationHandler.java:55)
at $Proxy19.internalFrameOpened(Unknown Source)
at javax.swing.JInternalFrame.fireInternalFrameEvent(Unknown Source)
at javax.swing.JInternalFrame.show(Unknown Source)
at java.awt.Component.show(Unknown Source)
at java.awt.Component.setVisible(Unknown Source)
at javax.swing.JComponent.setVisible(Unknown Source)
at com.inductiveautomation.factorypmi.application.FPMIApp$RuntimeWindowOpener.openWindow(FPMIApp.java:1573)
at com.inductiveautomation.factorypmi.application.FPMIApp.openWindow(FPMIApp.java:883)
at com.inductiveautomation.factorypmi.application.script.builtin.SecurityUtilities._tempReOpen(SecurityUtilities.java:206)
at com.inductiveautomation.factorypmi.application.runtime.UpdateProjectPane.uninstall(UpdateProjectPane.java:101)
at com.inductiveautomation.factorypmi.application.runtime.UpdateProjectPane$1.stepsFinished(UpdateProjectPane.java:89)
at com.inductiveautomation.ignition.client.launch.AbstractStepRunner$1.run(AbstractStepRunner.java:40)
at java.awt.event.InvocationEvent.dispatch(Unknown Source)
at java.awt.EventQueue.dispatchEventImpl(Unknown Source)
at java.awt.EventQueue.access$000(Unknown Source)
at java.awt.EventQueue$1.run(Unknown Source)
at java.awt.EventQueue$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.AccessControlContext$1.doIntersectionPrivilege(Unknown Source)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.run(Unknown Source)

```

Ignition v7.5.1 (b1122)  
Java: Sun Microsystems Inc. 1.6.0\_31  
[AddPunto.proj](https://us1.discourse-cdn.com/inductiveautomation/original/2X/d/db27b06fa04325decbd7324accda3d67f43021b0.proj) (17.4 KB)

 ![](https://us1.discourse-cdn.com/inductiveautomation/original/2X/4/4a06c3d8d405d638251b3f1d29434851d9cb8c87.jpg)  
  
 ![](https://us1.discourse-cdn.com/inductiveautomation/original/2X/b/bcc5ebeebbe2b09172c0fe1f7e0b3a55f2b40476.jpg)

---

<div class="post-metadata">

**Author:** ![James.Lorenz](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/james.lorenz/32/3290_2.png) [@James.Lorenz](https://forum.inductiveautomation.com/u/James.Lorenz)\
**Post date:** [October 12, 2012, 6:39pm UTC](https://forum.inductiveautomation.com/t/error-convert-to-int/5268/4 "2012-10-12T18:39:51Z")

</div>

That internalFrameOpened script needs to be modified to send the proper datatype to that property, since the property is expecting an int. Changing the script so that it takes the float value and casts it as an int should work:

```auto
system.gui.getParentWindow(event).getComponentForPath('Root Container.AddEditContainer.Numeric Text Field').intValue = int(system.gui.getParentWindow(event).getComponentForPath('Root Container').Velocidad)
```

---

<div class="post-metadata">

**Author:** ![caritoel27](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/caritoel27/32/3430_2.png) [@caritoel27](https://forum.inductiveautomation.com/u/caritoel27)\
**Post date:** [October 12, 2012, 7:12pm UTC](https://forum.inductiveautomation.com/t/error-convert-to-int/5268/5 "2012-10-12T19:12:05Z")

</div>

Thanks very much James!!! 😃 ![:prayer:](https://us1.discourse-cdn.com/inductiveautomation/original/1X/e5a7e3b63facc151ea73e3b45db7bdb3d4bdc316.gif ":prayer:") it works!!! Have a good day 🙂

Caritoel27
