No announcement yet.

Generating a binary string for SCADA software

  • Filter
  • Time
  • Show
Clear All
new posts

  • Generating a binary string for SCADA software

    Has anybody ever tried or heard of a successful implementation of PLC programming that can write the system status into a string for retrieval from SCADA software? Here's what i'm running in to...

    The system I'm working on monitors two furnaces in my shop. I'm using a free scada software to provide email alerts, diagnostic information and reports. The software i'm using has a tag limit that i'm about to run into and the cost of buying the least expensive license is over $1,500 which is way too much for what i'm doing. I'm trying to figure out how I can construct a string on the PLC that contains all of the information I need for each furnace. I can then use 1 tag per unit to pull that info into the scada software instead of using 16 tags to pull in each address. Here's a basic example:

    Power | Safety | Pilot | Fans | Thermal cut out | Vent safety cut out | Heat Call | Running
    11100000 - This would indicate that the furnace is in a standby state and is ready to run when the thermostat calls
    11110011 - This would indicate that the furnace is running normally
    11111010 - This would indicate that the furnace has cut out due to high temperature, but the t-stat is still calling for heat
    and so on...
    Is the only way to do this by writing conditional logic and using the copy instruction to write to the memory address like the example below, or can this be simplified?

    -| |------------| |------------| |-------------| |---------------|/|---------------|/|-------------| |------------| |------------------(COPY)
    x201          x202           x203            x204              x205              x206           x207           x208                     DS15
    Power       Safety          Pilot              Fan               TCO              VSCO            HC             Run                    11110011
    I'd like to use as few rungs as possible to keep things clean. Writing the above 16 times isn't the end of the world, but I thought there might be a better way that someone would know about, so I thought i'd ask and see if I could learn a thing or two!
    Last edited by smoran22; 12-28-2019, 02:45 AM.

  • #2
    Is the SCADA package incapable of extracting individual bits from an integer? If not I wouldn't even use the free version.
    And to cover all the possibilities you would need 256 rungs. Maybe choose a PLC with better string handling capabilities if you are stuck with the SCADA system.
    Last edited by bcarlton; 12-28-2019, 11:20 AM.



    • #3
      The software i'm using is VTScada Light. It seems to be pretty powerful and feature rich, and just happens to be the first program out of the 5 or 6 that I tried that I was able to get working. Most other free programs require a lot more programming skill than what I possess. That being said, I do have a binary tag type available to pull into the software, and I can read individual bits from that tag. In order to use that, I need to construct that string on the PLC, and that's where I'm stuck. In all reality I wouldn't use the full 256 rungs to cover every possibility, but after a nap and some coffee I see that I would need way more than the 16 I erroneously thought I would. This is my system to play with and learn on. This isn't a production system and if I break it, i'm only out my own money. If I can figure out a way to write the input status to a string, we're off to the races. If I can't do it on a CLICK, then it'll be awhile before I do any upgrading.


      • #4
        Surely the scada can convert an integer back to binary. Then you can do a pack copy in the click of your x bits (or c bits and you can mix and match i/o} with just a few rungs, then calculate what's going on in the scada software.
        10101010 -> 170 -> 10101010


        • #5
          Pack copy looks like it might be exactly what I need for this. I didn't know about that option. I'll have to play with it a bit.


          • #6
            Or, if you know in advance you want to do this, use bits from an integer as your relays in the first place, then you don't need to pack them, they're already there. Or, in the case of I/O bits, sometimes there's an alternate word-oriented way to reference the image register, like in Koyo there's VX0, meaning the 16-bit word from X0-7 and X10-17, also addressable via a normal octal V-Mem address.


            • #7
              Also upgrade to ver 12 and you can use the new I/O and calculation tag so you won't be constantly making new tags.
              Honestly just address the original bits.
              Trying to get two furnaces in under 50 tags is ambitious, good luck.


              • #8
                ControlsGuy explained the DirectLogic mapping, CLICK is a bit different but similar.

                The way you have those bit addresses shown, they are all Digital Inputs X201 to X208. These bits are automatically double-mapped into the 32-bit address "XD2", just point your Scada to the Modbus Address shown in the Address Picker.


                • #9
                  Years and years ago before all the pack bits etc. i would do an addition to get the bits I wanted.

                  Set Bitoutput to 0
                  ---| Power|------------(Math(Bitoutput = Bitoutput + 128))
                  ---| Safety|------------(Math(Bitoutput = Bitoutput + 64))
                  ---| Pilot|------------(Math(Bitoutput = Bitoutput + 32))
                  ---| Fans|------------(Math(Bitoutput = Bitoutput + 16))

                  11111010 -> 128+64+32+16+8+0+2+0 = 250 = 11111010