# SECS/GEM Module Questions

**URL:** <https://forum.inductiveautomation.com/t/secs-gem-module-questions/12083>\
**Category:** General Discussion\
**Created:** [August 30, 2016, 3:25am UTC](https://forum.inductiveautomation.com/t/secs-gem-module-questions/12083 "2016-08-30T03:25:58Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![wmorata](https://avatars.discourse-cdn.com/v4/letter/w/e9a140/32.png) [@wmorata](https://forum.inductiveautomation.com/u/wmorata)\
**Post date:** [August 30, 2016, 3:25am UTC](https://forum.inductiveautomation.com/t/secs-gem-module-questions/12083/1 "2016-08-30T03:25:58Z")

</div>

Hi All,

I’m new to SECS/GEM Module. I have a few questions regarding inserting of SECS/GEM messages into the Database Table “SECSGEM\_NewMessage”

Suppose I’m sending a SECS requests with a parameter format of “B”

How will the message body look like

myByteVal = ??? \<------ assume this is my “B” data to be inserted  
myASCIIVAL = ‘test’  
body = ‘[{“format”:“A”, “value”:’ + myASCIIVAL + ‘},{“format”:“B”, “value”:’ + myByteVal + ‘}]’;  
print body

How will I do this? and how will the body string looks like when inserted in the database?

Thank you!

---

<div class="post-metadata">

**Author:** ![mgross](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/mgross/32/3311_2.png) [@mgross](https://forum.inductiveautomation.com/u/mgross)\
**Post date:** [August 30, 2016, 2:46pm UTC](https://forum.inductiveautomation.com/t/secs-gem-module-questions/12083/2 "2016-08-30T14:46:10Z")

</div>

Keep in mind that the new messages table is going to disappear in the very near future, and that the only way to send messages will be to use the system.secsgem.sendMessage() scripting function. But in the meantime, here is a message body with binary data:

```auto
{'doc': 'ABS','format': 'B','value': [0x00,0x01,0x03,0x03,0x0a,0x0d,0x1b,0x5d,0x18,0x18,0x18,0x1a,0x04,0x13,0x7f,0x80,0xfe,0xff] }
```

Here is another example using integers for the byte array (same values as above):

```auto
{'doc': 'ABS','format': 'B','value': [0, 1, 3, 3, 10, 13, 27, 93, 24, 24, 24, 26, 4, 19, 127, -128, -2, -1] }
```

---

<div class="post-metadata">

**Author:** ![wmorata](https://avatars.discourse-cdn.com/v4/letter/w/e9a140/32.png) [@wmorata](https://forum.inductiveautomation.com/u/wmorata)\
**Post date:** [September 1, 2016, 12:16am UTC](https://forum.inductiveautomation.com/t/secs-gem-module-questions/12083/3 "2016-09-01T00:16:25Z")

</div>

Thanks! It’s now working!
