Ifix access of a bit in a Dint

timmyh

Member
Join Date
Apr 2008
Location
St. Louis, MO
Posts
28
Hi everyone,

Sorry if I am a little vague but this question was ask to me by someone working on a system that I am not familiar with. Anyway the plc is a control logix and hmi software is ifix. They are using igs driver. How do you access one bit from a dint register? I know in fix32 you can use F_00 for a bit of an int. Is there anything similar in ifix. Sorry I dont have more info.
 
I'm not familiar with ifix, however, I'll try and answer the general "how to" of your question.

The status of any bit can be accessed by bitwise ANDing the word with a mask where only the desired bit is set.

For example,

IF (DINT_TAG & 8) Then Do whatever -> will do whatever if bit 3 is set.

IF (DINT_TAG & 536870912) Then Do whatever -> will do whatever if bit 29 is set.

To determine the value to bitwise AND to the DINT raise 2 to the power of the bit number. 2^3 is 8. 2^29 is 536870912

If DINT_TAG is signed in ifix then the 31st bit needs different treatment because bit 31 is the sign bit. Therfore (DINT_TAG & -2147483648) may be needed to check for bit 31.

I hope that helps.
 
Not true. The F_xx refers to the offset in an array.
So if you are referencing F_CV as ANALOG_ARRAY[0] then F_01 would reference ANALOG_ARRAY[1].
Unfortunately there is no easy way to do bit picking (masking) in IFIX. You have to use an equation similar to what I am doing here:
Fix32.XXXX.XX_HV-150-18_DEV_3_STAT.F_CV - ( 4096 * ( INT ( Fix32.XXXX.XX_HV-150-18_DEV_3_STAT.F_CV / 4096 ) ) ) >= 512
For me, this references bit 9 of the analog register.
Wonderware makes this easy...one of the many reasons why I prefer it over IFIX.
 
tagname.1 or tagname[0].1 if an array of dints.
If I was at my machine I could tell you precisely, I do it all the time. I use Kepware but IGS is very similar.
There is some wierdness in kepware wherein tags that are static force you to use a slash instead of a dot. i.e. tagname/1 (as I recall)
 
So how would that look like in a expression, Node.TagName.F_CV.0 because when I put it like that and go to runtime Ifix notifies me that the tag doesn´t exist
 
I know it seems counter-intuitive, but if you are trying to bit pick from a DINT, you need to create a data type DR for the analog register in order to use F_XX.
If you have an analog array and try to use F_XX, you will be accessing member XX of the array. For example DINT[3] would be F_03 of that analog array.
Try using the DR data type and you'll be fine.
 
AI tag can't address a bit, only an entire register. Use DI, DO or DR for this. I almost always use DI and turn the output on or off if needed. But opinions differ.

I address these bits in the iFix Database one of 2 ways:

If I have an array of bools in the PLC I address the 12th bit in brackets.
i.e. Line1.PLC131.MaintenanceBits[12]

If I have them in a DINT in the PLC I use bracket and decimal. i.e. Line1.PLC131.MaintenanceBits[0].12
 
AI tag can't address a bit, only an entire register. Use DI, DO or DR for this. I almost always use DI and turn the output on or off if needed. But opinions differ.

I address these bits in the iFix Database one of 2 ways:

If I have an array of bools in the PLC I address the 12th bit in brackets.
i.e. Line1.PLC131.MaintenanceBits[12]

If I have them in a DINT in the PLC I use bracket and decimal. i.e. Line1.PLC131.MaintenanceBits[0].12

Yes, but he is talking about bit-picking a DINT. So rather than creating 32 tags for 32 bits, you create one tag, and use F_XX in workspace to reference each of the 32 bits.
 
So am I but I'm just picking it from the PLC instead of the iFix DB.

Your suggestion would certainly optimize the comm traffic (Which IGS attempts to take care of for you) but make it a little more difficult to troubleshoot.

When comms are fast enough, I prefer to pull 32 bits with their own tagnames. But if you are counting tags for licensing then DR is the way to go.
 
So am I but I'm just picking it from the PLC instead of the iFix DB.

Your suggestion would certainly optimize the comm traffic (Which IGS attempts to take care of for you) but make it a little more difficult to troubleshoot.

When comms are fast enough, I prefer to pull 32 bits with their own tagnames. But if you are counting tags for licensing then DR is the way to go.

I personally prefer to bitpick because I have not encountered a situation where it over-complicated the setup. In fact, it helps keep the number of tags to a minimum. Great for throughput and tag limits.
 

Similar Topics

Hi, I'm trying to get iFix 5.8 to access DINT and INT array elements from a ControlLogix. My tag: test_dint Data Type: DINT Array Length: 100...
Replies
6
Views
3,121
Define a technical solution to generate an iFix database that will allow customer to capture A&E data A customer want to use an OPC based program...
Replies
1
Views
2,014
hi all I would like to make a daily report on ifix SCADA. My need is to make a report inside a folder with current date and time using MS Access...
Replies
2
Views
1,433
You help me with instructions. I'm not into sports in particular Ifix intelution 3.5 like this: I do not know how to write code to automatically...
Replies
0
Views
2,383
Dear all, I am beginer in ifix hmi programming. I have 2 ifix 6.0 pc with license FiX and client.. Can some one tell me how to configure sample...
Replies
0
Views
114
Back
Top Bottom