Addressing a bit from an INT inside Siemens Function Block

Super Steve

Member
Join Date
Mar 2018
Location
NC
Posts
2
I am working with a Siemens 1515 CPU and I have created a ladder function block to use like an AB Add-On Instruction to control a Danfoss VFD. I am reading in the Status word (INT) of the VFD into this program block, which I am calling "I_VfdStatus".
I need to use a couple of bits from the Status word inside my program block. Like bit #2 is "VFD Faulted" How do I address a single bit from "I_VfdStatus" inside the program block?

Thanks in advance.

Steve
 
Youre welcome
Its only in In 1200 and 1500 CPU.
Its more tricky in older 300/400
You can also use xxx.B0 (byte 0)
Or xxx.W0 for (word 0)

Peter
 
The other handy thing to do is you can create the telegram from the danfoss drive as a custom Data Type (one for input data, one for output data)

Then, when you declare the tags for the drive's IO, you can declare I_Vfdstatus as type DanfossStatus (or whatever you called it), instead of as a simple INT. You declare it to the first bit of the structure (ie instead of IW20 it would be I20.0). All the bits are right there in the structure, and then you can pass the whole structure into the FB in one go as well.
 
I would follow mk42's advice.
When you create a Data Type you will then have meaningful names in the program, such as I_VfdStatus.Fault instead of I_VfdStatus.%X2
Easier to read the program. Less likely to make errors.

cardosocea said:
Wouldn't it be I_VfdStatus.2? In S7-300/400? How is that trickier?
With S7-300/400 you dont have the "slice" adressing (*).
You can only chose either fully symbolic, or fully absolute addressing.
You can create a data type, just like in TIA so you can address all the bits with meaningful symbols as described above.

*: Even if S7-300/400 can be programmed in both STEP7 Classic and TIA, you dont get the slice addressing in TIA. This only works with S7-1200/1500.
 

Similar Topics

See the screenshot of EIP tag list. We are trying to read in a digital input that is hard-wired. It is shown here as I31.1. I believe we cannot...
Replies
7
Views
278
I am currently using Micrologix 1100 connected to my pc using RSLinx Lite. I need to file data from Keyence IL series lasers using DL-EP1 module...
Replies
2
Views
1,263
Hello everyone... I need to enable a float value(Analog output) through a bit input. Kindly help me to do the same
Replies
1
Views
1,462
I am trying to use indexed addressing to store a long series of bits in a "file" via a bit shift left function in RSLogix 500. The file I want to...
Replies
8
Views
3,897
I have to check 1024 (sequential) bits for change of state in any of the bits and record which bit changed. I was going to do something like...
Replies
9
Views
4,475
Back
Top Bottom