# Issue using system.tag.configure() and setting the values to a float

**URL:** <https://forum.inductiveautomation.com/t/issue-using-system-tag-configure-and-setting-the-values-to-a-float/97721>\
**Category:** Ignition\
**Created:** [October 24, 2024, 11:21am UTC](https://forum.inductiveautomation.com/t/issue-using-system-tag-configure-and-setting-the-values-to-a-float/97721 "2024-10-24T11:21:29Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Joshwa\_Bachelder](https://avatars.discourse-cdn.com/v4/letter/j/e19b73/32.png) [@Joshwa\_Bachelder](https://forum.inductiveautomation.com/u/Joshwa_Bachelder)\
**Post date:** [October 24, 2024, 11:21am UTC](https://forum.inductiveautomation.com/t/issue-using-system-tag-configure-and-setting-the-values-to-a-float/97721/1 "2024-10-24T11:21:29Z")

</div>

I'm having an issue with using scripting to acquire a float value of percentages in a database and then creating tags using system.tag.configure() to assign that returned float value to the tag. I've tried "float", "float4", "Float", "Float4" and the integer format and it continues to create the type of the tag as integer regardless. I need it to be a float value.

This is a snip it of my code, the values being assigned are returned values of a query from a sql database that has the values stored as floats. I even tried force casting it as float using float(value) and that didn't help either.

Ignition 8.1.38

Code

```python
 # HitCount_Threshold_Warning Tag
        HitCountThresholdPrimary = system.db.runScalarPrepQuery(getHitCountThresholdQuery, [machine_group, machine_name, subprocess])
        hit_count_threshold_primary_tag = {
            "name": "HitCount_Threshold_Warning",
            "type": "Float4",
            "value": float(HitCountThresholdPrimary),
            "valueSource": "memory",
            "tagType": "AtomicTag"
        }
        tags2.append(hit_count_threshold_primary_tag)
        
        # HitCount_Threshold_SecondWarning Tag
        HitCountThresholdSecondary = system.db.runScalarPrepQuery(getHitCountSecondaryQuery, [machine_group, machine_name, subprocess])
        hit_count_threshold_secondary_tag = {
            "name": "HitCount_Threshold_SecondWarning",
            "type": "Float4",
            "value": float(HitCountThresholdSecondary),
            "valueSource": "memory",
            "tagType": "AtomicTag"
        }
        tags2.append(hit_count_threshold_secondary_tag)
        
        # Configure all tags at once
        system.tag.configure(subprocess_folder_path, tags, "o")
        system.tag.configure(subprocess_folder_path, tags2, "o")

```

---

<div class="post-metadata">

**Author:** ![Noah\_Casey](https://avatars.discourse-cdn.com/v4/letter/n/e480ec/32.png) [@Noah\_Casey](https://forum.inductiveautomation.com/u/Noah_Casey)\
**Post date:** [October 24, 2024, 12:21pm UTC](https://forum.inductiveautomation.com/t/issue-using-system-tag-configure-and-setting-the-values-to-a-float/97721/2 "2024-10-24T12:21:56Z")

</div>

"type" should be changed to "dataType"

Fixed Code:

```python
# HitCount_Threshold_Warning Tag
        HitCountThresholdPrimary = system.db.runScalarPrepQuery(getHitCountThresholdQuery, [machine_group, machine_name, subprocess])
        hit_count_threshold_primary_tag = {
            "name": "HitCount_Threshold_Warning",
            "dataType": "Float4",
            "value": float(HitCountThresholdPrimary),
            "valueSource": "memory",
            "tagType": "AtomicTag"
        }
        tags2.append(hit_count_threshold_primary_tag)
        
        # HitCount_Threshold_SecondWarning Tag
        HitCountThresholdSecondary = system.db.runScalarPrepQuery(getHitCountSecondaryQuery, [machine_group, machine_name, subprocess])
        hit_count_threshold_secondary_tag = {
            "name": "HitCount_Threshold_SecondWarning",
            "dataType": "Float4",
            "value": float(HitCountThresholdSecondary),
            "valueSource": "memory",
            "tagType": "AtomicTag"
        }
        tags2.append(hit_count_threshold_secondary_tag)
        
        # Configure all tags at once
        system.tag.configure(subprocess_folder_path, tags, "o")
        system.tag.configure(subprocess_folder_path, tags2, "o")

```

---

<div class="post-metadata">

**Author:** ![Joshwa\_Bachelder](https://avatars.discourse-cdn.com/v4/letter/j/e19b73/32.png) [@Joshwa\_Bachelder](https://forum.inductiveautomation.com/u/Joshwa_Bachelder)\
**Post date:** [October 24, 2024, 12:30pm UTC](https://forum.inductiveautomation.com/t/issue-using-system-tag-configure-and-setting-the-values-to-a-float/97721/3 "2024-10-24T12:30:20Z")

</div>

> [@Noah\_Casey](#):
>
> ```python
> # HitCount_Threshold_Warning Tag
> HitCountThresholdPrimary = system.db.runScalarPrepQuery(getHitCountThresholdQuery, [machine_group, machine_name, subprocess])
> hit_count_threshold_primary_tag = {
> "name": "HitCount_Threshold_Warning",
> "dataType": "Float4",
> "value": float(HitCountThresholdPrimary),
> "valueSource": "memory",
> "tagType": "AtomicTag"
> }
> tags2.append(hit_count_threshold_primary_tag)
>         
> # HitCount_Threshold_SecondWarning Tag
> HitCountThresholdSecondary = system.db.runScalarPrepQuery(getHitCountSecondaryQuery, [machine_group, machine_name, subprocess])
> hit_count_threshold_secondary_tag = {
> "name": "HitCount_Threshold_SecondWarning",
> "dataType": "Float4",
> "value": float(HitCountThresholdSecondary),
> "valueSource": "memory",
> "tagType": "AtomicTag"
> }
> tags2.append(hit_count_threshold_secondary_tag)
>         
> # Configure all tags at once
> system.tag.configure(subprocess_folder_path, tags, "o")
> system.tag.configure(subprocess_folder_path, tags2, "o")
> 
> ```

Wow, crazy. I tried dataType before but I didn't capitalize the F on float when I did that.

Thank you!!!
