Announcement

Collapse
No announcement yet.

COM port script headache

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    #16
    Ok. I'll try and pull something out and post it tonight or tomorrow night. Darned day job keeps getting in the way.

    Steve

    Comment


      #17
      Andy,

      Attached is the skeleton of a VB.NET script. I realized after I was doing it that you probably prefer VBScript, but hopefully you can either figure it out or translate it.

      The basic idea:
      1. When you open the port, also create a variable and initialize it with an empty string.
      2. When you get some new data, first pre-pend it with whatever is in the variable.
      3. If you have the full message (looked like your messages were 23 bytes long) then process it and reset the variable to an empty string
      4. Otherwise, store what you received so far in the variable and exit, hoping you get some more on the next call.
      Obviously I have no way of testing this, but the general principle is how I process data from the Meteor CID device in my SnevlCID, and that seems to be working fine for a few users. I'll be happy to help if it either doesn't make sense or doesn't work. Let me know.

      Steve
      Attached Files

      Comment


        #18
        Originally posted by stevea View Post
        Darned day job keeps getting in the way.

        Steve

        Yup, I know where you are comming from, hence the late reply.

        Thanks for posting your script, but I think I have it 99% reliable. I found that instead of polling the alarm panel for all 16 zones at once, resulting in a 23 byte packet, if I read the first eight then the second eight I got two 15 byte packets which HS seems to cope with.

        I don't know why, but hey...It works


        Thanks for everyones help, it's much appreciated.


        Andy

        Comment

        Working...
        X