# Zero/Tare a scale head using Ignition?

**URL:** <https://forum.inductiveautomation.com/t/zero-tare-a-scale-head-using-ignition/19015>\
**Category:** General Discussion\
**Tags:** ignition79\
**Created:** [July 30, 2018, 3:13pm UTC](https://forum.inductiveautomation.com/t/zero-tare-a-scale-head-using-ignition/19015 "2018-07-30T15:13:47Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![klichtenauer4](https://avatars.discourse-cdn.com/v4/letter/k/d78d45/32.png) [@klichtenauer4](https://forum.inductiveautomation.com/u/klichtenauer4)\
**Post date:** [July 30, 2018, 3:13pm UTC](https://forum.inductiveautomation.com/t/zero-tare-a-scale-head-using-ignition/19015/1 "2018-07-30T15:13:48Z")

</div>

I was wondering if anyone has been successful in creating a button in Ignition that can send a Tare or a Zero command to a scale head. Specifically, I am using the PS\_IN202 scale head. I’ve tried Googling but haven’t found anything helpful. If it is possible, would you mind providing a little snippet of the code. Thanks in advance.

---

<div class="post-metadata">

**Author:** ![paul-griffith](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paul-griffith/32/37249_2.png) [@paul-griffith](https://forum.inductiveautomation.com/u/paul-griffith)\
**Post date:** [July 30, 2018, 3:21pm UTC](https://forum.inductiveautomation.com/t/zero-tare-a-scale-head-using-ignition/19015/2 "2018-07-30T15:21:22Z")

</div>

Are you connecting the scale directly to the Ignition gateway using the serial modules, or using a serial -\> ethernet converter and the TCP driver?

Based on [this](http://www.prime-scales.com/wp-content/uploads/2017/03/PS-IN202dataFormat-Protocols.pdf) document it looks like you just need to send a CRLF terminated sequence with the correct characters, which you should be able to do with either driver.

---

<div class="post-metadata">

**Author:** ![klichtenauer4](https://avatars.discourse-cdn.com/v4/letter/k/d78d45/32.png) [@klichtenauer4](https://forum.inductiveautomation.com/u/klichtenauer4)\
**Post date:** [July 30, 2018, 3:28pm UTC](https://forum.inductiveautomation.com/t/zero-tare-a-scale-head-using-ignition/19015/3 "2018-07-30T15:28:21Z")

</div>

Yes, I am using the serial modules. I had found that same document but I guess it isn’t making sense to me. Do you know what script I would use to send that CRLF command?

---

<div class="post-metadata">

**Author:** ![paul-griffith](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paul-griffith/32/37249_2.png) [@paul-griffith](https://forum.inductiveautomation.com/u/paul-griffith)\
**Post date:** [July 30, 2018, 3:34pm UTC](https://forum.inductiveautomation.com/t/zero-tare-a-scale-head-using-ignition/19015/4 "2018-07-30T15:34:51Z")

</div>

First, configure the serial port: [https://docs.inductiveautomation.com/display/DOC79/system.serial.configureSerialPort](https://docs.inductiveautomation.com/display/DOC79/system.serial.configureSerialPort)  
Then open it to write: [https://docs.inductiveautomation.com/display/DOC79/system.serial.openSerialPort](https://docs.inductiveautomation.com/display/DOC79/system.serial.openSerialPort)  
Then, write to it: [https://docs.inductiveautomation.com/display/DOC79/system.serial.write](https://docs.inductiveautomation.com/display/DOC79/system.serial.write)  
Assuming the previously linked document is accurate, `system.serial.write("COM<whatever>", "ST\r\n")` (or `"SZ\r\n"`, for **S** cale **T** are / **S** cale **Z** ero, I’m assuming) should send the appropriate bytes.

---

<div class="post-metadata">

**Author:** ![klichtenauer4](https://avatars.discourse-cdn.com/v4/letter/k/d78d45/32.png) [@klichtenauer4](https://forum.inductiveautomation.com/u/klichtenauer4)\
**Post date:** [July 30, 2018, 3:49pm UTC](https://forum.inductiveautomation.com/t/zero-tare-a-scale-head-using-ignition/19015/5 "2018-07-30T15:49:07Z")

</div>

Thank you, sir. I changed it to serial.writeString(“ST\r\n”) and it worked perfectly.
