Andrew Evenson
Member
Ladies & Gentlemen,
I hope someone can maybe lead me in the right direction..
It is my first time dabbering with a Siemens S7-300. I decicded to duplicate some code we use on our automation platform, to play around with because I know how it works. The automation platform is not Siemens. It is from a company called Alstom. In the Alstom platform, you can combine bit and word logic in the same rung. This is what I am trying to achieve in the Siemens.
Alstom Example:
Note : The left hand rail cannot be considered a "power" rung or "1" , it has a value if -1 or Hex FFFF.
I should explain some things about the code.
The "a" and "g" address are integer values, not different than a "B" address in Allen Bradley. The "@" sysbol denotes a hex value.**This last stentence is key*** The <AND> is no different than what it implies. The <OUT> instruction is like the "Transfer" function in Siemens.
The above code works like this, you are basically creating a bit pattern within "g10" by setting bits withing g10 based on the conditions of the a0 bits. This allows you to buildup the word to represent different conditions or what ever you want. We use this for our HMI's to represnt a status for a device, instead of sending induvidul bits to the HMI.
If no "a0" bits are set, g10 = 0
If a0.0 is set, g10 = 2
If a0.1 is set, g10 = 4
If a0.0 and a0.1 are set, g10 = 6
If a0.2 is set, g10 = 32
If all bits are set, g10 = 38
I can figure out how to do this in Siemens, may take quite a bit of code, just trying to see if they have a "canned" instruction to do this?? I've looked, but cant seem to find anything.
Please ask if my explination is confusing...
Any help would be appriciated..
Thank you,
Andrew
I hope someone can maybe lead me in the right direction..
It is my first time dabbering with a Siemens S7-300. I decicded to duplicate some code we use on our automation platform, to play around with because I know how it works. The automation platform is not Siemens. It is from a company called Alstom. In the Alstom platform, you can combine bit and word logic in the same rung. This is what I am trying to achieve in the Siemens.
Alstom Example:
Note : The left hand rail cannot be considered a "power" rung or "1" , it has a value if -1 or Hex FFFF.
|----||---<AND>----------------------------------(OUT)------|
| a0.0 @1 | | g10
| | |
|----||---<AND>-|-<OR>---||--<AND>---|
a0.1 @2 @FFFF a0.2 @20
I should explain some things about the code.
The "a" and "g" address are integer values, not different than a "B" address in Allen Bradley. The "@" sysbol denotes a hex value.**This last stentence is key*** The <AND> is no different than what it implies. The <OUT> instruction is like the "Transfer" function in Siemens.
The above code works like this, you are basically creating a bit pattern within "g10" by setting bits withing g10 based on the conditions of the a0 bits. This allows you to buildup the word to represent different conditions or what ever you want. We use this for our HMI's to represnt a status for a device, instead of sending induvidul bits to the HMI.
If no "a0" bits are set, g10 = 0
If a0.0 is set, g10 = 2
If a0.1 is set, g10 = 4
If a0.0 and a0.1 are set, g10 = 6
If a0.2 is set, g10 = 32
If all bits are set, g10 = 38
I can figure out how to do this in Siemens, may take quite a bit of code, just trying to see if they have a "canned" instruction to do this?? I've looked, but cant seem to find anything.
Please ask if my explination is confusing...
Any help would be appriciated..
Thank you,
Andrew